8#include <ipc/collisions/collisions.hpp>
9#include <ipc/collision_mesh.hpp>
10#include <ipc/broad_phase/broad_phase.hpp>
11#include <ipc/potentials/barrier_potential.hpp>
16 NLOHMANN_JSON_SERIALIZE_ENUM(
17 ipc::BroadPhaseMethod,
18 {{ipc::BroadPhaseMethod::HASH_GRID,
"hash_grid"},
19 {ipc::BroadPhaseMethod::HASH_GRID,
"HG"},
20 {ipc::BroadPhaseMethod::BRUTE_FORCE,
"brute_force"},
21 {ipc::BroadPhaseMethod::BRUTE_FORCE,
"BF"},
22 {ipc::BroadPhaseMethod::SPATIAL_HASH,
"spatial_hash"},
23 {ipc::BroadPhaseMethod::SPATIAL_HASH,
"SH"},
24 {ipc::BroadPhaseMethod::BVH,
"bvh"},
25 {ipc::BroadPhaseMethod::BVH,
"BVH"},
26 {ipc::BroadPhaseMethod::SWEEP_AND_PRUNE,
"sweep_and_prune"},
27 {ipc::BroadPhaseMethod::SWEEP_AND_PRUNE,
"SAP"},
28 {ipc::BroadPhaseMethod::SWEEP_AND_TINIEST_QUEUE,
"sweep_and_tiniest_queue"},
29 {ipc::BroadPhaseMethod::SWEEP_AND_TINIEST_QUEUE,
"STQ"}})
47 ContactForm(
const ipc::CollisionMesh &collision_mesh,
49 const double avg_mass,
52 const bool is_time_dependent,
54 const ipc::BroadPhaseMethod broad_phase_method,
55 const double ccd_tolerance,
56 const int ccd_max_iterations);
59 std::string
name()
const override {
return "contact"; }
63 void init(
const Eigen::VectorXd &
x)
override;
98 double max_step_size(
const Eigen::VectorXd &x0,
const Eigen::VectorXd &x1)
const override;
103 void line_search_begin(
const Eigen::VectorXd &x0,
const Eigen::VectorXd &x1)
override;
115 void post_step(
const polysolve::nonlinear::PostStepData &data)
override;
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix