Commit 1ff6331a authored by Sergey Kireev's avatar Sergey Kireev
Browse files

Initial commit

parents
Pipeline #53 failed with stages
#!/usr/bin/gnuplot
#nx=500
#ny=500
#nt0=0
#nt=100000
#nts=100
#prefix="data"
#suffix=".dat"
#title=""
#sx=800
#sy=800
if (!exists("nt0")) nt0=0
if (!exists("prefix")) prefix="data"
if (!exists("suffix")) suffix=".dat"
if (!exists("title")) title=""
if (!exists("sx")) sx=800
if (!exists("sy")) sy=800
if (!exists("colorn")) colorn="yellow"
if (!exists("colorl")) colorl="#b52000"
if (!exists("colore")) colore="black"
set terminal gif animate size sx,sy
set termoption enhanced
set output prefix.".gif"
set xrange[-1:2*nx+1]
set yrange[ny:-1]
set cbrange[1:-1]
unset colorbox
set palette defined ( -1 colore, 0 colorl, 1 colorn )
fmt=prefix."%08d".suffix
do for [it=nt0:nt:nts] {
str=sprintf(fmt,it);
tit=sprintf("%s%08d",title,it)
set title tit
plot str binary array=(2*nx+1,ny) format="%d" with image
}
#!/usr/bin/gnuplot
#nx=500
#ny=500
#nt0=0
#nt=100000
#nts=100
#prefix="data"
#suffix=".dat"
#title=""
#sx=800
#sy=800
if (!exists("nt0")) nt0=0
if (!exists("prefix")) prefix="data"
if (!exists("suffix")) suffix=".dat"
if (!exists("title")) title=""
if (!exists("sx")) sx=800
if (!exists("sy")) sy=800
if (!exists("colorn")) colorn="yellow"
if (!exists("colorl")) colorl="#b52000"
if (!exists("colore")) colore="black"
set terminal gif animate size sx,sy
set termoption enhanced
set output prefix.".gif"
set xrange[-1:nx]
set yrange[ny:-1]
set cbrange[1:-1]
unset colorbox
set palette defined ( -1 colore, 0 colorl, 1 colorn )
fmt=prefix."%08d".suffix
do for [it=nt0:nt:nts] {
str=sprintf(fmt,it);
tit=sprintf("%s%08d",title,it)
set title tit
plot str binary array=(nx,ny) format="%d" with image
}
#!/usr/bin/gnuplot
#nx=500
#ny=500
#nt0=0
#nt=100000
#nts=100
#prefix="data"
#suffix=".dat"
#title=""
#sx=800
#sy=800
if (!exists("nt0")) nt0=0
if (!exists("prefix")) prefix="data"
if (!exists("suffix")) suffix=".dat"
if (!exists("title")) title=""
if (!exists("sx")) sx=800
if (!exists("sy")) sy=800
if (!exists("colorn")) colorn="yellow"
if (!exists("colorl")) colorl="#b52000"
if (!exists("colore")) colore="black"
set terminal png size sx,sy
set termoption enhanced
set xrange[-1:2*nx+1]
set yrange[ny:-1]
set cbrange[1:-1]
unset colorbox
set palette defined ( -1 colore, 0 colorl, 1 colorn )
fmt=prefix."%08d".suffix
do for [it=nt0:nt:nts] {
str=sprintf(fmt,it);
set output str.".png"
tit=sprintf("%s%08d",title,it)
set title tit
plot str binary array=(2*nx+1,ny) format="%d" with image
}
#!/usr/bin/gnuplot
#nx=500
#ny=500
#nt0=0
#nt=100000
#nts=100
#prefix="data"
#suffix=".dat"
#title=""
#sx=800
#sy=800
if (!exists("nt0")) nt0=0
if (!exists("prefix")) prefix="data"
if (!exists("suffix")) suffix=".dat"
if (!exists("title")) title=""
if (!exists("sx")) sx=800
if (!exists("sy")) sy=800
if (!exists("colorn")) colorn="yellow"
if (!exists("colorl")) colorl="#b52000"
if (!exists("colore")) colore="black"
set terminal png size sx,sy
set termoption enhanced
set xrange[-1:nx]
set yrange[ny:-1]
set cbrange[1:-1]
unset colorbox
set palette defined ( -1 colore, 0 colorl, 1 colorn )
fmt=prefix."%08d".suffix
do for [it=nt0:nt:nts] {
str=sprintf(fmt,it);
set output str.".png"
tit=sprintf("%s%08d",title,it)
set title tit
plot str binary array=(nx,ny) format="%d" with image
}
#!/bin/bash
source ./do_parameters.sh
LC_NUMERIC="en_US.UTF-8"
# Check if executable is present
if [ ! -x $executable ]; then
echo "Error: executable file '${executable}' not found!"
echo "Please, run \"make clean ; make\" to built the executable."
exit
fi
if [ "$cell" != "hex" ]; then
cell="square"
script_png="$scripts_dir/make_png_sqr.plt"
script_gif="$scripts_dir/make_gif_sqr.plt"
else
script_png="$scripts_dir/make_png_hex.plt"
script_gif="$scripts_dir/make_gif_hex.plt"
fi
for (( en100=${minn}; en100 <= ${maxn}; en100 += ${step} )); do
for (( enl100=${minnl}; enl100 < ${en100} && enl100 <= $maxnl; enl100 += ${step} )); do
for (( el100=${minl}; el100 < ${enl100} && el100 <= $maxl; el100 += ${step} )); do
en1=`echo "scale=2; ${en100}/100" | bc`
enl1=`echo "scale=2; ${enl100}/100" | bc`
el1=`echo "scale=2; ${el100}/100" | bc`
en=`printf "%04.2f" ${en1}`
enl=`printf "%04.2f" ${enl1}`
el=`printf "%04.2f" ${el1}`
name="en${en}_enl${enl}_el${el}"
title="e_n=${en} e_{nl}=${enl} e_l=${el} Step: "
echo ${name}
#continue
$executable -$cell -nsize $nsize -nx $nx -ny $ny -nt $nt -nts $nts -en $en -enl $enl -el $el -kt $kt -evap $evap -cond $cond -ipn $ipn -ipl $ipl -ipe $ipe -ofp $prefix -ofs $suffix -short | tee ${name}.txt
cat ${name}.txt >> output.txt
echo Making gif...
gnuplot -e "nx=${nx}; ny=${ny}; nt=${nt}; nts=${nts}; prefix=\"${prefix}\"; suffix=\"${suffix}\"; title=\"${title}\"" $script_gif
[ ! -d $gifdir ] && mkdir $gifdir
mv ${prefix}.gif $gifdir/${name}.gif
echo Making png...
gnuplot -e "nx=${nx}; ny=${ny}; nt=${nt}; nts=${nts}; prefix=\"${prefix}\"; suffix=\"${suffix}\"; title=\"${title}\"" $script_png
[ ! -d $pngdir ] && mkdir $pngdir
[ ! -d $pngdir/${name}_png ] && mkdir $pngdir/${name}_png
mv *.png $pngdir/${name}_png/
cd $pngdir
tar czf ${name}_png.tgz ${name}_png && rm -r ${name}_png
cd ..
echo Moving dat...
[ ! -d $datdir ] && mkdir $datdir
[ ! -d $datdir/${name}_dat ] && mkdir $datdir/${name}_dat
mv *.dat $datdir/${name}_dat/
cd $datdir
tar czf ${name}_dat.tgz ${name}_dat && rm -r ${name}_dat
cd ..
done
done
done
#!/bin/bash
export cell=hex
export nsize=3
export nx=500
export ny=500
export nt=100000
export nts=1000
#export np=100
#export en=2.0
#export el=1.0
#export enl=1.5
export kt=1.0
#export mu=-2.25
export evap=0.0
export cond=0.0
# initial parts
export ipn=0.4
export ipl=0.6
export ipe=0.0
export prefix="data"
export suffix=".dat"
export min=0
export max=500
export step=20
export minn=$min
export maxn=$max
export minnl=$min
export maxnl=$max
export minl=$min
export maxl=$max
export datdir="dat"
export pngdir="png"
export gifdir="gif"
export datfindir="dat_$nt"
export pngfindir="png_$nt"
export png2ddir="png2d_$nt"
export gif_sorted_dir="gif_sorted"
export png_sorted_dir="png_sorted"
export picsx=600
export picsy=600
#2d: pixels per picture
export ppp=200
#!/bin/bash
export cell=hex
export nsize=3
export nx=100
export ny=100
export nt=1000
export nts=100
#export np=100
#export en=2.0
#export el=1.0
#export enl=1.5
export kt=1.0
#export mu=-2.25
export evap=0.0
export cond=0.0
# initial parts
export ipn=0.4
export ipl=0.6
export ipe=0.0
export prefix="data"
export suffix=".dat"
export min=0
export max=100
export step=20
export minn=$min
export maxn=$max
export minnl=$min
export maxnl=$max
export minl=$min
export maxl=$max
export datdir="dat"
export pngdir="png"
export gifdir="gif"
export datfindir="dat_$nt"
export pngfindir="png_$nt"
export png2ddir="png2d_$nt"
export gif_sorted_dir="gif_sorted"
export png_sorted_dir="png_sorted"
export picsx=600
export picsy=600
#2d: pixels per picture
export ppp=200
export executable="../../src/nle"
export scripts_dir="../gnuplot"
#!/bin/bash
export cell=hex
export nsize=3
export nx=100
export ny=100
export nt=1000
export nts=100
#export np=100
#export en=2.0
#export el=1.0
#export enl=1.5
export kt=1.0
#export mu=-2.25
export evap=0.0
export cond=0.0
# initial parts
export ipn=0.4
export ipl=0.6
export ipe=0.0
export prefix="data"
export suffix=".dat"
export min=0
export max=100
export step=20
export minn=$min
export maxn=$max
export minnl=$min
export maxnl=$max
export minl=$min
export maxl=$max
export datdir="dat"
export pngdir="png"
export gifdir="gif"
export datfindir="dat_$nt"
export pngfindir="png_$nt"
export png2ddir="png2d_$nt"
export gif_sorted_dir="gif_sorted"
export png_sorted_dir="png_sorted"
export picsx=600
export picsy=600
#2d: pixels per picture
export ppp=200
#!/bin/bash
initial_step=0
if [ $# -lt 1 ]; then
echo "Usage: $0 <filename> [<initial_step_number>]"
exit
fi
file_to_load=$1
if [ $# -gt 1 ]; then
initial_step=$2
fi
echo "File to load: $file_to_load Initial step: ${initial_step}"
source ./parameters.sh
# Check if directory with the same name exist
if [ -d $name ]; then
echo "Directory '$name' already exist!"
echo "Delete or rename it, or change the name in the top of the $0 file."
exit
fi
# Check if executable is present
if [ ! -x $executable ]; then
echo "Error: executable file '${executable}' not found!"
echo "Please, run \"make clean ; make\" to built the executable."
exit
fi
# Set cell geometry
if [ "$cell" != "hex" ]; then
cell="square"
script_png="$scripts_dir/make_png_sqr.plt"
script_gif="$scripts_dir/make_gif_sqr.plt"
else
script_png="$scripts_dir/make_png_hex.plt"
script_gif="$scripts_dir/make_gif_hex.plt"
fi
echo "Name: ${name}"
mkdir $name
# Run simulation
./${executable} -nx $nx -ny $ny -nt $nt -nts $nts -ntp $ntp -nsize $nsize -$cell \
-en $en -el $el -enl $enl -kt $kt -mu $mu -evap $evap -cond $cond \
-ipn $ipn -ipl $ipl -ipe $ipe \
-load $file_to_load -it $initial_step \
-ofp $prefix -ofs $suffix | tee ${name}/${name}.txt
# check exit code
[ ${PIPESTATUS[0]} -eq 0 ] || { rm -r $name ; exit ; }
echo "Making gif..."
gnuplot -e "nx=${nx}; ny=${ny}; nt=${initial_step}+${nt}; nts=${nts}; nt0=${initial_step};
prefix=\"${prefix}\"; suffix=\"${suffix}\";
title=\"${pic_title}\"; sx=${pic_size_x}; sy=${pic_size_y};
colorn=\"${colorN}\"; colorl=\"${colorL}\"; colore=\"${colorE}\"" ${script_gif}
mv ${prefix}.gif ${name}/${name}.gif
echo "Making png..."
gnuplot -e "nx=${nx}; ny=${ny}; nt=${initial_step}+${nt}; nts=${nts}; nt0=${initial_step};
prefix=\"${prefix}\"; suffix=\"${suffix}\";
title=\"${pic_title}\"; sx=${pic_size_x}; sy=${pic_size_y};
colorn=\"${colorN}\"; colorl=\"${colorL}\"; colore=\"${colorE}\"" ${script_png}
[ ! -d ${name}/png ] && mkdir ${name}/png
mv *.png ${name}/png
echo "Moving dat..."
[ ! -d ${name}/dat ] && mkdir ${name}/dat
mv *.dat ${name}/dat
#!/bin/bash
initial_step=0
if [ $# -gt 0 ]; then
initial_step=$1
fi
echo "Initial step: ${initial_step}"
source ./parameters.sh
# Check if directory with the same name exist
if [ ! -d $name ]; then
echo "Directory '$name' does not exist!"
exit
fi
# Set cell geometry
if [ "$cell" != "hex" ]; then
script_png="$scripts_dir/make_png_sqr.plt"
script_gif="$scripts_dir/make_gif_sqr.plt"
else
script_png="$scripts_dir/make_png_hex.plt"
script_gif="$scripts_dir/make_gif_hex.plt"
fi
cd ${name}/dat
echo "Making gif..."
gnuplot -e "nx=${nx}; ny=${ny}; nt=${initial_step}+${nt}; nts=${nts}; nt0=${initial_step};
prefix=\"${prefix}\"; suffix=\"${suffix}\";
title=\"${pic_title}\"; sx=${pic_size_x}; sy=${pic_size_y};
colorn=\"${colorN}\"; colorl=\"${colorL}\"; colore=\"${colorE}\"" ../../${script_gif}
mv -f ${prefix}.gif ../${name}.gif
echo "Making png..."
gnuplot -e "nx=${nx}; ny=${ny}; nt=${initial_step}+${nt}; nts=${nts}; nt0=${initial_step};
prefix=\"${prefix}\"; suffix=\"${suffix}\";
title=\"${pic_title}\"; sx=${pic_size_x}; sy=${pic_size_y};
colorn=\"${colorN}\"; colorl=\"${colorL}\"; colore=\"${colorE}\"" ../../${script_png}
[ ! -d ../png ] && mkdir ../png
mv -f *.png ../png
cd ../..
#!/bin/bash
#------------------------------------------------------------
# Simulation parameters
#------------------------------------------------------------
# Name of the run
export name="run01"
# Cell geometry: square/hex
export cell=hex
# Array sizes
export nx=200
export ny=200
# Nanocrystal size
export nsize=3
# Number of simulation steps
export nt=10000
# Steps between saving to file
export nts=100
# Steps between printing output
export ntp=100
# Model parameters
export en=4.6
export el=1.0
export enl=1.2
export kt=1.0
export mu=-2.25
# Probabitity of evaporation and condensation
export evap=0.0
export cond=0.0
# Initial fraction of N,L,E
export ipn=0.4
export ipl=0.6
export ipe=0.0
# Parts of the names of the output files
export prefix="data"
export suffix=".dat"
# Picture sizes, pixels
export pic_size_x=600
export pic_size_y=600
# Picture colors (https://www.google.ru/search?q=gnuplot+color+names)
export colorN=yellow
export colorL="#b52000"
export colorE=black
# Picture title
export pic_title="e_l=${el} e_{nl}=${enl} e_n=${en} Step:"
# directories
export executable="../../src/nle"
export scripts_dir="../gnuplot"
#!/bin/bash
source ./parameters.sh
# Check if directory with the same name exist
if [ -d $name ]; then
echo "Directory '$name' already exist!"
echo "Delete or rename it, or change the name in the top of the $0 file."
exit
fi
# Check if executable is present
if [ ! -x $executable ]; then