Skip to content

Commit

Permalink
Add extra check for total_turbine_density
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Jan 6, 2025
1 parent aecda67 commit 50467b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/swe2d/test_anisotropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def bump(mesh, locs, scale=1.0):
# Check that turbines have been picked up
assert not np.allclose(solver_obj.fields.uv_2d.dat.data[0], 0.5, atol=1e-3)

# Check the turbine density has been set up correctly
total_turbine_density = assemble(solver_obj.tidal_farms[0].turbine_density * dx)
assert np.isclose(total_turbine_density, 2, atol=0.01), f"Expected 2, but got {total_turbine_density}"

# Return number of nonlinear solver iterations
return solver_obj.timestepper.solver.snes.getIterationNumber()

Expand Down

0 comments on commit 50467b7

Please sign in to comment.