mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Using triangle quality without checking - check is now in triangle class.
This commit is contained in:
@ -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) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -315,32 +315,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
triPointRef tri
|
triQ[faceI] = triPointRef
|
||||||
(
|
(
|
||||||
surf.points()[f[0]],
|
surf.points()[f[0]],
|
||||||
surf.points()[f[1]],
|
surf.points()[f[1]],
|
||||||
surf.points()[f[2]]
|
surf.points()[f[2]]
|
||||||
);
|
).quality();
|
||||||
|
|
||||||
vector ba(tri.b() - tri.a());
|
|
||||||
ba /= mag(ba) + VSMALL;
|
|
||||||
|
|
||||||
vector ca(tri.c() - tri.a());
|
|
||||||
ca /= mag(ca) + VSMALL;
|
|
||||||
|
|
||||||
if (mag(ba&ca) > 1-1E-3)
|
|
||||||
{
|
|
||||||
triQ[faceI] = SMALL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
triQ[faceI] = triPointRef
|
|
||||||
(
|
|
||||||
surf.points()[f[0]],
|
|
||||||
surf.points()[f[1]],
|
|
||||||
surf.points()[f[2]]
|
|
||||||
).quality();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -160,7 +160,15 @@ inline Foam::scalar Foam::triangle<Point, PointRef>::circumRadius() const
|
|||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
inline Foam::scalar Foam::triangle<Point, PointRef>::quality() const
|
inline Foam::scalar Foam::triangle<Point, PointRef>::quality() const
|
||||||
{
|
{
|
||||||
return mag()/(Foam::sqr(circumRadius())*3.0*sqrt(3.0)/4.0 + VSMALL);
|
scalar c = circumRadius();
|
||||||
|
|
||||||
|
if (c < ROOTVSMALL)
|
||||||
|
{
|
||||||
|
// zero circumRadius, something has gone wrong.
|
||||||
|
return SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mag()/(Foam::sqr(c)*3.0*sqrt(3.0)/4.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user