diff --git a/doc/src/fix_wall_flow.rst b/doc/src/fix_wall_flow.rst index d89e0b6d89..3b8d7300e6 100644 --- a/doc/src/fix_wall_flow.rst +++ b/doc/src/fix_wall_flow.rst @@ -129,4 +129,4 @@ The default for the units keyword is lattice. .. _fbc-Pavlov2: -**(Pavlov2)** Pavlov, Galigerov, Kolotinskii, Nikolskiy, Stegailov, "GPU-based Molecular Dynamics of Fluid Flows: Reaching for Turbulence", Int. J. High Perf. Comp. Appl., (2024) \ No newline at end of file +**(Pavlov2)** Pavlov, Galigerov, Kolotinskii, Nikolskiy, Stegailov, "GPU-based Molecular Dynamics of Fluid Flows: Reaching for Turbulence", Int. J. High Perf. Comp. Appl., (2024) diff --git a/src/KOKKOS/fix_wall_flow_kokkos.cpp b/src/KOKKOS/fix_wall_flow_kokkos.cpp index daf73e7ef2..a143578fdc 100644 --- a/src/KOKKOS/fix_wall_flow_kokkos.cpp +++ b/src/KOKKOS/fix_wall_flow_kokkos.cpp @@ -48,7 +48,7 @@ FixWallFlowKokkos::FixWallFlowKokkos(LAMMPS *lmp, int narg, char **a d_walls = d_walls_t("FixWallFlowKokkos::walls", walls.size()); auto h_walls = Kokkos::create_mirror_view(d_walls); for (int i = 0; i < walls.size(); ++i) - { + { h_walls(i) = walls[i]; } Kokkos::deep_copy(d_walls, h_walls); @@ -61,7 +61,7 @@ FixWallFlowKokkos::~FixWallFlowKokkos() memoryKK->destroy_kokkos(k_current_segment, current_segment); } -template +template void FixWallFlowKokkos::init() { atomKK->sync(execution_space, datamask_read); @@ -83,10 +83,10 @@ KOKKOS_INLINE_FUNCTION void FixWallFlowKokkos::operator()(TagFixWall d_current_segment(i) = compute_current_segment_kk(pos); } -template -void FixWallFlowKokkos::end_of_step() +template +void FixWallFlowKokkos::end_of_step() { - atomKK->sync(execution_space, datamask_read); + atomKK->sync(execution_space, datamask_read); k_current_segment.template sync(); d_x = atomKK->k_x.template view(); @@ -111,17 +111,17 @@ void FixWallFlowKokkos::end_of_step() template template -KOKKOS_INLINE_FUNCTION +KOKKOS_INLINE_FUNCTION void FixWallFlowKokkos::operator()(TagFixWallFlowEndOfStep, const int &atom_i) const { - if (d_mask[atom_i] & groupbit) - { + if (d_mask[atom_i] & groupbit) + { double pos = d_x(atom_i, flowax); int prev_segment = d_current_segment(atom_i); d_current_segment(atom_i) = compute_current_segment_kk(pos); - if (prev_segment != d_current_segment(atom_i)) - { + if (prev_segment != d_current_segment(atom_i)) + { generate_velocity_kk(atom_i); } } @@ -129,7 +129,7 @@ void FixWallFlowKokkos::operator()(TagFixWallFlowEndOfStep, template template -KOKKOS_INLINE_FUNCTION +KOKKOS_INLINE_FUNCTION void FixWallFlowKokkos::generate_velocity_kk(int atom_i) const { const int newton_iteration_count = 10; @@ -170,7 +170,7 @@ void FixWallFlowKokkos::generate_velocity_kk(int atom_i) const } template -KOKKOS_INLINE_FUNCTION +KOKKOS_INLINE_FUNCTION int FixWallFlowKokkos::compute_current_segment_kk(double pos) const { int result = 0; @@ -181,8 +181,8 @@ int FixWallFlowKokkos::compute_current_segment_kk(double pos) const } -template -void FixWallFlowKokkos::grow_arrays(int nmax) +template +void FixWallFlowKokkos::grow_arrays(int nmax) { k_current_segment.template sync(); memoryKK->grow_kokkos(k_current_segment, current_segment, nmax, "WallFlowKK::current_segment"); @@ -193,7 +193,7 @@ void FixWallFlowKokkos::grow_arrays(int nmax) } template -void FixWallFlowKokkos::copy_arrays(int i, int j, int) +void FixWallFlowKokkos::copy_arrays(int i, int j, int) { k_current_segment.template sync(); h_current_segment(j) = h_current_segment(i); @@ -252,7 +252,7 @@ int FixWallFlowKokkos::pack_exchange_kokkos( d_sendlist = k_sendlist.view(); d_copylist = k_copylist.view(); - + d_buf = typename ArrayTypes::t_xfloat_1d_um( k_buf.template view().data(), k_buf.extent(0)*k_buf.extent(1)); diff --git a/src/KOKKOS/fix_wall_flow_kokkos.h b/src/KOKKOS/fix_wall_flow_kokkos.h index 10bfed962d..8de0eded0a 100644 --- a/src/KOKKOS/fix_wall_flow_kokkos.h +++ b/src/KOKKOS/fix_wall_flow_kokkos.h @@ -107,16 +107,16 @@ class FixWallFlowKokkos : public FixWallFlow, public KokkosBase { KOKKOS_INLINE_FUNCTION void generate_velocity_kk(int atom_i) const; - KOKKOS_INLINE_FUNCTION + KOKKOS_INLINE_FUNCTION int compute_current_segment_kk(double pos) const; - KOKKOS_INLINE_FUNCTION + KOKKOS_INLINE_FUNCTION double get_mass(MassTag, int atom_i) const { return d_mass(d_type(atom_i)); } - KOKKOS_INLINE_FUNCTION + KOKKOS_INLINE_FUNCTION double get_mass(RMassTag, int atom_i) const { return d_rmass(atom_i); diff --git a/src/fix_wall_flow.cpp b/src/fix_wall_flow.cpp index 591f640279..695b93aea8 100644 --- a/src/fix_wall_flow.cpp +++ b/src/fix_wall_flow.cpp @@ -99,7 +99,7 @@ FixWallFlow::FixWallFlow(LAMMPS *lmp, int narg, char **arg) : // parsing wall count int wallcount = utils::inumeric(FLERR,arg[iarg],do_abort,lmp); if(wallcount <= 0) error->all(FLERR,"Illegal fix wall/flow argument: wall count must be positive integer"); - + ++iarg; // parsing walls if(narg - iarg != wallcount && narg - iarg != wallcount + 2) error->all(FLERR, "Wrong fix wall/flow wall count"); @@ -173,7 +173,7 @@ FixWallFlow::~FixWallFlow() int FixWallFlow::setmask() { int mask = 0; - + mask |= END_OF_STEP; return mask;