G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsIetiSystem.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <gsSolver/gsMatrixOp.h>
17
18namespace gismo
19{
20
68template< typename T >
70{
72 typedef memory::shared_ptr<Op> OpPtr;
76 typedef memory::shared_ptr<JumpMatrix> JumpMatrixPtr;
78public:
79
82 void reserve(index_t n);
83
96
99 const JumpMatrixPtr& jumpMatrix(index_t k) const { return m_jumpMatrices[k]; }
100
103 const OpPtr& localMatrixOp(index_t k) const { return m_localMatrixOps[k]; }
104
107 const Matrix& localRhs(index_t k) const { return m_localRhs[k]; }
108
111 const OpPtr& localSolverOp(index_t k) const { return m_localSolverOps[k]; }
112
117 {
118 GISMO_ASSERT( m_jumpMatrices.size()>0, "gsIetiSystem: Number of Lagrange multipliers "
119 "can only be determined if there are jump matrices.");
120 return m_jumpMatrices[0]->rows();
121 }
122
128 OpPtr schurComplement() const;
129
136
144 std::vector<Matrix> constructSolutionFromLagrangeMultipliers(const Matrix& multipliers) const;
145
149
153
157 std::vector<Matrix> constructSolutionFromSaddlePoint(const Matrix& x) const;
158
159
160private:
161 void setupSparseLUSolvers() const;
162
163 std::vector<JumpMatrixPtr> m_jumpMatrices;
164 std::vector<OpPtr> m_localMatrixOps;
165 std::vector<Matrix> m_localRhs;
166 mutable std::vector<OpPtr> m_localSolverOps;
167};
168
169} // namespace gismo
170
171#ifndef GISMO_BUILD_LIB
172#include GISMO_HPP_HEADER(gsIetiSystem.hpp)
173#endif
This class represents a IETI system.
Definition gsIetiSystem.h:70
OpPtr & localSolverOp(index_t k)
Access the local solver operator.
Definition gsIetiSystem.h:110
OpPtr schurComplement() const
Returns gsLinearOperator that represents the Schur complement for the IETI problem.
Definition gsIetiSystem.hpp:83
gsMatrixOp< SparseMatrix > SparseMatrixOp
Sparse matrix type as operatpr.
Definition gsIetiSystem.h:74
gsMatrix< T > Matrix
Matrix type.
Definition gsIetiSystem.h:77
OpPtr saddlePointProblem() const
Returns gsLinearOperator that represents the IETI problem as saddle point problem.
Definition gsIetiSystem.hpp:68
void setupSparseLUSolvers() const
Setup solvers if not provided by user.
Definition gsIetiSystem.hpp:50
JumpMatrixPtr & jumpMatrix(index_t k)
Access the jump matrix.
Definition gsIetiSystem.h:98
memory::shared_ptr< Op > OpPtr
Shared pointer to linear operator.
Definition gsIetiSystem.h:72
void addSubdomain(JumpMatrixPtr jumpMatrix, OpPtr localMatrixOp, Matrix localRhs, OpPtr localSolverOp=OpPtr())
Definition gsIetiSystem.hpp:32
std::vector< Matrix > constructSolutionFromSaddlePoint(const Matrix &x) const
Returns the local solutions for the individual subdomains.
Definition gsIetiSystem.hpp:141
std::vector< JumpMatrixPtr > m_jumpMatrices
Stores the jump matrices.
Definition gsIetiSystem.h:163
std::vector< OpPtr > m_localSolverOps
Stores the local solvers.
Definition gsIetiSystem.h:166
void reserve(index_t n)
Reserves the memory required to store the number of subdomains.
Definition gsIetiSystem.hpp:23
OpPtr & localMatrixOp(index_t k)
Access the local stiffness matrix (as gsLinearOperator)
Definition gsIetiSystem.h:102
Matrix & localRhs(index_t k)
Access the local right-hand side.
Definition gsIetiSystem.h:106
std::vector< OpPtr > m_localMatrixOps
Stores the local matrix ops .
Definition gsIetiSystem.h:164
std::vector< Matrix > m_localRhs
Stores the local right-hand sides.
Definition gsIetiSystem.h:165
gsLinearOperator< T > Op
Linear operator.
Definition gsIetiSystem.h:71
gsSparseMatrix< T > SparseMatrix
Sparse matrix type.
Definition gsIetiSystem.h:73
gsSparseMatrix< T, RowMajor > JumpMatrix
Sparse matrix type for jumps.
Definition gsIetiSystem.h:75
Matrix rhsForSchurComplement() const
Returns the right-hand-side that is required for the Schur complement formulation of the IETI problem...
Definition gsIetiSystem.hpp:91
Matrix rhsForSaddlePoint() const
Returns the right-hand-side that is required for the saddle point formulation of the IETI problem.
Definition gsIetiSystem.hpp:122
memory::shared_ptr< JumpMatrix > JumpMatrixPtr
Shared pointer to sparse matrix type for jumps.
Definition gsIetiSystem.h:76
std::vector< Matrix > constructSolutionFromLagrangeMultipliers(const Matrix &multipliers) const
Returns the local solutions for the individual subdomains.
Definition gsIetiSystem.hpp:107
index_t nLagrangeMultipliers() const
Returns the number of Lagrange multipliers.
Definition gsIetiSystem.h:116
Simple abstract class for discrete operators.
Definition gsLinearOperator.h:29
Simple adapter class to use a matrix (or matrix-like object) as a linear operator....
Definition gsMatrixOp.h:34
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
#define index_t
Definition gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Simple adapter classes to use matrices or linear solvers as gsLinearOperators.
The G+Smo namespace, containing all definitions for the library.