Hello everybody,
i am using output->write_dump(update->ntimestep) in an own code but it is not working. The same command is used from PRD and TAD. When debugging the loop within the write_dump function is ignored because ndump = 0 but how does it work then from PRD and TAD ?
Best regards
Betim
Hello everybody,
i am using output->write_dump(update->ntimestep) in an own code but it is not working. The same command is used from PRD and TAD. When debugging the loop within the write_dump function is ignored because ndump = 0 but how does it work then from PRD and TAD ?
if ndump == 0, then you have not defined any dumps
axel.
Hello Axel,
thank you for the response. in PRD command there is no dump defined too :
if (output->ndump && universe->iworld == 0) {
timer->barrier_start();
modify->addstep_compute_all(update->ntimestep);
update->integrate->setup_minimal(1);
// must reset whichflag so that computes won’t fail.
update->whichflag = 1;
output->write_dump(update->ntimestep);
update->whichflag = 0;
timer->barrier_stop();
time_output += timer->get_wall(Timer::TOTAL);
}
Am i missing something here ?
Best regards
Yes, the code makes perfect sense. There is no point in considering updating dump files, when there have been no dump commands and thus there are no dumps defined.
Axel.
How to define a dump and dump only when i call the write_dump function ? Do i have to just use the dump command in my input script and use nevery == 1 ?
Best regards
This does not work. Setting outpu->ndump to 1 within my code does not work either. I dont understand how it is done in PRD since this function is used only for TAD and PRD.
How to define a dump and dump only when i call the write_dump function ?
you are looking in the completely wrong place for that. the functionality you are looking at is for updating existing output (including dumps).
if you don’t want regular output plus on special occasions you will have to create and manage your own dump class instance.
like how it is done by the write_dump script command.
Do i have to just use the dump command in my input script and use nevery == 1 ?
if you don’t want regular output, you would have to set nevery to a very large number.
axel.
it will do what it is supposed to do and what is explained in the docs/comments. I’d rather not comment any further as your approach to programming and modifying code makes my head hurt.
Hello Axel,
i solved it. Setting the nevery to a large number solves my issue. Thank you and sorry for that it is the first code in c++ for me.
Regards
in my experience the attitude toward programming is independent from the programming language.
i am learning by doing and it is the first time i try to modify lammps so i have to look into other codes and try to optimize them until i get the wanted result.