neko
neko copied to clipboard
Proof of concept for user-created simcomps
This is a proof of concept of how user simcomps can be incorporated into the neko_simcomps
object so that they are executed just like the ordinary ones. As a reminder, the issue is that the simcomp factory cannot know about the new simcomp types, so the init has to happen in the user file. Here I use the user initialization routine to that end, so comments are provided there.
To make this work, I had to make the simcomp array inside the simcomp_exectutor_t
to be larger than the number of simcomps in the JSON file. A better solution is to add a proper add
routine.
I modify the tgv example to demonstrate things, test.f90
is just a copy of the vorticity simcomp with a new type name. The JSON for the user simcomp is added inside a "user_simcomps" array, but of course any configuration can be used, since it is the user code that parses the JSON.
I think this is in principle a pretty ok solution, which could facilitate users to encapsulate things in simcomps. I will put some more thought in how to make this as streamlined as possible.