Skip to content

Commit

Permalink
Merge pull request #36 from MiraGeoscience/GEOPY-1761
Browse files Browse the repository at this point in the history
GEOPY-1761: Update to latest of octree creation
  • Loading branch information
domfournier authored Sep 17, 2024
2 parents 7770ce7 + 7baacbb commit 8fd249e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions plate_simulation/mesh/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@ def octree_params(
self, survey: ObjectBase, topography: Surface, plates: list[Surface]
):
refinements = {
"Refinement A object": topography,
"Refinement A levels": "0, 2",
"Refinement A type": "surface",
"Refinement B object": survey,
"Refinement B levels": "4, 2",
"Refinement B type": "radial",
"Refinement A object": survey,
"Refinement A levels": "4, 4, 4",
"Refinement A horizon": False,
"Refinement B object": topography,
"Refinement B levels": "0, 2",
"Refinement B horizon": True,
"Refinement B distance": 1000.0,
}
for plate, letter in zip(plates, string.ascii_uppercase[2:], strict=False):
refinements.update(
{
f"Refinement {letter} object": plate,
f"Refinement {letter} levels": "2, 1",
f"Refinement {letter} type": "surface",
f"Refinement {letter} horizon": False,
}
)

Expand All @@ -63,5 +64,5 @@ def octree_params(

assert isinstance(survey.workspace.h5file, Path)
path = survey.workspace.h5file.parent
octree_params.input_file.write_ui_json(name="octree.ui.json", path=path)
octree_params.write_input_file(name="octree.ui.json", path=path)
return octree_params
2 changes: 1 addition & 1 deletion tests/runtest/driver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_plate_simulation(tmp_path):
k.name in [f"Iteration_0_{i}" for i in "xyz"] for k in data.property_groups
)
assert all(len(k.properties) == 20 for k in data.property_groups)
assert mesh.n_cells == 11132
assert mesh.n_cells == 14555
assert len(np.unique(model.values)) == 4
assert all(
k in np.unique(model.values) for k in [1.0 / 7500, 1.0 / 2000, 1.0 / 20]
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_azimuth_to_unit_vector():


def test_replicate_even(tmp_path):
workspace = Workspace(tmp_path / "test.geoh5")
workspace = Workspace.create(tmp_path / "test.geoh5")
surface = Surface.create(
workspace,
name="test",
Expand All @@ -40,7 +40,7 @@ def test_replicate_even(tmp_path):


def test_replicate_odd(tmp_path):
workspace = Workspace(tmp_path / "test.geoh5")
workspace = Workspace.create(tmp_path / "test.geoh5")
surface = Surface.create(
workspace,
name="test",
Expand Down

0 comments on commit 8fd249e

Please sign in to comment.