Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
fa16019
test: add comments and unittest for math_sphbes.h
pxlxingliang Jan 27, 2022
bb182f4
add cal_grad_overlap in orb11
maki49 Nov 20, 2021
8914737
fix a bug of Center2Orb::Orb11::cal_grad_overlap
maki49 Jan 13, 2022
92d23f7
gtest: double-check 2-center-int results from 2 classes
maki49 Jan 13, 2022
3329328
move to module_orbital/test and add CMakeLists.txt
maki49 Jan 14, 2022
ffcdfad
fix: orbital file not found
maki49 Jan 14, 2022
99071d6
add MPI_init
maki49 Jan 19, 2022
f3b7fd4
move main func to 1_snap_equal_test.cpp
maki49 Jan 22, 2022
5e99ede
modify according to the review
maki49 Jan 28, 2022
7a535a5
modify CMakeLists.txt according to #676
maki49 Feb 8, 2022
238828a
fix compile error caused by not linking lib in module_md/test
maki49 Feb 8, 2022
e31807d
fix 'file not found'
maki49 Feb 9, 2022
7680e5e
test: add the unittest of module_base/matrix.h
pxlxingliang Feb 11, 2022
ff824b8
modify the test name following "case upper camel case naming"
pxlxingliang Feb 11, 2022
7f653d0
test: add UT and annotations of realArray
Feb 11, 2022
c980910
modify annotations in realarray.h
Feb 11, 2022
ceba5b3
test: add UT and annotations for IntArray class
Feb 11, 2022
66a2aca
fix a bug caused by memory access
maki49 Feb 11, 2022
68fdb1b
test: add UT and annotations for class Vector3
Feb 11, 2022
89fb837
modify annotations in vector3 class
Feb 11, 2022
8fbb5bb
test: add UT and annotations for mathzone class
Feb 11, 2022
f26107a
small changes
maki49 Feb 12, 2022
b98fce1
Merge pull request #634 from maki49/hybrid_force
caic99 Feb 13, 2022
2502701
Merge branch 'deepmodeling:develop' into matrix
pxlxingliang Feb 14, 2022
1b867e1
Merge branch 'deepmodeling:develop' into unittest
hongriTianqi Feb 14, 2022
222b8aa
Merge pull request #698 from pxlxingliang/matrix
caic99 Feb 14, 2022
cfbd792
Merge branch 'develop' into unittest
hongriTianqi Feb 14, 2022
64e1e77
Merge pull request #708 from hongriTianqi/unittest
caic99 Feb 14, 2022
a5d3e11
test: add the unit test of sph_bessel_recursive.h
pxlxingliang Feb 14, 2022
8cf03d7
Merge branch 'develop' into sph_bessel
pxlxingliang Feb 14, 2022
6975edd
Merge pull request #713 from pxlxingliang/sph_bessel
caic99 Feb 14, 2022
7f6bf84
Merge branch 'develop' of https://github.com/deepmodeling/abacus-deve…
pxlxingliang Feb 14, 2022
30aff49
test: add the unit test and comments of math_sphbes.h
pxlxingliang Feb 15, 2022
aca89f4
fix the delete of pointer r jl
pxlxingliang Feb 15, 2022
1ce08d0
loose the threshold and modify the comments
pxlxingliang Feb 15, 2022
bbc471e
modified the recommended values of exx related input parameters.
ouqi0711 Feb 15, 2022
e67cec0
added a note of parallel job limitations for exx jobs
ouqi0711 Feb 15, 2022
2dbcd0c
Merge pull request #723 from ouqi0711/develop
caic99 Feb 16, 2022
8751d9f
Merge pull request #720 from pxlxingliang/math-sphbes
pxlxingliang Feb 16, 2022
057fe8f
test: add the unit test and comments for math_polyint.h
pxlxingliang Feb 17, 2022
f483a0f
modify the name of Func to sinc
pxlxingliang Feb 17, 2022
be97d86
Merge pull request #726 from pxlxingliang/develop
pxlxingliang Feb 17, 2022
4afd0cf
test:add the unittest and comments of math_ylmreal.h
pxlxingliang Feb 17, 2022
96a721b
test: UT and annotations in mathzone_add1
Feb 17, 2022
716e3fd
Merge branch 'develop' into unittest
hongriTianqi Feb 17, 2022
b9f3b06
test:modify mathzone_add1_test.cpp
Feb 17, 2022
7157bb7
Merge branch 'unittest' of github.com:hongriTianqi/abacus-develop int…
Feb 17, 2022
a3cd7d8
use M_PI in math.h
pxlxingliang Feb 17, 2022
129e193
Merge pull request #727 from pxlxingliang/develop
pxlxingliang Feb 18, 2022
d129b1c
Merge branch 'develop' into unittest
hongriTianqi Feb 18, 2022
bdd7256
Merge pull request #728 from hongriTianqi/unittest
hongriTianqi Feb 18, 2022
5d7588c
Fix #736: memory free by wrong index
caic99 Feb 21, 2022
eeb8cc7
Merge pull request #738 from deepmodeling/caic99-patch-1
dyzheng Feb 21, 2022
9a14a1a
test: add the unit test and comments for ylm.h
pxlxingliang Feb 22, 2022
3523ec0
Merge branch 'develop' into develop
pxlxingliang Feb 24, 2022
7e17d27
< refactor >
Qianruipku Feb 24, 2022
ad3d3ef
add CMakeLists.txt
Qianruipku Feb 24, 2022
0194120
add autotest for pw_refactor when PR
Qianruipku Feb 24, 2022
0a975a9
add integration test for pw_refactor when PR
Qianruipku Feb 24, 2022
cca9d48
modify tests in module_md
Qianruipku Feb 24, 2022
032727b
Merge pull request #747 from Qianruipku/pw_refactor
mohanchen Feb 26, 2022
dab3d27
merge pw_refactor and solve conflicts
maki49 Feb 26, 2022
fbf0d2d
fix compile error with test by cmake
maki49 Feb 26, 2022
aab7dca
remove pdiag_basic.cpp
maki49 Feb 26, 2022
5dfbb4a
remove cal_nnr by merge it with Record_adf::for_2d
maki49 Feb 27, 2022
b785375
remove GlobalV in ORB_control
maki49 Feb 28, 2022
7468328
UT and annotations for math_bspline
Feb 28, 2022
eb05e52
Merge pull request #740 from pxlxingliang/develop
dyzheng Feb 28, 2022
8f935c0
move parallel_orbitals.h, .cpp files from src_parallel into module_or…
maki49 Feb 28, 2022
3de2b49
Merge pull request #756 from hongriTianqi/develop
caic99 Feb 28, 2022
eea33c5
remove newdm parameters in test case 260
maki49 Feb 28, 2022
61bef01
remove useless output
maki49 Feb 28, 2022
ebd44d5
apply Ensolver to lcao-line
maki49 Feb 28, 2022
b787150
fix a pointer-bug in DFTU
maki49 Feb 28, 2022
af7a24e
Merge branch 'develop' of https://github.com/deepmodeling/abacus-deve…
maki49 Feb 28, 2022
82b349e
rearange init-basis in Run_lcao
maki49 Feb 28, 2022
74d69c8
merge TDDFT and solve conflicts
maki49 Feb 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- ABACUS_2.2.0_beta
- deepks
- planewave
- TDDFT
- pw_refactor
jobs:

test:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
pw
ri
driver
en_solver
-lm
)

Expand Down
10 changes: 5 additions & 5 deletions doc/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ This part of variables are relevant when using hybrid functionals

- exx_hybrid_type<a id="exx-hybrid-type"></a>
- *Type*: String
- *Description*: Type of hybrid functional used. Options are "hf" (pure Hartree-Fock), "pbe0"(PBE0), "hse" (Note: in order to use HSE functional, LIBXC is required).
- *Description*: Type of hybrid functional used. Options are "hf" (pure Hartree-Fock), "pbe0"(PBE0), "hse" (Note: in order to use HSE functional, LIBXC is required). Note also that HSE has been tested while PBE0 has NOT been fully tested yet, and the maxmum parallel cpus for running exx is Nx(N+1)/2, with N being the number of atoms.


If set to "no", then no hybrid functional is used (i.e.,Fock exchange is not included.)
Expand Down Expand Up @@ -1023,7 +1023,7 @@ adial integration for pseudopotentials, in Bohr.

- exx_pca_threshold<a id="exx-pca-threshold"></a>
- *Type*: Real
- *Description*: To accelerate the evaluation of four-center integrals (ik|jl), the product of atomic orbitals are expanded in the basis of auxiliary basis functions (ABF): &phi;<sub>i</sub>&phi;<sub>j</sub>~C<sup>k</sup><sub>ij</sub>P<sub>k</sub>. The size of the ABF (i.e. number of P<sub>k</sub>) is reduced using principal component analysis. When a large PCA threshold is used, the number of ABF will be reduced, hence the calculations becomes faster. However this comes at the cost of computational accuracy. A relatively safe choice of the value is 1d-3.
- *Description*: To accelerate the evaluation of four-center integrals (ik|jl), the product of atomic orbitals are expanded in the basis of auxiliary basis functions (ABF): &phi;<sub>i</sub>&phi;<sub>j</sub>~C<sup>k</sup><sub>ij</sub>P<sub>k</sub>. The size of the ABF (i.e. number of P<sub>k</sub>) is reduced using principal component analysis. When a large PCA threshold is used, the number of ABF will be reduced, hence the calculations becomes faster. However this comes at the cost of computational accuracy. A relatively safe choice of the value is 1d-4.
- *Default*: 0

