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
相关推荐
不想写代码的星星11 分钟前
COW(Copy-on-Write):开抄开抄,哎嘿,我装的
开发语言·c++
Sylvia-girl16 分钟前
C++内存如何管理?
java·jvm·c++
无敌秋29 分钟前
C++ 单例模式
c++·单例模式
Brilliantwxx36 分钟前
【C++】认识标准库STL(2)
开发语言·c++
故事还在继续吗41 分钟前
STL 容器算法手册
开发语言·c++·算法
啊我不会诶41 分钟前
2023西安邀请赛vp补题
c++·算法
唠玖馆41 分钟前
c++ list详解
c++
khalil102042 分钟前
代码随想录算法训练营Day-38动态规划06 | 322. 零钱兑换、279.完全平方数、139.单词拆分、多重背包、总结
数据结构·c++·算法·leetcode·动态规划
6Hzlia1 小时前
Hot 100 刷题计划】 LeetCode 146. LRU 缓存 | C++ 哈希表+双向链表
c++·leetcode·缓存
我不是懒洋洋1 小时前
【数据结构】二叉树OJ(单值二叉树、检查两棵树是否相同、对称二叉树、二叉树的前序遍历、另一颗树的子树)
c语言·数据结构·c++·经验分享·算法·leetcode·visual studio