- Timestamp:
- Aug 29, 2008, 10:12:00 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:
- c1fc22
- Parents:
- ab3a0e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
rab3a0e r6b8b57 652 652 atom *neues = NULL; 653 653 while (status) { 654 cout << "Currently parsing MD step " << repetition << "." << endl; 654 655 for (int i=0; i < config::MaxTypes; i++) { 655 656 sprintf(name,"Ion_Type%i",i+1); … … 1060 1061 }; 1061 1062 1063 /** Stores all elements in a MPQC input file. 1064 * Note that this format cannot be parsed again. 1065 * \param output open output *file stream to write to 1066 * \param *mol pointer to molecule containing all atoms of the molecule 1067 */ 1068 bool config::SaveMPQC(ofstream *output, molecule *mol) const 1069 { 1070 int ElementNo; 1071 int AtomNo; 1072 atom *Walker = NULL; 1073 element *runner; 1074 Vector center; 1075 1076 *output << "% Created by MoleCuilder" << endl; 1077 *output << "mpqc: (" << endl; 1078 *output << "\tsavestate = no" << endl; 1079 *output << "\tdo_gradient = yes" << endl; 1080 *output << "\tmole<CLHF>: (" << endl; 1081 *output << "\t\tmolecule<Molecule>: (" << endl; 1082 *output << "\t\t\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl; 1083 *output << "\t\t\t{ atoms geometry } = {" << endl; 1084 mol->DetermineCenter(center); 1085 // output of atoms 1086 ElementNo = 0; 1087 runner = mol->elemente->start; 1088 while (runner->next != mol->elemente->end) { // go through every element 1089 runner = runner->next; 1090 if (mol->ElementsInMolecule[runner->Z]) { // if this element got atoms 1091 ElementNo++; 1092 AtomNo = 0; 1093 Walker = mol->start; 1094 while (Walker->next != mol->end) { // go through every atom of this element 1095 Walker = Walker->next; 1096 if (Walker->type == runner) { // if this atom fits to element 1097 AtomNo++; 1098 *output << "\t\t\t\t" << Walker->type->symbol << " [ " << Walker->x.x[0]-center.x[0] << "\t" << Walker->x.x[1]-center.x[1] << "\t" << Walker->x.x[2]-center.x[2] << " ]" << endl; 1099 } 1100 } 1101 } 1102 } 1103 *output << "\t\t\t}" << endl; 1104 *output << "\t\t)" << endl; 1105 *output << "\t\tbasis<GaussianBasisSet>: (" << endl; 1106 *output << "\t\t\tname = \"STO-3G\"" << endl; 1107 *output << "\t\t\tmolecule = $:mpqc:mole:molecule" << endl; 1108 *output << "\t\t)" << endl; 1109 *output << "\t)" << endl; 1110 *output << ")" << endl; 1111 return true; 1112 }; 1113 1062 1114 /** Reads parameter from a parsed file. 1063 1115 * The file is either parsed for a certain keyword or if null is given for … … 1103 1155 Free((void **)&free_dummy, "config::ParseForParameter: *free_dummy"); 1104 1156 //Error(InitReading, name); 1105 fprintf(stderr,"Error:InitReading, critical %s not found\n", name);1157 //fprintf(stderr,"Error:InitReading, critical %s not found\n", name); 1106 1158 exit(255); 1107 1159 } else { … … 1114 1166 } 1115 1167 line++; 1116 } while ( ((dummy1[0] == '#') || (dummy1[0] == '\n')) && dummy != NULL); // skip commentary and empty lines1168 } while (dummy != NULL && dummy1 != NULL && ((dummy1[0] == '#') || (dummy1[0] == '\0'))); // skip commentary and empty lines 1117 1169 1118 1170 // C++ getline removes newline at end, thus re-add … … 1122 1174 dummy1[i+1] = '\0'; 1123 1175 } 1124 //fprintf(stderr,"line ends at %i, newline at %i\n", strlen(dummy1), strchr(dummy1,'\n')-free_dummy); 1176 //fprintf(stderr,"line %i ends at %i, newline at %i\n", line, strlen(dummy1), strchr(dummy1,'\n')-free_dummy); 1177 1125 1178 if (dummy1 == NULL) { 1126 1179 if (verbose) fprintf(stderr,"Error reading line %i\n",line); 1127 1180 } else { 1128 //fprintf(stderr," Reading nextline %i: %s\n", line, dummy1);1181 //fprintf(stderr,"Now parsing the line %i: %s\n", line, dummy1); 1129 1182 } 1130 1183 // Seek for possible end of keyword on line if given ... … … 1204 1257 if (dummy == NULL) 1205 1258 dummy = strchr(dummy1, ' '); // if not found seek for space 1206 while ((dummy != NULL) && ((*dummy == '\t') || (*dummy == ' '))) // skip some more tabs and spaces if necessary1207 dummy++;1208 /* while ((dummy != NULL) && ((*dummy == '\t') || (*dummy == ' '))) // skip some more tabs and spaces if necessary1209 dummy++;*/1210 1259 if (dummy == NULL) { // if still zero returned ... 1211 1260 dummy = strchr(dummy1, '\n'); // ... at line end then
Note:
See TracChangeset
for help on using the changeset viewer.