Skip to content

Restart from a linear combination #644

Answered by joneuhauser
marinamartinf asked this question in Q&A
Discussion options

You must be logged in to vote

On master, you could do:

platform->options.setArgs("RESTART FILE NAME", "input1.fld");
nek::setic();
nek::copyFromNek(curtime);

You now have the data in nrs->U, nrs->p and nrs->cds->S.
Allocate a temporary helper array on the device (platform->device.malloc) where you copy the data to, slice it for U, p, and S.

Repeat with the second field, but this time do nek::ocopyFromNek(curtime), the data is now in the correct target arrays.

Run platform->linalg.axpby to compute the linear combination. The result will be in the device arrays.

On next, you have direct access to the read methods in iofld so you don't have to do the hack with setting the restart filename.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by marinamartinf
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants