FEMAssembler< Discretization_, Model_ > Class Template Reference#

DiFfRG: DiFfRG::FEMAssembler< Discretization_, 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 <common.hh>

Inheritance diagram for DiFfRG::FEMAssembler< Discretization_, Model_ >:
DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim > DiFfRG::CG::Assembler< Discretization_, Model_ > DiFfRG::DG::Assembler< Discretization_, Model_ > DiFfRG::dDG::Assembler< Discretization_, Model_ >

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 = typename get_type::NumberType< Discretization_::VectorType >
 

Public Member Functions

 FEMAssembler (Discretization &discretization, Model &model, const JSONValue &json)
 
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()) override
 
const autoget_discretization () const
 
autoget_discretization ()
 
virtual void reinit () override
 Reinitialize the assembler. This is necessary if the mesh has changed, e.g. after a mesh refinement.
 
virtual void rebuild_jacobian_sparsity ()=0
 
virtual void set_time (double t) override
 Set the current time. The assembler should usually just forward this to the numerical model.
 
virtual void refinement_indicator (Vector< double > &, const VectorType &)=0
 
virtual void residual_variables (VectorType &residual, const VectorType &variables, const VectorType &spatial_solution) override
 
virtual void jacobian_variables (FullMatrix< NumberType > &jacobian, const VectorType &variables, const VectorType &spatial_solution) override
 
void readouts (DataOutput< dim, VectorType > &data_out, const VectorType &solution_global, const VectorType &variables) const
 
void extract (std::array< NumberType, Components::count_extractors()> &data, const VectorType &solution_global, const VectorType &variables, bool search_EoM, bool set_EoM, bool postprocess) const
 
bool jacobian_extractors (FullMatrix< NumberType > &extractor_jacobian, const VectorType &solution_global, const VectorType &variables)
 
double average_time_variable_residual_assembly ()
 
uint num_variable_residuals () const
 
double average_time_variable_jacobian_assembly ()
 
uint num_variable_jacobians () const
 
- Public Member Functions inherited from DiFfRG::AbstractAssembler< Discretization_::VectorType, Discretization_::SparseMatrixType, Discretization_::dim >
virtual void attach_data_output (DataOutput< dim, Discretization_::VectorType > &data_out, const Discretization_::VectorType &solution, const Discretization_::VectorType &variables=Discretization_::VectorType(), const Discretization_::VectorType &dt_solution=Discretization_::VectorType(), const Discretization_::VectorType &residual=Discretization_::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 const get_type::SparsityPattern< Discretization_::SparseMatrixType > & get_sparsity_pattern_jacobian () const=0
 Obtain the sparsity pattern of the jacobian matrix.
 
virtual void reinit_vector (Discretization_::VectorType &vector) const=0
 Reinitialize an arbitrary vector so that it has the correct size and structure.
 
virtual const Discretization_::SparseMatrixType & get_mass_matrix () const=0
 Obtain the mass matrix.
 
virtual void residual_variables (Discretization_::VectorType &residual, const Discretization_::VectorType &variables, const Discretization_::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 Discretization_::VectorType &variables, const Discretization_::VectorType &spatial_solution)
 When coupling the spatial discretization to additional variables, this function should calculate the jacobian for the additional variables.
 
void mass (Discretization_::VectorType &mass, const Discretization_::VectorType &solution_global, NumberType weight)
 Calculates the mass \(m_i(u)\) for an ODE.
 
virtual void mass (Discretization_::VectorType &mass, const Discretization_::VectorType &solution_global, const Discretization_::VectorType &solution_global_dot, NumberType weight)=0
 Calculates the mass \(m(u, \partial_t u)\) for a DAE.
 
void residual (Discretization_::VectorType &residual, const Discretization_::VectorType &solution_global, NumberType weight, NumberType weight_mass, const Discretization_::VectorType &variables=Discretization_::VectorType())
 Calculates the residual for an ODE.
 
virtual void residual (Discretization_::VectorType &residual, const Discretization_::VectorType &solution_global, NumberType weight, const Discretization_::VectorType &solution_global_dot, NumberType weight_mass, const Discretization_::VectorType &variables=Discretization_::VectorType())=0
 Calculates the residual for a DAE.
 
void jacobian_mass (Discretization_::SparseMatrixType &jacobian, const Discretization_::VectorType &solution_global, NumberType mass_weight=1.)
 Calculates the jacobian of the mass function for an ODE.
 
virtual void jacobian_mass (Discretization_::SparseMatrixType &jacobian, const Discretization_::VectorType &solution_global, const Discretization_::VectorType &solution_global_dot, NumberType alpha=1., NumberType beta=1.)=0
 Calculates the jacobian of the mass function for a DAE.
 
void jacobian (Discretization_::SparseMatrixType &jacobian, const Discretization_::VectorType &solution_global, NumberType weight, NumberType mass_weight, const Discretization_::VectorType &variables=Discretization_::VectorType())
 Calculates the jacobian of the residual function for an ODE.
 
virtual void jacobian (Discretization_::SparseMatrixType &jacobian, const Discretization_::VectorType &solution_global, NumberType weight, const Discretization_::VectorType &solution_global_dot, NumberType alpha, NumberType beta, const Discretization_::VectorType &variables=Discretization_::VectorType())=0
 Calculates the jacobian of the residual function for a DAE.
 

Static Public Attributes

static constexpr uint dim = Discretization::dim
 

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 FiniteElement< dim > & fe
 
const DoFHandler< dim > & dof_handler
 
const Mapping< dim > & mapping
 
uint threads
 
uint batch_size
 
DoFHandler< dim >::cell_iterator EoM_cell
 
DoFHandler< dim >::cell_iterator old_EoM_cell
 
const double EoM_abs_tol
 
const uint EoM_max_iter
 
Point< dimEoM
 
FullMatrix< NumberTypeextractor_jacobian
 
FullMatrix< NumberTypeextractor_jacobian_u
 
FullMatrix< NumberTypeextractor_jacobian_du
 
FullMatrix< NumberTypeextractor_jacobian_ddu
 
std::vector< types::global_dof_index > extractor_dof_indices
 
std::vector< doubletimings_variable_residual
 
std::vector< doubletimings_variable_jacobian
 

Static Protected Attributes

static constexpr int nothing = 0
 

Detailed Description

template<typename Discretization_, typename Model_>
class DiFfRG::FEMAssembler< Discretization_, Model_ >

The basic assembler that can be used for any standard CG scheme with flux and source.

Template Parameters
ModelThe model class which contains the physical equations.

Member Typedef Documentation

◆ Components

using DiFfRG::FEMAssembler< Discretization_, Model_ >::Components = typename Discretization::Components

◆ Discretization

◆ Model

◆ NumberType

using DiFfRG::FEMAssembler< Discretization_, Model_ >::NumberType = typename Discretization::NumberType

◆ VectorType

using DiFfRG::FEMAssembler< Discretization_, Model_ >::VectorType = typename Discretization::VectorType

Constructor & Destructor Documentation

◆ FEMAssembler()

DiFfRG::FEMAssembler< Discretization_, Model_ >::FEMAssembler ( Discretization discretization,
Model model,
const JSONValue json 
)
inline

Member Function Documentation

◆ attach_data_output()

virtual void DiFfRG::FEMAssembler< 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() 
)
inlineoverridevirtual

