Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
 All Classes Files Functions Variables Typedefs Friends Pages
particle_data.h
Go to the documentation of this file.
1 
21 #ifndef __PARTICLE_DATA_H__
22 #define __PARTICLE_DATA_H__
23 
24 #include <cstddef>
25 #include <vector>
26 #include <string>
27 
28 class LPSolver;
29 class Initializer;
30 class BoundingBox;
31 
32 
33 
51 class ParticleData {
52 public:
64  ParticleData(const Initializer& init);
65 
72  virtual ~ParticleData();
73 
82  std::size_t getCapacity() {return m_iCapacity;}
83 
89  std::size_t getTotalNum() {return m_iTotalNum;}
90 
96  std::size_t getFluidNum() {return m_iFluidNum;}
97 
103  std::size_t getBoundaryNum() {return m_iBoundaryNum;}
104 
110  std::size_t getGhostNum() {return m_iGhostNum;}
111 
117  std::size_t getMaxNeighbourNum() {return m_iMaxNeighbourNum;}
118 
126  std::size_t getMaxNeighbourNumInOneDir() {return m_iMaxNeighbourNumInOneDir;}
127 
133  std::size_t getFluidStartIndex() {return m_iFluidStartIndex;}
134 
140  std::size_t getBoundaryStartIndex() {return m_iBoundaryStartIndex;}
141 
147  std::size_t getGhostStartIndex() {return m_iGhostStartIndex;}
148 
154  int getDimension() {return m_iDimension;}
155 
156 
163  const double* const getPositionX() const {return m_vPositionX;}
164 
171  const double* const getPositionY() const {return m_vPositionY;}
172 
179  const double* const getPositionZ() const {return m_vPositionZ;}
180 
187  const double* const getVelocityU() const {return m_vVelocityU;}
188 
195  const double* const getVelocityV() const {return m_vVelocityV;}
196 
203  const double* const getVelocityW() const {return m_vVelocityW;}
204 
211  const double* const getVolume() const {return m_vVolume;}
212 
219  const double* const getPressure() const {return m_vPressure;}
220 
227  const double* const getSoundSpeed() const {return m_vSoundSpeed;}
228 
229 
230  //const double* const getEnergy() const {return m_vEnergy;}
231 
232 
241  const int* const getObjectTag() const {return m_vObjectTag;}
242 
243 
250  const double* const getDD1() const {return m_vDD1;}
251 
258  const double* const getDD2Left() const {return m_vDD2Left;}
259 
266  const double* const getDD2Right() const {return m_vDD2Right;}
267 
274  const double* const getDD3Left() const {return m_vDD3Left;}
275 
282  const double* const getDD3Right() const {return m_vDD3Right;}
283 
284 
285 private:
286 
287  friend class HyperbolicLPSolver;
288  friend class HyperbolicLPSolver1D;
289 
290  int m_iDimension;
291  std::size_t m_iCapacity;
292  std::size_t m_iTotalNum;
293  std::size_t m_iFluidNum;
294  std::size_t m_iBoundaryNum;
295  std::size_t m_iGhostNum;
296  std::size_t m_iFluidStartIndex;
297  std::size_t m_iBoundaryStartIndex;
298  std::size_t m_iGhostStartIndex;
299  std::size_t m_iMaxNeighbourNum;
300  std::size_t m_iMaxNeighbourNumInOneDir;
301 
302  double* m_vPositionX;
303  double* m_vPositionY;
304  double* m_vPositionZ;
305  double* m_vVelocityU;
306  double* m_vVelocityV;
307  double* m_vVelocityW;
308  double* m_vVolume;
309  double* m_vPressure;
310  double* m_vSoundSpeed;
311  //double* m_vEnergy;///< energy
312 
313  double* m_vTemp1VelocityU;
314  double* m_vTemp1VelocityV;
315  double* m_vTemp1VelocityW;
316  double* m_vTemp1Volume;
317  double* m_vTemp1Pressure;
318  double* m_vTemp1SoundSpeed;
319 
320  double* m_vTemp2VelocityU;
321  double* m_vTemp2VelocityV;
322  double* m_vTemp2VelocityW;
323  double* m_vTemp2Volume;
324  double* m_vTemp2Pressure;
325  double* m_vTemp2SoundSpeed;
326 
327  int* m_vLPFOrderRight;
328  int* m_vLPFOrderLeft;
329  int* m_vLPFOrderNorth;
330  int* m_vLPFOrderSouth;
331  int* m_vLPFOrderUp;
332  int* m_vLPFOrderDown;
333 
334  int* m_vNeighbourList;
335  int* m_vNeighbourListRight;
336  int* m_vNeighbourListLeft;
337  int* m_vNeighbourListNorth;
338  int* m_vNeighbourListSouth;
339  int* m_vNeighbourListUp;
340  int* m_vNeighbourListDown;
341 
342  int* m_vNeighbourListSize;
343  int* m_vNeighbourListRightSize;
344  int* m_vNeighbourListLeftSize;
345  int* m_vNeighbourListNorthSize;
346  int* m_vNeighbourListSouthSize;
347  int* m_vNeighbourListUpSize;
348  int* m_vNeighbourListDownSize;
349 
350 
351  int* m_vObjectTag;
352 
353  std::vector<BoundingBox*> m_vFluidBoundingBox;
354  std::vector<std::string> m_vBoundaryObjTypes;
355 
356  double* m_vDD1;
357  double* m_vDD2Left;
358  double* m_vDD2Right;
359  double* m_vDD3Left;
360  double* m_vDD3Right;
361  double* m_vCumP;
362  double* m_vPositionXm;
363 
364 };
365 
366 
367 #endif
const double *const getVelocityW() const
Getter function of the array of velocity in z-coordinate of the initialized particles.
Definition: particle_data.h:203
const double *const getVelocityV() const
Getter function of the array of velocity in y-coordinate of the initialized particles.
Definition: particle_data.h:195
This class is keeps the information of the boundaries of a fluid/boundary object. ...
Definition: initializer.h:51
std::size_t getMaxNeighbourNumInOneDir()
Getter function of the specified maximum number of neighbours in one direction (eg. right-hand-side in the x-coordinate) of a particle.
Definition: particle_data.h:126
std::size_t getBoundaryNum()
Getter function of the number of boundary particles.
Definition: particle_data.h:103
const double *const getPositionX() const
Getter function of the array of x-coordinates of the initialized particles.
Definition: particle_data.h:163
const double *const getPressure() const
Getter function of the array of pressure of the initialized particles.
Definition: particle_data.h:219
const double *const getDD1() const
Getter function of the array of divided difference of order 1.
Definition: particle_data.h:250
const double *const getDD3Left() const
Getter function of the array of divided difference of order 3.
Definition: particle_data.h:274
const double *const getDD2Left() const
Getter function of the array of divided difference of order 2.
Definition: particle_data.h:258
int getDimension()
Getter function of the specified dimension of simulation.
Definition: particle_data.h:154
const double *const getSoundSpeed() const
Getter function of the array of sound speed of the initialized particles.
Definition: particle_data.h:227
std::size_t getBoundaryStartIndex()
Getter function of the start index of boundary particles in the particle data arrays.
Definition: particle_data.h:140
std::size_t getMaxNeighbourNum()
Getter function of the specified maximum number of neighbours of a particle.
Definition: particle_data.h:117
const double *const getPositionY() const
Getter function of the array of y-coordinates of the initialized particles.
Definition: particle_data.h:171
std::size_t getTotalNum()
Getter function of the number of all types of particles.
Definition: particle_data.h:89
std::size_t getGhostNum()
Getter function of the number of ghost particles.
Definition: particle_data.h:110
The default Lagrangian Particle solver for the compressible Euler's equation in 2D and 3D...
Definition: lp_solver.h:118
An abstract class for the family of Lagrangian Particle solvers.
Definition: lp_solver.h:53
This class initializes the simulation.
Definition: initializer.h:227
const double *const getVelocityU() const
Getter function of the array of velocity in x-coordinate of the initialized particles.
Definition: particle_data.h:187
const double *const getPositionZ() const
Getter function of the array of z-coordinates of the initialized particles.
Definition: particle_data.h:179
The default Lagrangian Particle solver for the compressible Euler's equation in 1D.
Definition: lp_solver.h:584
std::size_t getCapacity()
Getter function of the specified array length for particle data arrays such as x, y...
Definition: particle_data.h:82
const double *const getDD3Right() const
Getter function of the array of divided difference of order 3.
Definition: particle_data.h:282
ParticleData(const Initializer &init)
Constructor.
Definition: particle_data.cpp:12
std::size_t getFluidNum()
Getter function of the number of fluid particles.
Definition: particle_data.h:96
std::size_t getFluidStartIndex()
Getter function of the start index of fluid particles in the particle data arrays.
Definition: particle_data.h:133
const double *const getDD2Right() const
Getter function of the array of divided difference of order 2.
Definition: particle_data.h:266
const double *const getVolume() const
Getter function of the array of volume of the initialized particles.
Definition: particle_data.h:211
A class that stores all information and data of particles, such as x, y, and z coordinates, neighbour lists, and bounding boxes.
Definition: particle_data.h:51
virtual ~ParticleData()
Destructor.
Definition: particle_data.cpp:148
const int *const getObjectTag() const
Getter function of the array of "object tags" of the initialized particles.
Definition: particle_data.h:241
std::size_t getGhostStartIndex()
Getter function of the start index of ghost particles in the particle data arrays.
Definition: particle_data.h:147