Changeset 920c70 for src/molecule_dynamics.cpp
- Timestamp:
- May 31, 2010, 1:09:58 PM (16 years ago)
- Branches:
- 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, Candidate_v1.7.0, 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
- Children:
- 42af9e
- Parents:
- 87b597
- File:
-
- 1 edited
-
src/molecule_dynamics.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_dynamics.cpp
r87b597 r920c70 190 190 { 191 191 stringstream zeile1, zeile2; 192 int *DoubleList = Calloc<int>(AtomCount, "PrintPermutationMap: *DoubleList"); 192 int *DoubleList = new int[AtomCount]; 193 for(int i=0;i<AtomCount;i++) 194 DoubleList[i] = 0; 193 195 int doubles = 0; 194 196 zeile1 << "PermutationMap: "; … … 204 206 if (doubles >0) 205 207 DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl); 206 Free(&DoubleList);208 delete[](DoubleList); 207 209 // Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl; 208 210 }; … … 339 341 double Potential, OldPotential, OlderPotential; 340 342 struct EvaluatePotential Params; 341 Params.PermutationMap = Calloc<atom*>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.**PermutationMap");342 Params.DistanceList = Malloc<DistanceMap*>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.**DistanceList");343 Params.DistanceIterators = Malloc<DistanceMap::iterator>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*DistanceIterators");344 Params.DoubleList = Calloc<int>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*DoubleList");345 Params.StepList = Malloc<DistanceMap::iterator>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*StepList");343 Params.PermutationMap = new atom *[AtomCount]; 344 Params.DistanceList = new DistanceMap *[AtomCount]; 345 Params.DistanceIterators = new DistanceMap::iterator[AtomCount]; 346 Params.DoubleList = new int[AtomCount]; 347 Params.StepList = new DistanceMap::iterator[AtomCount]; 346 348 int round; 347 349 atom *Walker = NULL, *Runner = NULL, *Sprinter = NULL; 348 350 DistanceMap::iterator Rider, Strider; 351 352 // set to zero 353 for (int i=0;i<AtomCount;i++) { 354 Params.PermutationMap[i] = NULL; 355 Params.DoubleList[i] = 0; 356 } 349 357 350 358 /// Minimise the potential … … 363 371 DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl); 364 372 MakeInjectivePermutation(this, Params); 365 Free(&Params.DoubleList);373 delete[](Params.DoubleList); 366 374 367 375 // argument minimise the constrained potential in this injective PermutationMap … … 445 453 for (int i=AtomCount; i--;) 446 454 Params.DistanceList[i]->clear(); 447 Free(&Params.DistanceList);448 Free(&Params.DistanceIterators);455 delete[](Params.DistanceList); 456 delete[](Params.DistanceIterators); 449 457 return ConstrainedPotential(Params); 450 458 }; … … 488 496 MinimiseConstrainedPotential(PermutationMap, startstep, endstep, configuration.GetIsAngstroem()); 489 497 else { 490 PermutationMap = Malloc<atom *>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");498 PermutationMap = new atom *[AtomCount]; 491 499 SetIndexedArrayForEachAtomTo( PermutationMap, &atom::nr ); 492 500 } … … 523 531 524 532 // store the list to single step files 525 int *SortIndex = Malloc<int>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: *SortIndex");533 int *SortIndex = new int[AtomCount]; 526 534 for (int i=AtomCount; i--; ) 527 535 SortIndex[i] = i; 528 536 status = MoleculePerStep->OutputConfigForListOfFragments(&configuration, SortIndex); 537 delete[](SortIndex); 529 538 530 539 // free and return 531 Free(&PermutationMap);540 delete[](PermutationMap); 532 541 delete(MoleculePerStep); 533 542 return status; … … 590 599 ConstrainedPotentialEnergy = MinimiseConstrainedPotential(PermutationMap,configuration.DoConstrainedMD, 0, configuration.GetIsAngstroem()); 591 600 EvaluateConstrainedForces(configuration.DoConstrainedMD, 0, PermutationMap, &Force); 592 Free(&PermutationMap);601 delete[](PermutationMap); 593 602 } 594 603
Note:
See TracChangeset
for help on using the changeset viewer.
