In [9]:
from dolfin import *

#!/usr/bin/python
import petsc4py
import sys

petsc4py.init(sys.argv)

from petsc4py import PETSc
import numpy as np

In [11]:
nn = 2
mesh = RectangleMesh(0, 0, 1, 1, nn, nn,'left')

order  = 2
Q = FunctionSpace(mesh, "CG", order)
QQ = FunctionSpace(mesh, "CG", order-1)

Qv = VectorFunctionSpace(mesh, "CG", order)
mesh.num_vertices()


DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.
DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.
DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.
Out[11]:
9

In [2]:
u = Function(Q)
N = FacetNormal(mesh)
u.vector()[0] = 1


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-9b32b77c7c0d> in <module>()
----> 1 u = Function(Q)
      2 N = FacetNormal(mesh)
      3 u.vector()[0] = 1

NameError: name 'Q' is not defined

In [3]:
v = Vertex(mesh,14)
Interior = BoundaryMesh(mesh,"interior")


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-a975ba5b577c> in <module>()
----> 1 v = Vertex(mesh,14)
      2 Interior = BoundaryMesh(mesh,"interior")

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/dolfin/cpp/mesh.pyc in __init__(self, *args)
   2766 
   2767         """
-> 2768         _mesh.Vertex_swiginit(self,_mesh.new_Vertex(*args))
   2769     __swig_destroy__ = _mesh.delete_Vertex
   2770     def point(self, *args):

TypeError: in method 'new_Vertex', argument 1 of type 'dolfin::Mesh const &'

In [11]:
T = as_vector((N[1],-N[0]))
import matplotlib.pylab as plt

element = Q.dolfin_element()
dofPerCell = (2*element.space_dimension()*element.value_dimension(0))
def QuadMap(a,b,x):
    y = (b-a)*x/2+(a+b)/2
    return y
print dofPerCell/2
def isEven(number):
        return number % 2 == 0
mesh.cells()


6
Out[11]:
array([[0, 1, 3],
       [1, 3, 4],
       [1, 2, 4],
       [2, 4, 5],
       [3, 4, 6],
       [4, 6, 7],
       [4, 5, 7],
       [5, 7, 8]], dtype=uint32)

In [4]:
# for cell in cells(mesh):
cell = Cell(mesh,1)
vc = cell.get_vertex_coordinates()
AllCells = mesh.cells()
cellIndex = AllCells[:,:][0]
Coords = mesh.coordinates()

if cell.orientation() == 0:
    vc = np.concatenate((Coords[cellIndex[1]],Coords[cellIndex[2]],Coords[cellIndex[0]],Coords[cellIndex[1]]))
    j = 0
else:
    vc = np.concatenate((Coords[cellIndex[0]],Coords[cellIndex[1]],Coords[cellIndex[2]],Coords[cellIndex[0]]))
    j = 1
    
print cell.orientation()

vc = vc.reshape((4,2))
EvenPoint = np.sqrt(1.0/3)
OddPoint = -np.sqrt(1.0/3)
# vc = np.concatenate((vc[:,:],vc[0,:]))


for i in range(0,dofPerCell/4):
    if j == 3:
        j = 0
    x = QuadMap(vc[i,0],vc[i+1,0],EvenPoint)
    y = QuadMap(vc[i,1],vc[i+1,1],EvenPoint)
    print x,y
    x = QuadMap(vc[i,0],vc[i+1,0],OddPoint)
    y = QuadMap(vc[i,1],vc[i+1,1],OddPoint)
    print x, y
    n = cell.normal(j)
    print n.x(),n.y()
    j += 1


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-b720b6790b06> in <module>()
      1 # for cell in cells(mesh):
----> 2 cell = Cell(mesh,1)
      3 vc = cell.get_vertex_coordinates()
      4 AllCells = mesh.cells()
      5 cellIndex = AllCells[:,:][0]

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/dolfin/cpp/mesh.pyc in __init__(self, *args)
   2991 
   2992         """
-> 2993         _mesh.Cell_swiginit(self,_mesh.new_Cell(*args))
   2994     __swig_destroy__ = _mesh.delete_Cell
   2995     def type(self, *args):

