mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated oriented flag for backwards compatibility
This commit is contained in:
@ -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())
|
||||
|
||||
Reference in New Issue
Block a user