mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: wrong numbering when determining the zoneIDs
of the STL written by topology optimisation. BUG: when determining which mesh faces are cut by iso-surface faces, only append the latter if it contains more than two points
This commit is contained in:
committed by
Andrew Heather
parent
e5d5e7b0be
commit
1f7fb08060
@ -141,8 +141,7 @@ bool Foam::topOVariablesBase::addCuttingFaceToIsoline
|
|||||||
{
|
{
|
||||||
// Check whether any of points of the new iso-surface face are already
|
// Check whether any of points of the new iso-surface face are already
|
||||||
// present in the surface. To reduce the number of comparisons, only
|
// present in the surface. To reduce the number of comparisons, only
|
||||||
// points on iso-surface faces belonging to neighbouring cells are
|
// points on iso-surface faces cutting the current cell are checked
|
||||||
// checked
|
|
||||||
labelList uniquePointIDs(facePoints.size(), -1);
|
labelList uniquePointIDs(facePoints.size(), -1);
|
||||||
DynamicList<point> uniqueFacePoints(facePoints.size());
|
DynamicList<point> uniqueFacePoints(facePoints.size());
|
||||||
DynamicList<label> uniqueFacePointEdges(facePoints.size());
|
DynamicList<label> uniqueFacePointEdges(facePoints.size());
|
||||||
@ -362,8 +361,8 @@ void Foam::topOVariablesBase::writeSurfaceFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Faces passed in previous zones
|
// Faces passed in previous zones
|
||||||
labelList cumulZoneSizes(surfZoneIds.size(), 0);
|
labelList cumulZoneSizes(nSerialPatches + 1, 0);
|
||||||
for (label zi = 1; zi < surfZoneIds.size() - 1; ++zi)
|
for (label zi = 1; zi < cumulZoneSizes.size(); ++zi)
|
||||||
{
|
{
|
||||||
cumulZoneSizes[zi] = cumulZoneSizes[zi - 1] + zoneSizes[zi - 1];
|
cumulZoneSizes[zi] = cumulZoneSizes[zi - 1] + zoneSizes[zi - 1];
|
||||||
}
|
}
|
||||||
@ -426,8 +425,6 @@ void Foam::topOVariablesBase::writeSurfaceFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::topOVariablesBase::topOVariablesBase
|
Foam::topOVariablesBase::topOVariablesBase
|
||||||
@ -453,7 +450,7 @@ Foam::topOVariablesBase::topOVariablesBase
|
|||||||
isoSurfFolder_
|
isoSurfFolder_
|
||||||
(mesh.time().globalPath()/"optimisation"/"topOIsoSurfaces"),
|
(mesh.time().globalPath()/"optimisation"/"topOIsoSurfaces"),
|
||||||
meshFaceToChangedFace_(),
|
meshFaceToChangedFace_(),
|
||||||
changedFacesPerCuttingFace_(),
|
//changedFacesPerCuttingFace_(),
|
||||||
surfPoints_(),
|
surfPoints_(),
|
||||||
surfFaces_()
|
surfFaces_()
|
||||||
{
|
{
|
||||||
@ -615,6 +612,8 @@ void Foam::topOVariablesBase::writeFluidSolidInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
addCuttingFaceToIsoline
|
addCuttingFaceToIsoline
|
||||||
(
|
(
|
||||||
cutCell.facePoints(),
|
cutCell.facePoints(),
|
||||||
@ -624,8 +623,9 @@ void Foam::topOVariablesBase::writeFluidSolidInterface
|
|||||||
isoSurfPts,
|
isoSurfPts,
|
||||||
isoSurfFaces,
|
isoSurfFaces,
|
||||||
zoneIDs
|
zoneIDs
|
||||||
);
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
for (const label facei : cellCutFaces)
|
for (const label facei : cellCutFaces)
|
||||||
{
|
{
|
||||||
cuttingFacesPerMeshFace[facei].push_back
|
cuttingFacesPerMeshFace[facei].push_back
|
||||||
@ -635,6 +635,7 @@ void Foam::topOVariablesBase::writeFluidSolidInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add boundary faces on the initial domain with a positive values on all
|
// Add boundary faces on the initial domain with a positive values on all
|
||||||
// points to the zero iso-surface
|
// points to the zero iso-surface
|
||||||
@ -664,8 +665,8 @@ void Foam::topOVariablesBase::writeFluidSolidInterface
|
|||||||
writeSurfaceFiles(surfPoints_, surfFaces_, zoneIds, nSerialPatches);
|
writeSurfaceFiles(surfPoints_, surfFaces_, zoneIds, nSerialPatches);
|
||||||
|
|
||||||
// Invert changedFace-to-cuttingFace map for the sensitivity computations
|
// Invert changedFace-to-cuttingFace map for the sensitivity computations
|
||||||
changedFacesPerCuttingFace_ =
|
//changedFacesPerCuttingFace_ =
|
||||||
invertOneToMany(surfFaces_.size(), changedFaceToCutFace);
|
// invertOneToMany(surfFaces_.size(), changedFaceToCutFace);
|
||||||
|
|
||||||
// Transform origin cut faces to a global numbering
|
// Transform origin cut faces to a global numbering
|
||||||
labelList cuttingFacesPerProc(Pstream::nProcs(), Zero);
|
labelList cuttingFacesPerProc(Pstream::nProcs(), Zero);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ protected:
|
|||||||
Map<label> meshFaceToChangedFace_;
|
Map<label> meshFaceToChangedFace_;
|
||||||
|
|
||||||
//- Per cutting face, the changed faces owned by it
|
//- Per cutting face, the changed faces owned by it
|
||||||
labelListList changedFacesPerCuttingFace_;
|
//labelListList changedFacesPerCuttingFace_;
|
||||||
|
|
||||||
//- Iso-surface points
|
//- Iso-surface points
|
||||||
pointField surfPoints_;
|
pointField surfPoints_;
|
||||||
@ -208,10 +208,10 @@ public:
|
|||||||
return zones_.getBetaMax();
|
return zones_.getBetaMax();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const labelListList& changedFacesPerCuttingFace() const
|
//inline const labelListList& changedFacesPerCuttingFace() const
|
||||||
{
|
//{
|
||||||
return changedFacesPerCuttingFace_;
|
// return changedFacesPerCuttingFace_;
|
||||||
}
|
//}
|
||||||
|
|
||||||
inline const pointField& surfacePoints() const
|
inline const pointField& surfacePoints() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user