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
0766c398
Commit
0766c398
authored
9 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
bug fixed, gets realluy fast now :-)
parent
13ffc6f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/delaunay_refinement.cpp
+13
-15
13 additions, 15 deletions
Mesh/delaunay_refinement.cpp
with
13 additions
and
15 deletions
Mesh/delaunay_refinement.cpp
+
13
−
15
View file @
0766c398
...
@@ -131,14 +131,16 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
...
@@ -131,14 +131,16 @@ 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
)
{
const
double
t
=
t1
+
(
L
+
interval
-
L0
)
*
(
t2
-
t1
)
/
dL
;
const
double
t
=
t1
+
(
L
+
interval
-
L0
)
*
(
t2
-
t1
)
/
dL
;
if
(
t
>=
t2
)
{
if
(
t
>=
t2
*
.999
)
{
break
;
break
;
}
}
else
{
else
{
// printf("%g ",t);
SPoint3
p
=
p1
*
(
1.
-
t
)
+
p2
*
t
;
SPoint3
p
=
p1
*
(
1.
-
t
)
+
p2
*
t
;
double
lc
=
e
.
first
->
lc
()
*
(
1.
-
t
)
+
e
.
second
->
lc
()
*
t
;
double
lc
=
e
.
first
->
lc
()
*
(
1.
-
t
)
+
e
.
second
->
lc
()
*
t
;
const
double
dx
=
0
;
//1.e-12 * (double) rand() / RAND_MAX;
const
double
dx
=
0
;
//1.e-12 * (double) rand() / RAND_MAX;
...
@@ -149,7 +151,8 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
...
@@ -149,7 +151,8 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
}
}
}
}
}
}
// printf(" press enter\n");
// getchar();
// printf("%d points added\n",S.size());
// printf("%d points added\n",S.size());
// exit(1);
// exit(1);
...
@@ -254,21 +257,15 @@ public:
...
@@ -254,21 +257,15 @@ public:
void
filterVertices
(
const
int
numThreads
,
void
filterVertices
(
const
int
numThreads
,
vertexFilter
&
_filter
,
vertexFilter
&
_filter
,
std
::
vector
<
Vertex
*>
&
S
,
std
::
vector
<
Vertex
*>
&
add
,
std
::
vector
<
Vertex
*>
&
add
,
double
(
*
f
)(
const
SPoint3
&
p
,
void
*
),
double
(
*
f
)(
const
SPoint3
&
p
,
void
*
),
void
*
data
)
{
void
*
data
)
{
// printf("before : %d points to add\n",add.size());
// double t1 = Cpu();
std
::
vector
<
int
>
indices
;
SortHilbert
(
add
,
indices
);
std
::
vector
<
Vertex
*>
_add
=
add
;
std
::
vector
<
Vertex
*>
_add
=
add
;
for
(
unsigned
int
i
=
0
;
i
<
S
.
size
();
i
++
){
SPoint3
p
(
S
[
i
]
->
x
(),
S
[
i
]
->
y
(),
S
[
i
]
->
z
());
// double l = f (p, data);
_filter
.
insert
(
S
[
i
]
);
}
add
.
clear
();
add
.
clear
();
// double t2 = Cpu();
for
(
unsigned
int
i
=
0
;
i
<
_add
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
_add
.
size
();
i
++
){
SPoint3
p
(
_add
[
i
]
->
x
(),
_add
[
i
]
->
y
(),
_add
[
i
]
->
z
());
SPoint3
p
(
_add
[
i
]
->
x
(),
_add
[
i
]
->
y
(),
_add
[
i
]
->
z
());
volumePointWithExclusionRegion
v
(
_add
[
i
]);
volumePointWithExclusionRegion
v
(
_add
[
i
]);
...
@@ -279,9 +276,6 @@ void filterVertices (const int numThreads,
...
@@ -279,9 +276,6 @@ void filterVertices (const int numThreads,
else
else
delete
_add
[
i
];
delete
_add
[
i
];
}
}
// double t3 = Cpu();
// printf("filter ---> %12.5E %12.5E \n",t2-t1,t3-t2);
// printf("after filter : %d points to add\n",add.size());
}
}
...
@@ -415,6 +409,10 @@ void edgeBasedRefinement (const int numThreads,
...
@@ -415,6 +409,10 @@ void edgeBasedRefinement (const int numThreads,
{
{
// vertexFilter _filter (bb, 20);
// vertexFilter _filter (bb, 20);
vertexFilter
_filter
;
vertexFilter
_filter
;
for
(
unsigned
int
i
=
0
;
i
<
_vertices
.
size
();
i
++
){
_filter
.
insert
(
_vertices
[
i
]
);
}
int
iter
=
1
;
int
iter
=
1
;
Msg
::
Info
(
"----------------------------------- SATUR FILTR SORTH DELNY TIME TETS"
);
Msg
::
Info
(
"----------------------------------- SATUR FILTR SORTH DELNY TIME TETS"
);
...
@@ -426,7 +424,7 @@ void edgeBasedRefinement (const int numThreads,
...
@@ -426,7 +424,7 @@ void edgeBasedRefinement (const int numThreads,
double
t1
=
Cpu
();
double
t1
=
Cpu
();
saturateEdges
(
ec
,
allocator
,
numThreads
,
add
,
_fx
,
NULL
);
saturateEdges
(
ec
,
allocator
,
numThreads
,
add
,
_fx
,
NULL
);
double
t2
=
Cpu
();
double
t2
=
Cpu
();
filterVertices
(
numThreads
,
_filter
,
_vertices
,
add
,
_fx
,
NULL
);
filterVertices
(
numThreads
,
_filter
,
add
,
_fx
,
NULL
);
double
t3
=
Cpu
();
double
t3
=
Cpu
();
if
(
add
.
empty
())
break
;
if
(
add
.
empty
())
break
;
// randomize vertices (EXTREMELY IMPORTANT FOR NOT DETERIORATING PERFORMANCE)
// randomize vertices (EXTREMELY IMPORTANT FOR NOT DETERIORATING PERFORMANCE)
...
...
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