SPHinXsys  alpha version
particle_generator_network.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  * --------------------------------------------------------------------------*/
30 #ifndef PARTICLE_GENERATOR_NETWORK_H
31 #define PARTICLE_GENERATOR_NETWORK_H
32 
33 #include "sph_data_containers.h"
35 #include "complex_body.h"
36 
37 namespace SPH
38 {
44  {
45  public:
46  ParticleGeneratorNetwork(SPHBody &sph_body, const Vecd &starting_pnt, const Vecd &second_pnt, int iterator, Real grad_factor);
47  virtual ~ParticleGeneratorNetwork(){};
48 
50  virtual void initializeGeometricVariables() override;
51 
52  protected:
54  Vecd second_pnt_;
55  size_t n_it_;
56  bool fascicles_;
59  Real angle_ = 0.3;
60  Real repulsivity_ = 0.175;
61  Real grad_factor_;
62  std::vector<Real> fascicle_angles_ = {-1.25, 0.75};
63  Real fascicle_ratio_ = 15.0;
64  SPHBody &sph_body_;
65  Shape &body_shape_;
66  BaseCellLinkedList *cell_linked_list_;
67  TreeBody *tree_;
73  Vecd getGradientFromNearestPoints(Vecd pt, Real delta);
82  bool createABranchIfValid(size_t parent_id, Real angle, Real repulsivity, size_t number_segments);
90  Vecd createATentativeNewBranchPoint(Vecd init_point, Vecd dir);
97  bool isCollision(const Vecd &new_point, const ListData &nearest_neighbor, size_t parent_id);
102  virtual bool extraCheck(const Vecd &new_point) { return false; };
103 
104  void growAParticleOnBranch(TreeBody::Branch *branch, const Vecd &new_point, const Vecd &end_direction);
105  };
106 }
107 #endif // PARTICLE_GENERATOR_NETWORK_H
bool createABranchIfValid(size_t parent_id, Real angle, Real repulsivity, size_t number_segments)
Create a new branch if it is valid.
Definition: particle_generator_network.cpp:100
Real grad_factor_
Definition: particle_generator_network.h:61
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
Vecd createATentativeNewBranchPoint(Vecd init_point, Vecd dir)
Functions that creates a new node in the mesh surface and it to the queue is it lies in the surface...
Definition: particle_generator_network.cpp:59
virtual bool extraCheck(const Vecd &new_point)
Check if the new point is valid according to extra constraint.
Definition: particle_generator_network.h:102
Abstract class for mesh cell linked list.
Definition: cell_linked_list.h:69
Real repulsivity_
Definition: particle_generator_network.h:60
Vecd second_pnt_
Definition: particle_generator_network.h:54
std::pair< size_t, Vecd > ListData
Definition: sph_data_containers.h:42
virtual void initializeGeometricVariables() override
Definition: particle_generator_network.cpp:164
Real segment_length_
Definition: particle_generator_network.h:58
Real angle_
Definition: particle_generator_network.h:59
The tree is composed of a root (the first branch) and other branch generated sequentially.
Definition: complex_body.h:61
size_t segments_in_branch_
Definition: particle_generator_network.h:57
Vecd starting_pnt_
Definition: particle_generator_network.h:53
Each branch (except the root) has a parent and several children, and geometric information. It is a realized edge and has multi inner particles. The first is the last particle from the parent or root, and the last is the first particle of all its child branches. Many connected branches compose a tree.
Definition: complex_body.h:96
This is the base class of particle generator, which generates particles with given positions and volu...
Vecd getGradientFromNearestPoints(Vecd pt, Real delta)
Get the gradient from nearest points, for imposing repulsive force.
Definition: particle_generator_network.cpp:41
bool isCollision(const Vecd &new_point, const ListData &nearest_neighbor, size_t parent_id)
Check if the new point has collision with the existing points.
Definition: particle_generator_network.cpp:71
Generate a tree-shape network for the conduction system of a heart with particles.
Definition: particle_generator_network.h:43
A complex body is characterized with a secondary structure, which can be imported externally or creat...
Set up of basic data structure.
size_t n_it_
Definition: particle_generator_network.h:55
std::vector< Real > fascicle_angles_
Definition: particle_generator_network.h:62
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
Real fascicle_ratio_
Definition: particle_generator_network.h:63
Definition: solid_body_supplementary.cpp:9
bool fascicles_
Definition: particle_generator_network.h:56