getfem-users
[Top][All Lists]
Advanced

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

[Getfem-users] level set function


From: ing.ire
Subject: [Getfem-users] level set function
Date: Tue, 8 Apr 2014 10:34:54 +0200

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.

reply via email to

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