Recent Releases of ogstools

ogstools - 0.7.0

OGSTools 0.7.0 Release Notes

OGS version: 6.5.4 Python: 3.10 - 3.13

Breaking changes

  • OGS Wheel (pip install ogs) is now an optional (before mandatory) dependency of OGSTools. OGSTools requests either a OGS wheel OR a custom OGS made available on PATH or OGSBINPATH.

API breaking changes

  • mesh.read_shape (removed function, functionality is not covered anymore)

Deprecations

  • meshseries.plotprobe (instead use MeshSeries.extractprobe and plot.line)

Examples

  • removed all examples with shape files

Changes (non API-breaking)

Bugfixes

  • meshesfromgmsh (msh2vtu): Physical groups, which include other physical groups needed to be defined after the subgroups otherwise groups were comprised of the wrong elements, now it's fixed
  • MeshSeries: probe() failed with output meshes only consisting of multiple lines representing BHEs, this is for example the case by using the output option by material id
  • MeshSeries: indexing failed with numpy data types
  • Feflow converter: Heterogeneous material for properties fixed (for KF only)
  • Feflow converter: In CLI extraction of topsurface domain fixed
  • BHE: Fix for huge BHE arrays
  • plot: Fix for plots from parallel computation (vtkGhostType)

Features

  • Logparser: analysis to inspect simulation behaviour over clock time and model time
  • Logparser: plot to create an overview of the convergence behavior for the entire simulation (ot.logparser.ploterror, ot.logparser.plotconvergence_order)
  • Logparser: Functionality for real time monitoring
  • Logparser: Can consume new version (2) of OGS log files (can still consume version 1)
  • OGS simulation can be run in a background process via ot.Project.run_model(..., background=True)
  • MeshSeries.extract_probe/probe/values accept str/Variables and lists of them as arguments (with improved performance)
  • plot: handle gaps in sampling lines and disjoined line meshes, such that each individual region is drawn separately.
  • Project: Run simulations in background
  • Project: Showcasing a second variant of setting well defined initial pressures in the gallery

Infrastructure

  • Several fixes for pyvista>=0.45
  • Pagefind index generation

Tests

  • Hypothesis testing introduction
  • More parallel and parameterized tests

Usability

  • Clarify what is expected from the user-provided list of observation points in plot_probe.
  • Some improved error messages

Maintainer TODOs

next sub release

next main release

  • MeshSeries: fromdata() constructor -> _init__()

- Python
Published by bilke 8 months ago

ogstools - 0.6.0

OGSTools 0.6.0 Release Notes

OGS version: 6.5.4 (But OGS is from now on optional!)

Python: 3.10 - 3.13

API breaking changes

  • meshseries.probe now squeezes the returned array: it seems more intuitive to return a 1D array if no list of points is provided (just a single tuple)
  • meshseries.plottimeslice has a new user interface - see the update example or the API reference. The interpolate argument was removed, as it tempts you to be used as a default (as it produces a nice image), but in doing so, can easily lead to wrong conclusions as the interpolated image might differ significantly from the raw data.
  • generalized meshseries.animate: it is now a freestanding function (plot.animate) and can take any plotting function - see the updated example or the API reference

Features

  • MeshSeries can now be initialized with from_data(meshes, timevalues)
  • MeshSeries now has an .items() iterator
  • MeshSeries has now an .extend function to combine 2 MeshSeries (e.g. for simulation restart/continuation)
  • plot.line now automatically sorts the data
  • User can select format when saving animation (gif or mp4)
  • variables.vector add BHE vector with support for slicing its components
  • Variables now have methods to create Variables related to absolute error, relative error and analytical solution corresponding to the parent Variable
  • Variable.transform now also works on MeshSeries
  • plot.line now can also handle MeshSeries - this allows to draw an array of lines in one call (e.g. lines for each pt in the MeshSeries over time or lines for each timestep over a spatial coordinate)
  • plot.contourf now only returns a figure if it wasn't given one as an argument
  • improved axis labelling for shared axes (only the outer axes should get labelled now)
  • new: meshseries.resample to interpolate the meshseries to new timevalues
  • new: extract_probe to create a new meshseries consisting only of points and probed data at these points
  • OGSBINPATH is read, this allows to specify a location of a custom OGS (ogs wheel not needed)
  • Improved errors and warnings when system has multiple or no OGS on PATH
  • ogstools.status(verbose=True) prints status of OGS installation

Infrastructure

Tests

  • Tests can be marked as system and tools
    • system tests: Invoke running a simulation with OGS
    • tools tests: Invoke calls to OGS binary tools and pybind11 functionality (in future)
  • Mac Tests added

Imports

  • When imports are actually implementation details, they should be loaded within the calling function (delayed initialization). Applied to imports that rely on OGS installation.

- Python
Published by bilke 12 months ago

ogstools - 0.5.0

OGSTools 0.5.0 Release Notes

  • Recommended OGS Version: 6.5.4

API breaking changes

  • MeshSeries.data --> MeshSeries.values
  • MeshSeries.clear --> MeshSeries.clear_cache
  • In aggregate functions func str is replaced by callables (e.g. numpy.min)
  • meshlib.gmshmeshing.remeshwithtriangle --> meshlib.gmshmeshing.remeshwithtriangles
  • msh2vtu python interface was replaced with meshesfromgmsh
    • CLI tool msh2vtu is not affected by this
    • parameter keep_ids was removed (in our OGS world there is no reason to keep the gmsh data names and the wrong data types in the meshes, which would happen if k was used)
    • parameter log_level was changed to log (True or False)
  • removed:
    • MeshSeries.spatialdataunit/spatialoutputunit/time_unit (see MeshSeries.scale())
    • plot.linesample/linesample_contourf
    • meshlib.dataprocessing.interppoints/distanceinprofile/sample_polyline (see updated line sample example)

Bugfixes

  • Failed sub library imports led to incomplete and unhandled package import
  • MeshSeries was unable to handle xdmf with just one timestep correctly
  • MeshSeries kept the hdf5 file handle open - parallel read access was not possible
  • OMPNUMTHREADS was not working on Windows
  • Feflow mesh did not allow mixed celltypes
  • plot functions had sometimes different color schemes in the color bar
  • Tortuosity was not a medium property
  • BHE mesh (z coordinate negative)

Features

  • MeshSeries gets copy() method.
  • MeshSeries gets transform() method, that applies an arbitrary transformation function to all time steps.
  • MeshSeries get extract() method to select points or cells via ids
  • MeshSeries can be sliced to get new MeshSeries with the selected subset of timesteps
  • MeshSeries gets a modify function that applies arbitrary function to all timestep - meshes.
  • MeshSeries gets a save function (only for pvd implemented yet)
  • difference() between two meshes is now possible even with different topologies
  • Project write_input, path can be specified
  • MeshSeries gets scale() method to scale spatially or temporally
  • variables.get_preset will now return a Variable corresponding to the spatial coordinates if given "x", "y" or "z"
  • plot module gets line() function as a general purpose 1D plotting function
  • plot.setup get spatialunit and timeunit which are used for labeling

Infrastructure

  • Python 3.13 support (CI testing)
  • Testing of all supported Python version 3.10-3.13 (pip and conda)
  • Testing with pinned dependencies in regression tests and with open dependencies in maintenance tests
  • msh2vtu - complete overhaul

Examples

  • All examples use import ogstools as ot. To not be confused with ogs python bindings

Footnotes

  • All related Merge requests are tagged with 0.5.0 Release https://gitlab.opengeosys.org/ogs/tools/ogstools/-/mergerequests?scope=all&state=merged&milestonetitle=0.5.0%20Release

- Python
Published by bilke about 1 year ago

ogstools - 0.4.0

OGSTools 0.4.0 Release Notes

Overview

Supports Python: 3.10, 3.11, 3.12.

First release after integration of ogs6py. The state of ogs6py corresponds to the functionality of v.403 of ogs6py (only light API changes, see Features/Project file)

OGS

OpenGeoSys version: 6.5.3

Migration strategy from ogs6py to ogstools

The recommended strategy is:

  • Back up your environment with pip freeze > yourfile.txt
  • Upgrade ogs6py to 0.403 first and resolve issues (see breaking changes).
  • Uninstall ogs6py and install ogstools
  • Remove import ogs6py. Add import ogstools as ogs. The former OGS becomes Project and function parameters of OGS.__init__() are now with lower case names. See example in Features

API changes

plot

  • renamed meshplotlib to plot
  • renamed plot function to contourf
  • renamed setup.pmin -> setup.vmin, setup.pmax -> setup.vmax
  • added several setup options available as kwargs

variables

  • renamed propertylib to variables (to align with OpenGeoSys vocabulary)
  • presets are now directly accessible as variables
  • renamed presets to properties
  • renamed Property class to Variable

meshlib

  • renamed aggregate function to time_aggregate
  • renamed MeshSeries.read to MeshSeries.mesh

Features

ogs6py

  • new version with significant parts of the codebase rewritten. Changes visible to the user:

example

before:

```python import ogstools as ogs

prj = ogs.Project(inputfile="mechanics.prj", outputfile="oldparameteradd.prj") prj.addblock( blocktag="parameter", parentxpath="./parameters", taglist=["name", "type", "value"], textlist=["density", "Constant", "1900"], ) prj.write_input() ```

now:

