In [1]:
from dolfin import *
import numpy as np
import scipy.sparse as sp
import numpy
from scipy2Trilinos import scipy_csr_matrix2CrsMatrix
from PyTrilinos import Epetra, ML, AztecOO

nn = 2
mesh = RectangleMesh(0, 0, 1, 1, nn, nn,'left')

order  = 2
Magnetic = FunctionSpace(mesh, "N1curl", order)
Lagrange = FunctionSpace(mesh, "CG", order)
L= FunctionSpace(mesh, "DG", order-1)
C = sp.csr_matrix((Magnetic.dim(),Lagrange.dim()))


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.

In [38]:
dof=Magnetic.dofmap()
Magnetic.element()


Out[38]:
<dolfin.cpp.fem.FiniteElement; proxy of <Swig Object of type 'boost::shared_ptr< dolfin::FiniteElement > *' at 0x3270630> >

In [5]:
for cell in cells(mesh):
  print "cell", cell.index(), "has edges :",
  for edge in edges(cell):
    print edge.index(),
  print


cell 0 has edges : 0 1 2
cell 1 has edges : 3 4 0
cell 2 has edges : 5 4 6
cell 3 has edges : 7 8 5
cell 4 has edges : 9 10 3
cell 5 has edges : 11 12 9
cell 6 has edges : 13 12 7
cell 7 has edges : 14 15 13

In [35]:


In [ ]:
rint cell3D

In [42]:
delement = Magnetic.dolfin_element()

In [53]:
uflele = Magnetic.ufl_element()

In [74]:
delement.interpolate_vertex_values?

In [141]:
u = Function(Lagrange)

In [143]:
u = grad(u)

In [133]:
u.vector().array()[1] !=(mesh.coordinates()[1])


Out[133]:
array([ True, False], dtype=bool)

In [140]:
mesh.cell_orientations()


Out[140]:
array([-1, -1, -1, -1, -1, -1, -1, -1], dtype=int32)

In [144]:
u((.1,.1))


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-144-56927b7a8a8c> in <module>()
----> 1 u((.1,.1))

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/ufl/exproperators.pyc in _call(self, arg, mapping, component)
    293         return _restrict(self, arg)
    294     else:
--> 295         return _eval(self, arg, mapping, component)
    296 Expr.__call__ = _call
    297 

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/ufl/exproperators.pyc in _eval(self, coord, mapping, component)
    285         mapping = {}
    286     index_values = StackDict()
--> 287     return f.evaluate(coord, mapping, component, index_values)
    288 
    289 def _call(self, arg, mapping=None, component=()):

/home/mwathen/Work/FEniCS/lib/python2.7/site-packages/ufl/differentiation.pyc in evaluate(self, x, mapping, component, index_values, derivatives)
    195         "Get child from mapping and return the component asked for."
    196         r = len(component)
--> 197         component, i = component[:-1], component[-1]
    198         derivatives = derivatives + (i,)
    199         result = self._f.evaluate(x, mapping, component, index_values,

IndexError: tuple index out of range