Changeset 35b698 for src/config.cpp


Ignore:
Timestamp:
Jun 23, 2010, 3:52:50 PM (16 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

BIG CHANGE: config::load and config::save in ParseCommandLineOptions() and main() replaced with FormatParser replacements.

Fragmentation:

  • FIX: MoleculeFillWithMoleculeAction: filler atoms have to be removed before the system can be stored to file.
  • FIX: PcpParser::load() - has to put the molecule also into World's MoleculeListClass (otherwise the name cannot be set right after loading)
  • new Libparser.a
  • all sources from PARSER subdir are compiled into libparser such that only ParserUnitTest is recompiled.

Testfixes:

  • testsuite-fragmentation - changes to due to different -f calling syntax.
  • most of the xyz files had to be replaced due to a single whitespace at the end of each entry: Domain/6, Simple_configuration/2, Simple_configuration/3, Simple_configuration/4, Simple_configuration/5, Simple_configuration/8
  • in many cases were the number orbitals (and thus MaxMinStopStep) wrong: Filling/1, Simple_configuration/4, Simple_configuration/5

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    rdc0d21 r35b698  
    3131/** Constructor for config file class.
    3232 */
    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),
     33config::config() : BG(NULL), Thermostats(0), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1),
    3434    configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), mainname(NULL), defaultpath(NULL), pseudopotpath(NULL),
    3535    DoOutVis(0), DoOutMes(1), DoOutNICS(0), DoOutOrbitals(0), DoOutCurrent(0), DoFullCurrent(0), DoPerturbation(0), DoWannier(0), CommonWannier(0), SawtoothStart(0.01),
     
    4242  pseudopotpath = new char[MAXSTRINGSIZE];
    4343  databasepath = new char[MAXSTRINGSIZE];
    44   configpath = new char[MAXSTRINGSIZE];
    4544  configname = new char[MAXSTRINGSIZE];
    4645  Thermostats = new ThermoStatContainer();
     
    4847  strcpy(defaultpath,"not specified");
    4948  strcpy(pseudopotpath,"not specified");
    50   configpath[0]='\0';
    5149  configname[0]='\0';
    5250  basis = "3-21G";
     
    6159  delete[](pseudopotpath);
    6260  delete[](databasepath);
    63   delete[](configpath);
    6461  delete[](configname);
    6562  if (Thermostats != NULL)
     
    383380};
    384381
    385 /** Retrieves the path in the given config file name.
    386  * \param filename config file string
    387  */
    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 
    412382/** Loads a molecule from a ConfigFileBuffer.
    413383 * \param *mol molecule to load
     
    603573  file->close();
    604574  delete(file);
    605   RetrieveConfigPathAndName(filename);
    606575
    607576  // ParseParameterFile
     
    840809    return;
    841810  }
    842   RetrieveConfigPathAndName(filename);
    843811  // ParseParameters
    844812
     
    15251493  molecule *mol = NULL;
    15261494
    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 
    15321495  // first save as PDB data
    15331496  if (ConfigFileName != NULL)
     
    15661529    mol->doCountAtoms();
    15671530    mol->CountElements();
    1568     mol->CalculateOrbitals(*this);
     1531    //mol->CalculateOrbitals(*this);
    15691532    delete[](src);
    15701533  } else {
     
    15721535      mol = *(molecules->ListOfMolecules.begin());
    15731536      mol->doCountAtoms();
    1574       mol->CalculateOrbitals(*this);
     1537      //mol->CalculateOrbitals(*this);
    15751538    } else {
    15761539      DoeLog(1) && (eLog() << Verbose(1) << "There are no molecules to save!" << endl);
     
    16341597  else
    16351598    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   }
    16401599
    16411600  // don't destroy molecule as it contains all our atoms
Note: See TracChangeset for help on using the changeset viewer.