Changeset 41a467 for src/config.hpp


Ignore:
Timestamp:
Nov 3, 2011, 7:44:01 PM (14 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, 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:
ab26c3
Parents:
47d041
git-author:
Frederik Heber <heber@…> (10/27/11 15:08:36)
git-committer:
Frederik Heber <heber@…> (11/03/11 19:44:01)
Message:

LARGE: config class is now just a tiny container.

  • this was loooooobg overdue. Config.cpp contained remnants from parsing pcp files and much else. Also fragmentation depended on it. Since refactoring of MoleculeListClass and the fragmentation, we don't need it anymore.
  • helper functions ParseForParameters(), LoadMolecule() extracted into new module PcpParser_helper.
  • config class now just contains 4 variables that are generally required (especially IsAngstroem) and they should probably remain with the world.
  • removed some places where config.hpp was no unnecessarily included.
  • Moved ConfigFileBuffer.* over to subfolder src/Parser/ where it rather belongs (associated with PcpParser).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.hpp

    r47d041 r41a467  
    99#define CONFIG_HPP_
    1010
    11 using namespace std;
    12 
    13 /*********************************************** includes ***********************************/
    14 
    1511// include config.h
    1612#ifdef HAVE_CONFIG_H
     
    1814#endif
    1915
    20 #include <string>
    21 
    22 /****************************************** forward declarations *****************************/
    23 
    24 class ConfigFileBuffer;
    25 class molecule;
    26 class MoleculeListClass;
    27 class periodentafel;
    28 
    29 /********************************************** declarations *******************************/
    30 
    3116/** The config file.
    32  * The class contains all parameters that control a dft run also functions to load and save.
     17 * The class contains some general parameters.
    3318 */
    3419class config {
    3520  public:
     21    config();
     22    ~config();
    3623
    37     int PsiType;
    38     int MaxPsiDouble;
    39     int PsiMaxNoUp;
    40     int PsiMaxNoDown;
    41     int MaxMinStopStep;
    42     int InitMaxMinStopStep;
    43     int ProcPEGamma;
    44     int ProcPEPsi;
    45     char *configname;
     24    char *databasepath;
     25    char *defaultpath;
    4626    bool FastParsing;
     27    int IsAngstroem;
    4728    double Deltat;
    4829
    49     char *databasepath;
    50 
    51     int DoConstrainedMD;
    52     int MaxOuterStep;
    53 
    54   private:
    55     char *mainname;
    56     char *defaultpath;
    57     char *pseudopotpath;
    58 
    59     int DoOutVis;
    60     int DoOutMes;
    61     int DoOutNICS;
    62     int DoOutOrbitals;
    63     int DoOutCurrent;
    64     int DoFullCurrent;
    65     int DoPerturbation;
    66     int DoWannier;
    67     int CommonWannier;
    68     double SawtoothStart;
    69     int VectorPlane;
    70     double VectorCut;
    71     int UseAddGramSch;
    72     int Seed;
    73 
    74     int OutVisStep;
    75     int OutSrcStep;
    76     int MaxPsiStep;
    77     double EpsWannier;
    78 
    79     int MaxMinStep;
    80     double RelEpsTotalEnergy;
    81     double RelEpsKineticEnergy;
    82     int MaxMinGapStopStep;
    83     int MaxInitMinStep;
    84     double InitRelEpsTotalEnergy;
    85     double InitRelEpsKineticEnergy;
    86     int InitMaxMinGapStopStep;
    87 
    88     //double BoxLength[NDIM*NDIM];
    89 
    90     double ECut;
    91     int MaxLevel;
    92     int RiemannTensor;
    93     int LevRFactor;
    94     int RiemannLevel;
    95     int Lev0Factor;
    96     int RTActualUse;
    97     int AddPsis;
    98 
    99     double RCut;
    100     int StructOpt;
    101     int IsAngstroem;
    102     int RelativeCoord;
    103     int MaxTypes;
     30  bool GetIsAngstroem() const;
     31};
    10432
    10533
    106   public:
    107   config();
    108   ~config();
    109 
    110   int TestSyntax(const char * const filename, const periodentafel * const periode) const;
    111   bool Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const;
    112   bool SaveMPQC(const char * const filename, const molecule * const mol) const;
    113   bool SavePDB(const char * const filename, const MoleculeListClass * const MolList) const;
    114   bool SavePDB(const char * const filename, const molecule * const mol) const;
    115   bool SaveTREMOLO(const char * const filename, const molecule * const mol) const;
    116   bool SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const;
    117 
    118   void SaveAll(char *ConfigFileName, periodentafel *periode, MoleculeListClass *molecules);
    119 
    120   void Edit();
    121   bool GetIsAngstroem() const;
    122   char *GetDefaultPath() const;
    123   void SetDefaultPath(const char * const path);
    124   void ParseThermostats(class ConfigFileBuffer * const fb);
    125 };
    126 
    127 int ParseForParameter(const int verbose, ifstream * const file, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical);
    128 int ParseForParameter(const int verbose, struct ConfigFileBuffer * const FileBuffer, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical);
    129 void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
    130 void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
    131 
    13234#endif /* CONFIG_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.