- Timestamp:
- Apr 8, 2009, 11:35:42 AM (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, 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:
- 09af1b
- Parents:
- d67150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
rd67150 r63f06e 282 282 case 'a': 283 283 cout << Verbose(0) << "Centering atoms in config file on origin." << endl; 284 mol->CenterOrigin((ofstream *)&cout , &x);284 mol->CenterOrigin((ofstream *)&cout); 285 285 break; 286 286 case 'b': 287 287 cout << Verbose(0) << "Centering atoms in config file on center of gravity." << endl; 288 mol->Center Gravity((ofstream *)&cout, &x);288 mol->CenterPeriodic((ofstream *)&cout); 289 289 break; 290 290 case 'c': … … 295 295 } 296 296 mol->CenterEdge((ofstream *)&cout, &x); // make every coordinate positive 297 mol-> Translate(&y); // translate by boundary297 mol->Center.AddVector(&y); // translate by boundary 298 298 helper.CopyVector(&y); 299 299 helper.Scale(2.); … … 646 646 cout << Verbose(0) << "all else - go back" << endl; 647 647 cout << Verbose(0) << "===============================================" << endl; 648 if (molecules->NumberOfActiveMolecules() > 0)648 if (molecules->NumberOfActiveMolecules() > 1) 649 649 cout << Verbose(0) << "WARNING: There is more than one molecule active! Atoms will be added to each." << endl; 650 650 cout << Verbose(0) << "INPUT: "; … … 657 657 658 658 case 'a': // add atom 659 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 659 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 660 if ((*ListRunner)->ActiveFlag) { 660 661 mol = *ListRunner; 661 662 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 665 666 666 667 case 'b': // scale a bond 667 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 668 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 669 if ((*ListRunner)->ActiveFlag) { 668 670 mol = *ListRunner; 669 671 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 687 689 688 690 case 'c': // unit scaling of the metric 689 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 691 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 692 if ((*ListRunner)->ActiveFlag) { 690 693 mol = *ListRunner; 691 694 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 703 706 704 707 case 'l': // measure distances or angles 705 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 708 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 709 if ((*ListRunner)->ActiveFlag) { 706 710 mol = *ListRunner; 707 711 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 711 715 712 716 case 'r': // remove atom 713 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 717 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 718 if ((*ListRunner)->ActiveFlag) { 714 719 mol = *ListRunner; 715 720 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 719 724 720 725 case 'u': // change an atom's element 721 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 726 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 727 if ((*ListRunner)->ActiveFlag) { 722 728 int Z; 723 729 mol = *ListRunner; … … 766 772 cout << Verbose(0) << "all else - go back" << endl; 767 773 cout << Verbose(0) << "===============================================" << endl; 768 if (molecules->NumberOfActiveMolecules() > 0)774 if (molecules->NumberOfActiveMolecules() > 1) 769 775 cout << Verbose(0) << "WARNING: There is more than one molecule active! Atoms will be added to each." << endl; 770 776 cout << Verbose(0) << "INPUT: "; … … 777 783 778 784 case 'd': // duplicate the periodic cell along a given axis, given times 779 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 785 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 786 if ((*ListRunner)->ActiveFlag) { 780 787 mol = *ListRunner; 781 788 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 835 842 836 843 case 'g': // center the atoms 837 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 844 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 845 if ((*ListRunner)->ActiveFlag) { 838 846 mol = *ListRunner; 839 847 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 843 851 844 852 case 'i': // align all atoms 845 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 853 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 854 if ((*ListRunner)->ActiveFlag) { 846 855 mol = *ListRunner; 847 856 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 851 860 852 861 case 'm': // mirror atoms along a given axis 853 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 862 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 863 if ((*ListRunner)->ActiveFlag) { 854 864 mol = *ListRunner; 855 865 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; … … 859 869 860 870 case 'o': // create the connection matrix 861 { 871 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 872 if ((*ListRunner)->ActiveFlag) { 862 873 double bonddistance; 863 874 clock_t start,end; … … 873 884 874 885 case 't': // translate all atoms 875 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 886 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 887 if ((*ListRunner)->ActiveFlag) { 876 888 mol = *ListRunner; 877 889 cout << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl; 878 890 cout << Verbose(0) << "Enter translation vector." << endl; 879 891 x.AskPosition(mol->cell_size,0); 880 mol-> Translate((const Vector *)&x);892 mol->Center.AddVector((const Vector *)&x); 881 893 } 882 894 break; … … 901 913 char choice; // menu choice char 902 914 bool valid; 903 Vector Center;915 Vector center; 904 916 int nr, count; 905 917 molecule *mol = NULL; 906 918 char *molname = NULL; 907 919 int length; 908 char filename[MAXSTRINGSIZE]; 909 910 cout << Verbose(0) << "==========Edit MOLECULES=====================" << endl; 920 921 cout << Verbose(0) << "==========EDIT MOLECULES=====================" << endl; 911 922 cout << Verbose(0) << "c - create new molecule" << endl; 912 923 cout << Verbose(0) << "l - load molecule from xyz file" << endl; 913 924 cout << Verbose(0) << "n - change molecule's name" << endl; 914 925 cout << Verbose(0) << "N - give molecules filename" << endl; 915 cout << Verbose(0) << "p - parse xyz file into molecule" << endl;926 cout << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl; 916 927 cout << Verbose(0) << "r - remove a molecule" << endl; 917 928 cout << Verbose(0) << "all else - go back" << endl; … … 929 940 break; 930 941 931 case 'l': // laod from XYZ file 932 cout << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 933 mol = new molecule(periode); 934 do { 935 cout << Verbose(0) << "Enter file name: "; 942 case 'l': // load from XYZ file 943 { 944 char filename[MAXSTRINGSIZE]; 945 cout << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 946 mol = new molecule(periode); 947 do { 948 cout << Verbose(0) << "Enter file name: "; 949 cin >> filename; 950 } while (!mol->AddXYZFile(filename)); 951 mol->SetNameFromFilename(filename); 952 // center at set box dimensions 953 mol->CenterEdge((ofstream *)&cout, ¢er); 954 mol->cell_size[0] = center.x[0]; 955 mol->cell_size[1] = 0; 956 mol->cell_size[2] = center.x[1]; 957 mol->cell_size[3] = 0; 958 mol->cell_size[4] = 0; 959 mol->cell_size[5] = center.x[2]; 960 molecules->insert(mol); 961 } 962 break; 963 964 case 'n': 965 { 966 char filename[MAXSTRINGSIZE]; 967 do { 968 cout << Verbose(0) << "Enter index of molecule: "; 969 cin >> nr; 970 mol = molecules->ReturnIndex(nr); 971 } while (mol == NULL); 972 cout << Verbose(0) << "Enter name: "; 936 973 cin >> filename; 937 } while (!mol->AddXYZFile(filename)); 938 mol->SetNameFromFilename(filename); 939 // center at set box dimensions 940 mol->CenterEdge((ofstream *)&cout, &Center); 941 mol->cell_size[0] = Center.x[0]; 942 mol->cell_size[1] = 0; 943 mol->cell_size[2] = Center.x[1]; 944 mol->cell_size[3] = 0; 945 mol->cell_size[4] = 0; 946 mol->cell_size[5] = Center.x[2]; 947 molecules->insert(mol); 948 break; 949 950 case 'n': 951 do { 952 cout << Verbose(0) << "Enter index of molecule: "; 953 cin >> nr; 954 mol = molecules->ReturnIndex(nr); 955 } while (mol != NULL); 956 cout << Verbose(0) << "Enter name: "; 957 cin >> filename; 958 strcpy(mol->name, filename); 974 strcpy(mol->name, filename); 975 } 959 976 break; 960 977 961 978 case 'N': 962 do { 963 cout << Verbose(0) << "Enter index of molecule: "; 964 cin >> nr; 965 mol = molecules->ReturnIndex(nr); 966 } while (mol != NULL); 967 cout << Verbose(0) << "Enter name: "; 968 cin >> filename; 969 mol->SetNameFromFilename(filename); 979 { 980 char filename[MAXSTRINGSIZE]; 981 do { 982 cout << Verbose(0) << "Enter index of molecule: "; 983 cin >> nr; 984 mol = molecules->ReturnIndex(nr); 985 } while (mol == NULL); 986 cout << Verbose(0) << "Enter name: "; 987 cin >> filename; 988 mol->SetNameFromFilename(filename); 989 } 970 990 break; 971 991 972 992 case 'p': // parse XYZ file 973 mol = NULL; 974 do { 975 cout << Verbose(0) << "Enter index of molecule: "; 976 cin >> nr; 977 mol = molecules->ReturnIndex(nr); 978 } while (mol == NULL); 979 cout << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 980 do { 981 cout << Verbose(0) << "Enter file name: "; 982 cin >> filename; 983 } while (!mol->AddXYZFile(filename)); 984 mol->SetNameFromFilename(filename); 993 { 994 char filename[MAXSTRINGSIZE]; 995 mol = NULL; 996 do { 997 cout << Verbose(0) << "Enter index of molecule: "; 998 cin >> nr; 999 mol = molecules->ReturnIndex(nr); 1000 } while (mol == NULL); 1001 cout << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 1002 do { 1003 cout << Verbose(0) << "Enter file name: "; 1004 cin >> filename; 1005 } while (!mol->AddXYZFile(filename)); 1006 mol->SetNameFromFilename(filename); 1007 } 985 1008 break; 986 1009 … … 989 1012 cin >> nr; 990 1013 count = 1; 991 MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); 992 for(; ((ListRunner != molecules->ListOfMolecules.end()) && (count < nr)); ListRunner++); 993 mol = *ListRunner; 994 if (count == nr) { 995 molecules->ListOfMolecules.erase(ListRunner); 996 delete(mol); 997 } 1014 for( MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1015 if (nr == (*ListRunner)->IndexNr) { 1016 mol = *ListRunner; 1017 molecules->ListOfMolecules.erase(ListRunner); 1018 delete(mol); 1019 } 998 1020 break; 999 1021 } … … 1011 1033 1012 1034 cout << Verbose(0) << "===========MERGE MOLECULES=====================" << endl; 1035 cout << Verbose(0) << "a - simple add of one molecule to another" << endl; 1013 1036 cout << Verbose(0) << "e - embedding merge of two molecules" << endl; 1014 1037 cout << Verbose(0) << "m - multi-merge of all molecules" << endl; … … 1025 1048 break; 1026 1049 1050 case 'a': 1051 { 1052 int src, dest; 1053 molecule *srcmol = NULL, *destmol = NULL; 1054 { 1055 do { 1056 cout << Verbose(0) << "Enter index of destination molecule: "; 1057 cin >> dest; 1058 destmol = molecules->ReturnIndex(dest); 1059 } while ((destmol == NULL) && (dest != -1)); 1060 do { 1061 cout << Verbose(0) << "Enter index of source molecule to add from: "; 1062 cin >> src; 1063 srcmol = molecules->ReturnIndex(src); 1064 } while ((srcmol == NULL) && (src != -1)); 1065 if ((src != -1) && (dest != -1)) 1066 molecules->SimpleAdd(srcmol, destmol); 1067 } 1068 } 1069 break; 1070 1027 1071 case 'e': 1072 cout << Verbose(0) << "Not implemented yet." << endl; 1028 1073 break; 1029 1074 1030 1075 case 'm': 1076 { 1077 int nr; 1078 molecule *mol = NULL; 1079 do { 1080 cout << Verbose(0) << "Enter index of molecule to merge into: "; 1081 cin >> nr; 1082 mol = molecules->ReturnIndex(nr); 1083 } while ((mol == NULL) && (nr != -1)); 1084 if (nr != -1) { 1085 int N = molecules->ListOfMolecules.size()-1; 1086 int *src = new int(N); 1087 for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1088 if ((*ListRunner)->IndexNr != nr) 1089 src[N++] = (*ListRunner)->IndexNr; 1090 molecules->SimpleMultiMerge(mol, src, N); 1091 delete[](src); 1092 } 1093 } 1031 1094 break; 1032 1095 1033 1096 case 's': 1097 cout << Verbose(0) << "Not implemented yet." << endl; 1034 1098 break; 1035 1099 1036 1100 case 't': 1101 { 1102 int src, dest; 1103 molecule *srcmol = NULL, *destmol = NULL; 1104 { 1105 do { 1106 cout << Verbose(0) << "Enter index of destination molecule: "; 1107 cin >> dest; 1108 destmol = molecules->ReturnIndex(dest); 1109 } while ((destmol == NULL) && (dest != -1)); 1110 do { 1111 cout << Verbose(0) << "Enter index of source molecule to merge into: "; 1112 cin >> src; 1113 srcmol = molecules->ReturnIndex(src); 1114 } while ((srcmol == NULL) && (src != -1)); 1115 if ((src != -1) && (dest != -1)) 1116 molecules->SimpleMerge(srcmol, destmol); 1117 } 1118 } 1037 1119 break; 1038 1120 } … … 1134 1216 molecule *mol = new molecule(periode); 1135 1217 1136 // merge all molecules in MoleculeListClass into this molecule1218 // translate each to its center and merge all molecules in MoleculeListClass into this molecule 1137 1219 int N = molecules->ListOfMolecules.size(); 1138 1220 int *src = new int(N); 1139 1221 N=0; 1140 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1222 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1141 1223 src[N++] = (*ListRunner)->IndexNr; 1224 (*ListRunner)->Translate(&(*ListRunner)->Center); 1225 } 1142 1226 molecules->SimpleMultiAdd(mol, src, N); 1227 delete[](src); 1228 // ... and translate back 1229 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1230 (*ListRunner)->Center.Scale(-1.); 1231 (*ListRunner)->Translate(&(*ListRunner)->Center); 1232 (*ListRunner)->Center.Scale(-1.); 1233 } 1143 1234 1144 1235 cout << Verbose(0) << "Storing configuration ... " << endl; … … 1146 1237 mol->CalculateOrbitals(*configuration); 1147 1238 configuration->InitMaxMinStopStep = configuration->MaxMinStopStep = configuration->MaxPsiDouble; 1148 strcpy(filename, ConfigFileName);1149 1239 if (ConfigFileName != NULL) { // test the file name 1150 output.open(ConfigFileName, ios::trunc); 1240 strcpy(filename, ConfigFileName); 1241 output.open(filename, ios::trunc); 1151 1242 } else if (strlen(configuration->configname) != 0) { 1152 1243 strcpy(filename, configuration->configname); … … 1217 1308 * \return exit code (0 - successful, all else - something's wrong) 1218 1309 */ 1219 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, config& configuration, char * &ConfigFileName, char *&PathToDatabases)1310 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, config& configuration, char *ConfigFileName, char *&PathToDatabases) 1220 1311 { 1221 1312 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1236 1327 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place 1237 1328 molecule *mol = new molecule(periode); 1329 mol->ActiveFlag = true; 1238 1330 molecules->insert(mol); 1239 1331 … … 1330 1422 } else { 1331 1423 cout << "Empty configuration file." << endl; 1332 ConfigFileName = argv[1];1424 strcpy(ConfigFileName, argv[1]); 1333 1425 config_present = empty; 1334 1426 output.close(); … … 1336 1428 } else { 1337 1429 test.close(); 1338 ConfigFileName = argv[1];1430 strcpy(ConfigFileName, argv[1]); 1339 1431 cout << Verbose(1) << "Specified config file found, parsing ... "; 1340 1432 switch (configuration.TestSyntax(ConfigFileName, periode, mol)) { … … 1618 1710 ExitFlag = 1; 1619 1711 SaveFlag = true; 1620 cout << Verbose(1) << "Centering atoms in origin." << endl;1621 mol->Center Origin((ofstream *)&cout, &x);1712 cout << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl; 1713 mol->CenterEdge((ofstream *)&cout, &x); 1622 1714 mol->SetBoxDimension(&x); 1623 1715 break; … … 1807 1899 ofstream output; 1808 1900 string line; 1809 char *ConfigFileName = NULL;1901 char ConfigFileName[MAXSTRINGSIZE]; 1810 1902 char *ElementsFileName = NULL; 1811 1903 int Z; … … 1813 1905 1814 1906 // =========================== PARSE COMMAND LINE OPTIONS ==================================== 1907 ConfigFileName[0] = '\0'; 1815 1908 j = ParseCommandLineOptions(argc, argv, molecules, periode, configuration, ConfigFileName, ElementsFileName); 1816 1909 if (j == 1) return 0; // just for -v and -h options … … 1829 1922 molecules->insert(mol); 1830 1923 } 1924 if (strlen(ConfigFileName) == 0) 1925 strcpy(ConfigFileName, DEFAULTCONFIG); 1926 1831 1927 1832 1928 // =========================== START INTERACTIVE SESSION ==================================== … … 1840 1936 cout << Verbose(0) << "============Menu===============================" << endl; 1841 1937 cout << Verbose(0) << "a - set molecule (in)active" << endl; 1842 cout << Verbose(0) << "e - edit new molecules" << endl;1938 cout << Verbose(0) << "e - edit molecules (load, parse, save)" << endl; 1843 1939 cout << Verbose(0) << "g - globally manipulate atoms in molecule" << endl; 1844 1940 cout << Verbose(0) << "M - Merge molecules" << endl; … … 1859 1955 cout << "Enter index of molecule: "; 1860 1956 cin >> j; 1861 count = 1; 1862 MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); 1863 for(; ((ListRunner != molecules->ListOfMolecules.end()) && (count < j)); ListRunner++); 1864 if (count == j) 1865 (*ListRunner)->ActiveFlag = !(*ListRunner)->ActiveFlag; 1957 for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1958 if ((*ListRunner)->IndexNr == j) 1959 (*ListRunner)->ActiveFlag = !(*ListRunner)->ActiveFlag; 1866 1960 } 1867 1961 break;
Note:
See TracChangeset
for help on using the changeset viewer.