Changeset c750cc for src/molecules.cpp
- Timestamp:
- Apr 29, 2008, 12:19:51 PM (17 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:
- 260934
- Parents:
- 451148
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecules.cpp
r451148 rc750cc 1892 1892 ifstream KeySetFile; 1893 1893 stringstream line; 1894 char *filename = (char *) Malloc(sizeof(char)* 255, "molecule::ParseKeySetFile - filename");1894 char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - filename"); 1895 1895 1896 1896 if (FragmentList != NULL) { // check list pointer … … 1905 1905 // each line represents a new fragment 1906 1906 int NumberOfFragments = 0; 1907 char *buffer = (char *) Malloc(sizeof(char)* 255, "molecule::ParseKeySetFile - *buffer");1907 char *buffer = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - *buffer"); 1908 1908 // 1. scan through file to know number of fragments 1909 1909 while (!KeySetFile.eof()) { 1910 KeySetFile.getline(buffer, 255);1910 KeySetFile.getline(buffer, MAXSTRINGSIZE); 1911 1911 if (strlen(buffer) > 0) // there is at least on possible number on the parsed line 1912 1912 NumberOfFragments++; … … 1919 1919 NumberOfFragments = 0; 1920 1920 while ((!KeySetFile.eof()) && (FragmentList->NumberOfMolecules > NumberOfFragments)) { 1921 KeySetFile.getline(buffer, 255);1921 KeySetFile.getline(buffer, MAXSTRINGSIZE); 1922 1922 KeySet CurrentSet; 1923 1923 if ((strlen(buffer) > 0) && (ScanBufferIntoKeySet(out, buffer, CurrentSet))) // if at least one valid atom was added, write config … … 1946 1946 ofstream AdjacencyFile; 1947 1947 atom *Walker = NULL; 1948 char *filename = (char *) Malloc(sizeof(char)* 255, "molecule::StoreAdjacencyToFile - filename");1948 char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::StoreAdjacencyToFile - filename"); 1949 1949 bool status = true; 1950 1950 … … 1982 1982 bool molecule::CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms, int bondorder) 1983 1983 { 1984 char *filename = (char *) Malloc(sizeof(char)* 255, "molecule::CheckAdjacencyFileAgainstMolecule - filename");1984 char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::CheckAdjacencyFileAgainstMolecule - filename"); 1985 1985 ifstream File; 1986 1986 bool status = true; … … 1996 1996 1997 1997 // determine order from file 1998 File.getline(filename, 255);1998 File.getline(filename, MAXSTRINGSIZE); 1999 1999 if (bondorder != atoi(&filename[5])) { 2000 2000 *out << "Bond order desired is " << bondorder << " and does not match one in file " << filename[6] << "." << endl; … … 2003 2003 // Parse the file line by line and count the bonds 2004 2004 while (!File.eof()) { 2005 File.getline(filename, 255);2005 File.getline(filename, MAXSTRINGSIZE); 2006 2006 stringstream line; 2007 2007 line.str(filename);
Note:
See TracChangeset
for help on using the changeset viewer.