G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsIetiMapper< T > Class Template Reference

Detailed Description

template<typename T>
class gismo::gsIetiMapper< T >

Ieti Mapper.

Algorithms that help with assembling the matrices required for IETI-Solvers

This class is written to work with the expression assembler and with assemblers derived from gsAssembler. If applied to a system, it is expected that individual instances of this class are used for each of the variables.

The objects of this class are initialized using a global dof mapper and a vector that contains function values for the eliminated variables (usually for the Dirichlet boundary).

This class then allows to obtain the jump matrices (jumpMatrix), the patch-local dof mappers (dofMapperLocal) and the patch-local function values for the eliminated dofs (fixedPart). The member function initFeSpace allows to pass dof mapper and the function values for the eliminated dofs to a variable object of the gsExprAssembler.

Moreover, this class allows to construct the primal degrees of freedom, which are then handled by the class gsPrimalSystem.

Finally, the member constructGlobalSolutionFromLocalSolutions allows the combination of the patch-local solutions to a global one.

+ Collaboration diagram for gsIetiMapper< T >:

Public Member Functions

void computeJumpMatrices (bool fullyRedundant, bool excludeCorners)
 This function computes the jump matrices. More...
 
Matrix constructGlobalSolutionFromLocalSolutions (const std::vector< Matrix > &localContribs)
 Construct the global solution from a vector of patch-local ones.
 
void cornersAsPrimals ()
 Set up the corners as primal dofs.
 
void customPrimalConstraints (std::vector< std::pair< index_t, SparseVector > > data)
 With this function, the caller can register more primal constraints. More...
 
const gsDofMapperdofMapperGlobal () const
 The global dof mapper.
 
const gsDofMapperdofMapperLocal (index_t k) const
 The dof mapper for the given patch Only available after computeJumpMatrices has been called.
 
const MatrixfixedPart (index_t k) const
 The function values for the eliminated dofs on the given patch Only available after computeJumpMatrices has been called.
 
 gsIetiMapper ()
 Default constructor.
 
 gsIetiMapper (const gsMultiBasis< T > &multiBasis, gsDofMapper dofMapperGlobal, const Matrix &fixedPart)
 Create the ieti mapper. More...
 
void init (const gsMultiBasis< T > &multiBasis, gsDofMapper dofMapperGlobal, const Matrix &fixedPart)
 Init the ieti mapper after default construction. More...
 
void initFeSpace (typename gsExprAssembler< T >::space u, index_t k)
 Apply the required changes to a space object of the expression assembler. More...
 
void interfaceAveragesAsPrimals (const gsMultiPatch< T > &geo, short_t d)
 Set up interface averages as primal dofs. More...
 
const JumpMatrixjumpMatrix (index_t k) const
 Returns the jump matrix \( B_k \) for the given patch Only available after computeJumpMatrices has been called.
 
const gsMultiBasis< T > & multiBasis () const
 Reference to the multi basis object being passed to constructur or init.
 
index_t nLagrangeMultipliers ()
 Returns the number of Lagrange multipliers.
 
index_t nPrimalDofs () const
 Returns the size of the primal problem (number of primal dofs)
 
const std::vector< SparseVector > & primalConstraints (index_t k) const
 Returns the primalConstraints (as vectors) for the given patch. More...
 
const std::vector< index_t > & primalDofIndices (index_t k) const
 Returns the indices of the primal dofs that are associated to the primal constraints for the given patch.
 
std::vector< index_tskeletonDofs (index_t patch) const
 Returns a list of dofs that are (on the coarse level) coupled. More...
 

Private Types

typedef gsSparseMatrix< T,
RowMajor > 
JumpMatrix
 Sparse matrix type for jumps.
 
typedef gsMatrix< T > Matrix
 Matrix type.
 
typedef gsSparseVector< T > SparseVector
 Sparse matrix type.
 

Static Private Member Functions

static gsSparseVector< T > assembleAverage (const gsGeometry< T > &geo, const gsBasis< T > &basis, const gsDofMapper &dm, boxComponent bc)
 Assembles for interfaceAveragesAsPrimals.
 

Private Attributes

gsDofMapper m_dofMapperGlobal
 The global dof mapper.
 
std::vector< gsDofMapperm_dofMapperLocal
 A vector of the patch-local dof mappers.
 
std::vector< Matrixm_fixedPart
 The values for the elminated (Dirichlet) dofs.
 
std::vector< JumpMatrixm_jumpMatrices
 The jump matrices.
 
const gsMultiBasis< T > * m_multiBasis
 Pointer to the respective multibasis.
 
index_t m_nPrimalDofs
 The number of primal dofs already created.
 
std::vector< std::vector
< SparseVector > > 
m_primalConstraints
 The primal constraints.
 
std::vector< std::vector
< index_t > > 
m_primalDofIndices
 The primal dof indices for each of the primal constraints.
 
unsigned m_status
 A status flag that is checked by assertions.
 

Constructor & Destructor Documentation

gsIetiMapper ( const gsMultiBasis< T > &  multiBasis,
gsDofMapper  dofMapperGlobal,
const Matrix fixedPart 
)
inline

Create the ieti mapper.

Parameters
multiBasisThe corresponding gsMultiBasis
dofMapperGlobalThe dof mapper for the global problem
fixedPartThe function values for the eliminated dofs

The multibasis object has to outlive the ieti mapper.

Member Function Documentation

void computeJumpMatrices ( bool  fullyRedundant,
bool  excludeCorners 
)

This function computes the jump matrices.

Parameters
fullyRedundantCompute the jump matrices in a fullyRedundant way; if false, then no redundancy
excludeCornersIgnore corners for jump matrices. This makes sense if the corners are chosen as primal dofs
void customPrimalConstraints ( std::vector< std::pair< index_t, SparseVector > >  data)

With this function, the caller can register more primal constraints.

All primal constraints in the vector are considered to be one single primal dof. Each component of the vector contains a pair consisting of the patch index and the vector representing the primal constraint.

void init ( const gsMultiBasis< T > &  multiBasis,
gsDofMapper  dofMapperGlobal,
const Matrix fixedPart 
)

Init the ieti mapper after default construction.

Parameters
multiBasisThe corresponding gsMultiBasis
dofMapperGlobalThe dof mapper for the global problem
fixedPartThe function values for the eliminated dofs

Instances of the class can be reused using this member function.

void initFeSpace ( typename gsExprAssembler< T >::space  u,
index_t  k 
)
inline

Apply the required changes to a space object of the expression assembler.

It is assumed that the space object is fully functioning, i.e., the setup member has been called.

This function exposes the dofMapperLocal and the fixedPart to the space.

void interfaceAveragesAsPrimals ( const gsMultiPatch< T > &  geo,
short_t  d 
)

Set up interface averages as primal dofs.

Parameters
geogsMultiPatch object describing the geometry
dThe dimension of the interfaces to be considered: d=1 yields edge averages, d=2 yields face averages

Adds contributions only iff the interface (edge, face,...) belongs to at least two patches. This function also works if d=geo.dim(), i.e., for the patch averages. In this case, the requirement that it contributes to at least two patches does not apply. For corners, use cornersAsPrimals instead.

const std::vector<SparseVector>& primalConstraints ( index_t  k) const
inline

Returns the primalConstraints (as vectors) for the given patch.

These vectors form the matrix \( C_k \) in the local saddle point system, see gsPrimalSystem

std::vector< index_t > skeletonDofs ( index_t  patch) const

Returns a list of dofs that are (on the coarse level) coupled.

Parameters
patchNumber of the patch