mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH:
Adding reflecting fluxes to Solar load radiation model. Adding functionality to the boundary radiation models and new place holder for basic wall types such as transparent, opaqueDiffusive, opaqueReflective,etc. Changing radiation wall models to run time selectable. Adding multi-band capabilities to VF model and improving the set up for using solar loads in VF and fvDOM radiation models.
This commit is contained in:
@ -3794,7 +3794,7 @@ void Foam::distributedTriSurfaceMesh::getRegion
|
||||
labelList triangleIndex(info.size());
|
||||
autoPtr<mapDistribute> mapPtr
|
||||
(
|
||||
calcLocalQueries
|
||||
localQueries
|
||||
(
|
||||
info,
|
||||
triangleIndex
|
||||
@ -3859,7 +3859,7 @@ void Foam::distributedTriSurfaceMesh::getNormal
|
||||
labelList triangleIndex(info.size());
|
||||
autoPtr<mapDistribute> mapPtr
|
||||
(
|
||||
calcLocalQueries
|
||||
localQueries
|
||||
(
|
||||
info,
|
||||
triangleIndex
|
||||
@ -4261,7 +4261,7 @@ void Foam::distributedTriSurfaceMesh::getField
|
||||
labelList triangleIndex(info.size());
|
||||
autoPtr<mapDistribute> mapPtr
|
||||
(
|
||||
calcLocalQueries
|
||||
localQueries
|
||||
(
|
||||
info,
|
||||
triangleIndex
|
||||
@ -4352,6 +4352,128 @@ Foam::triSurface Foam::distributedTriSurfaceMesh::overlappingSurface
|
||||
}
|
||||
|
||||
|
||||
// Exchanges indices to the processor they come from.
|
||||
// - calculates exchange map
|
||||
// - uses map to calculate local triangle index
|
||||
Foam::autoPtr<Foam::mapDistribute>
|
||||
Foam::distributedTriSurfaceMesh::localQueries
|
||||
(
|
||||
const List<pointIndexHit>& info,
|
||||
labelList& triangleIndex
|
||||
) const
|
||||
{
|
||||
triangleIndex.setSize(info.size());
|
||||
|
||||
const globalIndex& triIndexer = globalTris();
|
||||
|
||||
|
||||
// Determine send map
|
||||
// ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// Since determining which processor the query should go to is
|
||||
// cheap we do a multi-pass algorithm to save some memory temporarily.
|
||||
|
||||
// 1. Count
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
|
||||
forAll(info, i)
|
||||
{
|
||||
if (info[i].hit())
|
||||
{
|
||||
label proci = triIndexer.whichProcID(info[i].index());
|
||||
nSend[proci]++;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Size sendMap
|
||||
labelListList sendMap(Pstream::nProcs());
|
||||
forAll(nSend, proci)
|
||||
{
|
||||
sendMap[proci].setSize(nSend[proci]);
|
||||
nSend[proci] = 0;
|
||||
}
|
||||
|
||||
// 3. Fill sendMap
|
||||
forAll(info, i)
|
||||
{
|
||||
if (info[i].hit())
|
||||
{
|
||||
label proci = triIndexer.whichProcID(info[i].index());
|
||||
triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
|
||||
sendMap[proci][nSend[proci]++] = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
triangleIndex[i] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Send over how many i need to receive
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
labelListList sendSizes(Pstream::nProcs());
|
||||
sendSizes[Pstream::myProcNo()].setSize(Pstream::nProcs());
|
||||
forAll(sendMap, proci)
|
||||
{
|
||||
sendSizes[Pstream::myProcNo()][proci] = sendMap[proci].size();
|
||||
}
|
||||
Pstream::gatherList(sendSizes);
|
||||
Pstream::scatterList(sendSizes);
|
||||
|
||||
|
||||
// Determine receive map
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
labelListList constructMap(Pstream::nProcs());
|
||||
|
||||
// My local segments first
|
||||
constructMap[Pstream::myProcNo()] = identity
|
||||
(
|
||||
sendMap[Pstream::myProcNo()].size()
|
||||
);
|
||||
|
||||
label segmenti = constructMap[Pstream::myProcNo()].size();
|
||||
forAll(constructMap, proci)
|
||||
{
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
// What i need to receive is what other processor is sending to me.
|
||||
label nRecv = sendSizes[proci][Pstream::myProcNo()];
|
||||
constructMap[proci].setSize(nRecv);
|
||||
|
||||
for (label i = 0; i < nRecv; i++)
|
||||
{
|
||||
constructMap[proci][i] = segmenti++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Pack into distribution map
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
autoPtr<mapDistribute> mapPtr
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
segmenti, // size after construction
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
)
|
||||
);
|
||||
const mapDistribute& map = mapPtr();
|
||||
|
||||
|
||||
// Send over queries
|
||||
// ~~~~~~~~~~~~~~~~~
|
||||
|
||||
map.distribute(triangleIndex);
|
||||
|
||||
return mapPtr;
|
||||
}
|
||||
|
||||
|
||||
void Foam::distributedTriSurfaceMesh::distribute
|
||||
(
|
||||
const List<treeBoundBox>& bbs,
|
||||
|
||||
@ -202,6 +202,7 @@ private:
|
||||
|
||||
// Triangle index
|
||||
|
||||
|
||||
//- Helper: convert local triangle indices to global ones
|
||||
void convertTriIndices(List<pointIndexHit>& info) const;
|
||||
|
||||
@ -559,6 +560,17 @@ public:
|
||||
labelList& subFaceMap
|
||||
);
|
||||
|
||||
|
||||
//- Obtains global indices from pointIndexHit and swaps them back
|
||||
// to their original processor. Used to calculate local region
|
||||
// and normal.
|
||||
virtual autoPtr<mapDistribute> localQueries
|
||||
(
|
||||
const List<pointIndexHit>&,
|
||||
labelList& triangleIndex
|
||||
) const;
|
||||
|
||||
|
||||
//- Print some stats. Parallel aware version of
|
||||
// triSurface::writeStats.
|
||||
void writeStats(Ostream& os) const;
|
||||
|
||||
Reference in New Issue
Block a user