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
04f00063
Commit
04f00063
authored
12 years ago
by
Tristan Carrier Baudouin
Browse files
Options
Downloads
Patches
Plain Diff
conformity
parent
f6433187
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mesh/yamakawa.cpp
+166
-48
166 additions, 48 deletions
Mesh/yamakawa.cpp
Mesh/yamakawa.h
+9
-3
9 additions, 3 deletions
Mesh/yamakawa.h
with
175 additions
and
51 deletions
Mesh/yamakawa.cpp
+
166
−
48
View file @
04f00063
...
...
@@ -2822,10 +2822,18 @@ void PostOp::execute(){
void
PostOp
::
execute
(
GRegion
*
gr
){
printf
(
"................PYRAMIDS................
\n
"
);
init_markings
(
gr
);
build_vertex_to_tetrahedra
(
gr
);
pyramids
(
gr
);
pyramids
(
gr
,
1
);
rearrange
(
gr
);
init_markings
(
gr
);
build_vertex_to_tetrahedra
(
gr
);
build_vertex_to_pyramids
(
gr
);
pyramids
(
gr
,
2
);
rearrange
(
gr
);
statistics
(
gr
);
}
...
...
@@ -2843,66 +2851,66 @@ void PostOp::init_markings(GRegion* gr){
}
}
void
PostOp
::
pyramids
(
GRegion
*
gr
){
void
PostOp
::
pyramids
(
GRegion
*
gr
,
int
step
){
unsigned
int
i
;
MVertex
*
a
,
*
b
,
*
c
,
*
d
;
MVertex
*
e
,
*
f
,
*
g
,
*
h
;
MElement
*
element
;
std
::
vector
<
MElement
*>
hexahedra
;
std
::
vector
<
MElement
*>
prisms
;
std
::
vector
<
MTetrahedron
*>::
iterator
it
;
std
::
map
<
MElement
*
,
bool
>::
iterator
it2
;
hexahedra
.
clear
();
prisms
.
clear
();
for
(
i
=
0
;
i
<
gr
->
getNumMeshElements
();
i
++
){
element
=
gr
->
getMeshElement
(
i
);
if
(
eight
(
element
)){
hexahedra
.
push_back
(
element
);
a
=
element
->
getVertex
(
0
);
b
=
element
->
getVertex
(
1
);
c
=
element
->
getVertex
(
2
);
d
=
element
->
getVertex
(
3
);
e
=
element
->
getVertex
(
4
);
f
=
element
->
getVertex
(
5
);
g
=
element
->
getVertex
(
6
);
h
=
element
->
getVertex
(
7
);
if
(
step
==
1
){
pyramids1
(
a
,
b
,
c
,
d
,
gr
);
pyramids1
(
e
,
f
,
g
,
h
,
gr
);
pyramids1
(
a
,
b
,
f
,
e
,
gr
);
pyramids1
(
b
,
c
,
g
,
f
,
gr
);
pyramids1
(
d
,
c
,
g
,
h
,
gr
);
pyramids1
(
d
,
a
,
e
,
h
,
gr
);
}
else
if
(
step
==
2
){
pyramids2
(
a
,
b
,
c
,
d
,
gr
);
pyramids2
(
e
,
f
,
g
,
h
,
gr
);
pyramids2
(
a
,
b
,
f
,
e
,
gr
);
pyramids2
(
b
,
c
,
g
,
f
,
gr
);
pyramids2
(
d
,
c
,
g
,
h
,
gr
);
pyramids2
(
d
,
a
,
e
,
h
,
gr
);
}
}
}
for
(
i
=
0
;
i
<
gr
->
getNumMeshElements
();
i
++
){
element
=
gr
->
getMeshElement
(
i
);
if
(
six
(
element
)){
prisms
.
push_back
(
element
);
}
}
for
(
i
=
0
;
i
<
hexahedra
.
size
();
i
++
){
element
=
hexahedra
[
i
];
a
=
element
->
getVertex
(
0
);
b
=
element
->
getVertex
(
1
);
c
=
element
->
getVertex
(
2
);
d
=
element
->
getVertex
(
3
);
e
=
element
->
getVertex
(
4
);
f
=
element
->
getVertex
(
5
);
g
=
element
->
getVertex
(
6
);
h
=
element
->
getVertex
(
7
);
pyramids
(
a
,
b
,
c
,
d
,
gr
);
pyramids
(
e
,
f
,
g
,
h
,
gr
);
pyramids
(
a
,
b
,
f
,
e
,
gr
);
pyramids
(
b
,
c
,
g
,
f
,
gr
);
pyramids
(
d
,
c
,
g
,
h
,
gr
);
pyramids
(
d
,
a
,
e
,
h
,
gr
);
}
for
(
i
=
0
;
i
<
prisms
.
size
();
i
++
){
element
=
prisms
[
i
];
a
=
element
->
getVertex
(
0
);
b
=
element
->
getVertex
(
1
);
c
=
element
->
getVertex
(
2
);
d
=
element
->
getVertex
(
3
);
e
=
element
->
getVertex
(
4
);
f
=
element
->
getVertex
(
5
);
a
=
element
->
getVertex
(
0
);
b
=
element
->
getVertex
(
1
);
c
=
element
->
getVertex
(
2
);
d
=
element
->
getVertex
(
3
);
e
=
element
->
getVertex
(
4
);
f
=
element
->
getVertex
(
5
);
pyramids
(
a
,
d
,
f
,
c
,
gr
);
pyramids
(
a
,
b
,
e
,
d
,
gr
);
pyramids
(
b
,
c
,
f
,
e
,
gr
);
if
(
step
==
1
){
pyramids1
(
a
,
d
,
f
,
c
,
gr
);
pyramids1
(
a
,
b
,
e
,
d
,
gr
);
pyramids1
(
b
,
c
,
f
,
e
,
gr
);
}
else
if
(
step
==
2
){
pyramids2
(
a
,
d
,
f
,
c
,
gr
);
pyramids2
(
a
,
b
,
e
,
d
,
gr
);
pyramids2
(
b
,
c
,
f
,
e
,
gr
);
}
}
}
it
=
gr
->
tetrahedra
.
begin
();
...
...
@@ -2918,7 +2926,7 @@ void PostOp::pyramids(GRegion* gr){
}
}
void
PostOp
::
pyramids
(
MVertex
*
a
,
MVertex
*
b
,
MVertex
*
c
,
MVertex
*
d
,
GRegion
*
gr
){
void
PostOp
::
pyramids
1
(
MVertex
*
a
,
MVertex
*
b
,
MVertex
*
c
,
MVertex
*
d
,
GRegion
*
gr
){
MVertex
*
vertex
;
std
::
set
<
MElement
*>
bin
;
std
::
set
<
MElement
*>
bin1
;
...
...
@@ -2929,8 +2937,8 @@ void PostOp::pyramids(MVertex* a,MVertex* b,MVertex* c,MVertex* d,GRegion* gr){
bin1
.
clear
();
bin2
.
clear
();
find
(
a
,
c
,
bin1
);
find
(
b
,
d
,
bin2
);
find
_tetrahedra
(
a
,
c
,
bin1
);
find
_tetrahedra
(
b
,
d
,
bin2
);
bin
.
clear
();
for
(
it
=
bin1
.
begin
();
it
!=
bin1
.
end
();
it
++
){
...
...
@@ -2958,6 +2966,60 @@ void PostOp::pyramids(MVertex* a,MVertex* b,MVertex* c,MVertex* d,GRegion* gr){
}
}
void
PostOp
::
pyramids2
(
MVertex
*
a
,
MVertex
*
b
,
MVertex
*
c
,
MVertex
*
d
,
GRegion
*
gr
){
bool
flag
;
std
::
set
<
MElement
*>
bin1
;
std
::
set
<
MElement
*>
bin2
;
std
::
set
<
MElement
*>
bin3
;
std
::
set
<
MElement
*>
bin4
;
std
::
set
<
MElement
*>
tetrahedra
;
std
::
set
<
MElement
*>
pyramids
;
std
::
set
<
MElement
*>::
iterator
it
;
flag
=
0
;
bin1
.
clear
();
bin2
.
clear
();
find_tetrahedra
(
a
,
c
,
bin1
);
find_tetrahedra
(
b
,
d
,
bin2
);
if
(
bin1
.
size
()
!=
0
)
flag
=
1
;
bin3
.
clear
();
bin4
.
clear
();
find_pyramids
(
a
,
c
,
bin3
);
find_pyramids
(
b
,
d
,
bin4
);
if
(
bin3
.
size
()
!=
0
)
flag
=
1
;
tetrahedra
.
clear
();
for
(
it
=
bin1
.
begin
();
it
!=
bin1
.
end
();
it
++
){
tetrahedra
.
insert
(
*
it
);
}
for
(
it
=
bin2
.
begin
();
it
!=
bin2
.
end
();
it
++
){
tetrahedra
.
insert
(
*
it
);
}
pyramids
.
clear
();
for
(
it
=
bin3
.
begin
();
it
!=
bin3
.
end
();
it
++
){
pyramids
.
insert
(
*
it
);
}
for
(
it
=
bin4
.
begin
();
it
!=
bin4
.
end
();
it
++
){
pyramids
.
insert
(
*
it
);
}
if
(
pyramids
.
size
()
==
1
){
printf
(
"A
\n
"
);
}
else
if
(
pyramids
.
size
()
==
2
){
printf
(
"B
\n
"
);
}
else
if
(
pyramids
.
size
()
==
0
&&
tetrahedra
.
size
()
>
1
){
printf
(
"C
\n
"
);
}
else
if
(
pyramids
.
size
()
==
0
&&
tetrahedra
.
size
()
==
1
){
printf
(
"D
\n
"
);
}
}
void
PostOp
::
rearrange
(
GRegion
*
gr
){
unsigned
int
i
;
MElement
*
element
;
...
...
@@ -3045,6 +3107,20 @@ bool PostOp::eight(MElement* element){
else
return
0
;
}
bool
PostOp
::
apex
(
MElement
*
element
,
MVertex
*
vertex
){
bool
flag
;
flag
=
0
;
if
(
five
(
element
)){
if
(
element
->
getVertex
(
4
)
==
vertex
){
flag
=
1
;
}
}
return
flag
;
}
MVertex
*
PostOp
::
find
(
MVertex
*
v1
,
MVertex
*
v2
,
MVertex
*
v3
,
MVertex
*
v4
,
MElement
*
element
){
int
i
;
MVertex
*
vertex
;
...
...
@@ -3063,7 +3139,7 @@ MVertex* PostOp::find(MVertex* v1,MVertex* v2,MVertex* v3,MVertex* v4,MElement*
return
pointer
;
}
void
PostOp
::
find
(
MVertex
*
v1
,
MVertex
*
v2
,
std
::
set
<
MElement
*>&
final
){
void
PostOp
::
find
_tetrahedra
(
MVertex
*
v1
,
MVertex
*
v2
,
std
::
set
<
MElement
*>&
final
){
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>::
iterator
it1
;
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>::
iterator
it2
;
...
...
@@ -3075,6 +3151,18 @@ void PostOp::find(MVertex* v1,MVertex* v2,std::set<MElement*>& final){
}
}
void
PostOp
::
find_pyramids
(
MVertex
*
v1
,
MVertex
*
v2
,
std
::
set
<
MElement
*>&
final
){
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>::
iterator
it1
;
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>::
iterator
it2
;
it1
=
vertex_to_pyramids
.
find
(
v1
);
it2
=
vertex_to_pyramids
.
find
(
v2
);
if
(
it1
!=
vertex_to_pyramids
.
end
()
&&
it2
!=
vertex_to_pyramids
.
end
()){
intersection
(
it1
->
second
,
it2
->
second
,
final
);
}
}
void
PostOp
::
intersection
(
const
std
::
set
<
MElement
*>&
bin1
,
const
std
::
set
<
MElement
*>&
bin2
,
std
::
set
<
MElement
*>&
final
){
std
::
set_intersection
(
bin1
.
begin
(),
bin1
.
end
(),
bin2
.
begin
(),
bin2
.
end
(),
std
::
inserter
(
final
,
final
.
end
()));
}
...
...
@@ -3107,4 +3195,34 @@ void PostOp::build_vertex_to_tetrahedra(GRegion* gr){
}
}
}
}
void
PostOp
::
build_vertex_to_pyramids
(
GRegion
*
gr
){
unsigned
int
i
;
int
j
;
MElement
*
element
;
MVertex
*
vertex
;
std
::
set
<
MElement
*>
bin
;
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>::
iterator
it
;
vertex_to_pyramids
.
clear
();
for
(
i
=
0
;
i
<
gr
->
getNumMeshElements
();
i
++
){
element
=
gr
->
getMeshElement
(
i
);
if
(
five
(
element
)){
for
(
j
=
0
;
j
<
element
->
getNumVertices
();
j
++
){
vertex
=
element
->
getVertex
(
j
);
it
=
vertex_to_pyramids
.
find
(
vertex
);
if
(
it
!=
vertex_to_pyramids
.
end
()){
it
->
second
.
insert
(
element
);
}
else
{
bin
.
clear
();
bin
.
insert
(
element
);
vertex_to_pyramids
.
insert
(
std
::
pair
<
MVertex
*
,
std
::
set
<
MElement
*>
>
(
vertex
,
bin
));
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Mesh/yamakawa.h
+
9
−
3
View file @
04f00063
...
...
@@ -233,6 +233,7 @@ class PostOp{
private:
std
::
map
<
MElement
*
,
bool
>
markings
;
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>
vertex_to_tetrahedra
;
std
::
map
<
MVertex
*
,
std
::
set
<
MElement
*>
>
vertex_to_pyramids
;
public:
PostOp
();
~
PostOp
();
...
...
@@ -241,8 +242,9 @@ class PostOp{
void
execute
(
GRegion
*
);
void
init_markings
(
GRegion
*
);
void
pyramids
(
GRegion
*
);
void
pyramids
(
MVertex
*
,
MVertex
*
,
MVertex
*
,
MVertex
*
,
GRegion
*
);
void
pyramids
(
GRegion
*
,
int
);
void
pyramids1
(
MVertex
*
,
MVertex
*
,
MVertex
*
,
MVertex
*
,
GRegion
*
);
void
pyramids2
(
MVertex
*
,
MVertex
*
,
MVertex
*
,
MVertex
*
,
GRegion
*
);
void
rearrange
(
GRegion
*
);
void
statistics
(
GRegion
*
);
...
...
@@ -251,10 +253,14 @@ class PostOp{
bool
six
(
MElement
*
);
bool
eight
(
MElement
*
);
bool
apex
(
MElement
*
,
MVertex
*
);
MVertex
*
find
(
MVertex
*
,
MVertex
*
,
MVertex
*
,
MVertex
*
,
MElement
*
);
void
find
(
MVertex
*
,
MVertex
*
,
std
::
set
<
MElement
*>&
);
void
find_tetrahedra
(
MVertex
*
,
MVertex
*
,
std
::
set
<
MElement
*>&
);
void
find_pyramids
(
MVertex
*
,
MVertex
*
,
std
::
set
<
MElement
*>&
);
void
intersection
(
const
std
::
set
<
MElement
*>&
,
const
std
::
set
<
MElement
*>&
,
std
::
set
<
MElement
*>&
);
void
build_vertex_to_tetrahedra
(
GRegion
*
);
void
build_vertex_to_pyramids
(
GRegion
*
);
};
\ No newline at end of file
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