This page shows the minimial example of a mock script for use in developing coupled simulations.

The recommended strategy for coupled development is to adapt this script tp match the send and receive arrays in the MD code. This can then be used to plot outputs, inject dummy values and develop tests to ensure the coupled application behaves as expected.

from mpi4py import MPI
from cplpy import CPL

comm = MPI.COMM_WORLD
CPL = CPL()
CFD_COMM = CPL.init(CPL.CFD_REALM)
CPL.setup_cfd(CFD_COMM.Create_cart([1, 1, 1]), xyzL=[1.0, 1.0, 1.0], 
              xyz_orig=[0.0, 0.0, 0.0], ncxyz=[32, 32, 32])
recv_array, send_array = CPL.get_arrays(recv_size=3, send_size=3)

for time in range(101):

    CPL.send(send_array)
    recv_array, ierr = CPL.recv(recv_array)


CPL.finalize()
MPI.Finalize()