Changeset 97b825 for src/Parser


Ignore:
Timestamp:
Aug 7, 2010, 2:44:24 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:
458447
Parents:
5b4605
Message:

Shortened constructors [Meyers, "Effective C++" item 12]

  • also rearranged some initialization list (one per line).
Location:
src/Parser
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ChangeTracker.cpp

    r5b4605 r97b825  
    1616 */
    1717ChangeTracker::ChangeTracker() :
    18   Observable("ChangeTracker")
     18  Observable("ChangeTracker"),
     19  isConsistent(true)
    1920{
    20   isConsistent = true;
    2121  World::getInstance().signOn(this);
    2222}
  • src/Parser/FormatParser.cpp

    r5b4605 r97b825  
    1717 */
    1818FormatParser::FormatParser() :
    19   Observer("FormatParser")
     19  Observer("FormatParser"),
     20  saveStream(NULL)
    2021{
    2122  ChangeTracker::getInstance().signOn(this);
    22   saveStream = NULL;
    2323}
    2424
  • src/Parser/MpqcParser.cpp

    r5b4605 r97b825  
    2222 */
    2323MpqcParser::MpqcParser() : HessianPresent(false)
    24 {
    25 
    26 }
     24{}
    2725
    2826/** Destructor of MpqcParser.
    2927 *
    3028 */
    31 MpqcParser::~MpqcParser() {
    32 
    33 }
     29MpqcParser::~MpqcParser()
     30{}
    3431
    3532/** Load an MPQC config file into the World.
  • src/Parser/PcpParser.cpp

    r5b4605 r97b825  
    2424#include "Box.hpp"
    2525
     26
     27PcpParser::StructParallelization::StructParallelization() :
     28  ProcPEGamma(8),
     29  ProcPEPsi(1)
     30{}
     31
     32PcpParser::StructParallelization::~StructParallelization()
     33{}
     34
     35PcpParser::StructPaths::StructPaths() :
     36  databasepath(NULL),
     37  configname(NULL),
     38  mainname(NULL),
     39  defaultpath(NULL),
     40  pseudopotpath(NULL)
     41{}
     42
     43PcpParser::StructPaths::~StructPaths()
     44{}
     45
     46PcpParser::StructSwitches::StructSwitches() :
     47  DoConstrainedMD(0),
     48  DoOutVis(0),
     49  DoOutMes(1),
     50  DoOutNICS(0),
     51  DoOutOrbitals(0),
     52  DoOutCurrent(0),
     53  DoFullCurrent(0),
     54  DoPerturbation(0),
     55  DoWannier(0)
     56{}
     57
     58PcpParser::StructSwitches::~StructSwitches()
     59{}
     60
     61PcpParser::StructLocalizedOrbitals::StructLocalizedOrbitals() :
     62  CommonWannier(0),
     63  SawtoothStart(0.01),
     64  VectorPlane(0),
     65  VectorCut(0),
     66  UseAddGramSch(1),
     67  Seed(1),
     68  EpsWannier(1e-7)
     69{}
     70
     71PcpParser::StructLocalizedOrbitals::~StructLocalizedOrbitals()
     72{}
     73
     74PcpParser::StructStepCounts::StructStepCounts() :
     75  MaxMinStopStep(1),
     76  InitMaxMinStopStep(1),
     77  OutVisStep(10),
     78  OutSrcStep(5),
     79  MaxPsiStep(0),
     80  MaxOuterStep(0),
     81  MaxMinStep(100),
     82  RelEpsTotalEnergy(1e-07),
     83  RelEpsKineticEnergy(1e-05),
     84  MaxMinGapStopStep(0),
     85  MaxInitMinStep(100),
     86  InitRelEpsTotalEnergy(1e-05),
     87  InitRelEpsKineticEnergy(0.0001),
     88  InitMaxMinGapStopStep(0)
     89{}
     90
     91PcpParser::StructStepCounts::~StructStepCounts()
     92{}
     93
     94PcpParser::StructPlaneWaveSpecifics::StructPlaneWaveSpecifics() :
     95  PsiType(0),
     96  MaxPsiDouble(0),
     97  PsiMaxNoUp(0),
     98  PsiMaxNoDown(0),
     99  ECut(128),
     100  MaxLevel(5),
     101  RiemannTensor(0),
     102  LevRFactor(0),
     103  RiemannLevel(0),
     104  Lev0Factor(2),
     105  RTActualUse(0),
     106  AddPsis(0),
     107  RCut(20)
     108{}
     109
     110PcpParser::StructPlaneWaveSpecifics::~StructPlaneWaveSpecifics()
     111{}
     112
    26113/** Constructor of PcpParser.
    27114 *
    28115 */
    29 PcpParser::PcpParser()
    30 {
    31   Parallelization.ProcPEGamma = 8;
    32   Parallelization.ProcPEPsi = 1;
    33 
    34   Paths.databasepath = NULL;
    35   Paths.configname = NULL;
    36   Paths.mainname = NULL;
    37   Paths.defaultpath = NULL;
    38   Paths.pseudopotpath = NULL;
    39 
    40   Switches.DoConstrainedMD = 0;
    41   Switches.DoOutVis = 0;
    42   Switches.DoOutMes = 1;
    43   Switches.DoOutNICS = 0;
    44   Switches.DoOutOrbitals = 0;
    45   Switches.DoOutCurrent = 0;
    46   Switches.DoFullCurrent = 0;
    47   Switches.DoPerturbation = 0;
    48   Switches.DoWannier = 0;
    49 
    50   LocalizedOrbitals.CommonWannier = 0;
    51   LocalizedOrbitals.SawtoothStart = 0.01;
    52   LocalizedOrbitals.VectorPlane = 0;
    53   LocalizedOrbitals.VectorCut = 0;
    54   LocalizedOrbitals.UseAddGramSch = 1;
    55   LocalizedOrbitals.Seed = 1;
    56   LocalizedOrbitals.EpsWannier = 1e-7;
    57 
    58   StepCounts.MaxMinStopStep = 1;
    59   StepCounts.InitMaxMinStopStep = 1;
    60   StepCounts.OutVisStep = 10;
    61   StepCounts.OutSrcStep = 5;
    62   StepCounts.MaxPsiStep = 0;
    63   StepCounts.MaxOuterStep = 0;
    64   StepCounts.MaxMinStep = 100;
    65   StepCounts.RelEpsTotalEnergy = 1e-07;
    66   StepCounts.RelEpsKineticEnergy = 1e-05;
    67   StepCounts.MaxMinGapStopStep = 0;
    68   StepCounts.MaxInitMinStep = 100;
    69   StepCounts.InitRelEpsTotalEnergy = 1e-05;
    70   StepCounts.InitRelEpsKineticEnergy = 0.0001;
    71   StepCounts.InitMaxMinGapStopStep = 0;
    72 
    73   PlaneWaveSpecifics.PsiType = 0;
    74   PlaneWaveSpecifics.MaxPsiDouble = 0;
    75   PlaneWaveSpecifics.PsiMaxNoUp = 0;
    76   PlaneWaveSpecifics.PsiMaxNoDown = 0;
    77   PlaneWaveSpecifics.ECut = 128;
    78   PlaneWaveSpecifics.MaxLevel = 5;
    79   PlaneWaveSpecifics.RiemannTensor = 0;
    80   PlaneWaveSpecifics.LevRFactor = 0;
    81   PlaneWaveSpecifics.RiemannLevel = 0;
    82   PlaneWaveSpecifics.Lev0Factor = 2;
    83   PlaneWaveSpecifics.RTActualUse = 0;
    84   PlaneWaveSpecifics.AddPsis = 0;
    85   PlaneWaveSpecifics.RCut = 20;
    86   PlaneWaveSpecifics.PsiType = 0;
    87 
    88   FastParsing = false;
    89 
    90   Deltat = 0.01;
    91   IsAngstroem = 1;
    92   RelativeCoord = 0;
    93   StructOpt = 0;
    94   MaxTypes = 0;
    95 }
     116PcpParser::PcpParser() :
     117  FastParsing(false),
     118  Deltat(0.01),
     119  IsAngstroem(1),
     120  RelativeCoord(0),
     121  StructOpt(0),
     122  MaxTypes(0)
     123{}
    96124
    97125/** Destructor of PcpParser.
  • src/Parser/PcpParser.hpp

    r5b4605 r97b825  
    3131  void CalculateOrbitals(vector<atom *> &allatoms);
    3232
    33   struct StructParallelization {
     33  class StructParallelization {
     34  public:
     35    StructParallelization();
     36    ~StructParallelization();
     37
    3438    int ProcPEGamma;
    3539    int ProcPEPsi;
     
    3943   * Contains all the paths and names
    4044   */
    41   struct StructPaths {
     45  class StructPaths {
     46  public:
     47    StructPaths();
     48    ~StructPaths();
     49
    4250    char *databasepath;
    4351    char *configname;
     
    5058   * Contains all Do/Don't switches
    5159   */
    52   struct StructSwitches {
     60  class StructSwitches {
     61  public:
     62    StructSwitches();
     63    ~StructSwitches();
     64
    5365    int DoConstrainedMD;
    5466    int DoOutVis;
     
    6577   * Contains parameters regarding localization of orbitals or magnetic perturbation
    6678   */
    67   struct StructLocalizedOrbitals {
     79  class StructLocalizedOrbitals {
     80  public:
     81    StructLocalizedOrbitals();
     82    ~StructLocalizedOrbitals();
     83
    6884    int CommonWannier;
    6985    double SawtoothStart;
     
    7894   * Contains all step count and other epsilon threshold parameters
    7995   */
    80   struct StructStepCounts {
     96  class StructStepCounts {
     97  public:
     98    StructStepCounts();
     99    ~StructStepCounts();
     100
    81101    int MaxMinStopStep;
    82102    int InitMaxMinStopStep;
     
    101121   * Contains all parameters specific to the plane wave basis set
    102122   */
    103   struct StructPlaneWaveSpecifics {
     123  class StructPlaneWaveSpecifics {
     124  public:
     125    StructPlaneWaveSpecifics();
     126    ~StructPlaneWaveSpecifics();
     127
    104128    int PsiType;
    105129    int MaxPsiDouble;
  • src/Parser/TremoloParser.cpp

    r5b4605 r97b825  
    390390
    391391
    392 TremoloAtomInfoContainer::TremoloAtomInfoContainer() {
    393   F = "0";
    394   stress = "0";
    395   imprData = "-";
    396   GroupMeasureTypeNo = "0";
    397   extType = "-";
    398   name = "-";
    399   resName = "-";
    400   chainID = "0";
    401   resSeq = "0";
    402   occupancy = "0";
    403   tempFactor = "0";
    404   segID = "0";
    405   Charge = "0";
    406   charge = "0";
    407   GrpTypeNo = "0";
    408   torsion = "-";
    409   neighbors = vector<int>(0, 5);
    410 }
     392TremoloAtomInfoContainer::TremoloAtomInfoContainer() :
     393  F("0"),
     394  stress("0"),
     395  imprData("-"),
     396  GroupMeasureTypeNo("0"),
     397  extType("-"),
     398  name("-"),
     399  resName("-"),
     400  chainID("0"),
     401  resSeq("0"),
     402  occupancy("0"),
     403  tempFactor("0"),
     404  segID("0"),
     405  Charge("0"),
     406  charge("0"),
     407  GrpTypeNo("0"),
     408  torsion("-"),
     409  neighbors(vector<int>(0, 5))
     410{}
    411411
    412412void TremoloAtomInfoContainer::set(TremoloKey::atomDataKey key, string value) {
  • src/Parser/XyzParser.cpp

    r5b4605 r97b825  
    2222 * Constructor.
    2323 */
    24 XyzParser::XyzParser() {
    25   comment = "";
    26 }
     24XyzParser::XyzParser() :
     25  comment("")
     26{}
    2727
    2828/**
Note: See TracChangeset for help on using the changeset viewer.