Hi, In simpleFoam.C, runTim
In simpleFoam.C, runTime.Write() is used to write results, and simpleFoam p.storePrevIter() is called to store the pressure field of the previous iteration. Because the WOpt_ member in the copy constructor of GeometricField is always set to be NO_Write, and it seems that the write function always export the pressure field for the previous iteration (not p itself), pressue is always missing from the export.
Can someone tell me how to fix the problem or what part of my understanding is wrong?
// construct as copy
template<class> class PatchField, class GeoMesh>
const GeometricField<type,>& gf
Info<<>::GeometricField : "
"constructing as copy"
<<>info() << endl;
field0Ptr_ = new GeometricField<type,>
this->writeOpt() = IOobject::NO_WRITE;
Nice one. Go to OpenFOAM-1
Nice one. Go to
look for the function void Foam::GeometricField<type,>::storePrevIter() const
and in the second part do the following:
this->name() + "_prev",
Hi, Thanks for the workaro
Thanks for the workaround. I did further study into the code and found that "ConstructFromTmp" makes the difference because the following contructor. If ConstructFromTmp is turned on (defined), regIOobject(df) will be used instead of regIOobject(df, true), and the objectRegistry registration will not be transfered to the copy.
My further question is what is the purpose of ConstructFromTmp? It is used at several locations in the code, what different does this switch make?
const DimensionedField<type,>& df
# ifdef ConstructFromTmp
|All times are GMT -4. The time now is 15:53.|