From 37707b361b5a5787e2c75990ae81fb632a9851c9 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Thu, 6 Feb 2020 10:47:26 +0100 Subject: [PATCH] DEFEATURE: remove -cellZone subsetting from foamToEnsight - preliminary to adding multiple cellZones support (#1579) STYLE: align some foamToEnsight, foamToEnsightParts routines --- .../foamToEnsight/convertLagrangian.H | 9 +--- .../foamToEnsight/convertVolumeFields.H | 21 ++------ .../foamToEnsight/foamToEnsight.C | 52 +++++++------------ .../dataConversion/foamToEnsight/readFields.H | 29 +++++++---- .../foamToEnsight/writeDimFields.H | 27 ++++------ .../foamToEnsight/writeVolFields.H | 36 ++++++------- .../foamToEnsightParts/checkMeshMoving.H | 15 +++--- .../foamToEnsightParts/convertLagrangian.H | 8 +-- .../foamToEnsightParts/convertVolumeFields.H | 19 ++----- .../foamToEnsightParts/foamToEnsightParts.C | 38 ++++++-------- .../foamToEnsightParts/readFields.H | 22 ++++---- .../foamToEnsightParts/writeDimFields.H | 9 ++-- .../foamToEnsightParts/writeVolFields.H | 6 +-- 13 files changed, 118 insertions(+), 173 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H index b0478d844c4..9500ee60703 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertLagrangian.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,12 +48,7 @@ if (doLagrangian) Info<< "Write " << cloudName << " ("; const bool cloudExists = - returnReduce - ( - currentCloudDirs.found(cloudName), - orOp<bool>() - ); - + returnReduce(currentCloudDirs.found(cloudName), orOp<bool>()); { autoPtr<ensightFile> os = ensCase.newCloud(cloudName); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertVolumeFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertVolumeFields.H index 5490eec6d7a..f2d775a8042 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertVolumeFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/convertVolumeFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,23 +35,8 @@ Description { Info<< "Write volume field ("; - writeAllVolFields - ( - ensCase, - ensMesh, - meshProxy, - objects, - nodeValues - ); - - writeAllDimFields - ( - ensCase, - ensMesh, - meshProxy, - objects, - nodeValues - ); + writeAllVolFields(ensCase, ensMesh, objects); + writeAllDimFields(ensCase, ensMesh, objects); Info<< " )" << nl; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index c440c358252..552b0b62a85 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,6 +93,7 @@ Note #include "HashOps.H" #include "fvc.H" +#include "fvMesh.H" #include "fieldTypes.H" #include "volFields.H" #include "scalarIOField.H" @@ -104,7 +105,6 @@ Note #include "ensightMesh.H" #include "ensightOutputCloud.H" #include "ensightOutputVolField.H" -#include "fvMeshSubsetProxy.H" // local files #include "readFields.H" @@ -115,16 +115,6 @@ Note using namespace Foam; -//- Get internal field and make it a zero-gradient volume field with subsetting -template<class GeoField> -tmp<GeoField> -getZeroGradInternalField(IOobject& io, const fvMeshSubsetProxy& proxy) -{ - auto tfield = tmp<typename GeoField::Internal>::New(io, proxy.baseMesh()); - return proxy.interpolateInternal(tfield); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) @@ -192,12 +182,20 @@ int main(int argc, char *argv[]) "Specify single or multiple fields to write (all by default)\n" "Eg, 'T' or '( \"U.*\" )'" ); +#if 0 argList::addOption ( - "cellZone", - "word", - "Specify cellZone to write" + "cellZones", + "wordRes", + "Specify single or multiple cellZones to write\n" + "Eg, 'cells' or '( slice \"mfp-.*\" )'.", + true // mark as an advanced option ); + argList::addOptionCompat("cellZone", {"cellZones", 1912}); +#else + argList::ignoreOptionCompat({"cellZones", 1912}, true); // has argument +#endif + argList::addOption ( "name", @@ -221,8 +219,6 @@ int main(int argc, char *argv[]) : IOstream::BINARY ); - const bool nodeValues = args.found("nodeValues"); - cpuTime timer; memInfo mem; Info<< "Initial memory " << mem.update().size() << " kB" << endl; @@ -286,22 +282,11 @@ int main(int argc, char *argv[]) wordRes fieldPatterns; args.readListIfPresent<wordRe>("fields", fieldPatterns); - word cellZoneName; - if (args.readIfPresent("cellZone", cellZoneName)) - { - Info<< "Converting cellZone " << cellZoneName - << " only, with new outside faces as \"oldInternalFaces\"." - << nl; - } - - // Ignored (unproxied) if cellZoneName is empty - fvMeshSubsetProxy meshProxy(mesh, fvMeshSubsetProxy::ZONE, cellZoneName); - // New ensight case file, initialize header etc. ensightCase ensCase(outputDir, args.globalCaseName(), caseOpts); - // Construct the Ensight mesh - ensightMesh ensMesh(meshProxy.mesh(), writeOpts); + // Construct ensight mesh + ensightMesh ensMesh(mesh, writeOpts); if (Pstream::master()) { @@ -350,7 +335,7 @@ int main(int argc, char *argv[]) wordList objectNames(objects.sortedNames()); // Check availability for all times... - checkData(meshProxy.baseMesh(), timeDirs, objectNames); + checkData(mesh, timeDirs, objectNames); testedObjectNames = objectNames; } @@ -366,7 +351,6 @@ int main(int argc, char *argv[]) polyMesh::readUpdateState meshState = mesh.readUpdate(); if (meshState != polyMesh::UNCHANGED) { - meshProxy.correct(); ensMesh.expire(); ensMesh.correct(); } @@ -378,7 +362,7 @@ int main(int argc, char *argv[]) } // Objects at this time - IOobjectList objects(meshProxy.baseMesh(), runTime.timeName()); + IOobjectList objects(mesh, runTime.timeName()); // Restrict to objects that are available for all times objects.filterObjects(testedObjectNames); @@ -386,7 +370,7 @@ int main(int argc, char *argv[]) // Volume, internal, point fields #include "convertVolumeFields.H" - // Write lagrangian data + // Lagrangian fields #include "convertLagrangian.H" Info<< "Wrote in " diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/readFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/readFields.H index d51ce30412d..3d79fa6b467 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/readFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/readFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +27,8 @@ InNamespace Foam Description - Read fields from disk for foamToEnsight + Helper routines for reading a field or fields, + for foamToEnsight SourceFiles readFields.C @@ -46,30 +47,36 @@ SourceFiles namespace Foam { -//- Get the field and subset it, or return nullptr +//- Get the field or return nullptr template<class GeoField> -tmp<GeoField> getField(const IOobject* io, const fvMeshSubsetProxy& proxy) +tmp<GeoField> getField +( + const IOobject* io, + const typename GeoField::Mesh& mesh +) { if (io) { - auto tfield = tmp<GeoField>::New(*io, proxy.baseMesh()); - return proxy.interpolate(tfield); + return tmp<GeoField>::New(*io, mesh); } return nullptr; } -//- Get internal field and make it a zero-gradient volume field with subsetting +//- Get internal field and make it a zero-gradient volume field template<class GeoField> tmp<GeoField> -getZeroGradField(const IOobject* io, const fvMeshSubsetProxy& proxy) +getZeroGradField(const IOobject* io, const fvMesh& mesh) { if (io) { - auto tfield = - tmp<typename GeoField::Internal>::New(*io, proxy.baseMesh()); - return proxy.interpolateInternal(tfield); + auto tdimfield = tmp<typename GeoField::Internal>::New(*io, mesh); + + auto tfield = fvMeshSubsetProxy::zeroGradientField(tdimfield()); + tdimfield.clear(); + + return tfield; } return nullptr; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeDimFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeDimFields.H index ae4d9c35506..9e38b2f9d47 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeDimFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeDimFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef writeDimFields_H -#define writeDimFields_H +#ifndef ensight_writeDimFields_H +#define ensight_writeDimFields_H #include "writeVolFields.H" @@ -49,9 +49,7 @@ label writeDimFields ( ensightCase& ensCase, const ensightMesh& ensMesh, - const fvMeshSubsetProxy& proxy, - const IOobjectList& objects, - const bool nodeValues + const IOobjectList& objects ) { typedef GeometricField<Type, fvPatchField, volMesh> GeoField; @@ -63,6 +61,8 @@ label writeDimFields >::Internal DimField; + const fvMesh& mesh = ensMesh.mesh(); + label count = 0; for (const word& fieldName : objects.sortedNames<DimField>()) @@ -75,9 +75,7 @@ label writeDimFields ( ensCase, ensMesh, - proxy, - getZeroGradField<GeoField>(io, proxy), - nodeValues + getZeroGradField<GeoField>(io, mesh) ) ) { @@ -94,19 +92,16 @@ label writeAllDimFields ( ensightCase& ensCase, const ensightMesh& ensMesh, - const fvMeshSubsetProxy& proxy, - const IOobjectList& objects, - const bool nodeValues + const IOobjectList& objects ) { #undef foamToEnsight_WRITE_FIELD #define foamToEnsight_WRITE_FIELD(PrimitiveType) \ writeDimFields<PrimitiveType> \ ( \ - ensCase, ensMesh, \ - proxy, \ - objects, \ - nodeValues \ + ensCase, \ + ensMesh, \ + objects \ ) label count = 0; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeVolFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeVolFields.H index d0b6655c5fe..a5da0ea9da7 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeVolFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/writeVolFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,11 +34,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef writeVolFields_H -#define writeVolFields_H +#ifndef ensight_writeVolFields_H +#define ensight_writeVolFields_H #include "readFields.H" -#include "fvMeshSubsetProxy.H" +#include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,9 +50,7 @@ bool writeVolField ( ensightCase& ensCase, const ensightMesh& ensMesh, - const fvMeshSubsetProxy& proxy, - const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfield, - const bool nodeValues + const tmp<GeometricField<Type, fvPatchField, volMesh>>& tfield ) { if (!tfield.valid()) @@ -62,6 +60,9 @@ bool writeVolField const auto& field = tfield(); + // Forced use of node values? + const bool nodeValues = ensCase.nodeValues(); + autoPtr<ensightFile> os = ensCase.newData<Type>(field.name()); bool wrote = ensightOutput::writeVolField<Type> @@ -82,13 +83,13 @@ label writeVolFields ( ensightCase& ensCase, const ensightMesh& ensMesh, - const fvMeshSubsetProxy& proxy, - const IOobjectList& objects, - const bool nodeValues + const IOobjectList& objects ) { typedef GeometricField<Type, fvPatchField, volMesh> GeoField; + const fvMesh& mesh = ensMesh.mesh(); + label count = 0; for (const word& fieldName : objects.sortedNames<GeoField>()) @@ -99,9 +100,7 @@ label writeVolFields ( ensCase, ensMesh, - proxy, - getField<GeoField>(objects.findObject(fieldName), proxy), - nodeValues + getField<GeoField>(objects.findObject(fieldName), mesh) ) ) { @@ -118,19 +117,16 @@ label writeAllVolFields ( ensightCase& ensCase, const ensightMesh& ensMesh, - const fvMeshSubsetProxy& proxy, - const IOobjectList& objects, - const bool nodeValues + const IOobjectList& objects ) { #undef foamToEnsight_WRITE_FIELD #define foamToEnsight_WRITE_FIELD(PrimitiveType) \ writeVolFields<PrimitiveType> \ ( \ - ensCase, ensMesh, \ - proxy, \ - objects, \ - nodeValues \ + ensCase, \ + ensMesh, \ + objects \ ) label count = 0; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H index 8155d920cbc..4849c951287 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/checkMeshMoving.H @@ -1,5 +1,4 @@ -// check for "points" in all of the result directories -// - could restrict to the selected times +// Check for "points" in any of the result directories bool meshMoving = false; @@ -9,14 +8,17 @@ if (timeDirs.size() > 1 && Pstream::master()) // See if any other "polyMesh/points" files exist too. Info<< "Search for moving mesh ... " << flush; - forAll(timeDirs, timeI) + for (const instant& inst : timeDirs) { + const word& timeName = inst.name(); + meshMoving = ( - IOobject + timeName != mesh.pointsInstance() + && IOobject ( "points", - timeDirs[timeI].name(), + timeName, polyMesh::meshSubDir, mesh, IOobject::NO_READ, @@ -33,8 +35,7 @@ if (timeDirs.size() > 1 && Pstream::master()) if (meshMoving) { - Info<< "found." << nl - << " Writing meshes for every timestep." << endl; + Info<< "found. Writing meshes for every timestep." << endl; } else { diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertLagrangian.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertLagrangian.H index 8eb554150e1..9500ee60703 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertLagrangian.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertLagrangian.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,11 +48,7 @@ if (doLagrangian) Info<< "Write " << cloudName << " ("; const bool cloudExists = - returnReduce - ( - currentCloudDirs.found(cloudName), - orOp<bool>() - ); + returnReduce(currentCloudDirs.found(cloudName), orOp<bool>()); { autoPtr<ensightFile> os = ensCase.newCloud(cloudName); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertVolumeFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertVolumeFields.H index b5f39307ddd..20dd8373ae8 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertVolumeFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/convertVolumeFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,21 +35,8 @@ Description { Info<< "Write volume field ("; - writeAllVolFields - ( - ensCase, - ensParts, - mesh, - objects - ); - - writeAllDimFields - ( - ensCase, - ensParts, - mesh, - objects - ); + writeAllVolFields(ensCase, ensParts, mesh, objects); + writeAllDimFields(ensCase, ensParts, mesh, objects); Info<< " )" << nl; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C index 4b221f34943..9903495d42d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -88,6 +88,7 @@ Note #include "PstreamCombineReduceOps.H" #include "HashOps.H" +#include "fvMesh.H" #include "fieldTypes.H" #include "volFields.H" #include "scalarIOField.H" @@ -99,7 +100,6 @@ Note #include "ensightParts.H" #include "ensightOutputCloud.H" #include "ensightOutputVolField.H" -#include "fvMeshSubsetProxy.H" // local files #include "readFields.H" @@ -215,23 +215,12 @@ int main(int argc, char *argv[]) // Define sub-directory name to use for EnSight data. // The path to the ensight directory is at case level only // - For parallel cases, data only written from master - fileName ensightDir = args.get<word>("name", "Ensight"); - if (!ensightDir.isAbsolute()) + fileName outputDir = args.get<word>("name", "Ensight"); + if (!outputDir.isAbsolute()) { - ensightDir = args.globalPath()/ensightDir; + outputDir = args.globalPath()/outputDir; } - // - // Open new ensight case file, initialize header etc. - // - ensightCase ensCase - ( - ensightDir, - "Ensight", // args.globalCaseName(), - caseOpts - ); - - // // Output configuration // @@ -251,19 +240,26 @@ int main(int argc, char *argv[]) wordRes fieldPatterns; args.readListIfPresent<wordRe>("fields", fieldPatterns); + // New ensight case file, initialize header etc. + ensightCase ensCase + ( + outputDir, + "Ensight", // args.globalCaseName(), + caseOpts + ); - // Construct the list of ensight parts for the entire mesh + // Construct ensight parts for the entire mesh ensightParts ensParts(mesh); // Write summary information if (Pstream::master()) { - Info<< "Converting " << timeDirs.size() << " time steps" << endl; + Info<< "Converting " << timeDirs.size() << " time steps" << nl; OFstream info(ensCase.path()/"partsInfo"); info - << "// summary of ensight parts" << nl << nl; + << "// Summary of ensight parts" << nl << nl; ensParts.writeSummary(info); } @@ -336,7 +332,7 @@ int main(int argc, char *argv[]) if (doGeometry) { autoPtr<ensightGeoFile> os = ensCase.newGeometry(meshMoving); - ensParts.write(os.ref()); + ensParts.write(os); } } @@ -361,7 +357,7 @@ int main(int argc, char *argv[]) Info<< "\nEnd: " << timer.elapsedCpuTime() << " s, " - << mem.update().peak() << " kB (peak)\n" << endl; + << mem.update().peak() << " kB (peak)" << nl << endl; return 0; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/readFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/readFields.H index fe8288bd1fc..22544563fb5 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/readFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/readFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +27,8 @@ InNamespace Foam Description - Read fields from disk for foamToEnsight + Helper routines for reading a field or fields, + for foamToEnsightParts SourceFiles readFields.C @@ -39,7 +40,6 @@ SourceFiles #include "instantList.H" #include "IOobjectList.H" -#include "fvMesh.H" #include "fvMeshSubsetProxy.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,29 +47,31 @@ SourceFiles namespace Foam { -//- Get the field and subset it, or return nullptr +//- Get the field or return nullptr template<class GeoField> -tmp<GeoField> getField(const IOobject* io, const fvMesh& mesh) +tmp<GeoField> getField +( + const IOobject* io, + const typename GeoField::Mesh& mesh +) { if (io) { - auto tfield = tmp<GeoField>::New(*io, mesh); - return tfield; + return tmp<GeoField>::New(*io, mesh); } return nullptr; } -//- Get internal field and make it a zero-gradient volume field with subsetting +//- Get internal field and make it a zero-gradient volume field template<class GeoField> tmp<GeoField> getZeroGradField(const IOobject* io, const fvMesh& mesh) { if (io) { - auto tdimfield = - tmp<typename GeoField::Internal>::New(*io, mesh); + auto tdimfield = tmp<typename GeoField::Internal>::New(*io, mesh); auto tfield = fvMeshSubsetProxy::zeroGradientField(tdimfield()); tdimfield.clear(); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeDimFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeDimFields.H index cc3fa5f7307..06b318474ff 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeDimFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeDimFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef ensightParts_writeDimFields_H -#define ensightParts_writeDimFields_H +#ifndef foamToEnsightParts_writeDimFields_H +#define foamToEnsightParts_writeDimFields_H #include "writeVolFields.H" @@ -100,7 +100,8 @@ label writeAllDimFields #define foamToEnsight_WRITE_FIELD(PrimitiveType) \ writeDimFields<PrimitiveType> \ ( \ - ensCase, ensParts, \ + ensCase, \ + ensParts, \ mesh, \ objects \ ) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeVolFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeVolFields.H index dbad2846351..166408fed45 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeVolFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/writeVolFields.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef writeVolFields_H -#define writeVolFields_H +#ifndef ensightParts_writeVolFields_H +#define ensightParts_writeVolFields_H #include "readFields.H" #include "fvMesh.H" -- GitLab