15 #include <gsAssembler/gsVisitorMass.h>
43 m_stationary(&stationary),
m_theta(0.5)
46 "Theta parameter determining the time integration scheme [0..1]",
m_theta);
51 void setTheta(
const T th)
65 m_stationary->assemble();
75 "Something went terribly wrong.");
102 const gsSparseMatrix<T> & stationaryMatrix()
const {
return m_stationary->matrix(); }
103 const gsSparseMatrix<T> & stationaryRhs()
const {
return m_stationary->rhs(); }
115 gsAssembler<T> * m_stationary;
138 nextTimeStepFixedRhs(m_stationary->matrix(), m_mass,
139 m_stationary->rhs(), curSolution, Dt);
169 "Wrong size in current solution vector.");
171 const T c1 = Dt * m_theta;
172 m_system.matrix() = massMatrix + c1 * sysMatrix;
174 const T c2 = Dt * (1.0 - m_theta);
175 m_system.rhs().noalias() = c1 * rhs1 + c2 * rhs0 + (massMatrix - c2 * sysMatrix) * curSolution;
179 void gsHeatEquation<T>::nextTimeStepFixedRhs(
const gsSparseMatrix<T> & sysMatrix,
180 const gsSparseMatrix<T> & massMatrix,
181 const gsMatrix<T> & rhs,
182 const gsMatrix<T> & curSolution,
186 "Wrong size in current solution vector.");
188 const T c1 = Dt * m_theta;
189 m_system.matrix() = massMatrix + c1 * sysMatrix;
191 const T c2 = Dt * (1.0 - m_theta);
192 m_system.rhs().noalias() = Dt * rhs + (massMatrix - c2 * sysMatrix) * curSolution;
202 const index_t m_dofs = this->numDofs();
205 gsWarn<<
"No interior DoFs for mass compuation.\n";
211 m_system.reserve(m_bases[0], m_options, 1);
215 for (
size_t np=0; np < m_pde_ptr->domain().nPatches(); ++np )
218 this->apply(mass, np);
225 m_system.matrix().swap(m_mass);
memory::shared_ptr< gsPde< T > > m_pde_ptr
Definition: gsAssembler.h:276
void assembleMass()
Mass assembly routine.
Definition: gsHeatEquation.h:197
gsOptionList m_options
Options.
Definition: gsAssembler.h:285
std::vector< gsMultiBasis< T > > m_bases
Definition: gsAssembler.h:282
gsHeatEquation(gsAssembler< T > &stationary)
Construction receiving all necessary data.
Definition: gsHeatEquation.h:41
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition: gsAssembler.h:618
#define index_t
Definition: gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
void setReal(const std::string &label, const Real &value)
Sets an existing option label to be equal to value.
Definition: gsOptionList.cpp:166
The visitor computes element mass integrals.
Definition: gsVisitorMass.h:29
T m_theta
Theta parameter determining the scheme.
Definition: gsHeatEquation.h:121
#define gsWarn
Definition: gsDebug.h:50
gsSparseSystem< T > m_system
Global sparse linear system.
Definition: gsAssembler.h:290
Constructs the assembler for the discretized isogeometric heat equation.
Definition: gsHeatEquation.h:33
void assemble()
Initial assembly routine.
Definition: gsHeatEquation.h:59
std::vector< gsMatrix< T > > m_ddof
Definition: gsAssembler.h:295
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:211
void nextTimeStep(const gsMatrix< T > &curSolution, const T Dt)
Computes the matrix and right-hand side for the next timestep.
Definition: gsHeatEquation.h:136
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition: gsAssembler.h:265
gsSparseMatrix< T > m_mass
The mass matrix.
Definition: gsHeatEquation.h:118
Real getReal(const std::string &label) const
Reads value for option label from options.
Definition: gsOptionList.cpp:44