TypeError: in method 'new_Cell', argument 1 of type 'dolfin::Mesh const &'

In [588]:
cellIndex


Out[588]:
array([0, 1, 3], dtype=uint32)

In [559]:
cell = Cell(mesh,0)
n = cell.normal(2)
print n.x(),n.y()
cell.normal(0,0)
project?


0.0 -1.0

In [13]:
Magnetic = FunctionSpace(mesh, "N2curl", order)
(u) = TrialFunction(Magnetic)
(v) = TestFunction(Magnetic)
m = inner(u, v)*dx


DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.

In [19]:
M = assemble(m)
plt.spy(M.array())
plt.show()


DEBUG:FFC:Reusing form from cache.

In [82]:
u = Function(Q)
zero = np.zeros((Q.dim(),1))[:,0]
zero[0] = 1
u.vector()[:] = zero
parameters['linear_algebra_backend'] = 'uBLAS'
uu = grad(u)
Pv = project(uu,Magnetic,solver_type = "lu")
Pv= Pv.vector()


DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.
DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.

In [84]:
Pv.array()


Out[84]:
array([ -2.43088725e-17,  -2.36871170e-16,  -1.83887806e-16,
        -1.09516952e-16,   8.84898917e-18,   1.46588452e-17,
        -1.54893208e-17,  -4.06875438e-17,   9.22007076e-18,
         2.12257031e-18,   4.94532467e-18,   9.19046529e-18,
        -1.34613639e-16,  -1.22779846e-17,   3.17968289e-16,
         1.49648512e-16,   1.90338049e-16,  -1.44919848e-16,
         8.23068977e-20,  -3.06224171e-18,  -1.17920573e-18,
        -3.89122229e-16,   9.35722829e-16,   1.32134489e-15,
        -3.76451697e-16,  -4.94865298e-16,  -2.64042757e-16,
         2.13708518e-17,  -4.02800314e-17,   1.37710146e-17,
        -2.91808543e-16,  -1.21514842e-15,  -2.00227566e-15,
         3.80578917e-16,   1.15161054e-16,  -1.28043147e-16,
        -2.83674725e-17,   8.40516760e-17,   2.15103487e-17,
        -2.64042757e-16,  -4.94865298e-16,  -3.76451697e-16,
        -2.24854118e-15,   9.78359421e-16,   5.23044641e-15,
         1.55891457e-16,  -5.44431472e-17,   4.68433101e-17,
        -2.95558850e-15,  -5.10204185e-15,  -1.98910467e-15,
        -1.28043147e-16,   1.15161054e-16,   3.80578917e-16,
         1.59228931e-16,   7.42904210e-17,   1.03544727e-16,
        -3.52543873e-14,  -3.13722643e-14,  -9.57128654e-15,
         4.31353455e-16,   5.82262145e-16,   1.43946610e-15,
        -2.87790078e-14,   1.00000000e+00,   2.00000000e+00,
         3.91433076e-14,   1.00000000e+00,   2.00000000e+00,
         1.66666667e-01,  -1.66666667e-01,   3.01069921e-16])

In [20]:
Magnetic = FunctionSpace(mesh,"N1curl",order)
(u) = TrialFunction(Magnetic)
(v) = TestFunction(Magnetic)
Curl = assemble(inner(curl(u),curl(v))*dx)
uele=Magnetic.ufl_element()
dele = Magnetic.dolfin_element()


DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.
DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:UFL:No integrals left after transformation, returning empty form.
DEBUG:FFC:Reusing form from cache.

In [104]:
import dolfin

In [60]:
(u) = Function(Q)
(v) = TrialFunction(Q)
zero = np.zeros((Q.dim(),1))[:,0]
zero[0] = 1
v.vector()[:] = zero
N = FacetNormal(mesh)
A = assemble(inner(grad(v),N)*u*dx)


DEBUG:UFL:No integrals left after transformation, returning empty form.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Level 25:FFC:Calling FFC just-in-time (JIT) compiler, this may take some time.
INFO:FFC:Compiling form ffc_form_1f978917e0c15293e6c478f755ff21e0fbf499b5

