Class mgrid::BoundaryConditions
ClassList > mgrid > BoundaryConditions
Container for boundary conditions on all four edges of a domain. More...
#include <boundary_conditions.hpp>
Public Functions
| Type | Name |
|---|---|
| BoundaryConditions () = default |
|
| BoundaryConditions (const BoundaryConditions &) = default |
|
| BoundaryConditions (BoundaryConditions &&) = default |
|
| void | apply_default_conditions (int nx, int nz) Allocate edges and apply the default pattern: left/top = Neumann, right/bottom = Dirichlet. |
| void | apply_periodic (AxisKind kx, AxisKind kz, int nx, int nz) Set both edges of any axis whose kind is periodic toperiodicCondition , in place. Bounded axes are left untouched, so a non-periodic default pattern applied just before survives on the bounded edges. Does NOT resize: the caller must have sized the edges to(nx, nz) first (every call site does). Called byFDArray::resize and byStack::Stack for a periodic hierarchy. |
| Boundary & | get (BoundaryFlag f) Get mutable reference to a boundary edge. |
| const Boundary & | get (BoundaryFlag f) const Get const reference to a boundary edge. |
| BoundaryConditions & | operator= (const BoundaryConditions &) = default |
| BoundaryConditions & | operator= (BoundaryConditions &&) = default |
| void | resize (int nx, int nz) Allocate and zero-initialize all boundary edges. |
| void | set (BoundaryFlag f, const Boundary & values) Replace a boundary edge with new values. |
| void | set (BoundaryFlag f, const BoundaryPoint & point) Fill a boundary edge with a single point condition. |
| ~BoundaryConditions () = default |
Detailed Description
Holds boundary conditions indexed by BoundaryFlag (topBoundary, bottomBoundary, leftBoundary, rightBoundary). Top/bottom edges have nx points; left/right have nz points.
Public Functions Documentation
function BoundaryConditions [1/3]
mgrid::BoundaryConditions::BoundaryConditions () = default
function BoundaryConditions [2/3]
mgrid::BoundaryConditions::BoundaryConditions (
const BoundaryConditions &
) = default
function BoundaryConditions [3/3]
mgrid::BoundaryConditions::BoundaryConditions (
BoundaryConditions &&
) = default
function apply_default_conditions
Allocate edges and apply the default pattern: left/top = Neumann, right/bottom = Dirichlet.
void mgrid::BoundaryConditions::apply_default_conditions (
int nx,
int nz
)
Parameters:
nxWidth of domain.nzHeight of domain.
function apply_periodic
Set both edges of any axis whose kind is periodic toperiodicCondition , in place. Bounded axes are left untouched, so a non-periodic default pattern applied just before survives on the bounded edges. Does NOT resize: the caller must have sized the edges to(nx, nz) first (every call site does). Called byFDArray::resize and byStack::Stack for a periodic hierarchy.
void mgrid::BoundaryConditions::apply_periodic (
AxisKind kx,
AxisKind kz,
int nx,
int nz
)
Parameters:
kxKind of the x-axis (drives left/right edges).kzKind of the z-axis (drives top/bottom edges).nxWidth of domain; retained for call-site symmetry only.nzHeight of domain; retained for call-site symmetry only.
function get [1/2]
Get mutable reference to a boundary edge.
inline Boundary & mgrid::BoundaryConditions::get (
BoundaryFlag f
)
Parameters:
fThe boundary flag identifying which edge.
Returns:
Reference to the boundary vector.
function get [2/2]
Get const reference to a boundary edge.
inline const Boundary & mgrid::BoundaryConditions::get (
BoundaryFlag f
) const
Parameters:
fThe boundary flag identifying which edge.
Returns:
Const reference to the boundary vector.
function operator=
BoundaryConditions & mgrid::BoundaryConditions::operator= (
const BoundaryConditions &
) = default
function operator=
BoundaryConditions & mgrid::BoundaryConditions::operator= (
BoundaryConditions &&
) = default
function resize
Allocate and zero-initialize all boundary edges.
void mgrid::BoundaryConditions::resize (
int nx,
int nz
)
Parameters:
nxWidth of domain (size of top/bottom edges).nzHeight of domain (size of left/right edges).
function set [1/2]
Replace a boundary edge with new values.
void mgrid::BoundaryConditions::set (
BoundaryFlag f,
const Boundary & values
)
Parameters:
fThe boundary flag identifying which edge.valuesThe new boundary conditions.
Exception:
InvalidBoundaryConditionif values.size() does not match the current edge size.
function set [2/2]
Fill a boundary edge with a single point condition.
void mgrid::BoundaryConditions::set (
BoundaryFlag f,
const BoundaryPoint & point
)
Parameters:
fThe boundary flag identifying which edge.pointThe condition to replicate across all edge points.
function ~BoundaryConditions
mgrid::BoundaryConditions::~BoundaryConditions () = default
The documentation for this class was generated from the following file include/multigrid/boundary_conditions.hpp