preCICE v3.1.2
Loading...
Searching...
No Matches
Action.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "mapping/Mapping.hpp"
5
6namespace precice::action {
7
14class Action {
15public:
17 enum Timing {
18 WRITE_MAPPING_POST, // At the end of a time window, after write mapping (if existent) and before advancing cpl scheme
19 READ_MAPPING_POST // At the end of a time window, after read mapping (if existent)
20 };
21
23 Timing timing,
24 const mesh::PtrMesh & mesh,
26 : _timing(timing),
27 _mesh(mesh),
28 _meshRequirement(requirement)
29 {
30 }
31
33 Timing timing,
34 const mesh::PtrMesh &mesh)
35 : _timing(timing),
36 _mesh(mesh)
37 {
38 }
39
40 Action &operator=(Action &&) = delete;
41
43 virtual ~Action() = default;
44
48 virtual void performAction() = 0;
49
52 {
53 return _timing;
54 }
55
57 const mesh::PtrMesh &getMesh() const
58 {
59 return _mesh;
60 }
61
67
68private:
71
74
77};
78
79} // namespace precice::action
Abstract base class for configurable actions on data and/or meshes.
Definition Action.hpp:14
Action(Timing timing, const mesh::PtrMesh &mesh)
Definition Action.hpp:32
mapping::Mapping::MeshRequirement getMeshRequirement() const
Returns the mesh requirement of this action.
Definition Action.hpp:63
mesh::PtrMesh _mesh
Mesh carrying the data used in the action.
Definition Action.hpp:73
Timing _timing
Determines when the action will be executed.
Definition Action.hpp:70
Timing
Defines the time and place of application of the action.
Definition Action.hpp:17
virtual void performAction()=0
Performs the action, to be overwritten by subclasses.
mapping::Mapping::MeshRequirement _meshRequirement
The mesh requirements for the mesh.
Definition Action.hpp:76
Action & operator=(Action &&)=delete
virtual ~Action()=default
Destructor, empty.
const mesh::PtrMesh & getMesh() const
Returns the mesh carrying the data used in the action.
Definition Action.hpp:57
Action(Timing timing, const mesh::PtrMesh &mesh, mapping::Mapping::MeshRequirement requirement)
Definition Action.hpp:22
Timing getTiming() const
Returns the timing of the action.
Definition Action.hpp:51
MeshRequirement
Specifies requirements for the input and output meshes of a mapping.
Definition Mapping.hpp:45
contains actions to modify exchanged data.
Definition Action.hpp:6