Dirichlet BC problems...

Asked by Arun Jaganathan on 2013-11-25

Hello,

This is a beginner question. I have the following error setting Dirichlet BC .

Error: Unable to create Dirichlet boundary condition.
*** Reason: Illegal value rank (1), expecting (2).
*** Where: This error was encountered inside DirichletBC.cpp.

 Here is part of my code:

mesh = UnitSquareMesh(300, 300)
V = VectorFunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
Q = VectorFunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
W = V * Q

class DirichletBoundary(SubDomain):
 def inside(self,x,on_boundary):
  return on_boundary

zero = Constant((0.0,0.0))
bc1 = DirichletBC(W.sub(0), zero, DirichletBoundary())
bc2 = DirichletBC(W.sub(1), zero, DirichletBoundary())
bcs =[bc1, bc2]

Any help ?

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
2013-11-25
Last reply:
2013-11-27
Johannes Ring (johannr) 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 Arun Jaganathan for more information if necessary.

To post a message you must log in.