Snappy hex mesh proximity check

This commit is contained in:
Mattijs Janssens
2019-03-25 16:49:50 +00:00
committed by Andrew Heather
parent a1999bc92c
commit 6c3f2f4df1
30 changed files with 4974 additions and 135 deletions

View File

@ -42,8 +42,6 @@ License
#include "snapParameters.H"
#include "motionSmoother.H"
#include "topoDistanceData.H"
#include "FaceCellWave.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -375,94 +373,6 @@ bool Foam::meshRefinement::isCollapsedCell
}
Foam::labelList Foam::meshRefinement::nearestPatch
(
const labelList& adaptPatchIDs
) const
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
labelList nearestAdaptPatch;
if (adaptPatchIDs.size())
{
nearestAdaptPatch.setSize(mesh_.nFaces(), adaptPatchIDs[0]);
// Count number of faces in adaptPatchIDs
label nFaces = 0;
forAll(adaptPatchIDs, i)
{
const polyPatch& pp = patches[adaptPatchIDs[i]];
nFaces += pp.size();
}
// Field on cells and faces.
List<topoDistanceData> cellData(mesh_.nCells());
List<topoDistanceData> faceData(mesh_.nFaces());
// Start of changes
labelList patchFaces(nFaces);
List<topoDistanceData> patchData(nFaces);
nFaces = 0;
forAll(adaptPatchIDs, i)
{
label patchi = adaptPatchIDs[i];
const polyPatch& pp = patches[patchi];
forAll(pp, i)
{
patchFaces[nFaces] = pp.start()+i;
patchData[nFaces] = topoDistanceData(patchi, 0);
nFaces++;
}
}
// Propagate information inwards
FaceCellWave<topoDistanceData> deltaCalc
(
mesh_,
patchFaces,
patchData,
faceData,
cellData,
mesh_.globalData().nTotalCells()+1
);
// And extract
bool haveWarned = false;
forAll(faceData, facei)
{
if (!faceData[facei].valid(deltaCalc.data()))
{
if (!haveWarned)
{
WarningInFunction
<< "Did not visit some faces, e.g. face " << facei
<< " at " << mesh_.faceCentres()[facei] << endl
<< "Assigning these cells to patch "
<< adaptPatchIDs[0]
<< endl;
haveWarned = true;
}
}
else
{
nearestAdaptPatch[facei] = faceData[facei].data();
}
}
}
else
{
// Use patch 0
nearestAdaptPatch.setSize(mesh_.nFaces(), 0);
}
return nearestAdaptPatch;
}
// Returns list with for every internal face -1 or the patch they should
// be baffled into. Gets run after createBaffles so all the unzoned surface
// intersections have already been turned into baffles. (Note: zoned surfaces