ThunderEgg  1.0.0
ThunderEgg::P8estDomainGenerator Class Reference

Generates Domain objects form a given p4est object. More...

#include <P8estDomainGenerator.h>

Inheritance diagram for ThunderEgg::P8estDomainGenerator:
Collaboration diagram for ThunderEgg::P8estDomainGenerator:

Public Types

using BlockMapFunc = std::function< void(int block_no, double unit_x, double unit_y, double unit_z, double &x, double &y, double &z)>
 Maps coordinate in a block to a coordinate in the domain. More...
 

Public Member Functions

 P8estDomainGenerator (p8est_t *p8est, const std::array< int, 3 > &ns, int num_ghost_cells, const BlockMapFunc &bmf)
 Construct a new P8estDomainGenerator object. More...
 
 P8estDomainGenerator (P8estDomainGenerator &)
 
 P8estDomainGenerator (P8estDomainGenerator &&)=default
 
P8estDomainGeneratoroperator= (const P8estDomainGenerator &)
 
P8estDomainGeneratoroperator= (P8estDomainGenerator &&)=default
 
Domain< 3 > getFinestDomain ()
 Return the finest domain.
 
bool hasCoarserDomain ()
 return true if there is a coarser domain to be generated.
 
Domain< 3 > getCoarserDomain ()
 Return a new coarser domain.
 
- Public Member Functions inherited from ThunderEgg::DomainGenerator< 3 >
virtual ~DomainGenerator ()
 Destroy the DomainGenerator object.
 

Detailed Description

Generates Domain objects form a given p4est object.

Member Typedef Documentation

◆ BlockMapFunc

using ThunderEgg::P8estDomainGenerator::BlockMapFunc = std::function<void(int block_no, double unit_x, double unit_y, double unit_z, double& x, double& y, double& z)>

Maps coordinate in a block to a coordinate in the domain.

Each block is treated as a unit square. The input wil be the block number and a coordinate withing that unit square.

Parameters
block_nothe block number
unit_xthe x coordinate in the block
unit_ythe y coordinate in the block
unit_zthe z coordinate in the block
xthe resulting x coordinate of the mapping function
ythe resulting y coordinate of the mapping function
zthe resulting z coordinate of the mapping function

Constructor & Destructor Documentation

◆ P8estDomainGenerator()

ThunderEgg::P8estDomainGenerator::P8estDomainGenerator ( p8est_t *  p8est,
const std::array< int, 3 > &  ns,
int  num_ghost_cells,
const BlockMapFunc bmf 
)

Construct a new P8estDomainGenerator object.

Parameters
p8estthe p8est object
nsthe number of cells in each direction
num_ghost_cellsthe number of ghost cells on each side of the patch
bmfthe function used to map the blocks to the domain

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