source: src/Dynamics/MinimiseConstrainedPotential.cpp@ eb33c4

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since eb33c4 was e355762, checked in by Frederik Heber <heber@…>, 14 years ago

Rewrote MinimiseConstrainedPotential to just use std::map instead of arrays.

  • MinimiseConstrainedPotential::operator() needs std::Map<atom*,atom*> as parameter for PermutationMap.
  • Property mode set to 100644
File size: 18.8 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/*
9 * MinimiseConstrainedPotential.cpp
10 *
11 * Created on: Feb 23, 2011
12 * Author: heber
13 */
14
15// include config.h
16#ifdef HAVE_CONFIG_H
17#include <config.h>
18#endif
19
20#include "CodePatterns/MemDebug.hpp"
21
22#include <gsl/gsl_matrix.h>
23#include <gsl/gsl_vector.h>
24#include <gsl/gsl_linalg.h>
25
26#include "atom.hpp"
27#include "config.hpp"
28#include "element.hpp"
29#include "CodePatterns/enumeration.hpp"
30#include "CodePatterns/Info.hpp"
31#include "CodePatterns/Verbose.hpp"
32#include "CodePatterns/Log.hpp"
33#include "molecule.hpp"
34#include "parser.hpp"
35#include "LinearAlgebra/Plane.hpp"
36#include "World.hpp"
37
38#include "Dynamics/MinimiseConstrainedPotential.hpp"
39
40
41MinimiseConstrainedPotential::MinimiseConstrainedPotential(
42 molecule::atomSet &_atoms,
43 std::map<atom*, atom *> &_PermutationMap) :
44 atoms(_atoms),
45 PermutationMap(_PermutationMap)
46{}
47
48MinimiseConstrainedPotential::~MinimiseConstrainedPotential()
49{}
50
51double MinimiseConstrainedPotential::operator()(int _startstep, int _endstep, bool IsAngstroem)
52{
53 double Potential, OldPotential, OlderPotential;
54 int round;
55 atom *Sprinter = NULL;
56 DistanceMap::iterator Rider, Strider;
57
58 // set to zero
59 PermutationMap.clear();
60 DoubleList.clear();
61 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
62 DistanceList[*iter].clear();
63 }
64 DistanceList.clear();
65 DistanceIterators.clear();
66 DistanceIterators.clear();
67
68 /// Minimise the potential
69 // set Lagrange multiplier constants
70 PenaltyConstants[0] = 10.;
71 PenaltyConstants[1] = 1.;
72 PenaltyConstants[2] = 1e+7; // just a huge penalty
73 // generate the distance list
74 DoLog(1) && (Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl);
75 FillDistanceList();
76
77 // create the initial PermutationMap (source -> target)
78 CreateInitialLists();
79
80 // make the PermutationMap injective by checking whether we have a non-zero constants[2] term in it
81 DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl);
82 MakeInjectivePermutation();
83 DoubleList.clear();
84
85 // argument minimise the constrained potential in this injective PermutationMap
86 DoLog(1) && (Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl);
87 OldPotential = 1e+10;
88 round = 0;
89 do {
90 DoLog(2) && (Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl);
91 OlderPotential = OldPotential;
92 molecule::atomSet::const_iterator iter;
93 do {
94 iter = atoms.begin();
95 for (; iter != atoms.end(); ++iter) {
96 CalculateDoubleList();
97 PrintPermutationMap();
98 Sprinter = DistanceIterators[(*iter)]->second; // store initial partner
99 Strider = DistanceIterators[(*iter)]; //remember old iterator
100 DistanceIterators[(*iter)] = StepList[(*iter)];
101 if (DistanceIterators[(*iter)] == DistanceList[(*iter)].end()) {// stop, before we run through the list and still on
102 DistanceIterators[(*iter)] == DistanceList[(*iter)].begin();
103 break;
104 }
105 //Log() << Verbose(2) << "Current Walker: " << *(*iter) << " with old/next candidate " << *Sprinter << "/" << *DistanceIterators[(*iter)]->second << "." << endl;
106 // find source of the new target
107 molecule::atomSet::const_iterator runner = atoms.begin();
108 for (; runner != atoms.end(); ++runner) { // find the source whose toes we might be stepping on (Walker's new target should be in use by another already)
109 if (PermutationMap[(*runner)] == DistanceIterators[(*iter)]->second) {
110 //Log() << Verbose(2) << "Found the corresponding owner " << *(*runner) << " to " << *PermutationMap[(*runner)] << "." << endl;
111 break;
112 }
113 }
114 if (runner != atoms.end()) { // we found the other source
115 // then look in its distance list for Sprinter
116 Rider = DistanceList[(*runner)].begin();
117 for (; Rider != DistanceList[(*runner)].end(); Rider++)
118 if (Rider->second == Sprinter)
119 break;
120 if (Rider != DistanceList[(*runner)].end()) { // if we have found one
121 //Log() << Verbose(2) << "Current Other: " << *(*runner) << " with old/next candidate " << *PermutationMap[(*runner)] << "/" << *Rider->second << "." << endl;
122 // exchange both
123 PermutationMap[(*iter)] = DistanceIterators[(*iter)]->second; // put next farther distance into PermutationMap
124 PermutationMap[(*runner)] = Sprinter; // and hand the old target to its respective owner
125 CalculateDoubleList();
126 PrintPermutationMap();
127 // calculate the new potential
128 //Log() << Verbose(2) << "Checking new potential ..." << endl;
129 Potential = ConstrainedPotential();
130 if (Potential > OldPotential) { // we made everything worse! Undo ...
131 //Log() << Verbose(3) << "Nay, made the potential worse: " << Potential << " vs. " << OldPotential << "!" << endl;
132 //Log() << Verbose(3) << "Setting " << *(*runner) << "'s source to " << *DistanceIterators[(*runner)]->second << "." << endl;
133 // Undo for Runner (note, we haven't moved the iteration yet, we may use this)
134 PermutationMap[(*runner)] = DistanceIterators[(*runner)]->second;
135 // Undo for Walker
136 DistanceIterators[(*iter)] = Strider; // take next farther distance target
137 //Log() << Verbose(3) << "Setting " << *(*iter) << "'s source to " << *DistanceIterators[(*iter)]->second << "." << endl;
138 PermutationMap[(*iter)] = DistanceIterators[(*iter)]->second;
139 } else {
140 DistanceIterators[(*runner)] = Rider; // if successful also move the pointer in the iterator list
141 DoLog(3) && (Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl);
142 OldPotential = Potential;
143 }
144 if (Potential > PenaltyConstants[2]) {
145 DoeLog(1) && (eLog()<< Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl);
146 exit(255);
147 }
148 //Log() << Verbose(0) << endl;
149 } else {
150 DoeLog(1) && (eLog()<< Verbose(1) << **runner << " was not the owner of " << *Sprinter << "!" << endl);
151 exit(255);
152 }
153 } else {
154 PermutationMap[(*iter)] = DistanceIterators[(*iter)]->second; // new target has no source!
155 }
156 StepList[(*iter)]++; // take next farther distance target
157 }
158 } while (++iter != atoms.end());
159 } while ((OlderPotential - OldPotential) > 1e-3);
160 DoLog(1) && (Log() << Verbose(1) << "done." << endl);
161
162
163 return ConstrainedPotential();
164};
165
166void MinimiseConstrainedPotential::FillDistanceList()
167{
168 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
169 for (molecule::atomSet::const_iterator runner = atoms.begin(); runner != atoms.end(); ++runner) {
170 DistanceList[(*iter)].insert( DistancePair((*iter)->getPositionAtStep(startstep).distance((*runner)->getPositionAtStep(endstep)), (*runner)) );
171 }
172 }
173};
174
175void MinimiseConstrainedPotential::CreateInitialLists()
176{
177 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
178 StepList[(*iter)] = DistanceList[(*iter)].begin(); // stores the step to the next iterator that could be a possible next target
179 PermutationMap[(*iter)] = DistanceList[(*iter)].begin()->second; // always pick target with the smallest distance
180 DoubleList[DistanceList[(*iter)].begin()->second]++; // increase this target's source count (>1? not injective)
181 DistanceIterators[(*iter)] = DistanceList[(*iter)].begin(); // and remember which one we picked
182 DoLog(2) && (Log() << Verbose(2) << **iter << " starts with distance " << DistanceList[(*iter)].begin()->first << "." << endl);
183 }
184};
185
186void MinimiseConstrainedPotential::MakeInjectivePermutation()
187{
188 molecule::atomSet::const_iterator iter = atoms.begin();
189 DistanceMap::iterator NewBase;
190 double Potential = fabs(ConstrainedPotential());
191
192 if (atoms.empty()) {
193 eLog() << Verbose(1) << "Molecule is empty." << endl;
194 return;
195 }
196 while ((Potential) > PenaltyConstants[2]) {
197 CalculateDoubleList();
198 PrintPermutationMap();
199 iter++;
200 if (iter == atoms.end()) // round-robin at the end
201 iter = atoms.begin();
202 if (DoubleList[DistanceIterators[(*iter)]->second] <= 1) // no need to make those injective that aren't
203 continue;
204 // now, try finding a new one
205 Potential = TryNextNearestNeighbourForInjectivePermutation((*iter), Potential);
206 }
207 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
208 // now each single entry in the DoubleList should be <=1
209 if (DoubleList[*iter] > 1) {
210 DoeLog(0) && (eLog()<< Verbose(0) << "Failed to create an injective PermutationMap!" << endl);
211 performCriticalExit();
212 }
213 }
214 DoLog(1) && (Log() << Verbose(1) << "done." << endl);
215};
216
217unsigned int MinimiseConstrainedPotential::CalculateDoubleList()
218{
219 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
220 DoubleList[*iter] = 0;
221 unsigned int doubles = 0;
222 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
223 DoubleList[ PermutationMap[*iter] ]++;
224 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
225 if (DoubleList[*iter] > 1)
226 doubles++;
227 if (doubles >0)
228 DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl);
229 return doubles;
230};
231
232void MinimiseConstrainedPotential::PrintPermutationMap() const
233{
234 stringstream zeile1, zeile2;
235 int doubles = 0;
236 zeile1 << "PermutationMap: ";
237 zeile2 << " ";
238 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
239 zeile1 << (*iter)->getName() << " ";
240 zeile2 << (PermutationMap[*iter])->getName() << " ";
241 }
242 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
243 std::map<atom *, unsigned int>::const_iterator value_iter = DoubleList.find(*iter);
244 if (value_iter->second > (unsigned int)1)
245 doubles++;
246 }
247 if (doubles >0)
248 DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl);
249// Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl;
250};
251
252double MinimiseConstrainedPotential::ConstrainedPotential()
253{
254 double tmp = 0.;
255 double result = 0.;
256 // go through every atom
257 atom *Runner = NULL;
258 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
259 // first term: distance to target
260 Runner = PermutationMap[(*iter)]; // find target point
261 tmp = ((*iter)->getPositionAtStep(startstep).distance(Runner->getPositionAtStep(endstep)));
262 tmp *= IsAngstroem ? 1. : 1./AtomicLengthToAngstroem;
263 result += PenaltyConstants[0] * tmp;
264 //Log() << Verbose(4) << "Adding " << tmp*constants[0] << "." << endl;
265
266 // second term: sum of distances to other trajectories
267 result += SumDistanceOfTrajectories((*iter));
268
269 // third term: penalty for equal targets
270 result += PenalizeEqualTargets((*iter));
271 }
272
273 return result;
274};
275
276double MinimiseConstrainedPotential::TryNextNearestNeighbourForInjectivePermutation(atom *Walker, double &OldPotential)
277{
278 double Potential = 0;
279 DistanceMap::iterator NewBase = DistanceIterators[Walker]; // store old base
280 do {
281 NewBase++; // take next further distance in distance to targets list that's a target of no one
282 } while ((DoubleList[NewBase->second] != 0) && (NewBase != DistanceList[Walker].end()));
283 if (NewBase != DistanceList[Walker].end()) {
284 PermutationMap[Walker] = NewBase->second;
285 Potential = fabs(ConstrainedPotential());
286 if (Potential > OldPotential) { // undo
287 PermutationMap[Walker] = DistanceIterators[Walker]->second;
288 } else { // do
289 DoubleList[DistanceIterators[Walker]->second]--; // decrease the old entry in the doubles list
290 DoubleList[NewBase->second]++; // increase the old entry in the doubles list
291 DistanceIterators[Walker] = NewBase;
292 OldPotential = Potential;
293 DoLog(3) && (Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl);
294 }
295 }
296 return Potential;
297};
298
299double MinimiseConstrainedPotential::PenalizeEqualTargets(atom *Walker)
300{
301 double result = 0.;
302 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
303 if ((PermutationMap[Walker] == PermutationMap[(*iter)]) && (Walker < (*iter))) {
304 // atom *Sprinter = PermutationMap[Walker->nr];
305 // Log() << Verbose(0) << *Walker << " and " << *(*iter) << " are heading to the same target at ";
306 // Log() << Verbose(0) << Sprinter->getPosition(endstep);
307 // Log() << Verbose(0) << ", penalting." << endl;
308 result += PenaltyConstants[2];
309 //Log() << Verbose(4) << "Adding " << constants[2] << "." << endl;
310 }
311 }
312 return result;
313};
314
315double MinimiseConstrainedPotential::SumDistanceOfTrajectories(atom *Walker)
316{
317 gsl_matrix *A = gsl_matrix_alloc(NDIM,NDIM);
318 gsl_vector *x = gsl_vector_alloc(NDIM);
319 atom *Sprinter = NULL;
320 Vector trajectory1, trajectory2, normal, TestVector;
321 double Norm1, Norm2, tmp, result = 0.;
322
323 for (molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
324 if ((*iter) == Walker) // hence, we only go up to the Walker, not beyond (similar to i=0; i<j; i++)
325 break;
326 // determine normalized trajectories direction vector (n1, n2)
327 Sprinter = PermutationMap[Walker]; // find first target point
328 trajectory1 = Sprinter->getPositionAtStep(endstep) - Walker->getPositionAtStep(startstep);
329 trajectory1.Normalize();
330 Norm1 = trajectory1.Norm();
331 Sprinter = PermutationMap[(*iter)]; // find second target point
332 trajectory2 = Sprinter->getPositionAtStep(endstep) - (*iter)->getPositionAtStep(startstep);
333 trajectory2.Normalize();
334 Norm2 = trajectory1.Norm();
335 // check whether either is zero()
336 if ((Norm1 < MYEPSILON) && (Norm2 < MYEPSILON)) {
337 tmp = Walker->getPositionAtStep(startstep).distance((*iter)->getPositionAtStep(startstep));
338 } else if (Norm1 < MYEPSILON) {
339 Sprinter = PermutationMap[Walker]; // find first target point
340 trajectory1 = Sprinter->getPositionAtStep(endstep) - (*iter)->getPositionAtStep(startstep);
341 trajectory2 *= trajectory1.ScalarProduct(trajectory2); // trajectory2 is scaled to unity, hence we don't need to divide by anything
342 trajectory1 -= trajectory2; // project the part in norm direction away
343 tmp = trajectory1.Norm(); // remaining norm is distance
344 } else if (Norm2 < MYEPSILON) {
345 Sprinter = PermutationMap[(*iter)]; // find second target point
346 trajectory2 = Sprinter->getPositionAtStep(endstep) - Walker->getPositionAtStep(startstep); // copy second offset
347 trajectory1 *= trajectory2.ScalarProduct(trajectory1); // trajectory1 is scaled to unity, hence we don't need to divide by anything
348 trajectory2 -= trajectory1; // project the part in norm direction away
349 tmp = trajectory2.Norm(); // remaining norm is distance
350 } else if ((fabs(trajectory1.ScalarProduct(trajectory2)/Norm1/Norm2) - 1.) < MYEPSILON) { // check whether they're linear dependent
351 // Log() << Verbose(3) << "Both trajectories of " << *Walker << " and " << *Runner << " are linear dependent: ";
352 // Log() << Verbose(0) << trajectory1;
353 // Log() << Verbose(0) << " and ";
354 // Log() << Verbose(0) << trajectory2;
355 tmp = Walker->getPositionAtStep(startstep).distance((*iter)->getPositionAtStep(startstep));
356 // Log() << Verbose(0) << " with distance " << tmp << "." << endl;
357 } else { // determine distance by finding minimum distance
358 // Log() << Verbose(3) << "Both trajectories of " << *Walker << " and " << *(*iter) << " are linear independent ";
359 // Log() << Verbose(0) << endl;
360 // Log() << Verbose(0) << "First Trajectory: ";
361 // Log() << Verbose(0) << trajectory1 << endl;
362 // Log() << Verbose(0) << "Second Trajectory: ";
363 // Log() << Verbose(0) << trajectory2 << endl;
364 // determine normal vector for both
365 normal = Plane(trajectory1, trajectory2,0).getNormal();
366 // print all vectors for debugging
367 // Log() << Verbose(0) << "Normal vector in between: ";
368 // Log() << Verbose(0) << normal << endl;
369 // setup matrix
370 for (int i=NDIM;i--;) {
371 gsl_matrix_set(A, 0, i, trajectory1[i]);
372 gsl_matrix_set(A, 1, i, trajectory2[i]);
373 gsl_matrix_set(A, 2, i, normal[i]);
374 gsl_vector_set(x,i, (Walker->getPositionAtStep(startstep)[i] - (*iter)->getPositionAtStep(startstep)[i]));
375 }
376 // solve the linear system by Householder transformations
377 gsl_linalg_HH_svx(A, x);
378 // distance from last component
379 tmp = gsl_vector_get(x,2);
380 // Log() << Verbose(0) << " with distance " << tmp << "." << endl;
381 // test whether we really have the intersection (by checking on c_1 and c_2)
382 trajectory1.Scale(gsl_vector_get(x,0));
383 trajectory2.Scale(gsl_vector_get(x,1));
384 normal.Scale(gsl_vector_get(x,2));
385 TestVector = (*iter)->getPositionAtStep(startstep) + trajectory2 + normal
386 - (Walker->getPositionAtStep(startstep) + trajectory1);
387 if (TestVector.Norm() < MYEPSILON) {
388 // Log() << Verbose(2) << "Test: ok.\tDistance of " << tmp << " is correct." << endl;
389 } else {
390 // Log() << Verbose(2) << "Test: failed.\tIntersection is off by ";
391 // Log() << Verbose(0) << TestVector;
392 // Log() << Verbose(0) << "." << endl;
393 }
394 }
395 // add up
396 tmp *= IsAngstroem ? 1. : 1./AtomicLengthToAngstroem;
397 if (fabs(tmp) > MYEPSILON) {
398 result += PenaltyConstants[1] * 1./tmp;
399 //Log() << Verbose(4) << "Adding " << 1./tmp*constants[1] << "." << endl;
400 }
401 }
402 return result;
403};
404
405void MinimiseConstrainedPotential::EvaluateConstrainedForces(ForceMatrix *Force)
406{
407 double constant = 10.;
408
409 /// evaluate forces (only the distance to target dependent part) with the final PermutationMap
410 DoLog(1) && (Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl);
411 for(molecule::atomSet::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
412 atom *Sprinter = PermutationMap[(*iter)];
413 // set forces
414 for (int i=NDIM;i++;)
415 Force->Matrix[0][(*iter)->getNr()][5+i] += 2.*constant*sqrt((*iter)->getPositionAtStep(startstep).distance(Sprinter->getPositionAtStep(endstep)));
416 }
417 DoLog(1) && (Log() << Verbose(1) << "done." << endl);
418};
419
Note: See TracBrowser for help on using the repository browser.