cbc.block : block_symmetric_assemble & boundary conditions

Asked by Coraline Faurie

Hello !

Here is my problem. I need to use the cbc.block package for my python code (I need block-structure matrix), but I don't know how to apply my boundary condition (Dirichlet boundary conditions, basically non-slip conditions). Let me explain:

I downloaded the last version of cbc.block from: https://bitbucket.org/fenics-apps/cbc.bloI ck/overview. I first tried to run some demo, mixedpoisson.py and biot.py for example. However, I have a problem with the block_symmetric_assemble and block_assemble functions. Here is the error I obtain :

Traceback (most recent call last):

File "mixedpoisson.py", line 97, in <module>

[a21, 0 ]], bcs=bcs)

File "/usr/local/lib/python2.7/dist-packages/block/block_assemble.py", line 35, in block_symmetric_assemble

symm[i,j], asymm[i,j] = _symmetric_assemble(forms[i,j], row_bcs=bcs[i], col_bcs=bcs[j])

File "/usr/local/lib/python2.7/dist-packages/block/block_assemble.py", line 79, in _symmetric_assemble

from dolfin import symmetric_assemble

ImportError: cannot import name symmetric_assemble

Is this a problem with the versions of FEniCS/cbc.block ? I understood that "symmetric_assemble" does no longer exist in the Python interface.

Consequently, I tried to first assemble my blocks and then build my block matrix with: A = block_mat([...]) and the RHS: b = block_vec([...]). To apply my boundary condition I used: bc = block_bc([...]) (with inside my boundary conditions defined with DirichletBC) and bc.apply(A, b). However, "block_bc" is apparently not defined. I obtain this error:

NameError: name 'block_bc' is not defined

So now, I'm confused ! Anyone can help me with that ?

Thanks in advance for your time,

Coraline

PS: I install FEniCS via dorsal, so I have dolfin-1.2.0

Python 2.7.3

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Anders Logg (logg) said :
#1

FEniCS no longer uses Launchpad for Questions & Answers. Please consult the documentation on the FEniCS web page for where and how to (re)post your question: http://fenicsproject.org/support/

Can you help with this problem?

Provide an answer of your own, or ask Coraline Faurie for more information if necessary.

To post a message you must log in.