1#ifndef geometry_phase_space_dg_geometry_h
2#define geometry_phase_space_dg_geometry_h
5#include "warpxm/warpxm_config.h"
46 const std::string phase_space_order,
47 const std::vector<int> vspace_nelems,
48 const std::vector<real> vspace_minimums,
49 const std::vector<real> vspace_dv);
73 const std::vector<std::string>& boundary_names,
74 const bool has_fluxes);
95 const int vy_element_index,
96 const int vz_element_index)
const;
107 const int velocity_space_element_indexes[3],
108 real velocity_element_corner_coordinates[3])
const;
120 const int physical_element_index,
121 std::vector<std::vector<real>>& inverse_jacobian_phase_space)
const;
162 return _physical_space_dg_geometry.get();
171 return _physical_space_basis_set.get();
180 return _phase_space_basis_set.get();
189 return _vspace_ndims;
198 return _vspace_nelems;
217 return _vspace_n_vx_elems;
226 return _vspace_n_vy_elems;
235 return _vspace_n_vz_elems;
244 return _vspace_minimums;
253 return _vspace_maximums;
263 const int physical_element_index,
264 const int phase_space_element_local_node_index)
const
270 const int N_p = _physical_space_basis_set->getNumTotalNodes();
271 return physical_element_index * N_p + phase_space_element_local_node_index % N_p;
300 const int velocity_space_element_indexes[3],
301 const int phase_space_element_local_node_index,
302 std::array<real, 6>& position)
const;
313 const int vx_element_index,
314 const int vy_element_index,
315 const int vz_element_index);
327 const int vx_element_index,
328 const int vy_element_index,
329 const int vz_element_index,
330 const int local_phase_space_element_node_index);
339 return _vface_lookup;
351 std::string _basis_set_name;
354 std::unique_ptr<WmBasisArraySet> _physical_space_basis_set;
357 std::unique_ptr<WmUDGGeometry> _physical_space_dg_geometry;
361 std::vector<int> _vspace_nelems;
364 std::vector<real> _vspace_minimums;
365 std::vector<real> _vspace_maximums;
367 std::vector<real> _vspace_dv;
370 int _vspace_n_vx_elems;
371 int _vspace_n_vy_elems;
372 int _vspace_n_vz_elems;
376 std::string _phase_space_order;
377 std::unique_ptr<WmBasisArraySet> _phase_space_basis_set;
393 std::array<int, 18> _vface_lookup;
Definition: wmbasisarrayset.h:13
Definition: wmudggeometry.h:108
Definition: wmunstructuredpatch.h:22
Defines the global nodal DG phase space geometry at the patch level, given a WmUDGGeometry object tha...
Definition: phase_space_dg_geometry.h:39
int getVspaceNVyElems() const
Get number of vy elements.
Definition: phase_space_dg_geometry.h:224
int getFlattenedVelocitySpaceElementIndex(const int vx_element_index, const int vy_element_index, const int vz_element_index) const
Get the flattened velocity space element index.
int getGlobalPhaseSpaceNodeIndex(const int physical_element_index, const int vx_element_index, const int vy_element_index, const int vz_element_index, const int local_phase_space_element_node_index)
Get global phase space node index given:
WmBasisArraySet const * getPhysicalSpaceBasisArraySet() const
Get the pointer to the physical space basis set object.
Definition: phase_space_dg_geometry.h:169
void calcPhaseSpaceInverseJacobian(const int physical_element_index, std::vector< std::vector< real > > &inverse_jacobian_phase_space) const
Calculate the Inverse Jacobian of the phase space element Assumes it is same for all phase space elem...
int getMatchingGlobalPhysicalSpaceNodeIndex(const int physical_element_index, const int phase_space_element_local_node_index) const
Get the matching global physical space node index from the physical element index and local phase spa...
Definition: phase_space_dg_geometry.h:262
int getVspaceNVzElems() const
Get number of vz elements.
Definition: phase_space_dg_geometry.h:233
const std::vector< real > & getVspaceMinimums() const
Get the minimum velocity space coordinates.
Definition: phase_space_dg_geometry.h:242
WmUDGGeometry const * getWmUDGGeometry() const
Get the pointer to the WmUDGGeometry object.
Definition: phase_space_dg_geometry.h:160
int getVspaceNdims() const
Get number of velocity space dimensions.
Definition: phase_space_dg_geometry.h:187
PhaseSpaceDGGeometry(const std::string basis_set_name, const std::string phase_space_order, const std::vector< int > vspace_nelems, const std::vector< real > vspace_minimums, const std::vector< real > vspace_dv)
Constructor.
const std::vector< real > & getVspaceDv() const
Get dv in each velocity space dimension {dvx, dvy, dvz}.
Definition: phase_space_dg_geometry.h:206
WmBasisArraySet const * getPhaseSpaceBasisArraySet() const
Get the pointer to the phase space basis set object.
Definition: phase_space_dg_geometry.h:178
void setupBases(const WmUnstructuredPatch &patch)
Setup physical space and phase space bases.
int getVspaceNVxElems() const
Get number of vx elements.
Definition: phase_space_dg_geometry.h:215
const std::array< int, 18 > & getVfaceLookupTable()
Get the velocity face lookup table.
Definition: phase_space_dg_geometry.h:337
~PhaseSpaceDGGeometry()
Destructor.
int getGlobalPhaseSpaceElementIndex(const int physical_element_index, const int vx_element_index, const int vy_element_index, const int vz_element_index)
Get global phase space element index given:
const std::vector< real > & getVspaceMaximums() const
Get the maximum velocity space coordinates.
Definition: phase_space_dg_geometry.h:251
void getVelocityElementCornerCoordinates(const int velocity_space_element_indexes[3], real velocity_element_corner_coordinates[3]) const
Get the velocity element corner coordinates This is the velocity coordinate at the minimum corner of ...
void setupWmUDGGeometry(const WmUnstructuredPatch &patch, const std::vector< std::string > &boundary_names, const bool has_fluxes)
Setup physical space unstructured dg geometry.
const std::vector< int > & getVspaceNelems() const
Get number of velocity space elements in each velocity space dimension.
Definition: phase_space_dg_geometry.h:196
void getPhaseSpaceCoordinates(const int physical_element_index, const int velocity_space_element_indexes[3], const int phase_space_element_local_node_index, std::array< real, 6 > &position) const
Get phase space coordinates from _phase_space_coordinates.
Definition: phase_space_34duoprism.h:9
#define real
Definition: wmoclunstructuredreconstruction.h:11