From c716ff78be0775f8cc1c82982d8d381aaf8a3f4b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 24 Nov 2020 15:06:17 +0000 Subject: [PATCH] viewFactorsGen: Added test for transforming patches and issue an error --- .../preProcessing/viewFactorsGen/shootRays.H | 4 ++-- .../viewFactorsGen/viewFactorsGen.C | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/applications/utilities/preProcessing/viewFactorsGen/shootRays.H b/applications/utilities/preProcessing/viewFactorsGen/shootRays.H index f1dd9d5597..c2cdae3ac3 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/shootRays.H +++ b/applications/utilities/preProcessing/viewFactorsGen/shootRays.H @@ -47,7 +47,7 @@ for (label proci = 0; proci < Pstream::nProcs(); proci++) const vector& remA = remoteArea[j]; const label& remAgg = remoteAgg[j]; - const vector& d = remFc - fc; + const vector d(remFc - fc); if (((d & fA) < 0.) && ((d & remA) > 0)) { @@ -138,7 +138,7 @@ for (label proci = 0; proci < Pstream::nProcs(); proci++) { const vector& endP = end[rayID]; const vector& startP = hitInfo[hitIndex].hitPoint(); - const vector& d = endP - startP; + const vector d(endP - startP); startHitItself.append(startP + 0.01*d); endHitItself.append(startP + 1.01*d); diff --git a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C index 27de66c7be..335fa31068 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C +++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,18 +39,16 @@ Description #include "argList.H" #include "Time.H" -#include "fvMesh.H" #include "singleCellFvMesh.H" #include "volFields.H" #include "surfaceFields.H" #include "fixedValueFvPatchFields.H" #include "distributedTriSurfaceMesh.H" #include "cyclicAMIPolyPatch.H" -#include "mapDistribute.H" +#include "wedgePolyPatch.H" #include "meshTools.H" #include "uindirectPrimitivePatch.H" #include "DynamicField.H" -#include "scalarMatrices.H" #include "scalarListIOList.H" using namespace Foam; @@ -251,6 +249,20 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createNamedMesh.H" + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchi) + { + const polyPatch& pp = patches[patchi]; + if (isA(pp) || isA(pp)) + { + FatalErrorIn(args.executable()) << args.executable() + << " does not currently support transforming patches, " + "cyclic and wedge." + << exit(FatalError); + } + } + // Read view factor dictionary IOdictionary viewFactorDict ( @@ -333,7 +345,6 @@ int main(int argc, char *argv[]) label nCoarseFaces = 0; // total number of coarse faces label nFineFaces = 0; // total number of fine faces - const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh(); labelList viewFactorsPatches(patches.size());