DiFfRG
Loading...
Searching...
No Matches
DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ > Class Template Reference

#include <KurganovTadmor.hh>

Inheritance diagram for DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >:
DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >

Public Types

using Discretization = Discretization_
 
using Model = Model_
 
using NumberType = typename Discretization::NumberType
 
using VectorType = typename Discretization::VectorType
 
using Components = typename Discretization::Components
 
- Public Types inherited from DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >
using NumberType
 

Public Member Functions

 Assembler (Discretization &discretization, Model &model, const JSONValue &json)
 
virtual void reinit_vector (VectorType &vec) const override
 
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())
 
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
 
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 &mass, const VectorType &solution_global, const VectorType &solution_global_dot, NumberType weight) override
 
virtual void residual (VectorType &residual, const VectorType &solution_global, NumberType weight, const VectorType &solution_global_dot, NumberType weight_mass, const VectorType &variables=VectorType()) override
 
virtual void jacobian_mass (SparseMatrix< NumberType > &jacobian, const VectorType &solution_global, const VectorType &solution_global_dot, NumberType alpha=1., NumberType beta=1.) override
 
virtual void jacobian (SparseMatrix< NumberType > &jacobian, const VectorType &solution_global, NumberType weight, const VectorType &solution_global_dot, NumberType alpha, NumberType beta, const VectorType &variables=VectorType()) override
 
void build_sparsity (SparsityPattern &sparsity_pattern, const DoFHandler< dim > &to_dofh, const DoFHandler< dim > &from_dofh, const int stencil=1, bool add_extractor_dofs=false) const
 
void log (const std::string logger)
 
double average_time_reinit () const
 
uint num_reinits () const
 
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< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >
virtual void attach_data_output (DataOutput< dim, VectorType > &data_out, const VectorType &solution, const VectorType &variables=VectorType(), const VectorType &dt_solution=VectorType(), const VectorType &residual=VectorType())=0
 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_vector (VectorType &vector) const=0
 Reinitialize an arbitrary vector so that it has the correct size and structure.
 
virtual void residual_variables (VectorType &residual, const VectorType &variables, const VectorType &spatial_solution)
 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 &spatial_solution)
 When coupling the spatial discretization to additional variables, this function should calculate the jacobian for the additional variables.
 
void mass (VectorType &mass, const VectorType &solution_global, NumberType weight)
 Calculates the mass \(m_i(u)\) for an ODE.
 
virtual void mass (VectorType &mass, const VectorType &solution_global, const VectorType &solution_global_dot, NumberType weight)=0
 Calculates the mass \(m(u, \partial_t u)\) for a DAE.
 
void residual (VectorType &residual, const VectorType &solution_global, NumberType weight, NumberType weight_mass, const VectorType &variables=VectorType())
 Calculates the residual for an ODE.
 
virtual void residual (VectorType &residual, const VectorType &solution_global, NumberType weight, const VectorType &solution_global_dot, NumberType weight_mass, const VectorType &variables=VectorType())=0
 Calculates the residual for a DAE.
 
void jacobian_mass (SparseMatrixType &jacobian, const VectorType &solution_global, NumberType mass_weight=1.)
 Calculates the jacobian of the mass function for an ODE.
 
virtual void jacobian_mass (SparseMatrixType &jacobian, const VectorType &solution_global, const VectorType &solution_global_dot, NumberType alpha=1., NumberType beta=1.)=0
 Calculates the jacobian of the mass function for a DAE.
 
void jacobian (SparseMatrixType &jacobian, const VectorType &solution_global, NumberType weight, NumberType mass_weight, const VectorType &variables=VectorType())
 Calculates the jacobian of the residual function for an ODE.
 
virtual void jacobian (SparseMatrixType &jacobian, const VectorType &solution_global, NumberType weight, const VectorType &solution_global_dot, NumberType alpha, NumberType beta, const VectorType &variables=VectorType())=0
 Calculates the jacobian of the residual function for a DAE.
 

Static Public Attributes

static constexpr uint dim = Discretization::dim
 
static constexpr uint n_components = Components::count_fe_functions(0)
 

Protected Member Functions

template<typename... T>
auto fv_tie (T &&...t)
 

Static Protected Member Functions

template<typename... T>
static constexpr auto v_tie (T &&...t)
 
template<typename... T>
static constexpr auto e_tie (T &&...t)
 

Protected Attributes

Discretizationdiscretization
 
Modelmodel
 
const DoFHandler< dim > & dof_handler
 
const Mapping< dim > & mapping
 
const Triangulation< dim > & triangulation
 
