IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Public Member Functions | Protected Attributes | List of all members
IBTK::SecondaryHierarchy Class Reference

#include </home/runner/work/IBAMR/IBAMR/ibtk/include/ibtk/SecondaryHierarchy.h>

Public Member Functions

 SecondaryHierarchy (std::string name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > gridding_algorithm_db, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > load_balancer_db)
 
void reinit (int coarsest_patch_level_number, int finest_patch_level_number, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy)
 
void reinit (int coarsest_patch_level_number, int finest_patch_level_number, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, int workload_idx)
 
void transferPrimaryToSecondary (int level_number, int primary_data_idx, int secondary_data_idx, double data_time, SAMRAI::xfer::RefinePatchStrategy< NDIM > *patch_strategy=nullptr)
 
void transferSecondaryToPrimary (int level_number, int primary_data_idx, int secondary_data_idx, double data_time, SAMRAI::xfer::RefinePatchStrategy< NDIM > *patch_strategy=nullptr)
 
std::shared_ptr< IBTK::SAMRAIDataCachegetSAMRAIDataCache ()
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > getPrimaryHierarchy ()
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > getSecondaryHierarchy ()
 

Protected Attributes

std::string d_object_name
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > d_primary_hierarchy
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > d_secondary_hierarchy
 
int d_coarsest_patch_level_number = IBTK::invalid_level_number
 
int d_finest_patch_level_number = IBTK::invalid_level_number
 
std::unique_ptr< SAMRAI::mesh::StandardTagAndInitStrategy< NDIM > > d_tag_strategy
 
SAMRAI::tbox::Pointer< SAMRAI::mesh::TagAndInitializeStrategy< NDIM > > d_error_detector
 
SAMRAI::tbox::Pointer< SAMRAI::mesh::BoxGeneratorStrategy< NDIM > > d_box_generator
 
SAMRAI::tbox::Pointer< SAMRAI::mesh::LoadBalancer< NDIM > > d_load_balancer
 
SAMRAI::tbox::Pointer< SAMRAI::mesh::GriddingAlgorithm< NDIM > > d_gridding_algorithm
 
std::map< std::pair< int, std::pair< int, int > >, SAMRAI::tbox::Pointer< SAMRAI::xfer::RefineSchedule< NDIM > > > d_transfer_forward_schedules
 
std::map< std::pair< int, std::pair< int, int > >, SAMRAI::tbox::Pointer< SAMRAI::xfer::RefineSchedule< NDIM > > > d_transfer_backward_schedules
 
std::shared_ptr< IBTK::SAMRAIDataCached_eulerian_data_cache
 

Detailed Description

Class encapsulating the idea of a secondary hierarchy. In practice, this is an equivalent (same index space) hierarchy to a given PatchHierarchy, but is partitioned in parallel in a different way.

Constructor & Destructor Documentation

◆ SecondaryHierarchy()

IBTK::SecondaryHierarchy::SecondaryHierarchy ( std::string  name,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database gridding_algorithm_db,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database load_balancer_db 
)

Constructor - requires that the object be reinitialized. At the present time this object still requires manual setup of the various gridding classes.

Member Function Documentation

◆ getPrimaryHierarchy()

SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > IBTK::SecondaryHierarchy::getPrimaryHierarchy ( )

Get a copy of the pointer to the primary hierarchy.

◆ getSAMRAIDataCache()

std::shared_ptr< IBTK::SAMRAIDataCache > IBTK::SecondaryHierarchy::getSAMRAIDataCache ( )

Get a copy of the pointer to the secondary scratch object.

◆ getSecondaryHierarchy()

SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > IBTK::SecondaryHierarchy::getSecondaryHierarchy ( )

Get a copy of the pointer to the primary hierarchy.

◆ reinit() [1/2]

void IBTK::SecondaryHierarchy::reinit ( int  coarsest_patch_level_number,
int  finest_patch_level_number,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy 
)

Reinitialize the secondary hierarchy by performing a copy of the input hierarchy. This is useful during staggered initialization when we may not yet want to actually perform hierarchy-specific load balancing.

◆ reinit() [2/2]

void IBTK::SecondaryHierarchy::reinit ( int  coarsest_patch_level_number,
int  finest_patch_level_number,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy,
int  workload_idx 
)

Reinitialize the secondary hierarchy based on a new patch hierarchy.

◆ transferPrimaryToSecondary()

void IBTK::SecondaryHierarchy::transferPrimaryToSecondary ( int  level_number,
int  primary_data_idx,
int  secondary_data_idx,
double  data_time,
SAMRAI::xfer::RefinePatchStrategy< NDIM > *  patch_strategy = nullptr 
)

