-
Notifications
You must be signed in to change notification settings - Fork 2
GEOPY-2779: Add Leroi as option for engine inside Plate Simulation application #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
615ade0
d763e45
190fe46
26ea236
43f410e
1176e1d
77da1d5
f899e41
9f851e1
58c7956
551e8af
3a07436
8bc8ef4
999e985
71e10eb
45e4202
16e9eec
8c792fc
49ad967
c57f22a
f7739bc
c69414c
602eca4
36fe2a7
cb275a4
d12133a
bba8f22
84e3e34
b9c8ac6
8221bf5
2c1f4e1
00153a3
517ce5f
207a532
b66248e
e860349
337b00b
5d3dbea
2587551
3bb7798
3241db3
f6f8a8f
bea6cf4
f194b2a
3af27d6
33e39bc
9605442
8b1818d
5191acb
33bcc43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | ||
| # Copyright (c) 2023-2026 Mira Geoscience Ltd. ' | ||
| # ' | ||
| # This file is part of simpeg-drivers package. ' | ||
| # ' | ||
| # simpeg-drivers is distributed under the terms and conditions of the MIT License ' | ||
| # (see LICENSE file at the root of this source code package). ' | ||
| # ' | ||
| # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | ||
| # Copyright (c) 2023-2026 Mira Geoscience Ltd. ' | ||
| # ' | ||
| # This file is part of simpeg-drivers package. ' | ||
| # ' | ||
| # simpeg-drivers is distributed under the terms and conditions of the MIT License ' | ||
| # (see LICENSE file at the root of this source code package). ' | ||
| # ' | ||
| # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | ||
|
|
||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
| from .interface import LeroiAirInterface | ||
| from .options import LeroiAirOptions | ||
|
|
||
|
|
||
| class LeroiAirDriver: | ||
| """Orchestrates a LeroiAir forward simulation from input preparation to geoh5 output.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| options: LeroiAirOptions, | ||
| ) -> None: | ||
| """Initialize with simulation options.""" | ||
| self.options = options | ||
| self.interface = LeroiAirInterface(options) | ||
|
|
||
| @property | ||
| def project_path(self) -> Path: | ||
| """Directory containing the geoh5 workspace file.""" | ||
| return self.options.survey.entity.workspace.h5file.parent | ||
|
|
||
| def run_leroi(self) -> subprocess.CompletedProcess: | ||
| """Run the LeroiAir executable and raise on non-zero exit.""" | ||
| result = subprocess.run( | ||
| ["LeroiAir550_JR", "LeroiAir"], | ||
| cwd=self.project_path, | ||
| capture_output=True, | ||
| text=True, | ||
| check=False, | ||
| ) | ||
| if result.returncode != 0: | ||
| raise RuntimeError( | ||
| f"LeroiAir failed with return code {result.returncode}.\n" | ||
| f"stderr:\n{result.stderr}\n" | ||
| f"stdout:\n{result.stdout}" | ||
| ) | ||
| return result | ||
|
|
||
| def run(self) -> None: | ||
| """Write input, run LeroiAir, and save simulated data to geoh5.""" | ||
| self.interface.input.write_cfl_file(self.project_path / "LeroiAir.cfl") | ||
| self.run_leroi() | ||
| self.interface.output.save_to_geoh5( | ||
| outfile=self.project_path / "LeroiAir.out", | ||
| out_group=self.options.out_group, | ||
| normalization=1e-9, | ||
| ) | ||
|
Comment on lines
+51
to
+59
|
||


Uh oh!
There was an error while loading. Please reload this page.