Hello Erik,
I cannot say that I have much experience with the FileReader.
From the error message you are getting, you seem to be using the PUGH driver, is this correct?
This error is triggered in repos/cactuspughio/IOHDF5Util/src/RecoverVar.c when there is no Cactus variable of that name. Looking at the code in there it seems that it takes the name of the dataset in the file (which is IDBRILLMOL::phi since that is the name of the thorn writing it) an then looks for a Cactus variable of that name. It then (with a warning "Ignoring dataset 'IDBRILLMOL::phi'") skips this dataset.
Looking at the code in IOHDF5Util (and PUGHIOHDF5) it seems to me as if PUGH does not support the "alias" setting (CarpetIOHDF5 does).
To make this work you can either (I think) rename the dataset in the hdf5 file to have the expected name (eg using h5py) or extend RecoverVar.c with something like this (untested!):
--8<-- #ifdef IOUTIL_IOGH_HAS_ALIAS for(vindex = 0 ; vindex < CCTK_NumVars() ; vindex++) { if(ioUtilGH->alias && ioUtilGH->alias[vindex] && CCTK_EQUALS(ioUtilGH->alias[vindex], fullname)) { free(fullname); fullname = strdup(ioUtilGH->alias[vindex]); break; // leaves vindex at correct value } } if(vindex == CCTK_NumVars()) // did not find anything #endif // old code continues below /* check if there is a matching variable */ vindex = CCTK_VarIndex (fullname); --8<--
which more or less mimics what Carpet does in repos/carpet/CarpetIOHDF5/src/Input.cc
Yours, Roland
Thank you!, the method that you give me to stop the evolution, works perfectly. However, there is an error, I can't read the output data as initial data for my Brill wave evolution.
My thorn IDBrillMoL evolves the conformal factor (which I named phi because the initial data is obtained through a wave-like equation), and when the criteria is reached, it stops the evolution and saves a checkpoint with that iteration. For the evolution I wrote a thorn named BrillEvolve and I assigned memory to a variable named "brillpsi" which will store the initial conformal factor. When I read the data (checkpoint) I got the error: No matching variable found for 'IDBRILLMOL::phi'
According to the readingfile interface, I can read a variable and set in a different variable with the option alias, so, I try
IO::filereader_ID_vars = "BrillEvolve::brillpsi{alias='IDBRILLMOL::phi'}"
but I got the error above described. Can you help me with this? Am I misunderstanding how the readingfile interface works?
Erik
El lun., 14 oct. 2019 a las 9:44, Haas, Roland (rhaas@illinois.edu) escribió:
Hello Erik,
as to how to decide to stop: the simplest way would be to compute a pointwise stopping criterion (maybe magnitude of the right-hand-side or so) then do a reduction on it using the CCTK_Reduce function (assuming you are using Carpet), see eg. the code in Hydro_Analysis to compute the center of mass:
https://bitbucket.org/einsteintoolkit/einsteinanalysis/src/master/Hydro_Anal...
the function itself is documented here:
https://www.einsteintoolkit.org/usersguide/UsersGuidech9.html#verbatim-63
Once you have decided to stop, terminate the simulation by calling CCTK_TerminateNext ( https://www.einsteintoolkit.org/referencemanual/ReferenceManualch2.html#x4-1... ) making sure to have enabled the option to write a checkpoint when terminating (io::checkpoint_on_terminate = yes).
You can read data from the checkpoint as initial data using the filereader interface
https://www.einsteintoolkit.org/thornguide/CactusBase/IOUtil/documentation.h...
and if you need to change grid structure, you can use the ReadInterpolate thorn (https://github.com/rhaas80/ReadInterpolate/tree/master/ReadInterpolate), which is however a bit more complex to use.
If you need to change data in between what was checkpointed and what needs to be evolved you will have to add routines to the INITIAL bin after IOUtil_RecoverIDFromDatafiles (see IOUtil's schedule.ccl).
Hope this helps getting you started.
Yours, Roland
Dear all
I'm trying to construct Brill wave initial data by transforming the elliptic pde equation for the conformal factor in to a wave-like equation with a source. After reaching a stationary state, I want to stop the evolution and give the stationary state as an initial data for the BSSN system.
I'm evolving the wave-like equation with MoL and my question is, How can
I
stop the MoL evolution if the solution reaches the numerical tolerance
and
then pass it as initial data?
Erik
-- My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from http://pgp.mit.edu .