PLaSK library
Loading...
Searching...
No Matches
plask::BoundaryConditions< BoundaryT, ValueT > Struct Template Reference

Set of boundary conditions for given mesh type and boundary condition description type. More...

#include <plask/mesh/boundary_conditions.hpp>

Public Types

typedef BoundaryT Boundary
 Boundary type for a mesh of type MeshType.
 
typedef Boundary::MeshType MeshType
 type of mesh
 
typedef ValueT ValueType
 type which describes boundary condition
 
typedef BoundaryCondition< Boundary, ValueTypeElement
 One boundary-condition pair.
 
typedef elements_container_t::iterator iterator
 
typedef elements_container_t::const_iterator const_iterator
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
template<typename... ArgsTypes>
 BoundaryConditions (ArgsTypes &&... args)
 Delegate all constructors to underline container (which is std::list<Element>).
 
iterator getIteratorForIndex (std::size_t index)
 Get iterator to element with given index.
 
const_iterator getIteratorForIndex (std::size_t index) const
 Get iterator to element with given index.
 
Elementoperator[] (std::size_t index)
 Get reference to boundary condition with given index.
 
const Elementoperator[] (std::size_t index) const
 Get const reference to boundary condition with given index.
 
iterator add (Element &&element)
 Add new boundary condition to this (to end of elements list).
 
template<typename... ConditionArgumentsTypes>
iterator add (Boundary &&place, ConditionArgumentsTypes &&... value_args)
 Add new boundary condition to this (to end of elements list).
 
iterator insert (std::size_t index, Element &&element)
 Insert new boundary condition to this at specified position.
 
template<typename... ConditionArgumentsTypes>
iterator insert (std::size_t index, Boundary &&place, ConditionArgumentsTypes &&... value_args)
 Insert new boundary condition to this at specified position.
 
void clear ()
 Delete all boundary conditions from this set.
 
void erase (iterator to_erase)
 Remove the element point by to_erase from list.
 
void erase (iterator first, iterator last)
 Remove the elements in the range [first, last) from list.
 
void erase (std::size_t index)
 Remove the element with given index from list.
 
std::size_t size () const
 Get number of elements.
 
bool empty () const
 Check if this is empty.
 
BoundaryConditionsWithMesh< Boundary, ValueTypeget (const typename Boundary::MeshType &mesh, const shared_ptr< const GeometryD< MeshType::DIM > > &geometry) const
 Get BoundaryConditionsWithMesh<Boundary,ValueType>
 
BoundaryConditionsWithMesh< Boundary, ValueTypeget (const shared_ptr< const typename Boundary::MeshType > &mesh, const shared_ptr< const GeometryD< MeshType::DIM > > &geometry) const
 Get BoundaryConditionsWithMesh<Boundary,ValueType>
 
BoundaryConditionsWithMesh< Boundary, ValueTypeoperator() (const MeshType &mesh, const shared_ptr< const GeometryD< MeshType::DIM > > &geometry) const
 Get BoundaryConditionsWithMesh<Boundary,ValueType>
 
BoundaryConditionsWithMesh< Boundary, ValueTypeoperator() (const shared_ptr< const MeshType > &mesh, const shared_ptr< const GeometryD< MeshType::DIM > > &geometry) const
 Get BoundaryConditionsWithMesh<Boundary,ValueType>
 

Detailed Description

template<typename BoundaryT, typename ValueT>
struct plask::BoundaryConditions< BoundaryT, ValueT >

Set of boundary conditions for given mesh type and boundary condition description type.

Template Parameters
BoundaryTtype of boundary
ValueTtype which describe boundary condition Boundaries

Definition at line 197 of file boundary_conditions.hpp.

Member Typedef Documentation

◆ Boundary

Boundary type for a mesh of type MeshType.

Definition at line 199 of file boundary_conditions.hpp.

◆ const_iterator

typedef elements_container_t::const_iterator plask::BoundaryConditions< BoundaryT, ValueT >::const_iterator

Definition at line 212 of file boundary_conditions.hpp.

◆ Element

One boundary-condition pair.

Definition at line 204 of file boundary_conditions.hpp.

◆ iterator

