GIT: Initial state after latest Foundation merge

This commit is contained in:
Andrew Heather
2016-09-20 14:49:08 +01:00
4571 changed files with 115696 additions and 74609 deletions

View File

@ -316,8 +316,8 @@ bool Foam::edgeIntersections::rotatePerturb
const edge& e = surf1.edges()[edgeI];
// Endpoint to modify. Choose either start or end.
label pointI = e[rndGen.bit()];
//label pointI = e[0];
label pointi = e[rndGen.bit()];
//label pointi = e[0];
// Generate random vector slightly larger than tolerance.
vector rndVec = rndGen.vector01() - vector(0.5, 0.5, 0.5);
@ -335,17 +335,17 @@ bool Foam::edgeIntersections::rotatePerturb
// Scale to be moved by tolerance.
rndVec *= 0.01*magN;
Pout<< "rotating: shifting endpoint " << meshPoints[pointI]
Pout<< "rotating: shifting endpoint " << meshPoints[pointi]
<< " of edge:" << edgeI << " verts:"
<< points1[meshPoints[e[0]]] << ' '
<< points1[meshPoints[e[1]]]
<< " by " << rndVec
<< " tol:" << surf1PointTol[pointI] << endl;
<< " tol:" << surf1PointTol[pointi] << endl;
points1[meshPoints[pointI]] += rndVec;
points1[meshPoints[pointi]] += rndVec;
// Mark edges affected by change to point
const labelList& pEdges = surf1.pointEdges()[pointI];
const labelList& pEdges = surf1.pointEdges()[pointi];
forAll(pEdges, i)
{
@ -391,9 +391,9 @@ bool Foam::edgeIntersections::offsetPerturb
const pointIndexHit& pHit = hits[i];
// Classify point on face of surface2
label surf2FaceI = pHit.index();
label surf2Facei = pHit.index();
const triSurface::FaceType& f2 = surf2.localFaces()[surf2FaceI];
const triSurface::FaceType& f2 = surf2.localFaces()[surf2Facei];
const pointField& surf2Pts = surf2.localPoints();
const point ctr = f2.centre(surf2Pts);
@ -499,9 +499,9 @@ Foam::scalarField Foam::edgeIntersections::minEdgeLength(const triSurface& surf)
scalarField minLen(localPoints.size());
forAll(minLen, pointI)
forAll(minLen, pointi)
{
const labelList& pEdges = pointEdges[pointI];
const labelList& pEdges = pointEdges[pointi];
scalar minDist = GREAT;
@ -510,7 +510,7 @@ Foam::scalarField Foam::edgeIntersections::minEdgeLength(const triSurface& surf)
minDist = min(minDist, edges[pEdges[i]].mag(localPoints));
}
minLen[pointI] = minDist;
minLen[pointi] = minDist;
}
return minLen;
}

View File

