chrono学习(一)

我想用chrono进行沙土的仿真,首先学习demo_GPU_ballCosim.cpp,这个例子仿真了一些沙土的沉降过程。

首先,运行编辑完成的文件demo_GPU_ballCosim:

bash 复制代码
(base) eowyn@eowyn-MS-7D20:~/build_chrono/bin$ ./demo_GPU_ballCosim 

运行完得到一些数据,存放在DEMO_OUTPUT/GPU/ballCosim/checkpoint.dat中:

bash 复制代码
Reading parameters: ../data/gpu/ballCosim.json
--- Parsing JSON ---
params.sphere_radius 1.000000
params.sphere_density 1.000000
...
params.step_size 0.000050
--------------------
Now run_mode == FRICTIONLESS, this run is particle settling phase.
After it is done, you will have a settled bed of granular material.
A checkpoint file will be generated in the output directory to store this state.
Next, edit the JSON file, change 'run_mode' from 0 (FRICTIONLESS) to 1 (ONE_STEP),
then run this demo again to proceed with the ball drop part of this demo.

622476 particles sampled!
Output frame 1 of 100
Output frame 2 of 100
Output frame 3 of 100
...
Output frame 101 of 100
Writing checkpoint data to file "DEMO_OUTPUT/GPU/ballCosim/checkpoint.dat"

然后,根据运行文件中的提示,将/build_chrono/data/gpu/ballCosim.json文件中的'run_mode'变量从frictionless改成one_step. 然后,重新运行demo_GPU_ballCosim,将会展示沉降后的沙土。

bash 复制代码
(base) eowyn@eowyn-MS-7D20:~/build_chrono/bin$ ./demo_GPU_ballCosim 
Reading parameters: ../data/gpu/ballCosim.json
--- Parsing JSON ---
params.sphere_radius 1.000000
params.sphere_density 1.000000
...
params.step_size 0.000050
--------------------
Reading checkpoint data from file "DEMO_OUTPUT/GPU/ballCosim/checkpoint.dat"...
1 meshes
Version: 3.3.0
NVIDIA Corporation : NVIDIA GeForce RTX 3060/PCIe/SSE2 (3.3.0 NVIDIA 470.199.02)
GLSL: 3.30 NVIDIA via Cg compiler
Initialize Viewer : GL_INVALID_ENUM
Output at    50 FPS
Rendering at 2000 FPS
Output frame 1 of 100
Output frame 2 of 100
...
Output frame 10 of 100
Time: 67.6678 seconds
相关推荐
qq_406981037 小时前
c++构造函数初始化列表
c++
王老师青少年编程8 小时前
2026年9月GESP真题及题解(C++八级):末班车
c++·题解·真题·gesp·八级·2026年9月·末班车
cu1438 小时前
细谈GM7123C的具体功能与其应用
c语言·c++·人工智能·嵌入式硬件
朝朝辞暮i8 小时前
C++ 第 10 课:函数 Function
开发语言·c++
Zootopia6269 小时前
快递无人车与无人机各自进入配送网络后,路线能否一起算?
c++·人工智能·机器学习·matlab·ai·机器人·无人机
朝朝辞暮i9 小时前
C++ 第7课 while 循环
开发语言·c++·算法
huanbailu10 小时前
Qt 跨线程信号槽:connect 返回 true 但槽函数不执行的坑
开发语言·c++·qt·信号槽·跨线程·元类型
HEJOO911 小时前
C++ 虚函数表(vtable)深度解析
开发语言·c++
xailorliu12 小时前
矩阵定性-正定负定不定半正定半负定
c++·opencv·线性代数·计算机视觉·矩阵
个 人 练 习 生12 小时前
C++-----string基本使用详解
开发语言·c++·学习