INFO:FFC:Compiler stage 1: Analyzing form(s)
INFO:FFC:-----------------------------------
INFO:FFC:  
INFO:FFC:  Name:                   ''
  Cell:                   <triangle cell in 2D>
  Topological dimension:  2
  Geometric dimension:    2
  Rank:                   1
  Number of coefficients: 1
  Arguments:              '[v_{-1}]'
  Coefficients:           '[f_15]'
  Argument names:         '[v0]'
  Coefficient names:      '[w0]'
  Unique elements:        'CG2(?)'
  Unique sub elements:    'CG2(?)'
  Domains:                (Domain(Cell('triangle', 2), 'triangle_multiverse', 2, 2),
                          )
  Top level domains:      (Domain(Cell('triangle', 2), 'triangle_multiverse', 2, 2),
                          )
  
INFO:FFC:  Extracting monomial form representation from UFL form
DEBUG:FFC:  Monomial extraction failed: No handler defined for terminal FacetNormal.
DEBUG:FFC:  Estimated cost of tensor representation: -1
INFO:FFC:  representation:    auto --> quadrature
DEBUG:FFC:  Selecting quadrature degree based on total polynomial degree of integrand: 3
INFO:FFC:  quadrature_degree: auto --> 3
INFO:FFC:  quadrature_rule:   auto --> default
INFO:FFC:  
INFO:FFC:Compiler stage 1 finished in 0.00415015 seconds.

INFO:FFC:Compiler stage 2: Computing intermediate representation
INFO:FFC:-------------------------------------------------------
INFO:FFC:  Computing representation of 1 elements
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
INFO:FFC:  Computing representation of 1 dofmaps
DEBUG:FFC:  Reusing element from cache
INFO:FFC:  Computing representation of integrals
INFO:FFC:  Computing quadrature representation
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  
  QG-utils, psi_tables:
  {6: {FiniteElement('Lagrange', Domain(Cell('triangle', 2), 'triangle_multiverse', 2, 2), 2, None): {None: {None: {(0, 1): array([[0.56384396370849277, 0.072266525787876734, 0.56384396370849243,
          -1.6361104894963669, 0.072266525787876068, -1.6361104894963674],
         [8.3266726846886741e-17, -1.1102230246251565e-16,
          -1.6653345369377348e-16, -1.1102230246251565e-16,
          -5.5511151231257827e-17, -1.3877787807814457e-16],
         [-0.072266525787875513, -0.56384396370849144, 1.6361104894963674,
          -0.56384396370849144, 1.6361104894963674, -0.072266525787875735],
         [2.6361104894963665, 2.6361104894963665, 0.92773347421212327,
          0.92773347421212304, 0.43615603629150668, 0.43615603629150723],
         [-0.49157743792061637, 0.49157743792061592, -2.1999544532048594,
          2.1999544532048594, -1.7083770152842432, 1.7083770152842432],
         [-2.6361104894963674, -2.6361104894963674, -0.92773347421212338,
          -0.9277334742121236, -0.43615603629150701, -0.43615603629150695]], dtype=object), (1, 0): array([[0.56384396370849266, 0.072266525787876401, 0.56384396370849277,
          -1.6361104894963672, 0.07226652578787629, -1.6361104894963676],
         [1.6361104894963678, 1.6361104894963676, -0.072266525787876068,
          -0.072266525787876124, -0.56384396370849255, -0.56384396370849243],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.92773347421212327, 0.43615603629150695, 2.6361104894963661,
          0.43615603629150695, 2.6361104894963661, 0.92773347421212327],
         [-0.92773347421212327, -0.43615603629150695, -2.6361104894963661,
          -0.43615603629150695, -2.6361104894963661, -0.92773347421212327],
         [-2.1999544532048607, -1.7083770152842441, -0.49157743792061698,
          1.7083770152842432, 0.49157743792061592, 2.1999544532048598]], dtype=object), (0, 0): array([[-0.08525999807368706, -0.12434719365631873, -0.085259998073687046,
          0.20960719173000564, -0.12434719365631869, 0.20960719173000567],
         [0.20960719173000553, 0.20960719173000553, -0.12434719365631877,
          -0.12434719365631874, -0.08525999807368706, -0.08525999807368706],
         [-0.1243471936563187, -0.08525999807368706, 0.20960719173000567,
          -0.08525999807368706, 0.20960719173000567, -0.1243471936563187],
         [0.61140198570687188, 0.28743887558130055, 0.61140198570687188,
          0.10115913871182745, 0.28743887558130055, 0.10115913871182744],
         [0.10115913871182744, 0.10115913871182741, 0.2874388755813006,
          0.28743887558130055, 0.61140198570687199, 0.61140198570687188],
         [0.28743887558130055, 0.61140198570687199, 0.10115913871182744,
          0.61140198570687199, 0.10115913871182744, 0.28743887558130055]], dtype=object)}}}}}