◆ average_time_variable_jacobian_assembly()

double DiFfRG::FEMAssembler< Discretization_, Model_ >::average_time_variable_jacobian_assembly ( )
inline

◆ average_time_variable_residual_assembly()

double DiFfRG::FEMAssembler< Discretization_, Model_ >::average_time_variable_residual_assembly ( )
inline

◆ e_tie()

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

◆ extract()

void DiFfRG::FEMAssembler< Discretization_, Model_ >::extract ( std::array< NumberType, Components::count_extractors()> &  data,
const VectorType solution_global,
const VectorType variables,
bool  search_EoM,
bool  set_EoM,
bool  postprocess 
) const
inline

◆ get_differential_indices()

virtual IndexSet DiFfRG::FEMAssembler< 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_discretization() [1/2]

auto & DiFfRG::FEMAssembler< Discretization_, Model_ >::get_discretization ( )
inline

◆ get_discretization() [2/2]

const auto & DiFfRG::FEMAssembler< Discretization_, Model_ >::get_discretization ( ) const
inline

◆ jacobian_extractors()

bool DiFfRG::FEMAssembler< Discretization_, Model_ >::jacobian_extractors ( FullMatrix< NumberType > &  extractor_jacobian,
const VectorType solution_global,
const VectorType variables 
)
inline

◆ jacobian_variables()

virtual void DiFfRG::FEMAssembler< Discretization_, Model_ >::jacobian_variables ( FullMatrix< NumberType > &  jacobian,
const VectorType variables,
const VectorType spatial_solution 
)
inlineoverridevirtual

◆ num_variable_jacobians()

uint DiFfRG::FEMAssembler< Discretization_, Model_ >::num_variable_jacobians ( ) const
inline

◆ num_variable_residuals()

uint DiFfRG::FEMAssembler< Discretization_, Model_ >::num_variable_residuals ( ) const
inline

◆ readouts()

void DiFfRG::FEMAssembler< Discretization_, Model_ >::readouts ( DataOutput< dim, VectorType > &  data_out,
const VectorType solution_global,
const VectorType variables 
) const
inline

◆ rebuild_jacobian_sparsity()

◆ refinement_indicator()

◆ reinit()

◆ residual_variables()

virtual void DiFfRG::FEMAssembler< Discretization_, Model_ >::residual_variables ( VectorType residual,
const VectorType variables,
const VectorType spatial_solution 
)
inlineoverridevirtual

◆ set_time()

virtual void DiFfRG::FEMAssembler< 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... T>
static constexpr auto DiFfRG::FEMAssembler< Discretization_, Model_ >::v_tie ( T &&...  t)
inlinestaticconstexprprotected

Member Data Documentation

◆ batch_size

◆ dim

constexpr uint DiFfRG::FEMAssembler< Discretization_, Model_ >::dim = Discretization::dim
staticconstexpr

◆ discretization

◆ dof_handler

◆ EoM

◆ EoM_abs_tol

◆ EoM_cell

◆ EoM_max_iter

◆ extractor_dof_indices

std::vector<types::global_dof_index> DiFfRG::FEMAssembler< Discretization_, Model_ >::extractor_dof_indices
protected

◆ extractor_jacobian

◆ extractor_jacobian_ddu

◆ extractor_jacobian_du

◆ extractor_jacobian_u

◆ fe

◆ mapping

◆ model

◆ nothing

constexpr int DiFfRG::FEMAssembler< Discretization_, Model_ >::nothing = 0
staticconstexprprotected

◆ old_EoM_cell

◆ threads

◆ timings_variable_jacobian

std::vector<double> DiFfRG::FEMAssembler< Discretization_, Model_ >::timings_variable_jacobian
protected

◆ timings_variable_residual

std::vector<double> DiFfRG::FEMAssembler< Discretization_, Model_ >::timings_variable_residual
protected

The documentation for this class was generated from the following file:
  • /__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/FEM/assembler/common.hh