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:
@ -585,6 +585,65 @@ Foam::labelList Foam::localPointRegion::findDuplicateFaces
|
||||
}
|
||||
|
||||
|
||||
Foam::List<Foam::labelPair> Foam::localPointRegion::findDuplicateFacePairs
|
||||
(
|
||||
const polyMesh& mesh
|
||||
)
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
// Faces to test: all boundary faces
|
||||
labelList testFaces
|
||||
(
|
||||
identity(mesh.nFaces()-mesh.nInternalFaces())
|
||||
+ mesh.nInternalFaces()
|
||||
);
|
||||
|
||||
// Find correspondencing baffle face (or -1)
|
||||
const labelList duplicateFace(findDuplicateFaces(mesh, testFaces));
|
||||
|
||||
// Convert into list of coupled face pairs (mesh face labels).
|
||||
DynamicList<labelPair> baffles(testFaces.size());
|
||||
|
||||
forAll(duplicateFace, i)
|
||||
{
|
||||
label otherFaceI = duplicateFace[i];
|
||||
|
||||
if (otherFaceI != -1 && i < otherFaceI)
|
||||
{
|
||||
label meshFace0 = testFaces[i];
|
||||
label patch0 = patches.whichPatch(meshFace0);
|
||||
label meshFace1 = testFaces[otherFaceI];
|
||||
label patch1 = patches.whichPatch(meshFace1);
|
||||
|
||||
// Check for illegal topology. Should normally not happen!
|
||||
if
|
||||
(
|
||||
(patch0 != -1 && isA<processorPolyPatch>(patches[patch0]))
|
||||
|| (patch1 != -1 && isA<processorPolyPatch>(patches[patch1]))
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"localPointRegion::findDuplicateFacePairs(const polyMesh&)"
|
||||
) << "One of two duplicate faces is on"
|
||||
<< " processorPolyPatch."
|
||||
<< "This is not allowed." << nl
|
||||
<< "Face:" << meshFace0
|
||||
<< " is on patch:" << patches[patch0].name()
|
||||
<< nl
|
||||
<< "Face:" << meshFace1
|
||||
<< " is on patch:" << patches[patch1].name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
baffles.append(labelPair(meshFace0, meshFace1));
|
||||
}
|
||||
}
|
||||
return baffles.shrink();
|
||||
}
|
||||
|
||||
|
||||
void Foam::localPointRegion::updateMesh(const mapPolyMesh& map)
|
||||
{
|
||||
{
|
||||
|
||||
@ -48,6 +48,7 @@ SourceFiles
|
||||
#include "HashSet.H"
|
||||
#include "faceList.H"
|
||||
#include "boolList.H"
|
||||
#include "labelPair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -149,6 +150,9 @@ public:
|
||||
const labelList&
|
||||
);
|
||||
|
||||
//- Helper routine to find all baffles (two boundary faces
|
||||
// using the same points but in reverse order)
|
||||
static labelPairList findDuplicateFacePairs(const polyMesh&);
|
||||
|
||||
// Access
|
||||
|
||||
|
||||
@ -209,6 +209,38 @@ void Foam::pointToPointPlanarInterpolation::calcWeights
|
||||
nearestVertex_,
|
||||
nearestVertexWeight_
|
||||
);
|
||||
|
||||
//if (debug)
|
||||
//{
|
||||
// forAll(sourcePoints, i)
|
||||
// {
|
||||
// Pout<< "source:" << i << " at:" << sourcePoints[i]
|
||||
// << " 2d:" << localVertices[i]
|
||||
// << endl;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// forAll(destPoints, i)
|
||||
// {
|
||||
// label v0 = nearestVertex_[i][0];
|
||||
// label v1 = nearestVertex_[i][1];
|
||||
// label v2 = nearestVertex_[i][2];
|
||||
//
|
||||
// Pout<< "For location " << destPoints[i]
|
||||
// << " 2d:" << localFaceCentres[i]
|
||||
// << " sampling vertices" << nl
|
||||
// << " " << v0
|
||||
// << " at:" << sourcePoints[v0]
|
||||
// << " weight:" << nearestVertexWeight_[i][0] << nl
|
||||
// << " " << v1
|
||||
// << " at:" << sourcePoints[v1]
|
||||
// << " weight:" << nearestVertexWeight_[i][1] << nl
|
||||
// << " " << v2
|
||||
// << " at:" << sourcePoints[v2]
|
||||
// << " weight:" << nearestVertexWeight_[i][2] << nl
|
||||
// << endl;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -2745,6 +2745,12 @@ void Foam::triSurfaceTools::calcInterpolationWeights
|
||||
|
||||
calcInterpolationWeights(tri, nearest.rawPoint(), weights);
|
||||
|
||||
//Pout<< "calcScalingFactors : samplePt:" << samplePt
|
||||
// << " distance:" << nearest.distance()
|
||||
// << " to verts:" << verts
|
||||
// << " weights:" << weights
|
||||
// << endl;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user