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
e361f41c
Commit
e361f41c
authored
9 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
f8e7a276
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/delaunay_refinement.cpp
+10
-9
10 additions, 9 deletions
Mesh/delaunay_refinement.cpp
with
10 additions
and
9 deletions
Mesh/delaunay_refinement.cpp
+
10
−
9
View file @
e361f41c
...
@@ -131,7 +131,7 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
...
@@ -131,7 +131,7 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
const
double
f1
=
rr
.
_x3
;
const
double
f1
=
rr
.
_x3
;
const
double
f2
=
rr
.
_x4
;
const
double
f2
=
rr
.
_x4
;
const
double
dL
=
2.
*
(
t2
-
t1
)
*
dl
/
(
f1
+
f2
);
const
double
dL
=
2.
*
(
t2
-
t1
)
*
dl
/
(
f1
+
f2
);
// printf("%g --> %g for %g --> %g\n",L,dL,t1,t2);
// printf("%g --> %g for %g --> %g\n",L,dL,t1,t2);
double
L0
=
L
;
double
L0
=
L
;
while
(
1
)
{
while
(
1
)
{
...
@@ -196,7 +196,7 @@ public :
...
@@ -196,7 +196,7 @@ public :
{
{
const
double
FACTOR
=
0.8
;
const
double
FACTOR
=
0.8
;
const
double
K
=
FACTOR
*
p
->
_v
->
lc
();
const
double
K
=
FACTOR
*
p
->
_v
->
lc
();
const
double
d
=
const
double
d
=
SQR
(
p
->
_v
->
x
()
-
_v
->
x
())
+
SQR
(
p
->
_v
->
x
()
-
_v
->
x
())
+
SQR
(
p
->
_v
->
y
()
-
_v
->
y
())
+
SQR
(
p
->
_v
->
y
()
-
_v
->
y
())
+
SQR
(
p
->
_v
->
z
()
-
_v
->
z
());
SQR
(
p
->
_v
->
z
()
-
_v
->
z
());
...
@@ -264,7 +264,7 @@ void filterVertices (const int numThreads,
...
@@ -264,7 +264,7 @@ void filterVertices (const int numThreads,
std
::
vector
<
int
>
indices
;
std
::
vector
<
int
>
indices
;
SortHilbert
(
add
,
indices
);
SortHilbert
(
add
,
indices
);
std
::
vector
<
Vertex
*>
_add
=
add
;
std
::
vector
<
Vertex
*>
_add
=
add
;
// std::vector<Vertex*> _add;
// std::vector<Vertex*> _add;
// Vertex *current = add[0];
// Vertex *current = add[0];
// printf("before %d\n",add.size());
// printf("before %d\n",add.size());
...
@@ -274,7 +274,7 @@ void filterVertices (const int numThreads,
...
@@ -274,7 +274,7 @@ void filterVertices (const int numThreads,
// SQR(add[i]->z()-current->z()) );
// SQR(add[i]->z()-current->z()) );
// if (0.8*current->lc() > d){
// if (0.8*current->lc() > d){
// delete add[i];
// delete add[i];
// }
// }
// else {
// else {
// current = add[i];
// current = add[i];
// _add.push_back(add[i]);
// _add.push_back(add[i]);
...
@@ -327,9 +327,10 @@ void computeAdjacencies (Tet *t, int iFace, connSet &faceToTet){
...
@@ -327,9 +327,10 @@ void computeAdjacencies (Tet *t, int iFace, connSet &faceToTet){
}
}
}
}
bool
edgeSwaps
(
tetContainer
&
T
,
int
myThread
)
bool
edgeSwaps
(
tetContainer
&
T
,
int
myThread
)
{
{
// TODO
// TODO
return
false
;
}
}
...
@@ -359,7 +360,7 @@ void edgeBasedRefinement (const int numThreads,
...
@@ -359,7 +360,7 @@ void edgeBasedRefinement (const int numThreads,
// FILE *f = fopen ("pts_init.dat","w");
// FILE *f = fopen ("pts_init.dat","w");
// fprintf(f,"%d\n",all.size());
// fprintf(f,"%d\n",all.size());
// for (std::set<MVertex*>::iterator it = all.begin();it !=all.end(); ++it){
// for (std::set<MVertex*>::iterator it = all.begin();it !=all.end(); ++it){
// MVertex *mv = *it;
// MVertex *mv = *it;
// fprintf(f,"%12.5E %12.5E %12.5E\n",mv->x(),mv->y(),mv->z());
// fprintf(f,"%12.5E %12.5E %12.5E\n",mv->x(),mv->y(),mv->z());
// }
// }
// fclose(f);
// fclose(f);
...
@@ -455,7 +456,7 @@ void edgeBasedRefinement (const int numThreads,
...
@@ -455,7 +456,7 @@ void edgeBasedRefinement (const int numThreads,
std
::
vector
<
int
>
indices
;
std
::
vector
<
int
>
indices
;
SortHilbert
(
add
,
indices
);
SortHilbert
(
add
,
indices
);
double
t4
=
Cpu
();
double
t4
=
Cpu
();
delaunayTrgl
(
1
,
1
,
add
.
size
(),
&
add
,
allocator
,
1.e-28
);
delaunayTrgl
(
1
,
1
,
add
.
size
(),
&
add
,
allocator
,
1.e-28
);
double
t5
=
Cpu
();
double
t5
=
Cpu
();
add_all
.
insert
(
add_all
.
end
(),
add
.
begin
(),
add
.
end
());
add_all
.
insert
(
add_all
.
end
(),
add
.
begin
(),
add
.
end
());
Msg
::
Info
(
"IT %3d %8d points added, timings %5.2f %5.2f %5.2f %5.2f %5.2f %5d"
,
iter
,
add
.
size
(),
Msg
::
Info
(
"IT %3d %8d points added, timings %5.2f %5.2f %5.2f %5.2f %5.2f %5d"
,
iter
,
add
.
size
(),
...
@@ -474,7 +475,7 @@ void edgeBasedRefinement (const int numThreads,
...
@@ -474,7 +475,7 @@ void edgeBasedRefinement (const int numThreads,
for
(
unsigned
int
i
=
0
;
i
<
allocator
.
size
(
0
);
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
allocator
.
size
(
0
);
i
++
){
Tet
*
tt
=
allocator
(
0
,
i
);
Tet
*
tt
=
allocator
(
0
,
i
);
MVertex
*
mvs
[
4
];
MVertex
*
mvs
[
4
];
if
(
tt
->
V
[
0
]){
if
(
tt
->
V
[
0
]){
for
(
int
j
=
0
;
j
<
4
;
j
++
){
for
(
int
j
=
0
;
j
<
4
;
j
++
){
Vertex
*
v
=
tt
->
V
[
j
];
Vertex
*
v
=
tt
->
V
[
j
];
std
::
map
<
Vertex
*
,
MVertex
*>::
iterator
it
=
_ma
.
find
(
v
);
std
::
map
<
Vertex
*
,
MVertex
*>::
iterator
it
=
_ma
.
find
(
v
);
...
@@ -494,7 +495,7 @@ void edgeBasedRefinement (const int numThreads,
...
@@ -494,7 +495,7 @@ void edgeBasedRefinement (const int numThreads,
std
::
map
<
Edge
,
double
>
_sizes
;
std
::
map
<
Edge
,
double
>
_sizes
;
for
(
unsigned
int
i
=
0
;
i
<
allocator
.
size
(
0
);
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
allocator
.
size
(
0
);
i
++
){
Tet
*
tt
=
allocator
(
0
,
i
);
Tet
*
tt
=
allocator
(
0
,
i
);
if
(
tt
->
V
[
0
]){
if
(
tt
->
V
[
0
]){
for
(
int
j
=
0
;
j
<
6
;
j
++
){
for
(
int
j
=
0
;
j
<
6
;
j
++
){
Edge
e
=
tt
->
getEdge
(
j
);
Edge
e
=
tt
->
getEdge
(
j
);
std
::
map
<
Edge
,
double
>::
iterator
it
=
_sizes
.
find
(
e
);
std
::
map
<
Edge
,
double
>::
iterator
it
=
_sizes
.
find
(
e
);
...
...
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