@ -52,11 +52,11 @@ bool Foam::surfaceIntersection::excludeEdgeHit
(
const triSurface& surf,
const label edgeI,
const label faceI,
const label facei,
const scalar
)
{
const triSurface::FaceType& f = surf.localFaces()[faceI];
const triSurface::FaceType& f = surf.localFaces()[facei];
const edge& e = surf.edges()[edgeI];
forAll(f, fp)
@ -72,7 +72,7 @@ bool Foam::surfaceIntersection::excludeEdgeHit
// vector eVec = e.vec(surf.localPoints());
// eVec /= mag(eVec) + VSMALL;
//
// const labelList& eLabels = surf.faceEdges()[faceI];
// const labelList& eLabels = surf.faceEdges()[facei];
//
// // Get edge vector of 0th edge of face
// vector e0Vec = surf.edges()[eLabels[0]].vec(surf.localPoints());
@ -97,12 +97,12 @@ bool Foam::surfaceIntersection::excludeEdgeHit
// }
//
// // Check if same as faceNormal
// if (mag(n & surf.faceNormals()[faceI]) > 1-tol)
// if (mag(n & surf.faceNormals()[facei]) > 1-tol)
// {
//
// Pout<< "edge:" << e << " face:" << faceI
// Pout<< "edge:" << e << " face:" << facei
// << " e0Vec:" << e0Vec << " n:" << n
// << " normalComponent:" << (n & surf.faceNormals()[faceI])
// << " normalComponent:" << (n & surf.faceNormals()[facei])
// << " tol:" << tol << endl;
//
// return true;
@ -117,13 +117,13 @@ bool Foam::surfaceIntersection::excludeEdgeHit
}
//// Find intersection of plane with edges of hitFaceI. Returns
//// Find intersection of plane with edges of hitFacei. Returns
//// - edgeI
//// - intersection point
//Foam::pointIndexHit Foam::surfaceIntersection::faceEdgeIntersection
//(
// const triSurface& surf,
// const label hitFaceI,
// const label hitFacei,
//
// const vector& n,
// const point& eStart,
@ -134,7 +134,7 @@ bool Foam::surfaceIntersection::excludeEdgeHit
//
// const pointField& points = surf.points();
//
// const triSurface::FaceType& f = surf.localFaces()[hitFaceI];
// const triSurface::FaceType& f = surf.localFaces()[hitFacei];
//
// // Plane for intersect test.
// plane pl(eStart, n);
@ -172,7 +172,7 @@ bool Foam::surfaceIntersection::excludeEdgeHit
// meshTools::findEdge
// (
// surf.edges(),
// surf.faceEdges()[hitFaceI],
// surf.faceEdges()[hitFacei],
// f[fp],
// f[fp1]
// );
@ -186,7 +186,7 @@ bool Foam::surfaceIntersection::excludeEdgeHit
//
// FatalErrorInFunction
// << "Did not find intersection of plane " << pl
// << " with edges of face " << hitFaceI << " verts:" << f
// << " with edges of face " << hitFacei << " verts:" << f
// << abort(FatalError);
//
// return pInter;
@ -290,11 +290,11 @@ void Foam::surfaceIntersection::classifyHit
const labelList& facesA = surf1.edgeFaces()[edgeI];
// Label of face on surface2 edgeI intersected
label surf2FaceI = pHit.index();
label surf2Facei = pHit.index();
// Classify point on surface2
const triSurface::FaceType& f2 = surf2.localFaces()[surf2FaceI];
const triSurface::FaceType& f2 = surf2.localFaces()[surf2Facei];
const pointField& surf2Pts = surf2.localPoints();
label nearType, nearLabel;
@ -360,7 +360,7 @@ void Foam::surfaceIntersection::classifyHit
{
// 3. Point hits edge. Do nothing on this side. Reverse
// is handled by 2 (edge hits point)
label edge2I = getEdge(surf2, surf2FaceI, nearLabel);
label edge2I = getEdge(surf2, surf2Facei, nearLabel);
const edge& e2 = surf2.edges()[edge2I];
if (debug&2)
@ -380,7 +380,7 @@ void Foam::surfaceIntersection::classifyHit
// doing the surf2 with surf1 intersection but these
// are merged later on)
label edge2I = getEdge(surf2, surf2FaceI, nearLabel);
label edge2I = getEdge(surf2, surf2Facei, nearLabel);
const edge& e2 = surf2.edges()[edge2I];
if (debug&2)
@ -430,7 +430,7 @@ void Foam::surfaceIntersection::classifyHit
{
Pout<< pHit.hitPoint() << " is surf1:"
<< " end point of edge " << e
<< " surf2: face " << surf2FaceI
<< " surf2: face " << surf2Facei
<< endl;
}
@ -465,12 +465,12 @@ void Foam::surfaceIntersection::classifyHit
<< pHit.hitPoint() << " is surf1:"
<< " end point of edge " << e << " coord:"
<< surf1.localPoints()[nearVert]
<< " surf2: face " << surf2FaceI << endl;
<< " surf2: face " << surf2Facei << endl;
}
vector eVec = otherPt - nearPt;
if ((surf2.faceNormals()[surf2FaceI] & eVec) > 0)
if ((surf2.faceNormals()[surf2Facei] & eVec) > 0)
{
// otherVert on outside of surf2
@ -497,7 +497,7 @@ void Foam::surfaceIntersection::classifyHit
(
isFirstSurf,
facesA,
surf2FaceI,
surf2Facei,
allCutEdges,
allCutPoints
);
@ -508,7 +508,7 @@ void Foam::surfaceIntersection::classifyHit
{
Pout<< "Discarding " << pHit.hitPoint()
<< " since edge " << e << " on inside of surf2."
<< " surf2 normal:" << surf2.faceNormals()[surf2FaceI]
<< " surf2 normal:" << surf2.faceNormals()[surf2Facei]
<< endl;
}
}
@ -520,7 +520,7 @@ void Foam::surfaceIntersection::classifyHit
{
Pout<< pHit.hitPoint() << " is surf1:"
<< " somewhere on edge " << e
<< " surf2: face " << surf2FaceI
<< " surf2: face " << surf2Facei
<< endl;
}
@ -533,7 +533,7 @@ void Foam::surfaceIntersection::classifyHit
(
isFirstSurf,
facesA,
surf2FaceI,
surf2Facei,
allCutEdges,
allCutPoints
);
@ -573,11 +573,11 @@ void Foam::surfaceIntersection::doCutEdges
// Calculate local (to point) tolerance based on min edge length.
scalarField surf1PointTol(surf1Pts.size());
forAll(surf1PointTol, pointI)
forAll(surf1PointTol, pointi)
{
surf1PointTol[pointI] =
surf1PointTol[pointi] =
intersection::planarTol()
* minEdgeLen(surf1, pointI);
* minEdgeLen(surf1, pointi);
}
const triSurface& surf2 = querySurf2.surface();
@ -611,7 +611,7 @@ void Foam::surfaceIntersection::doCutEdges
// is in their plane and they share a point with the edge.
// Label of face on surface2 edgeI intersected
label hitFaceI = pHit.index();
label hitFacei = pHit.index();
if
(
@ -619,7 +619,7 @@ void Foam::surfaceIntersection::doCutEdges
(
surf1,
edgeI,
hitFaceI,
hitFacei,
0.1 // 1-cos of angle between normals
)
)
@ -860,7 +860,7 @@ Foam::surfaceIntersection::surfaceIntersection
(
true, // is first surface
surf1.edgeFaces()[edgeI],
pHit.index(), // surf2FaceI
pHit.index(), // surf2Facei
allCutEdges,
allCutPoints
);
@ -901,7 +901,7 @@ Foam::surfaceIntersection::surfaceIntersection
(
false, // is second surface
surf2.edgeFaces()[edgeI],
pHit.index(), // surf2FaceI
pHit.index(), // surf2Facei
allCutEdges,
allCutPoints
);
@ -959,13 +959,13 @@ Foam::surfaceIntersection::surfaceIntersection
forAllConstIter(labelPairLookup, facePairToVertex_, iter)
{
label pointI = iter();
label pointi = iter();
if (!usedPoints.found(pointI))
if (!usedPoints.found(pointi))
{
WarningInFunction
<< "Problem: cut point:" << pointI
<< " coord:" << cutPoints_[pointI]
<< "Problem: cut point:" << pointi
<< " coord:" << cutPoints_[pointi]
<< " not used by any edge" << endl;
}
}

