Modeling utilities

Description

Handles utilities including creating BCE particles, setting parameters via a JSON file, and output data into files with specified format.

Collaboration diagram for Modeling utilities:

Classes

class  chrono::fsi::ChFsiVisualization
 Run-time visualization support for Chrono::FSI systems. More...
 
class  chrono::fsi::ChFsiVisualizationGL
 Run-time visualization support for Chrono::FSI systems. More...
 
class  chrono::fsi::ChFsiVisualizationVSG
 Run-time visualization support for Chrono::FSI systems. More...
 

Functions

Real chrono::fsi::utils::W3h_Spline (Real d, Real h)
 Kernel function.
 
Real chrono::fsi::utils::massCalculator (Real Kernel_h, Real InitialSpacing, Real rho0)
 Particle mass calculator based on the initial spacing and density.
 
Real chrono::fsi::utils::IniNeiNum (Real Kernel_h, Real InitialSpacing)
 Particle number calculator based on the initial spacing and kernel length.
 
int2 chrono::fsi::utils::CreateFluidMarkers (std::shared_ptr< SphMarkerDataH > sphMarkers_H, std::shared_ptr< FsiData > fsiData, std::shared_ptr< SimParams > paramsH)
 Create fluid/granular SPH particles for the simulation.
 
CH_FSI_API void chrono::fsi::utils::PrintParticleToFile (const thrust::device_vector< Real4 > &posRadD, const thrust::device_vector< Real3 > &velMasD, const thrust::device_vector< Real4 > &rhoPresMuD, const thrust::device_vector< Real4 > &sr_tau_I_mu_i, const thrust::device_vector< Real4 > &derivVelRhoD, const thrust::host_vector< int4 > &referenceArray, const thrust::host_vector< int4 > &referenceArrayFEA, const std::string &dir, const std::shared_ptr< SimParams > &paramsH)
 Helper function to save the SPH data into files. More...
 
CH_FSI_API void chrono::fsi::utils::PrintFsiInfoToFile (const thrust::device_vector< Real3 > &posRigidD, const thrust::device_vector< Real4 > &qRigidD, const thrust::device_vector< Real4 > &velRigidD, const thrust::device_vector< Real3 > &pos1DNodeD, const thrust::device_vector< Real3 > &pos2DNodeD, const thrust::device_vector< Real3 > &vel1DNodeD, const thrust::device_vector< Real3 > &vel2DNodeD, const thrust::device_vector< Real3 > &forceRigidD, const thrust::device_vector< Real3 > &torqueRigidD, const thrust::device_vector< Real3 > &force1DNodeD, const thrust::device_vector< Real3 > &force2DNodeD, const std::string &dir, const double time)
 Helper function to save the FSI information into files. More...
 
CH_FSI_API void chrono::fsi::utils::WriteCsvParticlesToFile (thrust::device_vector< Real4 > &posRadD, thrust::device_vector< Real3 > &velMasD, thrust::device_vector< Real4 > &rhoPresMuD, thrust::host_vector< int4 > &referenceArray, const std::string &outfilename)
 Helper function to save particle info from FSI system to a CSV files. More...
 
CH_FSI_API void chrono::fsi::utils::WriteChPFParticlesToFile (thrust::device_vector< Real4 > &posRadD, thrust::host_vector< int4 > &referenceArray, const std::string &outfilename)
 Helper function to save particle info from FSI system to a ChPF binary files. More...
 
void chrono::fsi::utils::printStruct (struct Real2 &s)
 Print a Real2 struct.
 
void chrono::fsi::utils::printStruct (struct int2 &s)
 Print a Int2 struct.
 
void chrono::fsi::utils::printStruct (struct Real3 &s)
 Print a Real3 struct.
 
void chrono::fsi::utils::printStruct (struct int3 &s)
 Print a Int3 struct.
 
void chrono::fsi::utils::printStruct (struct Real4 &s)
 Print a Real4 struct.
 
void chrono::fsi::utils::printStruct (struct int4 &s)
 Print a Int4 struct.
 
