Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
53ac59f8
Commit
53ac59f8
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix msvc compile
parent
409bc12b
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/MQuadrangle.cpp
+68
-67
68 additions, 67 deletions
Geo/MQuadrangle.cpp
Geo/MTetrahedron.cpp
+10
-10
10 additions, 10 deletions
Geo/MTetrahedron.cpp
Geo/MTriangle.cpp
+2
-5
2 additions, 5 deletions
Geo/MTriangle.cpp
with
80 additions
and
82 deletions
Geo/MQuadrangle.cpp
+
68
−
67
View file @
53ac59f8
...
@@ -189,8 +189,6 @@ double MQuadrangle::angleShapeMeasure()
...
@@ -189,8 +189,6 @@ double MQuadrangle::angleShapeMeasure()
double
MQuadrangle
::
getInnerRadius
()
double
MQuadrangle
::
getInnerRadius
()
{
{
double
R
=
1.e22
;
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
// get the coordinates (x, y, z) of the 4 points defining the Quad
// get the coordinates (x, y, z) of the 4 points defining the Quad
double
x
[
4
]
=
{
_v
[
0
]
->
x
(),
_v
[
1
]
->
x
(),
_v
[
2
]
->
x
(),
_v
[
3
]
->
x
()};
double
x
[
4
]
=
{
_v
[
0
]
->
x
(),
_v
[
1
]
->
x
(),
_v
[
2
]
->
x
(),
_v
[
3
]
->
x
()};
...
@@ -200,7 +198,7 @@ double MQuadrangle::getInnerRadius()
...
@@ -200,7 +198,7 @@ double MQuadrangle::getInnerRadius()
// get the coefficient (a,b,c,d) of the mean plane - least square!
// get the coefficient (a,b,c,d) of the mean plane - least square!
// the plane has for equation " a*x+b*y+c*z+d=0 "
// the plane has for equation " a*x+b*y+c*z+d=0 "
// compute the centro
ï
d of the 4 points
// compute the centro
i
d of the 4 points
double
xm
=
(
x
[
0
]
+
x
[
1
]
+
x
[
2
]
+
x
[
3
])
/
4
;
double
xm
=
(
x
[
0
]
+
x
[
1
]
+
x
[
2
]
+
x
[
3
])
/
4
;
double
ym
=
(
y
[
0
]
+
y
[
1
]
+
y
[
2
]
+
y
[
3
])
/
4
;
double
ym
=
(
y
[
0
]
+
y
[
1
]
+
y
[
2
]
+
y
[
3
])
/
4
;
double
zm
=
(
z
[
0
]
+
z
[
1
]
+
z
[
2
]
+
z
[
3
])
/
4
;
double
zm
=
(
z
[
0
]
+
z
[
1
]
+
z
[
2
]
+
z
[
3
])
/
4
;
...
@@ -246,12 +244,15 @@ double MQuadrangle::getInnerRadius()
...
@@ -246,12 +244,15 @@ double MQuadrangle::getInnerRadius()
// go from XYZ-plane to XY-plane
// go from XYZ-plane to XY-plane
// 4 points, 4 edges => 4 inner radii of circles tangent to (at least) 3 of the four edges!
// 4 points, 4 edges => 4 inner radii of circles tangent to (at
// least) 3 of the four edges!
double
xn
[
4
],
yn
[
4
],
r
[
4
];
double
xn
[
4
],
yn
[
4
],
r
[
4
];
planarQuad_xyz2xy
(
xp
,
yp
,
zp
,
xn
,
yn
);
planarQuad_xyz2xy
(
xp
,
yp
,
zp
,
xn
,
yn
);
// compute for each of the 4 possibilities the incircle radius, keeping the minimum
// compute for each of the 4 possibilities the incircle radius,
// keeping the minimum
double
R
=
1.e22
;
for
(
int
j
=
0
;
j
<
4
;
j
++
){
for
(
int
j
=
0
;
j
<
4
;
j
++
){
r
[
j
]
=
computeInnerRadiusForQuad
(
xn
,
yn
,
j
);
r
[
j
]
=
computeInnerRadiusForQuad
(
xn
,
yn
,
j
);
if
(
r
[
j
]
<
R
){
if
(
r
[
j
]
<
R
){
...
...
This diff is collapsed.
Click to expand it.
Geo/MTetrahedron.cpp
+
10
−
10
View file @
53ac59f8
...
@@ -49,9 +49,7 @@ double MTetrahedronN::distoShapeMeasure()
...
@@ -49,9 +49,7 @@ double MTetrahedronN::distoShapeMeasure()
double
MTetrahedron
::
getInnerRadius
()
double
MTetrahedron
::
getInnerRadius
()
{
{
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
double
r
=
0.
;
double
dist
[
3
],
face_area
=
0.
;
double
dist
[
3
];
double
face_area
=
0.
;
double
vol
=
getVolume
();
double
vol
=
getVolume
();
for
(
int
i
=
0
;
i
<
4
;
i
++
){
for
(
int
i
=
0
;
i
<
4
;
i
++
){
MFace
f
=
getFace
(
i
);
MFace
f
=
getFace
(
i
);
...
@@ -59,15 +57,17 @@ double MTetrahedron::getInnerRadius()
...
@@ -59,15 +57,17 @@ double MTetrahedron::getInnerRadius()
MEdge
e
=
f
.
getEdge
(
j
);
MEdge
e
=
f
.
getEdge
(
j
);
dist
[
j
]
=
e
.
getVertex
(
0
)
->
distance
(
e
.
getVertex
(
1
));
dist
[
j
]
=
e
.
getVertex
(
0
)
->
distance
(
e
.
getVertex
(
1
));
}
}
face_area
+=
0.25
*
sqrt
((
dist
[
0
]
+
dist
[
1
]
+
dist
[
2
])
*
(
-
dist
[
0
]
+
dist
[
1
]
+
dist
[
2
])
*
(
dist
[
0
]
-
dist
[
1
]
+
dist
[
2
])
*
(
dist
[
0
]
+
dist
[
1
]
-
dist
[
2
]));
face_area
+=
0.25
*
sqrt
((
dist
[
0
]
+
dist
[
1
]
+
dist
[
2
])
*
(
-
dist
[
0
]
+
dist
[
1
]
+
dist
[
2
])
*
(
dist
[
0
]
-
dist
[
1
]
+
dist
[
2
])
*
(
dist
[
0
]
+
dist
[
1
]
-
dist
[
2
]));
}
}
return
3
*
vol
/
face_area
;
r
=
3
*
vol
/
face_area
;
#else
#else
r
=
0.
;
r
eturn
0.
;
#endif
#endif
return
r
;
}
}
double
MTetrahedron
::
gammaShapeMeasure
()
double
MTetrahedron
::
gammaShapeMeasure
()
{
{
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
...
...
This diff is collapsed.
Click to expand it.
Geo/MTriangle.cpp
+
2
−
5
View file @
53ac59f8
...
@@ -37,16 +37,13 @@ double MTriangle::distoShapeMeasure()
...
@@ -37,16 +37,13 @@ double MTriangle::distoShapeMeasure()
double
MTriangle
::
getInnerRadius
()
double
MTriangle
::
getInnerRadius
()
{
{
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
double
r
=
0.
;
double
dist
[
3
],
k
=
0.
;
double
dist
[
3
];
double
k
=
0.
;
for
(
int
i
=
0
;
i
<
3
;
i
++
){
for
(
int
i
=
0
;
i
<
3
;
i
++
){
MEdge
e
=
getEdge
(
i
);
MEdge
e
=
getEdge
(
i
);
dist
[
i
]
=
e
.
getVertex
(
0
)
->
distance
(
e
.
getVertex
(
1
));
dist
[
i
]
=
e
.
getVertex
(
0
)
->
distance
(
e
.
getVertex
(
1
));
k
+=
0.5
*
dist
[
i
];
k
+=
0.5
*
dist
[
i
];
}
}
r
=
sqrt
(
k
*
(
k
-
dist
[
0
])
*
(
k
-
dist
[
1
])
*
(
k
-
dist
[
2
]))
/
k
;
return
sqrt
(
k
*
(
k
-
dist
[
0
])
*
(
k
-
dist
[
1
])
*
(
k
-
dist
[
2
]))
/
k
;
return
r
;
#else
#else
return
0.
;
return
0.
;
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment