G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsBaseAssembler.h
Go to the documentation of this file.
1
15#pragma once
16
18
19namespace gismo
20{
21
25template <class T>
27{
28public:
29 typedef memory::shared_ptr<gsBaseAssembler> Ptr;
30 typedef memory::unique_ptr<gsBaseAssembler> uPtr;
31
35 virtual bool assemble(const gsMatrix<T> & solutionVector,
36 const std::vector<gsMatrix<T> > & fixedDDoFs) = 0;
37
39 virtual void assemble(bool /* saveEliminationMatrix */) {};
40 virtual void assemble() { assemble(false); };
41 virtual void assemble(const gsMultiPatch<T> & /* curSolution */)
43
45 virtual int numDofs() const { return gsAssembler<T>::numDofs(); }
46
48 virtual void constructSolution(const gsMatrix<T> & solVector,
49 const std::vector<gsMatrix<T> > & fixedDDofs,
50 gsMultiPatch<T> & result,
51 const gsVector<index_t> & unknowns) const;
52
53 virtual void constructSolution(const gsMatrix<T>& /* solVector */,
54 gsMultiPatch<T>& /* result */, short_t /* unk */ = 0) const
56 virtual void constructSolution(const gsMatrix<T>& /* solVector */,
57 gsMultiPatch<T>& /* result */,
58 const gsVector<index_t> & /* unknowns */) const
60
61 virtual void constructSolution(const gsMatrix<T> & /* solVector */,
62 const std::vector<gsMatrix<T> > & /* fixedDDofs */,
63 gsMultiPatch<T> & /* result */) const {};
64
65 //--------------------- DIRICHLET BC SHENANIGANS ----------------------------------//
66
74 virtual void setFixedDofs(index_t patch, boxSide side, const gsMatrix<T> & ddofs, bool oneUnk = false);
75
77 virtual void setFixedDofs(const std::vector<gsMatrix<T> > & ddofs);
78
81 virtual void getFixedDofs(index_t patch, boxSide side, gsMatrix<T> & ddofs) const;
82
84 virtual index_t numFixedDofs() const;
85
87 virtual void eliminateFixedDofs();
88
89 //virtual void modifyDirichletDofs(size_t patch, boxSide side, const gsMatrix<T> & ddofs);
90
91 //--------------------- OTHER ----------------------------------//
92
93 virtual void setRHS(const gsMatrix<T> & rhs) {m_system.rhs() = rhs;}
94
95 virtual void setMatrix(const gsSparseMatrix<T> & matrix) {m_system.matrix() = matrix;}
96
97protected:
98 using gsAssembler<T>::m_pde_ptr;
99 using gsAssembler<T>::m_bases;
100 using gsAssembler<T>::m_system;
101 using gsAssembler<T>::m_ddof;
102
103 gsSparseMatrix<T> eliminationMatrix;
104 gsMatrix<T> rhsWithZeroDDofs;
105};
106
107} // namespace ends
108
109#ifndef GISMO_BUILD_LIB
110#include GISMO_HPP_HEADER(gsBaseAssembler.hpp)
111#endif
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition gsAssembler.h:266
index_t numDofs() const
Returns the number of (free) degrees of freedom.
Definition gsAssembler.h:633
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition gsAssembler.h:618
gsSparseSystem< T > m_system
Global sparse linear system.
Definition gsAssembler.h:290
std::vector< gsMultiBasis< T > > m_bases
Definition gsAssembler.h:282
memory::shared_ptr< gsPde< T > > m_pde_ptr
Definition gsAssembler.h:276
std::vector< gsMatrix< T > > m_ddof
Definition gsAssembler.h:295
const gsSparseMatrix< T > & matrix() const
Returns the left-hand global matrix.
Definition gsAssembler.h:614
Extends the gsAssembler class by adding functionality necessary for a general nonlinear solver....
Definition gsBaseAssembler.h:27
virtual void assemble(bool)
assembly procedure for linear problems
Definition gsBaseAssembler.h:39
virtual void constructSolution(const gsMatrix< T > &, gsMultiPatch< T > &, short_t=0) const
Construct solution from computed solution vector for a single unknows.
Definition gsBaseAssembler.h:53
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsBaseAssembler.h:40
virtual void assemble(const gsMultiPatch< T > &)
Main non-linear assemble routine with input from current solution.
Definition gsBaseAssembler.h:41
virtual void getFixedDofs(index_t patch, boxSide side, gsMatrix< T > &ddofs) const
Definition gsBaseAssembler.hpp:113
virtual bool assemble(const gsMatrix< T > &solutionVector, const std::vector< gsMatrix< T > > &fixedDDoFs)=0
virtual void setFixedDofs(index_t patch, boxSide side, const gsMatrix< T > &ddofs, bool oneUnk=false)
Set Dirichet degrees of freedom on a given side of a given patch from a given matrix.
Definition gsBaseAssembler.hpp:61
virtual void eliminateFixedDofs()
Eliminates new Dirichelt degrees of fredom.
Definition gsBaseAssembler.hpp:151
virtual void constructSolution(const gsMatrix< T > &, gsMultiPatch< T > &, const gsVector< index_t > &) const
Construct solution from computed solution vector for a set of unknowns. The result is a vectorfield,...
Definition gsBaseAssembler.h:56
virtual void constructSolution(const gsMatrix< T > &solVector, const std::vector< gsMatrix< T > > &fixedDDofs, gsMultiPatch< T > &result, const gsVector< index_t > &unknowns) const
Constructs solution as a gsMultiPatch object from the solution vector and fixed DoFs.
Definition gsBaseAssembler.hpp:23
virtual index_t numFixedDofs() const
get the size of the Dirichlet vector for elimination
Definition gsBaseAssembler.hpp:142
virtual int numDofs() const
Returns number of free degrees of freedom.
Definition gsBaseAssembler.h:45
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
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
const gsMatrix< T > & rhs() const
Access the right hand side.
Definition gsSparseSystem.h:402
const gsSparseMatrix< T > & matrix() const
Access the system Matrix.
Definition gsSparseSystem.h:394
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Provides generic assembler routines.
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
The G+Smo namespace, containing all definitions for the library.