Exemple #1
0
void CState::fillBoxes()
{
    cout << "CState::fillBoxes()" << endl;

    vec3 atomPosition;
    ivec3 boxIndex;
    CAtom* atomptr;

    for (int i = 0; i < nAtoms; i++)
    {
        atomptr = atoms[i];
        atomPosition = atomptr->getPosition();
        for (int j = 0; j < 3; j++)
        {
            boxIndex(j) = int(floor(atomPosition(j)/boxDimensions(j)));
        }
        boxes[calculate_box_number(boxIndex, NBoxes)]->addAtom(atomptr);
    }

    cout << "Exiting CState::fillBoxes()" << endl << endl;
}