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...
 
class  chrono::fsi::ChUtilsTypeConvert
 Class for converting Chrono data structure to/from FSI data structure. More...
 

Functions

ChVector chrono::fsi::utils::TransformBCEToCOG (std::shared_ptr< ChBody > body, const ChVector<> &pos)
 This utility function converts a given position and orientation, specified with respect to a body's reference frame, into a frame defined with respect to the body's centroidal frame. More...
 
ChVector chrono::fsi::utils::TransformBCEToCOG (std::shared_ptr< ChBody > body, const Real3 &pos3)
 This utility function converts a given position and orientation, specified with respect to a body's reference frame, into a frame defined with respect to the body's centroidal frame. More...
 
void chrono::fsi::utils::CreateBCE_On_Sphere (thrust::host_vector< Real4 > &posRadBCE, Real rad, std::shared_ptr< SimParams > paramsH)
 Create BCE particles from a sphere.
 
void chrono::fsi::utils::CreateBCE_On_surface_of_Sphere (thrust::host_vector< Real4 > &posRadBCE, Real rad, Real kernel_h)
 Create BCE particles from the surface of a sphere.
 
void chrono::fsi::utils::CreateBCE_On_Cylinder (thrust::host_vector< Real4 > &posRadBCE, Real cyl_rad, Real cyl_h, std::shared_ptr< SimParams > paramsH, Real kernel_h, bool cartesian=true)
 Create BCE particles from a cylinder.
 
void chrono::fsi::utils::CreateBCE_On_Cone (thrust::host_vector< Real4 > &posRadBCE, Real cone_rad, Real cone_h, std::shared_ptr< SimParams > paramsH, Real kernel_h, bool cartesian=true)
 Create BCE particles from a cone.
 
void chrono::fsi::utils::CreateBCE_On_surface_of_Cylinder (thrust::host_vector< Real4 > &posRadBCE, thrust::host_vector< Real3 > &normals, Real cyl_rad, Real cyl_h, Real spacing)
 Create BCE particles from the surface of a cylinder.
 
void chrono::fsi::utils::CreateBCE_On_Box (thrust::host_vector< Real4 > &posRadBCE, const Real3 &hsize, int face, std::shared_ptr< SimParams > paramsH)
 Create BCE particles from box.
 
void chrono::fsi::utils::LoadBCE_fromFile (thrust::host_vector< Real4 > &posRadBCE, std::string fileName, double scale=1, double hsml=1)
 Load BCE particles from a file.
 
void chrono::fsi::utils::CreateBCE_On_shell (thrust::host_vector< Real4 > &posRadBCE, std::shared_ptr< SimParams > paramsH, std::shared_ptr< chrono::fea::ChElementShellANCF_3423 > shell, bool multiLayer=true, bool removeMiddleLayer=false, int SIDE=-2)
 Create BCE particles from a shell element.
 
void chrono::fsi::utils::CreateBCE_On_ChElementCableANCF (thrust::host_vector< Real4 > &posRadBCE, std::shared_ptr< SimParams > paramsH, std::shared_ptr< chrono::fea::ChElementCableANCF > cable, std::vector< int > remove, bool multiLayer=true, bool removeMiddleLayer=false, int SIDE=1)
 Create BCE particles from a cable element.
 
void chrono::fsi::utils::CreateBCE_On_ChElementShellANCF (thrust::host_vector< Real4 > &posRadBCE, std::shared_ptr< SimParams > paramsH, std::shared_ptr< chrono::fea::ChElementShellANCF_3423 > shell, std::vector< int > remove, bool multiLayer=true, bool removeMiddleLayer=false, int SIDE=-2, double kernel_h=0)
 Create BCE particles from a shell element.
 
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::PrintToFile (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::host_vector< int4 > &referenceArray, const thrust::host_vector< int4 > &referenceArrayFEA, const std::string &dir, const std::shared_ptr< SimParams > &paramsH, bool printToParaview=false)
 Helper function to save the SPH data 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.
 

Function Documentation

◆ PrintToFile()

CH_FSI_API void chrono::fsi::utils::PrintToFile ( 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::host_vector< int4 > &  referenceArray,
const thrust::host_vector< int4 > &  referenceArrayFEA,
const std::string &  dir,
const std::shared_ptr< SimParams > &  paramsH,
bool  printToParaview = false 
)

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.

◆ TransformBCEToCOG() [1/2]

ChVector chrono::fsi::utils::TransformBCEToCOG ( std::shared_ptr< ChBody body,
const ChVector<> &  pos 
)

This utility function converts a given position and orientation, specified with respect to a body's reference frame, into a frame defined with respect to the body's centroidal frame.

Note that by default, a body's reference frame is the centroidal frame. This is not true for a ChBodyAuxRef.

◆ TransformBCEToCOG() [2/2]

ChVector chrono::fsi::utils::TransformBCEToCOG ( std::shared_ptr< ChBody body,
const Real3 &  pos3 
)

This utility function converts a given position and orientation, specified with respect to a body's reference frame, into a frame defined with respect to the body's centroidal frame.

Note that by default, a body's reference frame is the centroidal frame. This is not true for a ChBodyAuxRef.

◆ 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.