WARPXM v1.10.0
Loading...
Searching...
No Matches
unique_subdomain_array.h
Go to the documentation of this file.
1#pragma once
2
3// STL includes
4#include <map>
5
6// Wm includes
8
13namespace wxm
14{
15namespace dfem
16{
17namespace array
18{
19
26{
27public:
28 // Used to stored unique patch arrays
29 typedef std::map<int, wxm::dfem::array::UniquePatchArray*> unique_patch_array_map;
30
40 const std::string& subdomain_name,
41 bool is_virtual,
42 const WxRange& element_range);
43
46
51 void fill(const real& value);
52
59 virtual void dump(WxIoBase& io, WxIoNodeType& group_node) const;
60
68 virtual void load(WxIoBase& io, const WxIoNodeType& group_node);
69
75 UniquePatchArray& patch_array(const int patch_index);
76
82 const UniquePatchArray& patch_array(const int patch_index) const;
83
84 friend std::ostream& operator<<(std::ostream& stream,
86 {
87 stream << "Array for subdomain '" << array._subdomain_name << "':\n";
88 for (auto& patch_array_pair : array._patch_array_map)
89 {
90 const int patch_index = patch_array_pair.first;
92 *(patch_array_pair.second);
93 stream << "Patch index '" << patch_index << "' : ";
94 stream << patch_array << "\n";
95 }
96 return stream;
97 }
98
99 const std::string& name() const
100 {
101 return _subdomain_name;
102 }
103
104 bool is_virtual() const
105 {
106 return _is_virtual;
107 }
108
109protected:
112
114 std::string _subdomain_name;
115
118
121
124
127
129
130private:
133
136
138 UniqueSubdomainArray& operator=(const UniqueSubdomainArray& other);
139};
140
141} // namespace array
142} // namespace dfem
143} // namespace wxm
Definition: wmdomain.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
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
const UniquePatchArray & patch_array(const int patch_index) const
Get the array associated with patch_index.
virtual void load(WxIoBase &io, const WxIoNodeType &group_node)
Load object from file.
std::string _subdomain_name
Name of subdomain in mesh.
Definition: unique_subdomain_array.h:114
UniqueSubdomainArray(const WmDomain &domain, const std::string &subdomain_name, bool is_virtual, const WxRange &element_range)
Constructor.
virtual void dump(WxIoBase &io, WxIoNodeType &group_node) const
Write out the array to file.
virtual ~UniqueSubdomainArray()
Destructor.
bool is_virtual() const
Definition: unique_subdomain_array.h:104
int _mesh_id
Mesh id.
Definition: unique_subdomain_array.h:126
const std::string & name() const
Definition: unique_subdomain_array.h:99
void fill(const real &value)
Fill subdomain with a value.
const WxRange & _element_range
Range for each element.
Definition: unique_subdomain_array.h:120
const WmDomain & _domain
Reference to domain object.
Definition: unique_subdomain_array.h:111
std::map< int, wxm::dfem::array::UniquePatchArray * > unique_patch_array_map
Definition: unique_subdomain_array.h:29
WxRange _global_range
Global range of array.
Definition: unique_subdomain_array.h:123
friend std::ostream & operator<<(std::ostream &stream, const wxm::dfem::array::UniqueSubdomainArray &array)
Definition: unique_subdomain_array.h:84
unique_patch_array_map _patch_array_map
Collection of patches found in subdomain.
Definition: unique_subdomain_array.h:117
bool _is_virtual
Definition: unique_subdomain_array.h:128
UniquePatchArray & patch_array(const int patch_index)
Get the array associated with patch_index.
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