Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72643378
percolation.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 16, 08:45
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Jul 18, 08:45 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
19082853
Attached To
rDLMA Diffusion limited mixed aggregation
percolation.cpp
View Options
#include <post.h>
namespace
post_p
{
bool
postprocessing
::
check_percolation
()
{
init_unfolding
();
bool
percolation_test
=
false
;
for
(
int
i
=
0
;
i
<
totalClusters_
;
i
++
){
for
(
int
axis
=
0
;
axis
<
dim
();
axis
++
)
{
percolation_test
=
(
percolation_test
||
cluster_percolation
(
i
,
axis
));
}
}
return
percolation_test
;
}
void
postprocessing
::
dump_percolation_file
(
char
*
filename
)
{
FILE
*
f
;
f
=
fopen
(
filename
,
"w"
);
fprintf
(
f
,
"cluster_number,"
);
for
(
int
axis
=
0
;
axis
<
dim
();
axis
++
){
if
(
axis
==
(
dim
()
-
1
))
fprintf
(
f
,
"percolation_x%d
\n
"
,
axis
);
else
fprintf
(
f
,
"percolation_x%d,"
,
axis
);
}
for
(
int
i
=
0
;
i
<
totalClusters_
;
i
++
){
fprintf
(
f
,
"%d,"
,
i
);
for
(
int
axis
=
0
;
axis
<
dim
();
axis
++
){
if
(
axis
==
(
dim
()
-
1
))
fprintf
(
f
,
"%d
\n
"
,
cluster_percolation
(
i
,
axis
));
else
fprintf
(
f
,
"%d,"
,
cluster_percolation
(
i
,
axis
));
}
}
fclose
(
f
);
}
void
postprocessing
::
dump_percolation_file
()
{
printf
(
"cluster_number,"
);
for
(
int
axis
=
0
;
axis
<
dim
();
axis
++
){
if
(
axis
==
(
dim
()
-
1
))
printf
(
"percolation_x%d
\n
"
,
axis
);
else
printf
(
"percolation_x%d,"
,
axis
);
}
for
(
int
i
=
0
;
i
<
totalClusters_
;
i
++
){
printf
(
"%d,"
,
i
);
for
(
int
axis
=
0
;
axis
<
dim
();
axis
++
){
if
(
axis
==
(
dim
()
-
1
))
printf
(
"%d
\n
"
,
cluster_percolation
(
i
,
axis
));
else
printf
(
"%d,"
,
cluster_percolation
(
i
,
axis
));
}
}
}
}
Event Timeline
Log In to Comment