mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: searchableSurfaceCollection: calculation of bounds, transformation of normal
This commit is contained in:
@ -247,6 +247,35 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection
|
|||||||
transform_.setSize(surfI);
|
transform_.setSize(surfI);
|
||||||
subGeom_.setSize(surfI);
|
subGeom_.setSize(surfI);
|
||||||
indexOffset_.setSize(surfI+1);
|
indexOffset_.setSize(surfI+1);
|
||||||
|
|
||||||
|
// Bounds is the overall bounds
|
||||||
|
bounds() = boundBox(point::max, point::min);
|
||||||
|
|
||||||
|
forAll(subGeom_, surfI)
|
||||||
|
{
|
||||||
|
const boundBox& surfBb = subGeom_[surfI].bounds();
|
||||||
|
|
||||||
|
// Transform back to global coordinate sys.
|
||||||
|
const point surfBbMin = transform_[surfI].globalPosition
|
||||||
|
(
|
||||||
|
cmptMultiply
|
||||||
|
(
|
||||||
|
surfBb.min(),
|
||||||
|
scale_[surfI]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const point surfBbMax = transform_[surfI].globalPosition
|
||||||
|
(
|
||||||
|
cmptMultiply
|
||||||
|
(
|
||||||
|
surfBb.max(),
|
||||||
|
scale_[surfI]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
bounds().min() = min(bounds().min(), surfBbMin);
|
||||||
|
bounds().max() = max(bounds().max(), surfBbMax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -579,6 +608,9 @@ void Foam::searchableSurfaceCollection::getNormal
|
|||||||
vectorField surfNormal;
|
vectorField surfNormal;
|
||||||
subGeom_[surfI].getNormal(surfInfo[surfI], surfNormal);
|
subGeom_[surfI].getNormal(surfInfo[surfI], surfNormal);
|
||||||
|
|
||||||
|
// Transform back to global coordinate sys.
|
||||||
|
surfNormal = transform_[surfI].globalVector(surfNormal);
|
||||||
|
|
||||||
const labelList& map = infoMap[surfI];
|
const labelList& map = infoMap[surfI];
|
||||||
forAll(map, i)
|
forAll(map, i)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user