ThunderEgg  1.0.0
ThunderEgg::P4estDomainGenerator Class Reference

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

#include <P4estDomainGenerator.h>

Inheritance diagram for ThunderEgg::P4estDomainGenerator:
Collaboration diagram for ThunderEgg::P4estDomainGenerator:

Public Types

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

Public Member Functions

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

Detailed Description

Generates Domain objects form a given p4est object.

Member Typedef Documentation

◆ BlockMapFunc

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

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
xthe resulting x coordinate of the mapping function
ythe resulting y coordinate of the mapping function

Constructor & Destructor Documentation

◆ P4estDomainGenerator()

ThunderEgg::P4estDomainGenerator::P4estDomainGenerator ( p4est_t *  p4est,
const std::array< int, 2 > &  ns,
int  num_ghost_cells,
const BlockMapFunc bmf 
)

Construct a new P4estDomainGenerator object.

Parameters
p4estthe p4est 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: