I wrote a Python-API for OGS5 as presented at the user-meeting on 2019-01-11.
You can find it on Github as part of the GeoStat-Framework: https://github.com/GeoStat-Framework/ogs5py
I also wrote a script-generation routine, to convert existing models to an ogs5py-script.
I created a repository where I converted most of the Benchmark-scripts (about 300). You can find it here: https://github.com/GeoStat-Framework/ogs5py_benchmarks
Hey Sebastian,
that’s a nice API and I love the script generator! At the moment there are 165 benchmark tests running after each pull request and not 300 I think. It needs a cleaning up off the list on github to distinguish between recently running and older benchmarks (archiv).
I think the generator is a powerful tool to convince people to use ogs5py. Another nice side effect is, that the benchmarks now appear in a unique format and a key-word check was performed (I found some bugs in the benchmarks because of that).
But I’ve still got some questions:
I ran into the problem, that there are some subkeywords, that can appear multiple times. In the current status of ogs5py this in not easily doable and I have to come up with a handy solution for that situation. Can you give me a list of sub-keywords this applies to?
Is there a common format for the ASC files I could come up with?
A list of the running benchmarks would be nice as you just said.
You mentioned some keywords, where some data is written directly after the keyword. This is not covered by ogs5py yet. Could you provide a list of keys with this property? I just took care of the DDC files, where the number of the subdomain is written (redundantly) after the #DOMAIN keyword.
thanks Sebastian for sharing this project! I had a quick look at your presentation from last week and this looks really cool and useful! I think this would be a really powerful addition and we should think about integration this into the code mainline. Although we thought the current version 5.8 would be the last I already see this in an upcoming version 5.9 …
Ahhh!
I found a bug in my reading routine. Therefore a lot of false-positive results showed up. I took the first key that matched the beginning of the given key… therefore POROSITY_DISTRIBUTION was read as POROSITY and showed up two times afterwards.
I fixed that. will be in Version 0.6.1
I have to think about the $NNEIGHBORS keyword… this one needs special treatment.
ogs5py v0.6.5 released. Have a look at the changelog.
You can update resp. install it via:
pip install -U ogs5py
Bugfixes
gli.add_polyline: Adding polyline by given point IDs was not possible: 3ec23af
Additions
New swap_axis routine in msh and gli: You can now easily swap axis of a mesh. If you have generated a 2D mesh in x-y you can get a x-z cross-section by swapping the y and z axis: 3ec23af
ogs5py v1.0.0 is finally released. There will be a publication about ogs5py in the near future.
You can update resp. install it via:
pip install -U ogs5py
ogs5py benchmarks
Almost all OGS5 Benchmarks were converted to an ogs5py script with the provided script generator. These benchmarks can be seen as a smorgasbord to provide a starting point for your own ogs5py model.
Release Notes
Bugfixes
GLI.add_polyline now allows integer coordinates for points: bf5d684
MSH.centroids are now calculated as center of mass instead of center of element nodes: b0708a6
download_ogs downloads a system dependent OGS5 executable: ede32e4
add_exe add a self compiled OGS5 executable: ede32e4
MSH.import_mesh now allows the import of material_id and element_id if given as cell_data in the external mesh: 00a77fa
MSH.export_mesh now automatically exports material_id (already the case before) and element_id.
Also you can now export additional point_data and field_data : 00a77fa
New method MSH.set_material_id to set the material IDs for specific elements: 4b11c6a
MSH.show now can show additional cell_data: ffd7604
New routine show_vtk to show vtk output with mayavi: f640c19
New method OGS.output_files to get a list of output files: 2f5f102
MSH.import_mesh can handle meshio.Mesh as input now #13
Changes
pygmsh support was removed. You can’t use pygmsh Geometry objects to generate meshes anymore. Please generate beforehand and import the generated mesh. Other generators are using gmsh directly now. #13
1.2.0 - 2022-05-15
Enhancements
move to a pyproject.toml based installation: d5ea756
move from develop/master branches to a single main branch