1
$\begingroup$

In Version 11.0, it appears that one cannot plot over a mesh. The following code worked in Version 10.2:

$Version
<< NDSolve`FEM`
reg = Rectangle[];
mesh = ToElementMesh[reg];
Plot3D[x^2 + y^2, Element[{x,y}, mesh]]

11.0.1 for Microsoft Windows (64-bit) (September 20, 2016)

Plot3D::idomdim: {x,y} ∈ mesh does not have a valid dimension as a plotting domain.

Of course I could have used Element[{x,y}, reg] as the plotting domain in this example, but I am working with a complicated mesh built from a BoundaryMesh rather than a region.

Similar behaviour has been observed in (144610) but this was not the question (and it was only an issue for the answerer zhk, who must have been using a different version of Mathematica to the OP).

$\endgroup$
  • $\begingroup$ It works like a breeze in version 11.3 for macOS, but I recall that version 11.0.1 was quite buggy when it came to MeshRegion and BoundaryMeshRegion. $\endgroup$ – Henrik Schumacher Aug 6 '18 at 6:33
  • 3
    $\begingroup$ mesh is an NDSolve`FEM`ElementMesh a different creature entirely, and wasn't completely supported in viz functions in 11.0. But, it works fine in 11.1. you need to convert to a MeshRegion via MeshRegion@mesh, but the results are "interesting" in 11.0. $\endgroup$ – rcollyer Aug 6 '18 at 15:22
2
$\begingroup$

As noted in the comments above this issue you see was due to a bug in V11.0 Things work fine in Version 11.1 onward. For version 11 you can use something like

Needs["NDSolve`FEM`"]
amesh = ToElementMesh[Disk[]];
MeshRegion[MeshOrderAlteration[amesh, 1]]

To convert a mesh to a first order mesh region.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy