WARPXM v1.10.0
Loading...
Searching...
No Matches
phase_space_element.h
Go to the documentation of this file.
1#ifndef geometry_phase_space_element_h
2#define geometry_phase_space_element_h
3
4// WARPXM includes
6
7namespace geometry
8{
9namespace phase_space_element
10{
11
12// Helper
31 const int N,
32 const int m,
33 const int i,
34 const int j,
35 const int k);
36
42{
43public:
49 {
50 }
51
57 void setup(const int local_face_index)
58 {
59 _local_face_index = local_face_index;
60 }
61
67 void setNeighborLocalFaceIndex(const int neighbor_local_face_index)
68 {
69 _neighbor_local_face_index = neighbor_local_face_index;
70 }
71 // void setPhaseSpaceFullNormal(const real nx,
72 // const real ny,
73 // const real nz,
74 // const real nvx,
75 // const real nvy,
76 // const real nvz)
77 // {
78 // _full_real_normal[0] = nx;
79 // _full_real_normal[1] = ny;
80 // _full_real_normal[2] = nz;
81 // _full_real_normal[3] = nvx;
82 // _full_real_normal[4] = nvy;
83 // _full_real_normal[5] = nvz;
84
85 // for (int i = 0; i < 6; i++)
86 // {
87 // _full_isoparametric_normal[i] = _full_real_normal[i];
88 // }
89 // }
90
97 void setPhaseSpaceNormal(const std::vector<real> normal)
98 {
99 for (const auto& component : normal)
100 {
101 _real_normal.push_back(component);
102 _isoparametric_normal.push_back(component);
103 }
104 }
105
111 void setPhaseSpaceIsoparametricNormal(const std::vector<real>& iso_normal)
112 {
113 for (const auto& component : iso_normal)
114 {
115 _isoparametric_normal.push_back(component);
116 }
117 }
118
124 const real* getRealNormal() const
125 {
126 return _real_normal.data();
127 }
128
135 {
136 return _isoparametric_normal.data();
137 }
138
144 void setNfp(const int N_fp_phase_space)
145 {
146 _N_fp_phase_space = N_fp_phase_space;
147 }
148
154 int getNfp() const
155 {
156 return _N_fp_phase_space;
157 }
158
165 void setLocalFaceNodes(const WmBasisArraySet* phase_space_basis_set,
166 const int local_face_index)
167 {
168 const int* face_nodes = phase_space_basis_set->getFaceNodes(local_face_index);
169 for (int i = 0; i < _N_fp_phase_space; i++)
170 {
171 _local_face_nodes.push_back(face_nodes[i]);
172 }
173 }
174
180 const int* getLocalFaceNodes() const
181 {
182 return &(_local_face_nodes[0]);
183 }
184
191 void setNeighborLocalFaceNodes(const WmBasisArraySet* phase_space_basis_set,
192 const int neighbor_local_face_index)
193 {
194 // The face nodes should be oriented to that the opposite neighbor nodes line up
195 // in the array exactly
196 const int* neighbor_face_nodes =
197 phase_space_basis_set->getFaceNodes(neighbor_local_face_index);
198 for (int i = 0; i < _N_fp_phase_space; i++)
199 {
200 _neighbor_local_face_nodes.push_back(neighbor_face_nodes[i]);
201 }
202 }
203
209 const int* getNeighborLocalFaceNodes() const
210 {
211 return &(_neighbor_local_face_nodes[0]);
212 }
213
214private:
215 int _local_face_index;
216 int _neighbor_local_face_index;
217 // // normals real space [6]
218 // std::vector<real> _full_real_normal;
219 // // isoparametric space [6]
220 // std::vector<real> _full_isoparametric_normal;
221 // only number of phase space dimensions of element
222 std::vector<real> _real_normal;
223 std::vector<real> _isoparametric_normal;
224
225 int _N_fp_phase_space;
226 std::vector<int> _local_face_nodes;
227 std::vector<int> _neighbor_local_face_nodes;
228
229 // _local_face_nodes=[0,1,2];
230 // _neighbor_local_face_nodes = [6, 7, 8];
231 // getGlobalPhysicalSpaceNode()
232 // getOppositGelobalPhysicalSpaceNode()
233 // getGlobalPhaseSpaceNodeIndices(physical_element, velocity_space_indexes);
234 // getOppositeGlobalPhaseNodeIndices(physical_element, velocity_space_indexes)
235 // {
236
237 // }
238};
239
247{
248public:
253 PhaseSpaceElement(const std::shared_ptr<geometry::phase_space::PhaseSpaceDGGeometry>&
254 phase_space_dg_geometry);
259 virtual ~PhaseSpaceElement() = default;
260
265 virtual void setup();
266
273 {
274 return _N_d_physical_space;
275 }
276
283 {
284 return _N_d_velocity_space;
285 }
286
293 {
294 return _N_d_phase_space;
295 }
296
303 virtual void setNd() = 0;
304
305
307
314 getFace(const int local_face_index) const
315 {
316 return _phase_space_faces[local_face_index].get();
317 }
318
328 const int physical_element_index,
329 const int phase_space_element_local_face_index,
330 const int phase_space_element_face_node_index) const;
331
345 const int phase_space_element_face_node_index,
346 const int neighbor_global_physical_element_index,
347 const int phase_space_neighbor_element_local_face_index,
348 const int orientation,
349 const int velocity_space_element_indexes[3]) const;
350
351
356 virtual void getCommonNormal(const int physical_element_index,
357 const int phaseSpaceElementFaceIndex,
358 std::vector<real>& phaseSpaceCommonNormal) const = 0;
359
360protected:
364
365 // Phase space geometry
366 std::shared_ptr<geometry::phase_space::PhaseSpaceDGGeometry> _phase_space_dg_geometry;
367
368 // Vector of pointers to the faces of this element
369 std::vector<std::unique_ptr<geometry::phase_space_element::PhaseSpaceFace>>
371
372 // add orientations for spatial faces
373 // This creates the corresponding arrays of the phase space element spatial faces that
374 // continue from the base physical elemnt face e.g. if the triangle 3rd order face
375 // orientation is 0, 1, 2, then for the corresponding cube face of the duoprism you
376 // need to add the rest of the phase space nodes of the cube -> 0, 1, 2, ... the other
377 // cube nodes N_orientations (physical space) x Nfp_phase_space (for spatial faces)
379};
380
381} // namespace phase_space_element
382} // namespace geometry
383
384#endif
Definition: wmbasisarrayset.h:13
const int * getFaceNodes(const int face_index) const
Definition: wmbasisarrayset.h:275
Base class used for generating phase space element information for kinetic phase space calculations.
Definition: phase_space_element.h:247
int getNeighborGlobalPhaseSpaceNodeIndexFromSpatialFace(const int phase_space_element_face_node_index, const int neighbor_global_physical_element_index, const int phase_space_neighbor_element_local_face_index, const int orientation, const int velocity_space_element_indexes[3]) const
This gets the neighboring phase space node of a node on a phase space element Written ofr a spatial f...
std::vector< int > _spatial_face_orientation
Definition: phase_space_element.h:378
std::shared_ptr< geometry::phase_space::PhaseSpaceDGGeometry > _phase_space_dg_geometry
Definition: phase_space_element.h:366
virtual void getCommonNormal(const int physical_element_index, const int phaseSpaceElementFaceIndex, std::vector< real > &phaseSpaceCommonNormal) const =0
base class function
geometry::phase_space_element::PhaseSpaceFace const * getFace(const int local_face_index) const
Get at face given a local face index of the element.
Definition: phase_space_element.h:314
virtual void setNd()=0
Set _N_d_physical_space, _N_d_velocity_space, _N_d_phase_space for the phase space element Has to be ...
int getNdPhysicalSpace()
Get number of dimensions in physical space.
Definition: phase_space_element.h:272
int getNdVelocitySpace()
Get number of dimensions in velocity space.
Definition: phase_space_element.h:282
int _N_d_physical_space
Definition: phase_space_element.h:361
int getNeighborGlobalPhysicalSpaceNodeIndexFromSpatialFace(const int physical_element_index, const int phase_space_element_local_face_index, const int phase_space_element_face_node_index) const
This gets the neighboring physical space node of a node on a phase space element on a spatial face.
int getNdPhaseSpace()
Get number of dimensions in phase space.
Definition: phase_space_element.h:292
virtual ~PhaseSpaceElement()=default
Destructor.
int _N_d_phase_space
Definition: phase_space_element.h:363
std::vector< std::unique_ptr< geometry::phase_space_element::PhaseSpaceFace > > _phase_space_faces
Definition: phase_space_element.h:370
int _N_d_velocity_space
Definition: phase_space_element.h:362
PhaseSpaceElement(const std::shared_ptr< geometry::phase_space::PhaseSpaceDGGeometry > &phase_space_dg_geometry)
Constructor.
PhaseSpaceFace Class used by PhaseSpaceElements.
Definition: phase_space_element.h:42
void setLocalFaceNodes(const WmBasisArraySet *phase_space_basis_set, const int local_face_index)
Set the local face nodes on this face.
Definition: phase_space_element.h:165
void setup(const int local_face_index)
setup
Definition: phase_space_element.h:57
void setNeighborLocalFaceIndex(const int neighbor_local_face_index)
Set Neighbor Local Face Index.
Definition: phase_space_element.h:67
void setNeighborLocalFaceNodes(const WmBasisArraySet *phase_space_basis_set, const int neighbor_local_face_index)
Set the local face nodes on the neighbor's face.
Definition: phase_space_element.h:191
int getNfp() const
Get Number of face nodes on this phase space face.
Definition: phase_space_element.h:154
PhaseSpaceFace()
Constructor.
Definition: phase_space_element.h:48
const int * getNeighborLocalFaceNodes() const
Get the local face nodes on the neighbor's face.
Definition: phase_space_element.h:209
void setPhaseSpaceNormal(const std::vector< real > normal)
Set Phase Space Normal of this face real and isoparametric normal are assumed same.
Definition: phase_space_element.h:97
const real * getIsoparametricNormal() const
Get Isoparametric Phase Space Normal.
Definition: phase_space_element.h:134
const real * getRealNormal() const
Get Real Phase Space Normal.
Definition: phase_space_element.h:124
const int * getLocalFaceNodes() const
Get the local face nodes on this face.
Definition: phase_space_element.h:180
void setPhaseSpaceIsoparametricNormal(const std::vector< real > &iso_normal)
Set Phase Space Isoparametric Normal of this face.
Definition: phase_space_element.h:111
void setNfp(const int N_fp_phase_space)
Set Number of face nodes on this phase space face.
Definition: phase_space_element.h:144
int getLocalPhaseSpaceNodeIndex(const int l, const int N, const int m, const int i, const int j, const int k)
This gives you the phase space element local node index given:
Definition: phase_space_34duoprism.h:9
#define real
Definition: wmoclunstructuredreconstruction.h:11