25template<
class T,
int MatOrder>
42 index_t m_nnzPerRowU, m_nnzPerRowP;
43 gsINSVisitorUUlin<T, MatOrder> m_visitorUUlin;
44 gsINSVisitorUUnonlin<T, MatOrder> m_visitorUUnonlin;
45 gsINSVisitorPU_withUPrhs<T, MatOrder> m_visitorUP;
46 gsINSVisitorRhsU<T, MatOrder> m_visitorF;
47 gsINSVisitorRhsP<T, MatOrder> m_visitorG;
50 gsMatrix<T> m_rhsUlin, m_rhsUnonlin, m_rhsBtB, m_rhsFG;
51 gsField<T> m_currentVelField, m_currentPresField;
53 bool m_isMassMatReady;
54 std::vector< gsSparseMatrix<T, MatOrder> > m_massMatBlocks;
66 using Base::m_dofMappers;
68 using Base::m_solution;
69 using Base::m_isBaseReady;
70 using Base::m_isSystemReady;
183 GISMO_ASSERT(m_isSystemReady,
"Matrix not ready, is fillGlobalSyst in the solver params true? If so, update() must be called first.");
190 GISMO_ASSERT(m_isSystemReady,
"Rhs not ready, is fillGlobalSyst in the solver params true? If so, update() must be called first.");
217 GISMO_ASSERT(i >= 0 && i < m_tarDim,
"Component index out of range.");
218 return getBlockUU().block(i * m_udofs, i * m_udofs, m_udofs, m_udofs);
224 {
return m_blockUP; }
233 GISMO_ASSERT(i >= 0 && i < m_tarDim,
"Component index out of range.");
234 return getBlockUP().middleRows(i * m_udofs, m_udofs);
240 GISMO_ASSERT(i >= 0 && i < m_tarDim,
"Component index out of range.");
248 GISMO_ASSERT(unkID == 0 || unkID == 1,
"unkID must be 0 (velocity) or 1 (pressure).");
249 GISMO_ASSERT(m_isMassMatReady,
"Mass matrices not assembled in gsINSAssembler.");
250 return m_massMatBlocks[unkID];
255 GISMO_ASSERT(unkID == 0 || unkID == 1,
"unkID must be 0 (velocity) or 1 (pressure).");
256 GISMO_ASSERT(m_isMassMatReady,
"Mass matrices not assembled in gsINSAssembler.");
257 return m_massMatBlocks[unkID];
266 GISMO_ASSERT(i >= 0 && i < m_tarDim,
"Component index out of range.");
267 return getRhsU().middleRows(i * m_udofs, m_udofs);
281template<
class T,
int MatOrder>
308template<
class T,
int MatOrder>
318 gsINSVisitorUUtimeDiscr<T, MatOrder> m_visitorTimeDiscr;
326 using Base::m_params;
327 using Base::m_pshift;
328 using Base::m_nnzPerRowU;
329 using Base::m_dofMappers;
330 using Base::m_solution;
331 using Base::m_baseMatrix;
332 using Base::m_matrix;
334 using Base::m_currentVelField;
396#ifndef GISMO_BUILD_LIB
397#include GISMO_HPP_HEADER(gsINSAssembler.hpp)
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
A scalar of vector field defined on a m_parametric geometry.
Definition gsField.h:55
A base class for all assemblers in gsIncompressibleFlow.
Definition gsFlowAssemblerBase.h:25
const gsBoundaryConditions< T > & getBCs() const
Returns a const reference to the boundary conditions.
Definition gsFlowAssemblerBase.h:185
std::vector< gsMultiBasis< T > > & getBases()
Returns a reference to the discretization bases.
Definition gsFlowAssemblerBase.h:181
gsAssemblerOptions getAssemblerOptions() const
Returns the assembler options.
Definition gsFlowAssemblerBase.h:191
const gsMultiPatch< T > & getPatches() const
Returns a const reference to the multipatch representing the computational domain.
Definition gsFlowAssemblerBase.h:172
A class that holds all parameters needed by the incompressible flow solver.
Definition gsFlowSolverParams.h:34
The steady incompressible Navier–Stokes assembler.
Definition gsINSAssembler.h:283
The unsteady incompressible Navier–Stokes assembler.
Definition gsINSAssembler.h:310
virtual void updateCurrentSolField(const gsMatrix< T > &solVector, bool updateSol)
Update the current solution field stored in the assembler (used as convection coefficient).
Definition gsINSAssembler.hpp:624
virtual gsMatrix< T > getRhsU() const
///
Definition gsINSAssembler.h:388
virtual void assembleLinearPart()
Assemble the linear part of the matrix.
Definition gsINSAssembler.hpp:634
virtual void updateDofMappers()
Update the DOF mappers in all visitors (e.g. after markDofsAsEliminatedZeros() ).
Definition gsINSAssembler.hpp:615
virtual gsSparseMatrix< T, MatOrder > getBlockUU()
Returns the velocity-velocity block of the linear system.
Definition gsINSAssembler.h:383
void initMembers()
Initialize all members.
Definition gsINSAssembler.hpp:592
virtual void update(const gsMatrix< T > &solVector, bool updateSol=true)
Definition gsINSAssembler.hpp:662
virtual void fillSystem()
Add the nonlinear part to the given matrix and right-hand side.
Definition gsINSAssembler.hpp:652
virtual void updateSizes()
Update sizes of members (when DOF numbers change, e.g. after markDofsAsEliminatedZeros()).
Definition gsINSAssembler.hpp:603
A base class for incompressible Navier-Stokes assemblers.
Definition gsINSAssembler.h:27
gsSparseMatrix< T, MatOrder > getBlockPU() const
Returns the pressure-velocity block of the linear system.
Definition gsINSAssembler.h:227
index_t numDofsUnk(index_t i)
Returns the number of DOFs for the i-th unknown.
Definition gsINSAssembler.hpp:486
virtual void fillBaseSystem()
Fill the linear part of the global matrix and right-hand side.
Definition gsINSAssembler.hpp:276
void fillGlobalMat_UU(gsSparseMatrix< T, MatOrder > &globalMat, const gsSparseMatrix< T, MatOrder > &sourceMat)
Fill the velocity-velocity block into the global saddle-point matrix.
Definition gsINSAssembler.hpp:229
virtual void initialize()
Initialize the assembler.
Definition gsINSAssembler.hpp:334
virtual const gsMatrix< T > & rhs() const
Returns the assembled right-hand side.
Definition gsINSAssembler.h:188
virtual void updateCurrentSolField(const gsMatrix< T > &solVector, bool updateSol)
Update the current solution field stored in the assembler (used as convection coefficient).
Definition gsINSAssembler.hpp:112
virtual void assembleLinearPart()
Assemble the linear part of the problem.
Definition gsINSAssembler.hpp:123
index_t getPdofs() const
Returns the number of pressure DOFs.
Definition gsINSAssembler.h:205
virtual const gsSparseMatrix< T, MatOrder > & matrix() const
Returns the assembled matrix.
Definition gsINSAssembler.h:181
const gsSparseMatrix< T, MatOrder > & getBlockUP() const
Returns the velocity-pressure block of the linear system.
Definition gsINSAssembler.h:223
virtual void fillStokesSystem(gsSparseMatrix< T, MatOrder > &stokesMat, gsMatrix< T > &stokesRhs)
Fill the matrix and right-hand side for the Stokes problem.
Definition gsINSAssembler.hpp:375
index_t getPshift() const
Returns the DOF shift of pressure (i.e. the total number of velocity DOFs).
Definition gsINSAssembler.h:208
virtual void markDofsAsEliminatedZeros(const std::vector< gsMatrix< index_t > > &boundaryDofs, const index_t unk)
Eliminate given DOFs as homogeneous Dirichlet boundary.
Definition gsINSAssembler.hpp:354
virtual gsSparseMatrix< T, MatOrder > getBlockUU(bool linPartOnly=false)
Returns the velocity-velocity block of the linear system.
Definition gsINSAssembler.hpp:498
virtual gsMatrix< T > getRhsU() const
///
Definition gsINSAssembler.hpp:539
index_t getUdofs() const
Returns the number of velocity DOFs (one velocity component).
Definition gsINSAssembler.h:202
void fillGlobalMat_PU(gsSparseMatrix< T, MatOrder > &globalMat, const gsSparseMatrix< T, MatOrder > &sourceMat)
Fill the pressure-velocity block into the global saddle-point matrix.
Definition gsINSAssembler.hpp:258
T computeFlowRate(index_t patch, boxSide side, gsMatrix< T > solution) const
Compute flow rate through a side of a given patch.
Definition gsINSAssembler.hpp:433
virtual gsSparseMatrix< T, MatOrder > getBlockPUcomp(index_t i) const
Returns part of pressure-velocity block for i-th velocity component.
Definition gsINSAssembler.h:238
virtual void updateDofMappers()
Update the DOF mappers in all visitors (when DOF numbers change, e.g. after markDofsAsEliminatedZeros...
Definition gsINSAssembler.hpp:101
virtual gsSparseMatrix< T, MatOrder > getBlockUUcompDiag(index_t i=0)
Returns the diagonal block of velocity-velocity block for i-th component.
Definition gsINSAssembler.h:215
virtual gsField< T > constructSolution(const gsMatrix< T > &solVector, index_t unk) const
Construct solution from computed solution vector for unknown unk.
Definition gsINSAssembler.hpp:389
T getViscosity() const
Returns the viscosity value.
Definition gsINSAssembler.h:178
virtual gsSparseMatrix< T, MatOrder > getBlockUPcomp(index_t i) const
Returns the part of velocity-pressure block for i-th velocity component.
Definition gsINSAssembler.h:231
void fillGlobalMat_UP(gsSparseMatrix< T, MatOrder > &globalMat, const gsSparseMatrix< T, MatOrder > &sourceMat)
Fill the velocity-pressure block into the global saddle-point matrix.
Definition gsINSAssembler.hpp:248
void initMembers()
Initialize the class members.
Definition gsINSAssembler.hpp:19
virtual void update(const gsMatrix< T > &solVector, bool updateSol=true)
Definition gsINSAssembler.hpp:344
virtual void assembleNonlinearPart()
Assemble the linear part of the problem.
Definition gsINSAssembler.hpp:194
virtual gsMatrix< T > getRhsUcomp(index_t i) const
///
Definition gsINSAssembler.h:264
virtual void fillSystem()
Add the nonlinear part to the given matrix and right-hand side.
Definition gsINSAssembler.hpp:316
gsMatrix< T > getRhsP() const
Returns the pressure part of the right-hand side.
Definition gsINSAssembler.hpp:552
virtual gsSparseMatrix< T, MatOrder > & getMassMatrix(index_t unkID)
Returns the mass matrix for unknown with index unk. There is also a const version.
Definition gsINSAssembler.h:246
virtual void updateSizes()
Update sizes of members (when DOF numbers change, e.g. after markDofsAsEliminatedZeros()).
Definition gsINSAssembler.hpp:62
void fillGlobalMat_PP(gsSparseMatrix< T, MatOrder > &globalMat, const gsSparseMatrix< T, MatOrder > &sourceMat)
Fill the pressure-pressure block into the global saddle-point matrix.
Definition gsINSAssembler.hpp:267
const gsMatrix< T > & getSolution() const
Returns a const reference to the current computed solution.
Definition gsINSAssembler.h:195
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
Provides declaration of the Field class.
The G+Smo namespace, containing all definitions for the library.