Skip to content

1325 translate physical names from gmsh meshes to porepy tags #1392

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

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

pschultzendorff
Copy link
Contributor

Proposed changes

Writing this on my phone, apologies for anything I miss and any name errors.

This PR introduces functionality to translate physical names from ‘’.msh’’ files to tags in the sense of ‘’pp.Grid.tags’’. This allows, e.g., to easily recreate the geometry of SPE11 by loading the grid and assigning permeability and porosity based on tags.

Porepy offers functionality to import from ‘.msh’ files via ‘’pp.fracs.fracture_importer. dfm_from_gmsh’’. At some point in the process, ‘’pp.fracs.msh_2_grid.create_nd_grids’’ is called to create nd subdomain grids.

We introduce a helper function ‘’tag_grids’’ which takes the information available to ‘’create_nd_grids’’ and the created subdomain grid and updates ‘‘grid.tags’’ accordingly. The function is called by every ‘’create_nd_grids’’ at the very end.

So far done:

  • Write ‘’tag_grids’’
  • Include ‘’tag_grids’’ in ‘’create_nd_grids’’
  • Write a test for ‘’tag_grids’’
  • Write tests for ‘’create_nd_grids’’. These test only the tagging

ToDo:

  • Pass the correct input to ‘’create_nd_grids’’. The way we try to do this is by meshing with ‘’fracture_network.mesh’’ and reading the created file. However this does not include physical names nor does it assign any physical names to mesh entities (vertices, lines, triangles, tetrahedra). The way we planned to do this is to loop through the file and add the correct lines manually. This is quite challenging. Possibly this whole approach has to be changed.

Hope this gives a good overview, let us know if you need more info

Types of changes

  • Minor change (e.g., dependency bumps, broken links).
  • Bugfix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Testing (contribution related to testing of existing or new functionality).
  • Documentation (contribution related to adding, improving, or fixing documentation).
  • Maintenance (e.g., improve logic and performance, remove obsolete code).
  • Other:

Checklist

  • The documentation is up-to-date.
  • Static typing is included in the update.
  • This PR does not duplicate existing functionality.
  • The update is covered by the test suite (including tests added in the PR).
  • If new skipped tests have been introduced in this PR, pytest was run with the --run-skipped flag.

@keileg
Copy link
Contributor

keileg commented Apr 14, 2025

Thanks for the effort, @pschultzendorff @zhangyh0713. I will have a go at improving the tests now.

keileg added 3 commits April 14, 2025 10:29
No need to try to generate a 3d mesh for 2d domains
Not really working, but upload it in the hope we can do better later
@keileg
Copy link
Contributor

keileg commented Apr 14, 2025

I tried a different take on adding physical groups to mesh entities compared to the one outlined in the tests (the suggestion there was to alter the generated mesh, I tried to work with gmsh prior to grid construction. However, I could not make things work, and have some vague ideas about how.

Most important is that I realized it is not clear to me what we want to achieve: a) Control the physical names of grid entities in the existing PorePy framework (this is potentially dangerous, since mesh construction depends on hard coded physical names etc.), b) Define new grid entities and physical groups, and use these to define facies and similar.

To be continued.

@IvarStefansson IvarStefansson marked this pull request as draft April 16, 2025 09:22
@keileg
Copy link
Contributor

keileg commented Apr 25, 2025

@pschultzendorff I think the two of us need to discuss the scope of this project before making the final push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Translate physical names from Gmsh meshes to PorePy tags.
4 participants