Changeset 6590194 for pcp/src


Ignore:
Timestamp:
Apr 21, 2008, 2:19:26 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
05fec0
Parents:
4782e78
git-author:
Frederik Heber <heber@…> (04/18/08 16:18:38)
git-committer:
Frederik Heber <heber@…> (04/21/08 14:19:26)
Message:

UpdateIonsR(): included constraint motion, and don't reset Forces afterwards, as they are needed for OutputVis()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified pcp/src/ions.c

    r4782e78 r6590194  
    853853      R_old = &I->I[is].R_old[NDIM*ia];
    854854      R_old_old = &I->I[is].R_old_old[NDIM*ia];
    855       if (I->I[is].IMT[ia] == MoveIon) {
     855      //if (I->I[is].IMT[ia] == MoveIon) { // even FixedIon moves, only not by other's forces
    856856                                for (d=0; d<NDIM; d++) {
    857857                                  R_old_old[d] = R_old[d];                              // shift old values
    858858                                  R_old[d] = R[d];
    859                                   R[d] += delta_t*(U[d]+a*FIon[d]);                     // F = m * a and s = 0.5 * a * t^2
     859                            R[d] += delta_t*(U[d]+a*FIon[d]);                   // F = m * a and s = 0.5 * a * t^2
    860860                                  FIon_old[d] = FIon[d];                                        // store old force
    861                                   FIon[d] = 0;                                                                          // zero all as a sign that's been moved
    862                                   FIonL[d] = 0;
    863                                   FIonNL[d] = 0;
    864                                   FEwald[d] = 0;
     861//                                FIon[d] = 0.;                                                                         // zero all as a sign that's been moved
     862//                                FIonL[d] = 0.;
     863//                                FIonNL[d] = 0.;
     864//                                FEwald[d] = 0.;
     865// don't reset forces here anymore, as we OutputVis() after this and before next CalculateForce() (rendering them null in the cute graphs)
    865866                                }
     867        if (I->I[is].Constraints[ia] != NULL) { // override current resulting R if constrained is given
     868          fprintf(stderr, "(%i) Using constrained coordinates R of step %d on ion (%i,%i)\n", P->Par.me, I->I[is].Constraints[ia]->step, is, ia);
     869          if ((I->I[is].Constraints[ia]->step != P->R.OuterStep) && (P->Par.me == 0))
     870            fprintf(stderr, "(%i) WARNING: constraint step %d does not match Outerstep %d for ion (%d,%d)\n", P->Par.me, I->I[is].Constraints[ia]->step, P->R.OuterStep, is, ia);
     871          for (d=0; d<NDIM; d++)
     872            R[d] = I->I[is].Constraints[ia]->R[d];
     873          I->I[is].IMT[ia] = I->I[is].Constraints[ia]->IMT;
     874          //RemoveConstraintItem(&I->I[is],ia); // and remove this first item from the list: // is done now  at UpdateIonsU()
     875        }
    866876                                RMat33Vec3(sR, P->Lat.InvBasis, R);
    867877                                RMat33Vec3(sRold, P->Lat.InvBasis, R_old);
     
    882892                                RMat33Vec3(R_old, P->Lat.RealBasis, sRold);
    883893                                RMat33Vec3(R_old_old, P->Lat.RealBasis, sRoldold);
    884       }
     894      //}
    885895    }
    886896  }
Note: See TracChangeset for help on using the changeset viewer.