typedef elements_container_t::iterator plask::BoundaryConditions< BoundaryT, ValueT >::iterator

Definition at line 211 of file boundary_conditions.hpp.

◆ MeshType

◆ ValueType

type which describes boundary condition

Definition at line 201 of file boundary_conditions.hpp.

Constructor & Destructor Documentation

◆ BoundaryConditions()

template<typename... ArgsTypes>
plask::BoundaryConditions< BoundaryT, ValueT >::BoundaryConditions ( ArgsTypes &&...  args)
inline

Delegate all constructors to underline container (which is std::list<Element>).

Parameters
argsarguments to delegate

Definition at line 231 of file boundary_conditions.hpp.

Member Function Documentation

◆ add() [1/2]

template<typename... ConditionArgumentsTypes>
iterator plask::BoundaryConditions< BoundaryT, ValueT >::add ( Boundary &&  place,
ConditionArgumentsTypes &&...  value_args 
)
inline

Add new boundary condition to this (to end of elements list).

It doesn't invalidate any iterators. It has constant time complexity.

Parameters
placeboundary
value_argsarguments for condition constructor, can be just one argument of ValueType to use copy/move-constructor
Returns
iterator to added element which allow to change or erase added element in future

Definition at line 308 of file boundary_conditions.hpp.

◆ add() [2/2]

Add new boundary condition to this (to end of elements list).

It doesn't invalidate any iterators. It has constant time complexity.

Parameters
elementboundary condition to add
Returns
iterator to added element which allow to change or erase added element in future

Definition at line 294 of file boundary_conditions.hpp.

◆ begin() [1/2]

Definition at line 214 of file boundary_conditions.hpp.

◆ begin() [2/2]

Definition at line 215 of file boundary_conditions.hpp.

◆ clear()

Delete all boundary conditions from this set.

Definition at line 344 of file boundary_conditions.hpp.

◆ empty()

bool plask::BoundaryConditions< BoundaryT, ValueT >::empty ( ) const
inline

Check if this is empty.

It has constant time complexity.

Returns
true only if this container contains no conditions boundaries

Definition at line 399 of file boundary_conditions.hpp.

◆ end() [1/2]

Definition at line 217 of file boundary_conditions.hpp.

◆ end() [2/2]

Definition at line 218 of file boundary_conditions.hpp.

◆ erase() [1/3]

void plask::BoundaryConditions< BoundaryT, ValueT >::erase ( iterator  first,
iterator  last 
)
inline

Remove the elements in the range [first, last) from list.

It doesn't invalidate any iterators from outside of deleted range. It has linear time complexity dependent on the length of the range.

Parameters
first,lastrange of elements to remove

Definition at line 364 of file boundary_conditions.hpp.

◆ erase() [2/3]

Remove the element point by to_erase from list.

It doesn't invalidate any iterators other than to_erase. It has constant time complexity.

Parameters
to_eraseiterator which show element to erase

Definition at line 354 of file boundary_conditions.hpp.

◆ erase() [3/3]

void plask::BoundaryConditions< BoundaryT, ValueT >::erase ( std::size_t  index)
inline

Remove the element with given index from list.

Do nothing if index is not valid.

It doesn't invalidate any iterators which not point to deleted element. It has linear time complexity.

Parameters
indexindex of element to remove

Definition at line 377 of file boundary_conditions.hpp.

◆ get() [1/2]

BoundaryConditionsWithMesh< Boundary, ValueType > plask::BoundaryConditions< BoundaryT, ValueT >::get ( const shared_ptr< const typename Boundary::MeshType > &  mesh,
const shared_ptr< const GeometryD< MeshType::DIM > > &  geometry 
) const
inline

Get BoundaryConditionsWithMesh<Boundary,ValueType>

Parameters
meshmesh
geometrygeometry at which the boundary conditions are defines

Definition at line 427 of file boundary_conditions.hpp.

◆ get() [2/2]

BoundaryConditionsWithMesh< Boundary, ValueType > plask::BoundaryConditions< BoundaryT, ValueT >::get ( const typename Boundary::MeshType mesh,
const shared_ptr< const GeometryD< MeshType::DIM > > &  geometry 
) const
inline

