Operation to READ_IF_PRESENT field
Hello World.
What happens to an operation like Code:
volVectorField us = fvc::interpolate(U) Will this operation cause an error or will it just be skipped if the field is not present?! |
READ_IF_PRESENT just means that the field will be read from disk if it is available,
otherwise it will be set to the value given in the constructor. |
....
Hi
[READ_IF_PRESENT just means that the field will be read from disk if it is available, otherwise it will be set to the value given in the constructor. ] What do you mean the value given in the constructor? |
Code:
volScalarField hTotal if the file hTotal exists, the value will be read from that file. Otherwise it will use the values from 'h+h0' |
Hi Niklas
Thanks for your reply. I have another problem, that by now I've couldn't solve that! I'm solving an equiation with a source term, like: ddt2(p)-laplacian(p)=q (source term is q) I calculate source term from another solver every 1e-5 second and bring all of them in time directories in this solver. The time interval of this solver is 1e-8 and I want that this solver reads every q whenever it reachs its time. For example at first it reads q in 0 directory and work with that, but when it reachs 1e-5 q should be read and changed and so on....... Do you know how should I define q to be read like this?!? Thank you Mohammadreza |
You read q at start so that volScalarField exists already, then you place the code below
just before the equation you want to solve Code:
IOobject qHeader |
Hi Niklas
Thank you so much for your reply...with a little modification it worked properly. Mohammadreza |
All times are GMT -4. The time now is 21:00. |