WARPXM v1.10.0
Loading...
Searching...
No Matches
unique_distributed_variable.h
Go to the documentation of this file.
1#pragma once
2
3// Wm includes
6#include "variable/distributed_variable.h"
7
8namespace wxm
9{
10namespace dfem
11{
12namespace variable
13{
14
21{
22public:
25 const std::vector<std::string>& subdomain_names,
26 const std::vector<std::string>& virtual_subdomains,
27 const WxRange& element_range);
28
31
37 void fill(const real& value);
38
46
53 const wxm::dfem::array::UniquePatchArray& patch_array(const int patch_index) const;
54
60 bool has_patch_array(const int patch_index) const;
61
68 void dump(WxIoBase& io, WxIoNodeType& group_node) const;
69
78 void load(WxIoBase& io, const WxIoNodeType& group_node);
79
81 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::UniquePatchArray*> patch_array_map_t;
86 typedef std::map<std::string, wxm::dfem::array::UniqueSubdomainArray*>
88
91
93 const std::vector<std::string>& _subdomain_names;
94 const std::vector<std::string>& _virtual_subdomains;
96
97private:
98};
99
106{
107public:
110
113
118 void setup(const WxCryptSet& wxc) override;
119
124 void fill(const std::vector<real>& values) override;
125
133 void swap(variable_t& other) override;
134
141 bool check_compatible(const variable_t& other) const override;
142
151 void dump(WxIoBase& io, WxIoNodeType& group_node) const override;
152
160 void load(WxIoBase& io, const WxIoNodeType& group_node) override;
161
169 const int patch_index) override;
170
178 const int patch_index) const override;
179
186 bool has_patch_array(const int component_index, const int patch_index) const override;
187
192 int component_index,
193 const std::string& subdomain,
194 WxIoNodeType comp_group) override;
195
196protected:
199 typedef std::vector<UniqueDistributedComponent*> component_arrays_t;
200
203
206
207private:
210
213
216};
217
218} // namespace variable
219} // namespace dfem
220} // namespace wxm
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 UniquePatchArray class defines a dataset associated with a patch of the domain which has a single...
Definition: unique_patch_array.h:19
The UniqueSubdomainArray class is used to represent a scalar existing within a portion of the domain ...
Definition: unique_subdomain_array.h:26
Class for Unique Distributed Component.
Definition: unique_distributed_variable.h:21
subdomain_arrays_t _subdomain_arrays
Definition: unique_distributed_variable.h:90
const std::vector< std::string > & _subdomain_names
Definition: unique_distributed_variable.h:93
WxRange _element_range
Definition: unique_distributed_variable.h:95
wxm::dfem::array::UniquePatchArray & patch_array(const int patch_index)
Aquire a patch array for a specified component.
void dump(WxIoBase &io, WxIoNodeType &group_node) const
Write out the array to file.
void load(WxIoBase &io, const WxIoNodeType &group_node)
Load object from file.
std::map< int, wxm::dfem::array::UniquePatchArray * > patch_array_map_t
Definition: unique_distributed_variable.h:85
void fill(const real &value)
Fill the distributed variable with a value for each component.
bool has_patch_array(const int patch_index) const
Check if patch array exists.
patch_array_map_t _patch_array_map
Definition: unique_distributed_variable.h:89
wxm::dfem::array::UniqueSubdomainArray * get_subdomain_array(const std::string &subdomain)
const std::vector< std::string > & _virtual_subdomains
Definition: unique_distributed_variable.h:94
std::map< std::string, wxm::dfem::array::UniqueSubdomainArray * > subdomain_arrays_t
Definition: unique_distributed_variable.h:87
const wxm::dfem::array::UniquePatchArray & patch_array(const int patch_index) const
Aquire a patch array for a specified component.
const WmDomain & _domain
Definition: unique_distributed_variable.h:92
UniqueDistributedComponent(const WmDomain &domain, const std::vector< std::string > &subdomain_names, const std::vector< std::string > &virtual_subdomains, const WxRange &element_range)
Constructor.
Class for Unique Distributed Variable.
Definition: unique_distributed_variable.h:106
std::vector< UniqueDistributedComponent * > component_arrays_t
Component arrays associates a component index with a patch array map.
Definition: unique_distributed_variable.h:199
void setup(const WxCryptSet &wxc) override
Setup object using supplied crypset.
wxm::array::patch_array_t & patch_array(const int component_index, const int patch_index) override
Acquire a patch array for a specified component.
bool has_patch_array(const int component_index, const int patch_index) const override
Query if the patch (or component) exist for a variable.
void swap(variable_t &other) override
Swap the internal data storage of this variable with otherVar leaving the outer shell the same,...
void dump(WxIoBase &io, WxIoNodeType &group_node) const override
Dump object to file.
UniqueDistributedVariable(const WmConstOpaquePtr &parentPointer)
Constructor.
const wxm::array::patch_array_t & patch_array(const int component_index, const int patch_index) const override
Acquire a patch array for a specified component.
component_arrays_t _component_arrays
Where the data is stored.
Definition: unique_distributed_variable.h:202
WxRange _element_range
Range of each element.
Definition: unique_distributed_variable.h:205
bool check_compatible(const variable_t &other) const override
Compares this variable to another supplied variable_t and report if they are swap compatible.
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.
void fill(const std::vector< real > &values) override
For each component, apply a fill value throughout the domain.
void load(WxIoBase &io, const WxIoNodeType &group_node) override
Load object from file.
Defines an interface for variables that exits over distributed memory.
Definition: distributed_variable.h:28
int component_index(const std::string &component_name) const
Returns the component number associated with the componentName.
variable_t(const WmConstOpaquePtr &parent_solver)
Constructor sets up basic variable container, but no properties or specifics.
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