Adding new problems to problem.zoo (#484)
* adding problems * add tests * update doc + formatting --------- Co-authored-by: Dario Coscia <dariocos99@gmail.com>
This commit is contained in:
committed by
Nicola Demo
parent
2ae4a94e49
commit
f67467e5bd
16
tests/test_problem_zoo/test_helmholtz.py
Normal file
16
tests/test_problem_zoo/test_helmholtz.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import pytest
|
||||
from pina.problem.zoo import HelmholtzProblem
|
||||
from pina.problem import SpatialProblem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("alpha", [1.5, 3])
|
||||
def test_constructor(alpha):
|
||||
problem = HelmholtzProblem(alpha=alpha)
|
||||
problem.discretise_domain(n=10, mode="random", domains="all")
|
||||
assert problem.are_all_domains_discretised
|
||||
assert isinstance(problem, SpatialProblem)
|
||||
assert hasattr(problem, "conditions")
|
||||
assert isinstance(problem.conditions, dict)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
HelmholtzProblem(alpha="a")
|
||||
Reference in New Issue
Block a user