DEBUG:FFC:  
  QG-utils, psi_tables, flat_tables:
  {'FE0_D10': array([[0.56384396370849266, 1.6361104894963678, 0.0, 0.92773347421212327,
          -0.92773347421212327, -2.1999544532048607],
         [0.072266525787876401, 1.6361104894963676, 0.0, 0.43615603629150695,
          -0.43615603629150695, -1.7083770152842441],
         [0.56384396370849277, -0.072266525787876068, 0.0,
          2.6361104894963661, -2.6361104894963661, -0.49157743792061698],
         [-1.6361104894963672, -0.072266525787876124, 0.0,
          0.43615603629150695, -0.43615603629150695, 1.7083770152842432],
         [0.07226652578787629, -0.56384396370849255, 0.0, 2.6361104894963661,
          -2.6361104894963661, 0.49157743792061592],
         [-1.6361104894963676, -0.56384396370849243, 0.0,
          0.92773347421212327, -0.92773347421212327, 2.1999544532048598]], dtype=object), 'FE0_D01': array([[0.56384396370849277, 8.3266726846886741e-17, -0.072266525787875513,
          2.6361104894963665, -0.49157743792061637, -2.6361104894963674],
         [0.072266525787876734, -1.1102230246251565e-16,
          -0.56384396370849144, 2.6361104894963665, 0.49157743792061592,
          -2.6361104894963674],
         [0.56384396370849243, -1.6653345369377348e-16, 1.6361104894963674,
          0.92773347421212327, -2.1999544532048594, -0.92773347421212338],
         [-1.6361104894963669, -1.1102230246251565e-16, -0.56384396370849144,
          0.92773347421212304, 2.1999544532048594, -0.9277334742121236],
         [0.072266525787876068, -5.5511151231257827e-17, 1.6361104894963674,
          0.43615603629150668, -1.7083770152842432, -0.43615603629150701],
         [-1.6361104894963674, -1.3877787807814457e-16,
          -0.072266525787875735, 0.43615603629150723, 1.7083770152842432,
          -0.43615603629150695]], dtype=object), 'FE0': array([[-0.08525999807368706, 0.20960719173000553, -0.1243471936563187,
          0.61140198570687188, 0.10115913871182744, 0.28743887558130055],
         [-0.12434719365631873, 0.20960719173000553, -0.08525999807368706,
          0.28743887558130055, 0.10115913871182741, 0.61140198570687199],
         [-0.085259998073687046, -0.12434719365631877, 0.20960719173000567,
          0.61140198570687188, 0.2874388755813006, 0.10115913871182744],
         [0.20960719173000564, -0.12434719365631874, -0.08525999807368706,
          0.10115913871182745, 0.28743887558130055, 0.61140198570687199],
         [-0.12434719365631869, -0.08525999807368706, 0.20960719173000567,
          0.28743887558130055, 0.61140198570687199, 0.10115913871182744],
         [0.20960719173000567, -0.08525999807368706, -0.1243471936563187,
          0.10115913871182744, 0.61140198570687188, 0.28743887558130055]], dtype=object)}
