Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
6cd78ff3
Commit
6cd78ff3
authored
Dec 08, 2010
by
mattijs
Browse files
ENH: tetrahedron : handle degenerate tets
parent
a9645157
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H
View file @
6cd78ff3
...
...
@@ -21,12 +21,11 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include
"triangle.H"
#include
"IOstreams.H"
#include
"triPointRef.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -152,7 +151,37 @@ inline Point tetrahedron<Point, PointRef>::circumCentre() const
vector
ba
=
b
^
a
;
vector
ca
=
c
^
a
;
return
a_
+
0.5
*
(
a
+
(
lambda
*
ba
-
mu
*
ca
)
/
((
c
&
ba
)
+
ROOTVSMALL
));
vector
num
=
lambda
*
ba
-
mu
*
ca
;
scalar
denom
=
(
c
&
ba
);
if
(
Foam
::
mag
(
denom
)
<
ROOTVSMALL
)
{
// Degenerate tet. Use test of the individual triangles.
{
point
triCentre
=
triPointRef
(
a_
,
b_
,
c_
).
circumCentre
();
if
(
magSqr
(
d_
-
triCentre
)
<
magSqr
(
a_
-
triCentre
))
{
return
triCentre
;
}
}
{
point
triCentre
=
triPointRef
(
a_
,
b_
,
d_
).
circumCentre
();
if
(
magSqr
(
c_
-
triCentre
)
<
magSqr
(
a_
-
triCentre
))
{
return
triCentre
;
}
}
{
point
triCentre
=
triPointRef
(
a_
,
c_
,
d_
).
circumCentre
();
if
(
magSqr
(
b_
-
triCentre
)
<
magSqr
(
a_
-
triCentre
))
{
return
triCentre
;
}
}
return
triPointRef
(
b_
,
c_
,
d_
).
circumCentre
();
}
return
a_
+
0.5
*
(
a
+
num
/
denom
);
}
...
...
Write
Preview
Supports
Markdown
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