# Indicator Function for 3d Mesh

6 days 16 hours ago #1786 by kelley
Hi,

I have a three dimensional geometry with different subdomains. To implement my weak form including the region boundaries, I was following the approach recommended in this thread .

My confusion now is that the indicator function is not acting as expected since it is indicating some sides of the domain (see the attached example adapted from the tutorials). I checked the current tutorials and the difference from the working examples appears to be that this is a three dimensional mesh. I'm not sure if I have to adapt my example somehow or if the CoefficientFunction does not have this information like it doesn't have the boundary region information?

I also tried setting GridFunctions as a workaround but these are interpolating into neighboring subdomains -- maybe there is a way to prevent this?

Josie
##### Attachments:

3 days 5 hours ago #1795 by joachim
Hi Josie,

the CoefficientFunction( list ) has one value per material, or one value per boundary, depending on the context. Drawing the surface mesh interprets it as one value per boundary.

If you clip and visualize L in the clipping plane, it looks as you expect.

You can also say:
cf = BoundaryFromVolumeCF(CoefficientFunction(values_list))
Draw(cf, mesh, "L")
Then the surface visualization evaluates the CF inside the volume elements next to the surface.

Joachim