Changeset 13d7f6


Ignore:
Timestamp:
Apr 21, 2008, 2:19:23 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
460e95
Parents:
9b2f5d
git-author:
Frederik Heber <heber@…> (04/18/08 14:16:44)
git-committer:
Frederik Heber <heber@…> (04/21/08 14:19:23)
Message:

ResetForces() added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pcp/src/ions.c

    r9b2f5d r13d7f6  
    579579}
    580580
     581/** Resets the forces array.
     582 * \param *P Problem at hand
     583 */
     584void ResetForces(struct Problem *P)
     585{
     586  struct Ions *I = &P->Ion;
     587  double *FIon, *FIonL, *FIonNL, *FEwald;
     588  int is, ia, d;
     589  for (is=0; is < I->Max_Types; is++) { // go through all types ...
     590    for (ia=0; ia < I->I[is].Max_IonsOfType; ia++) { // .. and each ion of the type
     591      FIon = &I->I[is].FIon[NDIM*ia];
     592      FIonL = &I->I[is].FIonL[NDIM*ia];
     593      FIonNL = &I->I[is].FIonNL[NDIM*ia];
     594      FEwald = &I->I[is].FEwald[NDIM*ia];
     595      for (d=0; d<NDIM; d++) {
     596        FIon[d] = 0.;                   // zero all as a sign that's been moved
     597        FIonL[d] = 0.;
     598        FIonNL[d] = 0.;
     599        FEwald[d] = 0.;
     600      }
     601    }
     602  }
     603};
     604
    581605/** Changes ion's velocity according to acting force.
    582606 * IonType::U is changed by the weighted force of actual step and last one
Note: See TracChangeset for help on using the changeset viewer.