IBAMR  IBAMR version 0.19.
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
IBTK::LibMeshSystemIBVectors Class Reference

Class LibMeshSystemIBVectors is a convenience class that manages access to libMesh vectors for the same system defined on multiple parts. It extends the base class LibMeshSystemVectors to provide access to vectors ghosted with both the Lagrangian partitioning (i.e., libMesh's computed partitioning, as in the base class) as well as the IB partitioning (i.e., the partitioning based on the distribution of SAMRAI data). More...

#include <ibtk/LibMeshSystemIBVectors.h>

Inheritance diagram for IBTK::LibMeshSystemIBVectors:
Inheritance graph
[legend]

Public Member Functions

 LibMeshSystemIBVectors (const std::vector< IBTK::FEDataManager * > &fe_data_managers, std::string system_name)
 
 LibMeshSystemIBVectors (const std::vector< IBTK::FEDataManager * > &fe_data_managers, const std::vector< bool > &part_mask, std::string system_name)
 
libMesh::PetscVector< double > & getIBGhosted (const std::string &vec_name, const unsigned int part)
 
std::vector< libMesh::PetscVector< double > * > getIBGhosted (const std::string &vec_name)
 
void reinit () override
 
libMesh::PetscVector< double > & get (const std::string &vec_name, const unsigned int part)
 
std::vector< libMesh::PetscVector< double > * > get (const std::string &vec_name)
 
void copy (const std::string &source, const std::vector< std::string > &dests)
 
void zero (const std::string &vec_name)
 

Protected Member Functions

std::vector< std::unique_ptr< libMesh::PetscVector< double > > > & maybeAddIBGhosted (const std::string &vec_name)
 Add an IB ghosted vector. More...
 
void maybeAdd (const std::string &vec_name)
 Check if a vector exists and, if not, add it. More...
 

Static Protected Member Functions

static bool vec_stored_in_map (const std::string &vec_name)
 Returns false if a standard libMesh vector; otherwise returns true. More...
 

Protected Attributes

std::vector< IBTK::FEDataManager * > d_fe_data_managers
 Pointers to IBTK::FEDataManager objects. These are needed to get IB ghosted vectors. More...
 
std::map< std::string, std::vector< std::unique_ptr< libMesh::PetscVector< double > > > > d_ib_ghosted_vectors
 Previously computed IB ghosted vectors. More...
 
std::vector< boold_part_mask
 Mask indicating which parts actually have a system with the given name. More...
 
const std::string d_system_name
 Name of the system. More...
 
std::vector< libMesh::System * > d_systems
 libMesh::System objects. More...
 

Detailed Description

This class stores information that depends on SAMRAI's parallel partitioning: LibMeshSystemIBVectors::reinit() should be called after regridding to clear this data.

Note
This class is intended for internal use in IBAMR. It is used in IBFEMethod and IBFESurfaceMethod.

Constructor & Destructor Documentation

◆ LibMeshSystemIBVectors() [1/2]

IBTK::LibMeshSystemIBVectors::LibMeshSystemIBVectors ( const std::vector< IBTK::FEDataManager * > &  fe_data_managers,
std::string  system_name 
)

Constructor.

Parameters
[in]fe_data_managersIBTK::FEDataManager objects for each part. These are used to get libMesh vectors with ghost regions corresponding to the Eulerian partitioning.
[in]system_nameName of the libMesh::System whose vectors we are accessing.

◆ LibMeshSystemIBVectors() [2/2]

IBTK::LibMeshSystemIBVectors::LibMeshSystemIBVectors ( const std::vector< IBTK::FEDataManager * > &  fe_data_managers,
const std::vector< bool > &  part_mask,
std::string  system_name 
)

Constructor, taking a mask argument indicating which systems actually exist.

Parameters
[in]fe_data_managersIBTK::FEDataManager objects for each part. These are used to get libMesh vectors with ghost regions corresponding to the Eulerian partitioning.
[in]part_maskA vector indicating on which parts the given system actually exists (for example, only some parts have fluid sources)
[in]system_nameName of the libMesh::System whose vectors we are accessing.

Member Function Documentation

◆ getIBGhosted() [1/2]

libMesh::PetscVector<double>& IBTK::LibMeshSystemIBVectors::getIBGhosted ( const std::string &  vec_name,
const unsigned int  part 
)

Get an IB-ghosted vector for a specific part.

Parameters
[in]vec_nameName of the vector.
[in]partPart number.

◆ getIBGhosted() [2/2]

std::vector<libMesh::PetscVector<double>*> IBTK::LibMeshSystemIBVectors::getIBGhosted ( const std::string &  vec_name)

Get, for each part, the IB-ghosted vectors corresponding to the name vec_name These vectors are ghosted with values determined by IBTK::FEDataManager (i.e., based on SAMRAI's parallel partitioning).

Note
These vectors are managed by this object: the ghosted information will not be valid after a regrid.

◆ reinit()

void IBTK::LibMeshSystemIBVectors::reinit ( )
overridevirtual

Reinitialize the object. This method must be called after the Eulerian data is updated.

Reimplemented from IBTK::LibMeshSystemVectors.

◆ maybeAddIBGhosted()

std::vector<std::unique_ptr<libMesh::PetscVector<double> > >& IBTK::LibMeshSystemIBVectors::maybeAddIBGhosted ( const std::string &  vec_name)
protected

◆ get() [1/2]

libMesh::PetscVector<double>& IBTK::LibMeshSystemVectors::get ( const std::string &  vec_name,
const unsigned int  part 
)
inherited

Get a specific vector for a specific part. These vectors are managed by libMesh::System objects.

Parameters
[in]vec_nameName of the vector - see the note in the general class description for an explanation of the inconsistency of this term versus what libMesh expects.
[in]partPart number.

◆ get() [2/2]

std::vector<libMesh::PetscVector<double>*> IBTK::LibMeshSystemVectors::get ( const std::string &  vec_name)
inherited

Get, for each part, the vector corresponding to the name vec_name. These vectors are managed by libMesh::System objects.

Parameters
[in]vec_nameName of the vector - see the note in the general class description for an explanation of the inconsistency of this term versus what libMesh expects.

◆ copy()

void IBTK::LibMeshSystemVectors::copy ( const std::string &  source,
const std::vector< std::string > &  dests 
)
inherited

Convenience function for copying libMesh vectors.

Parameters
[in]sourceName of the input vectors. These should already be present in the libMesh::System.
[in]destsNames of the output vectors.

◆ zero()

void IBTK::LibMeshSystemVectors::zero ( const std::string &  vec_name)
inherited

Zero vectors owned by a libMesh::System.

◆ vec_stored_in_map()

static bool IBTK::LibMeshSystemVectors::vec_stored_in_map ( const std::string &  vec_name)
inlinestaticprotectedinherited

◆ maybeAdd()

void IBTK::LibMeshSystemVectors::maybeAdd ( const std::string &  vec_name)
protectedinherited

Member Data Documentation

◆ d_fe_data_managers

std::vector<IBTK::FEDataManager*> IBTK::LibMeshSystemIBVectors::d_fe_data_managers
protected

◆ d_ib_ghosted_vectors

std::map<std::string, std::vector<std::unique_ptr<libMesh::PetscVector<double> > > > IBTK::LibMeshSystemIBVectors::d_ib_ghosted_vectors
protected

◆ d_part_mask

std::vector<bool> IBTK::LibMeshSystemVectors::d_part_mask
protectedinherited

◆ d_system_name

const std::string IBTK::LibMeshSystemVectors::d_system_name
protectedinherited

◆ d_systems

std::vector<libMesh::System*> IBTK::LibMeshSystemVectors::d_systems
protectedinherited

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