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
Package registry
Model registry
Operate
Terraform modules
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
Romin Tomasetti
gmsh
Commits
5c4ccb7e
Commit
5c4ccb7e
authored
4 years ago
by
Célestin Marot
Browse files
Options
Downloads
Patches
Plain Diff
faster initialization of the first tet (which can be O(n^4) :p)
parent
673179c4
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
contrib/hxt/tetMesh/src/hxt_tetDelaunay.c
+32
-13
32 additions, 13 deletions
contrib/hxt/tetMesh/src/hxt_tetDelaunay.c
with
32 additions
and
13 deletions
contrib/hxt/tetMesh/src/hxt_tetDelaunay.c
+
32
−
13
View file @
5c4ccb7e
...
...
@@ -65,21 +65,40 @@ static inline HXTStatus hxtTetrahedraInit(HXTMesh* mesh, HXTNodeInfo* nodeInfo,
HXTVertex
*
vertices
=
(
HXTVertex
*
)
mesh
->
vertices
.
coord
;
// find non-coplanar vertices
double
orientation
=
0
.
0
;
int
orientation
=
0
;
uint32_t
i
=
0
,
j
=
1
,
k
=
2
,
l
=
3
;
for
(
i
=
0
;
orientation
==
0
.
0
&&
i
<
nToInsert
-
3
;
i
++
)
for
(
i
=
0
;
orientation
==
0
&&
i
<
nToInsert
-
3
;
i
++
)
{
for
(
j
=
i
+
1
;
orientation
==
0
.
0
&&
j
<
nToInsert
-
2
;
j
++
)
double
*
d
=
vertices
[
nodeInfo
[
i
].
node
].
coord
;
for
(
j
=
i
+
1
;
orientation
==
0
&&
j
<
nToInsert
-
2
;
j
++
)
{
for
(
k
=
j
+
1
;
orientation
==
0
.
0
&&
k
<
nToInsert
-
1
;
k
++
)
double
*
c
=
vertices
[
nodeInfo
[
j
].
node
].
coord
;
double
cdx
=
c
[
0
]
-
d
[
0
];
double
cdy
=
c
[
1
]
-
d
[
1
];
double
cdz
=
c
[
2
]
-
d
[
2
];
if
(
cdx
==
0
.
0
&&
cdy
==
0
.
0
&&
cdz
==
0
.
0
)
continue
;
for
(
k
=
j
+
1
;
orientation
==
0
&&
k
<
nToInsert
-
1
;
k
++
)
{
for
(
l
=
k
+
1
;
orientation
==
0
.
0
&&
l
<
nToInsert
;
l
++
)
double
*
b
=
vertices
[
nodeInfo
[
k
].
node
].
coord
;
double
bdx
=
b
[
0
]
-
d
[
0
];
double
bdy
=
b
[
1
]
-
d
[
1
];
double
bdz
=
b
[
2
]
-
d
[
2
];
double
crossx
=
bdy
*
cdz
-
bdz
*
cdy
;
double
crossy
=
bdz
*
cdx
-
bdx
*
cdz
;
double
crossz
=
bdx
*
cdy
-
bdx
*
cdy
;
// check for colinearity: cross product
if
(
crossx
==
0
.
0
&&
crossy
==
0
.
0
&&
crossz
==
0
.
0
)
continue
;
for
(
l
=
k
+
1
;
orientation
==
0
&&
l
<
nToInsert
;
l
++
)
{
orientation
=
orient3d
(
vertices
[
nodeInfo
[
i
].
node
].
coord
,
vertices
[
nodeInfo
[
j
].
node
].
coord
,
vertices
[
nodeInfo
[
k
].
node
].
coord
,
vertices
[
nodeInfo
[
l
].
node
].
coord
);
double
*
a
=
vertices
[
nodeInfo
[
l
].
node
].
coord
;
double
adx
=
a
[
0
]
-
d
[
0
];
double
ady
=
a
[
1
]
-
d
[
1
];
double
adz
=
a
[
2
]
-
d
[
2
];
double
det
=
adx
*
crossx
+
ady
*
crossy
+
adz
*
crossz
;
orientation
=
(
det
>
o3dstaticfilter
)
-
(
det
<
-
o3dstaticfilter
);
}
}
}
...
...
@@ -87,8 +106,8 @@ static inline HXTStatus hxtTetrahedraInit(HXTMesh* mesh, HXTNodeInfo* nodeInfo,
l
--
;
k
--
;
j
--
;
i
--
;
if
(
orientation
==
0
.
0
){
return
HXT_ERROR_MSG
(
HXT_STATUS_FAILED
,
"all vertices are coplanar"
);
if
(
orientation
==
0
){
return
HXT_ERROR_MSG
(
HXT_STATUS_FAILED
,
"all vertices are
coplanar or nearly
coplanar"
);
}
// swap 0<->i 1<->j 2<->k 3<->l
...
...
@@ -119,7 +138,7 @@ static inline HXTStatus hxtTetrahedraInit(HXTMesh* mesh, HXTNodeInfo* nodeInfo,
}
if
(
orientation
>
0
.
0
){
if
(
orientation
>
0
){
uint32_t
tmp
=
i
;
i
=
j
;
j
=
tmp
;
...
...
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