ChVector3d chrono::fsi::utils::ToChVector (const Real3 &p3)
 Convert a Real3 data structure to a ChVector3d data structure.
 
ChVector3d chrono::fsi::utils::ToChVector (const Real2 &p2)
 Convert a Real2 data structure to a ChVector3d data structure.
 
ChVector3d chrono::fsi::utils::ToChVector (const Real4 &p4)
 Convert the first 3 arguments of a Real4 data structure to a ChVector3d data structure.
 
ChQuaternion chrono::fsi::utils::ToChQuaternion (const Real4 &q4)
 Convert a Real4 data structure to a ChQuaternion data structure.
 
Real2 chrono::fsi::utils::ToReal2 (const ChVector2<> &v2)
 
Real3 chrono::fsi::utils::ToReal3 (const ChVector3<> &v3)
 Convert a ChVector data structure to a Real3 data structure.
 
Real4 chrono::fsi::utils::ToReal4 (const ChVector3d &v3, Real m)
 Convert a ChVector3d and a scalar to a Real4 data structure.
 
Real4 chrono::fsi::utils::ToReal4 (const ChQuaternion<> &q4)
 Convert a ChQuaternion data structure to a Real4 data structure.
 

Function Documentation

◆ PrintFsiInfoToFile()

CH_FSI_API void chrono::fsi::utils::PrintFsiInfoToFile ( const thrust::device_vector< Real3 > &  posRigidD,
const thrust::device_vector< Real4 > &  qRigidD,
const thrust::device_vector< Real4 > &  velRigidD,
const thrust::device_vector< Real3 > &  pos1DNodeD,
const thrust::device_vector< Real3 > &  pos2DNodeD,
const thrust::device_vector< Real3 > &  vel1DNodeD,
const thrust::device_vector< Real3 > &  vel2DNodeD,
const thrust::device_vector< Real3 > &  forceRigidD,
const thrust::device_vector< Real3 > &  torqueRigidD,
const thrust::device_vector< Real3 > &  force1DNodeD,
const thrust::device_vector< Real3 > &  force2DNodeD,
const std::string &  dir,
const double  time 
)

Helper function to save the FSI information into files.

When called, this function creates files to write position, velocity, orientation of rigid bosied and position, velocity of nodes on flexible bodies.

◆ PrintParticleToFile()

CH_FSI_API void chrono::fsi::utils::PrintParticleToFile ( const thrust::device_vector< Real4 > &  posRadD,
const thrust::device_vector< Real3 > &  velMasD,
const thrust::device_vector< Real4 > &  rhoPresMuD,
const thrust::device_vector< Real4 > &  sr_tau_I_mu_i,
const thrust::device_vector< Real4 > &  derivVelRhoD,
const thrust::host_vector< int4 > &  referenceArray,
const thrust::host_vector< int4 > &  referenceArrayFEA,
const std::string &  dir,
const std::shared_ptr< SimParams > &  paramsH 
)

Helper function to save the SPH data into files.

When called, this function creates three files to write fluid, boundary and BCE particles data into files.

◆ WriteChPFParticlesToFile()

CH_FSI_API void chrono::fsi::utils::WriteChPFParticlesToFile ( thrust::device_vector< Real4 > &  posRadD,
thrust::host_vector< int4 > &  referenceArray,
const std::string &  outfilename 
)

Helper function to save particle info from FSI system to a ChPF binary files.

This function saves only particle positions.

◆ WriteCsvParticlesToFile()

CH_FSI_API void chrono::fsi::utils::WriteCsvParticlesToFile ( thrust::device_vector< Real4 > &  posRadD,
thrust::device_vector< Real3 > &  velMasD,
thrust::device_vector< Real4 > &  rhoPresMuD,
thrust::host_vector< int4 > &  referenceArray,
const std::string &  outfilename 
)

Helper function to save particle info from FSI system to a CSV files.

This function saves particle positions, velocities, rho, pressure, and mu.