G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
patchComponent Struct Reference

Detailed Description

Struct which represents a certain component (interior, face, egde, corner) of a particular patch.

This struct is a generalization of patchSide and of patchCorner.

+ Inheritance diagram for patchComponent:
+ Collaboration diagram for patchComponent:

Public Types

enum  location {
  interior ,
  begin ,
  end
}
 Represents a location. More...
 

Public Member Functions

patchCorner asCorner () const
 Converts to patchCorner and fails if the component is not a corner.
 
patchSide asSide () const
 Converts to patchSide and fails if the component is not a corner.
 
std::vector< patchCornercontainedCorners () const
 Returns a vector of all patchCorner s that are contained in the component.
 
std::vector< patchSidecontainingSides () const
 Returns a vector of all patchSide 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
 
patchComponent opposite () const
 Returns the opposite boxCorner.
 
index_t patch () const
 Returns the patch number.
 
 patchComponent (index_t p, boxComponent b)
 Constructor converting boxComponent to a patchComponent.
 
 patchComponent (index_t p, index_t b, short_t total_dim)
 Constructor.
 
 patchComponent (index_t p, short_t total_dim)
 Constructor creating patchComponent representing the interior.
 
 patchComponent (patchCorner p, short_t total_dim)
 Constructor converting patchCorner to a patchComponent.
 
 patchComponent (patchSide p, short_t total_dim)
 Constructor converting patchSide to a patchComponent.
 
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.
 
index_t m_patch
 The particular patch.
 
short_t m_total_dim
 The dimension of the box itself.
 

Member Enumeration Documentation

◆ location

enum location
inherited

Represents a location.

Enumerator
interior 

Represents the interior.

begin 

Represents the beginning.

end 

Represents the end.

Constructor & Destructor Documentation

◆ patchComponent() [1/5]

patchComponent ( index_t  p,
index_t  b,
short_t  total_dim 
)
inline

Constructor.

Parameters
pThe patch index
bThe index that defines the component
total_dimThe dimension of the box itself

◆ patchComponent() [2/5]

patchComponent ( index_t  p,
short_t  total_dim 
)
inline

Constructor creating patchComponent representing the interior.

Parameters
pThe patch index
total_dimThe dimension of the box itself

◆ patchComponent() [3/5]

patchComponent ( index_t  p,
boxComponent  b 
)
inline

Constructor converting boxComponent to a patchComponent.

Parameters
pThe patch index
bThe box component

◆ patchComponent() [4/5]

patchComponent ( patchSide  p,
short_t  total_dim 
)
inline

Constructor converting patchSide to a patchComponent.

Parameters
pThe patch side
total_dimThe dimension of the box itself

◆ patchComponent() [5/5]

patchComponent ( patchCorner  p,
short_t  total_dim 
)
inline

Constructor converting patchCorner to a patchComponent.

Parameters
pThe patch corner
total_dimThe dimension of the box itself

Member Function Documentation

◆ locationForDirection()

boxComponent::location locationForDirection ( index_t  direction) const
inherited

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) \)

Parameters
directionThe index \( i \) from above

◆ setLocationForDirection()

void setLocationForDirection ( index_t  direction,
boxComponent::location  par 
)
inherited

Sets the location for the direction

See locationForDirection

Parameters
directionThe index \( i \) from above
parSee locationForDirection

Member Data Documentation

◆ m_index

index_t m_index
privateinherited

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