Fluid structure interaction suite
LAC::BlockInitializer Class Reference

General class, used to initialize different types of block vectors, block atrices and block sparsity patterns using a common interface. More...

#include <lac_initializer.h>

Public Member Functions

 BlockInitializer (const std::vector< types::global_dof_index > &dofs_per_block, const std::vector< IndexSet > &owned, const std::vector< IndexSet > &relevant, const MPI_Comm &comm=MPI_COMM_WORLD)
 
void operator() (LATrilinos::BlockVector &v, bool fast=false)
 Initialize a non ghosted TrilinosWrappers::MPI::BlockVector. More...
 
void ghosted (LATrilinos::BlockVector &v, bool fast=false)
 Initialize a ghosted TrilinosWrappers::MPI::BlockVector. More...
 
void operator() (LAPETSc::BlockVector &v, bool fast=false)
 Initialize a non ghosted TrilinosWrappers::MPI::BlockVector. More...
 
void ghosted (LAPETSc::BlockVector &v, bool fast=false)
 Initialize a ghosted TrilinosWrappers::MPI::BlockVector. More...
 
void operator() (LABlockVector &v, bool fast=false)
 Initialize a serial BlockVector<double>. More...
 
void ghosted (LABlockVector &v, bool fast=false)
 Initiale a ghosted BlockVector<double>. More...
 
template<int dim, int spacedim>
void operator() (TrilinosWrappers::BlockSparsityPattern &s, const DoFHandler< dim, spacedim > &dh, const AffineConstraints< double > &cm, const Table< 2, DoFTools::Coupling > &coupling)
 Initialize a Trilinos Sparsity Pattern. More...
 
template<int dim, int spacedim>
void operator() (BlockSparsityPattern &s, const DoFHandler< dim, spacedim > &dh, const AffineConstraints< double > &cm, const Table< 2, DoFTools::Coupling > &coupling)
 Initialize a Deal.II Sparsity Pattern. More...
 
void operator() (const LABlockSparsityPattern &sparsity, LABlockSparseMatrix &matrix)
 Initialize a deal.II matrix. More...
 
void operator() (const LATrilinos::BlockSparsityPattern &sparsity, LATrilinos::BlockSparseMatrix &matrix)
 Initialize a Trilinos matrix. More...
 
void operator() (const LAPETSc::BlockSparsityPattern &, LAPETSc::BlockSparseMatrix &matrix)
 Initialize a PETSc matrix. More...
 

Private Attributes

std::unique_ptr< BlockDynamicSparsityPatterndsp
 The dynamic sparisty pattern. More...
 
const std::vector< types::global_dof_index > & dofs_per_block
 Dofs per block. More...
 
const std::vector< IndexSet > & owned
 Owned dofs per block. More...
 
const std::vector< IndexSet > & relevant
 Relevant dofs per block. More...
 
const MPI_Comm & comm
 MPI Communicator. More...
 

Detailed Description

General class, used to initialize different types of block vectors, block atrices and block sparsity patterns using a common interface.

Definition at line 30 of file lac_initializer.h.

Constructor & Destructor Documentation

◆ BlockInitializer()

LAC::BlockInitializer::BlockInitializer ( const std::vector< types::global_dof_index > &  dofs_per_block,
const std::vector< IndexSet > &  owned,
const std::vector< IndexSet > &  relevant,
const MPI_Comm &  comm = MPI_COMM_WORLD 
)
inline

Definition at line 33 of file lac_initializer.h.

Member Function Documentation

◆ operator()() [1/8]

void LAC::BlockInitializer::operator() ( LATrilinos::BlockVector v,
bool  fast = false 
)
inline

Initialize a non ghosted TrilinosWrappers::MPI::BlockVector.

Definition at line 47 of file lac_initializer.h.

References comm, owned, and TrilinosWrappers::MPI::BlockVector::reinit().

◆ ghosted() [1/3]

void LAC::BlockInitializer::ghosted ( LATrilinos::BlockVector v,
bool  fast = false 
)
inline

Initialize a ghosted TrilinosWrappers::MPI::BlockVector.

Definition at line 57 of file lac_initializer.h.

References comm, owned, TrilinosWrappers::MPI::BlockVector::reinit(), and relevant.

