From d04bb490fc0b52e3bfef8b417b0b7caa71dc2500 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 31 May 2019 15:28:57 +0200 Subject: [PATCH] STYLE: use dictionary checking methods in runTimePostProcessing - make parallelProjection default (was previously mandatory) --- .../fieldVisualisationBase.C | 2 +- .../functionObjectBase.C | 4 +- src/runTimePostProcessing/geometryBase.C | 4 +- src/runTimePostProcessing/geometryPatches.C | 2 +- .../runTimePostProcessing.C | 4 +- src/runTimePostProcessing/scene.C | 52 +++++++++---------- src/runTimePostProcessing/surface.C | 2 +- src/runTimePostProcessing/text.C | 8 +-- 8 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/runTimePostProcessing/fieldVisualisationBase.C b/src/runTimePostProcessing/fieldVisualisationBase.C index 08c3f6a..a23c5e3 100644 --- a/src/runTimePostProcessing/fieldVisualisationBase.C +++ b/src/runTimePostProcessing/fieldVisualisationBase.C @@ -742,7 +742,7 @@ fieldVisualisationBase : colours_(colours), fieldName_(dict.get("field")), - smooth_(dict.lookupOrDefault("smooth", false)), + smooth_(dict.getOrDefault("smooth", false)), colourBy_(cbColour), colourMap_(cmRainbow), range_(), diff --git a/src/runTimePostProcessing/functionObjectBase.C b/src/runTimePostProcessing/functionObjectBase.C index c44fecc..84b3465 100644 --- a/src/runTimePostProcessing/functionObjectBase.C +++ b/src/runTimePostProcessing/functionObjectBase.C @@ -76,8 +76,8 @@ Foam::functionObjects::runTimePostPro::functionObjectBase::functionObjectBase fieldVisualisationBase(dict, colours), state_(state), functionObjectName_(dict.get("functionObject")), - liveObject_(dict.lookupOrDefault("liveObject", true)), - clearObjects_(dict.lookupOrDefault("clearObjects", false)) + liveObject_(dict.getOrDefault("liveObject", true)), + clearObjects_(dict.getOrDefault("clearObjects", false)) {} diff --git a/src/runTimePostProcessing/geometryBase.C b/src/runTimePostProcessing/geometryBase.C index bac6e4f..5842e9a 100644 --- a/src/runTimePostProcessing/geometryBase.C +++ b/src/runTimePostProcessing/geometryBase.C @@ -99,10 +99,10 @@ Foam::functionObjects::runTimePostPro::geometryBase::geometryBase : parent_(parent), name_(dict.dictName()), - visible_(dict.lookupOrDefault("visible", true)), + visible_(dict.getOrDefault("visible", true)), renderMode_ ( - renderModeTypeNames.lookupOrDefault("renderMode", dict, rmGouraud) + renderModeTypeNames.getOrDefault("renderMode", dict, rmGouraud) ), opacity_(nullptr), colours_(colours) diff --git a/src/runTimePostProcessing/geometryPatches.C b/src/runTimePostProcessing/geometryPatches.C index c3e711b..5434695 100644 --- a/src/runTimePostProcessing/geometryPatches.C +++ b/src/runTimePostProcessing/geometryPatches.C @@ -77,7 +77,7 @@ Foam::functionObjects::runTimePostPro::geometryPatches::geometryPatches geometrySurface(parent, dict, colours, List()), fieldVisualisationBase(dict, colours), selectPatches_(), - nearCellValue_(dict.lookupOrDefault("nearCellValue", false)) + nearCellValue_(dict.getOrDefault("nearCellValue", false)) { dict.readEntry("patches", selectPatches_); } diff --git a/src/runTimePostProcessing/runTimePostProcessing.C b/src/runTimePostProcessing/runTimePostProcessing.C index f514b39..fbb9ac5 100644 --- a/src/runTimePostProcessing/runTimePostProcessing.C +++ b/src/runTimePostProcessing/runTimePostProcessing.C @@ -303,7 +303,7 @@ bool Foam::functionObjects::runTimePostProcessing::read(const dictionary& dict) fvMeshFunctionObject::read(dict); #ifdef FOAM_USING_VTK_MPI - parallel_ = (Pstream::parRun() && dict.lookupOrDefault("parallel", true)); + parallel_ = (Pstream::parRun() && dict.getOrDefault("parallel", true)); #else parallel_ = false; #endif @@ -311,7 +311,7 @@ bool Foam::functionObjects::runTimePostProcessing::read(const dictionary& dict) Info<< type() << " " << name() << ": reading post-processing data (" << (parallel_ ? "parallel" : "serial") << " rendering)" << endl; - if (dict.lookupOrDefault("debug", false)) + if (dict.getOrDefault("debug", false)) { runTimePostPro::geometryBase::debug = 1; Info<< " debugging on" << endl; diff --git a/src/runTimePostProcessing/scene.C b/src/runTimePostProcessing/scene.C index edbb43c..30026b9 100644 --- a/src/runTimePostProcessing/scene.C +++ b/src/runTimePostProcessing/scene.C @@ -45,39 +45,35 @@ void Foam::functionObjects::runTimePostPro::scene::readCamera const dictionary& dict ) { - if (dict.readIfPresent("nFrameTotal", nFrameTotal_)) - { - if (nFrameTotal_ < 1) - { - FatalIOErrorInFunction(dict) - << "nFrameTotal must be 1 or greater" - << exit(FatalIOError); - } - } + nFrameTotal_ = dict.getCheckOrDefault