[back to top](#input-file)
Expand All @@ -1044,21 +1044,21 @@ adial integration for pseudopotentials, in Bohr.

- exx_dm_threshold<a id="exx-dm-threshold"></a>
- *Type*: Real
- *Description*: The Fock exchange can be expressed as &Sigma;<sub>k,l</sub>(ik|jl)D<sub>kl</sub> where D is the density matrix. Smaller values of the density matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1d-3.
- *Description*: The Fock exchange can be expressed as &Sigma;<sub>k,l</sub>(ik|jl)D<sub>kl</sub> where D is the density matrix. Smaller values of the density matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1d-4.
- *Default*: 0

[back to top](#input-file)

- exx_schwarz_threshold<a id="exx-schwarz-threshold"></a>
- *Type*: Real
- *Description*: In practice the four-center integrals are sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each integral before carrying out explicit evaluations. Those that are smaller than exx_schwarz_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1d-4.
- *Description*: In practice the four-center integrals are sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each integral before carrying out explicit evaluations. Those that are smaller than exx_schwarz_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1d-5.
- *Default*: 0

[back to top](#input-file)

- exx_cauchy_threshold<a id="exx-cauchy-threshold"></a>
- *Type*: Real
- *Description*: In practice the Fock exchange matrix is sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each matrix element before carrying out explicit evaluations. Those that are smaller than exx_cauchy_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1d-6.
- *Description*: In practice the Fock exchange matrix is sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each matrix element before carrying out explicit evaluations. Those that are smaller than exx_cauchy_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1d-7.
- *Default*: 0

[back to top](#input-file)
Expand Down
1 change: 1 addition & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ add_subdirectory(module_neighbor)
add_subdirectory(module_orbital)
add_subdirectory(module_md)
add_subdirectory(module_deepks)
add_subdirectory(module_ensolver)
add_subdirectory(src_io)
add_subdirectory(src_ions)
add_subdirectory(src_lcao)
Expand Down
2 changes: 2 additions & 0 deletions source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ VPATH=./src_global\
:./src_ri\
:./\

include module_ensolver/Makefile.ensolver

#==========================
# Define HONG
#==========================
Expand Down
1 change: 0 additions & 1 deletion source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ FORCE_k.o\
parallel_orbitals.o \
global_fp.o \
pdiag_double.o \
pdiag_basic.o \
pdiag_common.o \
diag_scalapack_gvx.o \
subgrid_oper.o \
Expand Down
19 changes: 14 additions & 5 deletions source/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,31 @@ void Driver::reading(void)
void Driver::atomic_world(void)
{
ModuleBase::TITLE("Driver","atomic_world");

//--------------------------------------------------
// choose basis sets:
// pw: plane wave basis set
// lcao_in_pw: LCAO expaned by plane wave basis set
// lcao: linear combination of atomic orbitals
//--------------------------------------------------
string use_ensol;
ModuleEnSover::En_Solver *p_ensolver;
if(GlobalV::BASIS_TYPE=="pw" || GlobalV::BASIS_TYPE=="lcao_in_pw")
{
Run_pw::plane_wave_line();
use_ensol = "ksdft_pw";
//We set it temporarily
//Finally, we have ksdft_pw, ksdft_lcao, sdft_pw, ofdft, lj, eam, etc.
ModuleEnSover::init_esolver(p_ensolver, use_ensol);
Run_pw::plane_wave_line(p_ensolver);
ModuleEnSover::clean_esolver(p_ensolver);
}
#ifdef __LCAO
else if(GlobalV::BASIS_TYPE=="lcao")
{
Run_lcao::lcao_line();
}
{
use_ensol = "ksdft_lcao";
ModuleEnSover::init_esolver(p_ensolver, use_ensol);
Run_lcao::lcao_line(p_ensolver);
ModuleEnSover::clean_esolver(p_ensolver);
}
#endif

ModuleBase::timer::finish( GlobalV::ofs_running );
Expand Down
194 changes: 136 additions & 58 deletions source/module_base/intarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,152 @@
#ifndef INTARRAY_H
#define INTARRAY_H

#include <iostream>
#include <cassert>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>

#ifdef _MCD_CHECK
//#include "./src_parallel/mcd.h"
#endif

namespace ModuleBase
{

/**
* @brief Integer array
*
*/
class IntArray
{
public:
int *ptr;

// Constructors for different dimesnions
IntArray(const int d1 = 1, const int d2 = 1);
IntArray(const int d1, const int d2,const int d3);
IntArray(const int d1, const int d2,const int d3,const int d4);
IntArray(const int d1, const int d2,const int d3,const int d4,const int d5);
IntArray(const int d1, const int d2,const int d3,const int d4,const int d5,const int d6);

~IntArray();

void create(const int d1, const int d2);
void create(const int d1, const int d2, const int d3);
void create(const int d1, const int d2, const int d3, const int d4);
void create(const int d1, const int d2, const int d3, const int d4, const int d5);
void create(const int d1, const int d2, const int d3, const int d4, const int d5, const int d6);

const IntArray &operator=(const IntArray &right);
const IntArray &operator=(const int &right);

int &operator()(const int d1, const int d2);
int &operator()(const int d1, const int d2, const int d3);
int &operator()(const int d1, const int d2, const int d3,const int d4);
int &operator()(const int d1, const int d2, const int d3, const int d4, const int d5);
int &operator()(const int d1, const int d2, const int d3, const int d4, const int d5, const int d6);

const int &operator()(const int d1,const int d2)const;
const int &operator()(const int d1,const int d2,const int d3)const;
const int &operator()(const int d1,const int d2,const int d3,const int d4)const;
const int &operator()(const int d1,const int d2,const int d3,const int d4, const int d5)const;
const int &operator()(const int d1,const int d2,const int d3,const int d4, const int d5, const int d6)const;

void zero_out(void);

int getSize() const{ return size;}
int getDim() const{ return dim;}
int getBound1() const{ return bound1;}
int getBound2() const{ return bound2;}
int getBound3() const{ return bound3;}
int getBound4() const { return bound4;}
int getBound5() const { return bound5;}
int getBound6() const { return bound6;}

static int getArrayCount(void)
{ return arrayCount;}

private:
int size;
int dim;
int bound1, bound2, bound3, bound4, bound5, bound6;
static int arrayCount;
void freemem();
public:
int *ptr;

/**
* @brief Construct a new Int Array object
*
* @param d1 The first dimension size
* @param d2 The second dimension size
*/
IntArray(const int d1 = 1, const int d2 = 1);
IntArray(const int d1, const int d2, const int d3);
IntArray(const int d1, const int d2, const int d3, const int d4);
IntArray(const int d1, const int d2, const int d3, const int d4, const int d5);
IntArray(const int d1, const int d2, const int d3, const int d4, const int d5, const int d6);

~IntArray();

/**
* @brief Create integer arrays
*
* @param[in] d1
* @param[in] d2
*/
void create(const int d1, const int d2);
void create(const int d1, const int d2, const int d3);
void create(const int d1, const int d2, const int d3, const int d4);
void create(const int d1, const int d2, const int d3, const int d4, const int d5);
void create(const int d1, const int d2, const int d3, const int d4, const int d5, const int d6);

/**
* @brief Equal an IntArray to another one
*
* @param right
* @return const IntArray&
*/
const IntArray &operator=(const IntArray &right);

/**
* @brief Equal all elements of an IntArray to an
* integer
*
* @param right
* @return const IntArray&
*/
const IntArray &operator=(const int &right);

/**
* @brief Access elements by using operator "()"
*
* @param d1
* @param d2
* @return int&
*/
int &operator()(const int d1, const int d2);
int &operator()(const int d1, const int d2, const int d3);
int &operator()(const int d1, const int d2, const int d3, const int d4);
int &operator()(const int d1, const int d2, const int d3, const int d4, const int d5);
int &operator()(const int d1, const int d2, const int d3, const int d4, const int d5, const int d6);

/**
* @brief Access elements by using "()" through pointer
* without changing its elements
*
* @param d1
* @param d2
* @return const int&
*/
const int &operator()(const int d1, const int d2) const;
const int &operator()(const int d1, const int d2, const int d3) const;
const int &operator()(const int d1, const int d2, const int d3, const int d4) const;
const int &operator()(const int d1, const int d2, const int d3, const int d4, const int d5) const;
const int &operator()(const int d1, const int d2, const int d3, const int d4, const int d5, const int d6) const;

/**
* @brief Set all elements of an IntArray to zero
*
*/
void zero_out(void);

int getSize() const
{
return size;
}
int getDim() const
{
return dim;
}
int getBound1() const
{
return bound1;
}
int getBound2() const
{
return bound2;
}
int getBound3() const
{
return bound3;
}
int getBound4() const
{
return bound4;
}
int getBound5() const
{
return bound5;
}
int getBound6() const
{
return bound6;
}

/**
* @brief Get the Array Count object
*
* @return int
*/
static int getArrayCount(void)
{
return arrayCount;
}

private:
int size;
int dim;
int bound1, bound2, bound3, bound4, bound5, bound6;
static int arrayCount;
void freemem();
};
}
} // namespace ModuleBase

#endif // IntArray class
#endif // IntArray class
8 changes: 1 addition & 7 deletions source/module_base/math_bspline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,12 @@ namespace ModuleBase
}
}

void Bspline::cleanp()
{
delete[] bezier;
bezier = NULL;
}

double Bspline::bezier_ele(int n)
{
return this->bezier[n];
}

void Bspline::getbslpine(double x)
void Bspline::getbspline(double x)
{
bezier[0] = 1.0;
for(int k = 1 ; k <= norder ; ++k)
Expand Down
Loading