Skip to content

Commit

Permalink
Merge pull request #1 from xuqimen/master
Browse files Browse the repository at this point in the history
Update documentation, add link to SG15 pseudopotentials; move examples/ to tests/; rerun tests
  • Loading branch information
phanish-suryanarayana authored Feb 3, 2020
2 parents 9fa61b7 + 6651b1f commit 3bedf1e
Show file tree
Hide file tree
Showing 170 changed files with 11,635 additions and 12,884 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
----------------
Feb 03, 2020
Name: Qimen Xu
* Update documentation and README.md, add link to SG15 ONCV potentials.
* Move examples/ directory to under tests/.
* Add M-SPARC version to .out file.
* Print boundary conditions in the form of `BC: P P D` in .out file.
* Rerun tests and update the reference output files.

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## M-SPARC Usage
### (1) Brief:
Matlab-Simulation Package for Ab-initio Real-space Calculations (M-SPARC) is a real-space code for performing electronic structure calculations based on Kohn-Sham Density Functional Theory (DFT). Its primary purpose is the rapid development and testing of new algorithms and methods within DFT. The main features of M-SPARC 1.0 include
Matlab-Simulation Package for Ab-initio Real-space Calculations (M-SPARC) is a real-space code for performing electronic structure calculations based on Kohn-Sham Density Functional Theory (DFT). Its primary purpose is the rapid development and testing of new algorithms and methods within DFT. The main features of M-SPARC v1.0.0 include

* Boundary conditions for crystals, surfaces, wires, and molecules.
* Calculation of ground state energy, atomic forces, and stress tensor.
Expand All @@ -13,7 +13,9 @@ Matlab-Simulation Package for Ab-initio Real-space Calculations (M-SPARC) is a r
The required input files to run a simulation with M-SPARC are (with shared names)
(a) ".inpt" -- User options and parameters.
(b) ".ion" -- Atomic information.
A more detailed description of the input options can be found in the user manual loated in M-SPARC/docs. Examples of input files can be found in the directory M-SPARC/tests. In addition, M-SPARC requires pseudopotential files of psp8 format which can be generated by D. R. Hamann's open-source pseudopotential code [ONCVPSP](http://www.mat-simresearch.com/). Pseudopotential files are specified in the ".ion" file.
A more detailed description of the input options can be found in the user manual loated in M-SPARC/doc. Examples of input files can be found in the directory M-SPARC/tests.

In addition, M-SPARC requires pseudopotential files of psp8 format which can be generated by D. R. Hamann's open-source pseudopotential code [ONCVPSP](http://www.mat-simresearch.com/). A large number of accurate and efficient pseudopotentials are already provided within the package. For access to more pseudopotentials, the user is referred to the [SG15 ONCV potentials](http://www.quantum-simulation.org/potentials/sg15_oncv/). Using the [ONCVPSP](http://www.mat-simresearch.com/) input files included in the [SG15 ONCV potentials](http://www.quantum-simulation.org/potentials/sg15_oncv/), one can easily convert the [SG15 ONCV potentials](http://www.quantum-simulation.org/potentials/sg15_oncv/) from upf format to psp8 format. Paths to the pseudopotential files are specified in the ``.ion" file.