DEBUG:FFC:  
  tables: {'FE0_D10': array([[0.56384396370849266, 1.6361104894963678, 0.0, 0.92773347421212327,
          -0.92773347421212327, -2.1999544532048607],
         [0.072266525787876401, 1.6361104894963676, 0.0, 0.43615603629150695,
          -0.43615603629150695, -1.7083770152842441],
         [0.56384396370849277, -0.072266525787876068, 0.0,
          2.6361104894963661, -2.6361104894963661, -0.49157743792061698],
         [-1.6361104894963672, -0.072266525787876124, 0.0,
          0.43615603629150695, -0.43615603629150695, 1.7083770152842432],
         [0.07226652578787629, -0.56384396370849255, 0.0, 2.6361104894963661,
          -2.6361104894963661, 0.49157743792061592],
         [-1.6361104894963676, -0.56384396370849243, 0.0,
          0.92773347421212327, -0.92773347421212327, 2.1999544532048598]], dtype=object), 'FE0_D01': array([[0.56384396370849277, 8.3266726846886741e-17, -0.072266525787875513,
          2.6361104894963665, -0.49157743792061637, -2.6361104894963674],
         [0.072266525787876734, -1.1102230246251565e-16,
          -0.56384396370849144, 2.6361104894963665, 0.49157743792061592,
          -2.6361104894963674],
         [0.56384396370849243, -1.6653345369377348e-16, 1.6361104894963674,
          0.92773347421212327, -2.1999544532048594, -0.92773347421212338],
         [-1.6361104894963669, -1.1102230246251565e-16, -0.56384396370849144,
          0.92773347421212304, 2.1999544532048594, -0.9277334742121236],
         [0.072266525787876068, -5.5511151231257827e-17, 1.6361104894963674,
          0.43615603629150668, -1.7083770152842432, -0.43615603629150701],
         [-1.6361104894963674, -1.3877787807814457e-16,
          -0.072266525787875735, 0.43615603629150723, 1.7083770152842432,
          -0.43615603629150695]], dtype=object), 'FE0': array([[-0.08525999807368706, 0.20960719173000553, -0.1243471936563187,
          0.61140198570687188, 0.10115913871182744, 0.28743887558130055],
         [-0.12434719365631873, 0.20960719173000553, -0.08525999807368706,
          0.28743887558130055, 0.10115913871182741, 0.61140198570687199],
         [-0.085259998073687046, -0.12434719365631877, 0.20960719173000567,
          0.61140198570687188, 0.2874388755813006, 0.10115913871182744],
         [0.20960719173000564, -0.12434719365631874, -0.08525999807368706,
          0.10115913871182745, 0.28743887558130055, 0.61140198570687199],
         [-0.12434719365631869, -0.08525999807368706, 0.20960719173000567,
          0.28743887558130055, 0.61140198570687199, 0.10115913871182744],
         [0.20960719173000567, -0.08525999807368706, -0.1243471936563187,
          0.10115913871182744, 0.61140198570687188, 0.28743887558130055]], dtype=object)}
DEBUG:FFC:  
  name_map: {}
DEBUG:FFC:  
  inv_name_map: {'FE0_D10': 'FE0_D10', 'FE0_D01': 'FE0_D01', 'FE0': 'FE0'}
