Model construction, and I/O 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 Model construction, and I/O utilities:

Classes

class  chrono::fsi::ChVisualizationFsi
 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 > sphMarkersH, std::shared_ptr< FsiGeneralData > fsiGeneralData, 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 > &velRigidD, const thrust::device_vector< Real4 > &qRigidD, const thrust::device_vector< Real3 > &posNodeD, const thrust::device_vector< Real3 > &velNodeD, const thrust::host_vector< Real3 > &forceRigid, const thrust::host_vector< Real3 > &torqueRigid, const thrust::host_vector< Real3 > &forceNode, 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.
 
ChVector chrono::fsi::utils::ToChVector (const Real3 &p3)
 Convert a Real3 data structure to a ChVector data structure.
 
ChVector chrono::fsi::utils::ToChVector (const Real2 &p2)
 Convert a Real2 data structure to a ChVector data structure.
 
ChVector chrono::fsi::utils::ToChVector (const Real4 &p4)
 Convert the first 3 arguments of a Real4 data structure to a ChVector data structure.
 
ChQuaternion chrono::fsi::utils::ToChQuaternion (const Real4 &q4)
 Convert a Real4 data structure to a ChQuaternion data structure.
 
Real3 chrono::fsi::utils::ToReal3 (const ChVector<> &v3)
 Convert a ChVector data structure to a Real3 data structure.
 
Real4 chrono::fsi::utils::ToReal4 (const ChVector<> &v3, Real m)
 Convert a ChVector 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 > &  velRigidD,
const thrust::device_vector< Real4 > &  qRigidD,
const thrust::device_vector< Real3 > &  posNodeD,
const thrust::device_vector< Real3 > &  velNodeD,
const thrust::host_vector< Real3 > &  forceRigid,
const thrust::host_vector< Real3 > &  torqueRigid,
const thrust::host_vector< Real3 > &  forceNode,
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.