Commit Graph
10 Commits
Author SHA1 Message Date
Svenn Tveit 8eaa56885d Use docstring template for OnePhaseSimulator documentation 2025-09-23 13:20:42 +02:00
Håkon Hægland 6fe5742145 Convert docstrings to template format with simulator configurations
- Create unified template structure with 'simulators', 'constructors', and 'common_methods' sections
- Add support for both BlackOil and GasWater simulators
- Use {{name}} and {{class}} placeholders for template expansion
- Eliminates need for duplicate JSON files
2025-09-17 14:47:02 +02:00
Svenn Tveit 32dd09c78f Add Python gas-water simulator and refactor to template base class
Extend the Python blackoil simulator to support two-phase gas-water
simulations by extracting common functionality into a template base
class and implementing proper module separation.

- Extract PyBaseSimulator<TypeTag> template base class containing all
  common simulator functionality (20+ methods including advance, run,
  step, property access, and MPI handling)
- Add PyGasWaterSimulator for two-phase gas-water simulations using
  FlowGasWaterProblem TypeTag with oil phase disabled
- Split Python modules to avoid ODR violations:
  - BlackOil.so for PyBlackOilSimulator (FlowProblemTPFA)
  - GasWater.so for PyGasWaterSimulator (FlowGasWaterProblem)
- Implement proper template instantiation control with explicit
  instantiations per module

- Eliminate ~400 lines of code duplication between simulators
- Clean inheritance hierarchy: derived classes contain only constructors
- Type-safe specialization through OPM's TypeTag property system
- Separate docstring generation for each simulator type
- Independent build targets with shared infrastructure

- Update CMakeLists.txt to support multiple pybind11 modules
- Add docstrings_gw_simulators.json for gas-water simulator documentation
- Remove centralized Pybind11Exporter.cpp in favor of distributed exports
- Implement proper build dependencies and custom targets

This establishes a scalable foundation for extending OPM's Python
bindings to support additional simulator types (thermal, polymer,
solvent) while maintaining type safety and avoiding symbol conflicts.

Files changed: 21 files, 915 insertions, 428 deletions
2025-09-17 10:06:44 +02:00
Lisa Julia Nebel 6fecef3fb1 Add missing return type to check_simulation_finished function of BlackOilSimulator 2025-01-14 14:11:09 +01:00
Lisa Julia Nebel 6958abdbc2 Change return type of other _init_ of the BlackOilSimulator class 2025-01-14 10:58:12 +01:00
Lisa Julia Nebel 053fe26eff Change return type of _init_ of the BlackOilSimulator class 2025-01-14 10:32:55 +01:00
Lisa Julia Nebel 016a806a0c Change return type of _init_ of the BlackOilSimulator class 2025-01-14 09:40:54 +01:00
Lisa Julia Nebel 82ba8b4ea5 Fix errors in documentation. 2025-01-08 14:08:41 +01:00
Lisa Julia Nebel 13e3cd590c Fix typos and test the automatic deployment to opm-python-documentation 2024-07-25 19:34:17 +02:00
Lisa Julia Nebel 42d79ebb97 Delete almost everything of the documentation here, this will be done in a separate repository opm-python-documentation
Keep only the file docstrings.json (renamed to docstrings_simulators.json)
2024-07-10 18:02:41 +02:00