G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsIetiMapper.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <gsCore/gsMultiBasis.h>
18
19namespace gismo
20{
21
48template< typename T >
50{
54
55public:
58
72
80 void init(
83 const Matrix& fixedPart
84 );
85
87 void cornersAsPrimals();
88
101
107 void customPrimalConstraints( std::vector< std::pair<index_t,SparseVector> > data );
108
115 void computeJumpMatrices( bool fullyRedundant, bool excludeCorners );
116
120 std::vector<index_t> skeletonDofs( index_t patch ) const;
121
131 {
133 "gsIetiMapper: The class has not been initialized." );
134 GISMO_ASSERT( u.mapper().size() == m_dofMapperLocal[k].size(),
135 "gsIetiMapper::initFeSpace: The sizes do not agree." );
136 const_cast<expr::gsFeSpace<T>&>(u).mapper() = m_dofMapperLocal[k];
137 const_cast<expr::gsFeSpace<T>&>(u).fixedPart() = m_fixedPart[k];
138 }
139
141 Matrix constructGlobalSolutionFromLocalSolutions( const std::vector<Matrix>& localContribs );
142
143public:
144
147 {
149 "gsIetiMapper: Number of Lagrange multipliers not yet known.");
150 return m_jumpMatrices[0].rows();
151 }
152
155
160 const std::vector<SparseVector> & primalConstraints(index_t k) const { return m_primalConstraints[k]; }
161
164 const std::vector<index_t> & primalDofIndices(index_t k) const { return m_primalDofIndices[k]; }
165
168 const JumpMatrix& jumpMatrix(index_t k) const { return m_jumpMatrices[k]; }
169
172
175 const gsDofMapper& dofMapperLocal(index_t k) const { return m_dofMapperLocal[k]; }
176
179 const Matrix& fixedPart(index_t k) const { return m_fixedPart[k]; }
180
183 Matrix incorporateFixedPart(index_t k, const gsMatrix<T>& localSolution) const;
184
186 const gsMultiBasis<T>& multiBasis() const { return *m_multiBasis; }
187
188private:
189
191 const gsBasis<T>& basis, const gsDofMapper& dm,
192 boxComponent bc );
193
194private:
197 std::vector<gsDofMapper> m_dofMapperLocal;
198 std::vector<Matrix> m_fixedPart;
199 std::vector<JumpMatrix> m_jumpMatrices;
201 std::vector< std::vector<SparseVector> > m_primalConstraints;
202 std::vector< std::vector<index_t> > m_primalDofIndices;
203 unsigned m_status;
204};
205
206} // namespace gismo
207
208#ifndef GISMO_BUILD_LIB
209#include GISMO_HPP_HEADER(gsIetiMapper.hpp)
210#endif
Definition gsExpressions.h:973
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition gsDofMapper.h:69
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
Ieti Mapper.
Definition gsIetiMapper.h:50
Matrix incorporateFixedPart(index_t k, const gsMatrix< T > &localSolution) const
Incorporates fixedPart (eg. from eliminated Dirichlet dofs) to given patch-local solution.
Definition gsIetiMapper.hpp:400
const gsDofMapper & dofMapperGlobal() const
The global dof mapper.
Definition gsIetiMapper.h:171
gsMatrix< T > Matrix
Matrix type.
Definition gsIetiMapper.h:51
static gsSparseVector< T > assembleAverage(const gsGeometry< T > &geo, const gsBasis< T > &basis, const gsDofMapper &dm, boxComponent bc)
Assembles for interfaceAveragesAsPrimals.
Definition gsIetiMapper.hpp:183
void computeJumpMatrices(bool fullyRedundant, bool excludeCorners)
This function computes the jump matrices.
Definition gsIetiMapper.hpp:297
std::vector< std::vector< index_t > > m_primalDofIndices
The primal dof indices for each of the primal constraints.
Definition gsIetiMapper.h:202
std::vector< Matrix > m_fixedPart
The values for the elminated (Dirichlet) dofs.
Definition gsIetiMapper.h:198
const Matrix & fixedPart(index_t k) const
The function values for the eliminated dofs on the given patch Only available after computeJumpMatric...
Definition gsIetiMapper.h:179
void interfaceAveragesAsPrimals(const gsMultiPatch< T > &geo, short_t d)
Set up interface averages as primal dofs.
Definition gsIetiMapper.hpp:218
void cornersAsPrimals()
Set up the corners as primal dofs.
Definition gsIetiMapper.hpp:126
const gsDofMapper & dofMapperLocal(index_t k) const
The dof mapper for the given patch Only available after computeJumpMatrices has been called.
Definition gsIetiMapper.h:175
const gsMultiBasis< T > * m_multiBasis
Pointer to the respective multibasis.
Definition gsIetiMapper.h:195
void init(const gsMultiBasis< T > &multiBasis, gsDofMapper dofMapperGlobal, const Matrix &fixedPart)
Init the ieti mapper after default construction.
Definition gsIetiMapper.hpp:30
Matrix constructGlobalSolutionFromLocalSolutions(const std::vector< Matrix > &localContribs)
Construct the global solution from a vector of patch-local ones.
Definition gsIetiMapper.hpp:91
gsDofMapper m_dofMapperGlobal
The global dof mapper.
Definition gsIetiMapper.h:196
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 pa...
Definition gsIetiMapper.h:164
const gsMultiBasis< T > & multiBasis() const
Reference to the multi basis object being passed to constructur or init.
Definition gsIetiMapper.h:186
index_t nLagrangeMultipliers()
Returns the number of Lagrange multipliers.
Definition gsIetiMapper.h:146
gsSparseMatrix< T, RowMajor > JumpMatrix
Sparse matrix type for jumps.
Definition gsIetiMapper.h:53
index_t nPrimalDofs() const
Returns the size of the primal problem (number of primal dofs)
Definition gsIetiMapper.h:154
index_t m_nPrimalDofs
The number of primal dofs already created.
Definition gsIetiMapper.h:200
void customPrimalConstraints(std::vector< std::pair< index_t, SparseVector > > data)
With this function, the caller can register more primal constraints.
Definition gsIetiMapper.hpp:267
unsigned m_status
A status flag that is checked by assertions.
Definition gsIetiMapper.h:203
gsSparseVector< T > SparseVector
Sparse matrix type.
Definition gsIetiMapper.h:52
std::vector< index_t > skeletonDofs(index_t patch) const
Returns a list of dofs that are (on the coarse level) coupled.
Definition gsIetiMapper.hpp:282
std::vector< JumpMatrix > m_jumpMatrices
The jump matrices.
Definition gsIetiMapper.h:199
const JumpMatrix & jumpMatrix(index_t k) const
Returns the jump matrix for the given patch Only available after computeJumpMatrices has been called...
Definition gsIetiMapper.h:168
std::vector< gsDofMapper > m_dofMapperLocal
A vector of the patch-local dof mappers.
Definition gsIetiMapper.h:197
const std::vector< SparseVector > & primalConstraints(index_t k) const
Returns the primalConstraints (as vectors) for the given patch.
Definition gsIetiMapper.h:160
gsIetiMapper(const gsMultiBasis< T > &multiBasis, gsDofMapper dofMapperGlobal, const Matrix &fixedPart)
Create the ieti mapper.
Definition gsIetiMapper.h:66
std::vector< std::vector< SparseVector > > m_primalConstraints
The primal constraints.
Definition gsIetiMapper.h:201
gsIetiMapper()
Default constructor.
Definition gsIetiMapper.h:57
void initFeSpace(typename gsExprAssembler< T >::space u, index_t k)
Apply the required changes to a space object of the expression assembler.
Definition gsIetiMapper.h:130
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
Sparse vector class, based on gsEigen::SparseVector.
Definition gsSparseVector.h:35
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Generic expressions matrix assembly.
Provides declaration of MultiBasis class.
The G+Smo namespace, containing all definitions for the library.
S give(S &x)
Definition gsMemory.h:266
Struct which represents a certain component (interior, face, egde, corner).
Definition gsBoundary.h:445