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.


DomainInfo mirheo::createDomainInfo(MPI_Comm cartComm, real3 globalSize)

Construct a DomainInfo.

The DomainInfo
  • cartComm: A cartesian MPI communicator of the simulation
  • globalSize: 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.

The position x expressed in global coordinates
  • x: The local coordinates in the current subdomain

real3 global2local(real3 x) const

Convert global coordinates to local coordinates.

The position x expressed in local coordinates
  • x: The global coordinates in the simulation domain

template <typename RealType3>
bool inSubDomain(RealType3 xg) const

Checks if the global coordinates xg are inside the current subdomain.

true if xg is inside the current subdomain, false otherwise
  • xg: The global coordinates in the simulation domain

Public Members

real3 globalSize

Size of the whole simulation domain.

real3 globalStart

coordinates of the lower corner of the local domain, in global coordinates

real3 localSize

size of the sub domain in the current rank.