Skip to content

Commit

Permalink
Merge pull request #342 from polyfem/fix-differentiable
Browse files Browse the repository at this point in the history
try to fix unit test
  • Loading branch information
Huangzizhou committed Jun 5, 2024
2 parents 7938f16 + 7f78a56 commit 380cd4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,13 @@ TEST_CASE("friction-contact", "[test_adjoint]")

auto nl_problem = std::make_shared<AdjointNLProblem>(obj, var2sim, states, opt_args);

Eigen::VectorXd velocity_discrete;
velocity_discrete.setRandom(1);
Eigen::VectorXd velocity_discrete(1);
velocity_discrete << 1.;

Eigen::VectorXd x(1);
x << 0.2;

verify_adjoint(*nl_problem, x, velocity_discrete, 1e-7, 1e-5);
verify_adjoint(*nl_problem, x, velocity_discrete, 1e-4, 1e-6);
}

TEST_CASE("barycenter", "[test_adjoint]")
Expand Down

0 comments on commit 380cd4f

Please sign in to comment.