Assembler< Model_ > Class Template Reference#
|
DiFfRG
|
The basic assembler that can be used for any standard CG scheme with flux and source. More...
#include <variables.hh>
Public Types | |
| using | Model = Model_ |
| using | NumberType = double |
| using | VectorType = Vector<double> |
| using | Components = typename Model_::Components |
Public Types inherited from DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 > | |
| using | NumberType |
Public Member Functions | |
| Assembler (Model &model, const JSONValue &json) | |
| virtual void | reinit_vector (VectorType &vec) const override |
| Reinitialize an arbitrary vector so that it has the correct size and structure. | |
| virtual IndexSet | get_differential_indices () const override |
| Obtain the dofs which contain time derivatives. | |
| virtual void | attach_data_output (DataOutput< dim, VectorType > &data_out, const VectorType &solution, const VectorType &variables, const VectorType &dt_solution=VectorType(), const VectorType &residual=VectorType()) |
| Attach any data output to the DataOutput object provided. This can be used to extract additional data from the solution and write it to the output file. This includes both derivatives and other spatial functions, as well as single values that can be appended to the .csv file. | |
| virtual void | reinit () override |
| Reinitialize the assembler. This is necessary if the mesh has changed, e.g. after a mesh refinement. | |
| virtual void | set_time (double t) override |
| Set the current time. The assembler should usually just forward this to the numerical model. | |
| virtual const SparsityPattern & | get_sparsity_pattern_jacobian () const override |
| Obtain the sparsity pattern of the jacobian matrix. | |
| virtual const SparseMatrix< NumberType > & | get_mass_matrix () const override |
| Obtain the mass matrix. | |
| virtual void | residual_variables (VectorType &residual, const VectorType &variables, const VectorType &) override |
| When coupling the spatial discretization to additional variables, this function should calculate the residual for the additional variables. | |
| virtual void | jacobian_variables (FullMatrix< NumberType > &jacobian, const VectorType &variables, const VectorType &) override |
| void | readouts (DataOutput< dim, VectorType > &data_out, const VectorType &, const VectorType &variables) const |
| virtual void | mass (VectorType &, const VectorType &, const VectorType &, NumberType) override |
| virtual void | residual (VectorType &, const VectorType &, NumberType, const VectorType &, NumberType, const VectorType &variables=VectorType()) override |
| virtual void | jacobian_mass (SparseMatrix< NumberType > &, const VectorType &, const VectorType &, NumberType, NumberType) override |
| virtual void | jacobian (SparseMatrix< NumberType > &, const VectorType &, NumberType, const VectorType &, NumberType, NumberType, const VectorType &variables=VectorType()) override |
| void | log (const std::string logger) const |
| double | average_time_residual_assembly () |
| uint | num_residuals () const |
| double | average_time_jacobian_assembly () |
| uint | num_jacobians () const |
Public Member Functions inherited from DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 > | |
| virtual void | jacobian_variables (FullMatrix< NumberType > &jacobian, const Vector< double > &variables, const Vector< double > &spatial_solution) |
| When coupling the spatial discretization to additional variables, this function should calculate the jacobian for the additional variables. | |
| void | mass (Vector< double > &mass, const Vector< double > &solution_global, NumberType weight) |
| Calculates the mass \(m_i(u)\) for an ODE. | |
| virtual void | mass (Vector< double > &mass, const Vector< double > &solution_global, const Vector< double > &solution_global_dot, NumberType weight)=0 |
| Calculates the mass \(m(u, \partial_t u)\) for a DAE. | |
| void | residual (Vector< double > &residual, const Vector< double > &solution_global, NumberType weight, NumberType weight_mass, const Vector< double > &variables=Vector< double >()) |
| Calculates the residual for an ODE. | |
| virtual void | residual (Vector< double > &residual, const Vector< double > &solution_global, NumberType weight, const Vector< double > &solution_global_dot, NumberType weight_mass, const Vector< double > &variables=Vector< double >())=0 |
| Calculates the residual for a DAE. | |
| void | jacobian_mass (SparseMatrix< double > &jacobian, const Vector< double > &solution_global, NumberType mass_weight=1.) |
| Calculates the jacobian of the mass function for an ODE. | |
| virtual void | jacobian_mass (SparseMatrix< double > &jacobian, const Vector< double > &solution_global, const Vector< double > &solution_global_dot, NumberType alpha=1., NumberType beta=1.)=0 |
| Calculates the jacobian of the mass function for a DAE. | |
| void | jacobian (SparseMatrix< double > &jacobian, const Vector< double > &solution_global, NumberType weight, NumberType mass_weight, const Vector< double > &variables=Vector< double >()) |
| Calculates the jacobian of the residual function for an ODE. | |
| virtual void | jacobian (SparseMatrix< double > &jacobian, const Vector< double > &solution_global, NumberType weight, const Vector< double > &solution_global_dot, NumberType alpha, NumberType beta, const Vector< double > &variables=Vector< double >())=0 |
| Calculates the jacobian of the residual function for a DAE. | |
Static Public Attributes | |
| static constexpr uint | dim = 0 |
Private Attributes | |
| Model & | model |
| uint | threads |
| SparsityPattern | sparsity_pattern_mass |
| SparsityPattern | sparsity_pattern_jacobian |
| SparseMatrix< NumberType > | mass_matrix |
| std::vector< double > | timings_residual |
| std::vector< double > | timings_jacobian |
Static Private Attributes | |
| static constexpr int | nothing = 0 |
Detailed Description
class DiFfRG::Variables::Assembler< Model_ >
The basic assembler that can be used for any standard CG scheme with flux and source.
- Template Parameters
-
Model The model class which contains the physical equations.
Member Typedef Documentation
◆ Components
| using DiFfRG::Variables::Assembler< Model_ >::Components = typename Model_::Components |
◆ Model
| using DiFfRG::Variables::Assembler< Model_ >::Model = Model_ |
◆ NumberType
| using DiFfRG::Variables::Assembler< Model_ >::NumberType = double |
◆ VectorType
| using DiFfRG::Variables::Assembler< Model_ >::VectorType = Vector<double> |
Constructor & Destructor Documentation
◆ Assembler()
|
inline |
Member Function Documentation
◆ attach_data_output()
|
inlinevirtual |
Attach any data output to the DataOutput object provided. This can be used to extract additional data from the solution and write it to the output file. This includes both derivatives and other spatial functions, as well as single values that can be appended to the .csv file.
- Parameters
-
data_out The DataOutput object to attach the data to solution The spatial solution vector variables The additional variables vector
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ average_time_jacobian_assembly()
|
inline |
◆ average_time_residual_assembly()
|
inline |
◆ get_differential_indices()
|
inlineoverridevirtual |
Obtain the dofs which contain time derivatives.
- Returns
- IndexSet The indices of the dofs which contain time derivatives
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ get_mass_matrix()
|
inlineoverridevirtual |
Obtain the mass matrix.
- Returns
- const SparseMatrixType& The mass matrix
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ get_sparsity_pattern_jacobian()
|
inlineoverridevirtual |
Obtain the sparsity pattern of the jacobian matrix.
- Returns
- const SparsityPattern<VectorType>& The sparsity pattern of the jacobian matrix
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ jacobian()
|
inlineoverridevirtual |
◆ jacobian_mass()
|
inlineoverridevirtual |
◆ jacobian_variables()
|
inlineoverridevirtual |
◆ log()
|
inline |
◆ mass()
|
inlineoverridevirtual |
◆ num_jacobians()
|
inline |
◆ num_residuals()
|
inline |
◆ readouts()
|
inline |
◆ reinit()
|
inlineoverridevirtual |
Reinitialize the assembler. This is necessary if the mesh has changed, e.g. after a mesh refinement.
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ reinit_vector()
|
inlineoverridevirtual |
Reinitialize an arbitrary vector so that it has the correct size and structure.
- Parameters
-
vector The vector to be reinitialized
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ residual()
|
inlineoverridevirtual |
◆ residual_variables()
|
inlineoverridevirtual |
When coupling the spatial discretization to additional variables, this function should calculate the residual for the additional variables.
- Parameters
-
residual The residual vector of the additional variables variables The current additional variables vector spatial_solution The spatial solution vector, which is needed for the calculation of the residual
Reimplemented from DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ set_time()
|
inlineoverridevirtual |
Set the current time. The assembler should usually just forward this to the numerical model.
- Parameters
-
t The current time
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
Member Data Documentation
◆ dim
|
staticconstexpr |
◆ mass_matrix
|
private |
◆ model
|
private |
◆ nothing
|
staticconstexprprivate |
◆ sparsity_pattern_jacobian
|
private |
◆ sparsity_pattern_mass
|
private |
◆ threads
|
private |
◆ timings_jacobian
|
private |
◆ timings_residual
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/variables/assembler/variables.hh
Generated by
Public Types inherited from