Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:05

0001 #!/bin/bash -l 
0002 
0003 msg="=== $BASH_SOURCE :"
0004 ephoton-desc(){ cat << EOD
0005 $BASH_SOURCE:$FUNCNAME
0006 =========================
0007 
0008     TEST              : $TEST 
0009 
0010     EPHOTON_POST      : $EPHOTON_POST 
0011     EPHOTON_MOMW_POLW : $EPHOTON_MOMW_POLW
0012     EPHOTON_FLAG      : $EPHOTON_FLAG 
0013 
0014 EOD
0015 }
0016 
0017 ephoton-set(){
0018     local post=$1
0019     local momw_polw=$2
0020     local flag=$3
0021 
0022     export EPHOTON_POST=${EPHOTON_POST:-$post}
0023     export EPHOTON_MOMW_POLW=${EPHOTON_MOMW_POLW:-$momw_polw}
0024     export EPHOTON_FLAG=${EPHOTON_FLAG:-$flag}
0025 }
0026 
0027 ephoton-unset(){
0028     unset EPHOTON_POST 
0029     unset EPHOTON_MOMW_POLW
0030     unset EPHOTON_FLAG
0031 }
0032 
0033 ephoton-propagate_at_boundary_normal_incidence(){
0034     local post=0,0,0,0
0035     local momw_polw=0,0,-1,1,0,1,0,500
0036     local flag=0,0,0,0
0037     ephoton-set $post $momw_polw $flag 
0038 }
0039 
0040 ephoton-propagate_at_boundary(){
0041     local post=0,0,0,0
0042     #local momw_polw=1,0,-1,1,0,1,0,500   # 45 degree incidence against the normal 0,0,1  : but with 1.5/1.0 indices tahat is TIR
0043     #local momw_polw=1,0,1,1,0,1,0,500    # 45 degree incidence with the normal 0,0,1 : 
0044 
0045     #local momw_polw=1,0,-2,1,0,1,0,500   # steeper incidence against the normal 0,0,1  to avoid TIR
0046     local momw_polw=1,0,2,1,0,1,0,500   # steeper incidence with the normal 0,0,1  to avoid TIR
0047 
0048     local flag=0,0,0,0
0049     ephoton-set $post $momw_polw $flag 
0050 }
0051 
0052 ephoton-env(){
0053     local post=0,0,0,0
0054     local momw_polw=1,0,-1,1,0,1,0,500
0055     local flag=0,0,0,0
0056     ephoton-set $post $momw_polw $flag 
0057 }
0058 
0059 ephoton-reflect_specular(){
0060     local post=0,0,0,0
0061     local momw_polw=1,0,-1,1,0,1,0,500
0062     local flag=0,0,0,0
0063     ephoton-set $post $momw_polw $flag 
0064 }
0065 
0066 
0067 ephoton-mock_propagate_old(){
0068     local post=0,0,0,0
0069     local momw=1,0,-1,1
0070     local polw=0,1,0,500
0071     local flag=0,0,0,0
0072     ephoton-set $post ${momw},${polw} $flag 
0073 }
0074 
0075 ephoton-mock_propagate(){
0076     local post=0,0,0,0
0077     local momw=0,0,1,1
0078     local polw=0,1,0,500
0079     local flag=0,0,0,0
0080     ephoton-set $post ${momw},${polw} $flag 
0081 }
0082 
0083 ephoton-default(){
0084     ephoton-unset 
0085     echo $msg TEST $TEST : unset environment : will use C++ defaults in quad4::ephoton for p0
0086 }
0087 
0088 case $TEST in 
0089    propagate_at_boundary_normal_incidence) ephoton-propagate_at_boundary_normal_incidence ;;
0090    propagate_at_boundary)                  ephoton-propagate_at_boundary                  ;;
0091    env)                                    ephoton-env  ;;  
0092    reflect_specular)                       ephoton-reflect_specular  ;;
0093    mock_propagate*)                        ephoton-mock_propagate ;; 
0094                  *)                        ephoton-default ;;
0095 esac
0096 
0097 
0098 if [ -n "$VERBOSE" ]; then 
0099    ephoton-desc
0100 fi 
0101 
0102