```python import ogstools as ogs

prj = ogs.Project(inputfile="mechanics.prj", outputfile="newparameteradd.prj") prj.parameters.addparameter(name="density", type="Constant", value="1900") prj.writeinput() ```

  • support for combining replacement- and build-method commands
  • breaking changes: some methods renamed closer to project file tags:

  • add_process_variable() split-up into add_secondary_variable() and add_process_variable()

  • geo.add_geom() -> geometry.add_geometry(), timeloop -> time_loop etc.

  • support for more MPL properties

  • several bugfixes and tiny new features

  • integration into ogstools

plot

  • Time slice plots can be created easily: filled contour plots of transient data along a sampling line (example)

time_slice

  • Variables now have default symbols (e.g. used for labels in plots)

Mesh and MeshSeries

  • Mesh can be created from a shapefile

mesh = ogs.Mesh.read(test_shapefile)

```python import ogstools as ogs

ms = ogs.MeshSeries("filepath/filenamepvdorxdmf") ms.data("darcyvelocity")[-2:, 1:4, :] # shape is(2, 3, 2) result_mesh = ms[-1] for mesh in ms: print(mesh) ```

  • Added function argument to Meshseries.animate functions has more flexible parameter that allow
    1. transformation of the mesh and
    2. customization of the plot
  • Meshseries has domain_aggregate function (e.g. min/max of a variable per time step)

Project files

  • ogs6py added (this version corresponds to https://github.com/joergbuchwald/ogs6py/releases/tag/v.403)
  • OGS class is renamed to Project
  • Function parameters are with now lower case letters
  • project_file is now output_file

Documentation, examples and more

  • Documentation got new structure of examples (now all organized under ogstools/examples/)
  • pip requirements.txt files (of tested environment) are added for stable test environment reproduction (To be used by developers. Do not use it in your projects!)

Bugfixes

  • Several small fixes in plotting functions (visual)
  • MeshSeries closes file handle to h5 file after reading is finished
  • Dependency compatibility (e.g., remove restriction to matplotlib and relaxing requirements)

- Python
Published by bilke over 1 year ago

ogstools - 0.3.1

Overview

0.3.1 is a maintenance release (mainly bug fixes and refactorings)

Supports Python: 3.9, 3.10,3.11, 3.12.

This is the last release with support of Python 3.9!

OGS

Updated to 6.5.2.

Feflow converter

  • Conversion of component transport models with multiple components now possible
  • automatic creation of OGS-6 project file template,
  • bulk and boundary meshes, and
  • calculation of retardation factor from sorption coefficient.
  • detailed description for the example on the website.

CT_feflow_converter.png

Mesh: Borehole Heat Exchanger

  • Bug fixes in layer computation
  • Allow BHE begin at z=0 (Bug fix)
  • Support multiple BHE begin depths

Function to sample properties along a user-defined polyline.

  • It accepts polylines instead of simple lines and list of properties defined using Property-type.

Changes: * introduces sampleoverpolyline function to meshlib * adds two related plots into meshplotlib * in propertylib, Scalars get default color and linestyle properties that can be used in for plotting

[meshlib] timevalue of min or max over timeseries

  • This feature enables the visualization of when a minimum or maximum of a property happens at any point in a mesh.
  • It uses the existing MeshSeries.aggregate function which can now be called with two additional "func" arguments: "mintime" and "maxtime".

Refactorings

  • Moved examples data to one dedicated folder

Bugfixes

  • Meshplotlib: The streamlines in a slice of a 3D mesh are now corrected. This was due to 1) some wrong logic and 2) some floating point error when creating a Rectilineargrid to sample the values on.

- Python
Published by bilke over 1 year ago

ogstools - 0.3.0

OGSTools 0.3.0 Release Notes

Library

feflowlib got:

  • OGS compatible conversion of 2D meshes.
  • Conversion of hydro-thermal FEFLOW models.
  • Bug fix - removed bulk_node and element_ids after assignment.
  • Extended feflowlib to be able to convert user data from FEFLOW files. User data in the FEFLOW data can store data that are not necessary for the FEFLOW simulation.

logparser got:

  • Added to OGSTools with extended documentation.

meshlib got:

  • Function to compute differences of meshes.
    • The difference function from meshlib will now return one-to-one, pair-wise, or matrix difference depending on what input the user provides.
  • Introduction of functionality to probe points on MeshSeries.
  • Function to aggregate all timesteps in a MeshSeries given an aggregation function.

meshplotlib got:

  • Functionality and documentation for (mechanical) stress analyses.
  • Both, Custom figure and axes objects, can now be passed to plot function.
  • Examples are added for:
    • Custom figure axes.
    • XY labels with shared axes (Adding or not adding labels can be handled semi-automatically based on whether axes are shared).
    • Differences of meshes.
    • Limit plots.
  • Progress bars: for animation and convergence study evolution evaluation.
  • Label in format "property name / property unit" can be obtained from Property.
  • Small fix to how setting aspect ratio is handled.
  • Enable use of external fig and ax in plot functions and plotting different variables within one figure.
  • Reworked aspect ratios (with examples).
  • Interactive PyVista examples.

