Skip to content

Commit 7caf5ce

Browse files
author
wenfei-li
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into develop
2 parents e7731a6 + 066f60c commit 7caf5ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2838
-139
lines changed

source/Makefile.Objects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ OBJS_ESOLVER=esolver.o\
238238

239239
OBJS_SURCHEM=H_correction_pw.o\
240240
cal_epsilon.o\
241+
surchem.o\
241242
cal_pseudo.o\
242243
cal_totn.o\
243244
cal_vcav.o\
@@ -413,7 +414,6 @@ pzt2s.o\
413414
pdtrsm.o\
414415
pzhtrsm.o\
415416

416-
417417
PDIAG_MR_0=dcopy.o\
418418
dlae2.o\
419419
dlaebz.o\

source/input.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ void Input::Default(void)
420420
sigma_k = 0.6;
421421
nc_k = 0.00037;
422422

423+
comp_q = 0.0;
424+
comp_l = 1.0;
425+
comp_center = 0.0;
426+
comp_dim = 2;
427+
423428
return;
424429
}
425430

@@ -1495,6 +1500,22 @@ bool Input::Read(const std::string &fn)
14951500
{
14961501
read_value(ifs, nc_k);
14971502
}
1503+
else if (strcmp("comp_q", word) == 0)
1504+
{
1505+
read_value(ifs, comp_q);
1506+
}
1507+
else if (strcmp("comp_l", word) == 0)
1508+
{
1509+
read_value(ifs, comp_l);
1510+
}
1511+
else if (strcmp("comp_center", word) == 0)
1512+
{
1513+
read_value(ifs, comp_center);
1514+
}
1515+
else if (strcmp("comp_dim", word) == 0)
1516+
{
1517+
read_value(ifs, comp_dim);
1518+
}
14981519
//----------------------------------------------------------------------------------
14991520
else
15001521
{

source/input.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ class Input
399399
double tau;
400400
double sigma_k;
401401
double nc_k;
402+
// gauss charge
403+
double comp_q;
404+
double comp_l;
405+
double comp_center;
406+
int comp_dim;
402407

403408
//==========================================================
404409
// variables for test only

source/input_conv.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "src_ions/ions_move_basic.h"
1515
#include "src_pw/global.h"
1616
#include "src_pw/occupy.h"
17+
#include "module_surchem/surchem.h"
1718
#ifdef __EXX
1819
#include "src_ri/exx_abfs-jle.h"
1920
#endif
@@ -501,6 +502,11 @@ void Input_Conv::Convert(void)
501502
GlobalV::tau = INPUT.tau;
502503
GlobalV::sigma_k = INPUT.sigma_k;
503504
GlobalV::nc_k = INPUT.nc_k;
505+
506+
GlobalC::solvent_model.comp_q = INPUT.comp_q;
507+
GlobalC::solvent_model.comp_l = INPUT.comp_l;
508+
GlobalC::solvent_model.comp_center = INPUT.comp_center;
509+
GlobalC::solvent_model.comp_dim = INPUT.comp_dim;
504510
ModuleBase::timer::tick("Input_Conv", "Convert");
505511
return;
506512
}

source/module_base/global_file.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,20 @@ void ModuleBase::Global_File::make_dir_out(
128128
if(out_alllog)
129129
{
130130
ss << "running_" << calculation << "_" << rank + 1;
131-
open_log(GlobalV::ofs_running, ss.str(), restart);
131+
open_log(GlobalV::ofs_running, ss.str(), calculation, restart);
132132
}
133133
else
134134
{
135135
if(rank==0)
136136
{
137137
ss << "running_" << calculation;
138-
open_log(GlobalV::ofs_running, ss.str(), restart);
138+
open_log(GlobalV::ofs_running, ss.str(), calculation, restart);
139139
}
140140
}
141141

142142
if(rank==0)
143143
{
144-
open_log(GlobalV::ofs_warning, "warning", restart);
144+
open_log(GlobalV::ofs_warning, "warning", calculation, restart);
145145
}
146146
return;
147147
}
@@ -159,7 +159,7 @@ void ModuleBase::Global_File::make_dir_atom(const std::string &label)
159159
return;
160160
}
161161

162-
void ModuleBase::Global_File::open_log(std::ofstream &ofs, const std::string &fn, const bool &restart)
162+
void ModuleBase::Global_File::open_log(std::ofstream &ofs, const std::string &fn, const std::string &calculation, const bool &restart)
163163
{
164164
//----------------------------------------------------------
165165
// USE GLOBAL VARIABLE :
@@ -168,7 +168,7 @@ void ModuleBase::Global_File::open_log(std::ofstream &ofs, const std::string &fn
168168
std::stringstream ss;
169169
ss << GlobalV::global_out_dir << fn << ".log";
170170

171-
if(fn == "running_md" && restart)
171+
if((calculation == "md" || calculation == "sto-md") && restart)
172172
{
173173
ofs.open( ss.str(), ios::app );
174174
}

source/module_base/global_file.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Global_File
3030
//const bool out_alllog = false);
3131

3232
void make_dir_atom(const std::string &label);
33-
void open_log ( std::ofstream &ofs, const std::string &fn, const bool &restart);
33+
void open_log ( std::ofstream &ofs, const std::string &fn, const std::string &calculation, const bool &restart);
3434
void close_log( std::ofstream &ofs, const std::string &fn);
3535
void close_all_log(const int rank, const bool out_alllog = false);
3636
}

source/module_md/FIRE.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void FIRE::first_half()
6464
}
6565
#ifdef __MPI
6666
MPI_Bcast(pos , ucell.nat*3,MPI_DOUBLE,0,MPI_COMM_WORLD);
67+
MPI_Bcast(vel , ucell.nat*3,MPI_DOUBLE,0,MPI_COMM_WORLD);
6768
#endif
6869

6970
ucell.update_pos_tau(pos);
@@ -85,9 +86,9 @@ void FIRE::second_half()
8586
ModuleBase::timer::tick("FIRE", "second_half");
8687
}
8788

88-
void FIRE::outputMD(std::ofstream &ofs)
89+
void FIRE::outputMD(std::ofstream &ofs, bool cal_stress)
8990
{
90-
Verlet::outputMD(ofs);
91+
Verlet::outputMD(ofs, cal_stress);
9192

9293
ofs << " LARGEST GRAD (eV/A) : "
9394
<< max * ModuleBase::Hartree_to_eV * ModuleBase::ANGSTROM_AU << std::endl;

source/module_md/FIRE.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FIRE : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD(std::ofstream &ofs);
15+
void outputMD(std::ofstream &ofs, bool cal_stress);
1616
void write_restart();
1717
void restart();
1818
void check_force();

source/module_md/Langevin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ void Langevin::second_half()
4545
ModuleBase::timer::tick("Langevin", "second_half");
4646
}
4747

48-
void Langevin::outputMD(std::ofstream &ofs)
48+
void Langevin::outputMD(std::ofstream &ofs, bool cal_stress)
4949
{
50-
Verlet::outputMD(ofs);
50+
Verlet::outputMD(ofs, cal_stress);
5151
}
5252

5353
void Langevin::write_restart()

source/module_md/Langevin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Langevin : public Verlet
1212
void setup(ModuleESolver::ESolver *p_ensolve);
1313
void first_half();
1414
void second_half();
15-
void outputMD(std::ofstream &ofs);
15+
void outputMD(std::ofstream &ofs, bool cal_stress);
1616
void write_restart();
1717
void restart();
1818
void post_force();

0 commit comments

Comments
 (0)