G+Smo
25.01.0
Geometry + Simulation Modules
|
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.
Public Member Functions | |
void | computeJumpMatrices (bool fullyRedundant, bool excludeCorners) |
This function computes the jump matrices. | |
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. | |
const gsDofMapper & | dofMapperGlobal () const |
The global dof mapper. | |
const gsDofMapper & | dofMapperLocal (index_t k) const |
The dof mapper for the given patch Only available after computeJumpMatrices has been called. | |
const Matrix & | fixedPart (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. | |
Matrix | incorporateFixedPart (index_t k, const gsMatrix< T > &localSolution) const |
Incorporates fixedPart (eg. from eliminated Dirichlet dofs) to given patch-local solution. | |
void | init (const gsMultiBasis< T > &multiBasis, gsDofMapper dofMapperGlobal, const Matrix &fixedPart) |
Init the ieti mapper after default construction. | |
void | initFeSpace (typename gsExprAssembler< T >::space u, index_t k) |
Apply the required changes to a space object of the expression assembler. | |
void | interfaceAveragesAsPrimals (const gsMultiPatch< T > &geo, short_t d) |
Set up interface averages as primal dofs. | |
const JumpMatrix & | jumpMatrix (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. | |
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_t > | skeletonDofs (index_t patch) const |
Returns a list of dofs that are (on the coarse level) coupled. | |
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< gsDofMapper > | m_dofMapperLocal |
A vector of the patch-local dof mappers. | |
std::vector< Matrix > | m_fixedPart |
The values for the elminated (Dirichlet) dofs. | |
std::vector< JumpMatrix > | m_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. | |
|
inline |
Create the ieti mapper.
multiBasis | The corresponding gsMultiBasis |
dofMapperGlobal | The dof mapper for the global problem |
fixedPart | The function values for the eliminated dofs |
The multibasis object has to outlive the ieti mapper.
void computeJumpMatrices | ( | bool | fullyRedundant, |
bool | excludeCorners | ||
) |
This function computes the jump matrices.
fullyRedundant | Compute the jump matrices in a fullyRedundant way; if false, then no redundancy |
excludeCorners | Ignore 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.
multiBasis | The corresponding gsMultiBasis |
dofMapperGlobal | The dof mapper for the global problem |
fixedPart | The function values for the eliminated dofs |
Instances of the class can be reused using this member function.
|
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.
geo | gsMultiPatch object describing the geometry |
d | The 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.
|
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