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
d790d76b
Commit
d790d76b
authored
9 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
more enhancements, bu i still have 30% of performances to recover from my standalone code
parent
5460fbfa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mesh/delaunay3d.cpp
+5
-11
5 additions, 11 deletions
Mesh/delaunay3d.cpp
Mesh/delaunay_refinement.cpp
+3
-3
3 additions, 3 deletions
Mesh/delaunay_refinement.cpp
with
8 additions
and
14 deletions
Mesh/delaunay3d.cpp
+
5
−
11
View file @
d790d76b
...
@@ -517,7 +517,7 @@ static Tet* randomTet (int thread, tetContainer &allocator ){
...
@@ -517,7 +517,7 @@ static Tet* randomTet (int thread, tetContainer &allocator ){
}
}
//
#define _VERBOSE 1
#define _VERBOSE 1
void
delaunayTrgl
(
const
unsigned
int
numThreads
,
void
delaunayTrgl
(
const
unsigned
int
numThreads
,
const
unsigned
int
NPTS_AT_ONCE
,
const
unsigned
int
NPTS_AT_ONCE
,
unsigned
int
Npts
,
unsigned
int
Npts
,
...
@@ -528,7 +528,7 @@ void delaunayTrgl (const unsigned int numThreads,
...
@@ -528,7 +528,7 @@ void delaunayTrgl (const unsigned int numThreads,
double
totCavityGlob
=
0
;
double
totCavityGlob
=
0
;
#endif
#endif
// checkLocalDelaunayness(
T
, "initial");
// checkLocalDelaunayness(
allocator, 0
, "initial");
std
::
vector
<
int
>
invalidCavities
(
numThreads
);
std
::
vector
<
int
>
invalidCavities
(
numThreads
);
std
::
vector
<
int
>
cacheMisses
(
numThreads
,
0
);
std
::
vector
<
int
>
cacheMisses
(
numThreads
,
0
);
...
@@ -552,6 +552,7 @@ void delaunayTrgl (const unsigned int numThreads,
...
@@ -552,6 +552,7 @@ void delaunayTrgl (const unsigned int numThreads,
double
totCavity
=
0
;
double
totCavity
=
0
;
std
::
vector
<
cavityContainer
>
cavity
(
NPTS_AT_ONCE
);
std
::
vector
<
cavityContainer
>
cavity
(
NPTS_AT_ONCE
);
std
::
vector
<
connContainer
>
bnd
(
NPTS_AT_ONCE
);
std
::
vector
<
connContainer
>
bnd
(
NPTS_AT_ONCE
);
std
::
vector
<
bool
>
ok
(
NPTS_AT_ONCE
);
connContainer
faceToTet
;
connContainer
faceToTet
;
std
::
vector
<
Tet
*>
Choice
(
NPTS_AT_ONCE
);
std
::
vector
<
Tet
*>
Choice
(
NPTS_AT_ONCE
);
for
(
unsigned
int
K
=
0
;
K
<
NPTS_AT_ONCE
;
K
++
)
Choice
[
K
]
=
randomTet
(
myThread
,
allocator
);
for
(
unsigned
int
K
=
0
;
K
<
NPTS_AT_ONCE
;
K
++
)
Choice
[
K
]
=
randomTet
(
myThread
,
allocator
);
...
@@ -631,7 +632,6 @@ void delaunayTrgl (const unsigned int numThreads,
...
@@ -631,7 +632,6 @@ void delaunayTrgl (const unsigned int numThreads,
#pragma omp barrier
#pragma omp barrier
std
::
vector
<
bool
>
ok
(
NPTS_AT_ONCE
);
for
(
unsigned
int
K
=
0
;
K
<
NPTS_AT_ONCE
;
K
++
)
{
for
(
unsigned
int
K
=
0
;
K
<
NPTS_AT_ONCE
;
K
++
)
{
if
(
!
vToAdd
[
K
])
ok
[
K
]
=
false
;
if
(
!
vToAdd
[
K
])
ok
[
K
]
=
false
;
else
ok
[
K
]
=
canWeProcessCavity
(
cavity
[
K
],
myThread
,
K
);
else
ok
[
K
]
=
canWeProcessCavity
(
cavity
[
K
],
myThread
,
K
);
...
@@ -648,13 +648,7 @@ void delaunayTrgl (const unsigned int numThreads,
...
@@ -648,13 +648,7 @@ void delaunayTrgl (const unsigned int numThreads,
Choice
[
K
]
=
cavityK
[
0
];
Choice
[
K
]
=
cavityK
[
0
];
for
(
unsigned
int
i
=
0
;
i
<
bSize
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
bSize
;
i
++
)
{
// reuse memory slots of invalid elements
// reuse memory slots of invalid elements
Tet
*
t
;
Tet
*
t
=
(
i
<
cSize
)
?
cavityK
[
i
]
:
allocator
.
newTet
(
myThread
);
if
(
i
<
cSize
)
{
t
=
cavityK
[
i
];
}
else
{
t
=
allocator
.
newTet
(
myThread
);
}
if
(
i
<
cSize
&&
t
->
V
[
0
]
->
_thread
!=
myThread
)
cacheMisses
[
myThread
]
++
;
if
(
i
<
cSize
&&
t
->
V
[
0
]
->
_thread
!=
myThread
)
cacheMisses
[
myThread
]
++
;
t
->
setVerticesNoTest
(
bndK
[
i
].
f
.
V
[
0
],
bndK
[
i
].
f
.
V
[
1
],
bndK
[
i
].
f
.
V
[
2
],
vToAdd
[
K
]);
t
->
setVerticesNoTest
(
bndK
[
i
].
f
.
V
[
0
],
bndK
[
i
].
f
.
V
[
1
],
bndK
[
i
].
f
.
V
[
2
],
vToAdd
[
K
]);
Tet
*
neigh
=
bndK
[
i
].
t
;
Tet
*
neigh
=
bndK
[
i
].
t
;
...
@@ -672,7 +666,7 @@ void delaunayTrgl (const unsigned int numThreads,
...
@@ -672,7 +666,7 @@ void delaunayTrgl (const unsigned int numThreads,
computeAdjacencies
(
t
,
3
,
faceToTet
);
computeAdjacencies
(
t
,
3
,
faceToTet
);
}
}
for
(
unsigned
int
i
=
bSize
;
i
<
cSize
;
i
++
)
{
for
(
unsigned
int
i
=
bSize
;
i
<
cSize
;
i
++
)
{
cavityK
[
i
]
->
V
[
0
]
=
cavityK
[
i
]
->
V
[
1
]
=
cavityK
[
i
]
->
V
[
2
]
=
cavityK
[
i
]
->
V
[
3
]
=
NULL
;
cavityK
[
i
]
->
V
[
0
]
=
NULL
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Mesh/delaunay_refinement.cpp
+
3
−
3
View file @
d790d76b
...
@@ -140,9 +140,9 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
...
@@ -140,9 +140,9 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
else
{
else
{
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
=
1.e-1
0
*
(
double
)
rand
()
/
RAND_MAX
;
const
double
dx
=
1.e-1
2
*
(
double
)
rand
()
/
RAND_MAX
;
const
double
dy
=
1.e-1
0
*
(
double
)
rand
()
/
RAND_MAX
;
const
double
dy
=
1.e-1
2
*
(
double
)
rand
()
/
RAND_MAX
;
const
double
dz
=
1.e-1
0
*
(
double
)
rand
()
/
RAND_MAX
;
const
double
dz
=
1.e-1
2
*
(
double
)
rand
()
/
RAND_MAX
;
S
.
push_back
(
new
Vertex
(
p
.
x
()
+
dx
,
p
.
y
()
+
dy
,
p
.
z
()
+
dz
,
lc
));
S
.
push_back
(
new
Vertex
(
p
.
x
()
+
dx
,
p
.
y
()
+
dy
,
p
.
z
()
+
dz
,
lc
));
L
+=
interval
;
L
+=
interval
;
}
}
...
...
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