@@ -390,7 +390,7 @@ Edge3::Edge3(
390390{
391391 orientable =
392392 (mesh.is_orient_vertex (mesh.edges ()(id, 0 ))
393- && mesh.is_orient_vertex (mesh.edges ()(id, 0 )));
393+ && mesh.is_orient_vertex (mesh.edges ()(id, 1 )));
394394
395395 std::array<index_t , 4 > neighbors { { -1 , -1 , -1 , -1 } };
396396 {
@@ -450,20 +450,25 @@ Edge3::Edge3(
450450 d.normalized (), vertices.row (m_vertex_ids[0 ]),
451451 vertices.row (m_vertex_ids[1 ]), vertices.row (m_vertex_ids[2 ]),
452452 vertices.row (m_vertex_ids[3 ]), params, otypes, orientable);
453- } else if (has_neighbor_1 || has_neighbor_2) {
454- m_vertex_ids = { { neighbors[0 ], neighbors[1 ],
455- has_neighbor_1 ? neighbors[2 ] : neighbors[3 ] } };
456-
457453 } else {
458- m_vertex_ids = { { neighbors[0 ], neighbors[1 ] } };
459- m_is_active = true ;
454+ log_and_throw_error (
455+ " Codimensional objects in 3D are not supported yet!" );
456+
457+ if (has_neighbor_1 || has_neighbor_2) {
458+ m_vertex_ids = { { neighbors[0 ], neighbors[1 ],
459+ has_neighbor_1 ? neighbors[2 ] : neighbors[3 ] } };
460+
461+ } else {
462+ m_vertex_ids = { { neighbors[0 ], neighbors[1 ] } };
463+ m_is_active = true ;
464+ }
460465 }
461466}
462467
463- int Edge3::n_vertices () const { return N_EDGE_NEIGHBORS_3D ; }
468+ int Edge3::n_vertices () const { return m_vertex_ids. size () ; }
464469
465470double Edge3::potential (
466- Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<Vector12d > x) const
471+ Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<VectorMax12d > x) const
467472{
468473#ifdef IPC_TOOLKIT_DEBUG_AUTODIFF
469474 return smooth_edge3_term_template<double >(
@@ -477,7 +482,7 @@ double Edge3::potential(
477482}
478483
479484Vector15d Edge3::grad (
480- Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<Vector12d > x) const
485+ Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<VectorMax12d > x) const
481486{
482487#ifdef IPC_TOOLKIT_DEBUG_AUTODIFF
483488 Vector15d tmp;
@@ -497,7 +502,7 @@ Vector15d Edge3::grad(
497502}
498503
499504Matrix15d Edge3::hessian (
500- Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<Vector12d > x) const
505+ Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<VectorMax12d > x) const
501506{
502507#ifdef IPC_TOOLKIT_DEBUG_AUTODIFF
503508 Vector15d tmp;
0 commit comments