From cdefd715213942a792e54cdb496d82ded01058de Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 24 Oct 2021 11:33:56 +0100 Subject: [PATCH] fieldCoordinateSystemTransform: Updated coordinateSystem construction and documentation Resolves bug-report http://bugs.openfoam.org/view.php?id=3746 --- .../fieldCoordinateSystemTransform.C | 2 +- .../fieldCoordinateSystemTransform.H | 5 +- .../fieldCoordinateSystemTransformTemplates.C | 54 +------------------ 3 files changed, 7 insertions(+), 54 deletions(-) diff --git a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index 65efd6f0b1..90b1fc0f3a 100644 --- a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -56,7 +56,7 @@ fieldCoordinateSystemTransform : fvMeshFunctionObject(name, runTime, dict), fields_(), - coordSys_(coordinateSystem::New(mesh_, dict.subDict("coordinateSystem"))()) + coordSys_(coordinateSystem::New(mesh_, dict)()) { read(dict); diff --git a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index e4dafcd312..bcfe2cefd4 100644 --- a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H +++ b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H @@ -35,7 +35,9 @@ Description { type fieldCoordinateSystemTransform; libs ("libfieldFunctionObjects.so"); - ... + + writeControl writeTime; + fields ( U @@ -45,6 +47,7 @@ Description coordinateSystem { + type cartesian; origin (0.001 0 0); coordinateRotation { diff --git a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C index 5204f7dc79..350ad3a2dd 100644 --- a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C +++ b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C @@ -57,9 +57,7 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::transform if (mesh_.foundObject(fieldName)) { - DebugInfo - << type() << ": Field " << fieldName << " already in database" - << endl; + DebugInfo << type() << ": Field " << fieldName << endl; transformField ( @@ -68,61 +66,13 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::transform } else if (mesh_.foundObject(fieldName)) { - DebugInfo - << type() << ": Field " << fieldName << " already in database" - << endl; + DebugInfo << type() << ": Field " << fieldName << endl; transformField ( mesh_.lookupObject(fieldName) ); } - else - { - typeIOobject fieldHeader - ( - fieldName, - mesh_.time().timeName(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE - ); - - if (fieldHeader.headerOk()) - { - DebugInfo - << type() << ": Field " << fieldName << " read from file" - << endl; - - transformField - ( - mesh_.lookupObject(fieldName) - ); - } - else - { - typeIOobject fieldHeader - ( - fieldName, - mesh_.time().timeName(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE - ); - - if (fieldHeader.headerOk()) - { - DebugInfo - << type() << ": Field " << fieldName << " read from file" - << endl; - - transformField - ( - mesh_.lookupObject(fieldName) - ); - } - } - } }