Get BoundaryConditionsWithMesh<Boundary,ValueType>

Parameters
meshmesh

Definition at line 407 of file boundary_conditions.hpp.

◆ getIteratorForIndex() [1/2]

iterator plask::BoundaryConditions< BoundaryT, ValueT >::getIteratorForIndex ( std::size_t  index)
inline

Get iterator to element with given index.

This method has linear time complexity.

Parameters
[in]indexindex of element
Returns
iterator to element with given index or end() if index is not valid

Definition at line 240 of file boundary_conditions.hpp.

◆ getIteratorForIndex() [2/2]

const_iterator plask::BoundaryConditions< BoundaryT, ValueT >::getIteratorForIndex ( std::size_t  index) const
inline

Get iterator to element with given index.

This method has linear time complexity.

Parameters
[in]indexindex of element
Returns
iterator to element with given index or end() if index is not valid

Definition at line 253 of file boundary_conditions.hpp.

◆ insert() [1/2]

template<typename... ConditionArgumentsTypes>
iterator plask::BoundaryConditions< BoundaryT, ValueT >::insert ( std::size_t  index,
Boundary &&  place,
ConditionArgumentsTypes &&...  value_args 
)
inline

Insert new boundary condition to this at specified position.

It doesn't invalidate any iterators. It has constant time complexity.

Parameters
indexinsert position
placeboundary
value_argsarguments for condition constructor, can be just one argument of ValueType to use copy/move-constructor
Returns
iterator to inserted element which allow to change or erase added element in future

Definition at line 337 of file boundary_conditions.hpp.

◆ insert() [2/2]

iterator plask::BoundaryConditions< BoundaryT, ValueT >::insert ( std::size_t  index,
Element &&  element 
)
inline

Insert new boundary condition to this at specified position.

It doesn't invalidate any iterators. It has constant time complexity.

Parameters
indexinsert position
elementboundary condition to add
Returns
iterator to inserted element which allow to change or erase added element in future

Definition at line 321 of file boundary_conditions.hpp.

◆ operator()() [1/2]

BoundaryConditionsWithMesh< Boundary, ValueType > plask::BoundaryConditions< BoundaryT, ValueT >::operator() ( const MeshType mesh,
const shared_ptr< const GeometryD< MeshType::DIM > > &  geometry 
) const
inline

Get BoundaryConditionsWithMesh<Boundary,ValueType>

Parameters
meshmesh
geometrygeometry at which the boundary conditions are defines

Definition at line 437 of file boundary_conditions.hpp.

◆ operator()() [2/2]

BoundaryConditionsWithMesh< Boundary, ValueType > plask::BoundaryConditions< BoundaryT, ValueT >::operator() ( const shared_ptr< const MeshType > &  mesh,
const shared_ptr< const GeometryD< MeshType::DIM > > &  geometry 
) const
inline

Get BoundaryConditionsWithMesh<Boundary,ValueType>

Parameters
meshmesh
geometrygeometry at which the boundary conditions are defines

Definition at line 447 of file boundary_conditions.hpp.

◆ operator[]() [1/2]

Element & plask::BoundaryConditions< BoundaryT, ValueT >::operator[] ( std::size_t  index)
inline

Get reference to boundary condition with given index.

This method has linear time complexity.

Parameters
indexindex of element
Returns
reference to boundary condition with given index
Exceptions
OutOfBoundsExceptionif index is not valid

Definition at line 267 of file boundary_conditions.hpp.

◆ operator[]() [2/2]

const Element & plask::BoundaryConditions< BoundaryT, ValueT >::operator[] ( std::size_t  index) const
inline

Get const reference to boundary condition with given index.

This method has linear time complexity.

Parameters
indexindex of element
Returns
const reference to boundary condition with given index
Exceptions
OutOfBoundsExceptionif index is not valid

Definition at line 281 of file boundary_conditions.hpp.

◆ size()

std::size_t plask::BoundaryConditions< BoundaryT, ValueT >::size ( ) const
inline

Get number of elements.

This method has linear time complexity.

Returns
number of elements

Definition at line 389 of file boundary_conditions.hpp.


The documentation for this struct was generated from the following file: