Skip to content

Commit

Permalink
call add_efield
Browse files Browse the repository at this point in the history
  • Loading branch information
brucefan1983 committed Jun 30, 2024
1 parent aebd547 commit 2fe998f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main_gpumd/add_field.cu → src/main_gpumd/add_efield.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ add_efield(
}
}

void Add_Efeild::compute(const int step, const std::vector<Group>& groups, Atom& atom)
void Add_Efield::compute(const int step, const std::vector<Group>& groups, Atom& atom)
{
for (int call = 0; call < num_calls_; ++call) {
const int step_mod_table_length = step % table_length_[call];
Expand All @@ -73,7 +73,7 @@ void Add_Efeild::compute(const int step, const std::vector<Group>& groups, Atom&
}
}

void Add_Efeild::parse(const char** param, int num_param, const std::vector<Group>& group)
void Add_Efield::parse(const char** param, int num_param, const std::vector<Group>& group)
{
printf("Add electric field.\n");

Expand Down Expand Up @@ -162,7 +162,7 @@ void Add_Efeild::parse(const char** param, int num_param, const std::vector<Grou
}
}

void Add_Efeild::finalize()
void Add_Efield::finalize()
{
num_calls_ = 0;
}
2 changes: 1 addition & 1 deletion src/main_gpumd/add_efield.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class Atom;
class Group;

class Add_Efeild
class Add_Efield
{
public:

Expand Down
5 changes: 5 additions & 0 deletions src/main_gpumd/run.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Run simulation according to the inputs in the run.in file.
------------------------------------------------------------------------------*/

#include "add_efield.cuh"
#include "add_force.cuh"
#include "cohesive.cuh"
#include "electron_stop.cuh"
Expand Down Expand Up @@ -259,6 +260,7 @@ void Run::perform_a_run()

electron_stop.compute(time_step, atom);
add_force.compute(step, group, atom);
add_efield.compute(step, group, atom);

integrate.compute2(time_step, double(step) / number_of_steps, group, box, atom, thermo);

Expand Down Expand Up @@ -314,6 +316,7 @@ void Run::perform_a_run()

electron_stop.finalize();
add_force.finalize();
add_efield.finalize();
integrate.finalize();
mc.finalize();
velocity.finalize();
Expand Down Expand Up @@ -466,6 +469,8 @@ void Run::parse_one_keyword(std::vector<std::string>& tokens)
electron_stop.parse(param, num_param, atom.number_of_atoms, number_of_types);
} else if (strcmp(param[0], "add_force") == 0) {
add_force.parse(param, num_param, group);
} else if (strcmp(param[0], "add_efield") == 0) {
add_efield.parse(param, num_param, group);
} else if (strcmp(param[0], "mc") == 0) {
mc.parse_mc(param, num_param, group, atom);
} else if (strcmp(param[0], "dftd3") == 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/main_gpumd/run.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Force;
class Integrate;
class Measure;

#include "add_efield.cuh"
#include "add_force.cuh"
#include "electron_stop.cuh"
#include "force/force.cuh"
Expand Down Expand Up @@ -70,4 +71,5 @@ private:
Measure measure;
Electron_Stop electron_stop;
Add_Force add_force;
Add_Efield add_efield;
};

0 comments on commit 2fe998f

Please sign in to comment.