const JSONValuejson
 
uint threads
 
const uint batch_size
 
Triangulation< dim >::cell_iterator EoM_cell
 
Triangulation< dim >::cell_iterator old_EoM_cell
 
const double EoM_abs_tol
 
const uint EoM_max_iter
 
const QGauss< dimquadrature
 
SparsityPattern sparsity_pattern_mass
 
SparsityPattern sparsity_pattern_jacobian
 
SparseMatrix< NumberTypemass_matrix
 
std::vector< double > timings_reinit
 
std::vector< double > timings_residual
 
std::vector< double > timings_jacobian
 

Member Typedef Documentation

◆ Components

template<typename Discretization_ , typename Model_ >
using DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::Components = typename Discretization::Components

◆ Discretization

template<typename Discretization_ , typename Model_ >
using DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::Discretization = Discretization_

◆ Model

template<typename Discretization_ , typename Model_ >
using DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::Model = Model_

◆ NumberType

template<typename Discretization_ , typename Model_ >
using DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::NumberType = typename Discretization::NumberType

◆ VectorType

template<typename Discretization_ , typename Model_ >
using DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::VectorType = typename Discretization::VectorType

Constructor & Destructor Documentation

◆ Assembler()

template<typename Discretization_ , typename Model_ >
DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::Assembler ( Discretization & discretization,
Model & model,
const JSONValue & json )
inline

Member Function Documentation

◆ attach_data_output()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::attach_data_output ( DataOutput< dim, VectorType > & data_out,
const VectorType & solution,
const VectorType & variables,
const VectorType & dt_solution = VectorType(),
const VectorType & residual = VectorType() )
inlinevirtual

◆ average_time_jacobian_assembly()

template<typename Discretization_ , typename Model_ >
double DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::average_time_jacobian_assembly ( ) const
inline

◆ average_time_reinit()

template<typename Discretization_ , typename Model_ >
double DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::average_time_reinit ( ) const
inline

◆ average_time_residual_assembly()

template<typename Discretization_ , typename Model_ >
double DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::average_time_residual_assembly ( ) const
inline

◆ build_sparsity()

template<typename Discretization_ , typename Model_ >
void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::build_sparsity ( SparsityPattern & sparsity_pattern,
const DoFHandler< dim > & to_dofh,
const DoFHandler< dim > & from_dofh,
const int stencil = 1,
bool add_extractor_dofs = false ) const
inline

◆ e_tie()

template<typename Discretization_ , typename Model_ >
template<typename... T>
static constexpr auto DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::e_tie ( T &&... t)
inlinestaticconstexprprotected

◆ fv_tie()

template<typename Discretization_ , typename Model_ >
template<typename... T>
auto DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::fv_tie ( T &&... t)
inlineprotected

◆ get_differential_indices()

template<typename Discretization_ , typename Model_ >
virtual IndexSet DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::get_differential_indices ( ) const
inlineoverridevirtual

Obtain the dofs which contain time derivatives.

Returns
IndexSet The indices of the dofs which contain time derivatives

Implements DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >.

◆ get_mass_matrix()

template<typename Discretization_ , typename Model_ >
virtual const SparseMatrix< NumberType > & DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::get_mass_matrix ( ) const
inlineoverridevirtual

Obtain the mass matrix.

Returns
const SparseMatrixType& The mass matrix

Implements DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >.

◆ get_sparsity_pattern_jacobian()

template<typename Discretization_ , typename Model_ >
virtual const SparsityPattern & DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::get_sparsity_pattern_jacobian ( ) const
inlineoverridevirtual

Obtain the sparsity pattern of the jacobian matrix.

Returns
const SparsityPattern<VectorType>& The sparsity pattern of the jacobian matrix

Implements DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >.

◆ jacobian()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::jacobian ( SparseMatrix< NumberType > & jacobian,
const VectorType & solution_global,
NumberType weight,
const VectorType & solution_global_dot,
NumberType alpha,
NumberType beta,
const VectorType & variables = VectorType() )
inlineoverridevirtual

◆ jacobian_mass()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::jacobian_mass ( SparseMatrix< NumberType > & jacobian,
const VectorType & solution_global,
const VectorType & solution_global_dot,
NumberType alpha = 1.,
NumberType beta = 1. )
inlineoverridevirtual

◆ jacobian_variables()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::jacobian_variables ( FullMatrix< NumberType > & jacobian,
const VectorType & variables,
const VectorType &  )
inlineoverridevirtual

◆ log()

template<typename Discretization_ , typename Model_ >
void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::log ( const std::string logger)
inline

