3
$\begingroup$

I'm using NDSolveValue to solve the Laplacian equation for this geometry:

enter image description here

I want to view the mesh that NDSolveValue is using, so I do the following:

Print@Show[
   Graphics3D[{Opacity[0], lrectregion, Opacity[0], rrectregion}, 
    ImageSize -> Large], sol["ElementMesh"]["Wireframe"]];

(where sol is the interpolated function that NDSolveValue returns. Its actual form doesn't matter for this question and the code used to produce it is hefty, so I didn't include it.)

However, it's hard to see what's actually going on in the 3D plot that gets generated:

enter image description here

If I manually zoom in on the boundaries (those rectangles), I can kind of see detail, but still not that well:

enter image description here

I know about these "slice" functions like SliceDensityPlot3D that are very helpful for seeing a 2D "slice" of a 3D function in 3D space. Is there anything like that for visualizing the mesh?

I've looked at this article for element mesh visualization but didn't see anything helpful.

$\endgroup$

1 Answer 1

3
$\begingroup$

No, there is no SliceDensityPlot3D for mesh visualization. There is no density to plot. The mesh wireframe is a Graphics/Graphics3D object so you can use

sol["ElementMesh"]["Wireframe"[PlotRange -> {All, {40, 60}, All}]]

enter image description here

Show[
   Graphics3D[{Opacity[0], lrectregion, Opacity[0], rrectregion}, 
    ImageSize -> Large], sol["ElementMesh"]["Wireframe"[PlotRange -> {All, {40, 60}, All}]]
,Boxed->False
]

should do what you want.

$\endgroup$
1
  • $\begingroup$ Thanks, this looks good. Just to be clear, I didn't think there was a density, I just meant the functionality of looking at a 2D slice of a 3D function. $\endgroup$ Jun 1, 2016 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.