mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: added an optional argument to the constructor of patchWave
This provides a list of faces (can be internal ones) to act as additional seeds for the wave algorithm. The default argument provides an empty list, so the behaviour of patchWave should not change. Useful in topology optimisation, for propagating the active design variables from the seed faces to the interior, with a given number of cells at a time.
This commit is contained in:
committed by
Andrew Heather
parent
59bf69b92e
commit
2b2c78309c
@ -66,6 +66,20 @@ void Foam::patchWave::setChangedFaces
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const label facei : sourceIDs_)
|
||||
{
|
||||
changedFaces[nChangedFaces] = facei;
|
||||
|
||||
faceDist[nChangedFaces] =
|
||||
wallPoint
|
||||
(
|
||||
mesh.faceCentres()[facei],
|
||||
0.0
|
||||
);
|
||||
|
||||
nChangedFaces++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +151,8 @@ Foam::patchWave::patchWave
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelHashSet& patchIDs,
|
||||
const bool correctWalls
|
||||
const bool correctWalls,
|
||||
const labelList& sourceIDs
|
||||
)
|
||||
:
|
||||
cellDistFuncs(mesh),
|
||||
@ -145,7 +160,8 @@ Foam::patchWave::patchWave
|
||||
correctWalls_(correctWalls),
|
||||
nUnset_(0),
|
||||
distance_(mesh.nCells()),
|
||||
patchDistance_(mesh.boundaryMesh().size())
|
||||
patchDistance_(mesh.boundaryMesh().size()),
|
||||
sourceIDs_(sourceIDs)
|
||||
{
|
||||
patchWave::correct();
|
||||
}
|
||||
@ -163,7 +179,7 @@ void Foam::patchWave::correct()
|
||||
{
|
||||
// Set initial changed faces: set wallPoint for wall faces to wall centre
|
||||
|
||||
label nPatch = sumPatchSize(patchIDs_);
|
||||
label nPatch = sumPatchSize(patchIDs_) + sourceIDs_.size();
|
||||
|
||||
List<wallPoint> faceDist(nPatch);
|
||||
labelList changedFaces(nPatch);
|
||||
|
||||
Reference in New Issue
Block a user