DEBUG:FFC:  
  QG-utils, psi_tables, unique_tables:
  {'FE0_D10': array([[0.56384396370849266, 1.6361104894963678, 0, 0.92773347421212327,
          -0.92773347421212327, -2.1999544532048607],
         [0.072266525787876401, 1.6361104894963676, 0, 0.43615603629150695,
          -0.43615603629150695, -1.7083770152842441],
         [0.56384396370849277, -0.072266525787876068, 0, 2.6361104894963661,
          -2.6361104894963661, -0.49157743792061698],
         [-1.6361104894963672, -0.072266525787876124, 0, 0.43615603629150695,
          -0.43615603629150695, 1.7083770152842432],
         [0.07226652578787629, -0.56384396370849255, 0, 2.6361104894963661,
          -2.6361104894963661, 0.49157743792061592],
         [-1.6361104894963676, -0.56384396370849243, 0, 0.92773347421212327,
          -0.92773347421212327, 2.1999544532048598]], dtype=object), 'FE0_D01': array([[0.56384396370849277, 0, -0.072266525787875513, 2.6361104894963665,
          -0.49157743792061637, -2.6361104894963674],
         [0.072266525787876734, 0, -0.56384396370849144, 2.6361104894963665,
          0.49157743792061592, -2.6361104894963674],
         [0.56384396370849243, 0, 1.6361104894963674, 0.92773347421212327,
          -2.1999544532048594, -0.92773347421212338],
         [-1.6361104894963669, 0, -0.56384396370849144, 0.92773347421212304,
          2.1999544532048594, -0.9277334742121236],
         [0.072266525787876068, 0, 1.6361104894963674, 0.43615603629150668,
          -1.7083770152842432, -0.43615603629150701],
         [-1.6361104894963674, 0, -0.072266525787875735, 0.43615603629150723,
          1.7083770152842432, -0.43615603629150695]], dtype=object), 'FE0': array([[-0.08525999807368706, 0.20960719173000553, -0.1243471936563187,
          0.61140198570687188, 0.10115913871182744, 0.28743887558130055],
         [-0.12434719365631873, 0.20960719173000553, -0.08525999807368706,
          0.28743887558130055, 0.10115913871182741, 0.61140198570687199],
         [-0.085259998073687046, -0.12434719365631877, 0.20960719173000567,
          0.61140198570687188, 0.2874388755813006, 0.10115913871182744],
         [0.20960719173000564, -0.12434719365631874, -0.08525999807368706,
          0.10115913871182745, 0.28743887558130055, 0.61140198570687199],
         [-0.12434719365631869, -0.08525999807368706, 0.20960719173000567,
          0.28743887558130055, 0.61140198570687199, 0.10115913871182744],
         [0.20960719173000567, -0.08525999807368706, -0.1243471936563187,
          0.10115913871182744, 0.61140198570687188, 0.28743887558130055]], dtype=object)}
DEBUG:FFC:  
  QG-utils, psi_tables, name_map:
  {'FE0_D10': ('FE0_D10', (), False, False), 'FE0_D01': ('FE0_D01', (), False, False), 'FE0': ('FE0', (), False, False)}
INFO:FFC:  Transforming cell integral
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
DEBUG:FFC:  Reusing element from cache
INFO:FFC:  Computing representation of forms
INFO:FFC:  
INFO:FFC:Compiler stage 2 finished in 0.015656 seconds.

INFO:FFC:Compiler stage 3: Optimizing intermediate representation
INFO:FFC:--------------------------------------------------------
INFO:FFC:  Skipping optimizations, add -O to optimize
INFO:FFC:  
INFO:FFC:Compiler stage 3 finished in 0.00102401 seconds.

INFO:FFC:Compiler stage 4: Generating code
INFO:FFC:---------------------------------
INFO:FFC:  Generating code for 1 element(s)
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
DEBUG:FFC:  Removing unused variable: tmp7
DEBUG:FFC:  Removing unused variable: tmp6
DEBUG:FFC:  Removing unused variable: tmp5
DEBUG:FFC:  Removing unused variable: tt
DEBUG:FFC:  Removing unused variable: ss
DEBUG:FFC:  Removing unused variable: rr
INFO:FFC:  Generating code for 1 dofmap(s)
INFO:FFC:  Generating code for integrals
DEBUG:FFC:  Removing unused variable: circumradius
DEBUG:FFC:  Removing unused variable: v0v1
DEBUG:FFC:  Removing unused variable: v0v2
DEBUG:FFC:  Removing unused variable: v1v2
DEBUG:FFC:  Removing unused variable: volume
INFO:FFC:  Cell, number of operations to compute tensor: 612
INFO:FFC:  Generating code for forms
INFO:FFC:  
INFO:FFC:Compiler stage 4 finished in 0.0744059 seconds.

INFO:FFC:Compiler stage 4.1 finished in 2.14577e-06 seconds.

INFO:FFC:Compiler stage 5: Formatting code
INFO:FFC:---------------------------------
INFO:FFC:  Output written to ./ffc_form_1f978917e0c15293e6c478f755ff21e0fbf499b5.h.
INFO:FFC:  
INFO:FFC:Compiler stage 5 finished in 0.00170898 seconds.

INFO:FFC:FFC finished in 0.0986991 seconds.
DEBUG:FFC:Compiling and linking Python extension module, this may take some time.
In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/mwathen/.instant/error/ffc_form_1f978917e0c15293e6c478f755ff21e0fbf499b5/compile.log'
ERROR:instant:In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/mwathen/.instant/error/ffc_form_1f978917e0c15293e6c478f755ff21e0fbf499b5/compile.log'
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-60-fbc5cd156500> in <module>()
      5 v.vector()[:] = zero
      6 N = FacetNormal(mesh)