View File

@ -124,13 +124,13 @@ class surfaceIntersection
static void transfer(List<DynamicList<T>>&, List<List<T>>&);
//- Get minimum length of all edges connected to point
static scalar minEdgeLen(const triSurface& surf, const label pointI);
static scalar minEdgeLen(const triSurface& surf, const label pointi);
//- Get edge label of edge between face vertices fp and fp+1
static label getEdge
(
const triSurface& surf,
const label faceI,
const label facei,
const label fp
);
@ -154,7 +154,7 @@ class surfaceIntersection
(
const triSurface& surf,
const label edgeI,
const label faceI,
const label facei,
const scalar tol
);
@ -164,7 +164,7 @@ class surfaceIntersection
//static pointIndexHit faceEdgeIntersection
//(
// const triSurface&,
// const label hitFaceI,
// const label hitFacei,
//
// const vector& n,
// const point& eStart,

View File

@ -64,10 +64,10 @@ void Foam::surfaceIntersection::writeOBJ
Foam::scalar Foam::surfaceIntersection::minEdgeLen
(
const triSurface& surf,
const label pointI
const label pointi
)
{
const labelList& pEdges = surf.pointEdges()[pointI];
const labelList& pEdges = surf.pointEdges()[pointi];
scalar minLen = GREAT;
@ -82,17 +82,17 @@ Foam::scalar Foam::surfaceIntersection::minEdgeLen
}
// Get edge between fp and fp+1 on faceI.
// Get edge between fp and fp+1 on facei.
Foam::label Foam::surfaceIntersection::getEdge
(
const triSurface& surf,
const label faceI,
const label facei,
const label fp
)
{
const edge faceEdge = surf.localFaces()[faceI].faceEdge(fp);
const edge faceEdge = surf.localFaces()[facei].faceEdge(fp);
const labelList& eLabels = surf.faceEdges()[faceI];
const labelList& eLabels = surf.faceEdges()[facei];
forAll(eLabels, eI)
{
@ -106,7 +106,7 @@ Foam::label Foam::surfaceIntersection::getEdge
FatalErrorInFunction
<< "Problem:: Cannot find edge with vertices " << faceEdge
<< " in face " << faceI
<< " in face " << facei
<< abort(FatalError);
return -1;
@ -265,13 +265,13 @@ void Foam::surfaceIntersection::writeIntersectedEdges
// Dump all points (surface followed by cutPoints)
const pointField& pts = surf.localPoints();
forAll(pts, pointI)
forAll(pts, pointi)
{
writeOBJ(pts[pointI], os);
writeOBJ(pts[pointi], os);
}
forAll(cutPoints(), cutPointI)
forAll(cutPoints(), cutPointi)
{
writeOBJ(cutPoints()[cutPointI], os);
writeOBJ(cutPoints()[cutPointi], os);
}
forAll(edgeCutVerts, edgeI)