Adding coupling values as IOList in Mesh objectregistry

Hi,

I need to store the value of the coupled data because I need it for further calculation in boundary condition implementation in the PIMPLE loop. So, I was planning that when precice adapter reads this data, I add it as a scalar in IOLIst and add it to the mesh objectregistry. For example,

IOList<scalar> waveg
    (
       IOobject("waveg", 
                      mesh_.time().timeName(),
                      mesh_, IOObject::NO_READ, IOobject::NO_WRITE), 1);
    waveg[0] = g;

However, when I go out of the scope of this function, I do not see this IOList added to the mesh objectregistry. How can I add this list there?

This is an interesting (at least for me), though OpenFOAM-specific question on how to register objects to the objects’ registry.

If I understand correcty (see OpenFOAM Wiki), with IOobject() you can create an object, but it does not register it. Could you please also try with regIOobject and report your findings here?