viewFactorsGen: Added test for transforming patches and issue an error

This commit is contained in:
Henry Weller
2020-11-24 15:06:17 +00:00
parent 528a04244f
commit c716ff78be
2 changed files with 18 additions and 7 deletions

View File

@ -47,7 +47,7 @@ for (label proci = 0; proci < Pstream::nProcs(); proci++)
const vector& remA = remoteArea[j]; const vector& remA = remoteArea[j];
const label& remAgg = remoteAgg[j]; const label& remAgg = remoteAgg[j];
const vector& d = remFc - fc; const vector d(remFc - fc);
if (((d & fA) < 0.) && ((d & remA) > 0)) 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& endP = end[rayID];
const vector& startP = hitInfo[hitIndex].hitPoint(); const vector& startP = hitInfo[hitIndex].hitPoint();
const vector& d = endP - startP; const vector d(endP - startP);
startHitItself.append(startP + 0.01*d); startHitItself.append(startP + 0.01*d);
endHitItself.append(startP + 1.01*d); endHitItself.append(startP + 1.01*d);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,18 +39,16 @@ Description
#include "argList.H" #include "argList.H"
#include "Time.H" #include "Time.H"
#include "fvMesh.H"
#include "singleCellFvMesh.H" #include "singleCellFvMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "distributedTriSurfaceMesh.H" #include "distributedTriSurfaceMesh.H"
#include "cyclicAMIPolyPatch.H" #include "cyclicAMIPolyPatch.H"
#include "mapDistribute.H" #include "wedgePolyPatch.H"
#include "meshTools.H" #include "meshTools.H"
#include "uindirectPrimitivePatch.H" #include "uindirectPrimitivePatch.H"
#include "DynamicField.H" #include "DynamicField.H"
#include "scalarMatrices.H"
#include "scalarListIOList.H" #include "scalarListIOList.H"
using namespace Foam; using namespace Foam;
@ -251,6 +249,20 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createNamedMesh.H" #include "createNamedMesh.H"
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchi];
if (isA<cyclicTransform>(pp) || isA<wedgePolyPatch>(pp))
{
FatalErrorIn(args.executable()) << args.executable()
<< " does not currently support transforming patches, "
"cyclic and wedge."
<< exit(FatalError);
}
}
// Read view factor dictionary // Read view factor dictionary
IOdictionary viewFactorDict IOdictionary viewFactorDict
( (
@ -333,7 +345,6 @@ int main(int argc, char *argv[])
label nCoarseFaces = 0; // total number of coarse faces label nCoarseFaces = 0; // total number of coarse faces
label nFineFaces = 0; // total number of fine faces label nFineFaces = 0; // total number of fine faces
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh(); const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh();
labelList viewFactorsPatches(patches.size()); labelList viewFactorsPatches(patches.size());