zoomy_core.symsolver.precice_adapter

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

Module Contents#

Classes#

PreciceAdapter

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 (one mpiexec per participant).

Functions#

overlap_participant

The overlap of a Schwarz-coupled participant (cfg: adapter, tag, overlap layers): sets the adapter’s vertices (mirror cells written, overlap cells read, at their centres) and returns (overlap, mirror) (zoomy_core.mesh.overlap.overlap_layers).

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 (one mpiexec per participant).

References

Initialization

Open participant name from config on mesh mesh_name, writing the data write and reading read.

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 vertices write (the mirror cells’ centres, (n, >= dim)) and read (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 advance completed 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, overlap layers): sets the adapter’s vertices (mirror cells written, overlap cells read, at their centres) and returns (overlap, mirror) (zoomy_core.mesh.overlap.overlap_layers).