Changeset e30ce8 for src/builder.cpp
- Timestamp:
- Jun 2, 2010, 4:17:17 PM (15 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, 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:
- 3610bb
- Parents:
- 584a2a
- git-author:
- Frederik Heber <heber@…> (06/02/10 15:41:52)
- git-committer:
- Frederik Heber <heber@…> (06/02/10 16:17:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
r584a2a re30ce8 2354 2354 performCriticalExit(); 2355 2355 } else { 2356 SaveFlag = true; 2357 double * const cell_size = World::getInstance().getDomain(); 2358 for (int axis = 1; axis <= NDIM; axis++) { 2359 int faktor = atoi(argv[argptr++]); 2360 int count; 2361 const element ** Elements; 2362 Vector ** vectors; 2363 if (faktor < 1) { 2364 DoeLog(1) && (eLog()<< Verbose(1) << "Repetition factor mus be greater than 1!" << endl); 2365 faktor = 1; 2366 } 2367 if (mol->getAtomCount() != 0) { // if there is more than none 2368 count = mol->getAtomCount(); // is changed becausing of adding, thus has to be stored away beforehand 2369 Elements = new const element *[count]; 2370 vectors = new Vector *[count]; 2371 j = 0; 2372 for(molecule::iterator iter = mol->begin();iter!=mol->end();++iter){ 2373 Elements[j] = (*iter)->type; 2374 vectors[j] = &(*iter)->x; 2375 j++; 2376 } 2377 if (count != j) 2378 DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl); 2379 x.Zero(); 2380 y.Zero(); 2381 y[abs(axis)-1] = cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude 2382 for (int i=1;i<faktor;i++) { // then add this list with respective translation factor times 2383 x += y; // per factor one cell width further 2384 for (int k=count;k--;) { // go through every atom of the original cell 2385 first = World::getInstance().createAtom(); // create a new body 2386 first->x = (*vectors[k]) + x; 2387 first->type = Elements[k]; // insert original element 2388 mol->AddAtom(first); // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...) 2389 } 2390 } 2391 // free memory 2392 delete[](Elements); 2393 delete[](vectors); 2394 // correct cell size 2395 if (axis < 0) { // if sign was negative, we have to translate everything 2396 x =(-(faktor-1)) * y; 2397 mol->Translate(&x); 2398 } 2399 cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= faktor; 2400 } 2401 } 2356 ArgcList.insert(argptr-1); 2357 ArgcList.insert(argptr); 2358 ArgcList.insert(argptr+1); 2359 ArgcList.insert(argptr+2); 2360 argptr+=3; 2402 2361 } 2403 2362 break;
Note:
See TracChangeset
for help on using the changeset viewer.