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
4 changes: 3 additions & 1 deletion source/source_estate/module_pot/pot_ml_exx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ void ML_EXX::set_para(const Input_para& inp, const UnitCell* ucell_in, const Mod
if (this->descriptor_type[i] == "gamma") feg_inpt[i] = 1.;
}

if (PARAM.inp.of_ml_feg == 1)
if (PARAM.inp.of_ml_feg == 1)
{
this->feg_net_F = torch::softplus(this->nn->forward(feg_inpt)).to(this->device_CPU).contiguous().data_ptr<double>()[0];
}
else
{
this->feg_net_F = this->nn->forward(feg_inpt).to(this->device_CPU).contiguous().data_ptr<double>()[0];
Expand Down
2 changes: 1 addition & 1 deletion source/source_io/module_ml/write_mlkedf_descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void Write_MLKEDF_Descriptors::generate_descriptor(

// p
this->cal_tool->getP(prho, pw_rho, nablaRho, container);
npy::SaveArrayAsNumpy("p.npy", false, 1, cshape, container);
npy::SaveArrayAsNumpy(out_dir + "/p.npy", false, 1, cshape, container);

for (int ik = 0; ik < this->cal_tool->nkernel; ++ik)
{
Expand Down
2 changes: 1 addition & 1 deletion source/source_pw/module_ofdft/kedf_lkt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ double KEDF_LKT::get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rh
}
delete[] nabla_rho;

return energy;
return this->lkt_energy;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion source/source_pw/module_ofdft/kedf_ml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ void KEDF_ML::set_para(
if (this->descriptor_type[i] == "gamma") feg_inpt[i] = 1.;
}

if (PARAM.inp.of_ml_feg == 1)
if (PARAM.inp.of_ml_feg == 1)
{
this->feg_net_F = torch::softplus(this->nn->forward(feg_inpt)).to(this->device_CPU).contiguous().data_ptr<double>()[0];
}
else
{
this->feg_net_F = this->nn->forward(feg_inpt).to(this->device_CPU).contiguous().data_ptr<double>()[0];
Expand Down
2 changes: 1 addition & 1 deletion source/source_pw/module_ofdft/kedf_tf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ double KEDF_TF::get_energy(const double* const* prho)
}
this->tf_energy = energy;
Parallel_Reduce::reduce_all(this->tf_energy);
return energy;
return this->tf_energy;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source/source_pw/module_ofdft/kedf_vw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ double KEDF_vW::get_energy(double** pphi, ModulePW::PW_Basis* pw_rho)
delete[] tempPhi;
delete[] LapPhi;

return energy;
return this->vw_energy;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source/source_pw/module_ofdft/kedf_wt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ double KEDF_WT::get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho
}
delete[] kernelRhoBeta;

return energy;
return this->wt_energy;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source/source_pw/module_ofdft/kedf_xwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ double KEDF_XWM::get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rh
delete[] w1Rho5_6;
delete[] w2Rho5_6;

return energy;
return this->xwm_energy;
}

/**
Expand Down
Loading