SPHinXsys  alpha version
base_particle_generator.h
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------*
2  * SPHinXsys *
3  * --------------------------------------------------------------------------*
4  * SPHinXsys (pronunciation: s'finksis) is an acronym from Smoothed Particle *
5  * Hydrodynamics for industrial compleX systems. It provides C++ APIs for *
6  * physical accurate simulation and aims to model coupled industrial dynamic *
7  * systems including fluid, solid, multi-body dynamics and beyond with SPH *
8  * (smoothed particle hydrodynamics), a meshless computational method using *
9  * particle discretization. *
10  * *
11  * SPHinXsys is partially funded by German Research Foundation *
12  * (Deutsche Forschungsgemeinschaft) DFG HU1527/6-1, HU1527/10-1 *
13  * and HU1527/12-1. *
14  * *
15  * Portions copyright (c) 2017-2020 Technical University of Munich and *
16  * the authors' affiliations. *
17  * *
18  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
19  * not use this file except in compliance with the License. You may obtain a *
20  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
21  * *
22  * --------------------------------------------------------------------------*/
31 #ifndef BASE_PARTICLE_GENERATOR_H
32 #define BASE_PARTICLE_GENERATOR_H
33 
34 #include "base_data_package.h"
35 #include "sph_data_containers.h"
36 #include "large_data_containers.h"
37 
38 namespace SPH
39 {
40 
41  class SPHBody;
42  class BaseParticles;
43  class InOutput;
44 
50  {
51  public:
52  explicit BaseParticleGenerator(SPHBody &sph_body);
53  virtual ~BaseParticleGenerator(){};
54 
55  virtual void initializeGeometricVariables() = 0;
56 
57  protected:
58  BaseParticles *base_particles_;
60  StdLargeVec<size_t> &unsorted_id_;
61  virtual void initializePosition(const Vecd &position);
62  };
63 
69  {
70  public:
71  explicit ParticleGenerator(SPHBody &sph_body);
72  virtual ~ParticleGenerator(){};
73 
74  protected:
77  virtual void initializePositionAndVolumetricMeasure(const Vecd &position, Real volumetric_measure);
78  };
79 
85  {
86  public:
87  explicit SurfaceParticleGenerator(SPHBody &sph_body);
89 
90  protected:
94  virtual void initializeSurfaceProperties(const Vecd &surface_normal, Real thickness);
95  };
96 
103  {
104  public:
105  explicit ObserverParticleGenerator(SPHBody &sph_body)
106  : ParticleGenerator(sph_body){};
107  ObserverParticleGenerator(SPHBody &sph_body, const StdVec<Vecd> &positions)
108  : ParticleGenerator(sph_body), positions_(positions){};
109  virtual ~ObserverParticleGenerator(){};
110 
111  virtual void initializeGeometricVariables() override;
112 
113  protected:
114  StdVec<Vecd> positions_;
115  };
116 
122  {
123  std::string file_path_;
124 
125  public:
126  ParticleGeneratorReload(SPHBody &sph_body, InOutput &in_output, const std::string &reload_body_name);
127  virtual ~ParticleGeneratorReload(){};
128  virtual void initializeGeometricVariables() override;
129  };
130 }
131 #endif // BASE_PARTICLE_GENERATOR_H
StdLargeVec< Real > & Vol_
Definition: base_particle_generator.h:72
Particles with essential (geometric and kinematic) data. There are three types of particles, all par...
Definition: base_particles.h:81
StdLargeVec< size_t > & unsorted_id_
Definition: base_particle_generator.h:60
Generate particle directly from position-and-volume data.
Definition: base_particle_generator.h:102
Generate volumetric particles by initialize extra surface variables.
Definition: base_particle_generator.h:84
Set up of basic data structure.
Abstract base particle generator.
Definition: base_particle_generator.h:49
SPHBody is a base body with basic data and functions. Its derived class can be a real fluid body...
Definition: base_body.h:61
StdLargeVec< Vecd > & n_
Definition: base_particle_generator.h:88
The base class which defines folders for output, restart and particle reload folders.
Definition: in_output.h:65
Generate volumetric particles by initialize position and volume.
Definition: base_particle_generator.h:68
StdLargeVec< Real > & thickness_
Definition: base_particle_generator.h:92
StdLargeVec< Vecd > & pos_
Definition: base_particle_generator.h:59
Generate particle by reloading particle position and volume.
Definition: base_particle_generator.h:121
Definition: solid_body_supplementary.cpp:9