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
a277cdcf
Commit
a277cdcf
authored
12 years ago
by
Tristan Carrier Baudouin
Browse files
Options
Downloads
Patches
Plain Diff
periodic Voronoi
parent
96aef962
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/periodical.cpp
+77
-19
77 additions, 19 deletions
Mesh/periodical.cpp
with
77 additions
and
19 deletions
Mesh/periodical.cpp
+
77
−
19
View file @
a277cdcf
...
...
@@ -201,7 +201,7 @@ void voroMetal3D::execute(std::vector<SPoint3>& vertices)
}
}
printf
(
"Squared root of smallest face area : %.9f
\n
"
,
sqrt
(
min_area
));
printf
(
"
\n
Squared root of smallest face area : %.9f
\n
\n
"
,
sqrt
(
min_area
));
std
::
ofstream
file
(
"cells.pos"
);
file
<<
"View
\"
test
\"
{
\n
"
;
...
...
@@ -395,7 +395,6 @@ void voroMetal3D::correspondance(double e){
unsigned
int
i
;
unsigned
int
j
;
int
count
;
int
count2
;
bool
flag
;
double
x
,
y
,
z
;
double
delta_x
;
...
...
@@ -404,17 +403,24 @@ void voroMetal3D::correspondance(double e){
SPoint3
p1
;
SPoint3
p2
;
GFace
*
gf
;
GVertex
*
v1
;
GVertex
*
v2
;
GModel
*
model
=
GModel
::
current
();
GModel
::
fiter
it
;
std
::
vector
<
GFace
*>
faces
;
std
::
list
<
GVertex
*>
vertices
;
std
::
list
<
GEdge
*>
edges
;
std
::
map
<
GFace
*
,
SPoint3
>
centers
;
std
::
map
<
GFace
*
,
bool
>
markings
;
std
::
set
<
GVertex
*>
duplicate
;
std
::
list
<
GVertex
*>::
iterator
it2
;
std
::
map
<
GFace
*
,
SPoint3
>::
iterator
it3
;
std
::
map
<
GFace
*
,
SPoint3
>::
iterator
it4
;
std
::
map
<
GFace
*
,
bool
>::
iterator
it5
;
std
::
map
<
GFace
*
,
bool
>::
iterator
it6
;
std
::
list
<
GEdge
*>::
iterator
it7
;
std
::
set
<
GVertex
*>::
iterator
it8
;
std
::
set
<
GVertex
*>::
iterator
it9
;
faces
.
clear
();
...
...
@@ -456,14 +462,9 @@ void voroMetal3D::correspondance(double e){
}
count
=
0
;
count2
=
0
;
std
::
ofstream
file
;
file
.
open
(
"cells.geo"
,
std
::
ios
::
out
|
std
::
ios
::
app
);
std
::
ofstream
file2
(
"check.pos"
);
file2
<<
"View
\"
test
\"
{
\n
"
;
printf
(
"Face 1 nbr. - Face 2 nbr.
\n
"
);
std
::
ofstream
file
(
"check.pos"
);
file
<<
"View
\"
test
\"
{
\n
"
;
for
(
i
=
0
;
i
<
faces
.
size
();
i
++
){
for
(
j
=
0
;
j
<
faces
.
size
();
j
++
){
...
...
@@ -510,24 +511,81 @@ void voroMetal3D::correspondance(double e){
it5
->
second
=
1
;
it6
->
second
=
1
;
printf
(
"%d %d
\n
"
,
faces
[
i
]
->
tag
(),
faces
[
j
]
->
tag
());
print_segment
(
p1
,
p2
,
file2
);
//file << faces[i]->tag() << " " << faces[j]->tag() << "\n";
print_segment
(
p1
,
p2
,
file
);
count
++
;
}
else
{
count2
++
;
}
}
}
}
file
2
<<
"};
\n
"
;
file
<<
"};
\n
"
;
printf
(
"Number of
linked
exterior faces : %d
\n
"
,
2
*
count
);
printf
(
"
\n
Number of exterior face
periodicitie
s : %d
\n
"
,
2
*
count
);
printf
(
"Total number of exterior faces : %zu
\n
"
,
faces
.
size
());
printf
(
"Number of mislinked : %d
\n
"
,
count2
-
count
);
duplicate
.
clear
();
for
(
i
=
0
;
i
<
faces
.
size
();
i
++
){
gf
=
faces
[
i
];
edges
=
gf
->
edges
();
for
(
it7
=
edges
.
begin
();
it7
!=
edges
.
end
();
it7
++
){
duplicate
.
insert
((
*
it7
)
->
getBeginVertex
());
duplicate
.
insert
((
*
it7
)
->
getEndVertex
());
}
}
count
=
0
;
std
::
ofstream
file2
(
"vertices"
);
for
(
it8
=
duplicate
.
begin
();
it8
!=
duplicate
.
end
();
it8
++
){
v1
=
*
it8
;
for
(
it9
=
duplicate
.
begin
();
it9
!=
duplicate
.
end
();
it9
++
){
v2
=
*
it9
;
delta_x
=
fabs
(
v2
->
x
()
-
v1
->
x
());
delta_y
=
fabs
(
v2
->
y
()
-
v1
->
y
());
delta_z
=
fabs
(
v2
->
z
()
-
v1
->
z
());
if
(
equal
(
delta_x
,
1.0
,
e
)
&&
equal
(
delta_y
,
0.0
,
e
)
&&
equal
(
delta_z
,
0.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
if
(
equal
(
delta_x
,
0.0
,
e
)
&&
equal
(
delta_y
,
1.0
,
e
)
&&
equal
(
delta_z
,
0.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
if
(
equal
(
delta_x
,
0.0
,
e
)
&&
equal
(
delta_y
,
0.0
,
e
)
&&
equal
(
delta_z
,
1.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
if
(
equal
(
delta_x
,
1.0
,
e
)
&&
equal
(
delta_y
,
1.0
,
e
)
&&
equal
(
delta_z
,
0.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
if
(
equal
(
delta_x
,
0.0
,
e
)
&&
equal
(
delta_y
,
1.0
,
e
)
&&
equal
(
delta_z
,
1.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
if
(
equal
(
delta_x
,
1.0
,
e
)
&&
equal
(
delta_y
,
0.0
,
e
)
&&
equal
(
delta_z
,
1.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
if
(
equal
(
delta_x
,
1.0
,
e
)
&&
equal
(
delta_y
,
1.0
,
e
)
&&
equal
(
delta_z
,
1.0
,
e
)){
file2
<<
v1
->
tag
()
<<
" "
<<
v2
->
tag
()
<<
"
\n
"
;
count
++
;
}
}
}
printf
(
"
\n
Number of exterior vertex periodicities : %d
\n
"
,
count
);
printf
(
"Total number of exterior vertices : %zu
\n\n
"
,
duplicate
.
size
());
}
bool
voroMetal3D
::
equal
(
double
x
,
double
y
,
double
e
){
...
...
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