Initialize data when using direct access to received mesh?

Hi,

I am interested in having Participant B not provide any mesh but instead just have direct access to Participant A’s mesh, but I also want Participant B to write initial data to Participant A. Is this possible?

The documentation states that, in the context of coupling data:

All data is initialized to 0 by default. If you configure preCICE to provide custom initial data, then participants need to provide this data before calling initialize(). After you defined the meshes, use requiresInitialData() to check if initial data is required. Then use writeData() to specify your initial data and continue to initialize().

However, in order to use writeData() prior to initialize(), Participant B needs the vertex IDs and coordinates of Participant A’s mesh, which it seems that it cannot have access to until after calling initialize(), as stated here.

Is this possible at all presently? Thank you for any assistance.

The problem you describe is exactly the reasons why this is not possible anymore. This was a direct consequence of the API simplification between preCICE v2 and preCICE v3.

If possible, the initial shape of the coupling data should be encoded by participant A. For serial coupling schemes, you could also let participant B start, then participant A will read the data from the first time step when executed for the first time.
If that’s still not sufficient or zero data is a problem, you could consider having the first solver time-step with zero data or skip the first solve execution in your solver.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.