| 1 |
"""Unit tests for MultiMesh Functions""" |
| 2 |
|
| 3 |
# Copyright (C) 2017 Simon Funke |
| 4 |
# |
| 5 |
# This file is part of DOLFIN. |
| 6 |
# |
| 7 |
# DOLFIN is free software: you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU Lesser General Public License as published by |
| 9 |
# the Free Software Foundation, either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# DOLFIN is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU Lesser General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU Lesser General Public License |
| 18 |
# along with DOLFIN. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
# |
| 20 |
# First added: 2017-12-12 |
| 21 |
# Last changed: 2017-12-12 |
| 22 |
|
| 23 |
import pytest |
| 24 |
from dolfin import * |
| 25 |
|
| 26 |
from dolfin_utils.test import skip_in_parallel |
| 27 |
|
| 28 |
@skip_in_parallel |
| 29 |
def test_multimesh_function(): |
| 30 |
|
| 31 |
# Define meshes |
| 32 |
mesh_0 = UnitSquareMesh(2, 2) |
| 33 |
mesh_1 = RectangleMesh(Point(0.1*DOLFIN_PI, 0.1*DOLFIN_PI), |
| 34 |
Point(0.2*DOLFIN_PI, 0.2*DOLFIN_PI), |
| 35 |
2, 2) |
| 36 |
|
| 37 |
# Build multimesh |
| 38 |
multimesh = MultiMesh() |
| 39 |
multimesh.add(mesh_0) |
| 40 |
multimesh.add(mesh_1) |
| 41 |
multimesh.build() |
| 42 |
|
| 43 |
V = MultiMeshFunctionSpace(multimesh, "Lagrange", 1) |
| 44 |
W = MultiMeshFunctionSpace(multimesh, "Lagrange", 2) |
| 45 |
|
| 46 |
# Create some basic multimesh functions |
| 47 |
FacetNormal(multimesh) |
| 48 |
|
| 49 |
TrialFunction(V) |
| 50 |
TestFunction(V) |
| 51 |
MultiMeshFunction(V) |
| 52 |
|
| 53 |
TrialFunction(W) |
| 54 |
TestFunction(W) |
| 55 |
MultiMeshFunction(W) |