SyFi  0.3
test_sfc.test_dolfin_integration.TestDolfinIntegration Class Reference

Inherits CompatibilityTestCase.

List of all members.

Public Member Functions

def setUp
def tearDown
def test_dolfin_poisson

Detailed Description

Definition at line 18 of file test_dolfin_integration.py.


Member Function Documentation

Definition at line 20 of file test_dolfin_integration.py.

00020 
00021     def setUp(self):
00022         SyFi.initSyFi(3)
00023         dolfin.parameters["form_compiler"]["name"] = "sfc"

Definition at line 24 of file test_dolfin_integration.py.

00024 
00025     def tearDown(self):
00026         pass

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)

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines