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

Class LibMeshSystemVectors is a convenience class that manages access to libMesh vectors for the same system defined on multiple parts. This class only supports access to vectors ghosted with the Lagrangian partitioning (i.e., libMesh's computed partitioning). The subclass LibMeshSystemIBVectors provides access to the IB partitioning (i.e., the partitioning based on the distribution of SAMRAI data). More...

#include <ibtk/LibMeshSystemVectors.h>

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

Public Member Functions

 LibMeshSystemVectors (const std::vector< libMesh::EquationSystems * > &equation_systems, const std::vector< bool > &part_mask, std::string system_name)
 
 LibMeshSystemVectors (const std::vector< libMesh::EquationSystems * > &equation_systems, std::string system_name)
 
virtual ~LibMeshSystemVectors ()=default
 
libMesh::PetscVector< double > & get (const std::string &vec_name, const unsigned int part)
 
std::vector< libMesh::PetscVector< double > * > get (const std::string &vec_name)
 
virtual void reinit ()
 
void copy (const std::string &source, const std::vector< std::string > &dests)
 
void zero (const std::string &vec_name)
 

Protected Member Functions

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< 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

A libMesh::System stores vectors in two different ways: the solution and current_local_solution vectors are stored explicitly by the System object (see libMesh::System::solution and libMesh::System::current_local_solution). They are not accessible by libMesh::System::request_vector() and related functions. All other vectors (including the right-hand side) are stored inside a map and are accessible by request_vector(). IBTK::LibMeshSystemVectors::get(), for the sake of a uniform interface, is inconsistent with libMesh in this regard: the vector name "solution" refers to the solution vector (which is not stored in the map). The same is true for "current_local_solution". For convenience, this class also accepts "current" as an alias for "current_local_solution". All other vector names are stored in the libMesh::System vector map.

All vectors added to a libMesh::System by this class are ghosted (with ghost data computed by the System) and registered for projection (i.e., if the mesh changes, these vectors will be automatically updated).

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

Constructor & Destructor Documentation

◆ LibMeshSystemVectors() [1/2]

IBTK::LibMeshSystemVectors::LibMeshSystemVectors ( const std::vector< libMesh::EquationSystems * > &  equation_systems,
const std::vector< bool > &  part_mask,
std::string  system_name 
)

Constructor.

Parameters
[in]equation_systemslibMesh::EquationSystems objects for each part.
[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.

◆ LibMeshSystemVectors() [2/2]

IBTK::LibMeshSystemVectors::LibMeshSystemVectors ( const std::vector< libMesh::EquationSystems * > &  equation_systems,
std::string  system_name 
)

Constructor.

Parameters
[in]equation_systemslibMesh::EquationSystems objects for each part.
[in]system_nameName of the libMesh::System whose vectors we are accessing.

◆ ~LibMeshSystemVectors()

virtual IBTK::LibMeshSystemVectors::~LibMeshSystemVectors ( )
virtualdefault

Destructor. Made virtual to aid inheritance.

Member Function Documentation

◆ get() [1/2]

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

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)

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.

◆ reinit()

virtual void IBTK::LibMeshSystemVectors::reinit ( )
virtual

Reinitialize the object.

Reimplemented in IBTK::LibMeshSystemIBVectors.

◆ copy()

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

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)

Zero vectors owned by a libMesh::System.

◆ vec_stored_in_map()

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

◆ maybeAdd()

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

Member Data Documentation

◆ d_part_mask

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

◆ d_system_name

const std::string IBTK::LibMeshSystemVectors::d_system_name
protected

◆ d_systems

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

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