AbstractAdaptor< VectorType > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
Interface of mesh adaptors: decide when to adapt the mesh, adapt it, and transfer the solution. More...
#include <abstract_adaptor.hh>
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
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
-
VectorType Vector type of the spatial solution.
Constructor & Destructor Documentation
◆ ~AbstractAdaptor()
|
virtualdefault |
Member Function Documentation
◆ adapt()
|
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()
|
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()
|
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()
|
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()
|
inlinevirtual |
Restore what save_state() stored.
Reimplemented in HAdaptivity< Assembler >.
◆ operator()()
|
pure virtual |
Adapt the mesh if one is due at time t, and transfer sol to the new mesh.
- Parameters
-
t The current RG time. sol The current solution; resized and interpolated if the mesh changed.
- Returns
- true if the mesh changed.
Implemented in NoAdaptivity< VectorType >.
◆ save_state()
|
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()
|
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
Generated by