13 #include <util/space/Vector.h> 14 #include <ddMd/chemistry/Mask.h> 15 #include <ddMd/communicate/Plan.h> 16 #include "AtomArray.h" 18 namespace Util{
class Memory; }
76 static void setHasAtomContext(
bool hasAtomContext);
81 static bool hasAtomContext();
87 static int packedAtomSize();
92 static int packedGhostSize();
103 Atom& operator = (
Atom const & other);
125 void setTypeId(
int Id);
132 void setIsGhost(
bool isGhost);
186 unsigned int& groups();
211 bool isGhost()
const;
216 const Vector& position()
const;
221 const Vector& velocity()
const;
226 const Vector& force()
const;
231 const Mask& mask()
const;
236 const Plan& plan()
const;
252 unsigned int groups()
const;
274 void packAtom(
Buffer& buffer);
281 void unpackAtom(
Buffer& buffer);
290 void packGhost(
Buffer& buffer);
299 void unpackGhost(
Buffer& buffer);
308 void packUpdate(
Buffer& buffer);
317 void unpackUpdate(
Buffer& buffer);
326 void packForce(
Buffer& buffer);
336 void unpackForce(
Buffer& buffer);
338 #endif // ifdef UTIL_MPI 345 void copyLocalGhost(
Atom const & sendAtom);
352 void copyLocalUpdate(
Atom const & sendAtom);
361 static bool hasAtomContext_;
384 unsigned int localId_;
433 inline void Atom::setTypeId(
int typeId)
434 { typeId_ = typeId; }
439 inline void Atom::setIsGhost(
bool isGhost)
443 localId_ = localId_ | 1;
446 localId_ = localId_ & ~1;
453 inline int Atom::typeId()
const 459 inline bool Atom::isGhost()
const 462 return bool(localId_ & 1);
469 {
return position_; }
474 inline Vector const & Atom::position()
const 475 {
return position_; }
486 inline Vector const & Atom::force()
const 510 {
return arrayPtr_->velocities_[localId_ >> 1]; }
515 inline Vector const & Atom::velocity()
const 516 {
return arrayPtr_->velocities_[localId_ >> 1]; }
522 {
return arrayPtr_->masks_[localId_ >> 1]; }
527 inline Mask const & Atom::mask()
const 528 {
return arrayPtr_->masks_[localId_ >> 1]; }
534 {
return arrayPtr_->plans_[localId_ >> 1]; }
539 inline Plan const & Atom::plan()
const 540 {
return arrayPtr_->plans_[localId_ >> 1]; }
545 inline int Atom::id()
const 546 {
return arrayPtr_->ids_[localId_ >> 1]; }
551 inline void Atom::setId(
int id)
552 { arrayPtr_->ids_[localId_ >> 1] = id; }
559 if (!hasAtomContext_) {
562 return arrayPtr_->contexts_[localId_ >> 1];
570 if (!hasAtomContext_) {
573 return arrayPtr_->contexts_[localId_ >> 1];
579 inline unsigned int& Atom::groups()
580 {
return arrayPtr_->groups_[localId_ >> 1]; }
585 inline unsigned int Atom::groups()
const 586 {
return arrayPtr_->groups_[localId_ >> 1]; }
591 inline bool Atom::hasAtomContext()
592 {
return hasAtomContext_; }
Set of Atoms for which pair interactions with a parent Atom are "masked".
A Vector is a Cartesian vector.
A point particle in an MD simulation.
Parallel domain decomposition (DD) MD simulation.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Descriptor for context of an Atom within a molecule and species.
An array of Atom objects.
Utility classes for scientific computation.
Provides method to allocate array.
Buffer for interprocessor communication.
An IntVector is an integer Cartesian vector.