WARPXM v1.10.0
Loading...
Searching...
No Matches
distributed_variable.h
Go to the documentation of this file.
1#ifndef DISTRIBUTED_VARIABLE_T_H
2#define DISTRIBUTED_VARIABLE_T_H
3
4// Wm includes
8#include "lib/wxmsgbase.h"
9#include "variable/distributed_variable.h"
10#include "variable/variable.h"
11
12#include <map>
13
14namespace wxm
15{
16namespace dfem
17{
18namespace variable
19{
20
22{
23public:
26 const std::vector<std::string>& subdomain_names,
27 const std::vector<std::string>& virtual_subdomains,
28 const WxRange& element_range);
29
32
38 void fill(const real& value);
39
47
54 const wxm::dfem::array::patch_array_t& patch_array(const int patch_index) const;
55
61 bool has_patch_array(const int patch_index) const;
62
69 void dump(WxIoBase& io, WxIoNodeType& group_node) const;
70
79 void load(WxIoBase& io, const WxIoNodeType& group_node);
80
81 array::subdomain_array_t* get_subdomain_array(const std::string& subdomain);
82
83protected:
84 // This is a quick lookup map used with the patch_array_function
85 typedef std::map<int, wxm::dfem::array::patch_array_t*> patch_array_map_t;
86 typedef std::map<std::string, wxm::dfem::array::subdomain_array_t*>
88
91
93 const std::vector<std::string>& _subdomain_names;
94 const std::vector<std::string>& virtual_subdomains_;
96
97private:
98};
99
101{
102public:
105
108
119 void setup(const WxCryptSet& wxc) override;
120
130 void swap(wxm::variable::variable_t& otherVar) override;
131
138 bool check_compatible(const wxm::variable::variable_t& var) const override;
139
147 const int patch_index) override;
148
156 const int patch_index) const override;
157
164 bool has_patch_array(const int component_index, const int patch_index) const override;
165
172 void fill(const std::vector<real>& values) override;
173
180 void dump(WxIoBase& io, WxIoNodeType& group_node) const override;
181
190 void load(WxIoBase& io, const WxIoNodeType& group_node) override;
191
193 int component_index,
194 const std::string& subdomain,
195 WxIoNodeType comp_group) override;
196
197protected:
200 typedef std::vector<distributed_component_t*> component_arrays_t;
201
204
207
210
211private:
214
217
219 distributed_variable_t& operator=(const distributed_variable_t& other);
220};
221} // namespace variable
222} // namespace dfem
223} // namespace wxm
224
225#endif // DISTRIBUTED_VARIABLE_T_H
Definition: wmbasisarrayset.h:13
Opaque Pointer object that carries the referenced data type, but does not expose this payload type as...
Definition: wmopaqueptr.h:81
Definition: wmdomain.h:35
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
WxRange represents a hyper-rectangular domain of an n-dimensional space of integers.
Definition: wxrange.h:23
Definition: array.h:190
The patch_array_t class defines a dataset associated with a patch of the domain This class will be us...
Definition: patch_array.h:31
The subdomain_array_t class is used to represent a scalar existing on a basis within a portion of the...
Definition: subdomain_array.h:34
Definition: distributed_variable.h:22
void load(WxIoBase &io, const WxIoNodeType &group_node)
Load object from file.
std::map< int, wxm::dfem::array::patch_array_t * > patch_array_map_t
Definition: distributed_variable.h:85
const std::vector< std::string > & virtual_subdomains_
Definition: distributed_variable.h:94
const wxm::dfem::array::patch_array_t & patch_array(const int patch_index) const
Aquire a patch array for a specified component.
wxm::dfem::array::patch_array_t & patch_array(const int patch_index)
Aquire a patch array for a specified component.
patch_array_map_t _patch_array_map
Definition: distributed_variable.h:89
distributed_component_t(const WmDomain &domain, const std::vector< std::string > &subdomain_names, const std::vector< std::string > &virtual_subdomains, const WxRange &element_range)
Constructor.
void fill(const real &value)
Fill the distributed variable with a value for each component.
subdomain_arrays_t _subdomain_arrays
Definition: distributed_variable.h:90
bool has_patch_array(const int patch_index) const
Check if patch array exists.
const WmDomain & _domain
Definition: distributed_variable.h:92
void dump(WxIoBase &io, WxIoNodeType &group_node) const
Write out the array to file.
array::subdomain_array_t * get_subdomain_array(const std::string &subdomain)
std::map< std::string, wxm::dfem::array::subdomain_array_t * > subdomain_arrays_t
Definition: distributed_variable.h:87
WxRange _element_range
Definition: distributed_variable.h:95
const std::vector< std::string > & _subdomain_names
Definition: distributed_variable.h:93
Definition: distributed_variable.h:101
void setup(const WxCryptSet &wxc) override
Setup an array from input file block.
void load(WxIoBase &io, const WxIoNodeType &group_node) override
Load object from file.
WxRange _element_range
Range of each element.
Definition: distributed_variable.h:206
bool check_compatible(const wxm::variable::variable_t &var) const override
Compares this variable to another supplied WmVariable and report if they are swap compatible.
wxm::basis::basis_t * _basis
Basis associated with array.
Definition: distributed_variable.h:209
bool has_patch_array(const int component_index, const int patch_index) const override
Check if variable exists on patch.
wxm::array::patch_array_t & patch_array(const int component_index, const int patch_index) override
Aquire a patch array for a specified component.
void load_subdomain_data(WxIoBase &io, int component_index, const std::string &subdomain, WxIoNodeType comp_group) override
Loads data from file into a particular component/subdomain section.
component_arrays_t _component_arrays
Where the data is stored.
Definition: distributed_variable.h:203
void fill(const std::vector< real > &values) override
Fill the distributed variable with a value for each component.
void dump(WxIoBase &io, WxIoNodeType &group_node) const override
Write out the array to file.
void swap(wxm::variable::variable_t &otherVar) override
Swap the internal data storage of this variable with otherVar leaving the outer shell the same,...
const wxm::array::patch_array_t & patch_array(const int component_index, const int patch_index) const override
Aquire a patch array for a specified component.
std::vector< distributed_component_t * > component_arrays_t
Component arrays associates a component index with a patch array map.
Definition: distributed_variable.h:200
distributed_variable_t(const WmConstOpaquePtr &parentPointer)
Constructor.
Defines an interface for variables that exits over distributed memory.
Definition: distributed_variable.h:28
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
#define real
Definition: wmoclunstructuredreconstruction.h:11