Changeset 9a5bcd for src/builder.cpp
- Timestamp:
- Oct 17, 2008, 1:20:42 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, 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:
- 4ee3df
- Parents:
- f00693
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
rf00693 r9a5bcd 699 699 mol->CalculateOrbitals(*configuration); 700 700 configuration->InitMaxMinStopStep = configuration->MaxMinStopStep = configuration->MaxPsiDouble; 701 if (ConfigFileName != NULL) { 701 strcpy(filename, ConfigFileName); 702 if (ConfigFileName != NULL) { // test the file name 702 703 output.open(ConfigFileName, ios::trunc); 703 704 } else if (strlen(configuration->configname) != 0) { 705 strcpy(filename, configuration->configname); 704 706 output.open(configuration->configname, ios::trunc); 705 707 } else { 708 strcpy(filename, DEFAULTCONFIG); 706 709 output.open(DEFAULTCONFIG, ios::trunc); 707 710 } 711 output.close(); 712 output.clear(); 708 713 cout << Verbose(0) << "Saving of config file "; 709 if (configuration->Save( &output, periode, mol))714 if (configuration->Save(filename, periode, mol)) 710 715 cout << "successful." << endl; 711 716 else 712 717 cout << "failed." << endl; 713 output.close();714 output.clear();715 718 716 719 // and save to xyz file … … 741 744 742 745 // and save as MPQC configuration 743 if (ConfigFileName != NULL) {746 if (ConfigFileName != NULL) 744 747 strcpy(filename, ConfigFileName); 745 strcat(filename, ".in"); 746 output.open(filename, ios::trunc); 747 } 748 if (output == NULL) { 748 if (output == NULL) 749 749 strcpy(filename,"main_pcp_linux"); 750 strcat(filename, ".in");751 output.open(filename, ios::trunc);752 }753 750 cout << Verbose(0) << "Saving as mpqc input "; 754 if (configuration->SaveMPQC( &output, mol))751 if (configuration->SaveMPQC(filename, mol)) 755 752 cout << "done." << endl; 756 753 else 757 754 cout << "failed." << endl; 758 output.close();759 output.clear();760 755 761 756 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { … … 919 914 ExitFlag = 1; 920 915 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 916 ExitFlag = 255; 921 917 cerr << "Not enough arguments for parsing: -p <xyz file>" << endl; 922 918 } else { … … 934 930 ExitFlag = 1; 935 931 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1]))) { 932 ExitFlag = 255; 936 933 cerr << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl; 937 934 } else { … … 995 992 ExitFlag = 1; 996 993 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) { 994 ExitFlag = 255; 997 995 cerr << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl; 998 996 } else { … … 1007 1005 ExitFlag = 1; 1008 1006 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1007 ExitFlag = 255; 1009 1008 cerr << "Not enough or invalid arguments given for storing tempature: -T <temperature file>" << endl; 1010 1009 } else { … … 1023 1022 ExitFlag = 1; 1024 1023 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1024 ExitFlag = 255; 1025 1025 cerr << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl; 1026 1026 } else { … … 1037 1037 ExitFlag = 1; 1038 1038 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1039 ExitFlag = 255; 1039 1040 cerr << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl; 1040 1041 } else { … … 1051 1052 ExitFlag = 1; 1052 1053 if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) ) { 1054 ExitFlag = 255; 1053 1055 cerr << "Not enough or invalid arguments given for scaling: -s <factor/[factor_x]> [factor_y] [factor_z]" << endl; 1054 1056 } else { … … 1077 1079 ExitFlag = 1; 1078 1080 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1081 ExitFlag = 255; 1079 1082 cerr << "Not enough or invalid arguments given for centering in box: -b <length_x> <length_y> <length_z>" << endl; 1080 1083 } else { … … 1097 1100 ExitFlag = 1; 1098 1101 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1102 ExitFlag = 255; 1099 1103 cerr << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl; 1100 1104 } else { … … 1132 1136 ExitFlag = 1; 1133 1137 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) { 1138 ExitFlag = 255; 1134 1139 cerr << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl; 1135 1140 } else { … … 1170 1175 ExitFlag = 1; 1171 1176 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) ) { 1177 ExitFlag = 255; 1172 1178 cerr << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl; 1173 1179 volume = -1; // for case 'u': don't print error again … … 1180 1186 if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) ) { 1181 1187 if (volume != -1) 1188 ExitFlag = 255; 1182 1189 cerr << "Not enough arguments given for suspension: -u <density>" << endl; 1183 1190 } else { … … 1202 1209 ExitFlag = 1; 1203 1210 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1211 ExitFlag = 255; 1204 1212 cerr << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl; 1205 1213 } else {
Note:
See TracChangeset
for help on using the changeset viewer.