mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: symmetryPlane: inherit normal
This commit is contained in:
@ -42,17 +42,20 @@ namespace Foam
|
|||||||
|
|
||||||
void Foam::symmetryPlanePolyPatch::calcGeometry(PstreamBuffers&)
|
void Foam::symmetryPlanePolyPatch::calcGeometry(PstreamBuffers&)
|
||||||
{
|
{
|
||||||
if (returnReduce(size(), sumOp<label>()) == 0)
|
if (n_ == vector::rootMax)
|
||||||
{
|
{
|
||||||
// No faces in patch. Avoid gAverage complaining and set
|
if (returnReduce(size(), sumOp<label>()))
|
||||||
// normal to nonsense value to catch any use
|
|
||||||
n_ = vector::rootMax;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
const vectorField& nf(faceNormals());
|
const vectorField& nf(faceNormals());
|
||||||
n_ = gAverage(nf);
|
n_ = gAverage(nf);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "Patch " << name() << " calculated average normal "
|
||||||
|
<< n_ << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check the symmetry plane is planar
|
// Check the symmetry plane is planar
|
||||||
forAll(nf, facei)
|
forAll(nf, facei)
|
||||||
{
|
{
|
||||||
@ -61,6 +64,11 @@ void Foam::symmetryPlanePolyPatch::calcGeometry(PstreamBuffers&)
|
|||||||
FatalErrorIn("symmetryPlanePolyPatch::n()")
|
FatalErrorIn("symmetryPlanePolyPatch::n()")
|
||||||
<< "Symmetry plane '" << name() << "' is not planar."
|
<< "Symmetry plane '" << name() << "' is not planar."
|
||||||
<< endl
|
<< endl
|
||||||
|
<< "At local face at "
|
||||||
|
<< primitivePatch::faceCentres()[facei]
|
||||||
|
<< " the normal " << nf[facei]
|
||||||
|
<< " differs from the average normal " << n_
|
||||||
|
<< " by " << magSqr(n_ - nf[facei]) << endl
|
||||||
<< "Either split the patch into planar parts"
|
<< "Either split the patch into planar parts"
|
||||||
<< " or use the " << symmetryPolyPatch::typeName
|
<< " or use the " << symmetryPolyPatch::typeName
|
||||||
<< " patch type"
|
<< " patch type"
|
||||||
@ -69,6 +77,7 @@ void Foam::symmetryPlanePolyPatch::calcGeometry(PstreamBuffers&)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
|
||||||
@ -109,7 +118,7 @@ Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
polyPatch(pp, bm),
|
polyPatch(pp, bm),
|
||||||
n_(vector::rootMax)
|
n_(pp.n_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -123,7 +132,7 @@ Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
polyPatch(pp, bm, index, newSize, newStart),
|
polyPatch(pp, bm, index, newSize, newStart),
|
||||||
n_(vector::rootMax)
|
n_(pp.n_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -137,7 +146,7 @@ Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
polyPatch(pp, bm, index, mapAddressing, newStart),
|
polyPatch(pp, bm, index, mapAddressing, newStart),
|
||||||
n_(vector::rootMax)
|
n_(pp.n_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user