viewFactorsGen/shootRays: Allow the specification of maxDynListLength in viewFactorsDict

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1501
This commit is contained in:
Henry
2015-01-27 10:49:23 +00:00
parent 4f4b2e9112
commit 597343dfc7

View File

@ -1,8 +1,11 @@
// All rays expressed as start face (local) index end end face (global) // All rays expressed as start face (local) index end end face (global)
// Pre-size by assuming a certain percentage is visible. // Pre-size by assuming a certain percentage is visible.
// Maximum lenght for dynamicList // Maximum length for dynamicList
const label maxDynListLength = 100000; const label maxDynListLength
(
viewFactorDict.lookupOrDefault<label>("maxDynListLength", 100000)
);
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label procI = 0; procI < Pstream::nProcs(); procI++)
{ {
@ -36,7 +39,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
const vector& fA = myArea[i]; const vector& fA = myArea[i];
const label& fAgg = myAgg[i]; const label& fAgg = myAgg[i];
for (; j < remoteFc.size(); j++)// for (; j < remoteFc.size(); j++)
{ {
if (procI != Pstream::myProcNo() || i != j) if (procI != Pstream::myProcNo() || i != j)
{ {
@ -75,7 +78,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
} }
} }
}while (returnReduce(i < myFc.size(), orOp<bool>())); } while (returnReduce(i < myFc.size(), orOp<bool>()));
List<pointIndexHit> hitInfo(startIndex.size()); List<pointIndexHit> hitInfo(startIndex.size());
surfacesMesh.findLine(start, end, hitInfo); surfacesMesh.findLine(start, end, hitInfo);
@ -88,7 +91,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
// Collect the rays which has not abstacle in bettween in rayStartFace // Collect the rays which has not abstacle in bettween in rayStartFace
// and rayEndFace. If the ray hit itself get stored in dRayIs // and rayEndFace. If the ray hit itself get stored in dRayIs
forAll (hitInfo, rayI) forAll(hitInfo, rayI)
{ {
if (!hitInfo[rayI].hit()) if (!hitInfo[rayI].hit())
{ {
@ -117,7 +120,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
labelField rayIs; labelField rayIs;
rayIs.transfer(dRayIs); rayIs.transfer(dRayIs);
dRayIs.clear(); dRayIs.clear();
forAll (rayIs, rayI) forAll(rayIs, rayI)
{ {
const label rayID = rayIs[rayI]; const label rayID = rayIs[rayI];
label hitIndex = -1; label hitIndex = -1;
@ -166,7 +169,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
firstLoop = false; firstLoop = false;
iter ++; iter ++;
}while (returnReduce(hitInfo.size(), orOp<bool>()) > 0 && iter < 10); } while (returnReduce(hitInfo.size(), orOp<bool>()) > 0 && iter < 10);
startIndex.clear(); startIndex.clear();
end.clear(); end.clear();