|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
Handler for boundary conditions per spatial dimension. More...
#include <BCHandler.hpp>

Public Types | |
| enum | BCType { OPEN , PERIODIC , DIRICHLET } |
| Supported boundary condition types. More... | |
Public Member Functions | |
| BCHandler (const BCHandler &other)=default | |
| Defaulted copy constructor. | |
| template<typename... Bcs> | |
| BCHandler (Bcs... bcs) | |
Variadic constructor accepting exactly Dim BC values. | |
| bool | isAll (BCType bc_type) const |
Return true if every stored BC equals bc_type. | |
| bool | isAllEqual () const |
| Check whether all stored BCs are equal (all the same value). | |
| template<typename Field > | |
| ippl::BConds< Field, Dim > | toIPPLBConds () const |
Static Public Member Functions | |
| static BCType | strToBCType (const std::string &str) |
Convert a textual boundary-condition name to BCType enum. | |
Private Attributes | |
| std::array< BCType, Dim > | bcs_m |
| Internal storage of boundary conditions, one per dimension. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const BCHandler &h) |
| Stream output helper for debugging and logging. | |
Handler for boundary conditions per spatial dimension.
BCHandler<Dim> stores a boundary-condition type for each of the Dim dimensions. It offers simple construction, string-to-enum parsing, and some basic functionality used in the field container environment.
Usage examples:
BCHandler<3> b(BCHandler<3>::OPEN, BCHandler<3>::PERIODIC, BCHandler<3>::OPEN);FieldSolverCmd: BCH_t::strToBCType(Attributes::getString(itsAttr[FIELDSOLVER::BCFFTX]))| Dim | Number of spatial dimensions. |
Definition at line 29 of file BCHandler.hpp.
| enum BCHandler::BCType |
Supported boundary condition types.
OPEN: non-periodic/open boundary.PERIODIC: periodic boundary across the corresponding dimension.DIRICHLET: fixed potential (zero for now) at the boundary.DIRICHLET!). | Enumerator | |
|---|---|
| OPEN | |
| PERIODIC | |
| DIRICHLET | |
Definition at line 41 of file BCHandler.hpp.
|
default |
Defaulted copy constructor.
Variadic constructor accepting exactly Dim BC values.
Each argument should be convertible to BCType. The constructor validates that the number of provided BCs equals Dim and throws an OpalException otherwise.
| Bcs | Variadic parameter pack type. |
| bcs | Boundary condition values for each dimension. |
| OpalException | when the number of provided BCs != Dim. |
Definition at line 85 of file BCHandler.hpp.
Return true if every stored BC equals bc_type.
| bc_type | Boundary condition value to compare against. |
true if all dimensions have bc_type, otherwise false. Definition at line 98 of file BCHandler.hpp.
References Dim.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Check whether all stored BCs are equal (all the same value).
This function is necesary, since current IPPL does not support mixed BCs, so this consistency check validates user input.
true when every element in the internal array equals the first element. Definition at line 114 of file BCHandler.hpp.
References Dim.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestatic |
Convert a textual boundary-condition name to BCType enum.
Currently recognised strings are "OPEN", "PERIODIC", and "DIRICHLET". The strings come from the pre-defined strings in the FieldSolverCmd class. If these don't match, you might get an exception during current FieldSolver construction.
| str | Input string representing the boundary condition. |
BCType value. | OpalException | if the string does not match an implemented BC type. |
Definition at line 55 of file BCHandler.hpp.
References BCHandler< Dim >::DIRICHLET, BCHandler< Dim >::OPEN, and BCHandler< Dim >::PERIODIC.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Definition at line 179 of file BCHandler.hpp.
|
friend |
Stream output helper for debugging and logging.
Produces a compact, human-readable representation such as: * BCHandler<3>: [OPEN, PERIODIC, OPEN].
Definition at line 128 of file BCHandler.hpp.
Internal storage of boundary conditions, one per dimension.
Definition at line 202 of file BCHandler.hpp.