mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -1094,18 +1094,19 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
|
||||
const bool output
|
||||
)
|
||||
{
|
||||
scalarList wghtSum(wght.size(), 0.0);
|
||||
|
||||
scalar minBound = VGREAT;
|
||||
scalar maxBound = -VGREAT;
|
||||
|
||||
scalar tSum = 0.0;
|
||||
|
||||
// Normalise the weights
|
||||
forAll(wght, faceI)
|
||||
{
|
||||
scalar s = sum(wght[faceI]);
|
||||
wghtSum[faceI] = s;
|
||||
|
||||
scalar t = s/patchAreas[faceI];
|
||||
|
||||
tSum += t;
|
||||
|
||||
if (t < minBound)
|
||||
{
|
||||
minBound = t;
|
||||
@ -1122,11 +1123,16 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (output)
|
||||
{
|
||||
Info<< "AMI: Patch " << patchName << " weights min/max = "
|
||||
const label nFace = returnReduce(wght.size(), sumOp<scalar>());
|
||||
reduce(tSum, sumOp<scalar>());
|
||||
|
||||
Info<< "AMI: Patch " << patchName << " weights min/max/average = "
|
||||
<< returnReduce(minBound, minOp<scalar>()) << ", "
|
||||
<< returnReduce(maxBound, maxOp<scalar>()) << endl;
|
||||
<< returnReduce(maxBound, maxOp<scalar>()) << ", "
|
||||
<< tSum/nFace << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2011,7 +2017,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
|
||||
const tmp<Field<Type> >& tFld
|
||||
) const
|
||||
{
|
||||
return interpolateToSource(tFld, sumOp<Type>());
|
||||
return interpolateToSource(tFld(), sumOp<Type>());
|
||||
}
|
||||
|
||||
|
||||
@ -2035,7 +2041,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
|
||||
const tmp<Field<Type> >& tFld
|
||||
) const
|
||||
{
|
||||
return interpolateToTarget(tFld, sumOp<Type>());
|
||||
return interpolateToTarget(tFld(), sumOp<Type>());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
const scalar len
|
||||
)
|
||||
{
|
||||
const scalar matchTol = 1e-4;
|
||||
const scalar matchTol = 1e-6;
|
||||
|
||||
// distance to cutting plane
|
||||
FixedList<scalar, 3> d;
|
||||
@ -78,7 +78,8 @@ void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
(
|
||||
(nPos == 3)
|
||||
|| ((nPos == 2) && (nCoPlanar == 1))
|
||||
|| ((nPos == 1) && (nCoPlanar == 2)))
|
||||
|| ((nPos == 1) && (nCoPlanar == 2))
|
||||
)
|
||||
{
|
||||
/*
|
||||
/\ _____
|
||||
@ -95,14 +96,16 @@ void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
else if ((nPos == 2) && (nCoPlanar == 0))
|
||||
{
|
||||
/*
|
||||
________
|
||||
\ /
|
||||
--\----/--
|
||||
\ /
|
||||
\/
|
||||
i1________i2
|
||||
\ /
|
||||
--\----/--
|
||||
\ /
|
||||
\/
|
||||
i0
|
||||
|
||||
2 points above plane, 1 below
|
||||
- resulting quad above plane split into 2 triangles
|
||||
- forget triangle below plane
|
||||
*/
|
||||
|
||||
// point under the plane
|
||||
@ -129,13 +132,16 @@ void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
if (nCoPlanar == 0)
|
||||
{
|
||||
/*
|
||||
/\
|
||||
/ \
|
||||
--/----\--
|
||||
/______\
|
||||
i0
|
||||
/\
|
||||
/ \
|
||||
--/----\--
|
||||
/______\
|
||||
i2 i1
|
||||
|
||||
1 point above plane, 2 below
|
||||
- keep triangle avove intersection plane
|
||||
- keep triangle above intersection plane
|
||||
- forget quad below plane
|
||||
*/
|
||||
|
||||
// indices of remaining points
|
||||
@ -143,24 +149,23 @@ void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
label i2 = d.fcIndex(i1);
|
||||
|
||||
// determine the two intersection points
|
||||
point p01 = planeIntersection(d, tri, i0, i1);
|
||||
point p02 = planeIntersection(d, tri, i0, i2);
|
||||
point p01 = planeIntersection(d, tri, i1, i0);
|
||||
point p02 = planeIntersection(d, tri, i2, i0);
|
||||
|
||||
// forget quad below plane
|
||||
// - add triangle above plane to list
|
||||
// add triangle above plane to list
|
||||
setTriPoints(tri[i0], p01, p02, nTris, tris);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
|
||||
i0
|
||||
|\
|
||||
| \
|
||||
__|__\__
|
||||
__|__\_i2_
|
||||
| /
|
||||
| /
|
||||
|/
|
||||
|
||||
i1
|
||||
|
||||
1 point above plane, 1 on plane, 1 below
|
||||
- keep triangle above intersection plane
|
||||
@ -171,9 +176,9 @@ void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
label i2 = copI;
|
||||
|
||||
// determine the intersection point
|
||||
point p01 = planeIntersection(d, tri, i0, i1);
|
||||
point p01 = planeIntersection(d, tri, i1, i0);
|
||||
|
||||
// add triangle above plane to list
|
||||
// add triangle above plane to list - clockwise points
|
||||
if (d.fcIndex(i0) == i1)
|
||||
{
|
||||
setTriPoints(tri[i0], p01, tri[i2], nTris, tris);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
|
||||
|
||||
Reference in New Issue
Block a user