Skip to content

Commit 4ab9876

Browse files
committed
Dummy adhesion potential tests
1 parent 9889c4a commit 4ab9876

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

python/src/potentials/tangential_adhesion_potential.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ using namespace ipc;
77

88
void define_tangential_adhesion_potential(py::module_& m)
99
{
10-
py::class_<TangentialadhesionPotential, TangentialPotential>(
11-
m, "TangentialadhesionPotential")
10+
py::class_<TangentialAdhesionPotential, TangentialPotential>(
11+
m, "TangentialAdhesionPotential")
1212
.def(
1313
py::init<const double>(),
1414
R"ipc_Qu8mg5v7(
@@ -19,7 +19,7 @@ void define_tangential_adhesion_potential(py::module_& m)
1919
)ipc_Qu8mg5v7",
2020
py::arg("eps_a"))
2121
.def_property(
22-
"eps_a", &TangentialadhesionPotential::eps_a,
23-
&TangentialadhesionPotential::set_eps_a,
22+
"eps_a", &TangentialAdhesionPotential::eps_a,
23+
&TangentialAdhesionPotential::set_eps_a,
2424
"Get the tangential adhesion mollifier parameter :math:`\epsilon_a`.");
2525
}

src/ipc/potentials/tangential_adhesion_potential.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55
namespace ipc {
66

7-
TangentialadhesionPotential::TangentialadhesionPotential(const double eps_a)
7+
TangentialAdhesionPotential::TangentialAdhesionPotential(const double eps_a)
88
: Super()
99
{
1010
set_eps_a(eps_a);
1111
}
1212

13-
double TangentialadhesionPotential::f0(const double x) const
13+
double TangentialAdhesionPotential::f0(const double x) const
1414
{
1515
return tangential_adhesion_f0(x, eps_a());
1616
}
1717

18-
double TangentialadhesionPotential::f1_over_x(const double x) const
18+
double TangentialAdhesionPotential::f1_over_x(const double x) const
1919
{
2020
return tangential_adhesion_f1_over_x(x, eps_a());
2121
}
2222

23-
double TangentialadhesionPotential::f2_x_minus_f1_over_x3(const double x) const
23+
double TangentialAdhesionPotential::f2_x_minus_f1_over_x3(const double x) const
2424
{
2525
return tangential_adhesion_f2_x_minus_f1_over_x3(x, eps_a());
2626
}

src/ipc/potentials/tangential_adhesion_potential.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace ipc {
66

77
/// @brief The tangential adhesion potential.
8-
class TangentialadhesionPotential : public TangentialPotential {
8+
class TangentialAdhesionPotential : public TangentialPotential {
99
using Super = TangentialPotential;
1010

1111
public:
1212
/// @brief Construct a tangential adhesion potential.
1313
/// @param eps_a The tangential adhesion mollifier parameter \f$\epsilon_a\f$.
14-
explicit TangentialadhesionPotential(const double eps_a);
14+
explicit TangentialAdhesionPotential(const double eps_a);
1515

1616
/// @brief Get the tangential adhesion mollifier parameter \f$\epsilon_a\f$.
1717
double eps_a() const { return m_eps_a; }

tests/src/tests/potential/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(SOURCES
22
# Tests
3+
test_adhesion_potentials.cpp
34
test_barrier_potential.cpp
45
test_friction_potential.cpp
56

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <catch2/catch_test_macros.hpp>
2+
3+
#include <ipc/potentials/normal_adhesion_potential.hpp>
4+
#include <ipc/potentials/tangential_adhesion_potential.hpp>
5+
6+
using namespace ipc;
7+
8+
TEST_CASE("Normal adhesion potential", "[potential][adhesion]")
9+
{
10+
NormalAdhesionPotential potential(1e-3, 2e-3, 1e3, 0.5);
11+
}
12+
13+
TEST_CASE("Tangetial adhesion potential", "[potential][adhesion]")
14+
{
15+
TangentialAdhesionPotential potential(1e-3);
16+
}

0 commit comments

Comments
 (0)