AbstractAdaptor< VectorType > Class Template Reference#

DiFfRG: AbstractAdaptor< VectorType > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
AbstractAdaptor< VectorType > Class Template Referenceabstract

Interface of mesh adaptors: decide when to adapt the mesh, adapt it, and transfer the solution. More...

#include <abstract_adaptor.hh>

Inheritance diagram for AbstractAdaptor< VectorType >:

Public Member Functions

virtual ~AbstractAdaptor ()=default
 
virtual bool operator() (const double t, VectorType &sol)=0
 Adapt the mesh if one is due at time t, and transfer sol to the new mesh.
 
virtual bool adapt_at (const double t, VectorType &sol, const std::vector< VectorType * > &also_transfer)
 As operator()(t, sol), but also transfers the vectors in also_transfer (states on the same mesh as sol, e.g. a stepper's earlier checkpoints) to the new mesh.
 
virtual bool adapt (VectorType &solution)=0
 Adapt the mesh now, regardless of the schedule, and transfer solution to the new mesh.
 
virtual double adaptation_period () const
 How often operator() may change the mesh, in RG time; 0 if it never does.
 
virtual double last_adaptation_time () const
 The time of the last adaptation, or NaN if this adaptor keeps no such schedule.
 
virtual void set_last_adaptation_time (const double)
 Restore the adaptation schedule from a snapshot; see last_adaptation_time().
 
virtual void save_state (ModelState &state) const
 Store what later adaptations depend on beyond the schedule (e.g. the age of cells), for flow snapshots.
 
virtual void load_state (const ModelState &state)
 Restore what save_state() stored.
 

Detailed Description

template<typename VectorType>
class DiFfRG::AbstractAdaptor< VectorType >

Interface of mesh adaptors: decide when to adapt the mesh, adapt it, and transfer the solution.

Implementations: HAdaptivity (refinement and coarsening of cells) and NoAdaptivity (fixed mesh).

Template Parameters
VectorTypeVector type of the spatial solution.

Constructor & Destructor Documentation

◆ ~AbstractAdaptor()

template<typename VectorType >
virtual ~AbstractAdaptor ( )
virtualdefault

Member Function Documentation

◆ adapt()

template<typename VectorType >
virtual bool adapt ( VectorType & solution)
pure virtual

Adapt the mesh now, regardless of the schedule, and transfer solution to the new mesh.

Returns
true if the mesh changed.

Implemented in NoAdaptivity< VectorType >.

◆ adapt_at()

template<typename VectorType >
virtual bool adapt_at ( const double t,
VectorType & sol,
const std::vector< VectorType * > & also_transfer )
inlinevirtual

As operator()(t, sol), but also transfers the vectors in also_transfer (states on the same mesh as sol, e.g. a stepper's earlier checkpoints) to the new mesh.

The default implementation can transfer nothing else: it throws if an adaptation happened and also_transfer is not empty.

◆ adaptation_period()

template<typename VectorType >
virtual double adaptation_period ( ) const
inlinevirtual

How often operator() may change the mesh, in RG time; 0 if it never does.

The IDA steppers ask the adaptor at multiples of this, not only at output times, so that a long output_dt does not delay adaptations.

Reimplemented in HAdaptivity< Assembler >.

◆ last_adaptation_time()

template<typename VectorType >
virtual double last_adaptation_time ( ) const
inlinevirtual

The time of the last adaptation, or NaN if this adaptor keeps no such schedule.

Stored in flow snapshots, so that a restarted flow adapts at the same times as an uninterrupted one.

Reimplemented in HAdaptivity< Assembler >.

◆ load_state()

template<typename VectorType >
virtual void load_state ( const ModelState & state)
inlinevirtual

Restore what save_state() stored.

Reimplemented in HAdaptivity< Assembler >.

◆ operator()()

template<typename VectorType >
virtual bool operator() ( const double t,
VectorType & sol )
pure virtual

Adapt the mesh if one is due at time t, and transfer sol to the new mesh.

Parameters
tThe current RG time.
solThe current solution; resized and interpolated if the mesh changed.
Returns
true if the mesh changed.

Implemented in NoAdaptivity< VectorType >.

◆ save_state()

template<typename VectorType >
virtual void save_state ( ModelState & state) const
inlinevirtual

Store what later adaptations depend on beyond the schedule (e.g. the age of cells), for flow snapshots.

load_state() is called on a restart once the mesh of the snapshot is rebuilt.

Reimplemented in HAdaptivity< Assembler >.

◆ set_last_adaptation_time()

template<typename VectorType >
virtual void set_last_adaptation_time ( const double )
inlinevirtual

Restore the adaptation schedule from a snapshot; see last_adaptation_time().

Reimplemented in HAdaptivity< Assembler >.


The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/discretization/common/abstract_adaptor.hh