◆ mass()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::mass ( VectorType & mass,
const VectorType & solution_global,
const VectorType & solution_global_dot,
NumberType weight )
inlineoverridevirtual

◆ num_jacobians()

template<typename Discretization_ , typename Model_ >
uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::num_jacobians ( ) const
inline

◆ num_reinits()

template<typename Discretization_ , typename Model_ >
uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::num_reinits ( ) const
inline

◆ num_residuals()

template<typename Discretization_ , typename Model_ >
uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::num_residuals ( ) const
inline

◆ readouts()

template<typename Discretization_ , typename Model_ >
void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::readouts ( DataOutput< dim, VectorType > & data_out,
const VectorType & ,
const VectorType & variables ) const
inline

◆ reinit()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::reinit ( )
inlineoverridevirtual

Reinitialize the assembler. This is necessary if the mesh has changed, e.g. after a mesh refinement.

Implements DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >.

◆ reinit_vector()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::reinit_vector ( VectorType & vec) const
inlineoverridevirtual

◆ residual()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::residual ( VectorType & residual,
const VectorType & solution_global,
NumberType weight,
const VectorType & solution_global_dot,
NumberType weight_mass,
const VectorType & variables = VectorType() )
inlineoverridevirtual

◆ residual_variables()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::residual_variables ( VectorType & residual,
const VectorType & variables,
const VectorType &  )
inlineoverridevirtual

◆ set_time()

template<typename Discretization_ , typename Model_ >
virtual void DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::set_time ( double t)
inlineoverridevirtual

Set the current time. The assembler should usually just forward this to the numerical model.

Parameters
tThe current time

Implements DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >.

◆ v_tie()

template<typename Discretization_ , typename Model_ >
template<typename... T>
static constexpr auto DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::v_tie ( T &&... t)
inlinestaticconstexprprotected

Member Data Documentation

◆ batch_size

template<typename Discretization_ , typename Model_ >
const uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::batch_size
protected

◆ dim

template<typename Discretization_ , typename Model_ >
uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::dim = Discretization::dim
staticconstexpr

◆ discretization

template<typename Discretization_ , typename Model_ >
Discretization& DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::discretization
protected

◆ dof_handler

template<typename Discretization_ , typename Model_ >
const DoFHandler<dim>& DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::dof_handler
protected

◆ EoM_abs_tol

template<typename Discretization_ , typename Model_ >
const double DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::EoM_abs_tol
protected

◆ EoM_cell

template<typename Discretization_ , typename Model_ >
Triangulation<dim>::cell_iterator DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::EoM_cell
mutableprotected

◆ EoM_max_iter

template<typename Discretization_ , typename Model_ >
const uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::EoM_max_iter
protected

◆ json

template<typename Discretization_ , typename Model_ >
const JSONValue& DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::json
protected

◆ mapping

template<typename Discretization_ , typename Model_ >
const Mapping<dim>& DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::mapping
protected

◆ mass_matrix

template<typename Discretization_ , typename Model_ >
SparseMatrix<NumberType> DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::mass_matrix
protected

◆ model

template<typename Discretization_ , typename Model_ >
Model& DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::model
protected

◆ n_components

template<typename Discretization_ , typename Model_ >
uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::n_components = Components::count_fe_functions(0)
staticconstexpr

◆ old_EoM_cell

template<typename Discretization_ , typename Model_ >
Triangulation<dim>::cell_iterator DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::old_EoM_cell
protected

◆ quadrature

template<typename Discretization_ , typename Model_ >
const QGauss<dim> DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::quadrature
protected

◆ sparsity_pattern_jacobian

template<typename Discretization_ , typename Model_ >
SparsityPattern DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::sparsity_pattern_jacobian
protected

◆ sparsity_pattern_mass

template<typename Discretization_ , typename Model_ >
SparsityPattern DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::sparsity_pattern_mass
protected

◆ threads

template<typename Discretization_ , typename Model_ >
uint DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::threads
protected

◆ timings_jacobian

template<typename Discretization_ , typename Model_ >
std::vector<double> DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::timings_jacobian
protected

◆ timings_reinit

template<typename Discretization_ , typename Model_ >
std::vector<double> DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::timings_reinit
protected

◆ timings_residual

template<typename Discretization_ , typename Model_ >
std::vector<double> DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::timings_residual
protected

◆ triangulation

template<typename Discretization_ , typename Model_ >
const Triangulation<dim>& DiFfRG::FV::KurganovTadmor::Assembler< Discretization_, Model_ >::triangulation
protected

The documentation for this class was generated from the following file: