PLaSK library
|
Boundaries represent some conditions which allow to choose a subset of points (strictly: indexes of points) from mesh. Boundaries are typically used by solvers to show points for boundaries conditions.
Boundaries are specific for given type of mesh. Class MeshType::Boundary (which in most cases is same as Boundary<MeshType>) stores boundary for mesh of type MeshType
. It has get
method which return BoundaryNodeSet instance for mesh given as parameter. BoundaryNodeSet represent a set of points (indexes of points in given mesh) and allow for:
Typically, you should call MeshType
static methods to obtain value for Boundary<MeshType>.
Example:
Solvers hold boundary conditions which are pairs of: boundary (described by plask::Boundary) and condidion (description depends from type of condition, can be solver specific). Class plask::BoundaryConditions is container template of such pairs (it depends from both types: mesh and condition). So, typically, solvers have one or more public fields of type BoundaryConditions<MeshType, ConditionType>. User of solver can call this fields methods to add boundary condition, and solver can iterate over this boundary conditions.
See also Writing solvers in depth.
Instance of BoundaryNodeSet in fact is only a holder which contains pointer to abstract class plask::BoundaryNodeSetImpl. It points to subclass of plask::BoundaryNodeSetImpl which implements all boundary logic (all calls of BoundaryNodeSet methods are delegete to it).
So, writing new boundary for given type of mesh MeshType
is writing subclass of plask::BoundaryNodeSetImpl.
PLaSK contains some universal BoundaryNodeSet implementations: