Description

Data manager for the SPH-based FSI system.

Public Member Functions

 FsiDataManager (std::shared_ptr< ChFsiParamsSPH > params)
 
void SetGrowthFactor (float factor)
 Set the growth factor for buffer resizing.
 
void AddSphParticle (Real3 pos, Real rho, Real pres, Real mu, Real3 vel=mR3(0.0), Real3 tau_diag=mR3(0.0), Real3 tau_offdiag=mR3(0.0), Real pc=1e3)
 Add an SPH particle given its position, physical properties, velocity, and stress.
 
void AddBceMarker (MarkerType type, Real3 pos, Real3 vel)
 Add a BCE marker of given type at the specified position and with specified velocity.
 
void Initialize (unsigned int num_fsi_bodies, unsigned int num_fsi_meshes1D, unsigned int num_fsi_nodes1D, unsigned int num_fsi_elements1D, unsigned int num_fsi_meshes2D, unsigned int num_fsi_nodes2D, unsigned int num_fsi_elements2D, bool ad_defined, const std::vector< ChAABB > &ad_body, const std::vector< ChAABB > &ad_node1D, const std::vector< ChAABB > &ad_node2D, NodeDirections node_directions_mode)
 Initialize the underlying FSU system. More...
 
std::vector< int > FindParticlesInBox (const Real3 &hsize, const Real3 &pos, const Real3 &ax, const Real3 &ay, const Real3 &az)
 Find indices of all SPH particles inside the specified OBB.
 
std::vector< Real3GetPositions ()
 Extract positions of all markers (SPH and BCE).
 
std::vector< Real3GetVelocities ()
 Extract velocities of all markers (SPH and BCE).
 
std::vector< Real3GetAccelerations ()
 Extract accelerations of all markers (SPH and BCE).
 
std::vector< Real3GetForces ()
 Extract forces applied to all markers (SPH and BCE).
 
std::vector< Real3GetProperties ()
 Extract fluid properties of all markers (SPH and BCE). More...
 
std::vector< int > GetFreeSurfaceFlags ()
 Extract free-surface identification flags of all markers (SPH and BCE). More...
 
std::vector< Real3GetPositions (const std::vector< int > &indices)
 Extract positions of all markers (SPH and BCE) with indices in the provided array.
 
std::vector< Real3GetVelocities (const std::vector< int > &indices)
 Extract velocities of all markers (SPH and BCE) with indices in the provided array.
 
std::vector< Real3GetAccelerations (const std::vector< int > &indices)
 Extract accelerations of all markers (SPH and BCE) with indices in the provided array.
 
std::vector< Real3GetForces (const std::vector< int > &indices)
 Extract forces applied to all markers (SPH and BCE) with indices in the provided array.
 
std::vector< Real3GetRigidForces ()
 Extract FSI forces on rigid bodies.
 
std::vector< Real3GetRigidTorques ()
 Extract FSI torques on rigid bodies.
 
std::vector< Real3GetMesh1DForces ()
 Extract FSI forces on flex1D nodes.
 
std::vector< Real3GetMesh2DForces ()
 Extract FSI forces on flex2D nodes.
 
void ConstructReferenceArray ()
 
void SetCounters (unsigned int num_fsi_bodies, unsigned int num_fsi_meshes1D, unsigned int num_fsi_nodes1D, unsigned int num_fsi_elements1D, unsigned int num_fsi_meshes2D, unsigned int num_fsi_nodes2D, unsigned int num_fsi_elements2D)
 
void ResetData ()
 Reset device data at beginning of a step. More...
 
void ResizeArrays (uint numExtended)
 Resize data arrays based on particle activity.
 
void UpdateActiveDomains ()
 Update solid active domains (used for CRM only). More...
 
size_t GetCurrentGPUMemoryUsage () const
 Return device memory usage.
 

Public Attributes

std::shared_ptr< GPUDeviceInfogpuDeviceInfo
 GPU device information.
 
std::shared_ptr< ChFsiParamsSPHparamsH
 simulation parameters (host)
 
std::shared_ptr< CounterscountersH
 problem counters (host)
 
std::shared_ptr< SphMarkerDataDsphMarkers_D
 information of SPH particles at state 1 on device
 
std::shared_ptr< SphMarkerDataDsortedSphMarkers1_D
 information of SPH particles at state 2 on device
 
