Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 3c30dc5

Browse files
committed
comment huge test
1 parent cbf0f79 commit 3c30dc5

File tree

1 file changed

+60
-60
lines changed

1 file changed

+60
-60
lines changed

tests/src/tests/potential/test_new.cpp

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -85,63 +85,63 @@ using namespace ipc;
8585
// // std::cout << "hess: " << hess_b.norm() << "\n";
8686
// }
8787

88-
TEST_CASE(
89-
"Smooth barrier potential convergence 3D",
90-
"[smooth_potential]")
91-
{
92-
const BroadPhaseMethod method = BroadPhaseMethod::BVH;
93-
const bool adaptive_dhat = false;
94-
95-
double dhat = -1;
96-
std::string mesh_name = "";
97-
SECTION("debug")
98-
{
99-
mesh_name = ("2-cubes.obj");
100-
dhat = 0.25;
101-
}
102-
103-
double min_dist_ratio = 0.8;
104-
Eigen::MatrixXd vertices;
105-
Eigen::MatrixXi edges, faces;
106-
bool success = tests::load_mesh(mesh_name, vertices, edges, faces);
107-
CAPTURE(mesh_name);
108-
REQUIRE(success);
109-
110-
CollisionMesh mesh;
111-
ParameterType param(dhat, 0.8, 0, 0.1, 0, 2);
112-
param.set_adaptive_dhat_ratio(min_dist_ratio);
113-
SmoothCollisions<3> collisions;
114-
mesh = CollisionMesh(vertices, edges, faces);
115-
std::cout << "Mesh Memory " << getCurrentRSS() / (1024.*1024) << "MB\n";
116-
117-
// ignore self-contact
118-
{
119-
std::vector<int> vids(vertices.rows(), 0);
120-
for (int i = 0; i < vertices.rows(); i++)
121-
if (vertices(i, 0) < -1.1)
122-
vids[i] = 1;
123-
mesh.can_collide = [vids](size_t vi, size_t vj) {
124-
return vids[vi] != vids[vj];
125-
};
126-
}
127-
128-
// collisions.compute_adaptive_dhat(mesh, vertices, param, method);
129-
collisions.build(mesh, vertices, param, adaptive_dhat, method);
130-
std::cout << "Collision set Memory " << getCurrentRSS() / (1024.*1024) << "MB\n";
131-
CAPTURE(dhat, method, adaptive_dhat);
132-
CHECK(collisions.size() > 0);
133-
std::cout << "smooth collision candidate size " << collisions.size() << "\n";
134-
135-
CHECK(!has_intersections(mesh, vertices));
136-
137-
SmoothContactPotential<SmoothCollisions<3>> potential(param);
138-
std::cout << std::setprecision(12) << "energy: " << potential(collisions, mesh, vertices) << "\n";
139-
140-
// -------------------------------------------------------------------------
141-
// Gradient
142-
// -------------------------------------------------------------------------
143-
144-
// const Eigen::VectorXd grad_b =
145-
// potential.gradient(collisions, mesh, vertices);
146-
// std::cout << "grad: " << grad_b.norm() << "\n";
147-
}
88+
// TEST_CASE(
89+
// "Smooth barrier potential convergence 3D",
90+
// "[smooth_potential]")
91+
// {
92+
// const BroadPhaseMethod method = BroadPhaseMethod::BVH;
93+
// const bool adaptive_dhat = false;
94+
95+
// double dhat = -1;
96+
// std::string mesh_name = "";
97+
// SECTION("debug")
98+
// {
99+
// mesh_name = ("2-cubes.obj");
100+
// dhat = 0.25;
101+
// }
102+
103+
// double min_dist_ratio = 0.8;
104+
// Eigen::MatrixXd vertices;
105+
// Eigen::MatrixXi edges, faces;
106+
// bool success = tests::load_mesh(mesh_name, vertices, edges, faces);
107+
// CAPTURE(mesh_name);
108+
// REQUIRE(success);
109+
110+
// CollisionMesh mesh;
111+
// ParameterType param(dhat, 0.8, 0, 0.1, 0, 2);
112+
// param.set_adaptive_dhat_ratio(min_dist_ratio);
113+
// SmoothCollisions<3> collisions;
114+
// mesh = CollisionMesh(vertices, edges, faces);
115+
// std::cout << "Mesh Memory " << getCurrentRSS() / (1024.*1024) << "MB\n";
116+
117+
// // ignore self-contact
118+
// {
119+
// std::vector<int> vids(vertices.rows(), 0);
120+
// for (int i = 0; i < vertices.rows(); i++)
121+
// if (vertices(i, 0) < -1.1)
122+
// vids[i] = 1;
123+
// mesh.can_collide = [vids](size_t vi, size_t vj) {
124+
// return vids[vi] != vids[vj];
125+
// };
126+
// }
127+
128+
// // collisions.compute_adaptive_dhat(mesh, vertices, param, method);
129+
// collisions.build(mesh, vertices, param, adaptive_dhat, method);
130+
// std::cout << "Collision set Memory " << getCurrentRSS() / (1024.*1024) << "MB" << std::endl;
131+
// CAPTURE(dhat, method, adaptive_dhat);
132+
// CHECK(collisions.size() > 0);
133+
// std::cout << "smooth collision candidate size " << collisions.size() << std::endl;
134+
135+
// CHECK(!has_intersections(mesh, vertices));
136+
137+
// SmoothContactPotential<SmoothCollisions<3>> potential(param);
138+
// std::cout << std::setprecision(12) << "energy: " << potential(collisions, mesh, vertices) << std::endl;
139+
140+
// // -------------------------------------------------------------------------
141+
// // Gradient
142+
// // -------------------------------------------------------------------------
143+
144+
// // const Eigen::VectorXd grad_b =
145+
// // potential.gradient(collisions, mesh, vertices);
146+
// // std::cout << "grad: " << grad_b.norm() << "\n";
147+
// }

0 commit comments

Comments
 (0)