Skip to content

Commit

Permalink
hang remove friction and dt logging update
Browse files Browse the repository at this point in the history
  • Loading branch information
ryichando committed Jan 6, 2025
1 parent af9031e commit 391c790
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
6 changes: 5 additions & 1 deletion examples/hang.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
"gravity = param.get(\"gravity\")\n",
"\n",
"# set strain-limiting upper bound 1% (0.5%+0.5%)\n",
"param.set(\"strain-limit-eps\", 0.005).set(\"strain-limit-tau\", 0.005)\n",
"(\n",
" param.set(\"strain-limit-eps\", 0.005)\n",
" .set(\"strain-limit-tau\", 0.005)\n",
" .set(\"friction\", 0.0)\n",
")\n",
"\n",
"# set the maximal video frame to 200\n",
"param.set(\"frames\", 200)\n",
Expand Down
26 changes: 17 additions & 9 deletions src/cpp/main/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ StepResult advance() {

float dt = param->dt;

// Name: Step Size
// Format: list[(vid_time,float)]
// Description:
// Target step size.
logging.mark("dt", dt);

if (shell_face_count) {
utility::compute_svd(data, data.vertex.curr, svd, prm);
tmp_scalar.clear();
Expand Down Expand Up @@ -664,6 +670,17 @@ StepResult advance() {
// Total count of Newton's steps consumed in the single step.
logging.mark("newton_steps", step);

// Name: Final Step Size
// Format: list[(vid_time,float)]
// Description:
// Actual step size advanced in the simulation.
// For most of the cases, this value is the same as the step
// size specified in the parameter. However, the actual step
// size is reduced by `toi_advanced` and may be also reduced
// when the option `enable_retry` is set to
// true and the PCG fails.
logging.mark("final_dt", dt);

param->prev_dt = dt;
param->time += param->prev_dt;

Expand All @@ -685,15 +702,6 @@ StepResult advance() {
logging.mark("retry_count", retry_count);
}
result.retry_count = retry_count;

// Name: Step Size
// Format: list[(vid_time,float)]
// Description:
// Actual step size advanced in the simulation.
// For most of the cases, this value is the same as the step size specified
// in the parameter. However, the actual step size is reduced when the
// option `enable_retry` is set to true and the PCG fails.
logging.mark("dt", dt);
return result;
}

Expand Down

0 comments on commit 391c790

Please sign in to comment.