zoomy_core.symsolver.precice_adapter#
Host side of a preCICE participant, shared by the Python backends (NumPy, JAX): the preCICE
API calls of the couple_* effects, and the overlap of a Schwarz-coupled participant
(ChorinTemplate.precice_march).
References
Chourdakis et al. 2022, https://doi.org/10.12688/openreseurope.14445.2
Module Contents#
Classes#
Host side of the |
Functions#
The overlap of a Schwarz-coupled participant ( |
API#
- class zoomy_core.symsolver.precice_adapter.PreciceAdapter(name, config, mesh_name, write, read, comm=None)#
Host side of the
couple_*effects: the preCICE API calls only.comm(mpi4py) makes a distributed participant, one preCICE process per rank, so it must span the world (onempiexecper participant).References
Chourdakis et al. 2022, https://doi.org/10.12688/openreseurope.14445.2
Initialization
Open participant
namefromconfigon meshmesh_name, writing the datawriteand readingread.- set_vertices(coords)#
The coupling vertices
(n, >= dim), in the order of the data.
- init(q)#
Write the initial data if required, initialise; returns whether coupling is ongoing.
- max_dt()#
Largest time step left in the window.
- set_overlap_vertices(write, read)#
An overlap participant (
ChorinTemplate.precice_march): the verticeswrite(the mirror cells’ centres,(n, >= dim)) andread(the overlap cells’) of one mesh, in the order of the data; the window may repeat (an implicit scheme), the template restarting it from the window start.iterations: the coupling iterations of each completed window.
- read()#
The read data of the peer at the window start, one row per name.
- read_iterate()#
The peer’s read data of its last coupling iteration (the window end), one row per name.
- repeat()#
Whether preCICE repeats the window of the last
advance(not converged).
- write(q)#
Write
q; returns an empty tuple.
- advance(dt)#
Advance by
dt; returns whether coupling is ongoing.
- window_complete()#
Whether the last
advancecompleted a time window.
- finalize()#
Finalize the participant.
- zoomy_core.symsolver.precice_adapter.overlap_participant(cfg, mesh, n_state)#
The overlap of a Schwarz-coupled participant (
cfg:adapter,tag,overlaplayers): sets the adapter’s vertices (mirror cells written, overlap cells read, at their centres) and returns(overlap, mirror)(zoomy_core.mesh.overlap.overlap_layers).