Loading...
Searching...
No Matches
terra::grid::shell::SubdomainInfo Class Reference

(Sortable) Globally unique identifier for a single subdomain of a diamond. More...

#include <spherical_shell.hpp>

Public Member Functions

 SubdomainInfo ()
 Creates invalid ID.
 
 SubdomainInfo (int diamond_id, int subdomain_x, int subdomain_y, int subdomain_r)
 Creates unique subdomain ID.
 
 SubdomainInfo (const int64_t global_id)
 Read from encoded 64-bit integer.
 
int diamond_id () const
 Diamond that subdomain is part of.
 
int subdomain_x () const
 Subdomain index in lateral x-direction (local to the diamond).
 
int subdomain_y () const
 Subdomain index in lateral y-direction (local to the diamond).
 
int subdomain_r () const
 Subdomain index in the radial direction (local to the diamond).
 
bool operator< (const SubdomainInfo &other) const
 
bool operator== (const SubdomainInfo &other) const
 
int64_t global_id () const
 Scrambles the four indices (diamond ID, x, y, r) into a single integer.
 

Detailed Description

(Sortable) Globally unique identifier for a single subdomain of a diamond.

Carries the diamond ID, and the subdomain index (x, y, r) inside the diamond. Is globally unique (particularly useful for in parallel settings). Does not carry information about the refinement of a subdomain (just the index).

Constructor & Destructor Documentation

◆ SubdomainInfo() [1/3]

terra::grid::shell::SubdomainInfo::SubdomainInfo ( )
inline

Creates invalid ID.

◆ SubdomainInfo() [2/3]

terra::grid::shell::SubdomainInfo::SubdomainInfo ( int  diamond_id,
int  subdomain_x,
int  subdomain_y,
int  subdomain_r 
)
inline

Creates unique subdomain ID.

◆ SubdomainInfo() [3/3]

terra::grid::shell::SubdomainInfo::SubdomainInfo ( const int64_t  global_id)
inlineexplicit

Read from encoded 64-bit integer.

See global_id() for format.

Member Function Documentation

◆ diamond_id()

int terra::grid::shell::SubdomainInfo::diamond_id ( ) const
inline

Diamond that subdomain is part of.

◆ global_id()

int64_t terra::grid::shell::SubdomainInfo::global_id ( ) const
inline

Scrambles the four indices (diamond ID, x, y, r) into a single integer.

Format

bits (LSB) 0-18 (19 bits): subdomain_x
bits 19-37 (19 bits): subdomain_y
bits 38-56 (19 bits): subdomain_r
bits 57-63 (MSB) ( 7 bits): diamond_id (in [0, ..., 9])
int diamond_id() const
Diamond that subdomain is part of.
Definition spherical_shell.hpp:629
int subdomain_r() const
Subdomain index in the radial direction (local to the diamond).
Definition spherical_shell.hpp:638
int subdomain_x() const
Subdomain index in lateral x-direction (local to the diamond).
Definition spherical_shell.hpp:632
int subdomain_y() const
Subdomain index in lateral y-direction (local to the diamond).
Definition spherical_shell.hpp:635

◆ operator<()

bool terra::grid::shell::SubdomainInfo::operator< ( const SubdomainInfo other) const
inline

◆ operator==()

bool terra::grid::shell::SubdomainInfo::operator== ( const SubdomainInfo other) const
inline

◆ subdomain_r()

int terra::grid::shell::SubdomainInfo::subdomain_r ( ) const
inline

Subdomain index in the radial direction (local to the diamond).

◆ subdomain_x()

int terra::grid::shell::SubdomainInfo::subdomain_x ( ) const
inline

Subdomain index in lateral x-direction (local to the diamond).

◆ subdomain_y()

int terra::grid::shell::SubdomainInfo::subdomain_y ( ) const
inline

Subdomain index in lateral y-direction (local to the diamond).


The documentation for this class was generated from the following file: