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
057cdab7
Commit
057cdab7
authored
Jan 12, 2013
by
Tristan Carrier Baudouin
Browse files
Options
Downloads
Patches
Plain Diff
hexahedra
parent
fe9b71d6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/yamakawa.cpp
+140
-163
140 additions, 163 deletions
Mesh/yamakawa.cpp
with
140 additions
and
163 deletions
Mesh/yamakawa.cpp
+
140
−
163
View file @
057cdab7
// Gmsh - Copyright (C) 1997-201
1
C. Geuzaine, J.-F. Remacle
// Gmsh - Copyright (C) 1997-201
3
C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@geuz.org>.
...
...
@@ -502,27 +502,29 @@ void Recombinator::patern3(GRegion* gr){
void
Recombinator
::
merge
(
GRegion
*
gr
){
unsigned
int
i
;
int
count
;
int
idle
;
bool
flag
;
double
threshold
;
double
quality
;
double
coeff
;
MVertex
*
a
,
*
b
,
*
c
,
*
d
;
MVertex
*
e
,
*
f
,
*
g
,
*
h
;
MElement
*
element
;
std
::
set
<
MElement
*>
parts
;
std
::
vector
<
MTetrahedron
*>
opt
;
std
::
set
<
MElement
*>::
iterator
it
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it2
;
std
::
vector
<
MTetrahedron
*>::
iterator
it3
;
Hex
hex
;
count
=
1
;
idle
=
0
;
quality
=
0.0
;
for
(
i
=
0
;
i
<
potential
.
size
();
i
++
){
hex
=
potential
[
i
];
threshold
=
0.25
;
if
(
hex
.
get_quality
()
<
threshold
){
break
;
}
a
=
hex
.
get_a
();
b
=
hex
.
get_b
();
c
=
hex
.
get_c
();
...
...
@@ -543,7 +545,6 @@ void Recombinator::merge(GRegion* gr){
find
(
h
,
hex
,
parts
);
flag
=
1
;
for
(
it
=
parts
.
begin
();
it
!=
parts
.
end
();
it
++
){
element
=
*
it
;
it2
=
markings
.
find
(
element
);
...
...
@@ -552,29 +553,24 @@ void Recombinator::merge(GRegion* gr){
break
;
}
}
threshold
=
0.25
;
if
(
hex
.
get_quality
()
<
threshold
){
flag
=
0
;
}
if
(
!
flag
)
continue
;
if
(
!
valid
(
hex
,
parts
)){
flag
=
0
;
continue
;
}
if
(
!
conformityA
(
hex
)){
flag
=
0
;
continue
;
}
if
(
!
conformityB
(
hex
)){
flag
=
0
;
continue
;
}
if
(
!
conformityC
(
hex
)){
flag
=
0
;
continue
;
}
if
(
flag
){
printf
(
"%d - %d/%d - %f
\n
"
,
count
,
i
,(
int
)
potential
.
size
(),
hex
.
get_quality
());
quality
=
quality
+
hex
.
get_quality
();
for
(
it
=
parts
.
begin
();
it
!=
parts
.
end
();
it
++
){
...
...
@@ -586,28 +582,19 @@ void Recombinator::merge(GRegion* gr){
build_hash_tableA
(
hex
);
build_hash_tableB
(
hex
);
build_hash_tableC
(
hex
);
idle
=
0
;
count
++
;
}
else
{
idle
++
;
}
coeff
=
0.1
;
if
((
double
)
idle
>
coeff
*
(
double
)
potential
.
size
()
&&
potential
.
size
()
>
2000
){
break
;
}
}
opt
.
clear
();
opt
.
resize
(
gr
->
tetrahedra
.
size
());
opt
=
gr
->
tetrahedra
;
gr
->
tetrahedra
.
clear
();
it3
=
gr
->
tetrahedra
.
begin
();
while
(
it3
!=
gr
->
tetrahedra
.
end
()){
element
=
(
MElement
*
)(
*
it3
);
for
(
i
=
0
;
i
<
opt
.
size
();
i
++
){
element
=
(
MElement
*
)(
opt
[
i
]);
it2
=
markings
.
find
(
element
);
if
(
it2
->
second
==
1
){
it3
=
gr
->
tetrahedra
.
erase
(
it3
);
}
else
{
it3
++
;
if
(
it2
->
second
==
0
){
gr
->
tetrahedra
.
push_back
(
opt
[
i
]);
}
}
...
...
@@ -617,27 +604,30 @@ void Recombinator::merge(GRegion* gr){
void
Recombinator
::
improved_merge
(
GRegion
*
gr
){
unsigned
int
i
;
int
count
;
int
idle
;
bool
flag
;
double
threshold
;
double
quality
;
double
coeff
;
MVertex
*
a
,
*
b
,
*
c
,
*
d
;
MVertex
*
e
,
*
f
,
*
g
,
*
h
;
MElement
*
element
;
std
::
set
<
MElement
*>
parts
;
std
::
vector
<
MTetrahedron
*>
opt
;
std
::
set
<
MElement
*>::
iterator
it
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it2
;
std
::
vector
<
MTetrahedron
*>::
iterator
it3
;
Hex
hex
;
count
=
1
;
idle
=
0
;
quality
=
0.0
;
for
(
i
=
0
;
i
<
potential
.
size
();
i
++
){
hex
=
potential
[
i
];
threshold
=
0.25
;
if
(
hex
.
get_quality
()
<
threshold
){
break
;
}
a
=
hex
.
get_a
();
b
=
hex
.
get_b
();
c
=
hex
.
get_c
();
...
...
@@ -658,7 +648,6 @@ void Recombinator::improved_merge(GRegion* gr){
find
(
h
,
hex
,
parts
);
flag
=
1
;
for
(
it
=
parts
.
begin
();
it
!=
parts
.
end
();
it
++
){
element
=
*
it
;
it2
=
markings
.
find
(
element
);
...
...
@@ -667,29 +656,24 @@ void Recombinator::improved_merge(GRegion* gr){
break
;
}
}
threshold
=
0.25
;
if
(
hex
.
get_quality
()
<
threshold
){
flag
=
0
;
}
if
(
!
flag
)
continue
;
if
(
!
valid
(
hex
,
parts
)){
flag
=
0
;
continue
;
}
if
(
!
conformityA
(
hex
)){
flag
=
0
;
continue
;
}
if
(
!
conformityB
(
hex
)){
flag
=
0
;
continue
;
}
if
(
!
conformityC
(
hex
)){
flag
=
0
;
continue
;
}
if
(
flag
){
printf
(
"%d - %d/%d - %f
\n
"
,
count
,
i
,(
int
)
potential
.
size
(),
hex
.
get_quality
());
quality
=
quality
+
hex
.
get_quality
();
for
(
it
=
parts
.
begin
();
it
!=
parts
.
end
();
it
++
){
...
...
@@ -701,28 +685,19 @@ void Recombinator::improved_merge(GRegion* gr){
build_hash_tableA
(
hex
);
build_hash_tableB
(
hex
);
build_hash_tableC
(
hex
);
idle
=
0
;
count
++
;
}
else
{
idle
++
;
}
coeff
=
0.1
;
if
((
double
)
idle
>
coeff
*
(
double
)
potential
.
size
()
&&
potential
.
size
()
>
2000
){
break
;
}
}
opt
.
clear
();
opt
.
resize
(
gr
->
tetrahedra
.
size
());
opt
=
gr
->
tetrahedra
;
gr
->
tetrahedra
.
clear
();
it3
=
gr
->
tetrahedra
.
begin
();
while
(
it3
!=
gr
->
tetrahedra
.
end
()){
element
=
(
MElement
*
)(
*
it3
);
for
(
i
=
0
;
i
<
opt
.
size
();
i
++
){
element
=
(
MElement
*
)(
opt
[
i
]);
it2
=
markings
.
find
(
element
);
if
(
it2
->
second
==
1
){
it3
=
gr
->
tetrahedra
.
erase
(
it3
);
}
else
{
it3
++
;
if
(
it2
->
second
==
0
){
gr
->
tetrahedra
.
push_back
(
opt
[
i
]);
}
}
...
...
@@ -2077,9 +2052,9 @@ void Supplementary::merge(GRegion* gr){
MVertex
*
d
,
*
e
,
*
f
;
MElement
*
element
;
std
::
set
<
MElement
*>
parts
;
std
::
vector
<
MTetrahedron
*>
opt
;
std
::
set
<
MElement
*>::
iterator
it
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it2
;
std
::
vector
<
MTetrahedron
*>::
iterator
it3
;
Prism
prism
;
count
=
1
;
...
...
@@ -2088,6 +2063,11 @@ void Supplementary::merge(GRegion* gr){
for
(
i
=
0
;
i
<
potential
.
size
();
i
++
){
prism
=
potential
[
i
];
threshold
=
0.15
;
if
(
prism
.
get_quality
()
<
threshold
){
break
;
}
a
=
prism
.
get_a
();
b
=
prism
.
get_b
();
c
=
prism
.
get_c
();
...
...
@@ -2104,7 +2084,6 @@ void Supplementary::merge(GRegion* gr){
find
(
f
,
prism
,
parts
);
flag
=
1
;
for
(
it
=
parts
.
begin
();
it
!=
parts
.
end
();
it
++
){
element
=
*
it
;
it2
=
markings
.
find
(
element
);
...
...
@@ -2113,29 +2092,24 @@ void Supplementary::merge(GRegion* gr){
break
;
}
}
threshold
=
0.15
;
if
(
prism
.
get_quality
()
<
threshold
){
flag
=
0
;
}
if
(
!
flag
)
continue
;
if
(
!
valid
(
prism
,
parts
)){
flag
=
0
;
continue
;
}
if
(
!
conformityA
(
prism
)){
flag
=
0
;
continue
;
}
if
(
!
conformityB
(
prism
)){
flag
=
0
;
continue
;
}
if
(
!
conformityC
(
prism
)){
flag
=
0
;
continue
;
}
if
(
flag
){
printf
(
"%d - %d/%d - %f
\n
"
,
count
,
i
,(
int
)
potential
.
size
(),
prism
.
get_quality
());
quality
=
quality
+
prism
.
get_quality
();
for
(
it
=
parts
.
begin
();
it
!=
parts
.
end
();
it
++
){
...
...
@@ -2149,17 +2123,17 @@ void Supplementary::merge(GRegion* gr){
build_hash_tableC
(
prism
);
count
++
;
}
}
it3
=
gr
->
tetrahedra
.
begin
();
while
(
it3
!=
gr
->
tetrahedra
.
end
()){
element
=
(
MElement
*
)(
*
it3
);
opt
.
clear
();
opt
.
resize
(
gr
->
tetrahedra
.
size
());
opt
=
gr
->
tetrahedra
;
gr
->
tetrahedra
.
clear
();
for
(
i
=
0
;
i
<
opt
.
size
();
i
++
){
element
=
(
MElement
*
)(
opt
[
i
]);
it2
=
markings
.
find
(
element
);
if
(
it2
->
second
==
1
){
it3
=
gr
->
tetrahedra
.
erase
(
it3
);
}
else
{
it3
++
;
if
(
it2
->
second
==
0
){
gr
->
tetrahedra
.
push_back
(
opt
[
i
]);
}
}
...
...
@@ -2979,8 +2953,8 @@ void PostOp::pyramids1(GRegion* gr){
MElement
*
element
;
std
::
vector
<
MElement
*>
hexahedra
;
std
::
vector
<
MElement
*>
prisms
;
std
::
vector
<
MTetrahedron
*>
::
iterator
i
t
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it
2
;
std
::
vector
<
MTetrahedron
*>
op
t
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it
;
hexahedra
.
clear
();
prisms
.
clear
();
...
...
@@ -3030,15 +3004,16 @@ void PostOp::pyramids1(GRegion* gr){
pyramids1
(
b
,
c
,
f
,
e
,
gr
);
}
it
=
gr
->
tetrahedra
.
begin
();
while
(
it
!=
gr
->
tetrahedra
.
end
()){
element
=
(
MElement
*
)(
*
it
);
it2
=
markings
.
find
(
element
);
if
(
it2
->
second
==
1
){
it
=
gr
->
tetrahedra
.
erase
(
it
);
}
else
{
it
++
;
opt
.
clear
();
opt
.
resize
(
gr
->
tetrahedra
.
size
());
opt
=
gr
->
tetrahedra
;
gr
->
tetrahedra
.
clear
();
for
(
i
=
0
;
i
<
opt
.
size
();
i
++
){
element
=
(
MElement
*
)(
opt
[
i
]);
it
=
markings
.
find
(
element
);
if
(
it
->
second
==
0
){
gr
->
tetrahedra
.
push_back
(
opt
[
i
]);
}
}
}
...
...
@@ -3050,8 +3025,8 @@ void PostOp::pyramids2(GRegion* gr){
MElement
*
element
;
std
::
vector
<
MElement
*>
hexahedra
;
std
::
vector
<
MElement
*>
prisms
;
std
::
vector
<
MTetrahedron
*>
::
iterator
i
t1
;
std
::
vector
<
MPyramid
*>
::
iterator
i
t2
;
std
::
vector
<
MTetrahedron
*>
op
t1
;
std
::
vector
<
MPyramid
*>
op
t2
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it
;
hexahedra
.
clear
();
...
...
@@ -3102,27 +3077,29 @@ void PostOp::pyramids2(GRegion* gr){
pyramids2
(
b
,
c
,
f
,
e
,
gr
);
}
it1
=
gr
->
tetrahedra
.
begin
();
while
(
it1
!=
gr
->
tetrahedra
.
end
()){
element
=
(
MElement
*
)(
*
it1
);
opt1
.
clear
();
opt1
.
resize
(
gr
->
tetrahedra
.
size
());
opt1
=
gr
->
tetrahedra
;
gr
->
tetrahedra
.
clear
();
for
(
i
=
0
;
i
<
opt1
.
size
();
i
++
){
element
=
(
MElement
*
)(
opt1
[
i
]);
it
=
markings
.
find
(
element
);
if
(
it
->
second
==
1
){
it1
=
gr
->
tetrahedra
.
erase
(
it1
);
}
else
{
it1
++
;
if
(
it
->
second
==
0
){
gr
->
tetrahedra
.
push_back
(
opt1
[
i
]);
}
}
it2
=
gr
->
pyramids
.
begin
();
while
(
it2
!=
gr
->
pyramids
.
end
()){
element
=
(
MElement
*
)(
*
it2
);
opt2
.
clear
();
opt2
.
resize
(
gr
->
pyramids
.
size
());
opt2
=
gr
->
pyramids
;
gr
->
pyramids
.
clear
();
for
(
i
=
0
;
i
<
opt2
.
size
();
i
++
){
element
=
(
MElement
*
)(
opt2
[
i
]);
it
=
markings
.
find
(
element
);
if
(
it
->
second
==
1
){
it2
=
gr
->
pyramids
.
erase
(
it2
);
}
else
{
it2
++
;
if
(
it
->
second
==
0
){
gr
->
pyramids
.
push_back
(
opt2
[
i
]);
}
}
}
...
...
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