Domain¶
In Mirheo, the simulation domain has a rectangular shape subdivided in equal subdomains.
Each simulation rank is mapped to a single subdomain in a cartesian way.
Furthermore, we distinguish the global coordinates (that are the same for all ranks) from the local coordinates (different from one subdomain to another).
The mirheo::DomainInfo utility class provides a description of the domain, subdomain and a mapping between the coordinates of these two entities.
API¶
-
DomainInfo
mirheo::createDomainInfo(MPI_Comm cartComm, real3 globalSize)¶ Construct a DomainInfo.
- Return
- The DomainInfo
- Parameters
cartComm: A cartesian MPI communicator of the simulationglobalSize: The size of the whole simulation domain
-
struct
DomainInfo¶ Describes the simulation global and local domains, with a mapping between the two.
The simulation domain is a rectangular box. It is splitted into smaller rectangles, one by simulation rank. Each of these subdomains have a local system of coordinates, centered at the center of these rectangular boxes. The global system of coordinate has the lowest corner of the domain at (0,0,0).
Public Functions
-
real3
local2global(real3 x) const¶ Convert local coordinates to global coordinates.
- Return
- The position
xexpressed in global coordinates - Parameters
x: The local coordinates in the current subdomain
-
real3
global2local(real3 x) const¶ Convert global coordinates to local coordinates.
- Return
- The position
xexpressed in local coordinates - Parameters
x: The global coordinates in the simulation domain
-
template <typename RealType3>
boolinSubDomain(RealType3 xg) const¶ Checks if the global coordinates
xgare inside the current subdomain.- Return
trueifxgis inside the current subdomain,falseotherwise- Parameters
xg: The global coordinates in the simulation domain
-
real3