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
d8a138b6
Commit
d8a138b6
authored
12 years ago
by
Tristan Carrier Baudouin
Browse files
Options
Downloads
Patches
Plain Diff
Voronoi 3D
parent
8d6b49c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/periodical.cpp
+40
-3
40 additions, 3 deletions
Mesh/periodical.cpp
with
40 additions
and
3 deletions
Mesh/periodical.cpp
+
40
−
3
View file @
d8a138b6
...
@@ -366,12 +366,19 @@ void voroMetal3D::print_geo_face_loop(int index,std::vector<int>& indices,std::o
...
@@ -366,12 +366,19 @@ void voroMetal3D::print_geo_face_loop(int index,std::vector<int>& indices,std::o
}
}
void
voroMetal3D
::
correspondance
(){
void
voroMetal3D
::
correspondance
(){
int
i
;
unsigned
int
i
;
unsigned
int
j
;
bool
flag
;
double
e
;
GFace
*
gf
;
GFace
*
gf
;
GModel
*
model
=
GModel
::
current
();
GModel
*
model
=
GModel
::
current
();
GModel
::
fiter
it
;
GModel
::
fiter
it
;
std
::
vector
<
GFace
*>
faces
;
std
::
vector
<
GFace
*>
faces
;
std
::
map
<
GFace
*
,
bool
>
markings
;
std
::
map
<
GFace
*
,
bool
>
markings
;
std
::
map
<
GFace
*
,
bool
>::
iterator
it1
;
std
::
map
<
GFace
*
,
bool
>::
iterator
it2
;
surface_params
params1
;
surface_params
params2
;
faces
.
clear
();
faces
.
clear
();
...
@@ -393,7 +400,37 @@ void voroMetal3D::correspondance(){
...
@@ -393,7 +400,37 @@ void voroMetal3D::correspondance(){
markings
.
insert
(
std
::
pair
<
GFace
*
,
bool
>
(
faces
[
i
],
0
));
markings
.
insert
(
std
::
pair
<
GFace
*
,
bool
>
(
faces
[
i
],
0
));
}
}
e
=
0.000001
;
std
::
ofstream
file
;
std
::
ofstream
file
;
file
.
open
(
"cells.geo"
,
std
::
ios
::
out
|
std
::
ios
::
app
);
file
.
open
(
"cells.geo"
,
std
::
ios
::
out
|
std
::
ios
::
app
);
//geofile << "test\n";
for
(
i
=
0
;
i
<
faces
.
size
();
i
++
){
for
(
j
=
0
;
j
<
faces
.
size
();
j
++
){
flag
=
0
;
params1
=
faces
[
i
]
->
getSurfaceParams
();
params2
=
faces
[
j
]
->
getSurfaceParams
();
if
(
fabs
(
params1
.
cx
-
params2
.
cx
)
<
1.0
+
e
&&
fabs
(
params1
.
cx
-
params2
.
cx
)
>
1.0
-
e
&&
fabs
(
params1
.
cy
-
params2
.
cy
)
<
e
&&
fabs
(
params1
.
cz
-
params2
.
cz
)
<
e
){
flag
=
1
;
}
if
(
fabs
(
params1
.
cy
-
params2
.
cy
)
<
1.0
+
e
&&
fabs
(
params1
.
cy
-
params2
.
cy
)
>
1.0
-
e
&&
fabs
(
params1
.
cx
-
params2
.
cx
)
<
e
&&
fabs
(
params1
.
cz
-
params2
.
cz
)
<
e
){
flag
=
1
;
}
if
(
fabs
(
params1
.
cz
-
params2
.
cz
)
<
1.0
+
e
&&
fabs
(
params1
.
cz
-
params2
.
cz
)
>
1.0
-
e
&&
fabs
(
params1
.
cy
-
params2
.
cy
)
<
e
&&
fabs
(
params1
.
cx
-
params2
.
cx
)
<
e
){
flag
=
1
;
}
if
(
flag
){
it1
=
markings
.
find
(
faces
[
i
]);
it2
=
markings
.
find
(
faces
[
j
]);
if
(
it1
->
second
==
0
&&
it2
->
second
==
0
){
it1
->
second
=
1
;
it2
->
second
=
1
;
file
<<
faces
[
i
]
->
tag
()
<<
" "
<<
faces
[
j
]
->
tag
()
<<
"
\n
"
;
}
}
}
}
}
}
\ 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