Changeset 318bfd for src/builder.cpp
- Timestamp:
- Jun 13, 2008, 9:18:57 AM (18 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:
- edb650
- Parents:
- 6c5812
- File:
-
- 1 edited
-
src/builder.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
r6c5812 r318bfd 758 758 cout << "\t-b x1 x2 x3\tCenter atoms in domain with given edge lengths of (x1,x2,x3)." << endl; 759 759 cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 760 cout << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl; 760 761 cout << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl; 761 762 cout << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner and stores config files in same dir as config." << endl; … … 768 769 cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl; 769 770 cout << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl; 771 cout << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl; 770 772 cout << "\t-v/-V\t\tGives version information." << endl; 771 773 cout << "Note: config files must not begin with '-' !" << endl; … … 983 985 ExitFlag = 1; 984 986 cout << Verbose(0) << "Evaluating volume of the convex envelope."; 985 // tmp = atof(argv[argptr++]);986 // if (tmp < 1.0) {987 // cerr << Verbose(0) << "Density must be greater than 1.0g/cm^3 !" << endl;988 // tmp = 1.3;989 // }990 987 VolumeOfConvexEnvelope((ofstream *)&cout, &configuration, NULL, mol); 988 break; 989 case 'u': 990 { 991 double tmp; 992 ExitFlag = 1; 993 cout << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water."; 994 tmp = atof(argv[argptr++]); 995 if (tmp < 1.0) { 996 cerr << Verbose(0) << "Density must be greater than 1.0g/cm^3 !" << endl; 997 tmp = 1.3; 998 } 999 // for(int i=0;i<NDIM;i++) { 1000 // repetition[i] = atoi(argv[argptr++]); 1001 // if (repetition[i] < 1) 1002 // cerr << Verbose(0) << "ERROR: repetition value must be greater 1!" << endl; 1003 // repetition[i] = 1; 1004 // } 1005 PrepareClustersinWater((ofstream *)&cout, &configuration, mol, tmp); 1006 } 1007 break; 1008 case 'd': 1009 for (int axis = 1; axis <= NDIM; axis++) { 1010 int faktor = atoi(argv[argptr++]); 1011 int count; 1012 element ** Elements; 1013 vector ** Vectors; 1014 if (faktor < 1) { 1015 cerr << Verbose(0) << "ERROR: Repetition faktor mus be greater than 1!" << endl; 1016 faktor = 1; 1017 } 1018 mol->CountAtoms((ofstream *)&cout); // recount atoms 1019 if (mol->AtomCount != 0) { // if there is more than none 1020 count = mol->AtomCount; // is changed becausing of adding, thus has to be stored away beforehand 1021 Elements = new element *[count]; 1022 Vectors = new vector *[count]; 1023 j = 0; 1024 first = mol->start; 1025 while (first->next != mol->end) { // make a list of all atoms with coordinates and element 1026 first = first->next; 1027 Elements[j] = first->type; 1028 Vectors[j] = &first->x; 1029 j++; 1030 } 1031 if (count != j) 1032 cout << Verbose(0) << "ERROR: AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl; 1033 x.Zero(); 1034 y.Zero(); 1035 y.x[abs(axis)-1] = mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude 1036 for (int i=1;i<faktor;i++) { // then add this list with respective translation factor times 1037 x.AddVector(&y); // per factor one cell width further 1038 for (int k=count;k--;) { // go through every atom of the original cell 1039 first = new atom(); // create a new body 1040 first->x.CopyVector(Vectors[k]); // use coordinate of original atom 1041 first->x.AddVector(&x); // translate the coordinates 1042 first->type = Elements[k]; // insert original element 1043 mol->AddAtom(first); // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...) 1044 } 1045 } 1046 // free memory 1047 delete[](Elements); 1048 delete[](Vectors); 1049 // correct cell size 1050 if (axis < 0) { // if sign was negative, we have to translate everything 1051 x.Zero(); 1052 x.AddVector(&y); 1053 x.Scale(-(faktor-1)); 1054 mol->Translate(&x); 1055 } 1056 mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= faktor; 1057 } 1058 } 991 1059 break; 992 1060 default: // no match? Step on
Note:
See TracChangeset
for help on using the changeset viewer.
