Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
a846b220
Commit
a846b220
authored
Jul 21, 2011
by
mattijs
Browse files
ENH: triSurfaceTools: restore cvm changes
parent
7ca505ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
View file @
a846b220
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -2212,40 +2212,34 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
// Nearest to face interior. Use faceNormal to determine side
scalar
c
=
sampleNearestVec
&
surf
.
faceNormals
()[
nearestFaceI
];
// If the sample is essentially on the face, do not check for
// it being perpendicular.
//
//
If the sample is essentially on the face, do not check for
//
//
it being perpendicular.
// if (debug)
// scalar magSampleNearestVec = mag(sampleNearestVec);
// if (magSampleNearestVec > SMALL)
// {
//
scalar
magSampleNearestVec
=
mag(s
ampleNearestVec
);
//
c /=
magSampleNearestVec
*
mag(s
urf.faceNormals()[nearestFaceI]
);
// if (mag
SampleNearestVec > SMALL
)
// if (mag
(c) < 0.99
)
// {
// c /=
// magSampleNearestVec
// *mag(surf.faceNormals()[nearestFaceI]);
// if (mag(c) < 0.99)
// {
// WarningIn("triSurfaceTools::surfaceSide")
// << "nearestPoint identified as being on triangle "
// << "face but vector from nearestPoint to sample is "
// << "not perpendicular to the normal." << nl
// << "sample: " << sample << nl
// << "nearestPoint: " << nearestPoint << nl
// << "sample - nearestPoint: "
// << sample - nearestPoint << nl
// << "normal: "
// << surf.faceNormals()[nearestFaceI] << nl
// << "mag(sample - nearestPoint): "
// << mag(sample - nearestPoint) << nl
// << "normalised dot product: " << c << nl
// << "triangle vertices: " << nl
// << " " << points[f[0]] << nl
// << " " << points[f[1]] << nl
// << " " << points[f[2]] << nl
// << endl;;
// }
// FatalErrorIn("triSurfaceTools::surfaceSide")
// << "nearestPoint identified as being on triangle face "
// << "but vector from nearestPoint to sample is not "
// << "perpendicular to the normal." << nl
// << "sample: " << sample << nl
// << "nearestPoint: " << nearestPoint << nl
// << "sample - nearestPoint: "
// << sample - nearestPoint << nl
// << "normal: " << surf.faceNormals()[nearestFaceI] << nl
// << "mag(sample - nearestPoint): "
// << mag(sample - nearestPoint) << nl
// << "normalised dot product: " << c << nl
// << "triangle vertices: " << nl
// << " " << points[f[0]] << nl
// << " " << points[f[1]] << nl
// << " " << points[f[2]] << nl
// << abort(FatalError);
// }
// }
...
...
@@ -2267,26 +2261,26 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
label
edgeI
=
surf
.
faceEdges
()[
nearestFaceI
][
nearLabel
];
// if (debug)
{
// Check order of faceEdges same as face vertices.
const
edge
&
e
=
surf
.
edges
()[
edgeI
];
const
labelList
&
meshPoints
=
surf
.
meshPoints
();
const
edge
meshEdge
(
meshPoints
[
e
[
0
]],
meshPoints
[
e
[
1
]]);
if
(
meshEdge
!=
edge
(
f
[
nearLabel
],
f
[
f
.
fcIndex
(
nearLabel
)])
)
{
FatalErrorIn
(
"triSurfaceTools::surfaceSide"
)
<<
"Edge:"
<<
edgeI
<<
" local vertices:"
<<
e
<<
" mesh vertices:"
<<
meshEdge
<<
" not at position "
<<
nearLabel
<<
" in face "
<<
f
<<
abort
(
FatalError
);
}
}
//
{
//
// Check order of faceEdges same as face vertices.
//
const edge& e = surf.edges()[edgeI];
//
const labelList& meshPoints = surf.meshPoints();
//
const edge meshEdge(meshPoints[e[0]], meshPoints[e[1]]);
//
if
//
(
//
meshEdge
//
!= edge(f[nearLabel], f[f.fcIndex(nearLabel)])
//
)
//
{
//
FatalErrorIn("triSurfaceTools::surfaceSide")
//
<< "Edge:" << edgeI << " local vertices:" << e
//
<< " mesh vertices:" << meshEdge
//
<< " not at position " << nearLabel
//
<< " in face " << f
//
<< abort(FatalError);
//
}
//
}
return
edgeSide
(
surf
,
sample
,
nearestPoint
,
edgeI
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment