@@ -76,21 +76,23 @@ void define_barrier_potential(py::module_& m)
7676        .def (
7777            " shape_derivative" 
7878            py::overload_cast<
79-                 const  CollisionsBase &, const  CollisionMesh&,
79+                 const  Collisions &, const  CollisionMesh&,
8080                const  Eigen::MatrixXd&>(
8181                &BarrierPotential::shape_derivative, py::const_),
8282            R"ipc_Qu8mg5v7( 
8383            Compute the shape derivative of the potential. 
8484
85-             std::runtime_error If the collision collisions were not built with shape derivatives enabled. 
85+             std::runtime_error If the collision collisions were not built 
86+             with shape derivatives enabled. 
8687
8788            Parameters: 
8889                collisions: The set of collisions. 
8990                mesh: The collision mesh. 
9091                vertices: Vertices of the collision mesh. 
9192
9293            Returns: 
93-                 The derivative of the force with respect to X, the rest vertices. 
94+                 The derivative of the force with respect to X, the rest 
95+                 vertices. 
9496            )ipc_Qu8mg5v7"  ,
9597            py::arg (" collisions" py::arg (" mesh" py::arg (" vertices" 
9698        .def (
@@ -142,7 +144,8 @@ void define_barrier_potential(py::module_& m)
142144            py::arg (" project_hessian_to_psd" false )
143145        .def (
144146            " shape_derivative" 
145-             [](const  DistanceBasedPotential& self, const  Collision<4 >& collision,
147+             [](const  DistanceBasedPotential& self,
148+                const  Collision<4 >& collision,
146149               const  std::array<long , 4 >& vertex_ids,
147150               const  VectorMax12d& rest_positions,
148151               const  VectorMax12d& positions) {
@@ -180,33 +183,36 @@ void define_smooth_potential(py::module_& m)
180183{
181184    py::class_<ParameterType>(m, " ParameterType" 
182185        .def (
183-             py::init<const  double &,const  double &,const  double &,const  double &,const  double &,
184-             const  int &>(),
186+             py::init<
187+                 const  double &, const  double &, const  double &, const  double &,
188+                 const  double &, const  int &, const  int &>(),
185189            R"ipc_Qu8mg5v7( 
186190            Construct parameter set for smooth contact. 
187191
188192            Parameters: 
189193                dhat, alpha_t, beta_t, alpha_n, beta_n, r 
190194            )ipc_Qu8mg5v7"  ,
191-             py::arg (" dhat" py::arg (" alpha_t" py::arg (" beta_t"   py::arg ( " alpha_n " ), 
192-             py::arg (" beta_n" py::arg (" r" 
195+             py::arg (" dhat" py::arg (" alpha_t" py::arg (" beta_t" 
196+             py::arg (" alpha_n " ),  py::arg ( " beta_n" py::arg (" r" 
193197        .def (
194-             py::init<const  double &,const  double &,const  double &,const  int &>(),
198+             py::init<const  double &,  const  double &,  const  double &,  const  int &>(),
195199            R"ipc_Qu8mg5v7( 
196200            Construct parameter set for smooth contact. 
197201
198202            Parameters: 
199203                dhat, alpha_t, beta_t, r 
200204            )ipc_Qu8mg5v7"  ,
201-             py::arg (" dhat" py::arg (" alpha_t" py::arg (" beta_t" py::arg (" r" 
205+             py::arg (" dhat" py::arg (" alpha_t" py::arg (" beta_t" 
206+             py::arg (" r" 
202207        .def_readonly (" dhat" 
203208        .def_readonly (" alpha_t" alpha_t )
204209        .def_readonly (" beta_t" beta_t )
205210        .def_readonly (" alpha_n" 
206211        .def_readonly (" beta_n" 
207212        .def_readonly (" r" 
208213
209-     py::class_<SmoothContactPotential<SmoothCollisions<2 >>>(m, " SmoothPotential" 
214+     py::class_<SmoothContactPotential<SmoothCollisions<2 >>>(
215+         m, " SmoothPotential" 
210216        .def (
211217            py::init<const  ParameterType&>(),
212218            R"ipc_Qu8mg5v7( 
@@ -221,7 +227,9 @@ void define_smooth_potential(py::module_& m)
221227            py::overload_cast<
222228                const  SmoothCollisions<2 >&, const  CollisionMesh&,
223229                const  Eigen::MatrixXd&>(
224-                 &SmoothContactPotential<SmoothCollisions<2 >>::Potential::operator (), py::const_),
230+                 &SmoothContactPotential<
231+                     SmoothCollisions<2 >>::Potential::operator (),
232+                 py::const_),
225233            R"ipc_Qu8mg5v7( 
226234            Compute the barrier potential for a set of collisions. 
227235
@@ -239,7 +247,9 @@ void define_smooth_potential(py::module_& m)
239247            py::overload_cast<
240248                const  SmoothCollisions<2 >&, const  CollisionMesh&,
241249                const  Eigen::MatrixXd&>(
242-                 &SmoothContactPotential<SmoothCollisions<2 >>::Potential::gradient, py::const_),
250+                 &SmoothContactPotential<
251+                     SmoothCollisions<2 >>::Potential::gradient,
252+                 py::const_),
243253            R"ipc_Qu8mg5v7( 
244254            Compute the gradient of the barrier potential. 
245255
@@ -255,8 +265,11 @@ void define_smooth_potential(py::module_& m)
255265        .def (
256266            " hessian" 
257267            py::overload_cast<
258-                 const  SmoothCollisions<2 >&, const  CollisionMesh&, const  Eigen::MatrixXd&,
259-                 const  bool >(&SmoothContactPotential<SmoothCollisions<2 >>::Potential::hessian, py::const_),
268+                 const  SmoothCollisions<2 >&, const  CollisionMesh&,
269+                 const  Eigen::MatrixXd&, const  bool >(
270+                 &SmoothContactPotential<
271+                     SmoothCollisions<2 >>::Potential::hessian,
272+                 py::const_),
260273            R"ipc_Qu8mg5v7( 
261274            Compute the hessian of the barrier potential. 
262275
@@ -273,8 +286,10 @@ void define_smooth_potential(py::module_& m)
273286            py::arg (" project_hessian_to_psd" false )
274287        .def (
275288            " __call__" 
276-             py::overload_cast<const  SmoothCollision<6 >&, const  Vector<double , -1 , 18 >&>(
277-                 &SmoothContactPotential<SmoothCollisions<2 >>::operator (), py::const_),
289+             py::overload_cast<
290+                 const  SmoothCollision<6 >&, const  Vector<double , -1 , 18 >&>(
291+                 &SmoothContactPotential<SmoothCollisions<2 >>::operator (),
292+                 py::const_),
278293            R"ipc_Qu8mg5v7( 
279294            Compute the potential for a single collision. 
280295
@@ -288,8 +303,10 @@ void define_smooth_potential(py::module_& m)
288303            py::arg (" collision" py::arg (" x" 
289304        .def (
290305            " gradient" 
291-             py::overload_cast<const  SmoothCollision<6 >&, const  Vector<double , -1 , 18 >&>(
292-                 &SmoothContactPotential<SmoothCollisions<2 >>::gradient, py::const_),
306+             py::overload_cast<
307+                 const  SmoothCollision<6 >&, const  Vector<double , -1 , 18 >&>(
308+                 &SmoothContactPotential<SmoothCollisions<2 >>::gradient,
309+                 py::const_),
293310            R"ipc_Qu8mg5v7( 
294311            Compute the gradient of the potential for a single collision. 
295312
@@ -304,8 +321,10 @@ void define_smooth_potential(py::module_& m)
304321        .def (
305322            " hessian" 
306323            py::overload_cast<
307-                 const  SmoothCollision<6 >&, const  Vector<double , -1 , 18 >&, const  bool >(
308-                 &SmoothContactPotential<SmoothCollisions<2 >>::hessian, py::const_),
324+                 const  SmoothCollision<6 >&, const  Vector<double , -1 , 18 >&,
325+                 const  bool >(
326+                 &SmoothContactPotential<SmoothCollisions<2 >>::hessian,
327+                 py::const_),
309328            R"ipc_Qu8mg5v7( 
310329            Compute the hessian of the potential for a single collision. 
311330
0 commit comments