This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

assemble_system problem

0 votes

HI all,

when I use assemble_system to assemble a symmetric system with boundary condition applied, I got an error. I do not know how to handle this or is there any alternative way to preserve the symmetry of matrix after applying BCs. Thanks.
complete code segment as follows:

from dolfin import *
mesh = UnitSquareMesh(3,3)
cell_domains = CellFunction('size_t',mesh)
cell_domains.array()[4:]=1 #randomly change the marks on cell
V = FunctionSpace(mesh,"CG",1)
u0=Expression("x[0]") #define the BC
u = TrialFunction(V)
v = TestFunction(V)
a = 1.0\*inner(grad(u), grad(v))\*dx(1) + 2.0\*inner(grad(u), grad(v))\*dx(2)
L = Constant(0.0)\*v\*dx
bc = DirichletBC(V, u0, DomainBoundary())
A, b = assemble_system(a,L,bc,cell_domains = cell_domains)

:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/FEniCS1.2.app/Contents/Resources/lib/python2.7/site-packages/dolfin/fem/assembling.py", line 297, in assemble_system
dolfin_form.set_cell_domains(cell_domains);
NameError: global name 'dolfin_form' is not defined
asked Oct 12, 2013 by jying FEniCS User (2,020 points)
edited Nov 7, 2013 by johanhake

Please post complete code.

I don't get an error running the above code. What version of DOLFIN are you using (import dolfin, print dolfin.__version__).

I use dolfin 1.2. It seems this function works in dolfin 1.0.

I get the same error, OS X 10.7, FEniCS 1.2.0 …

1 Answer

+1 vote

If you grab the snapshot download as of today 7-November-2013 (not sure what operating system that you're using - I was using OS X 10.7) it will fix the problem. The "regular" download has the problem in it.

answered Nov 7, 2013 by timm FEniCS User (2,100 points)
edited Nov 7, 2013 by timm
...