17#include <Cabana_Core.hpp>
33template <
class DEVICE_TYPE = DeviceType,
bool DEVICE = true>
54 using AtomsT = Cabana::AoSoA<DataTypes, typename DEVICE_TYPE::memory_space, VECTOR_LENGTH>;
76 pos = Cabana::slice<POS>(atoms_);
77 vel = Cabana::slice<VEL>(atoms_);
78 force = Cabana::slice<FORCE>(atoms_);
79 type = Cabana::slice<TYPE>(atoms_);
80 mass = Cabana::slice<MASS>(atoms_);
81 charge = Cabana::slice<CHARGE>(atoms_);
82 relativeMass = Cabana::slice<RELATIVE_MASS>(atoms_);
108 charge(
dst) = charge(
src);
109 relativeMass(
dst) = relativeMass(
src);
126 Cabana::deep_copy(pos, 0
_r);
127 Cabana::deep_copy(vel, 0
_r);
128 Cabana::deep_copy(force, 0
_r);
129 Cabana::deep_copy(type, 0);
130 Cabana::deep_copy(mass, 0
_r);
131 Cabana::deep_copy(charge, 0
_r);
132 Cabana::deep_copy(relativeMass, 0
_r);
134 template <
class DEVICE_TYPE_SRC,
bool DEVICE_SRC>
150template <
class DEVICE_TYPE_A,
bool DEVICE_A,
class DEVICE_TYPE_B,
bool DEVICE_B>
154 dst.numLocalAtoms =
src.numLocalAtoms;
155 dst.numGhostAtoms =
src.numGhostAtoms;
157 Cabana::deep_copy(
dst.getAoSoA(),
src.getAoSoA());
163template <
class DEVICE_TYPE,
bool DEVICE>
164template <
class DEVICE_TYPE_SRC,
bool DEVICE_SRC>
167 : atoms_(
"atoms", atoms.size())
Data structure for storing information about atoms on the host and the device.
Definition Atoms.hpp:35
void sliceAll()
Definition Atoms.hpp:74
typename AtomsT::template member_slice_type< RELATIVE_MASS > relative_mass_t
Definition Atoms.hpp:62
KOKKOS_INLINE_FUNCTION auto arraySize(size_t s) const
Definition Atoms.hpp:87
KOKKOS_INLINE_FUNCTION auto numSoA() const
Definition Atoms.hpp:86
KOKKOS_FORCEINLINE_FUNCTION relative_mass_t getRelativeMass() const
Definition Atoms.hpp:70
KOKKOS_FORCEINLINE_FUNCTION vel_t getVel() const
Definition Atoms.hpp:65
idx_t numLocalAtoms
Definition Atoms.hpp:120
typename AtomsT::template member_slice_type< FORCE > force_t
Definition Atoms.hpp:58
idx_t numGhostAtoms
Definition Atoms.hpp:121
KOKKOS_INLINE_FUNCTION auto size() const
Definition Atoms.hpp:85
Props
Definition Atoms.hpp:38
@ POS
Definition Atoms.hpp:39
@ RELATIVE_MASS
relative mass of the atom in relation to the molecule
Definition Atoms.hpp:45
@ CHARGE
Definition Atoms.hpp:44
@ VEL
Definition Atoms.hpp:40
@ MASS
Definition Atoms.hpp:43
@ TYPE
Definition Atoms.hpp:42
@ FORCE
Definition Atoms.hpp:41
KOKKOS_FORCEINLINE_FUNCTION charge_t getCharge() const
Definition Atoms.hpp:69
KOKKOS_FORCEINLINE_FUNCTION pos_t getPos() const
Definition Atoms.hpp:64
typename AtomsT::template member_slice_type< MASS > mass_t
Definition Atoms.hpp:60
KOKKOS_FORCEINLINE_FUNCTION force_t getForce() const
Definition Atoms.hpp:66
void removeGhostAtoms()
Definition Atoms.hpp:112
GeneralAtoms(const idx_t numAtoms)
Definition Atoms.hpp:123
typename AtomsT::template member_slice_type< TYPE > type_t
Definition Atoms.hpp:59
typename AtomsT::template member_slice_type< CHARGE > charge_t
Definition Atoms.hpp:61
typename AtomsT::template member_slice_type< POS > pos_t
Definition Atoms.hpp:56
void resize(size_t size)
Definition Atoms.hpp:89
KOKKOS_FORCEINLINE_FUNCTION charge_t getMass() const
Definition Atoms.hpp:68
KOKKOS_INLINE_FUNCTION void copy(const idx_t dst, const idx_t src) const
Definition Atoms.hpp:98
void permute(LinkedCellList &linkedCellList) const
Definition Atoms.hpp:95
Cabana::AoSoA< DataTypes, typename DEVICE_TYPE::memory_space, VECTOR_LENGTH > AtomsT
Definition Atoms.hpp:54
typename AtomsT::template member_slice_type< VEL > vel_t
Definition Atoms.hpp:57
auto & getAoSoA() const
Definition Atoms.hpp:118
KOKKOS_FORCEINLINE_FUNCTION type_t getType() const
Definition Atoms.hpp:67
void setForce(const real_t &val) const
Definition Atoms.hpp:72
Cabana::MemberTypes< real_t[DIMENSIONS], real_t[DIMENSIONS], real_t[DIMENSIONS], idx_t, real_t, real_t, real_t > DataTypes
Definition Atoms.hpp:53
impl::GeneralAtoms< DeviceType, true > DeviceAtoms
atoms with memory allocated on device
Definition Atoms.hpp:176
void deep_copy(impl::GeneralAtoms< DEVICE_TYPE_A, DEVICE_A > &dst, const impl::GeneralAtoms< DEVICE_TYPE_B, DEVICE_B > &src)
Definition Atoms.hpp:151
static constexpr int DIMENSIONS
number of spatial dimensions
Definition constants.hpp:24
Cabana::LinkedCellList< typename DeviceType::memory_space > LinkedCellList
Definition datatypes.hpp:179
int64_t idx_t
Definition datatypes.hpp:91
double real_t
Definition datatypes.hpp:99