1) You can use functions such as BoundaryMesh
or SubMesh
to define your n-1 dimensional mesh on which you then can define a new functionspace. You can interpolate
or project
functions from your n-dimensional functionspace onto your new n-1 dimensional one.
2) You can define a MeshFunction
that is 1 or 0, depending on the comparison of your scalar function with x, and then use this MeshFunction
to define a new SubMesh
. This will work if you scalar function is piecewise constant (edit: within every element). If this is not the case, i.e. your scalar function equals x somewhere mid-element, you essentially need a new mesh, so I wouldn't know how to do it. If your goal is just to plot however (not to continue working on this new mesh), you can use a visualization program such as Paraview and clip above/below a certain value.