Skip to content

Commit

Permalink
Added ion relaxation ctest. ctests passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sambit Das committed Jul 1, 2018
1 parent 703fbdd commit 2d36989
Show file tree
Hide file tree
Showing 10 changed files with 1,430 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/dft/moveAtoms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,13 @@ void dftClass<FEOrder>::updateAtomPositionsAndMoveMesh(const std::vector<Point<C

if (!useHybridMeshUpdateScheme)//always remesh
{
pcout << "Auto remeshing and reinitialization of dft problem for new atom coordinates" << std::endl;
if (!dftParameters::reproducible_output)
pcout << "Auto remeshing and reinitialization of dft problem for new atom coordinates" << std::endl;

init(1);
pcout << "...Reinitialization end" << std::endl;

if (!dftParameters::reproducible_output)
pcout << "...Reinitialization end" << std::endl;
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions src/geoOpt/geoOptIon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ geoOptIon<FEOrder>::geoOptIon(dftClass<FEOrder>* _dftPtr,const MPI_Comm &mpi_com
mpi_communicator (mpi_comm_replica),
n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_comm_replica)),
this_mpi_process (Utilities::MPI::this_mpi_process(mpi_comm_replica)),
pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0))
pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0 && !dftParameters::reproducible_output))
{

}
Expand Down Expand Up @@ -84,9 +84,9 @@ void geoOptIon<FEOrder>::run()
lineSearchDampingParameter);