◆ operator()() [2/8]

void LAC::BlockInitializer::operator() ( LAPETSc::BlockVector v,
bool  fast = false 
)
inline

Initialize a non ghosted TrilinosWrappers::MPI::BlockVector.

Definition at line 66 of file lac_initializer.h.

References comm, owned, and PETScWrappers::MPI::BlockVector::reinit().

◆ ghosted() [2/3]

void LAC::BlockInitializer::ghosted ( LAPETSc::BlockVector v,
bool  fast = false 
)
inline

Initialize a ghosted TrilinosWrappers::MPI::BlockVector.

Definition at line 77 of file lac_initializer.h.

References comm, owned, PETScWrappers::MPI::BlockVector::reinit(), and relevant.

◆ operator()() [3/8]

void LAC::BlockInitializer::operator() ( LABlockVector &  v,
bool  fast = false 
)
inline

Initialize a serial BlockVector<double>.

Definition at line 87 of file lac_initializer.h.

References dofs_per_block.

◆ ghosted() [3/3]

void LAC::BlockInitializer::ghosted ( LABlockVector &  v,
bool  fast = false 
)
inline

Initiale a ghosted BlockVector<double>.

Same as above.

Definition at line 97 of file lac_initializer.h.

References dofs_per_block.

◆ operator()() [4/8]

template<int dim, int spacedim>
void LAC::BlockInitializer::operator() ( TrilinosWrappers::BlockSparsityPattern s,
const DoFHandler< dim, spacedim > &  dh,
const AffineConstraints< double > &  cm,
const Table< 2, DoFTools::Coupling > &  coupling 
)
inline

◆ operator()() [5/8]

template<int dim, int spacedim>
void LAC::BlockInitializer::operator() ( BlockSparsityPattern s,
const DoFHandler< dim, spacedim > &  dh,
const AffineConstraints< double > &  cm,
const Table< 2, DoFTools::Coupling > &  coupling 
)
inline

Initialize a Deal.II Sparsity Pattern.

Definition at line 128 of file lac_initializer.h.

References BlockSparsityPattern::copy_from(), dofs_per_block, dsp, and DoFTools::make_sparsity_pattern().

◆ operator()() [6/8]

void LAC::BlockInitializer::operator() ( const LABlockSparsityPattern &  sparsity,
LABlockSparseMatrix &  matrix 
)
inline

Initialize a deal.II matrix.

Definition at line 146 of file lac_initializer.h.

◆ operator()() [7/8]

void LAC::BlockInitializer::operator() ( const LATrilinos::BlockSparsityPattern sparsity,
LATrilinos::BlockSparseMatrix matrix 
)
inline

Initialize a Trilinos matrix.

Definition at line 157 of file lac_initializer.h.

◆ operator()() [8/8]

void LAC::BlockInitializer::operator() ( const LAPETSc::BlockSparsityPattern ,
LAPETSc::BlockSparseMatrix matrix 
)
inline

Initialize a PETSc matrix.

Definition at line 169 of file lac_initializer.h.

References Assert, comm, dsp, StandardExceptions::ExcNotInitialized(), and owned.

Member Data Documentation

◆ dsp

std::unique_ptr<BlockDynamicSparsityPattern> LAC::BlockInitializer::dsp
private

The dynamic sparisty pattern.

Definition at line 181 of file lac_initializer.h.

Referenced by operator()().

◆ dofs_per_block

const std::vector<types::global_dof_index>& LAC::BlockInitializer::dofs_per_block
private

Dofs per block.

Definition at line 186 of file lac_initializer.h.

Referenced by ghosted(), and operator()().

◆ owned

const std::vector<IndexSet>& LAC::BlockInitializer::owned
private

Owned dofs per block.

Definition at line 191 of file lac_initializer.h.

Referenced by ghosted(), and operator()().

◆ relevant

const std::vector<IndexSet>& LAC::BlockInitializer::relevant
private

Relevant dofs per block.

Definition at line 196 of file lac_initializer.h.

Referenced by ghosted(), and operator()().

◆ comm

const MPI_Comm& LAC::BlockInitializer::comm
private

MPI Communicator.

Definition at line 201 of file lac_initializer.h.

Referenced by ghosted(), and operator()().


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