SPHinXsys  alpha version
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SPH::ParticleGeneratorNetwork Class Reference

Generate a tree-shape network for the conduction system of a heart with particles. More...

#include <particle_generator_network.h>

Inherits SPH::ParticleGenerator.

Public Member Functions

 ParticleGeneratorNetwork (SPHBody &sph_body, const Vecd &starting_pnt, const Vecd &second_pnt, int iterator, Real grad_factor)
 
virtual void initializeGeometricVariables () override
 
- Public Member Functions inherited from SPH::ParticleGenerator
 ParticleGenerator (SPHBody &sph_body)
 
- Public Member Functions inherited from SPH::BaseParticleGenerator
 BaseParticleGenerator (SPHBody &sph_body)
 

Protected Member Functions

Vecd getGradientFromNearestPoints (Vecd pt, Real delta)
 Get the gradient from nearest points, for imposing repulsive force. More...
 
bool createABranchIfValid (size_t parent_id, Real angle, Real repulsivity, size_t number_segments)
 Create a new branch if it is valid. More...
 
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. More...
 
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. More...
 
virtual bool extraCheck (const Vecd &new_point)
 Check if the new point is valid according to extra constraint. More...
 
void growAParticleOnBranch (TreeBody::Branch *branch, const Vecd &new_point, const Vecd &end_direction)
 
- Protected Member Functions inherited from SPH::ParticleGenerator
virtual void initializePositionAndVolumetricMeasure (const Vecd &position, Real volumetric_measure)
 
- Protected Member Functions inherited from SPH::BaseParticleGenerator
virtual void initializePosition (const Vecd &position)
 

Protected Attributes

Vecd starting_pnt_
 
Vecd second_pnt_
 
size_t n_it_
 
bool fascicles_
 
size_t segments_in_branch_
 
Real segment_length_
 
Real angle_ = 0.3
 
Real repulsivity_ = 0.175
 
Real grad_factor_
 
std::vector< Real > fascicle_angles_ = {-1.25, 0.75}
 
Real fascicle_ratio_ = 15.0
 
SPHBodysph_body_
 
Shapebody_shape_
 
BaseCellLinkedListcell_linked_list_
 
TreeBodytree_
 
- Protected Attributes inherited from SPH::ParticleGenerator
StdLargeVec< Real > & Vol_
 
- Protected Attributes inherited from SPH::BaseParticleGenerator
BaseParticlesbase_particles_
 
StdLargeVec< Vecd > & pos_
 
StdLargeVec< size_t > & unsorted_id_
 

Detailed Description

Generate a tree-shape network for the conduction system of a heart with particles.

Member Function Documentation

◆ createABranchIfValid()

bool SPH::ParticleGeneratorNetwork::createABranchIfValid ( size_t  parent_id,
Real  angle,
Real  repulsivity,
size_t  number_segments 
)
protected

Create a new branch if it is valid.

Parameters
[in]sph_body(SPHBody)The SPHBody to whom the tree belongs.
[in]parent_id(size_t)Id of parent branch.
[in]angle(Real)The angle for growing new points.
[in]repulsivity(Real)The repulsivity for creating new points.
[in]number_segments(size_t)Number of segments in this branch.

Project grad to surface.
This constraint imposed to avoid too small time step size.

◆ createATentativeNewBranchPoint()

Vecd SPH::ParticleGeneratorNetwork::createATentativeNewBranchPoint ( Vecd  init_point,
Vecd  dir 
)
protected

Functions that creates a new node in the mesh surface and it to the queue is it lies in the surface.

Parameters
[in]init_nodevector that contains the coordinates of the last node added in the branch. vector that contains the coordinates of the last node added in the branch.
[in]dira vector that contains the direction from the init_node to the node to project.
[out]endpoint of the created segment.

◆ extraCheck()

virtual bool SPH::ParticleGeneratorNetwork::extraCheck ( const Vecd &  new_point)
inlineprotectedvirtual

Check if the new point is valid according to extra constraint.

Parameters
[in]new_point(Vecd)The enquiry point.

◆ getGradientFromNearestPoints()

Vecd SPH::ParticleGeneratorNetwork::getGradientFromNearestPoints ( Vecd  pt,
Real  delta 
)
protected

Get the gradient from nearest points, for imposing repulsive force.

Parameters
[in]pt(Vecd)Inquiry point.
[in]delta(Real)parameter for gradient calculation.

◆ initializeGeometricVariables()

void SPH::ParticleGeneratorNetwork::initializeGeometricVariables ( )
overridevirtual

Created base particles based on edges in branch

Set vertices in family branch.

Creating a new branch.
Creating a new branch with fixed number of segments.

Implements SPH::BaseParticleGenerator.

◆ isCollision()

bool SPH::ParticleGeneratorNetwork::isCollision ( const Vecd &  new_point,
const ListData nearest_neighbor,
size_t  parent_id 
)
protected

Check if the new point has collision with the existing points.

Parameters
[in]new_point(Vecd)The enquiry point.
[in]nearest_neighbor(ListData)The nearest point of the existing points.
[in]parent_id(size_t)Id of parent branch

Member Data Documentation

◆ angle_

Real SPH::ParticleGeneratorNetwork::angle_ = 0.3
protected

angle with respect to the direction of the previous edge and the new edge.

◆ fascicle_angles_

std::vector<Real> SPH::ParticleGeneratorNetwork::fascicle_angles_ = {-1.25, 0.75}
protected

angles with respect to the initial edge of the fascicles.

◆ fascicle_ratio_

Real SPH::ParticleGeneratorNetwork::fascicle_ratio_ = 15.0
protected

ratio of length of the fascicles. Include one per fascicle to include.

◆ fascicles_

bool SPH::ParticleGeneratorNetwork::fascicles_
protected

Create fascicles?

◆ grad_factor_

Real SPH::ParticleGeneratorNetwork::grad_factor_
protected

Factor for computing gradient from nearest node.

◆ n_it_

size_t SPH::ParticleGeneratorNetwork::n_it_
protected

Number of iterations (generations of branch.

◆ repulsivity_

Real SPH::ParticleGeneratorNetwork::repulsivity_ = 0.175
protected

repulsivity parameter.

◆ second_pnt_

Vecd SPH::ParticleGeneratorNetwork::second_pnt_
protected

Second point, approximate the growing direction.

◆ segment_length_

Real SPH::ParticleGeneratorNetwork::segment_length_
protected

segment length of the branch.

◆ segments_in_branch_

size_t SPH::ParticleGeneratorNetwork::segments_in_branch_
protected

approximated number of segments in a branch.

◆ starting_pnt_

Vecd SPH::ParticleGeneratorNetwork::starting_pnt_
protected

Starting point for net work.


The documentation for this class was generated from the following files: