G+Smo
24.08.0
Geometry + Simulation Modules
|
Struct which represents a certain component (interior, face, egde, corner).
This struct is a generalization of boxSide and of boxCorner.
Public Types | |
enum | location { interior, begin, end } |
Represents a location. More... | |
Public Member Functions | |
boxCorner | asCorner () const |
Converts to boxCorner and fails if the component is not a corner. | |
boxSide | asSide () const |
Converts to boxSide and fails if the component is not a side. | |
boxComponent (index_t b, short_t total_dim) | |
Constructor. More... | |
boxComponent (short_t total_dim) | |
Constructor creating boxComponent representing the interior. More... | |
boxComponent (boxSide b, short_t total_dim) | |
Constructor converting boxSide to a boxComponent. More... | |
boxComponent (boxCorner b, short_t total_dim) | |
Constructor converting boxCorner to a boxComponent. More... | |
std::vector< boxCorner > | containedCorners () const |
Returns a vector of all boxCorner s that are contained in the component. | |
std::vector< boxSide > | containingSides () const |
Returns a vector of all boxSide s that contain the component. | |
short_t | dim () const |
Dimension of the component. | |
index_t | index () const |
Returns the index. | |
location | locationForDirection (index_t direction) const |
boxComponent | opposite () const |
Returns the opposite boxCorner. | |
void | setLocationForDirection (index_t direction, location par) |
short_t | totalDim () const |
Dimension of the computational domain (the box itself) | |
Private Attributes | |
index_t | m_index |
The index defines the component. More... | |
short_t | m_total_dim |
The dimension of the box itself. | |
enum location |
|
inline |
Constructor.
b | The index that defines the component |
total_dim | The dimension of the box itself |
|
inline |
Constructor creating boxComponent representing the interior.
total_dim | The dimension of the box itself |
boxComponent | ( | boxSide | b, |
short_t | total_dim | ||
) |
Constructor converting boxSide to a boxComponent.
b | The box side |
total_dim | The dimension of the box itself |
boxComponent | ( | boxCorner | b, |
short_t | total_dim | ||
) |
Constructor converting boxCorner to a boxComponent.
b | The box corner |
total_dim | The dimension of the box itself |
boxComponent::location locationForDirection | ( | index_t | direction | ) | const |
Gets the location for the direction
If the result value is begin, then the component is characterized by \( x_i = 0 \) If the result value is end, then the component is characterized by \( x_i = 1 \) If the result value is begin, then the component is characterized by \( x_i \in (0,1) \)
direction | The index \( i \) from above |
void setLocationForDirection | ( | index_t | direction, |
boxComponent::location | par | ||
) |
Sets the location for the direction
See locationForDirection
direction | The index \( i \) from above |
par | See locationForDirection |
|
private |
The index defines the component.
If the index is written as trinary number with digits 0, 1, 2 each position names one of the spatial dimensions and values are: 0=interior, 1=begin, 2=end (cf location)
So, in 2D (m_total_dim=2), we have indeces [00]=0 to [22]=8
[00] = 0 ... interior [01] = 1 ... left edge [02] = 2 ... right edge [10] = 3 ... lower edge [20] = 6 ... upper edge [11] = 4 ... lower-left corner etc., where [ab]=3*a+b
In 3D (m_total_dim=3), we have indeces [000]=0 to [222]=26
[000] = 0 ... interior [001] = 1 ... west face [002] = 2 ... east face [010] = 3 ... south face [020] = 6 ... north face [100] = 9 ... front face [200] = 18 ... back face [011] = 4 ... south-west edge [222] = 26 ... back-north-east corner etc., where [abc]=9*a+3*b+c