Skip to content

Update preCICE API calls for precice:develop#51

Merged
IshaanDesai merged 32 commits intodevelopfrom
preCICE-v3
Aug 28, 2023
Merged

Update preCICE API calls for precice:develop#51
IshaanDesai merged 32 commits intodevelopfrom
preCICE-v3

Conversation

@erikscheurer
Copy link
Copy Markdown
Contributor

@erikscheurer erikscheurer commented Jun 18, 2023

This PR updates the micro-manager preCICE version to the current API from the python-bindings.

One Problem I am currently facing is requiring initial data. The Micro Manager uses self._participant.get_mesh_vertices_and_ids to get the number of local micro sims. However, now that initialize_data and initialize is just initialize we can't do:

  1. initialize
  2. get_mesh_vertices_and_ids
  3. initialize all micro_sims and get initial data
  4. initialize_data

as we did before.
Related to that problem are probably the changes in the precice-config where some precice-error occured with

       <exchange data="micro-scalar-data" mesh="macro-mesh" from="Micro-Manager" to="Macro-dummy" initialize="yes"/>

but ran fine with initialize="no".

These changes are just adapting the new preCICE API. But it would be interesting to rethink if a hard separation of scalar and vector data is necessary, now that the preCICE API has only one read and write data function.

Also the tests currently fail due to an error in installing the python bindings on the develop container, but I do not see much of a difference in installing the bindings than in the python-bindings tests. The solverdummies run locally with the develop version of precice and the python-bindings.

@IshaanDesai
Copy link
Copy Markdown
Member

IshaanDesai commented Jun 19, 2023

Thanks for already opening the v3 update PR!

As far as I know, the function get_mesh_vertices_and_ids should work before initializing preCICE. So the new order of doing things would be:

  1. Initialize preCICE
  2. Call get_mesh_vertices_and_ids to get the macro vertices
  3. Initialize all micro simulations and get the initial states if the user has provided them.
  4. Check for each data if preCICE requires initial data, using the API function requires_initial_data
  5. If initial data is required, explicitly write the data using write_data

Also the tests currently fail due to an error in installing the python bindings on the develop container

The unit tests fail because we install pyprecice as part of the micro-manager installation, which then pulls v2.5.0.2. We need to manually develop just like you did at the other places. The others failures are a bit weird, will have a look.

@IshaanDesai IshaanDesai self-assigned this Jul 16, 2023
@IshaanDesai IshaanDesai added the breaking change A change will break backwards compatibilty label Jul 16, 2023
@IshaanDesai
Copy link
Copy Markdown
Member

As stated in #54, the Micro Manager can no longer write initial data to preCICE. The initialize() function requirement in the library form of the micro simulations is henceforth dropped.

@IshaanDesai IshaanDesai marked this pull request as ready for review August 11, 2023 21:12
@IshaanDesai IshaanDesai merged commit 13819a9 into develop Aug 28, 2023
@IshaanDesai IshaanDesai deleted the preCICE-v3 branch August 28, 2023 12:33
@IshaanDesai IshaanDesai mentioned this pull request Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change A change will break backwards compatibilty

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants