Description

Base class to calculate force between SPH particles.

This is an abstract class that defines an interface that various SPH method should implement. The class owns a collision system fsi which takes care of GPU based proximity computation of the particles. It also holds a pointer to external data of SPH particles, proximity data, parameters, and numbers. Child class must implement Initialize and ForceSPH methods.

Inheritance diagram for chrono::fsi::ChFsiForce:
Collaboration diagram for chrono::fsi::ChFsiForce:

Public Member Functions

 ChFsiForce (std::shared_ptr< ChBce > otherBceWorker, std::shared_ptr< SphMarkerDataD > otherSortedSphMarkersD, std::shared_ptr< ProximityDataD > otherMarkersProximityD, std::shared_ptr< FsiGeneralData > otherFsiGeneralData, std::shared_ptr< SimParams > otherParamsH, std::shared_ptr< ChCounters > otherNumObjects, bool verb)
 Base constructor for the ChFsiForce class. More...
 
virtual ~ChFsiForce ()
 Destructor of the ChFsiForce.
 
virtual void ForceSPH (std::shared_ptr< SphMarkerDataD > otherSphMarkersD, std::shared_ptr< FsiBodiesDataD > otherFsiBodiesD, std::shared_ptr< FsiMeshDataD > fsiMeshD)=0
 Function to calculate forces on SPH particles. More...
 
virtual void Initialize ()
 Synchronize the copy of the data (parameters and number of objects) between device (GPU) and host (CPU). More...
 
void SetLinearSolver (SolverType type)
 Function to set the linear solver type for the solver implemented using the ISPH method (ChFsiForceI2SPH and ChFsiForceIISPH)
 
- Public Member Functions inherited from chrono::fsi::ChFsiGeneral
 ChFsiGeneral (std::shared_ptr< SimParams > hostParams, std::shared_ptr< ChCounters > hostNumObjects)
 Constructor for the ChFsiGeneral class. More...
 
virtual ~ChFsiGeneral ()
 Destructor of the ChFsiGeneral class.
 
void computeGridSize (uint n, uint blockSize, uint &numBlocks, uint &numThreads)
 Compute number of blocks and threads for calculation on GPU. More...
 

Static Public Member Functions

static void CopySortedToOriginal_Invasive_R3 (thrust::device_vector< Real3 > &original, thrust::device_vector< Real3 > &sorted, const thrust::device_vector< uint > &gridMarkerIndex)
 Copy sorted data into original data (real3). More...
 
static void CopySortedToOriginal_NonInvasive_R3 (thrust::device_vector< Real3 > &original, const thrust::device_vector< Real3 > &sorted, const thrust::device_vector< uint > &gridMarkerIndex)
 Copy sorted data into original data (real3). More...
 
static void CopySortedToOriginal_Invasive_R4 (thrust::device_vector< Real4 > &original, thrust::device_vector< Real4 > &sorted, const thrust::device_vector< uint > &gridMarkerIndex)
 Copy sorted data into original data (real4). More...
 
static void CopySortedToOriginal_NonInvasive_R4 (thrust::device_vector< Real4 > &original, thrust::device_vector< Real4 > &sorted, const thrust::device_vector< uint > &gridMarkerIndex)
 Copy sorted data into original data (real4). More...
 

Protected Attributes

std::shared_ptr< ChFsiLinearSolvermyLinearSolver
 pointer to the linear solver type
 
std::shared_ptr< ChBcebceWorker
 pointer to Boundary Condition Enforcing particles class
 
std::shared_ptr< ChCollisionSystemFsifsiCollisionSystem
 collision system for building neighbors list
 
std::shared_ptr< SphMarkerDataDsphMarkersD
 device copy of the SPH particles data
 
std::shared_ptr< SphMarkerDataDsortedSphMarkersD
 device copy of the sorted sph particles data
 
std::shared_ptr< ProximityDataDmarkersProximityD
 pointer object that holds the proximity of the particles
 
std::shared_ptr< FsiGeneralDatafsiGeneralData
 pointer to sph general data
 
std::shared_ptr< SimParamsparamsH
 pointer to simulation parameters
 
std::shared_ptr< ChCountersnumObjectsH
 pointer to number of objects, fluid and boundary particles
 
thrust::device_vector< Real3 > vel_vis_Sorted_D
 sorted visualization velocity data
 
thrust::device_vector< Real3 > vel_XSPH_Sorted_D
 sorted xsph velocity data
 
thrust::device_vector< Real4 > derivVelRhoD_Sorted_D
 sorted derivVelRhoD
 
