WARPXM v1.10.0
Loading...
Searching...
No Matches
wmva_runner.h
Go to the documentation of this file.
1#ifndef WM_VA_RUNNER_H
2#define WM_VA_RUNNER_H
3
4#include "sync/synchronizer.h"
5#include "wmhostaction.h"
6
7#include <memory>
8#include <vector>
9#include <array>
10#include <numeric>
11
12namespace wxm
13{
14namespace variable
15{
16class distributed_variable_t;
17}
18namespace dfem
19{
20namespace variable_adjuster
21{
22class variable_adjuster_t;
23}
24} // namespace dfem
25
29class va_runner : public WmHostAction
30{
31 // internal storage for patch processes to run
32 std::vector<std::unique_ptr<WmHostAction>> processors_;
33
34 bool add_variables(const WxCryptSet& wxc, const std::string& name);
35
36 // all local patch synchronizers
37 std::vector<std::unique_ptr<wxm::sync::patch_synchronizer_t>> synchronizers_;
38
39public:
40 // pair of variable/component
41 typedef std::vector<std::pair<wxm::variable::distributed_variable_t*, size_t>>
43
44protected:
45 // variable adjusters to be run, in sorted order
46 std::vector<wxm::dfem::variable_adjuster::variable_adjuster_t*> adjusters_;
47
48 // priorities of the various variable adjusters
49 std::vector<int> va_priorities;
50
52 // maximum number of variable adjuster priority levels
54
55 // pair of distributed variable and component index
57
58public:
59 va_runner(const WmConstOpaquePtr& parent_solver) : WmHostAction(parent_solver)
60 {
61 }
62
63 void setup(const WxCryptSet& wxc) override;
64
65 bool needsDomain() const override
66 {
67 return false;
68 }
69
71
75 void start_sync();
76
81
82protected:
83 void typeCheck() override;
84};
85} // namespace wxm
86
87#endif
Opaque Pointer object that carries the referenced data type, but does not expose this payload type as...
Definition: wmopaqueptr.h:81
The WmHostAction class is a base class for sub-solvers in the WARPXM system.
Definition: wmhostaction.h:35
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
virtual std::string name() const
Get name of object.
Represents important parameters for the efficacy of a completing simulation step.
Definition: wxstepperstatus.h:19
Runs a set of variable adjusters.
Definition: wmva_runner.h:30
std::vector< std::pair< wxm::variable::distributed_variable_t *, size_t > > variables_type
Definition: wmva_runner.h:42
std::vector< int > va_priorities
Definition: wmva_runner.h:49
void setup(const WxCryptSet &wxc) override
Setup hostaction object using supplied cryptset.
void typeCheck() override
Check that the provided variables meet the expected variable types for this hostaction.
WxStepperStatus step() override
Advance the stepper by assigned time step.
variables_type variables_
Definition: wmva_runner.h:56
va_runner(const WmConstOpaquePtr &parent_solver)
Definition: wmva_runner.h:59
void finish_sync()
wait for syncing to finish
void start_sync()
Asynchronously start syncing ghost cell data.
std::vector< wxm::dfem::variable_adjuster::variable_adjuster_t * > adjusters_
Definition: wmva_runner.h:46
int min_priority
Definition: wmva_runner.h:51
int max_priority
Definition: wmva_runner.h:53
bool needsDomain() const override
Return true if this updater needs a domain to work on.
Definition: wmva_runner.h:65
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8