1 /* ----------------------------------------------------------------------
2    SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer
3    http://sparta.sandia.gov
4    Steve Plimpton, sjplimp@sandia.gov, Michael Gallis, magalli@sandia.gov
5    Sandia National Laboratories
6 
7    Copyright (2014) Sandia Corporation.  Under the terms of Contract
8    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
9    certain rights in this software.  This software is distributed under
10    the GNU General Public License.
11 
12    See the README file in the top-level SPARTA directory.
13 ------------------------------------------------------------------------- */
14 
15 #include "string.h"
16 #include "fix_move_surf_kokkos.h"
17 #include "grid_kokkos.h"
18 #include "particle_kokkos.h"
19 #include "move_surf.h"
20 #include "update.h"
21 #include "comm.h"
22 #include "input.h"
23 #include "grid.h"
24 #include "surf_kokkos.h"
25 #include "domain.h"
26 #include "memory_kokkos.h"
27 #include "error.h"
28 #include "sparta_masks.h"
29 
30 using namespace SPARTA_NS;
31 
32 enum{UNKNOWN,OUTSIDE,INSIDE,OVERLAP};           // several files
33 
34 /* ---------------------------------------------------------------------- */
35 
FixMoveSurfKokkos(SPARTA * sparta,int narg,char ** arg)36 FixMoveSurfKokkos::FixMoveSurfKokkos(SPARTA *sparta, int narg, char **arg) :
37   FixMoveSurf(sparta, narg, arg)
38 {
39   kokkos_flag = 0; // need auto sync
40   execution_space = Host;
41   datamask_read = EMPTY_MASK;
42   datamask_modify = EMPTY_MASK;
43 }
44 
45 /* ----------------------------------------------------------------------
46    move surface points incrementally
47 ------------------------------------------------------------------------- */
48 
end_of_step()49 void FixMoveSurfKokkos::end_of_step()
50 {
51   GridKokkos* grid_kk = (GridKokkos*) grid;
52   ParticleKokkos* particle_kk = (ParticleKokkos*) particle;
53   SurfKokkos* surf_kk = (SurfKokkos*) surf;
54 
55   grid_kk->sync(Host,ALL_MASK);
56   particle_kk->sync(Host,ALL_MASK);
57   surf_kk->sync(Host,ALL_MASK);
58 
59   FixMoveSurf::end_of_step();
60 
61   grid_kk->modify(Host,ALL_MASK);
62   particle_kk->modify(Host,ALL_MASK);
63   surf_kk->modify(Host,ALL_MASK);
64   particle_kk->sorted_kk = 0;
65 
66   grid_kk->wrap_kokkos_graphs();
67   grid_kk->update_hash();
68 }
69