Changeset 35b698 for src/config.cpp
- Timestamp:
- Jun 23, 2010, 3:52:50 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, Candidate_v1.7.0, 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:
- d0fbec
- Parents:
- dc0d21
- git-author:
- Frederik Heber <heber@…> (06/23/10 15:20:35)
- git-committer:
- Frederik Heber <heber@…> (06/23/10 15:52:50)
- File:
-
- 1 edited
-
src/config.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
rdc0d21 r35b698 31 31 /** Constructor for config file class. 32 32 */ 33 config::config() : BG(NULL), Thermostats(0), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),33 config::config() : BG(NULL), Thermostats(0), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), 34 34 configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), mainname(NULL), defaultpath(NULL), pseudopotpath(NULL), 35 35 DoOutVis(0), DoOutMes(1), DoOutNICS(0), DoOutOrbitals(0), DoOutCurrent(0), DoFullCurrent(0), DoPerturbation(0), DoWannier(0), CommonWannier(0), SawtoothStart(0.01), … … 42 42 pseudopotpath = new char[MAXSTRINGSIZE]; 43 43 databasepath = new char[MAXSTRINGSIZE]; 44 configpath = new char[MAXSTRINGSIZE];45 44 configname = new char[MAXSTRINGSIZE]; 46 45 Thermostats = new ThermoStatContainer(); … … 48 47 strcpy(defaultpath,"not specified"); 49 48 strcpy(pseudopotpath,"not specified"); 50 configpath[0]='\0';51 49 configname[0]='\0'; 52 50 basis = "3-21G"; … … 61 59 delete[](pseudopotpath); 62 60 delete[](databasepath); 63 delete[](configpath);64 61 delete[](configname); 65 62 if (Thermostats != NULL) … … 383 380 }; 384 381 385 /** Retrieves the path in the given config file name.386 * \param filename config file string387 */388 void config::RetrieveConfigPathAndName(const string filename)389 {390 char *ptr = NULL;391 char *buffer = new char[MAXSTRINGSIZE];392 strncpy(buffer, filename.c_str(), MAXSTRINGSIZE);393 int last = -1;394 for(last=MAXSTRINGSIZE;last--;) {395 if (buffer[last] == '/')396 break;397 }398 if (last == -1) { // no path in front, set to local directory.399 strcpy(configpath, "./");400 ptr = buffer;401 } else {402 strncpy(configpath, buffer, last+1);403 ptr = &buffer[last+1];404 if (last < 254)405 configpath[last+1]='\0';406 }407 strcpy(configname, ptr);408 DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl);409 delete[](buffer);410 };411 412 382 /** Loads a molecule from a ConfigFileBuffer. 413 383 * \param *mol molecule to load … … 603 573 file->close(); 604 574 delete(file); 605 RetrieveConfigPathAndName(filename);606 575 607 576 // ParseParameterFile … … 840 809 return; 841 810 } 842 RetrieveConfigPathAndName(filename);843 811 // ParseParameters 844 812 … … 1525 1493 molecule *mol = NULL; 1526 1494 1527 if (!strcmp(configpath, GetDefaultPath())) {1528 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;1529 }1530 1531 1532 1495 // first save as PDB data 1533 1496 if (ConfigFileName != NULL) … … 1566 1529 mol->doCountAtoms(); 1567 1530 mol->CountElements(); 1568 mol->CalculateOrbitals(*this);1531 //mol->CalculateOrbitals(*this); 1569 1532 delete[](src); 1570 1533 } else { … … 1572 1535 mol = *(molecules->ListOfMolecules.begin()); 1573 1536 mol->doCountAtoms(); 1574 mol->CalculateOrbitals(*this);1537 //mol->CalculateOrbitals(*this); 1575 1538 } else { 1576 1539 DoeLog(1) && (eLog() << Verbose(1) << "There are no molecules to save!" << endl); … … 1634 1597 else 1635 1598 Log() << Verbose(0) << "\t... failed." << endl; 1636 1637 if (!strcmp(configpath, GetDefaultPath())) {1638 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;1639 }1640 1599 1641 1600 // don't destroy molecule as it contains all our atoms
Note:
See TracChangeset
for help on using the changeset viewer.
