Dear Irene,
The level-set function should be approximatively a signed distance to
the hole boundary. So that you cannot just set the value of level set to
1 or 0.
If your function is not close to a signed distance. The standard way is
to use a reinitilization of the level-set using a Hamilton-Jacobi
equation to make it evolves toward a signed distance and preserving the
0 level-set. An exemple of such a reinitialization can be found in the
example interface/tests/matlab/demo_structural_optimization.m
Regards,
Yves
Le 08/04/2014 10:34, ing.ire a écrit :
> Dear all,
> I am using getfem to solve a stokes problem in a domain with a hole,
> set by a level set function.
> Till now, I am setting the level set function as
> in contrib/xfem_contact/xfem_stokes.cc, that is defining an analytical
> function that returns the distance of a geometrical point from the
> border set by the level set function (eg: 2D circle of radius=Radius
> and centre=(0.5,0.5) ):
>
> double ls_value (const base_node &P)
> {
> double R=Radius;
> return (P[0]-0.5)*(P[0]+0.5)+(P[1]-0.5)*(P[1]-0.5)-R*R;
> }
>
> and then calling this function for every dof of the level set mesh FEM
> and assigning the value to the vector ls.values():
>
> const getfem::mesh_fem &lsmf = ls.get_mesh_fem();
> for (size_type i=0; i<lsmf.nb_dof();++i)
> ls.values()[i] = ls_value(lsmf.point_of_dof(i));
>
>
> Is it possible to add the level set function by directly setting its
> value (0 or 1) in each dof of the level set mesh FEM?
> I can write a function that returns 0 or 1 if the geometrical point P
> that takes as an argument belongs to one region or the other, but then
> how can I set the object getfem::level_set ls in getfem?
>
>
> Thanks in advance.
> Irene.
>
>
> _______________________________________________
> Getfem-users mailing list
> [email protected]
> https://mail.gna.org/listinfo/getfem-users
--
Yves Renard ([email protected]) 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
---------
_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users