SyFi
0.3
|
Inherits CompatibilityTestCase.
Public Member Functions | |
def | setUp |
def | tearDown |
def | test_dolfin_poisson |
Definition at line 18 of file test_dolfin_integration.py.
Definition at line 20 of file test_dolfin_integration.py.
Definition at line 24 of file test_dolfin_integration.py.
Definition at line 27 of file test_dolfin_integration.py.
00027 00028 def test_dolfin_poisson(self): 00029 mesh = UnitSquare(32, 32) 00030 V = FunctionSpace(mesh, "CG", 1) 00031 bc = DirichletBC(V, Constant(0.0), 00032 lambda x: x[0] < 1e-9 or x[0] > 1.0-1e-9) 00033 v = TestFunction(V) 00034 u = TrialFunction(V) 00035 f = Function(V) 00036 estr = "500.0 * exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)" 00037 f.interpolate(Expression(estr)) 00038 a = dot(grad(v), grad(u))*dx 00039 L = v*f*dx 00040 w = Function(V) 00041 solve(a == L, w, bc) 00042 00043 self.assertLess(w.vector().norm("l2") - 142.420764968, 1e-4)