std::shared_ptr< SphMarkerDataDsortedSphMarkers2_D
 sorted information of SPH particles at state 1 on device
 
std::shared_ptr< SphMarkerDataHsphMarkers_H
 information of SPH particles on host
 
std::shared_ptr< FsiBodyStateHfsiBodyState_H
 rigid body state (host)
 
std::shared_ptr< FsiBodyStateDfsiBodyState_D
 rigid body state (device)
 
std::shared_ptr< FsiMeshStateHfsiMesh1DState_H
 1-D FEA mesh state (host)
 
std::shared_ptr< FsiMeshStateDfsiMesh1DState_D
 1-D FEA mesh state (device)
 
std::shared_ptr< FsiMeshStateHfsiMesh2DState_H
 2-D FEA mesh state (host)
 
std::shared_ptr< FsiMeshStateDfsiMesh2DState_D
 2-D FEA mesh state (device)
 
thrust::host_vector< int2 > flex1D_Nodes_H
 node indices for each 1-D flex segment (host)
 
thrust::device_vector< int2 > flex1D_Nodes_D
 node indices for each 1-D flex segment (device)
 
thrust::host_vector< int3 > flex2D_Nodes_H
 node indices for each 2-D flex face (host)
 
thrust::device_vector< int3 > flex2D_Nodes_D
 node indices for each 2-D flex face (device)
 
bool has_ad
 use solid active domains
 
thrust::host_vector< ActiveDomainad_body_H
 body active domains (on host, expressed in body frames)
 
thrust::device_vector< ActiveDomainad_body_D
 body active domains (on device, expressed in absolute frame)
 
thrust::host_vector< ActiveDomainad_node1D_H
 1-D mesh node active domains (on host, expressed in node frames)
 
thrust::device_vector< ActiveDomainad_node1D_D
 1-D mesh node active domains (on device, expressed in absolute frame)
 
thrust::host_vector< ActiveDomainad_node2D_H
 2–D mesh node active domains (on host, expressed in node frames)
 
thrust::device_vector< ActiveDomainad_node2D_D
 2-D mesh node active domains (on device, expressed in absolute frame)
 
thrust::host_vector< Real3rigid_BCEcoords_H
 local coordinates for BCE markers on rigid bodies (host)
 
thrust::device_vector< Real3rigid_BCEcoords_D
 local coordinates for BCE markers on rigid bodies (device)
 
thrust::host_vector< Real3flex1D_BCEcoords_H
 local coords for BCE markers on 1-D flex segments (host)
 
thrust::device_vector< Real3flex1D_BCEcoords_D
 local coords for BCE markers on 1-D flex segments (device)
 
thrust::host_vector< Real3flex2D_BCEcoords_H
 local coords for BCE markers on 2-D flex faces (host)
 
thrust::device_vector< Real3flex2D_BCEcoords_D
 local coors for BCE markers on 2-D flex faces (device)
 
thrust::host_vector< uintrigid_BCEsolids_H
 body ID for BCE markers on rigid bodies (host)
 
thrust::device_vector< uintrigid_BCEsolids_D
 body ID for BCE markers on rigid bodies (device)
 
thrust::host_vector< uint3 > flex1D_BCEsolids_H
 mesh and segment IDs for BCE markers on 1-D segments (host)
 
thrust::device_vector< uint3 > flex1D_BCEsolids_D
 mesh and segment IDs for BCE markers on 1-D segments (device)
 
thrust::host_vector< uint3 > flex2D_BCEsolids_H
 mesh and face IDs for BCE markers on 2-D faces (host)
 
thrust::device_vector< uint3 > flex2D_BCEsolids_D
 mesh and face IDs for BCE markers on 2-D faces (device)
 
thrust::device_vector< Real3rigid_FSI_ForcesD
 surface-integrated forces to rigid bodies
 
thrust::device_vector< Real3rigid_FSI_TorquesD
 surface-integrated torques to rigid bodies
 
thrust::device_vector< Real3flex1D_FSIforces_D
 surface-integrated forces on FEA 1-D segment nodes
 
thrust::device_vector< Real3flex2D_FSIforces_D
 surface-integrated forces on FEA 2-D face nodes
 
std::shared_ptr< ProximityDataDmarkersProximity_D
 information of neighbor search on the device
 
