ENH: edgeIntersections: added subset manipulation

This commit is contained in:
mattijs
2014-10-13 12:46:27 +01:00
committed by Andrew Heather
parent 736b551ae2
commit df9ae1d07f
2 changed files with 45 additions and 2 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -700,4 +700,38 @@ Foam::label Foam::edgeIntersections::removeDegenerates
} }
void Foam::edgeIntersections::replace
(
const edgeIntersections& subInfo,
const labelList& edgeMap,
const labelList& faceMap
)
{
forAll(subInfo, subI)
{
const List<pointIndexHit>& subHits = subInfo[subI];
const labelList& subClass = subInfo.classification()[subI];
label edgeI = edgeMap[subI];
List<pointIndexHit>& intersections = operator[](edgeI);
labelList& intersectionTypes = classification_[edgeI];
intersections.setSize(subHits.size());
intersectionTypes.setSize(subHits.size());
forAll(subHits, i)
{
const pointIndexHit& subHit = subHits[i];
intersections[i] = pointIndexHit
(
subHit.hit(),
subHit.rawPoint(),
faceMap[subHit.index()]
);
intersectionTypes[i] = subClass[i];
}
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -197,6 +197,15 @@ public:
const scalarField& surf1PointTol, const scalarField& surf1PointTol,
pointField& points1 pointField& points1
); );
//- Replace edge intersection for a subset (given as edge map and
// face map - for face indices stored in pointIndexHit.index())
void replace
(
const edgeIntersections&,
const labelList& edgeMap,
const labelList& faceMap
);
}; };