Description
Utilities for creating BCE particles, setting parameters via a JSON file, and output data into files with specified format.
Classes | |
class | chrono::fsi::sph::GpuTimer |
Time recorder for cuda events. More... | |
Functions | |
void | chrono::fsi::sph::computeGridSize (uint n, uint blockSize, uint &numBlocks, uint &numThreads) |
Compute number of blocks and threads for calculation on GPU. More... | |
void | chrono::fsi::sph::SaveParticleDataCFD (const std::string &dir, OutputLevel level, const thrust::device_vector< Real4 > &posRadD, const thrust::device_vector< Real3 > &velMasD, const thrust::device_vector< Real4 > &derivVelRhoD, const thrust::device_vector< Real4 > &rhoPresMuD, const thrust::device_vector< Real4 > &srTauMuD, const thrust::host_vector< int4 > &referenceArray, const thrust::host_vector< int4 > &referenceArrayFEA) |
Save current CFD SPH data to files. More... | |
void | chrono::fsi::sph::SaveParticleDataCRM (const std::string &dir, OutputLevel level, const thrust::device_vector< Real4 > &posRadD, const thrust::device_vector< Real3 > &velMasD, const thrust::device_vector< Real4 > &derivVelRhoD, const thrust::device_vector< Real4 > &rhoPresMuD, const thrust::device_vector< Real3 > &tauXxYyZzD, const thrust::device_vector< Real3 > &tauXyXzYzD, const thrust::host_vector< int4 > &referenceArray, const thrust::host_vector< int4 > &referenceArrayFEA) |
Save current CRM SPH data to files. More... | |
void | chrono::fsi::sph::SaveSolidData (const std::string &dir, double time, const thrust::device_vector< Real3 > &posRigidD, const thrust::device_vector< Real4 > &rotRigidD, const thrust::device_vector< Real3 > &velRigidD, const thrust::device_vector< Real3 > &forceRigidD, const thrust::device_vector< Real3 > &torqueRigidD, const thrust::device_vector< Real3 > &pos1DNodeD, const thrust::device_vector< Real3 > &vel1DNodeD, const thrust::device_vector< Real3 > &force1DNodeD, const thrust::device_vector< Real3 > &pos2DNodeD, const thrust::device_vector< Real3 > &vel2DNodeD, const thrust::device_vector< Real3 > &force2DNodeD) |
Save current FSI solid data. More... | |
void | chrono::fsi::sph::WriteParticleFileCSV (const std::string &filename, thrust::device_vector< Real4 > &posRadD, thrust::device_vector< Real3 > &velMasD, thrust::device_vector< Real4 > &rhoPresMuD, thrust::host_vector< int4 > &referenceArray) |
Save current particle data to a CSV file. More... | |
void | chrono::fsi::sph::WriteParticleFileCHPF (const std::string &filename, thrust::device_vector< Real4 > &posRadD, thrust::host_vector< int4 > &referenceArray) |
Save current particle data to a binary ChPF file. More... | |
void | chrono::fsi::sph::printStruct (struct Real2 &s) |
Print a Real2 struct. | |
void | chrono::fsi::sph::printStruct (struct int2 &s) |
Print a Int2 struct. | |
void | chrono::fsi::sph::printStruct (struct Real3 &s) |
Print a Real3 struct. | |
void | chrono::fsi::sph::printStruct (struct int3 &s) |
Print a Int3 struct. | |
void | chrono::fsi::sph::printStruct (struct Real4 &s) |
Print a Real4 struct. | |
void | chrono::fsi::sph::printStruct (struct int4 &s) |
Print a Int4 struct. | |
ChVector3d | chrono::fsi::sph::ToChVector (const Real3 &p3) |
Convert a Real3 data structure to a ChVector3d data structure. | |
ChVector3d | chrono::fsi::sph::ToChVector (const Real2 &p2) |
Convert a Real2 data structure to a ChVector3d data structure. | |
ChVector3d | chrono::fsi::sph::ToChVector (const Real4 &p4) |
Convert the first 3 arguments of a Real4 data structure to a ChVector3d data structure. | |
ChQuaternion | chrono::fsi::sph::ToChQuaternion (const Real4 &q4) |
Convert a Real4 data structure to a ChQuaternion data structure. | |
Real2 | chrono::fsi::sph::ToReal2 (const ChVector2<> &v2) |
Real3 | chrono::fsi::sph::ToReal3 (const ChVector3<> &v3) |
Convert a ChVector data structure to a Real3 data structure. | |
Real4 | chrono::fsi::sph::ToReal4 (const ChVector3d &v3, Real m) |
Convert a ChVector3d and a scalar to a Real4 data structure. | |
Real4 | chrono::fsi::sph::ToReal4 (const ChQuaternion<> &q4) |
Convert a ChQuaternion data structure to a Real4 data structure. | |
Macro Definition Documentation
◆ cudaCheckError
#define cudaCheckError | ( | ) |
◆ cudaCheckErrorFlag
#define cudaCheckErrorFlag | ( | error_flag_D, | |
kernel_name | |||
) |
◆ cudaResetErrorFlag
#define cudaResetErrorFlag | ( | error_flag_D | ) |
Function Documentation
◆ computeGridSize()
void chrono::fsi::sph::computeGridSize | ( | uint | n, |
uint | blockSize, | ||
uint & | numBlocks, | ||
uint & | numThreads | ||
) |
Compute number of blocks and threads for calculation on GPU.
This function calculates the number of blocks and threads for a given number of elements based on the blockSize.
- Parameters
-
n total number of elements blockSize block size (threads per block) numBlocks number of blocks [output] numThreads number of threads [output]
◆ SaveParticleDataCFD()
void chrono::fsi::sph::SaveParticleDataCFD | ( | const std::string & | dir, |
OutputLevel | level, | ||
const thrust::device_vector< Real4 > & | posRadD, | ||
const thrust::device_vector< Real3 > & | velMasD, | ||
const thrust::device_vector< Real4 > & | derivVelRhoD, | ||
const thrust::device_vector< Real4 > & | rhoPresMuD, | ||
const thrust::device_vector< Real4 > & | srTauMuD, | ||
const thrust::host_vector< int4 > & | referenceArray, | ||
const thrust::host_vector< int4 > & | referenceArrayFEA | ||
) |
Save current CFD SPH data to files.
Create separate files to write fluid, boundary BCE, rigid BCE, and flex BCE marker information. The amount of data saved for each marker is controlled by the specified OutputLevel (e.g., for level CFD_FULL, the output includes shear rate).
◆ SaveParticleDataCRM()
void chrono::fsi::sph::SaveParticleDataCRM | ( | const std::string & | dir, |
OutputLevel | level, | ||
const thrust::device_vector< Real4 > & | posRadD, | ||
const thrust::device_vector< Real3 > & | velMasD, | ||
const thrust::device_vector< Real4 > & | derivVelRhoD, | ||
const thrust::device_vector< Real4 > & | rhoPresMuD, | ||
const thrust::device_vector< Real3 > & | tauXxYyZzD, | ||
const thrust::device_vector< Real3 > & | tauXyXzYzD, | ||
const thrust::host_vector< int4 > & | referenceArray, | ||
const thrust::host_vector< int4 > & | referenceArrayFEA | ||
) |
Save current CRM SPH data to files.
Create separate files to write fluid, boundary BCE, rigid BCE, and flex BCE marker information. The amount of data saved for each marker is controlled by the specified OutputLevel (e.g., for level CRM_FULL, the output includes stress).
◆ SaveSolidData()
void chrono::fsi::sph::SaveSolidData | ( | const std::string & | dir, |
double | time, | ||
const thrust::device_vector< Real3 > & | posRigidD, | ||
const thrust::device_vector< Real4 > & | rotRigidD, | ||
const thrust::device_vector< Real3 > & | velRigidD, | ||
const thrust::device_vector< Real3 > & | forceRigidD, | ||
const thrust::device_vector< Real3 > & | torqueRigidD, | ||
const thrust::device_vector< Real3 > & | pos1DNodeD, | ||
const thrust::device_vector< Real3 > & | vel1DNodeD, | ||
const thrust::device_vector< Real3 > & | force1DNodeD, | ||
const thrust::device_vector< Real3 > & | pos2DNodeD, | ||
const thrust::device_vector< Real3 > & | vel2DNodeD, | ||
const thrust::device_vector< Real3 > & | force2DNodeD | ||
) |
Save current FSI solid data.
Append states and fluid forces at current time for all solids in the FSI problem.
◆ WriteParticleFileCHPF()
void chrono::fsi::sph::WriteParticleFileCHPF | ( | const std::string & | filename, |
thrust::device_vector< Real4 > & | posRadD, | ||
thrust::host_vector< int4 > & | referenceArray | ||
) |
Save current particle data to a binary ChPF file.
Write particle positions only.
◆ WriteParticleFileCSV()
void chrono::fsi::sph::WriteParticleFileCSV | ( | const std::string & | filename, |
thrust::device_vector< Real4 > & | posRadD, | ||
thrust::device_vector< Real3 > & | velMasD, | ||
thrust::device_vector< Real4 > & | rhoPresMuD, | ||
thrust::host_vector< int4 > & | referenceArray | ||
) |
Save current particle data to a CSV file.
Write particle positions, velocities, rho, pressure, and mu.