bool verbose
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::fsi::ChFsiGeneral
uint iDivUp (uint a, uint b)
 Return a/b or a/b + 1.
 

Constructor & Destructor Documentation

◆ ChFsiForce()

chrono::fsi::ChFsiForce::ChFsiForce ( std::shared_ptr< ChBce otherBceWorker,
std::shared_ptr< SphMarkerDataD otherSortedSphMarkersD,
std::shared_ptr< ProximityDataD otherMarkersProximityD,
std::shared_ptr< FsiGeneralData otherFsiGeneralData,
std::shared_ptr< SimParams otherParamsH,
std::shared_ptr< ChCounters otherNumObjects,
bool  verb 
)

Base constructor for the ChFsiForce class.

The constructor instantiates the force system and initializes the pointer to external data.

Parameters
otherBceWorkerobject that handles BCE particles
otherSortedSphMarkersDinformation of particle in the sorted device array
otherMarkersProximityDobject that holds device proximity info
otherFsiGeneralDataSPH general data
otherParamsHsimulation parameters on host
otherNumObjectscounters
verbverbose terminal output

Member Function Documentation

◆ CopySortedToOriginal_Invasive_R3()

static void chrono::fsi::ChFsiForce::CopySortedToOriginal_Invasive_R3 ( thrust::device_vector< Real3 > &  original,
thrust::device_vector< Real3 > &  sorted,
const thrust::device_vector< uint > &  gridMarkerIndex 
)
static

Copy sorted data into original data (real3).

This function copies the data that are sorted in the collision system, into the original data, where data is real3. The class is invasive, meaning that the sorted data will be modified (and will be equivalent to the original). Therefore, this function should be used whenever sorted data is not needed, but efficiency is preferred.

◆ CopySortedToOriginal_Invasive_R4()

static void chrono::fsi::ChFsiForce::CopySortedToOriginal_Invasive_R4 ( thrust::device_vector< Real4 > &  original,
thrust::device_vector< Real4 > &  sorted,
const thrust::device_vector< uint > &  gridMarkerIndex 
)
static

Copy sorted data into original data (real4).

This function copies the data that are sorted in the collision system, into the original data, where data is real4. The class is invasive, meaning that the sorted data will be modified (and will be equivalent to the original). Therefore, this function should be used whenever sorted data is not needed, but efficiency is preferred.

◆ CopySortedToOriginal_NonInvasive_R3()

static void chrono::fsi::ChFsiForce::CopySortedToOriginal_NonInvasive_R3 ( thrust::device_vector< Real3 > &  original,
const thrust::device_vector< Real3 > &  sorted,
const thrust::device_vector< uint > &  gridMarkerIndex 
)
static

Copy sorted data into original data (real3).

This function copies the data that are sorted in the collision system, into the original data, where data is real3. The class is non-invasive, meaning that the sorted data will not be modified. This comes at the expense of lower efficiency.

◆ CopySortedToOriginal_NonInvasive_R4()

static void chrono::fsi::ChFsiForce::CopySortedToOriginal_NonInvasive_R4 ( thrust::device_vector< Real4 > &  original,
thrust::device_vector< Real4 > &  sorted,
const thrust::device_vector< uint > &  gridMarkerIndex 
)
static

Copy sorted data into original data (real4).

This function copies the data that are sorted in the collision system, into the original data, where data is real4. The class is non-invasive, meaning that the sorted data will not be modified. This comes at the expense of lower efficiency.

◆ ForceSPH()

virtual void chrono::fsi::ChFsiForce::ForceSPH ( std::shared_ptr< SphMarkerDataD otherSphMarkersD,
std::shared_ptr< FsiBodiesDataD otherFsiBodiesD,
std::shared_ptr< FsiMeshDataD fsiMeshD 
)
pure virtual

Function to calculate forces on SPH particles.

This is a virtual method that needs to be overridden by the child classes to compute forces in an implicit integrator using ISPH method (see ChFsiForceI2SPH and ChFsiForceIISPH) or an explicit integrator using WCPSH method (see ChFsiForceExplicitSPH).

◆ Initialize()

virtual void chrono::fsi::ChFsiForce::Initialize ( )
virtual

Synchronize the copy of the data (parameters and number of objects) between device (GPU) and host (CPU).

This function needs to be called once the host data are modified.

Reimplemented in chrono::fsi::ChFsiForceExplicitSPH, chrono::fsi::ChFsiForceI2SPH, and chrono::fsi::ChFsiForceIISPH.


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