Commits

Garth Wells committed 83d082c Merge

Merge remote-tracking branch 'origin/garth/fix-issue-71'

Comments (0)

Files changed (2)

demo/documented/periodic/python/demo_periodic.py

     def eval(self, values, x):
         dx = x[0] - 0.5
         dy = x[1] - 0.5
-        values[0] = x[0]*sin(5.0*DOLFIN_PI*x[1]) + 1.0*exp(-(dx*dx + dy*dy)/0.02)
+        values[0] = x[0]*sin(5.0*DOLFIN_PI*x[1]) \
+                    + 1.0*exp(-(dx*dx + dy*dy)/0.02)
 
 # Sub domain for Dirichlet boundary condition
 class DirichletBoundary(SubDomain):
     def inside(self, x, on_boundary):
-        return bool((x[1] < DOLFIN_EPS or x[1] > (1.0 - DOLFIN_EPS)) and on_boundary)
+        return bool((x[1] < DOLFIN_EPS or x[1] > (1.0 - DOLFIN_EPS)) \
+                    and on_boundary)
 
 # Sub domain for Periodic boundary condition
 class PeriodicBoundary(SubDomain):
         y[0] = x[0] - 1.0
         y[1] = x[1]
 
-# Create periodic boundary condition
-pbc = PeriodicBoundary()
-
 # Create mesh and finite element
 mesh = UnitSquareMesh(32, 32)
-V = FunctionSpace(mesh, "CG", 1, constrained_domain=pbc)
-
+V = FunctionSpace(mesh, "CG", 1, constrained_domain=PeriodicBoundary())
 
 # Create Dirichlet boundary condition
 u0 = Constant(0.0)
 dbc = DirichletBoundary()
 bc0 = DirichletBC(V, u0, dbc)
 
-#bc1 = PeriodicBC(V, pbc)
-
 # Collect boundary conditions
 bcs = [bc0]
 

site-packages/dolfin/functions/functionspace.py

         return FunctionSpaceFromCpp(cpp_space)
 
 class FunctionSpaceFromCpp(FunctionSpaceBase):
-    " FunctionSpace represents a finite element function space."
+    "FunctionSpace represents a finite element function space."
     def __init__(self, cppV, element=None):
         """ Initialize a FunctionSpace from an already excisting
             cpp.FunctionSpace.
     def __init__(self, mesh, ufc_finite_element, ufc_dofmap, constrained_domain=None):
         " Initialize a FunctionSpace from ufc data "
         self._mesh = mesh
-        self._finite_element     = cpp.FiniteElement(ufc_finite_element)
+        self._finite_element = cpp.FiniteElement(ufc_finite_element)
         if constrained_domain is None:
-            self._dofmap            = cpp.DofMap(ufc_dofmap, mesh)
+            self._dofmap = cpp.DofMap(ufc_dofmap, mesh)
         else:
-            self._dofmap            = cpp.DofMap(ufc_dofmap, mesh, constrained_domain)
+            self._dofmap = cpp.DofMap(ufc_dofmap, mesh, constrained_domain)
         self._ufc_finite_element = ufc_finite_element
-        self._ufc_dofmap        = ufc_dofmap
+        self._ufc_dofmap = ufc_dofmap
         cpp.FunctionSpace.__init__(self, self._mesh, self._finite_element, \
                                    self._dofmap)