美文网首页
2020-03-30 辐射计算 & scanning(正则表达式

2020-03-30 辐射计算 & scanning(正则表达式

作者: 锅炉工的自我修养 | 来源:发表于2020-03-30 23:24 被阅读0次

小结

    1. 修改辐射公式
    1. 编写输出辐射相关的的脚本格式化存储
    1. 修改对应你的read_case_s.m
    1. debug for matlab scrpits
    1. 修改 mat2d script
    1. 新版本solps-iter完全使用
    1. 编写,带有过滤功能的scan scripts
    1. 做选择非常消耗精力,设置默认函数,减少选择耗散
    • 无明显优势,前者优先

修改辐射计算公式

#!/bin/bash

# function: calculate the radiation and save in 2D_data/radiation_w.last10

base_path=`pwd`
if [ ! -d "${base_path}/2D_data" ]
then
        mkdir 2D_data
        echo "Create the 2D_data file "
else
        #echo "2D_data has existed."
fi

# ==================== get the radiation information ========================== #
    # core radiation
echo "comp brna 0.0 rmma pot m* 0 0 sumz ev rm* -1.0 rm* brhe m- b2ra 0 0 sumz m+ b2br 0 0 sumz m+ 1 nreg m* sumx sumy jxa writ f.y " | b2plot >& /dev/null ; less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","core_t",$2)}' > "${base_path}/2D_data/radiation_w.last10"
    # sol radiation
echo "comp brna 0.0 rmma pot m* 0 0 sumz ev rm* -1.0 rm* brhe m- b2ra 0 0 sumz m+ b2br 0 0 sumz m+ 2 nreg m* sumx sumy jxa writ f.y " | b2plot >& /dev/null ; less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","sol_t",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # it radiation
echo "comp brna 0.0 rmma pot m* 0 0 sumz ev rm* -1.0 rm* brhe m- b2ra 0 0 sumz m+ b2br 0 0 sumz m+ 3 nreg m* sumx sumy jxa writ f.y " | b2plot >& /dev/null ; less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","it_t",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # ot radiation
echo "comp brna 0.0 rmma pot m* 0 0 sumz ev rm* -1.0 rm* brhe m- b2ra 0 0 sumz m+ b2br 0 0 sumz m+ 4 nreg m* sumx sumy jxa writ f.y " | b2plot >& /dev/null ; less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","ot_t",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # total radiation
echo "comp brna 0.0 rmma pot m* 0 0 sumz ev rm* -1.0 rm* brhe m- b2ra 0 0 sumz m+ b2br 0 0 sumz m+ sumx sumy jxa writ f.y " | b2plot >& /dev/null ; less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","total_t",$2)}' >> "${base_path}/2D_data/radiation_w.last10"

# ================================= radiation of carbon ========================= #
    # core radiation
echo "comp b2ra 2 8 sumz b2br 2 8 sumz m+ 1 nreg m* sumx sumy jxa writ f.y" | b2plot >&/dev/null;less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","core_c",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # sol radiation
echo "comp b2ra 2 8 sumz b2br 2 8 sumz m+ 2 nreg m* sumx sumy jxa writ f.y" | b2plot >&/dev/null;less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","sol_c",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # it radiation
echo "comp b2ra 2 8 sumz b2br 2 8 sumz m+ 3 nreg m* sumx sumy jxa writ f.y" | b2plot >&/dev/null;less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","it_c",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # ot radiation
echo "comp b2ra 2 8 sumz b2br 2 8 sumz m+ 4 nreg m* sumx sumy jxa writ f.y" | b2plot >&/dev/null;less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","ot_c",$2)}' >> "${base_path}/2D_data/radiation_w.last10"
    # total radiation
echo "comp b2ra 2 8 sumz b2br 2 8 sumz m+ sumx sumy jxa writ f.y" | b2plot >&/dev/null;less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("%8s: %f\n","total_c",$2)}' >> "${base_path}/2D_data/radiation_w.last10"

less "${base_path}/2D_data/radiation_w.last10"


如何存储

echo "comp brna 0.0 rmma pot m* 0 0 sumz ev rm* -1.0 rm* brhe m- b2ra 0 0 sumz m+ b2br 0 0 sumz m+ 1 nreg m* sumx sumy jxa writ f.y " | b2plot > & /dev/null ; less b2pl.exe.dir/b2plot.write | tail -n1 | awk '{printf("test: %f\n", $2)}' > test

修改内容

    1. read_case_*.m
    1. 修改 data_scan
    1. 修改most_data
      --

新集群使用

    1. 检查是否设 ps
    1. 修改 DEVICE 为 HL-2M
    1. 设置快捷键
# .bashrc
alias solps='cd $HOME/version/solps-iter'
  • 4.测试并行是否打开
which b2mn.exe
# default for turnning on the mpi
set_mpi # add in the tail of setup.csh 
# add some alias

    1. 移动case

    1. 配置脚本

    1. 产生数据
scan path
    1. 修改辐射相关
    • 辐射功率分布

  • 碳辐射
  • mat2d_add
  • most_add

    1. 确认辐射没有出问题
    • 重新运行
    • 删除空文件
    • 调整输出信息
    • pdena 的输出:单独输出这个不能画图,plot_tri_eirene

awk 使用shell变量

#!/bin/bash 
 
# sepcify the father path of case cluster 
path=${1} 
 
# specify the string, containning in casename 
 
if [ $# -lt 1 ] ; then 
        echo "Please enter the path. " 
        exit 0 
elif [ $# -gt 1 ]; then 
        cn=${2} 
else     
        cn='MW' # default value 
fi 
 
 
# get the case_namelist, which you want to read  
rm case_namelist &>  /dev/null 
 
ls ${path} | awk '/'${cn}'/ {print $0}' > case_namelist 
while read -r case_name 
do 
        case_path="${path}/${case_name}" 
        if [ -d ${case_path} ] 
        then 
                cd "${path}/${case_name}" 
 
                # ====== callback your scripts in here ======== # 
                pwd 
 
                # ============================================= # 
        else 
                echo "Please check ${case_name}, which is not a directroy." 
        fi 
done < case_namelist

调用

scan /home/zhangyanjie/version/solps-iter/runs/hl-2m/SFD sf

read and save data

相关文章

网友评论

      本文标题:2020-03-30 辐射计算 & scanning(正则表达式

      本文链接:https://www.haomeiwen.com/subject/wmzmuhtx.html