WARPXM v1.10.0
Loading...
Searching...
No Matches
wmunstructuredpatch.h
Go to the documentation of this file.
1#ifndef WMUNSTRUCTURED_PATCH_H
2#define WMUNSTRUCTURED_PATCH_H
3
4// WarpX includes
5#include "wxrange.h"
6
7// STD includes
8#include <iostream>
9#include <map>
10#include <typeinfo>
11#include <vector>
12
13// List of classes found in this library
14
15class WmDomain;
20
22{
23public:
24 typedef std::pair<int, WmUnstructuredPatchLink*> patchLinkPair_t;
25 typedef std::map<int, WmUnstructuredPatchLink*> patchLinkMap_t;
26
27 typedef std::pair<int, int> reconstructionID_t;
28
29 WmUnstructuredPatch(int patchIndex,
30 const std::string& patchName,
31 int primitiveID,
32 int numLayers,
33 const std::vector<int>& numElementsPerLayer,
34 const std::vector<int>& numNodesPerLayer,
35 const std::string& subdomainName,
36 WmDomain* pDomain);
37
39
40 void setProcID(int num);
42 {
43 _pUG = pUG;
44 }
45
46 const WmDomain& domain() const
47 {
48 return *_domain;
49 }
50
51 void setMeshTranslation(int* mT);
52 void setMeshIDs(int previousMeshID, int meshID);
53
54 int getPatchIndex() const
55 {
56 return _patchIndex;
57 }
58 int getPrimitiveID() const
59 {
60 return _primitiveID;
61 }
62 const std::string& getName() const
63 {
64 return _name;
65 }
66 int getProcID() const
67 {
68 return _procID;
69 }
71 {
72 return _numTotalElements;
73 }
74 int getNumTotalNodes() const
75 {
76 return _numTotalNodes;
77 }
78 int getNumElementsInLayer(int ghostLayer) const;
79 int getNumNodesInLayer(int ghostLayer) const;
80 int getNumLayers() const
81 {
82 return _numLayers;
83 }
84 bool isLocal() const
85 {
86 return _local;
87 }
88 const std::string& getSubdomainName() const
89 {
90 return _subdomainName;
91 }
93 {
94 return _domain;
95 }
97 {
98 return _pUG;
99 }
100
101 std::map<int, int> getPatchConnectivity() const;
102
103 int getMeshID() const
104 {
105 return _meshID;
106 }
107 int getPMeshID() const
108 {
109 return _pMeshID;
110 }
111
112 void addLink(const std::string& linkedPatchName,
113 int linkedPatchIndex,
114 const std::vector<int>& numElementsPerLayer);
115 void
116 setLinkedPatch(int linkedPatchIndex, const int* fromIndexes, const int* toIndexes);
118 {
119 return _linkedPatches;
120 }
122
123 int getNumElementsBelowLayer(int layer) const;
124
125 int getLayerOfElement(int elementIndex) const;
126
127 void setSubdomainRange(const WxRange& range)
128 {
129 _subdomainRange = range;
130 }
132 {
133 return _subdomainRange;
134 }
135
136 void setPatchRange(const WxRange& range)
137 {
138 _patchRange = range;
139 }
140 const WxRange& getPatchRange() const
141 {
142 return _patchRange;
143 }
144
145 const int* getMeshTranslation() const
146 {
147 return _meshTranslation;
148 }
149
150protected:
151 // General Patch Information
152 std::string _name; // Name of Patch
153 int _patchIndex; // Global index of Patch
154 std::string _subdomainName; // Name of Parent Subdomain
155 int _primitiveID; // Primitive ID number of Element (see unstructured geometry)
156 WmDomain* _domain; // Parent domain of patch
157 bool _local; // Locality test
158 int _procID; // Processor ID
159 int _numLayers; // Number of layers of elements and nodes
160
161 // Patch Parameters
162 int* _numElementsPerLayer; // Total Elements of patch specified in layers
163 int _numTotalElements; // This will be called a lot
164
168
169 // Node Properties
170 int* _numNodesPerLayer; // Total Nodes of patch specified in layers
171 int _numTotalNodes; // This will be called a lot
172
173 // Holds geometry
175
176 // Linked patches
178
179 // Range of patch within subdomain
181
182 // Range of subdomain
184};
185
198{
199public:
209 int from_patch_index,
210 const std::string& from_patch_name,
211 const std::vector<int>& num_linked_elements_per_layer);
212
215
221 void setLinkedIndexes(const int* fromIndexes, const int* toIndexes);
222
227 bool isShared() const
228 {
229 return _sharedBoundary;
230 }
231
237 {
238 return *_from_patch;
239 }
240
246 {
247 return _to_patch;
248 }
249
254 const std::vector<int>& from_indexes() const
255 {
256 return _from_indexes;
257 }
258
263 const std::vector<int>& to_indexes() const
264 {
265 return _to_indexes;
266 }
267
274
275 // Old commands - need to remove these
276 const std::string& getLinkedSubdomainName() const;
277
278 int getNumElements() const
279 {
280 return _numElements;
281 }
282 const std::vector<int>& getNumElementsPerLayer() const
283 {
285 }
286 const int* getLinkedIndexes() const
287 {
288 return _from_indexes.data();
289 }
290 const int* getIndexes() const
291 {
292 return _to_indexes.data();
293 }
294
296 {
297 return &_to_patch;
298 }
300 {
301 return _from_patch;
302 }
303
305 {
307 }
308
309protected:
312
315
318
320 std::string _from_patch_name;
321
324
326 std::vector<int> _numElementsPerLayer;
327
330
332 std::vector<int> _from_indexes;
333
335 std::vector<int> _to_indexes;
336
337private:
340};
341
342#endif
Definition: wmdomain.h:35
Class used for generating mesh geometry concerns.
Definition: wmunstructuredgeometry.h:45
Definition: wmunstructuredpatch.h:22
int getNumElementsInLayer(int ghostLayer) const
WmUnstructuredGeometry * getUnstructuredGeometry() const
Definition: wmunstructuredpatch.h:96
int getLayerOfElement(int elementIndex) const
int _primitiveID
Definition: wmunstructuredpatch.h:155
int getNumTotalNodes() const
Definition: wmunstructuredpatch.h:74
std::map< int, WmUnstructuredPatchLink * > patchLinkMap_t
Definition: wmunstructuredpatch.h:25
int * _numNodesPerLayer
Definition: wmunstructuredpatch.h:170
int getPrimitiveID() const
Definition: wmunstructuredpatch.h:58
WxRange _subdomainRange
Definition: wmunstructuredpatch.h:183
const int * getMeshTranslation() const
Definition: wmunstructuredpatch.h:145
WxRange _patchRange
Definition: wmunstructuredpatch.h:180
WmUnstructuredPatch(int patchIndex, const std::string &patchName, int primitiveID, int numLayers, const std::vector< int > &numElementsPerLayer, const std::vector< int > &numNodesPerLayer, const std::string &subdomainName, WmDomain *pDomain)
const WmDomain & domain() const
Definition: wmunstructuredpatch.h:46
int _procID
Definition: wmunstructuredpatch.h:158
std::string _name
Definition: wmunstructuredpatch.h:152
std::map< int, int > getPatchConnectivity() const
std::string _subdomainName
Definition: wmunstructuredpatch.h:154
int getNumTotalElements() const
Definition: wmunstructuredpatch.h:70
void setMeshTranslation(int *mT)
int getNumElementsBelowLayer(int layer) const
void setProcID(int num)
int _numTotalElements
Definition: wmunstructuredpatch.h:163
patchLinkMap_t _linkedPatches
Definition: wmunstructuredpatch.h:177
const std::string & getSubdomainName() const
Definition: wmunstructuredpatch.h:88
const WxRange & getSubdomainRange() const
Definition: wmunstructuredpatch.h:131
void addLink(const std::string &linkedPatchName, int linkedPatchIndex, const std::vector< int > &numElementsPerLayer)
const WxRange & getPatchRange() const
Definition: wmunstructuredpatch.h:140
void setLinkedPatch(int linkedPatchIndex, const int *fromIndexes, const int *toIndexes)
void setPatchRange(const WxRange &range)
Definition: wmunstructuredpatch.h:136
WmDomain * getDomain() const
Definition: wmunstructuredpatch.h:92
int getNumLayers() const
Definition: wmunstructuredpatch.h:80
int _pMeshID
Definition: wmunstructuredpatch.h:166
bool isLocal() const
Definition: wmunstructuredpatch.h:84
int getNumNodesInLayer(int ghostLayer) const
WmUnstructuredGeometry * _pUG
Definition: wmunstructuredpatch.h:174
const WmUnstructuredPatchLink & getPatchLink(const WmUnstructuredPatch &patch) const
int _meshID
Definition: wmunstructuredpatch.h:165
int getProcID() const
Definition: wmunstructuredpatch.h:66
void setGeometry(WmUnstructuredGeometry *pUG)
Definition: wmunstructuredpatch.h:41
const patchLinkMap_t & getPatchLinks() const
Definition: wmunstructuredpatch.h:117
WmDomain * _domain
Definition: wmunstructuredpatch.h:156
int _patchIndex
Definition: wmunstructuredpatch.h:153
bool _local
Definition: wmunstructuredpatch.h:157
int _numTotalNodes
Definition: wmunstructuredpatch.h:171
int getPatchIndex() const
Definition: wmunstructuredpatch.h:54
const std::string & getName() const
Definition: wmunstructuredpatch.h:62
int getPMeshID() const
Definition: wmunstructuredpatch.h:107
int * _numElementsPerLayer
Definition: wmunstructuredpatch.h:162
void setSubdomainRange(const WxRange &range)
Definition: wmunstructuredpatch.h:127
std::pair< int, int > reconstructionID_t
Definition: wmunstructuredpatch.h:27
int * _meshTranslation
Definition: wmunstructuredpatch.h:167
int getMeshID() const
Definition: wmunstructuredpatch.h:103
int _numLayers
Definition: wmunstructuredpatch.h:159
std::pair< int, WmUnstructuredPatchLink * > patchLinkPair_t
Definition: wmunstructuredpatch.h:24
void setMeshIDs(int previousMeshID, int meshID)
Class used for generating reconstruction arrays for the high-order finite volume method.
Definition: wmunstructuredreconstruction.h:19
WxRange represents a hyper-rectangular domain of an n-dimensional space of integers.
Definition: wxrange.h:23