Support to communicate multiple data fields #34
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.
This pull request provides a first realisation of communicating multiple data fields as suggested in #31 and closes #31. The changes also affect the API of the fenicsx-adapter the following way:
create_coupling_expression()
→create_coupling_expression(mesh_name)
read_data(dt)
→read_data(dt, mesh_name)
write_data(write_function)
→write_data(write_function, mesh_name)
initialize(coupling_subdomain, read_function_space=None, write_object=None)
now expects a dictionary with entries of the following structure:mesh_name: [coupling_subdomain, read_function_space, write_object]
Furthermore
fenicsxprecice
has a memberMeshes
which is an enum type and holds members with the same name as specified in the config files, i.e., if one participant defines a mesh calledLeft
and you want to e.g. write values from this mesh, the implementation expects the user to callwrite_data(write_function, fenicsxprecice.Meshes.Left)
. All functions that requiremesh_name
must use fenicsxprecice.Meshes.The structure of the participant config file also changed to support multiple meshes.
I also provided a minimal working example which (hopefully) makes it clear how to use this feature exactly (see
tutorials/multiple-fields
.