WARPXM v1.10.0
Loading...
Searching...
No Matches
subdomain_array.h
Go to the documentation of this file.
1#ifndef SUBDOMAIN_ARRAY_T_H
2#define SUBDOMAIN_ARRAY_T_H
3
4// STL includes
5#include <limits>
6#include <algorithm>
7
8// Wx includes
9#include "lib/wxany.h"
10
11// Wm includes
12#include "lib/wmdomain.h"
13#include "basis/basis.h"
14#include "array/array.h"
17
22namespace wxm
23{
24namespace dfem
25{
26namespace array
27{
28
34{
35public:
37 typedef std::map<int, patch_array_t*> patch_array_map_t;
38
48 const std::string& subdomain_name,
49 bool is_virtual,
50 const WxRange& element_range);
51
54
59 void fill(const real& value);
60
68 virtual void dump(WxIoBase& io,
69 WxIoNodeType& group_node,
70 bool include_ghost_elements = false) const;
71
80 virtual void load(WxIoBase& io,
81 const WxIoNodeType& group_node,
82 bool include_ghost_elements = false);
83
89 patch_array_t& patch_array(const int patch_index);
90
96 const patch_array_t& patch_array(const int patch_index) const;
97
98 // /**
99 // * @brief Returns the subdomain name associated with this array
100 // * @return Subdomain name
101 // */
102 // const std::string & subdomain_name() const {return _subdomain_name;}
103
104 friend std::ostream& operator<<(std::ostream& stream,
106 {
107 stream << "Array for subdomain '" << array._subdomain_name << "':\n";
108 for (auto& patch_array_pair : array._patch_array_map)
109 {
110 const int patch_index = patch_array_pair.first;
112 *(patch_array_pair.second);
113 stream << "Patch index '" << patch_index << "' : ";
114 stream << patch_array << "\n";
115 }
116 return stream;
117 }
118
119 const std::string& name() const
120 {
121 return _subdomain_name;
122 }
123
124 bool is_virtual() const
125 {
126 return is_virtual_;
127 }
128
129protected:
132
134 std::string _subdomain_name;
135
138
141
144
147
149
150private:
153
156
158 subdomain_array_t& operator=(const subdomain_array_t& other);
159};
160
161} // namespace array
162} // namespace dfem
163} // namespace wxm
164
167#endif // SUBDOMAIN_ARRAY_T_H
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 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
patch_array_t & patch_array(const int patch_index)
Get the array associated with patch_index.
bool is_virtual_
Definition: subdomain_array.h:148
virtual void dump(WxIoBase &io, WxIoNodeType &group_node, bool include_ghost_elements=false) const
Write out the array to file.
virtual void load(WxIoBase &io, const WxIoNodeType &group_node, bool include_ghost_elements=false)
Load object from file.
void fill(const real &value)
Fill subdomain with a value.
const std::string & name() const
Definition: subdomain_array.h:119
virtual ~subdomain_array_t()
Destructor.
friend std::ostream & operator<<(std::ostream &stream, const wxm::dfem::array::subdomain_array_t &array)
Definition: subdomain_array.h:104
std::string _subdomain_name
Name of subdomain in mesh.
Definition: subdomain_array.h:134
const patch_array_t & patch_array(const int patch_index) const
Get the array associated with patch_index.
const WmDomain & _domain
Reference to domain object.
Definition: subdomain_array.h:131
int _mesh_id
Mesh id.
Definition: subdomain_array.h:146
subdomain_array_t(const WmDomain &domain, const std::string &subdomain_name, bool is_virtual, const WxRange &element_range)
Constructor.
WxRange _global_range
Global range of array.
Definition: subdomain_array.h:143
std::map< int, patch_array_t * > patch_array_map_t
Used to store patch arrays.
Definition: subdomain_array.h:37
bool is_virtual() const
Definition: subdomain_array.h:124
const WxRange & _element_range
Range for each element.
Definition: subdomain_array.h:140
patch_array_map_t _patch_array_map
Collection of patches found in subdomain.
Definition: subdomain_array.h:137
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