You can set a new calculation mode with a new keyword in calcmod
file by following way.
- Define a new variable corresponding to the new calculation mode in
struct.h
file.
- The value with the keyword are read by
ReadcalcmodFile
function in readdef.cpp
.
In the following, we describe the detail of the flow of setting the calculation mode.
- Set initial value at the beginning of ReadcalcmodFile function.
X->iCalcType=0;
X->iFlgFiniteTemperature=0;
X->iCalcModel=0;
X->iOutputMode=0;
X->iCalcEigenVec=0;
X->iInitialVecType=0;
X->iOutputEigenVec=0;
X->iInputEigenVec=0;
X->iOutputHam=0;
X->iInputHam=0;
X->iFlgCalcSpec=0;
X->iReStart=0;
X->iFlgMPI=0;
- Each line is read by
fgetsMPI
function. GetKWWithIdx
function reads ctmp = keyword, itmp=index. while(
fgetsMPI(ctmpLine, D_CharTmpReadDef+D_CharKWDMAX, fp)!=NULL ){
if(iret==1) continue;
return(-1);
}
X->iCalcType=itmp;
}
...
}
The line is divided into keyword and number by using CheckWords
function.
For example, when you add new key word "NTest", you can get the value as follows:
- See also
- ReadcalcmodFile, CheckWords