New location logic - #15
Draft
orlandoisepic wants to merge 40 commits into
Draft
orlandoisepic wants to merge 40 commits into
orlandoisepic wants to merge 40 commits into
Conversation
Create a new enum for location-type and update old references to "patch"
update documentation of topology
Added info about changed topology tags
Extend preprocessing to guard against multiple location-types for the same location and actually implement the check for "unique-exchanges", which the docstring said the method does, but never actually did.
Change all references from "patch" to "location" and added a few comments for clarity.
Consistently use LocationType as entry and not str
Update the `LocationNode` class to suit new needs.
New location logic! This changed mainly the old `_patch_preprocessing()` (now `_initialize_locations()`) and `_initialize_meshes_and_patches()` (now `_initialize_meshes()`). Patch names are not modified in the topology anymore, thus appear in the adapter-config as they were specified. This allows a much cleaner method and removed a lot of unnecessary logic. The patches (now LocationNode) are now mainly used as their object and hold references to all meshes that use/interact with them. Meshes are now split based on type (extensive vs. intensive) and location (surface vs. volume). This includes some logic, although it is implemented in a smarter way than before. The method that passes the location info to the adapter-configs has been modified to include the new LocationNode as well. The new location_type is used as a key in the `mesh_map` which is used in a few other methods; other than that, no changes. This makes the current design a bit lighter and more modular.
Use the renamed method of NodeCreator
Use the new LocationNode object and actually adhere to the precice-adapter-schema 🫣
This was
linked to
issues
Aug 16, 2026
Fix the uniqueness check to include location-names
Remove check for duplicate exchanges. I think this may require some more adjustements and should thus be moved to a different PR
Update test to new topology format
Fix comparison logic
This updates and optimizes the mesh-creation logic. Before, if two participants exchanged intensive and extensive data, always two meshes were used per participant. Now, if the exchanges are in different direction, i.e., extensive in one direction, intensive in the other, the same mesh is used by each participant.
it now uses _ instead of -
Update to avoid weird bug
Change it back. Apparently it was correct all along
Mesh split logic
orlandoisepic
marked this pull request as ready for review
August 17, 2026 13:11
uekerman
reviewed
Aug 19, 2026
uekerman
left a comment
Member
There was a problem hiding this comment.
Had a quick look (only):
- Is there any example with volume coupling already? If not, could be good to add one to also check the "type".
- Probably beyond this PR: We should eventually check all names for consistency with the adapter schema, things like using "-name" or not
to-location-name->to-location-namesand turn into list (same for "from")
Contributor
Author
I added an example plus a test
I agree. Dropping the "-name" would certainly make writing the topology easier and be more consistent with the adapter config.
I will work on it |
orlandoisepic
marked this pull request as draft
August 21, 2026 04:11
Member
agree
don't agree :) Could you please open a separate issue (eventually) where we could collect and compare names? |
update to new adapter-config
Change `from-/to-location-name` → `from-/to-location-names` (note the 's' at the end).
Updaet to allow lists in `from-/to-location-names`. The preprocessing method is now redundant.
Move the preprocessing and validation logic to a new class.
New validation and preprocessing logic.
Update to new reader and processing.
This scenario is not correct anymore. Now it is supposed to cause an error. This error is already checked in "preprocessing/exchange_loop"
Update the description for new tags
Contributor
Author
|
The requested feature
is implemented in #18 and can be merged into this PR. |
Co-authored-by: Benjamin Uekermann <benjamin.uekermann@gmail.com>
Location lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New location logic
This implements the requested changes in #7 and #14 (that have first been proposed in precice/preeco-orga#70).
This means that the topology now uses the tags
from-location-nameandto-location-nameinstead offrom-patchandto-patch, respectively.The new tags
from-location-typeandto-location-typeare introduced and can currently take the valuessurfaceandvolume.These tags are only relevant for the adapter-config.
The precice-config generation is left completely unchanged by this PR.
These changes also affect the generated adapter-config: its entry "location" is now filled out according to the specified location type of the exchanges and patch-names are now used exactly as specified in the topology.
Implementation Details
Unfortunately, there were a lot of changes to be made to the
NodeCreator:(_patch_preprocessing()and_initialize_meshes_and_patches()have been reworked into_initialize_locations()and now_initialize_meshes(). Both methods are now relatively modular and simpler than before.LocationNode(previouslyPatchNode) is now used consistently throughout the entire project. No more storing and manipulating locations (patches) as strings.get_mesh_patch_map()has been renamed toget_mesh_location_map()and now uses the newLocationNodeobjects.location-typeas the meshes key and were thus updated.The TopologyReader has also improved:
check_topology()method now checks against more edge cases and preprocesses it more.The adapter config now uses the
LocationNodeobject to create the entries.