if (dftParameters::chkType>=1 && dftParameters::restartFromChk)
pcout<<" Re starting Ion force relaxation using nonlinear CG solver... "<<std::endl;
pcout<<"Re starting Ion force relaxation using nonlinear CG solver... "<<std::endl;
else
pcout<<" Starting Ion force relaxation using nonlinear CG solver... "<<std::endl;
pcout<<"Starting Ion force relaxation using nonlinear CG solver... "<<std::endl;
if (dftParameters::verbosity>=2)
{
pcout<<" ---Non-linear CG Parameters-------------- "<<std::endl;
Expand Down
1,225 changes: 1,225 additions & 0 deletions tests/dft/pseudopotential/real/N_ONCV_PBE-1.0.upf

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
number of atoms: 2
number of atoms types: 1
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 8.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00
v2 : 0.000000000000000000e+00 8.000000000000000000e+01 0.000000000000000000e+00
v3 : 0.000000000000000000e+00 0.000000000000000000e+00 8.000000000000000000e+01
-----------------------------------------------------------------------------------------
------------Cartesian coordinates of atoms (origin at center of domain)------------------
AtomId 0: -1.199999999999999956e+00 0.000000000000000000e+00 0.000000000000000000e+00
AtomId 1: 1.199999999999999956e+00 0.000000000000000000e+00 0.000000000000000000e+00
-----------------------------------------------------------------------------------------

Finite element mesh information
-------------------------------------------------
number of elements: 960
number of degrees of freedom: 31257
-------------------------------------------------

Setting initial guess for wavefunctions....

Reading initial guess for electron-density.....

Pseudopotential initalization....

Starting SCF iterations....
SCF iterations converged to the specified tolerance after: 12 iterations.

Energy computations (Hartree)
-------------------
Total energy: -19.83481668

Absolute values of ion forces (Hartree/Bohr)
--------------------------------------------------------------------------------------------
AtomId 0: 0.243134,0.000000,0.000000
AtomId 1: 0.243131,0.000000,0.000000
--------------------------------------------------------------------------------------------
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 80.000000 0.000000 0.000000
v2 : 0.000000 80.000000 0.000000
v3 : 0.000000 0.000000 80.000000
-----------------------------------------------------------------------------------------
------------Cartesian coordinates of atoms (origin at center of domain)------------------
AtomId 0: -1.029807 0.000000 0.000000
AtomId 1: 1.029808 0.000000 0.000000
-----------------------------------------------------------------------------------------

Finite element mesh information
-------------------------------------------------
number of elements: 960
number of degrees of freedom: 31257
-------------------------------------------------

Reading initial guess for PSI....

Pseudopotential initalization....

Starting SCF iterations....
SCF iterations converged to the specified tolerance after: 13 iterations.

Energy computations (Hartree)
-------------------
Total energy: -19.88861003

Absolute values of ion forces (Hartree/Bohr)
--------------------------------------------------------------------------------------------
AtomId 0: 0.078653,0.000000,0.000000
AtomId 1: 0.078651,0.000000,0.000000
--------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
number of atoms: 2
number of atoms types: 1
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 8.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00
v2 : 0.000000000000000000e+00 8.000000000000000000e+01 0.000000000000000000e+00
v3 : 0.000000000000000000e+00 0.000000000000000000e+00 8.000000000000000000e+01
-----------------------------------------------------------------------------------------
------------Cartesian coordinates of atoms (origin at center of domain)------------------
AtomId 0: -1.199999999999999956e+00 0.000000000000000000e+00 0.000000000000000000e+00
AtomId 1: 1.199999999999999956e+00 0.000000000000000000e+00 0.000000000000000000e+00
-----------------------------------------------------------------------------------------

Finite element mesh information
-------------------------------------------------
number of elements: 960
number of degrees of freedom: 31257
-------------------------------------------------

Setting initial guess for wavefunctions....

Reading initial guess for electron-density.....

Pseudopotential initalization....

Starting SCF iterations....
SCF iterations converged to the specified tolerance after: 12 iterations.

Energy computations (Hartree)
-------------------
Total energy: -19.83481668

Absolute values of ion forces (Hartree/Bohr)
--------------------------------------------------------------------------------------------
AtomId 0: 0.243134,0.000000,0.000000
AtomId 1: 0.243131,0.000000,0.000000
--------------------------------------------------------------------------------------------
-----------Simulation Domain bounding vectors (lattice vectors in fully periodic case)-------------
v1 : 80.000000 0.000000 0.000000
v2 : 0.000000 80.000000 0.000000
v3 : 0.000000 0.000000 80.000000
-----------------------------------------------------------------------------------------
------------Cartesian coordinates of atoms (origin at center of domain)------------------
AtomId 0: -1.029806 0.000000 0.000000
AtomId 1: 1.029808 0.000000 0.000000
-----------------------------------------------------------------------------------------

Finite element mesh information
-------------------------------------------------
number of elements: 960
number of degrees of freedom: 31257
-------------------------------------------------

Reading initial guess for PSI....

Pseudopotential initalization....

Starting SCF iterations....
SCF iterations converged to the specified tolerance after: 12 iterations.

Energy computations (Hartree)
-------------------
Total energy: -19.88861002

Absolute values of ion forces (Hartree/Bohr)
--------------------------------------------------------------------------------------------
AtomId 0: 0.078646,0.000000,0.000000
AtomId 1: 0.078646,0.000000,0.000000
--------------------------------------------------------------------------------------------
52 changes: 52 additions & 0 deletions tests/dft/pseudopotential/real/nitrogenMolecule_01.prm.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set VERBOSITY = 0
set REPRODUCIBLE OUTPUT = true

subsection Geometry
set NATOMS=2
set NATOM TYPES=1
set ATOMIC COORDINATES FILE = @SOURCE_DIR@/nitrogenMolecule_coordinates.inp
set DOMAIN VECTORS FILE = @SOURCE_DIR@/nitrogenMolecule_domainVectors.inp
subsection Optimization
set ION OPT=true
set FORCE TOL=0.1
set ION RELAX FLAGS FILE =@SOURCE_DIR@/nitrogenMolecule_relaxationFlags.inp
end
end

subsection Boundary conditions
set PERIODIC1 = false
set PERIODIC2 = false
set PERIODIC3 = false
set SELF POTENTIAL RADIUS = 4.0
end

subsection Finite element mesh parameters
set POLYNOMIAL ORDER=3
subsection Auto mesh generation parameters
set MESH SIZE AROUND ATOM = 0.7
set BASE MESH SIZE = 10.0
set ATOM BALL RADIUS = 2.0
set MESH SIZE AT ATOM = 0.7
end
end

subsection DFT functional parameters
set EXCHANGE CORRELATION TYPE = 4
set PSEUDOPOTENTIAL CALCULATION = true
set PSEUDO TESTS FLAG = true
set PSEUDOPOTENTIAL FILE NAMES LIST = @SOURCE_DIR@/pseudoNGGA.inp
end

subsection SCF parameters
set ANDERSON SCHEME MIXING HISTORY = 70
set ANDERSON SCHEME MIXING PARAMETER = 0.5
set MAXIMUM ITERATIONS = 40
set TEMPERATURE = 500
set TOLERANCE = 5e-6

subsection Eigen-solver parameters
set NUMBER OF KOHN-SHAM WAVEFUNCTIONS = 12
set ORTHOGONALIZATION TYPE=LW
set CHEBYSHEV POLYNOMIAL DEGREE = 25
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
7 5 -1.20000000E+00 0.00000000E+00 0.00000000E+00
7 5 1.20000000E+00 0.00000000E+00 0.00000000E+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
80.0 0.0 0.0
0.0 80.0 0.0
0.0 0.0 80.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 0 0
1 0 0
1 change: 1 addition & 0 deletions tests/dft/pseudopotential/real/pseudoNGGA.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7 N_ONCV_PBE-1.0.upf

0 comments on commit 2d36989

Please sign in to comment.