SPHinXsys  alpha version
particle_generator_lattice.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  * --------------------------------------------------------------------------*/
32 #ifndef PARTICLE_GENERATOR_LATTICE_H
33 #define PARTICLE_GENERATOR_LATTICE_H
34 
36 
37 namespace SPH
38 {
39 
40  class Shape;
41  class ParticleSpacingByBodyShape;
42  class ShellParticles;
43 
49  {
50  public:
51  explicit BaseParticleGeneratorLattice(SPHBody &sph_body);
52  virtual ~BaseParticleGeneratorLattice(){};
53 
54  protected:
55  Real lattice_spacing_;
56  BoundingBox domain_bounds_;
57  Shape &body_shape_;
58  };
59 
65  {
66  public:
67  explicit ParticleGeneratorLattice(SPHBody &sph_body);
68  virtual ~ParticleGeneratorLattice(){};
69 
70  virtual void initializeGeometricVariables() override;
71  };
72 
78  {
79  public:
80  explicit ParticleGeneratorMultiResolution(SPHBody &sph_body);
82 
83  protected:
84  ParticleSpacingByBodyShape *particle_adaptation_;
85  StdLargeVec<Real> &h_ratio_;
86 
87  virtual void initializePositionAndVolumetricMeasure(const Vecd &position, Real volume) override;
88  virtual void initializeSmoothingLengthRatio(Real local_spacing);
89  };
90 
99  {
100  public:
101  ThickSurfaceParticleGeneratorLattice(SPHBody &sph_body, Real global_avg_thickness);
103 
104  virtual void initializeGeometricVariables() override;
105 
106  protected:
107  Real total_volume_;
109  Real particle_spacing_;
110  Real avg_particle_volume_;
111  size_t number_of_cells_;
112  size_t planned_number_of_particles_;
113  };
114 }
115 #endif // PARTICLE_GENERATOR_LATTICE_H
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
Base class for generating particles from lattice positions for a body.
Definition: particle_generator_lattice.h:48
generate particles from lattice positions for a body.
Definition: particle_generator_lattice.h:64
generate multi-resolution particles from lattice positions for a body.
Definition: particle_generator_lattice.h:77
Adaptive resolutions within a SPH body according to the distance to the body surface.
Definition: adaptation.h:128
This is the base class of particle generator, which generates particles with given positions and volu...
Real global_avg_thickness_
Definition: particle_generator_lattice.h:108
Generate thick surface particles from lattice positions for a thin structure defined by a body shape...
Definition: particle_generator_lattice.h:98
Generate volumetric particles by initialize extra surface variables.
Definition: base_particle_generator.h:84
SPHBody is a base body with basic data and functions. Its derived class can be a real fluid body...
Definition: base_body.h:61
Generate volumetric particles by initialize position and volume.
Definition: base_particle_generator.h:68
Definition: solid_body_supplementary.cpp:9