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)
66 m_stationary->assemble();
76 "Something went terribly wrong.");
103 const gsSparseMatrix<T> & stationaryMatrix()
const {
return m_stationary->matrix(); }
104 const gsSparseMatrix<T> & stationaryRhs()
const {
return m_stationary->rhs(); }
116 gsAssembler<T> * m_stationary;
139 nextTimeStepFixedRhs(m_stationary->matrix(), m_mass,
140 m_stationary->rhs(), curSolution, Dt);
170 "Wrong size in current solution vector.");
172 const T c1 = Dt * m_theta;
173 m_system.matrix() = massMatrix + c1 * sysMatrix;
175 const T c2 = Dt * (1.0 - m_theta);
176 m_system.rhs().noalias() = c1 * rhs1 + c2 * rhs0 + (massMatrix - c2 * sysMatrix) * curSolution;
180void gsHeatEquation<T>::nextTimeStepFixedRhs(
const gsSparseMatrix<T> & sysMatrix,
181 const gsSparseMatrix<T> & massMatrix,
182 const gsMatrix<T> & rhs,
183 const gsMatrix<T> & curSolution,
187 "Wrong size in current solution vector.");
189 const T c1 = Dt * m_theta;
190 m_system.matrix() = massMatrix + c1 * sysMatrix;
192 const T c2 = Dt * (1.0 - m_theta);
193 m_system.rhs().noalias() = Dt * rhs + (massMatrix - c2 * sysMatrix) * curSolution;
203 const index_t m_dofs = this->numDofs();
206 gsWarn<<
"No interior DoFs for mass compuation.\n";
212 m_system.reserve(m_bases[0], m_options, 1);
216 for (
size_t np=0; np < m_pde_ptr->domain().nPatches(); ++np )
219 this->apply(mass, np);
226 m_system.matrix().swap(m_mass);
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition gsAssembler.h:266
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
gsOptionList m_options
Options.
Definition gsAssembler.h:285
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsAssembler.hpp:51
memory::shared_ptr< gsPde< T > > m_pde_ptr
Definition gsAssembler.h:276
std::vector< gsMatrix< T > > m_ddof
Definition gsAssembler.h:295
Constructs the assembler for the discretized isogeometric heat equation.
Definition gsHeatEquation.h:34
void nextTimeStep(const gsMatrix< T > &curSolution, const T Dt)
Computes the matrix and right-hand side for the next timestep.
Definition gsHeatEquation.h:137
gsOptionList m_options
Options.
Definition gsAssembler.h:285
void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsHeatEquation.h:60
gsHeatEquation(gsAssembler< T > &stationary)
Construction receiving all necessary data.
Definition gsHeatEquation.h:41
gsSparseMatrix< T > m_mass
The mass matrix.
Definition gsHeatEquation.h:119
void assembleMass()
Mass assembly routine.
Definition gsHeatEquation.h:198
T m_theta
Theta parameter determining the scheme.
Definition gsHeatEquation.h:122
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
void setReal(const std::string &label, const Real &value)
Sets an existing option label to be equal to value.
Definition gsOptionList.cpp:166
Real getReal(const std::string &label) const
Reads value for option label from options.
Definition gsOptionList.cpp:44
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
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
The visitor computes element mass integrals.
Definition gsVisitorMass.h:30
#define index_t
Definition gsConfig.h:32
#define gsWarn
Definition gsDebug.h:50
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
The G+Smo namespace, containing all definitions for the library.
Mass visitor for assembling element mass matrix.