WARPXM v1.10.0
Loading...
Searching...
No Matches
variable_adjuster.h
Go to the documentation of this file.
1#ifndef WMVARIABLEADJUSTER_H
2#define WMVARIABLEADJUSTER_H
3
4// Wm includes
5#include "dfem/dfem.h"
8
9#include <memory>
10
11// forward declarations
12class WmMemoryObject;
13
14namespace wxm
15{
16namespace dfem
17{
18namespace variable_adjuster
19{
31{
32protected:
33 std::vector<size_t> _var_idcs;
34
35 std::vector<std::unique_ptr<WmApplication>> _apps;
36
37 // very hacked together support for copy_all and limiters limiting all variables
38 bool _grab_all = false;
39
40public:
42
45
50 void setup(const WxCryptSet& wxc) override;
51
58 virtual void solve(real time, variables_type& input) = 0;
59
60 std::vector<wxm::array::patch_array_t*> get_patch_arrays(const variables_type& in);
61
62 // not actually used, but just here to make this class
63 // non-abstract
64 void process() override
65 {
66 }
67
68 virtual const std::vector<size_t>& get_input_indices() const
69 {
70 return _var_idcs;
71 }
72
78 int priority() const
79 {
80 return _priority;
81 }
82
92 virtual void Barrier(const WxMsgBase& msg, const real time, variables_type& input)
93 {
94 // Do nothing by default, subclasses may override.
95 }
96
97protected:
99};
100
102} // namespace variable_adjuster
103} // namespace dfem
104} // namespace wxm
105
106#endif // WMVARIABLEADJUSTER_H
The WmPatchProcess class is a base class for processes that are broken up onto separate sections of t...
Definition: wmpatchprocess.h:26
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
Provides an abstract interface for message based communication between different processes.
Definition: wxmsgbase.h:22
The WmVariableAdjuster class is a base class for variable adjusters.
Definition: variable_adjuster.h:31
virtual const std::vector< size_t > & get_input_indices() const
Definition: variable_adjuster.h:68
std::vector< wxm::array::patch_array_t * > get_patch_arrays(const variables_type &in)
int priority() const
Getter function for priority.
Definition: variable_adjuster.h:78
int _priority
Definition: variable_adjuster.h:98
virtual void Barrier(const WxMsgBase &msg, const real time, variables_type &input)
An opportunity for the variable adjuster to perform any MPI operations it needs to after solve is cal...
Definition: variable_adjuster.h:92
wxm::temporal_solver::variables_type variables_type
Definition: variable_adjuster.h:41
void setup(const WxCryptSet &wxc) override
Setup the spatial solver using the cryptset.
bool _grab_all
Definition: variable_adjuster.h:38
virtual void solve(real time, variables_type &input)=0
applies the variable adjuster to input
std::vector< std::unique_ptr< WmApplication > > _apps
Definition: variable_adjuster.h:35
void process() override
Definition: variable_adjuster.h:64
std::vector< size_t > _var_idcs
Definition: variable_adjuster.h:33
std::vector< std::pair< wxm::variable::distributed_variable_t *, size_t > > variables_type
Definition: wmtemporalsolver.h:47
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11