getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] Question concerning reordering in mesh_fem; Patch for


From: Yves Renard
Subject: Re: [Getfem-users] Question concerning reordering in mesh_fem; Patch for getfemmatlab.tex
Date: Thu, 29 Jan 2009 17:24:43 +0100
User-agent: KMail/1.9.5

On Thursday 29 January 2009 16:36, you wrote:
> Dear Mailing list, dear Yves Renard, dear Julien Pommier,
>
> I want to use getfem to compute the gradient of a scalar field given
> on the nodes of a 3D-mesh (tetraeders) using the Matlab interface. I
> have a problem with the reordering of the nodes in the mesh_fem
> object.
>
> I do the following in Matlab:
> % ------------------
> % import the mesh
> m=gfMesh('import', 'gmshv2', 'meshfile.gmsh');
> % get the points
> points=gf_mesh_get(m,'pts')';
> % calculate the scalar field at the node positions
> % (using a FEM-calculation, that does not use getfem yet)
> U=calculate_scalar_field(points);
>
> % create a mesh_fem for the gradient computation
> mf=gfMeshFem(m,1);
> % 3 dimensions, linear interpolation
> set(mf, 'fem', gfFem('FEM_PK(3,1)'));
>
> % the following does not give the right result because the convexes
> % and nodes are reordered somehow with the cuthill_mckee_on_convexes
> % method and U is supposed to be a field on the mesh_fem and not
> % on the mesh as in my case - is that right?
> DU=gf_compute(mf, U, 'gradient', mf);
>
> % So I need something like:
> V=reorder_according_to_the_mesh_fem_order_of_points(U, mf);
> DV=gf_compute(mf, V, 'gradient', mf);
> % ------------------

It should be better to do the operation "calculate_scalar_field" on the dof of 
mf. You can have the set of dof with the instruction
points = gf_mesh_fem_get(mf, 'dof nodes');

You can also use the gf_mesh_fem_get(mf, 'eval', expr) instruction.

If you really need the correspondance beetween fem nodes and mesh vertices you 
can have it comparing the list given by
   gf_mesh_fem_get(mf, 'dof from cv', [ivec CVLST])
and the one given by
gf_mesh_get(m, 'pid from cvid'[,ivec CVLST])
for each element.

>
> Is there a possibility to reorder my scalar field or to associate the
> values with the nodes in the mesh_fem? I could not find an appropriate
> function, that gives the ordering used in mesh_fem. I'm quite new to
> getfem.
>
> I prepared a little patch for the getfemmatlab.tex, correcting some
> spelling errors (see attachment), you might want to apply it.

Ok, thank you.

> And a suggestion: I would appreciate a getfem-users wiki or even
> better if your website would run on a wiki (using for example
> http://dokuwiki.org/) and I could provide help with that, if you want.
I have no real experience with this ...
>
> Thank you for your time,
> Mirko Windhoff
> http://kyb.mpg.de/~mwindhoff


Yves.

-- 

  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

---------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]