getfem-users
[Top][All Lists]

## Re: [Getfem-users] setting dirichlet boundary for vector fields

 From: Yves Renard Subject: Re: [Getfem-users] setting dirichlet boundary for vector fields Date: Fri, 12 Mar 2010 12:55:09 +0100 User-agent: KMail/1.9.9

```Dear  P. Kaminski,

Yes, for the old brick system, it is not possible to describe a data with a
vectorial mesh_fem. So you have to declare a second scalar mesh_fem
( mfdata = gf.MeshFem(m, 1) for instance) and use it for the eval
operation and for the b2.set_param('R', mfdata, U).

This limitation is not present in the new brick system (version 4.0.0).

Yves.

> On jeudi 11 mars 2010, you wrote:
> > 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
> >
> > P. Kaminski
> >
> > _______________________________________________
> > Getfem-users mailing list
> > https://mail.gna.org/listinfo/getfem-users

--

Yves Renard (address@hidden)       tel : (33) 04.72.43.87.08
Pole de Mathematiques, INSA-Lyon             fax : (33) 04.72.43.85.29
20, rue Albert Einstein
69621 Villeurbanne Cedex, FRANCE
http://math.univ-lyon1.fr/~renard

---------

```