getfem-users
[Top][All Lists]

[Getfem-users] setting dirichlet boundary for vector fields

 From: Przemyslaw Kaminski Subject: [Getfem-users] setting dirichlet boundary for vector fields Date: Thu, 11 Mar 2010 14:40:28 +0100 User-agent: KMail/1.13.1 (Linux/2.6.32.8; KDE/4.4.1; x86_64; ; )

```Hello,
This may be a silly question but I don't know how to set a Dirichlet
boundary condition for vector fields.
I have a vector field like this one (in Python):

mfu = gf.MeshFem(2, 2)

and I set the boundary conditions like this:

U = mfu.eval('[x[0]*(1-x[0]),x[1]*(1-x[1])]') # exact solution

b0 = gf.MdBrick('isotropic_linearized_elasticity', mim, mfu)
b0.set_param('lambda', Lambda)
b0.set_param('mu', Mu)

b1 = gf.MdBrick('source term', b0, 1)
b1.set_param('source_term', [4., 4.])

border = m.outer_faces()
m.set_region(42, border)
b2 = gf.MdBrick('dirichlet', b1, 42, mfu, 'penalized')
b2.set_param('R', mfu, U)

But then I get an error

Traceback (most recent call last):
File "./elasticity.py", line 42, in <module>
b2.set_param('R', mfu, U)
File "/home/przemek/lib/python2.6/site-packages/getfem/getfem.py",
line 1556, in set_param
return self.set("param", name, *args)
File "/home/przemek/lib/python2.6/site-packages/getfem/getfem.py",
line 1392, in set
return getfem('mdbrick_set',self.id, *args)
RuntimeError: (Getfem::InterfaceError) -- cannot use a mesh_fem whose
qdim is not 1 for a brick parameter