simpeg / discretize

Discretization tools for finite volume and inverse problems.

Home Page:http://discretize.simpeg.xyz/

Repository from Github https://github.comsimpeg/discretizeRepository from Github https://github.comsimpeg/discretize

Understanding how tree mesh refinement works in SimPEG

jiajiasun opened this issue · comments

Hello everyone. I was looking at the TreeMesh tutorial here http://discretize.simpeg.xyz/en/main/tutorials/mesh_generation/4_tree_mesh.html#sphx-glr-tutorials-mesh-generation-4-tree-mesh-py, and tried to develop an understanding of how the refinement was done, especially what the numbers in the octree levels mean and how these numbers define the refinement. I cannot seem to find any documentation. Did I miss anything?

Update: Dom pointed me to https://geoapps.readthedocs.io/en/latest/content/applications/create_octree.html#Radial. I am now in the middle of trying to wrap my head around it.

@jiajiasun constructing tree meshes, a lot of things have less to do with actual distances and more to do with the number of base cells. Consider the function refine_tree_xyz where you supplied a single points r0 around which you want to refine and you chose the 'radial' option.

The discretization around that points is going to depend on the list you entered for levels. Let levels = [4, 6, 8] and assume the smallest cells (base cell) in your tree mesh have side length h. Because the first entry in levels is 4, your mesh will use the smallest cell size within a radius of 4 x h around the point your provided. The second entry in levels is a 6, so within a radius of 6 x (2h), your cells will have widths of 2h. And with a radius of 8 x (4h) your cells will have widths 4h. And so forth until you reach the maximum allowable cells size for the mesh.

Note that levels can have entries of 0 if you don't want to discretize an area beginning at the smallest cell size.

Hopefully this helps.

@dccowan Thank you so much, Devin! That makes a lot more sense now!

We are currently improving the documentation for all of discretize. I will consider this when documenting the function. For now, I will close this issue.