Skip to content

Commit 5c4b9b6

Browse files
committed
update mag
1 parent cece2ac commit 5c4b9b6

File tree

16 files changed

+55
-34
lines changed

16 files changed

+55
-34
lines changed

source/module_elecstate/module_dm/test/prepare_unitcell.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ class UcellTestPrepare
7474
static UnitCell ucell;
7575
ucell.setup(this->latname, this->ntype, this->lmaxmax, this->init_vel, this->fixed_axes);
7676

77-
delete[] ucell.magnet.start_magnetization; // mag set here
77+
delete[] ucell.magnet.start_mag; // mag set here
7878

7979
ucell.atom_label.resize(ucell.ntype);
8080
ucell.atom_mass.resize(ucell.ntype);
8181
ucell.pseudo_fn.resize(ucell.ntype);
8282
ucell.pseudo_type.resize(ucell.ntype);
8383
ucell.orbital_fn.resize(ucell.ntype);
84-
ucell.magnet.start_magnetization = new double[ucell.ntype]; // mag set here
84+
ucell.magnet.start_mag = new double[ucell.ntype]; // mag set here
8585
ucell.magnet.ux_[0] = 0.0; // ux_ set here
8686
ucell.magnet.ux_[1] = 0.0;
8787
ucell.magnet.ux_[2] = 0.0;
@@ -92,7 +92,7 @@ class UcellTestPrepare
9292
ucell.pseudo_fn[it] = this->pp_files[it];
9393
ucell.pseudo_type[it] = this->pp_types[it];
9494
ucell.orbital_fn[it] = this->orb_files[it];
95-
ucell.magnet.start_magnetization[it] = 0.0; // mag set here
95+
ucell.magnet.start_mag[it] = 0.0; // mag set here
9696
}
9797
// lattice info
9898
ucell.lat0 = this->lat0;

source/module_elecstate/module_dm/test/test_dm_io.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ LCAO_Orbitals::~LCAO_Orbitals()
2323
#endif
2424
Magnetism::Magnetism()
2525
{
26-
this->tot_magnetization = 0.0;
27-
this->abs_magnetization = 0.0;
28-
this->start_magnetization = nullptr;
26+
this->tot_mag = 0.0;
27+
this->abs_mag = 0.0;
28+
this->start_mag = nullptr;
2929
}
3030
Magnetism::~Magnetism()
3131
{
32-
delete[] this->start_magnetization;
32+
delete[] this->start_mag;
3333
}
3434

3535
#include "module_cell/klist.h"

source/module_hamilt_lcao/module_hcontainer/test/prepare_unitcell.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ class UcellTestPrepare
7272
this->ntype = this->elements.size();
7373
static UnitCell ucell;
7474
ucell.setup(this->latname, this->ntype, this->lmaxmax, this->init_vel, this->fixed_axes);
75-
delete[] ucell.magnet.start_magnetization; // mag set here
75+
delete[] ucell.magnet.start_mag; // mag set here
7676
ucell.atom_label.resize(ucell.ntype);
7777
ucell.atom_mass.resize(ucell.ntype);
7878
ucell.pseudo_fn.resize(ucell.ntype);
7979
ucell.pseudo_type.resize(ucell.ntype);
8080

8181
ucell.orbital_fn.resize(ucell.ntype);
82-
ucell.magnet.start_magnetization = new double[ucell.ntype]; // mag set here
82+
ucell.magnet.start_mag = new double[ucell.ntype]; // mag set here
8383
ucell.magnet.ux_[0] = 0.0; // ux_ set here
8484
ucell.magnet.ux_[1] = 0.0;
8585
ucell.magnet.ux_[2] = 0.0;
@@ -90,7 +90,7 @@ class UcellTestPrepare
9090
ucell.pseudo_fn[it] = this->pp_files[it];
9191
ucell.pseudo_type[it] = this->pp_types[it];
9292
ucell.orbital_fn[it] = this->orb_files[it];
93-
ucell.magnet.start_magnetization[it] = 0.0; // mag set here
93+
ucell.magnet.start_mag[it] = 0.0; // mag set here
9494
}
9595
// lattice info
9696
ucell.lat0 = this->lat0;

source/module_hamilt_lcao/module_hcontainer/test/test_hcontainer_readCSR.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ LCAO_Orbitals::~LCAO_Orbitals()
2424
#endif
2525
Magnetism::Magnetism()
2626
{
27-
this->tot_magnetization = 0.0;
28-
this->abs_magnetization = 0.0;
29-
this->start_magnetization = nullptr;
27+
this->tot_mag = 0.0;
28+
this->abs_mag = 0.0;
29+
this->start_mag = nullptr;
3030
}
3131
Magnetism::~Magnetism()
3232
{
33-
delete[] this->start_magnetization;
33+
delete[] this->start_mag;
3434
}
3535
// mocke functions
3636

source/module_io/nscf_band.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
#include "module_base/tool_title.h"
66
#include "module_base/formatter.h"
77

8+
#ifdef __MPI
89
#include <mpi.h>
10+
#endif
911

1012
void ModuleIO::nscf_band(
1113
const int &is,

source/module_io/nscf_fermi_surf.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#include "module_base/global_variable.h"
55
#include "module_base/timer.h"
66

7+
#ifdef __MPI
78
#include <mpi.h>
9+
#endif
810

911
void ModuleIO::nscf_fermi_surface(const std::string &out_band_dir,
1012
const int &nband,

source/module_io/output_log.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
#include "module_base/global_variable.h"
77

88
#include "module_base/parallel_comm.h"
9+
10+
#ifdef __MPI
911
#include <mpi.h>
12+
#endif
1013

1114
namespace ModuleIO
1215
{

source/module_io/test/bessel_basis_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
#endif
2222
#include "gtest/gtest.h"
2323

24+
25+
#ifdef __MPI
26+
#include <mpi.h>
27+
#endif
28+
2429
/// @brief Simpson integral
2530
/// @attention this function is a COMPLETE version, but there is no improvement in performance.
2631
/// @param x variable stored in a vector

source/module_io/test/cif_io_test.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include "module_base/formatter.h"
66
#include <fstream>
77

8+
#ifdef __MPI
9+
#include <mpi.h>
10+
#endif
11+
812
/**
913
* this is the unittest for ABACUS i/o interface with Crystal Information File (CIF) format.
1014
*
@@ -408,4 +412,4 @@ int main(int argc, char** argv)
408412
MPI_Finalize();
409413
#endif
410414
return ret;
411-
}
415+
}

source/module_io/test/io_dmk_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ LCAO_Orbitals::LCAO_Orbitals() {}
2121
LCAO_Orbitals::~LCAO_Orbitals() {}
2222
#endif
2323
Magnetism::Magnetism() {
24-
this->tot_magnetization = 0.0;
25-
this->abs_magnetization = 0.0;
26-
this->start_magnetization = nullptr;
24+
this->tot_mag = 0.0;
25+
this->abs_mag = 0.0;
26+
this->start_mag = nullptr;
2727
}
28-
Magnetism::~Magnetism() { delete[] this->start_magnetization; }
28+
Magnetism::~Magnetism() { delete[] this->start_mag; }
2929

3030
/************************************************
3131
* unit test of read_dmk and write_dmk
@@ -228,4 +228,4 @@ int main(int argc, char** argv)
228228
MPI_Finalize();
229229
return result;
230230
}
231-
#endif
231+
#endif

0 commit comments

Comments
 (0)