Commit 7ac88c13 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Updated oriented flag for backwards compatibility

parent 2355f1aa
......@@ -37,7 +37,15 @@ void Foam::DimensionedField<Type, GeoMesh>::readField
)
{
dimensions_.reset(dimensionSet(fieldDict.lookup("dimensions")));
oriented_.read(fieldDict);
// Note: oriented state may have already been set on construction
// - if so - do not reset by re-reading
// - required for backwards compatibility in case of restarting from
// an old run where the oriented state may not have been set
if (oriented_.oriented() != orientedType::ORIENTED)
{
oriented_.read(fieldDict);
}
Field<Type> f(fieldDictEntry, fieldDict, GeoMesh::size(mesh_));
this->transfer(f);
......
......@@ -169,6 +169,11 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readOldTimeIfPresent()
this->mesh()
);
// Ensure the old time field oriented flag is set to the parent's state
// Note: required for backwards compatibility in case of restarting from
// an old run where the oriented state may not have been set
field0Ptr_->oriented() = this->oriented();
field0Ptr_->timeIndex_ = timeIndex_ - 1;
if (!field0Ptr_->readOldTimeIfPresent())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment