Ignore:
Timestamp:
Aug 3, 2009, 6:58:46 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
f4a346
Parents:
4e4940 (diff), e8de2e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ConcaveHull' of ssh://heber@192.168.194.2/home/metzler/workspace/espack into ConcaveHull

Conflicts:

molecuilder/src/atom.cpp
molecuilder/src/boundary.cpp
molecuilder/src/boundary.hpp
molecuilder/src/linkedcell.cpp
molecuilder/src/linkedcell.hpp
molecuilder/src/molecules.hpp
molecuilder/src/vector.hpp

  • added Saskia Metzler's code that finds whether a point is in- or outside.
  • The code is not yet incorporated, but I rather want to continue with merging TesselationRefactoring first.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/linkedcell.cpp

    r4e4940 r0e2190  
    129129
    130130/** Calculates the index for a given atom *Walker.
    131  * \param *Walker atom to set index to
     131 * \param Walker atom to set index to
    132132 * \return if the atom is also found in this cell - true, else - false
    133133 */
    134 bool LinkedCell::SetIndexToAtom(atom *Walker)
     134bool LinkedCell::SetIndexToAtom(const atom &Walker)
    135135{
    136136  bool status = false;
    137137  for (int i=0;i<NDIM;i++) {
    138     n[i] = (int)floor((Walker->x.x[i] - min.x[i])/RADIUS);
     138    n[i] = (int)floor((Walker.x.x[i] - min.x[i])/RADIUS);
    139139  }
    140140  index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
    141141  if (CheckBounds()) {
    142142    for (LinkedAtoms::iterator Runner = LC[index].begin(); Runner != LC[index].end(); Runner++)
    143       status = status || ((*Runner) == Walker);
     143      status = status || ((*Runner) == &Walker);
    144144    return status;
    145145  } else {
    146     cerr << Verbose(1) << "ERROR: Atom "<< *Walker << " at " << Walker->x << " is out of bounds." << endl;
     146    cerr << Verbose(1) << "ERROR: Atom "<< Walker << " at " << Walker.x << " is out of bounds." << endl;
    147147    return false;
     148  }
     149};
     150
     151/** Calculates the interval bounds of the linked cell grid.
     152 * \param *lower lower bounds
     153 * \param *upper upper bounds
     154 */
     155void LinkedCell::GetNeighbourBounds(int lower[NDIM], int upper[NDIM])
     156{
     157  for (int i=0;i<NDIM;i++) {
     158    lower[i] = ((n[i]-1) >= 0) ? n[i]-1 : 0;
     159    upper[i] = ((n[i]+1) < N[i]) ? n[i]+1 : N[i]-1;
     160    //cout << " [" << Nlower[i] << "," << Nupper[i] << "] ";
     161    // check for this axis whether the point is outside of our grid
     162    if (n[i] < 0)
     163      upper[i] = lower[i];
     164    if (n[i] > N[i])
     165      lower[i] = upper[i];
     166
     167    //cout << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl;
    148168  }
    149169};
     
    153173 * \return Vector is inside bounding box - true, else - false
    154174 */
    155 bool LinkedCell::SetIndexToVector(Vector *x)
     175bool LinkedCell::SetIndexToVector(const Vector *x)
    156176{
    157177  bool status = true;
Note: See TracChangeset for help on using the changeset viewer.