Assembler< Model_ > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
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 | SparseMatrixType = SparseMatrix<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 ConfigTree &) | |
| virtual void | reinit_vector (VectorType &vec) const override |
| Reinitialize an arbitrary vector so that it has the correct size and structure. | |
| virtual void | reinit_matrix (SparseMatrixType &matrix) const override |
| Reinitialize a matrix to the jacobian's sparsity pattern. | |
| virtual MPI_Comm | get_communicator () const override |
| The communicator this assembler's linear algebra lives on. | |
| virtual void | reinit_solution_view (SolutionView< VectorType > &view) const override |
| Establish the layout of a fully-replicated read-only view of the solution. | |
| virtual IndexSet | get_differential_indices () const override |
| Obtain the dofs which contain time derivatives. | |
| virtual void | attach_data_output (OutputFrame< dim, VectorType > &data_out, const VectorType &solution, const VectorType &variables, const VectorType &dt_solution=VectorType(), const VectorType &residual=VectorType()) override |
| Contribute the assembler's fields and model readouts to one scoped output frame. | |
| 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 (OutputFrame< 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 |
| SummaryEvent | summary () const override |
| double | average_time_residual_assembly () const |
| uint | num_residuals () const |
| double | average_time_jacobian_assembly () const |
| uint | num_jacobians () const |
Public Member Functions inherited from DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 > | |
| virtual void | attach_data_output (DataOutput< dim, Vector< double > > &, const Vector< double > &, const Vector< double > &=Vector< double >(), const Vector< double > &=Vector< double >(), const Vector< double > &=Vector< double >())=delete |
| 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 |
| 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 |
◆ SparseMatrixType
| using DiFfRG::Variables::Assembler< Model_ >::SparseMatrixType = SparseMatrix<double> |
◆ VectorType
| using DiFfRG::Variables::Assembler< Model_ >::VectorType = Vector<double> |
Constructor & Destructor Documentation
◆ Assembler()
|
inline |
This assembler has no FE space at all (dim == 0) and never runs a mesh_loop, so it needs neither an assembly schedule nor a report port; the config is unused.
Member Function Documentation
◆ attach_data_output()
|
inlineoverridevirtual |
Contribute the assembler's fields and model readouts to one scoped output frame.
- Parameters
-
data_out The current output frame 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_communicator()
|
inlineoverridevirtual |
The communicator this assembler's linear algebra lives on.
MPI_COMM_SELF for a serial discretization, so callers never branch on the build type.
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ 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 |
◆ 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_matrix()
|
inlineoverridevirtual |
Reinitialize a matrix to the jacobian's sparsity pattern.
The counterpart of reinit_vector, and it exists for the same reason: callers must not build the object themselves. SparseMatrixType m(get_sparsity_pattern_jacobian()) is fine for a serial matrix and impossible for a distributed one, which needs the owned row set and a communicator as well – neither of which a timestepper has any business knowing. Routing this through the assembler keeps the timesteppers policy-agnostic.
Implements DiFfRG::AbstractAssembler< Vector< double >, SparseMatrix< double >, 0 >.
◆ reinit_solution_view()
|
inlineoverridevirtual |
Establish the layout of a fully-replicated read-only view of the solution.
Output, the EoM search and the potential solves all read arbitrary global dof indices, which a vector holding only this rank's rows cannot answer. Refreshing one of these before handing it to them keeps all of that code unchanged. See SolutionView.
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 >.
◆ summary()
|
inlineoverridevirtual |
Return aggregate assembly statistics for the run summary.
Reimplemented from 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 |
◆ 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