SPHinXsys  alpha version
Classes | Namespaces
base_particles.h File Reference

This is the base class of SPH particles. The basic data of the particles is saved in separated large vectors. Each derived class will introduce several extra vectors for the new data. Note that there is no class of single particle. More...

#include "base_data_package.h"
#include "sph_data_containers.h"
#include "base_material.h"
#include "xml_engine.h"
#include <fstream>

Go to the source code of this file.

Classes

class  SPH::ParticleDynamics< ReturnType >
 The base class for all particle dynamics This class contains the only two interface functions available for particle dynamics. An specific implementation should be realized. More...
 
class  SPH::BaseParticles
 Particles with essential (geometric and kinematic) data. There are three types of particles, all particles of a same type are saved with continuous memory segments. The first type is real particles whose states are updated by particle dynamics. One is buffer particles whose state are not updated by particle dynamics. Buffer particles are saved behind real particles. The global value of total_real_particles_ separate the real and buffer particles. They may be switched from real particles or switch to real particles. As the memory for both particles are continuous, such switch is achieved at the memory boundary sequentially. The basic idea is swap the data of the last real particle with the one will be switched particle, and then switch this swapped last particle as buffer particle by decrease the total_real_particles_ by one. Switch from buffer particle to real particle is easy. One just need to assign expect state to the first buffer particle and increase total_real_particles_ by one. The other is ghost particles whose states are updated according to boundary condition if their indices are included in the neighbor particle list. The ghost particles are saved behind the buffer particles. The global value of real_particles_bound_ separate the sum of real and buffer particles with ghost particles. The global value of total_ghost_particles_ indicates the total number of ghost particles in use. It will be initialized to zero before a time step. In SPHinXsys, the variables registered in general particle data (ParticleData) belong to a hierarchy of two layers. The first is for the global basic physical states to describe the physical process. These variables are defined within the classes of particles. The second is for the local, dynamics-method-related variables, which are defined in specific methods, and are only used by the relevant methods. There is a rule of single registration, that is, a variable is only allowed to be registered with a name once by the function registerAVariable. The usage of the second- and third-layer variables is accessed by getVariableByName. Such a rule requires careful design of the code. More...
 
struct  SPH::BaseParticles::resizeParticleData< VariableType >
 
struct  SPH::BaseParticles::addAParticleDataValue< VariableType >
 
struct  SPH::BaseParticles::copyAParticleDataValue< VariableType >
 
struct  SPH::WriteAParticleVariableToXml
 
struct  SPH::ReadAParticleVariableFromXml
 
class  SPH::BaseDerivedVariable< VariableType >
 computing displacement from current and initial particle position More...
 

Namespaces

 SPH
 

Detailed Description

This is the base class of SPH particles. The basic data of the particles is saved in separated large vectors. Each derived class will introduce several extra vectors for the new data. Note that there is no class of single particle.

Author
Xiangyu Hu and Chi Zhang