14 #define MAX_INPUTOPTION_HASH_NUMBER 20
19 {
"a_x",
"a_y",
"a_z",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
20 {
"Band_size",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
21 {
"ConvCriteriaTol",
"Check_iteration_period",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
22 {
"Direction",
"domain_mat(1)",
"domain_orig(1)",
"domain_size(1)",
"domain_shape(1)",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
23 {
"evmin",
"evmax",
"Eigenvector_Flag",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
24 {
"Find_eigenvalue_number",
"Find_degenerated_ev_number",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
25 {
"Geometry_Origin",
"Geometry_Size",
"Geometry_Shape",
"Geometry_Material",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
26 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
27 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
28 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
29 {
"k_points",
"kx",
"ky",
"kz",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
30 {
"Load_in_MIC",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
31 {
"MatrixFileName",
"Matrix_Dimension",
"Max_iteration_Number",
"MPI_Level",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
32 {
"Number_of_nonzero_entries",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
33 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
34 {
"periodicity_elec",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
35 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
36 {
"Reorthogonalization",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
37 {
"Sorting_before_CSR_building",
"Save_atom_map",
"Save_Hamiltonian",
"Structure_type",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
38 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
39 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
40 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
41 {
"Wave_Function_Flag",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
42 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
43 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
44 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" },
45 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" }
61 char szTemp[1024], ch;
62 int i, nIndex, nLength = strlen(pszBuffer);
65 for (i = 0; i < nLength; ++i)
68 if (
' ' != ch &&
'\r' != ch &&
'\n' != ch &&
'\t' != ch &&
'[' != ch &&
']' != ch)
69 szTemp[nIndex++] = pszBuffer[i];
71 szTemp[nIndex] = NULL;
72 strcpy(pszBuffer, szTemp);
80 char szTemp[1024], ch;
81 int i, nIndex, nLength = strlen(pszBuffer);
84 for (i = 0; i < nLength; ++i)
87 if (
'\r' != ch &&
'\n' != ch &&
'\t' != ch &&
'[' != ch &&
']' != ch)
88 szTemp[nIndex++] = pszBuffer[i];
90 szTemp[nIndex] = NULL;
91 strcpy(pszBuffer, szTemp);
99 char szTemp[1024], ch;
100 int i, nIndex, nLength = strlen(pszBuffer);
103 for (i = 0; i < nLength; ++i)
110 for (; i < nLength; ++i)
113 szTemp[nIndex++] = pszBuffer[i];
116 szTemp[nIndex] = NULL;
117 strcpy(pszBuffer, szTemp);
128 char strSperate[] =
" ";
131 token = strtok(pszBuffer, strSperate);
133 while (token != NULL)
135 pParam[nCount++] = atof(token);
137 if (nParamSize == nCount)
140 token = strtok(NULL, strSperate);
152 char szValue[1024] =
"";
225 lpParam->
fevMin = atof(szValue);
228 lpParam->
fevMax = atof(szValue);
257 lpParam->
fOrigin[nSubIndex - 1][
_X] = param[0];
258 lpParam->
fOrigin[nSubIndex - 1][
_Y] = param[1];
259 lpParam->
fOrigin[nSubIndex - 1][
_Z] = param[2];
281 strcpy(lpParam->
szShape[nSubIndex - 1], szValue);
282 if (!strcmp(lpParam->
szShape[nSubIndex - 1],
"Box"))
284 else if (!strcmp(lpParam->
szShape[nSubIndex - 1],
"Cylinder"))
293 strcpy(lpParam->
szDomainMat[nSubIndex - 1], szValue);
402 lpParam->
bSaveMapFile = atoi(szValue) == 1 ?
true :
false;
440 strcpy(pszValue, strrchr(pszOption,
'=') + 1);;
456 opt = fopen(pszInputCommnadFileName,
"rt");
466 while (fgets(szBuffer, 1024, opt))
468 nHash = (int)szBuffer[0];
473 if (nHash >= 48 && nHash <= 57)
484 if (nHash < 0 || nHash > 26)
524 unsigned int nLastIndex, i;
527 for (i = nStart; i < strlen(pszBuffer); ++i)
529 if (
')' == pszBuffer[i])
536 if (99999 == nLastIndex)
539 strncpy(szNumber, pszBuffer + nStart, nLastIndex - nStart);
540 szNumber[nLastIndex - nStart] = NULL;
541 if (0 == strlen(szNumber))
544 return atoi(szNumber);
char szDataFileName[1024]
Hamiltonian data file name only for calculating eigen value from file.
unsigned int nMPILevel
MPI Grouping level.
static void TrimStringEx(char *pszBuffer)
Trim string using white spapce not including ' '.
static void GetValueAfterEqualString(char *pszOption, char *pszValue)
Extracting string after equal charater postion.
static unsigned int ExtractOptionIndex(char *pszBuffer, int nHash, int nOptIndex)
Get Number of Index. ex) Geometry_Origin(1)=[ 0 0 0 ], -> Get '1' from option string.
#define HASH_SARP
Command file parameter names.
#define MAX_INPUTOPTION_HASH_NUMBER
static void InitData(LPINPUT_CMD_PARAM lpParam)
Initialize some default parameter.
bool bSaveHamiltonian
Save Hamiltonian matrix or not.
This class for parsing input command file.
static void ExtractParam(char *pszBuffer, double *pParam, int nParamSize)
Extracing paramter in string.
double fKValueInit[3]
Init k point value.
double fKValueFinal[3]
Final k point value.
bool bSortBeforeCSRBuilding
When solve lanczos without geometric building, determine sorting data before building CSR...
int nShape[NMAXDOMAIN]
Geometric Shape.
bool bDoSelectiveReorthogonalization
Option for doing selective reorthogonalization or not.
static void SetOptionParam(LPINPUT_CMD_PARAM lpParam, char *pszOption, int nHash, int nOptIndex)
Setting option variable.
bool bCalculateEigenVectors
Option for doing calculating eigen vectors or not.
unsigned int nBandSize
Band basis size.
static LPINPUT_CMD_PARAM ParsingInputCommand(char *pszInputCommnadFileName)
Parsing Commaind file.
double fevMin
Eigen value minimun value boundary.
int nFindingEigenValueCount
Eigen value count for want to find.
char * g_inputOption[27][MAX_INPUTOPTION_HASH_NUMBER]
bool bNeedRotate
Calculation parameter that need to apply rotation matrix.
bool bCalculateWaveFunction
Option for doing calculating wave function or not.
int nLanczosIterationCount
A counts of lanczos interation.
unsigned int nFindingDegeneratedEVCount
Degenerated eigenvalue count for want to find.
Structure for save input command file parsing result.
double fShapeLength[NMAXDOMAIN][3]
Shap length x, y, z, direction.
double fevMax
Eigen value maximun value boundary.
double fDirection[3]
Direction x, y, z.
bool bSaveMapFile
Save atom map or not.
char szDomainMat[NMAXDOMAIN][1024]
Material type.
int nSubDomainNumber
Numbers of Subdomain, except main domain.
double fUnitcellLength[3]
Unitcell length x, y, z direction.
bool bUsingCubeModel
Option for using cube model or not.
int nMatrixNonzeroElementCount
Non zero count in Hamiltonian matrix only for calculating eigen value from file.
char szStructureType[1024]
Structure type.
double fConvergeceCriteria
Eigen value convergence criteria.
double fKPoints
K point count.
char szShape[NMAXDOMAIN][1024]
Geometric Shape.
static void TrimSpaceEdge(char *pszBuffer)
Trim space both side of string.
struct CKNCommandFileParser::INPUT_CMD_PARAM * LPINPUT_CMD_PARAM
int nMatrixDemension
Hamiltonian matrix demension.
int nCheckEigenvalueInterval
A interval for checking T matrix eigenvlaue.
bool bConsiderBoundaryCondition[3]
Considering bondary condition or not x, y, z direction.
static void TrimString(char *pszBuffer)
Trim string using white spapce including ' '.
int nDirectionSingle
Direction xyz.
double fOrigin[NMAXDOMAIN][3]
Coordinator original coordinate.