Octree Mesh Creation

7ccc1cb8086549ea83dd450b36c196c9

This application lets users create Octree mesh objects with local refinements using the SimPEG.discretize package. The refinements can be performed on any number of objects.

See the Methodology section to learn more about how the algorithm works.

New user? Visit the Getting Started page.

Application

The following sections provide details on the different parameters controlling the application. Interactive widgets shown below are for demonstration purposes only.

[1]:
from geoapps.octree_creation.application import OctreeMesh

app = OctreeMesh(geoh5=r"../../../assets/FlinFlon.geoh5")
app()

Project Selection

Select and connect to an existing geoh5 project file containing objects with vertices.

OR

Select a *.ui.json input file to re-load parameters from. See the Input ui.json section for details.

[2]:
app.project_panel

See the Project Panel page for more details.

Core hull extent

List of objects available to define the core region of the mesh. Padding parameters are added beyond the convex hull of the selected object.

[3]:
app.objects

Mesh Parameters

9956ceb06115434f890ab72e79da56df

Minimum depth

Minimum thickness of the mesh below the core hull extent. See the Methodology section for details.

[4]:
app.depth_core

Core cell sizes

Easting

Minimum cell size (m) along the x-axis

[5]:
app.u_cell_size

Northing

Minimum cell dimension (m) along the y-axis

[6]:
app.v_cell_size

Vertical

Minimum cell dimension (m) along the z-axis

[7]:
app.w_cell_size

Padding distances

Minimum padding distance (m) requested around the core region.

Horizontal

Padding distance added around the core region on the XY-plane.

[8]:
app.horizontal_padding

Vertical

Padding distance added above and below the core region.

[9]:
app.vertical_padding

Refinements

Blocks of refinement parameters controlling where small cells are required. Overlapping regions of refinement will default to the smaller cell size. Cells outside of the regions of refinement are allowed to increase in size (double) as quickly as possible to fill the remaining volume.

Note: The application defaults to two blocks of refinement, labeled as A and B. See notes below to learn how to add more blocks of refinement.

[10]:
app.refinement_list.children[0]

Object

Reference object with 3D coordinates (vertices or centroids) used to refine the octree mesh.

[11]:
app.refinement_list.children[0].children[1]

Levels

List of integers defining the minimum number of cells at each octree level [\(N_{level 1}\), \(N_{level 2}\), \(N_{level 3}\), …]. See examples below

[12]:
app.refinement_list.children[0].children[2]

Type

The type of refinement to be performed on the selected object vertices and number of cells per octree level.

[13]:
app.refinement_list.children[0].children[3]

Radial

Octree cells specified at each Level are added as concentric shells around the selected Object vertices.

badf5f2be80b46a797fc029fc296c59e

Surface

Octree cells specified at each Level are added at depth as layers of cells. The layers of cells are defined by a 2D Delaunay triangulation based on the Object vertices. The maximum distance parameter can be use to limit the horizontal extent of the refinement.

d14b46b2e7434850bf49550103294b3f

Max distance

Maximum refinement distance away from the input vertices. Cell sizes are allowed to increase quickly beyond this distance.

Note: This parameter is useful to avoid a fine refinement occuring between remote vertices as shown above.

[14]:
app.refinement_list.children[0].children[4]

Output panel

An octree mesh is created and exported directly to the target workspace by clicking on the export button.

[15]:
app.output_panel

Methodology

This section provides algorithmic details about the mesh creation. The entire process can be broken down into three main parts:

Step 1- Mesh creation

The first stage relies on the discretize.utils.mesh_builder_xyz method to define the outer limits of the mesh. The horizontal and vertical extent are computed based on the selected entity Core Hull Extent, padding distances and Minimum Depth (vertical only). Limits are rounded up such that the number of core cells along each dimension is in power of 2 (i.e. 64, 128, …), as required for octree discretization.

The example below demonstrates this process with the default parameters:

b82d535a9f2040daada3c18462235a6a

Horizontal extent (East-West):

Input: 5600 m (hull) + 2*1000 m (pad) = 7600 m

Round: 7600 m / 25 m/cell = 304 cells -> 512 cells

Final: 512 cells * 25 m/cell = 12800 m

Vertical extent:

Input: 46 m (hull) + 2*1000 m (pad) + 500 (core) m = 2546 m

Round: 2546 m / 25 m/cell = 102 cells -> 128 cells

Final: 128 cells * 25 m/cell = 3,200 m

Step 2- Refinements

Once the extent of the mesh has been defined, the program can proceed with the Refinements prescribed by the user. The routine makes use of the discretize.utils.refine_tree_xyz utility function. The order of refinements is not important as only the smallest cell octree found at a given position is used.

Step 3 - Finalization

Once all the refinements have been added, the TreeMesh.finalize() routine is called for the final construction of the mesh. Cells in regions outside of the refinements are allowed to expand as quickly as possible. Et voila!

Input ui.json

This application relies on a structured json file to store and run the program.

The same input ui.json file can be used to run the program from command line:

activate geoapps
python -m geoapps.octree_creation.application [YourInputName].ui.json

or directly from Geoscience ANALYST Pro v3.3.1 or higher. The ui.json can also be used to re-load the parameters from a previous run by selecting the ui.json file from the Project Selection widget, instead of a geoh5 file.

Notes

b1ba76cdf2714abb9ff5fe524aa2c32c

  • Additional refinements can be performed by adding new blocks of parameters to the default input ui.json file:

    • For each additional refinement blocks, a unique name must be provided (C, D, etc)

    • Each block must include all refinement parameters.

    • Changes made will be displayed after re-loading the ui.json from the Project Selection panel.

Geoscience ANALYST Pro v3.4

Users with an active Geoscience ANALYST Pro license (v3.4) can execute this application directly from an active session with a drag & drop of a *.ui.json file to the Viewport.

../../_images/GA_pro_octree.gif

Need help? Contact us at support@mirageoscience.com