9 #include <mcMd/chemistry/Atom.h> 30 for (
int j = 0; j < MaxAtomCell; ++j) {
42 int jp, atomId, nAtomCellTest;
45 if (atoms_[jp] != 0) {
46 atomId = atoms_[jp]->id();
48 if (cellTags[atomId].cellId != icell) {
49 UTIL_THROW(
"Value in CellTag.cellId inconsistent with icell");
51 if (cellTags[atomId].cellPos != jp) {
52 std::cout <<
"atomId =" << atomId << std::endl;
53 std::cout <<
"cellTags[atomId].cellPos =" 54 << cellTags[atomId].cellPos << std::endl;
55 std::cout <<
"index jp in Cell = " << jp << std::endl;
57 "Value in CellTag.cellPos inconsistent with Cell.atoms_");
59 if (jp >= firstClearPos_) {
60 UTIL_THROW(
"Value atoms_[i] >=0 for i >= firstClearPos_");
63 if (jp < firstEmptyPos_) {
64 UTIL_THROW(
"Value atoms_[i] < 0 for i < firstEmptyPos_");
68 if (firstClearPos_ > 0) {
69 if (atoms_[firstClearPos_-1] == 0) {
70 UTIL_THROW(
"Error: atoms_[firstClearPos_-1] == 0");
73 if (nAtomCellTest != nAtomCell_) {
74 UTIL_THROW(
"Number of atoms in cell != nAtomCell_");
Cell()
Default constructor, creates an empty Cell.
bool isValid(const Array< CellTag > &cellTags, int nAtom, int icell) const
Check validity of Cell, and consistency with array of CellTags.
Array container class template.
void clear()
Reset Cell to empty state.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Utility classes for scientific computation.
static const int MaxAtomCell
Maximum number of atoms per cell.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).