Transfer data from the primary hierarchy to the secondary hierarchy.

If needed, a SAMRAI::xfer::RefinePatchStrategy object can be provided for filling ghost data at physical boundaries.

◆ transferSecondaryToPrimary()

void IBTK::SecondaryHierarchy::transferSecondaryToPrimary ( int  level_number,
int  primary_data_idx,
int  secondary_data_idx,
double  data_time,
SAMRAI::xfer::RefinePatchStrategy< NDIM > *  patch_strategy = nullptr 
)

Transfer data from the secondary hierarchy to the primary hierarchy.

If needed, a SAMRAI::xfer::RefinePatchStrategy object can be provided for filling ghost data at physical boundaries.

Member Data Documentation

◆ d_box_generator

SAMRAI::tbox::Pointer<SAMRAI::mesh::BoxGeneratorStrategy<NDIM> > IBTK::SecondaryHierarchy::d_box_generator
protected

Box generator.

Note
this object has to be persistent since d_gridding_alg requires it: see the note for that member object.

◆ d_coarsest_patch_level_number

int IBTK::SecondaryHierarchy::d_coarsest_patch_level_number = IBTK::invalid_level_number
protected

Coarsest level on which there are patches with elements (i.e., patches which should be considered by this object).

◆ d_error_detector

SAMRAI::tbox::Pointer<SAMRAI::mesh::TagAndInitializeStrategy<NDIM> > IBTK::SecondaryHierarchy::d_error_detector
protected

Error detector.

Note
this object has to be persistent since d_gridding_alg requires it: see the note for that member object.

◆ d_eulerian_data_cache

std::shared_ptr<IBTK::SAMRAIDataCache> IBTK::SecondaryHierarchy::d_eulerian_data_cache
protected

Scratch index data object for the patch hierarchy managed by this class.

◆ d_finest_patch_level_number

int IBTK::SecondaryHierarchy::d_finest_patch_level_number = IBTK::invalid_level_number
protected

Finest level on which there are patches with elements (i.e., patches which should be considered by this object).

◆ d_gridding_algorithm

SAMRAI::tbox::Pointer<SAMRAI::mesh::GriddingAlgorithm<NDIM> > IBTK::SecondaryHierarchy::d_gridding_algorithm
protected

Gridding algorithm.

Note
this object has to be persistent because, due to a bug in SAMRAI, it is impossible to create a SAMRAI::mesh::GriddingAlgorithm object in a restarted simulation without a corresponding entry in the restart database.

◆ d_load_balancer

SAMRAI::tbox::Pointer<SAMRAI::mesh::LoadBalancer<NDIM> > IBTK::SecondaryHierarchy::d_load_balancer
protected

Load balancer.

Note
this object has to be persistent since d_scratch_gridding_alg requires it: see the note for that member object.

◆ d_object_name

std::string IBTK::SecondaryHierarchy::d_object_name
protected

Object name.

◆ d_primary_hierarchy

SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > IBTK::SecondaryHierarchy::d_primary_hierarchy
protected

Pointer to the primary patch hierarchy (i.e., the one not by this class).

◆ d_secondary_hierarchy

SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > IBTK::SecondaryHierarchy::d_secondary_hierarchy
protected

Pointer to the secondary patch hierarchy (i.e., the one managed by this class).

◆ d_tag_strategy

std::unique_ptr<SAMRAI::mesh::StandardTagAndInitStrategy<NDIM> > IBTK::SecondaryHierarchy::d_tag_strategy
protected

Tag strategy. Since this class does not have any notion of refinement or coarsening this object will simply tag cells in such a way that we end up with exactly the same refinement pattern on the secondary hierarchy as the primary hierarchy.

◆ d_transfer_backward_schedules

std::map<std::pair<int, std::pair<int, int> >, SAMRAI::tbox::Pointer<SAMRAI::xfer::RefineSchedule<NDIM> > > IBTK::SecondaryHierarchy::d_transfer_backward_schedules
protected

Refinement schedules for transferring data from the secondary hierarchy (i.e., the one managed by this object) to the primary hierarchy. The key type is the level number and a pair of indices (the primary and scratch, in that order).

Note
this function assumes that only data on the finest level needs to be transferred.

◆ d_transfer_forward_schedules

std::map<std::pair<int, std::pair<int, int> >, SAMRAI::tbox::Pointer<SAMRAI::xfer::RefineSchedule<NDIM> > > IBTK::SecondaryHierarchy::d_transfer_forward_schedules
protected

Refinement schedules for transferring data from the primary hierarchy to the secondary (i.e., this) hierarchy. The key type is the level number and a pair of indices (the primary and scratch, in that order).

Note
this function assumes that only data on the finest level needs to be transferred.

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