WARPXM v1.10.0
Loading...
Searching...
No Matches
unique_patch_array.h
Go to the documentation of this file.
1#pragma once
2
3// Wm includes
4#include "array/array.h"
6
7namespace wxm
8{
9namespace dfem
10{
11namespace array
12{
19{
20public:
27
30
33
40 {
41 return _patch;
42 }
43
50 virtual void dump(WxIoBase& io, WxIoNodeType& group_node) const;
51
59 virtual void load(WxIoBase& io, const WxIoNodeType& group_nodes);
60
66 const WxRange& element_range() const
67 {
68 return _element_range;
69 }
70
71 friend std::ostream& operator<<(std::ostream& stream,
73 {
74 stream << static_cast<const wxm::array::patch_array_t&>(array);
75 return stream;
76 }
77
83 real& operator[](int index) override
84 {
85 return (*_data)[0];
86 }
87
93 const real& operator[](int index) const override
94 {
95 return (*_data)[0];
96 }
97
98protected:
101
104
108
112
113private:
116
118 UniquePatchArray& operator=(const UniquePatchArray& other);
119};
120} // namespace array
121} // namespace dfem
122} // namespace wxm
Definition: wmunstructuredpatch.h:22
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
std::shared_ptr< std::vector< real > > _data
Shared pointer containing data.
Definition: array.h:184
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
const WxRange & element_range() const
Get the range of data associated with each mesh element.
Definition: unique_patch_array.h:66
virtual ~UniquePatchArray()
Virtual Destructor.
UniquePatchArray(const WmUnstructuredPatch &patch, const WxRange &element_range)
Constructor for UniquePatchArray.
const real & operator[](int index) const override
Return data at index 0 This overrides default behavior to take index 0 because size should be 1.
Definition: unique_patch_array.h:93
const WmUnstructuredPatch & _patch
Patch associated with array.
Definition: unique_patch_array.h:100
virtual void load(WxIoBase &io, const WxIoNodeType &group_nodes)
Load object from file.
real & operator[](int index) override
Return data at index 0 This overrides default behavior to take index 0 because size should be 1.
Definition: unique_patch_array.h:83
WxRange _element_range
Range describing each element.
Definition: unique_patch_array.h:103
const WmUnstructuredPatch & patch() const
Get the patch this array is setup for.
Definition: unique_patch_array.h:39
UniquePatchArray(const UniquePatchArray &other)
Copy Constructor.
friend std::ostream & operator<<(std::ostream &stream, const wxm::dfem::array::UniquePatchArray &array)
Definition: unique_patch_array.h:71
WxRange _global_range
Range describing global dataset in subdomain - used for data io.
Definition: unique_patch_array.h:107
virtual void dump(WxIoBase &io, WxIoNodeType &group_node) const
Write out the array to file.
WxRange _local_range
Range describing local dataset in subdomain - used for data io.
Definition: unique_patch_array.h:111
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