----> 7 A = assemble(inner(grad(v),N)*u*dx)

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/dolfin/fem/assembling.pyc in assemble(form, tensor, mesh, coefficients, function_spaces, cell_domains, exterior_facet_domains, interior_facet_domains, reset_sparsity, add_values, finalize_tensor, keep_diagonal, backend, form_compiler_parameters, bcs)
    166                            coefficients=coefficients,
    167                            form_compiler_parameters=form_compiler_parameters,
--> 168                            common_cell=common_cell)
    169 
    170     # Set mesh if specified (important for functionals without a function spaces)

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/dolfin/fem/form.pyc in __init__(self, form, function_spaces, coefficients, subdomains, form_compiler_parameters, common_cell)
     54             self._compiled_form, module, self.form_data, prefix \
     55                                  = jit(form, form_compiler_parameters,
---> 56                                        common_cell)
     57 
     58         elif isinstance(form, ufc.form):

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/dolfin/compilemodules/jit.pyc in mpi_jit(*args, **kwargs)
     58         # Just call JIT compiler when running in serial
     59         if MPI.num_processes() == 1:
---> 60             return local_jit(*args, **kwargs)
     61 
     62         # Compile first on process 0

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/dolfin/compilemodules/jit.pyc in jit(form, form_compiler_parameters, common_cell)
    120         raise RuntimeError, "Form compiler must implement the jit function."
    121 
--> 122     return jit_compile(form, parameters=p, common_cell=common_cell)

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.pyc in jit(ufl_object, parameters, common_cell)
     76         return jit_element(ufl_object, parameters)
     77     else:
---> 78         return jit_form(ufl_object, parameters, common_cell)
     79 
     80 def _auto_select_degree(elements):

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.pyc in jit_form(form, parameters, common_cell)
    219             cppargs = parameters["cpp_optimize_flags"].split() \
    220                       if parameters["cpp_optimize"] else ["-O0"],
--> 221             cache_dir = cache_dir)
    222 
    223         # Remove code

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/ufc_utils/build.pyc in build_ufc_module(h_files, source_directory, system_headers, **kwargs)
     71                                 system_headers          = system_headers,
     72                                 cmake_packages          = ["UFC"],
---> 73                                 **kwargs)
     74 
     75 def extract_declarations(h_files):

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/instant/build.pyc in build_module(modulename, source_directory, code, init_code, additional_definitions, additional_declarations, sources, wrap_headers, local_headers, system_headers, include_dirs, library_dirs, libraries, swigargs, swig_include_dirs, cppargs, lddargs, object_files, arrays, generate_interface, generate_setup, cmake_packages, signature, cache_dir)
    540 
    541         # Recompile if necessary
--> 542         recompile(modulename, module_path, new_compilation_checksum, build_system)
    543 
    544         # --- Load, cache, and return module

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/instant/build.pyc in recompile(modulename, module_path, new_compilation_checksum, build_system)
    149                     os.remove(compilation_checksum_filename)
    150                 msg = "In instant.recompile: The module did not compile with command '%s', see '%s'"
--> 151                 instant_error(msg % (cmd, compile_log_filename_dest))
    152 
    153     finally:

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/instant/output.pyc in instant_error(*message)
     55     _log.error(*message)
     56     text = message[0] % message[1:]
---> 57     raise RuntimeError(text)
     58 
     59 def instant_assert(condition, *message):

RuntimeError: In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/mwathen/.instant/error/ffc_form_1f978917e0c15293e6c478f755ff21e0fbf499b5/compile.log'

In [61]:
A.array()


Out[61]:
array([ 1.66666667,  0.16666667,  0.16666667,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ])

In [ ]:
print cell.get_cell_data

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.incident

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.order

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.ordered

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.collides

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.contains

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.cell_normal

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.facet_area

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [ ]:
print cell.distance

In [185]:


In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [ ]:
print "   edge", edge.mesh_id

In [80]:
v.array()


Out[80]:
0.0