Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88146473
custom_output.pl
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
Thu, Oct 17, 01:34
Size
705 B
Mime Type
text/x-perl
Expires
Sat, Oct 19, 01:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21718866
Attached To
rLAMMPS lammps
custom_output.pl
View Options
#!/usr/bin/perl
#
Open
the
custom
output
from
the
custom_output
.
cc
program
open
A
,
"packing.custom1"
or
die
"Can't open file \"packing.custom1\"\n"
;
#
Open
the
POV
-
Ray
file
open
B
,
">custom_output_p.pov"
or
die
"Can't open output file\n"
;
#
Loop
over
all
lines
in
the
packing
.
custom1
file
while
(
<
A
>
)
{
#
Use
a
regular
expression
to
get
the
particle
position
and
the
number
#
of
faces
of
the
Voronoi
cell
.
These
will
be
stored
in
the
variables
#
$
1
and
$
2
.
m
/
pos=\
((.
*
)
\
).
*
faces=
(
\d*
)
/
;
#
Print
a
sphere
to
the
POV
-
Ray
file
,
giving
it
a
different
texture
#
depending
on
the
number
of
faces
of
the
Voronoi
cell
print
B
"sphere{<$1>,0.5 texture{t$2}}\n"
;
}
#
Close
the
two
files
close
A
;
close
B
;
Event Timeline
Log In to Comment