diff --git a/examples/hexagonal/modes/00_params.sh b/examples/hexagonal/modes/00_params.sh index 3f512f2..050c80f 100644 --- a/examples/hexagonal/modes/00_params.sh +++ b/examples/hexagonal/modes/00_params.sh @@ -25,7 +25,7 @@ export B2Y_nmi=$(bc <<< '4*pi/3/'${SEPARATION_nm}) # a K-point coordinates export KPOINTX_nmi=$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm}) -export KPOINTY_nmi=$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm}) +export KPOINTY_nmi=0.0 #$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm}) export RADIUS_nm=50 export HEIGHT_nm=50 diff --git a/examples/hexagonal/modes/01a_realfreq_svd.sh b/examples/hexagonal/modes/01a_realfreq_svd.sh new file mode 100755 index 0000000..64a2a75 --- /dev/null +++ b/examples/hexagonal/modes/01a_realfreq_svd.sh @@ -0,0 +1,16 @@ +#!/bin/bash +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +MISCDIR=../../../misc + +source ${SCRIPTDIR}/00_params.sh + +${MISCDIR}/lat2d_realfreqsvd.py \ + -B $BG_REFINDEX \ + -b s${A1X_nm}e-9 s${A1Y_nm}e-9 \ + -b s${A2X_nm}e-9 s${A2Y_nm}e-9 \ + -p s${P1X_nm}e-9 s${P1Y_nm}e-9 \ + -p s${P2X_nm}e-9 s${P2Y_nm}e-9 \ + -L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \ + -k s${KPOINTX_nmi}e9 s${KPOINTY_nmi}e9 \ + -F 1.3 0.001 1.5 \ + -P diff --git a/qpms/argproc.py b/qpms/argproc.py index b947ff2..cc48d78 100644 --- a/qpms/argproc.py +++ b/qpms/argproc.py @@ -114,6 +114,20 @@ def sfloat(string): else: raise exc return res +def sint(string): + '''Tries to match an int, or an int with prepended 's' + + Used as a workaraound for argparse's negative number matcher if '+' is used as a + prefix + ''' + try: + res = int(string) + except ValueError as exc: + if string[0] == 's': + res = int(string[1:]) + else: raise exc + return res + def material_spec(string): """Tries to parse a string as a material specification, i.e. a real or complex number or one of the string in built-in Lorentz-Drude models.