Commit 56c6fd69 authored by Peter Oehme's avatar Peter Oehme Committed by René Fritze
Browse files

add test file for boundary functions

parent d41c0df7
import numpy as np
from pymor.analyticalproblems.domaindescriptions import PolygonalDomain
from pymortests.base import runmodule
def determine_boundary_type(point):
x = point[0]
y = point[1]
if y == 0:
return "neumann"
return "dirichlet"
def test_polygonal_chain_boundary_function():
chain = [[2, 0], [4, 0], [3, 2]]
reference_boundary_types = {"neumann": [0, 1], "dirichlet": [2]}
domain = PolygonalDomain(points=chain, boundary_types=determine_boundary_type)
assert domain.boundary_types == reference_boundary_types
if __name__ == "__main__":
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment