Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Bartman-Szwarc committed Sep 12, 2024
1 parent 0786538 commit 356613a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_conmech/regression/test_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
from tests.test_conmech.regression.std_boundary import standard_boundary_nodes


@pytest.fixture(params=["direct", "global optimization", "schur"][-1:])
@pytest.fixture(params=["direct", "global optimization", "schur"])
def solving_method(request):
return request.param


@pytest.fixture(params=["BFGS", "qsm", "subgradient"])
def opt_method(request):
return request.param


def generate_test_suits():
test_suites = []

Expand Down Expand Up @@ -159,9 +164,9 @@ def outer_forces(x, t=None):


@pytest.mark.parametrize("setup, expected_displacement_vector", generate_test_suits())
def test_static_solver(solving_method, setup, expected_displacement_vector):
def test_static_solver(solving_method, opt_method, setup, expected_displacement_vector):
runner = StaticSolver(setup, solving_method)
result = runner.solve(initial_displacement=setup.initial_displacement, method="qsm")
result = runner.solve(initial_displacement=setup.initial_displacement, method=opt_method)

displacement = result.body.mesh.nodes[:] - result.displaced_nodes[:]
std_ids = standard_boundary_nodes(runner.body.mesh.nodes, runner.body.mesh.elements)
Expand Down

0 comments on commit 356613a

Please sign in to comment.