thrust::host_vector< int4 > referenceArray
 phases in the array of SPH particles
 
thrust::host_vector< int4 > referenceArray_FEA
 phases in the array of SPH particles for flexible elements
 
thrust::device_vector< Real4derivVelRhoD
 particle dv/dt and d(rho)/dt for particles
 
thrust::device_vector< Real4derivVelRhoOriginalD
 particle dv/dt and d(rho)/dt - unsorted
 
thrust::device_vector< Real3derivTauXxYyZzD
 d(tau)/dt for particles
 
thrust::device_vector< Real3derivTauXyXzYzD
 d(tau)/dt for particles
 
thrust::device_vector< Real3vel_XSPH_D
 XSPH velocity for particles.
 
thrust::device_vector< Real3vis_vel_SPH_D
 ISPH velocity for particles.
 
thrust::device_vector< Real4sr_tau_I_mu_i
 ISPH strain-rate, stress, inertia number, friction.
 
thrust::device_vector< Real4sr_tau_I_mu_i_Original
 ISPH strain-rate, stress, inertia number, friction.
 
thrust::device_vector< Real3bceAcc
 acceleration for boundary/rigid/flex body particles
 
thrust::device_vector< int32_t > activityIdentifierOriginalD
 active particle flags - unsorted
 
thrust::device_vector< int32_t > activityIdentifierSortedD
 active particle flags - sorted
 
thrust::device_vector< int32_t > extendedActivityIdentifierOriginalD
 active particle flags - unsorted
 
thrust::device_vector< uintprefixSumExtendedActivityIdD
 prefix sum of extended particles
 
thrust::device_vector< uintactiveListD
 active list of particles
 
thrust::device_vector< uintnumNeighborsPerPart
 number of neighbors for each particle
 
thrust::device_vector< uintneighborList
 neighbor list for all particles
 
thrust::device_vector< uintfreeSurfaceIdD
 identifiers for particles close to free surface
 
thrust::device_vector< RealposDivergenceD
 divergence of the position field (basis of the free-surface test)
 
thrust::device_vector< RealcourantViscousTimeStepD
 Courant time step for viscosity.
 
thrust::device_vector< RealaccelerationTimeStepD
 Courant time step for acceleration - unsorted.
 

Member Function Documentation

◆ GetFreeSurfaceFlags()

std::vector<int> chrono::fsi::sph::FsiDataManager::GetFreeSurfaceFlags ( )

Extract free-surface identification flags of all markers (SPH and BCE).

A value of 1 marks an SPH particle at or near the free surface. Zero is reported for BCE markers and for SPH particles that are not active, namely particles in the extended halo of an active domain and particles that left the computational domain. Such particles have a truncated neighborhood by construction, so their free-surface test is meaningless and would otherwise report a spurious surface along the active domain boundary.

◆ GetProperties()

std::vector<Real3> chrono::fsi::sph::FsiDataManager::GetProperties ( )

Extract fluid properties of all markers (SPH and BCE).

For each SPH particle, the 3-dimensional vector contains density, pressure, and viscosity.

◆ Initialize()

void chrono::fsi::sph::FsiDataManager::Initialize ( unsigned int  num_fsi_bodies,
unsigned int  num_fsi_meshes1D,
unsigned int  num_fsi_nodes1D,
unsigned int  num_fsi_elements1D,
unsigned int  num_fsi_meshes2D,
unsigned int  num_fsi_nodes2D,
unsigned int  num_fsi_elements2D,
bool  ad_defined,
const std::vector< ChAABB > &  ad_body,
const std::vector< ChAABB > &  ad_node1D,
const std::vector< ChAABB > &  ad_node2D,
NodeDirections  node_directions_mode 
)

Initialize the underlying FSU system.

Set reference arrays and counters, cache solid active domains, and resize simulation arrays.

◆ ResetData()

void chrono::fsi::sph::FsiDataManager::ResetData ( )

Reset device data at beginning of a step.

Initializes device vectors to zero.

◆ UpdateActiveDomains()

void chrono::fsi::sph::FsiDataManager::UpdateActiveDomains ( )

Update solid active domains (used for CRM only).

Update device active domains expressed in the absolute frame.


The documentation for this struct was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono_fsi/sph/physics/SphDataManager.cuh