@@ -388,7 +388,7 @@ Edge3::Edge3(
388388{
389389 orientable =
390390 (mesh.is_orient_vertex (mesh.edges ()(id, 0 ))
391- && mesh.is_orient_vertex (mesh.edges ()(id, 0 )));
391+ && mesh.is_orient_vertex (mesh.edges ()(id, 1 )));
392392
393393 std::array<index_t , 4 > neighbors { { -1 , -1 , -1 , -1 } };
394394 {
@@ -448,20 +448,24 @@ Edge3::Edge3(
448448 d.normalized (), vertices.row (m_vertex_ids[0 ]),
449449 vertices.row (m_vertex_ids[1 ]), vertices.row (m_vertex_ids[2 ]),
450450 vertices.row (m_vertex_ids[3 ]), params, otypes, orientable);
451- } else if (has_neighbor_1 || has_neighbor_2) {
452- m_vertex_ids = { { neighbors[0 ], neighbors[1 ],
453- has_neighbor_1 ? neighbors[2 ] : neighbors[3 ] } };
454-
455451 } else {
456- m_vertex_ids = { { neighbors[0 ], neighbors[1 ] } };
457- m_is_active = true ;
452+ log_and_throw_error (" Codimensional objects in 3D are not supported yet!" );
453+
454+ if (has_neighbor_1 || has_neighbor_2) {
455+ m_vertex_ids = { { neighbors[0 ], neighbors[1 ],
456+ has_neighbor_1 ? neighbors[2 ] : neighbors[3 ] } };
457+
458+ } else {
459+ m_vertex_ids = { { neighbors[0 ], neighbors[1 ] } };
460+ m_is_active = true ;
461+ }
458462 }
459463}
460464
461- int Edge3::n_vertices () const { return N_EDGE_NEIGHBORS_3D ; }
465+ int Edge3::n_vertices () const { return m_vertex_ids. size () ; }
462466
463467double Edge3::potential (
464- Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<Vector12d > x) const
468+ Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<VectorMax12d > x) const
465469{
466470#ifdef IPC_TOOLKIT_DEBUG_AUTODIFF
467471 return smooth_edge3_term_template<double >(
@@ -475,7 +479,7 @@ double Edge3::potential(
475479}
476480
477481Vector15d Edge3::grad (
478- Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<Vector12d > x) const
482+ Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<VectorMax12d > x) const
479483{
480484#ifdef IPC_TOOLKIT_DEBUG_AUTODIFF
481485 Vector15d tmp;
@@ -495,7 +499,7 @@ Vector15d Edge3::grad(
495499}
496500
497501Matrix15d Edge3::hessian (
498- Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<Vector12d > x) const
502+ Eigen::ConstRef<Eigen::Vector3d> d, Eigen::ConstRef<VectorMax12d > x) const
499503{
500504#ifdef IPC_TOOLKIT_DEBUG_AUTODIFF
501505 Vector15d tmp;
0 commit comments