ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ryujin::Interface::Task< Number > Class Template Referenceabstract
Inheritance diagram for ryujin::Interface::Task< Number >:
Inheritance graph
[legend]

Public Member Functions

virtual ~Task ()=default
 
Setup
virtual void initialize (TaskContext< Number > &)
 
virtual void start (TaskContext< Number > &)
 
virtual void prepare (TaskContext< Number > &)
 
Execution
virtual void execute (TaskContext< Number > &context)=0
 
virtual void finalize (TaskContext< Number > &)
 
Checkpointing
virtual void save (boost::archive::binary_oarchive &) const
 
virtual void load (boost::archive::binary_iarchive &)
 

Information

 Task (const std::string &name, TaskPhase phase)
 

Detailed Description

template<typename Number = double>
class ryujin::Interface::Task< Number >

The interface of a Task: an operation that the Scheduler executes in a given TaskPhase of every cycle.

The Scheduler calls the functions of all active tasks in the following order:

In addition, a task stores its internal state in checkpoints with save() and load().

Definition at line 342 of file task.h.

Constructor & Destructor Documentation

◆ ~Task()

template<typename Number = double>
virtual ryujin::Interface::Task< Number >::~Task ( )
virtualdefault

Destructor.

◆ Task()

template<typename Number = double>
ryujin::Interface::Task< Number >::Task ( const std::string &  name,
TaskPhase  phase 
)
inlineprotected

The name of the task, used for selecting it in the parameter file. The phase in which the task runs. Constructor taking the name of the task and the phase in which it runs.

Definition at line 439 of file task.h.

Member Function Documentation

◆ initialize()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::initialize ( TaskContext< Number > &  )
inlinevirtual

Initialize the task.

Called once at the very beginning.

Reimplemented in ryujin::Logger< dim, Number >, and ryujin::ErrorEvaluation< dim, Number >.

Definition at line 360 of file task.h.

◆ start()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::start ( TaskContext< Number > &  )
inlinevirtual

Start the computation.

Called once after all tasks have been initialized and before the first call to prepare().

Reimplemented in ryujin::Checkpointing< dim, Number >, and ryujin::Logger< dim, Number >.

Definition at line 368 of file task.h.

◆ prepare()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::prepare ( TaskContext< Number > &  )
inlinevirtual

Prepare the task for the current mesh.

Called after start() and whenever a task of the adapt phase sets TaskContext::prepare_required.

Note
prepare() must preserve the internal state of the task.

Reimplemented in ryujin::MeshAdaptor< dim, Number >, ryujin::Logger< dim, Number >, ryujin::Simulation< HD, PD, dim, Number >, ryujin::Quantities< dim, Number >, and ryujin::VTUOutput< dim, Number >.

Definition at line 378 of file task.h.

◆ execute()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::execute ( TaskContext< Number > &  context)
pure virtual

◆ finalize()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::finalize ( TaskContext< Number > &  )
inlinevirtual

Finalize the task. Called once at the end.

Reimplemented in ryujin::Checkpointing< dim, Number >, ryujin::Logger< dim, Number >, and ryujin::ErrorEvaluation< dim, Number >.

Definition at line 395 of file task.h.

◆ save()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::save ( boost::archive::binary_oarchive &  ) const
inlinevirtual

Store the internal state of the task in a checkpoint. Called on all MPI ranks; but only the data of rank 0 is written.

Definition at line 407 of file task.h.

◆ load()

template<typename Number = double>
virtual void ryujin::Interface::Task< Number >::load ( boost::archive::binary_iarchive &  )
inlinevirtual

Restore the internal state of the task from a checkpoint. Called on all MPI ranks with the data written by save() on rank 0.

Definition at line 413 of file task.h.


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