### (3) Execution:
M-SPARC can be executed in matlab by calling the `msparc` function (which is located under src/ directory). It is required that the ".inpt" and ".ion" files are located in the same directory and share the same name. For example, to run a simulation with input files as "filename.inpt" and "filename.ion" in the src/ directory, use the following command:
Expand All @@ -27,7 +29,7 @@ S = msparc('../tests/MeshConvergence/Si8-ONCV-0.4');
```
The result is printed to an output file named "Si8-ONCV-0.4.out", located in the same directory as the input files. If the file "Si8-ONCV-0.4.out" is already present, the result will be printed to "Si8-ONCV-0.4.out_1" instead. The max number of ".out" files allowed with the same name is 100. Once this number is reached, the result will instead overwrite the "Si8-ONCV-0.4.out" file. One can compare the result with the reference out file named "Si8-ONCV-0.4.refout".

In the examples/ directory, we also provide a sample script file `run_examples.m`, which launches four example tests one by one. To run these examples, simply change directory to examples/ directory, and run
In the tests/examples/ directory, we also provide a sample script file `run_examples.m`, which launches four example tests one by one. To run these examples, simply change directory to tests/examples/ directory, and run
```
run_examples
```
Expand Down
Binary file modified doc/Manual.pdf
Binary file not shown.
11 changes: 5 additions & 6 deletions doc/Manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@


\begin{frame}[allowframebreaks]{\textbf{Introduction}} \label{Introduction}
Matlab-Simulation Package for Ab-initio Real-space Calculations (M-SPARC) is a real-space code for performing electronic structure calculations based on Kohn-Sham Density Functional Theory (DFT). Its primary purpose is the rapid development and testing of new algorithms and methods within DFT. The current features of M-SPARC include
Matlab-Simulation Package for Ab-initio Real-space Calculations (M-SPARC) is a real-space code for performing electronic structure calculations based on Kohn-Sham Density Functional Theory (DFT). Its primary purpose is the rapid development and testing of new algorithms and methods within DFT. The main features of M-SPARC v1.0.0 include
\begin{itemize}
\item Boundary conditions for crystals, surfaces, wires, and molecules.
\item Calculation of ground state energy, atomic forces, and stress tensor.
Expand All @@ -95,7 +95,8 @@
\item ``.inpt" file -- User options and parameters.
\item ``.ion" file -- Atomic information.
\end{itemize}
It is required that the ``.inpt" and ``.ion" files are located in the same directory and share the same name. A detailed description of the input options is provided in this document. Examples of input files can be found in the directory \texttt{M-SPARC/tests}. In addition, M-SPARC requires pseudopotential files of psp8 format which can be generated by D. R. Hamann's open-source pseudopotential code \href{http://www.mat-simresearch.com/}{ONCVPSP}. Pseudopotential files are specified in the ``.ion" file.
It is required that the ``.inpt" and ``.ion" files are located in the same directory and share the same name. A detailed description of the input options is provided in this document. Examples of input files can be found in the directory \texttt{M-SPARC/tests}. \\
In addition, M-SPARC requires pseudopotential files of psp8 format which can be generated by D. R. Hamann's open-source pseudopotential code \href{http://www.mat-simresearch.com/}{ONCVPSP}. A large number of accurate and efficient pseudopotentials are already provided within the package. For access to more pseudopotentials, the user is referred to the \href{http://www.quantum-simulation.org/potentials/sg15_oncv/}{SG15 ONCV potentials}. Using the \href{http://www.mat-simresearch.com/}{ONCVPSP} input files included in the \href{http://www.quantum-simulation.org/potentials/sg15_oncv/}{SG15 ONCV potentials}, one can easily convert the \href{http://www.quantum-simulation.org/potentials/sg15_oncv/}{SG15 ONCV potentials} from upf format to psp8 format. Paths to the pseudopotential files are specified in the ``.ion" file.
\end{frame}


Expand All @@ -112,10 +113,11 @@
\end{verbatim}
The result is printed to output file ``Si8-ONCV-0.4.out", located in the same directory as the input files. If the file ``Si8-ONCV-0.4.out" is already present, the result will be printed to ``Si8-ONCV-0.4.out\_1" instead. The max number of ``.out" files allowed with the same name is 100. Once this number is reached, the result will instead overwrite the ``Si8-ONCV-0.4.out" file. One can compare the result with the reference out file named ``Si8-ONCV-0.4.refout".\\~\\

In the \texttt{examples/} directory, we also provide a sample script file \texttt{run\_examples.m}, which launches four example tests one by one. To run these examples, simply change directory to \texttt{examples/} directory, and run:
In the \texttt{tests/examples/} directory, we also provide a sample script file \texttt{run\_examples.m}, which launches four example tests one by one. To run these examples, simply change directory to \texttt{tests/examples/} directory, and run:
\begin{verbatim}
run_examples
\end{verbatim}
Note that in this case, we're trying to call the \texttt{msparc} function from a different directory. This is achieved by using the MATLAB function \texttt{addpath} to add the \texttt{src/} directory to search path.

One can also run M-SPARC using the MATLAB parallel pool over k-points/spin by providing a second argument, \texttt{parallel\_switch}, when running M-SPARC:
\begin{verbatim}
Expand Down Expand Up @@ -235,9 +237,6 @@
A set of three whitespace delimited values specifying the cell lengths in the lattice vector (\hyperlink{LATVEC}{\texttt{LATVEC}}) directions, respectively.
\end{block}

\begin{block}{Remark}
The values should not be separated by more than one white space character.
\end{block}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
10 changes: 8 additions & 2 deletions src/initialization.m
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@

start_time = fix(clock);
fprintf(fileID,'***************************************************************************\n');
fprintf(fileID,'* M-SPARC (Dec 17, 2019) *\n');
fprintf(fileID,'* M-SPARC v1.0.0 (Feb 03, 2020) *\n');
fprintf(fileID,'* Copyright (c) 2019 Material Physics & Mechanics Group, Georgia Tech *\n');
fprintf(fileID,'* Distributed under GNU General Public License 3 (GPL) *\n');
fprintf(fileID,'* Date: %s Start time: %02d:%02d:%02d *\n',date,start_time(4),start_time(5),start_time(6));
Expand All @@ -1100,7 +1100,13 @@
end
fprintf(fileID,'FD_GRID: %d %d %d\n',S.Nx-S.BCx,S.Ny-S.BCy,S.Nz-S.BCz);
fprintf(fileID,'FD_ORDER: %d\n',S.FDn*2);
fprintf(fileID,'BOUNDARY_CONDITION: %d\n',S.BC);
%fprintf(fileID,'BOUNDARY_CONDITION: %d\n',S.BC);
str_BC = ['P', 'D'];
fprintf(fileID,'BC:');
fprintf(fileID,' %s',str_BC(S.BCx+1));
fprintf(fileID,' %s',str_BC(S.BCy+1));
fprintf(fileID,' %s',str_BC(S.BCz+1));
fprintf(fileID,'\n');
if (S.BC==2 || S.BC==3 || S.BC==4)
fprintf(fileID,'KPOINT_GRID: %d %d %d\n',S.nkpt);
fprintf(fileID,'KPOINT_SHIFT: %d %d %d\n',S.kptshift);
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/H2O_sheet/H2O_Nx_28.inpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CELL: 5.669178374980770 5.669178374980770 22.676713499923078
FD_GRID: 28 28 112
FD_ORDER: 12
BOUNDARY_CONDITION: 3
BC: P P D
#CHEB_DEGREE: 32
#RHO_TRIGGER: 5
EXCHANGE_CORRELATION: LDA_PZ
Expand Down
54 changes: 27 additions & 27 deletions tests/BC/H2O_sheet/H2O_Nx_28.refout
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
***************************************************************************
* M-SPARC (Dec 17, 2019) *
* M-SPARC v1.0.0 (Feb 03, 2020) *
* Copyright (c) 2019 Material Physics & Mechanics Group, Georgia Tech *
* Distributed under GNU General Public License 3 (GPL) *
* Date: 17-Dec-2019 Start time: 16:41:08 *
* Date: 01-Feb-2020 Start time: 22:45:51 *
***************************************************************************
Input parameters
***************************************************************************
CELL: 5.669178 5.669178 22.676713
FD_GRID: 28 28 112
FD_ORDER: 12
BOUNDARY_CONDITION: 3
BC: P P D
KPOINT_GRID: 1 1 1
KPOINT_SHIFT: 0 0 0
ELEC_TEMP_TYPE: fermi-dirac
Expand Down Expand Up @@ -37,13 +37,13 @@ PRINT_FORCES: 1
PRINT_ATOMS: 1
PRINT_EIGEN: 0
PRINT_DENSITY: 0
OUTPUT_FILE: ../tests/BC/H2O_sheet/H2O_Nx_28.out
OUTPUT_FILE: BC/H2O_sheet/H2O_Nx_28.out
***************************************************************************
Initialization
***************************************************************************
Mesh spacing : 0.202471 (Bohr)
Number of symmetry adapted k-points: 1
Output printed to : ../tests/BC/H2O_sheet/H2O_Nx_28.out
Output printed to : BC/H2O_sheet/H2O_Nx_28.out
Total number of atom types : 2
Total number of atoms : 3
Total number of electrons : 8
Expand All @@ -62,38 +62,38 @@ Estimated total memory usage : 269.01 MB
Self Consistent Field (SCF#1)
=====================================================================
Iteration Free Energy (Ha/atom) SCF Error Timing (sec)
1 -5.6231916849E+00 5.313E-01 3.077
2 -5.6727655238E+00 1.008E-01 3.003
3 -5.6741003009E+00 2.591E-02 2.959
4 -5.6741757619E+00 3.185E-02 2.726
5 -5.6742566340E+00 6.540E-03 2.703
6 -5.6742638473E+00 1.094E-03 2.329
7 -5.6742642641E+00 3.816E-03 2.329
8 -5.6742649714E+00 8.866E-04 2.239
9 -5.6742650100E+00 2.584E-04 2.094
10 -5.6742650317E+00 3.233E-05 1.983
11 -5.6742650293E+00 7.606E-06 1.854
12 -5.6742650212E+00 2.944E-06 1.379
13 -5.6742650102E+00 1.482E-06 1.262
14 -5.6742650192E+00 4.900E-07 1.076
1 -5.6231916849E+00 5.313E-01 4.701
2 -5.6727655238E+00 1.008E-01 5.004
3 -5.6741003009E+00 2.591E-02 4.848
4 -5.6741757619E+00 3.185E-02 4.486
5 -5.6742566340E+00 6.540E-03 4.615
6 -5.6742638473E+00 1.094E-03 3.819
7 -5.6742642641E+00 3.816E-03 3.794
8 -5.6742649714E+00 8.866E-04 3.531
9 -5.6742650100E+00 2.584E-04 3.273
10 -5.6742650317E+00 3.233E-05 3.022
11 -5.6742650293E+00 7.605E-06 2.934
12 -5.6742650212E+00 2.944E-06 2.230
13 -5.6742650102E+00 1.482E-06 1.847
14 -5.6742650191E+00 4.901E-07 1.603
Total number of SCF: 14
====================================================================
Energy
====================================================================
Free energy per atom : -5.6742650192E+00 (Ha/atom)
Free energy per atom : -5.6742650191E+00 (Ha/atom)
Total free energy : -1.7022795057E+01 (Ha)
Band structure energy : -4.1002774979E+00 (Ha)
Band structure energy : -4.1002774993E+00 (Ha)
Exchange correlation energy : -4.1627063761E+00 (Ha)
Self and correction energy : -3.5341201837E+01 (Ha)
Entropy*kb*T : -9.8840325431E-11 (Ha)
Fermi level : -1.7067741068E-01 (Ha)
Average force : 1.8531933032E-02 (Ha/Bohr)
Maximum force : 2.2454697551E-02 (Ha/Bohr)
Time for force calculation : 0.735 (sec)
Entropy*kb*T : -9.8840325194E-11 (Ha)
Fermi level : -1.7067741084E-01 (Ha)
Average force : 1.8531933024E-02 (Ha/Bohr)
Maximum force : 2.2454697555E-02 (Ha/Bohr)
Time for force calculation : 0.985 (sec)
***************************************************************************
Timing info
***************************************************************************
Total walltime : 36.436 sec
Total walltime : 59.380 sec
___________________________________________________________________________

***************************************************************************
Expand Down
Loading

0 comments on commit 3bedf1e

Please sign in to comment.