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

Information about the thick spherical shell mesh. More...

#include <spherical_shell.hpp>

Public Member Functions

 DomainInfo ()=default
 
 DomainInfo (int diamond_lateral_refinement_level, const std::vector< double > &radii)
 Constructs a thick spherical shell with one subdomain per diamond (10 subdomains total) and shells at specific radii.
 
 DomainInfo (int diamond_lateral_refinement_level, const std::vector< double > &radii, int num_subdomains_in_lateral_direction, int num_subdomains_in_radial_direction)
 Constructs a thick spherical shell with shells at specific radii.
 
int subdomain_max_refinement_level () const
 The "maximum refinement level" of the subdomains.
 
int diamond_lateral_refinement_level () const
 
const std::vector< double > & radii () const
 
int num_subdomains_per_diamond_side () const
 
int num_subdomains_in_radial_direction () const
 
int subdomain_num_nodes_per_side_laterally () const
 Equivalent to calling subdomain_num_nodes_per_side_laterally( subdomain_refinement_level() )
 
int subdomain_num_nodes_radially () const
 Equivalent to calling subdomain_num_nodes_radially( subdomain_refinement_level() )
 
int subdomain_num_nodes_per_side_laterally (const int level) const
 Number of nodes in the lateral direction of a subdomain on the passed level.
 
int subdomain_num_nodes_radially (const int level) const
 Number of nodes in the radial direction of a subdomain on the passed level.
 
std::vector< SubdomainInfolocal_subdomains (const SubdomainToRankDistributionFunction &subdomain_to_rank) const
 

Detailed Description

Information about the thick spherical shell mesh.

Note
If you want to create a domain for an application, use the DistributedDomain class, which constructs an instance of this class internally.

General information

The thick spherical shell is built from ten spherical diamonds. The diamonds are essentially curved hexahedra. The number of cells in lateral directions is required to be a power of 2, the number of cells in the radial direction can be chosen arbitrarily (though a power of two allows for maximally deep multigrid hierarchies).

Each diamond can be subdivided into subdomains (in all three directions) for better parallel distribution (each process can only operate on one or more entire subdomains).

This class holds data such as

  • the shell radii,
  • the number of subdomains in each direction (on each diamond),
  • the number of nodes per subdomain in each direction (including overlapping nodes where two or more subdomains meet).

Note that all subdomains always have the same shape.

Multigrid and coarsening

Since the global number of cells in a diamond in lateral and radial direction does not need to match, and since the number of cells in radial direction does not even need to be a power of two (although it is a good idea to choose it that way), this class computes the maximum number of coarsening steps (which is equivalent to the number of "refinement levels") dynamically. Thus, a bad choice for the number of radial layers may result in a mesh that cannot be coarsened at all.

Parallel distribution

This class has no notion of parallel distribution. For that refer to the DistributedDomain class.

Constructor & Destructor Documentation

◆ DomainInfo() [1/3]

terra::grid::shell::DomainInfo::DomainInfo ( )
default

◆ DomainInfo() [2/3]

terra::grid::shell::DomainInfo::DomainInfo ( int  diamond_lateral_refinement_level,
const std::vector< double > &  radii 
)
inline

Constructs a thick spherical shell with one subdomain per diamond (10 subdomains total) and shells at specific radii.

Note
Use uniform_shell_radii() to quickly construct a uniform list of radii.

Note: a 'shell' is a spherical 2D manifold in 3D space (it is thin), a 'layer' is defined as the volume between two 'shells' (it is thick)

Parameters
diamond_lateral_refinement_levelnumber of lateral diamond refinements
radiilist of shell radii, vector must have at least 2 elements

◆ DomainInfo() [3/3]

terra::grid::shell::DomainInfo::DomainInfo ( int  diamond_lateral_refinement_level,
const std::vector< double > &  radii,
int  num_subdomains_in_lateral_direction,
int  num_subdomains_in_radial_direction 
)
inline

Constructs a thick spherical shell with shells at specific radii.

Note
Use uniform_shell_radii() to quickly construct a uniform list of radii.

Note: a 'shell' is a spherical 2D manifold in 3D space (it is thin), a 'layer' is defined as the volume between two 'shells' (it is thick)

Parameters
diamond_lateral_refinement_levelnumber of lateral diamond refinements
radiilist of shell radii, vector must have at least 2 elements
num_subdomains_in_lateral_directionnumber of subdomains in lateral direction per diamond
num_subdomains_in_radial_directionnumber of subdomains in radial direction per diamond

Member Function Documentation

◆ diamond_lateral_refinement_level()

int terra::grid::shell::DomainInfo::diamond_lateral_refinement_level ( ) const
inline

◆ local_subdomains()

std::vector< SubdomainInfo > terra::grid::shell::DomainInfo::local_subdomains ( const SubdomainToRankDistributionFunction subdomain_to_rank) const
inline

◆ num_subdomains_in_radial_direction()

int terra::grid::shell::DomainInfo::num_subdomains_in_radial_direction ( ) const
inline

◆ num_subdomains_per_diamond_side()

int terra::grid::shell::DomainInfo::num_subdomains_per_diamond_side ( ) const
inline

◆ radii()

const std::vector< double > & terra::grid::shell::DomainInfo::radii ( ) const
inline

◆ subdomain_max_refinement_level()

int terra::grid::shell::DomainInfo::subdomain_max_refinement_level ( ) const
inline

The "maximum refinement level" of the subdomains.

This (non-negative) number is essentially indicating how many times a subdomain can be uniformly coarsened.

◆ subdomain_num_nodes_per_side_laterally() [1/2]

int terra::grid::shell::DomainInfo::subdomain_num_nodes_per_side_laterally ( ) const
inline

Equivalent to calling subdomain_num_nodes_per_side_laterally( subdomain_refinement_level() )

◆ subdomain_num_nodes_per_side_laterally() [2/2]

int terra::grid::shell::DomainInfo::subdomain_num_nodes_per_side_laterally ( const int  level) const
inline

Number of nodes in the lateral direction of a subdomain on the passed level.

The level must be non-negative. The finest level is given by subdomain_max_refinement_level().

◆ subdomain_num_nodes_radially() [1/2]

int terra::grid::shell::DomainInfo::subdomain_num_nodes_radially ( ) const
inline

Equivalent to calling subdomain_num_nodes_radially( subdomain_refinement_level() )

◆ subdomain_num_nodes_radially() [2/2]

int terra::grid::shell::DomainInfo::subdomain_num_nodes_radially ( const int  level) const
inline

Number of nodes in the radial direction of a subdomain on the passed level.

The level must be non-negative. The finest level is given by subdomain_max_refinement_level().


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