Changeset 7f3b9d for src/config.cpp
- Timestamp:
- May 23, 2008, 9:17:19 AM (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:
- 040f93
- Parents:
- 6097ea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r6097ea r7f3b9d 282 282 case 'j': // BoxLength 283 283 cout << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl; 284 for (int i= 0;i<6;i++) {284 for (int i=6;i--;) { 285 285 cout << Verbose(0) << "Cell size" << i << ": "; 286 286 cin >> mol->cell_size[i]; … … 408 408 409 409 /** Retrieves the path in the given config file name. 410 * \param *filename config file string410 * \param filename config file string 411 411 */ 412 void config::RetrieveConfigPathAndName( char *filename)412 void config::RetrieveConfigPathAndName(string filename) 413 413 { 414 414 char *ptr = NULL; 415 char *buffer = new char[MAXSTRINGSIZE]; 416 strncpy(buffer, filename.c_str(), MAXSTRINGSIZE); 415 417 int last = -1; 416 for(int i=0;i<MAXSTRINGSIZE;i++) { 417 if (filename[i] == '/') 418 last = i; 419 if (filename[i] == '\0') 418 for(last=MAXSTRINGSIZE;last--;) { 419 if (buffer[last] == '/') 420 420 break; 421 421 } 422 if (last == -1) { // no path in front, set to local directory.422 if (last == 0) { // no path in front, set to local directory. 423 423 strcpy(configpath, "./"); 424 ptr = filename;424 ptr = buffer; 425 425 } else { 426 strncpy(configpath, filename, last+1);427 ptr = & filename[last+1];426 strncpy(configpath, buffer, last+1); 427 ptr = &buffer[last+1]; 428 428 if (last < 254) 429 429 configpath[last+1]='\0'; … … 431 431 strcpy(configname, ptr); 432 432 cout << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl; 433 delete[](buffer); 433 434 }; 434 435 … … 824 825 825 826 826 for (i=0;i<128;i++) elementhash[i] = NULL; 827 for (i=MAX_ELEMENTS;i--;) 828 elementhash[i] = NULL; 827 829 cout << Verbose(0) << "Parsing Ions ..." << endl; 828 830 No=0;
Note:
See TracChangeset
for help on using the changeset viewer.