msh2vtu got:

  • A cleaner Python interface without the need to run argparse in between.
  • A modification for msh2vtu to allow to convert BHE meshes.

Infrastructure & Development

  • Use latest release of OGS ogstools.opengeosys.org: 6.5.1.
  • Code quality report added.
  • Various changes for building OGSTools with GNU Guix.

breaking API-Changes

  • from 0.2.0 to 0.3.0

msh2vtu

  • rename parameter
  • argument defaults are now the same for both CLI and python interface

msh2vtu( rdcd --> reindex (Default changed from True to False) ogs --> keep_ids (Reverse meaning, new default of False is the same as ogs=True before)

propertylib

  • rename function

Property(__Call__ --> transform )

- Python
Published by bilke almost 2 years ago

ogstools - 0.2.0

OGSTools 0.2.0 Release Notes

Library

studies a new package that provides utility functions to compose studies from multiple simulation runs. For now it contains functions to perform convergence studies on simulation results (with increasing spatial/temporal discretization) for specific timesteps or over all timesteps.

msh2vtu got a cleaner python interface without the need to run argparse in between.

feflowlib has been updated with new functionalities. In particular, material properties can now be taken into account when converting and creating OGS models. In addition, feflowlib now uses ogs6py to create prj files. With these changes the conversion of FEFLOW models for steady state diffusion and liquid flow processes can generate a complete prj-file for OGS simulations.

Tools

feflow2ogs-tool now enables simulation-ready prj-files for steady state diffusion and liquid flow processes.

Infrastructure & Development

Web documentation for releases is now available on ogstools.opengeosys.org. Documentation for previous releases will be available in the future and can be selected with a version dropdown in the navigation bar.

- Python
Published by bilke almost 2 years ago

ogstools - 0.1.0

OGSTools 0.1.0 Release Notes

The second release of the ogstools-package brings lots of new library functionality for e.g. plotting and mesh generation as well as a new tool for converting FEFLOW meshes! A full-featured prebuilt Docker image is provided.

Library

feflowlib is a new package for accessing FEFLOW easily in pyvista.

meshlib is a new package for efficient mesh generation from surfaces. It can be used to create meshes from {ref}PyVista surfaces <sphx_glr_auto_examples_howto_meshlib_plot_meshlib_pyvista_input.py> and from {ref}.vtu surface files <sphx_glr_auto_examples_howto_meshlib_plot_meshlib_vtu_input.py>.


meshplotlib is a new package to visualize {ref}2D <sphx_glr_auto_examples_howto_meshplotlib_plot_meshplotlib_2d.py> and {ref}3D <sphx_glr_auto_examples_howto_meshplotlib_plot_meshplotlib_3d.py> mesh data. It also can generate {ref}animations <sphx_glr_auto_examples_howto_meshplotlib_plot_animation.py>:


propertylib is a new package which provides a base class to handle {ref}common mesh properties systematically <sphx_glr_auto_examples_howto_propertylib_plot_propertylib.py> (e.g. temperature, pressure, displacement, ...).


nuclearwasteheat provides an easy way to {ref}calculate the heat generated by nuclear waste repositories <sphx_glr_auto_examples_howto_nuclearwasteheat_plot_nuclearwasteheat.py>.

Tools

The new feflow2ogs-tool converts data stored in FEFLOW binary format to VTK format. It can only be used with a FEFLOW installation.

Infrastructure & Development

Examples on the web page are generated via sphinx_gallery which also allows for downloading the example as an Jupyter Notebook file.

We also added some shortcuts via make for development related tasks such as setting up the development environment, running the tests or creating a live preview of the documentation.

Development can now be done via VSCode's Dev Containers.

- Python
Published by bilke almost 2 years ago

ogstools - 0.0.3

OGSTools 0.0.3 Release Notes

This is the first release of the ogstools-package, a joint effort of OGS users and developers to strengthen the OGS ecosystem!

Tools

msh2vtu

The msh2vtu-tool by Dominik Kern (TU Bergakademie Freiberg) has been integrated into ogstools. For more info see . Its former repository at GitHub dominik-kern/msh2vtu has been deprecated and development continues under the ogstools umbrella.

Infrastructure

Documentation web site

This documentation website has been implemented and is available at https://ogs.ogs.xyz/tools/ogstools.

Unit testing and style checks

A tox-based test driver for unit tests and style checks has been implemented.

- Python
Published by bilke almost 2 years ago