WARPXM v1.10.0
Loading...
Searching...
No Matches
distributed_variable.h
Go to the documentation of this file.
1#ifndef DISTRIBUTED_VARIABLE_H
2#define DISTRIBUTED_VARIABLE_H
3
4// STL includes
5#include <string>
6
7// Wm includes
8#include "variable/variable.h"
9
10// forward declarations
11namespace wxm
12{
13namespace array
14{
15class patch_array_t;
16}
17} // namespace wxm
18
19namespace wxm
20{
21namespace variable
22{
23
28{
29
30public:
36 virtual void setup(const WxCryptSet& wxc);
37
42 const std::vector<std::string>& subdomain_names() const
43 {
44 return _subdomain_names;
45 }
46
52 bool on_subdomain(const std::string& subdomain_name) const
53 {
54 bool is_real =
55 std::find(_subdomain_names.begin(), _subdomain_names.end(), subdomain_name) !=
56 _subdomain_names.end();
57 if (is_real)
58 {
59 return true;
60 }
61 return std::find(_virtual_subdomains.begin(),
63 subdomain_name) != _virtual_subdomains.end();
64 }
65
73 const int patch_index) = 0;
74
82 const int patch_index) const = 0;
83
90 virtual bool has_patch_array(const int component_index,
91 const int patch_index) const = 0;
92
96 virtual void load_subdomain_data(WxIoBase& io,
98 const std::string& subdomain,
99 WxIoNodeType comp_group) = 0;
100
101protected:
103 std::vector<std::string> _subdomain_names;
104
106 std::vector<std::string> _virtual_subdomains;
107
110
111private:
114
117
119 distributed_variable_t& operator=(const distributed_variable_t& other);
120};
121} // namespace variable
122} // namespace wxm
123
124#endif // DISTRIBUTED_VARIABLE_H
Opaque Pointer object that carries the referenced data type, but does not expose this payload type as...
Definition: wmopaqueptr.h:81
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 access to hierachical datasets.
Definition: wxiobase.h:25
Definition: array.h:190
Defines an interface for variables that exits over distributed memory.
Definition: distributed_variable.h:28
virtual wxm::array::patch_array_t & patch_array(const int component_index, const int patch_index)=0
Aquire a patch array for a specified component.
distributed_variable_t(const WmConstOpaquePtr &parent_solver)
Forces the distributed variable to be a base class.
const std::vector< std::string > & subdomain_names() const
Get a list of subdomains on which this distributed variable exists.
Definition: distributed_variable.h:42
bool on_subdomain(const std::string &subdomain_name) const
Check if this distributed variable exists on a given subdomain.
Definition: distributed_variable.h:52
std::vector< std::string > _virtual_subdomains
List of subdomains on which this distributed variable exists.
Definition: distributed_variable.h:106
virtual void setup(const WxCryptSet &wxc)
Setup the distributed variable.
std::vector< std::string > _subdomain_names
List of subdomains on which this distributed variable exists.
Definition: distributed_variable.h:103
virtual const wxm::array::patch_array_t & patch_array(const int component_index, const int patch_index) const =0
Aquire a patch array for a specified component.
virtual void load_subdomain_data(WxIoBase &io, int component_index, const std::string &subdomain, WxIoNodeType comp_group)=0
Loads data from file into a particular component/subdomain section.
virtual bool has_patch_array(const int component_index, const int patch_index) const =0
Query if the patch (or component) exist for a variable.
Definition: variable.h:22
int component_index(const std::string &component_name) const
Returns the component number associated with the componentName.
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
Provides a means for derived messengers to return implimentation specific message status flags and da...
Definition: wxiotmpl.h:23