Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions source/module_base/module_mixing/test/mixing_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#ifdef _OPENMP
#include <omp.h>
#endif

#include "../broyden_mixing.h"
#include "../plain_mixing.h"
Expand Down Expand Up @@ -151,7 +153,9 @@ class Mixing_Test : public testing::Test

TEST_F(Mixing_Test, BroydenSolveLinearEq)
{
#ifdef _OPENMP
omp_set_num_threads(1);
#endif
init_method("broyden");
std::vector<double> x_in = xd_ref;
std::vector<double> x_out(3);
Expand Down Expand Up @@ -196,7 +200,9 @@ TEST_F(Mixing_Test, BroydenSolveLinearEq)

TEST_F(Mixing_Test, PulaySolveLinearEq)
{
#ifdef _OPENMP
omp_set_num_threads(1);
#endif
init_method("pulay");
std::vector<double> x_in = xd_ref;
std::vector<double> x_out(3);
Expand Down Expand Up @@ -242,7 +248,9 @@ TEST_F(Mixing_Test, PulaySolveLinearEq)

TEST_F(Mixing_Test, PlainSolveLinearEq)
{
#ifdef _OPENMP
omp_set_num_threads(1);
#endif
init_method("plain");
std::vector<double> x_in = xd_ref;
std::vector<double> x_out(3);
Expand Down
7 changes: 7 additions & 0 deletions source/module_elecstate/test/charge_mixing_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
#include "module_basis/module_pw/pw_basis.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#undef private

#ifdef _OPENMP
#include <omp.h>
#endif

int FUNC_TYPE = 1;

Expand Down Expand Up @@ -116,7 +119,9 @@ class ChargeMixingTest : public ::testing::Test

TEST_F(ChargeMixingTest, SetMixingTest)
{
#ifdef _OPENMP
omp_set_num_threads(1);
#endif
PARAM.input.nspin = 1;
Charge_Mixing CMtest;
CMtest.set_rhopw(&pw_basis, &pw_basis);
Expand Down Expand Up @@ -214,7 +219,9 @@ TEST_F(ChargeMixingTest, SetMixingTest)

TEST_F(ChargeMixingTest, InitMixingTest)
{
#ifdef _OPENMP
omp_set_num_threads(1);
#endif
PARAM.input.nspin = 1;
FUNC_TYPE = 1;
Charge_Mixing CMtest;
Expand Down
Loading