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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
a545e8f8
Commit
a545e8f8
authored
19 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
1b6a6cd4
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
Mesh/BDS.cpp
+8
-7
8 additions, 7 deletions
Mesh/BDS.cpp
Mesh/BDS.h
+3
-2
3 additions, 2 deletions
Mesh/BDS.h
Mesh/DiscreteSurface.cpp
+1
-6
1 addition, 6 deletions
Mesh/DiscreteSurface.cpp
with
12 additions
and
15 deletions
Mesh/BDS.cpp
+
8
−
7
View file @
a545e8f8
...
@@ -204,11 +204,12 @@ double dist_droites_gauches(BDS_Point *p1, BDS_Point *p2,
...
@@ -204,11 +204,12 @@ double dist_droites_gauches(BDS_Point *p1, BDS_Point *p2,
}
}
bool
proj_point_triangle
(
double
xa
,
double
ya
,
double
za
,
bool
proj_point_triangle
(
double
xa
,
double
ya
,
double
za
,
const
BDS_Vector
&
n
,
BDS_Triangle
*
t
,
BDS_Triangle
*
t
,
double
&
x
,
double
&
y
,
double
&
z
)
double
&
x
,
double
&
y
,
double
&
z
)
{
{
const
double
eps_prec
=
1.e-10
;
const
double
eps_prec
=
1.e-10
;
BDS_Vector
n
=
t
->
N
();
//
BDS_Vector n = t->N();
double
mat
[
3
][
3
];
double
mat
[
3
][
3
];
double
b
[
3
];
double
b
[
3
];
double
res
[
2
];
double
res
[
2
];
...
@@ -681,7 +682,7 @@ void BDS_Mesh :: createSearchStructures ( )
...
@@ -681,7 +682,7 @@ void BDS_Mesh :: createSearchStructures ( )
printf
(
"creating the ANN search structure
\n
"
);
printf
(
"creating the ANN search structure
\n
"
);
const
double
LC_SEARCH
=
LC
*
3
.e-3
;
const
double
LC_SEARCH
=
LC
*
1
.e-3
;
for
(
std
::
set
<
BDS_GeomEntity
*
,
GeomLessThan
>::
iterator
it
=
geom
.
begin
();
for
(
std
::
set
<
BDS_GeomEntity
*
,
GeomLessThan
>::
iterator
it
=
geom
.
begin
();
it
!=
geom
.
end
();
it
!=
geom
.
end
();
...
@@ -2079,7 +2080,7 @@ bool project_point_on_a_list_of_triangles ( BDS_Point *p ,
...
@@ -2079,7 +2080,7 @@ bool project_point_on_a_list_of_triangles ( BDS_Point *p ,
{
{
{
{
double
xp
,
yp
,
zp
;
double
xp
,
yp
,
zp
;
bool
ok
=
proj_point_triangle
(
p
->
X
,
p
->
Y
,
p
->
Z
,
*
it
,
xp
,
yp
,
zp
);
bool
ok
=
proj_point_triangle
(
p
->
X
,
p
->
Y
,
p
->
Z
,
p
->
N
(),
*
it
,
xp
,
yp
,
zp
);
if
(
ok
)
if
(
ok
)
{
{
global_ok
=
true
;
global_ok
=
true
;
...
@@ -2208,14 +2209,14 @@ void BDS_Mesh :: compute_metric_edge_lengths (const BDS_Metric & metric)
...
@@ -2208,14 +2209,14 @@ void BDS_Mesh :: compute_metric_edge_lengths (const BDS_Metric & metric)
0.5
*
(
e
->
p1
->
Y
+
e
->
p2
->
Y
),
0.5
*
(
e
->
p1
->
Y
+
e
->
p2
->
Y
),
0.5
*
(
e
->
p1
->
Z
+
e
->
p2
->
Z
));
0.5
*
(
e
->
p1
->
Z
+
e
->
p2
->
Z
));
double
radius
=
1.
/
curvature
;
double
radius
=
1.
/
curvature
;
double
target
=
3.14159
*
radius
/
3.0
;
double
target
=
3.14159
*
radius
/
metric
.
nb_elements_per_radius_of_curvature
;
e
->
target_length
=
metric
.
update_target_length
(
target
,
e
->
target_length
);
e
->
target_length
=
metric
.
update_target_length
(
target
,
e
->
target_length
);
// printf("e1 radius %g target %g length %g mlp %g ml %g\n",radius, target,e->length(),e->length()/target,e->metric_length);
// printf("e1 radius %g target %g length %g mlp %g ml %g\n",radius, target,e->length(),e->length()/target,e->metric_length);
}
}
else
else
{
{
double
radius
=
0.5
*
(
e
->
p1
->
radius_of_curvature
+
e
->
p2
->
radius_of_curvature
);
double
radius
=
0.5
*
(
e
->
p1
->
radius_of_curvature
+
e
->
p2
->
radius_of_curvature
);
double
target
=
3.14159
*
radius
/
3.0
;
double
target
=
3.14159
*
radius
/
metric
.
nb_elements_per_radius_of_curvature
;
e
->
target_length
=
metric
.
update_target_length
(
target
,
e
->
target_length
);
e
->
target_length
=
metric
.
update_target_length
(
target
,
e
->
target_length
);
}
}
...
@@ -2263,7 +2264,7 @@ int BDS_Mesh :: adapt_mesh ( double l, bool smooth, BDS_Mesh *geom_mesh)
...
@@ -2263,7 +2264,7 @@ int BDS_Mesh :: adapt_mesh ( double l, bool smooth, BDS_Mesh *geom_mesh)
SNAP_SUCCESS
=
0
;
SNAP_SUCCESS
=
0
;
SNAP_FAILURE
=
0
;
SNAP_FAILURE
=
0
;
BDS_Metric
metric
(
l
,
LC
/
2
00
,
LC
);
BDS_Metric
metric
(
l
,
LC
/
5
00
,
LC
,
3
);
// printf("METRIC %g %g %g\n",LC,metric._min,metric._max);
// printf("METRIC %g %g %g\n",LC,metric._min,metric._max);
// add initial set of edges in a list
// add initial set of edges in a list
...
...
This diff is collapsed.
Click to expand it.
Mesh/BDS.h
+
3
−
2
View file @
a545e8f8
...
@@ -29,8 +29,9 @@ class BDS_Metric
...
@@ -29,8 +29,9 @@ class BDS_Metric
{
{
public:
public:
const
double
target
,
_min
,
_max
,
treshold
;
const
double
target
,
_min
,
_max
,
treshold
;
BDS_Metric
(
double
_target
,
double
_mmin
,
double
_mmax
,
double
_tres
=
0.7
)
const
double
nb_elements_per_radius_of_curvature
;
:
target
(
_target
),
_min
(
_mmin
),
_max
(
_mmax
),
treshold
(
_tres
)
BDS_Metric
(
double
_target
,
double
_mmin
,
double
_mmax
,
double
cc
,
double
_tres
=
0.7
)
:
target
(
_target
),
_min
(
_mmin
),
_max
(
_mmax
),
treshold
(
_tres
),
nb_elements_per_radius_of_curvature
(
cc
)
{}
{}
inline
double
update_target_length
(
double
_target
,
double
old_target_length
)
const
inline
double
update_target_length
(
double
_target
,
double
old_target_length
)
const
{
{
...
...
This diff is collapsed.
Click to expand it.
Mesh/DiscreteSurface.cpp
+
1
−
6
View file @
a545e8f8
// $Id: DiscreteSurface.cpp,v 1.2
2
2005-08-2
4
14:
32
:5
6
remacle Exp $
// $Id: DiscreteSurface.cpp,v 1.2
3
2005-08-2
5
14:
56
:5
4
remacle Exp $
//
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -50,11 +50,6 @@ void Mesh_To_BDS(Surface *s, BDS_Mesh *m)
...
@@ -50,11 +50,6 @@ void Mesh_To_BDS(Surface *s, BDS_Mesh *m)
Vertex
*
v1
=
simp
->
V
[
0
];
Vertex
*
v1
=
simp
->
V
[
0
];
Vertex
*
v2
=
simp
->
V
[
1
];
Vertex
*
v2
=
simp
->
V
[
1
];
Vertex
*
v3
=
simp
->
V
[
2
];
Vertex
*
v3
=
simp
->
V
[
2
];
double
n
[
3
];
normal3points
(
v1
->
Pos
.
X
,
v1
->
Pos
.
Y
,
v1
->
Pos
.
Z
,
v2
->
Pos
.
X
,
v2
->
Pos
.
Y
,
v2
->
Pos
.
Z
,
v3
->
Pos
.
X
,
v3
->
Pos
.
Y
,
v3
->
Pos
.
Z
,
n
);
m
->
add_triangle
(
v1
->
Num
,
v2
->
Num
,
v3
->
Num
);
m
->
add_triangle
(
v1
->
Num
,
v2
->
Num
,
v3
->
Num
);
}
}
List_Delete
(
triangles
);
List_Delete
(
triangles
);
...
...
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