Changeset 88b400 for src


Ignore:
Timestamp:
Aug 7, 2010, 1:46:16 PM (15 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:
5b4605
Parents:
44de80
Message:

converted #define's to enums, consts and typedefs [Meyers, "Effective C++", item 1].

basic changes:

  • #define bla 1.3 -> const double bla = 1.3
  • #define bla "test" -> const char * const bla = "test
  • use class specific constants! (HULLEPSILON)

const int Class::bla = 1.3; (in .cpp)
static const int bla; (in .hpp inside class private section)

  • "enum hack": #define bla 5 -> enum { bla = 5 };
    • if const int bla=5; impossible
    • e.g. necessary if constant is used in array declaration (int blabla[bla];)

details:

  • new file defs.cpp where const double reside in and are referenced by extern "C" const double
  • joiner.cpp: main() had to be changed due to concatenation of two #define possible, of two const char * not
  • class specific constants: HULLEPSILON, BONDTHRESHOLD, SPHERERADIUS
  • extended GetPathLengthonCircumCircle to additional parameter HULLEPSILON
Location:
src
Files:
1 added
32 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/MolecularVolumeAction.cpp

    r44de80 r88b400  
    1616#include "Helpers/Log.hpp"
    1717#include "Helpers/Verbose.hpp"
     18#include "tesselation.hpp"
    1819#include "World.hpp"
    1920
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp

    r44de80 r88b400  
    1818#include "molecule.hpp"
    1919#include "periodentafel.hpp"
     20#include "tesselation.hpp"
    2021#include "LinearAlgebra/Vector.hpp"
    2122#include "World.hpp"
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    r44de80 r88b400  
    1515#include "Helpers/Log.hpp"
    1616#include "molecule.hpp"
     17#include "tesselation.hpp"
    1718#include "Helpers/Verbose.hpp"
    1819#include "World.hpp"
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp

    r44de80 r88b400  
    1414#include "Helpers/Log.hpp"
    1515#include "molecule.hpp"
     16#include "tesselation.hpp"
    1617#include "Helpers/Verbose.hpp"
    1718#include "World.hpp"
  • src/BoundaryMaps.hpp

    r44de80 r88b400  
    99#define BOUNDARYMAPS_HPP_
    1010
    11 #define IndexToIndex std::map <int, int>
     11class BoundaryPointSet;
     12class BoundaryLineSet;
     13class BoundaryTriangleSet;
     14class BoundaryPolygonSet;
     15class CandidateForTesselation;
     16class TesselPoint;
    1217
    13 #define PointMap std::map < int, class BoundaryPointSet * >
    14 #define PointSet std::set < class BoundaryPointSet * >
    15 #define PointList std::list < class BoundaryPointSet * >
    16 #define PointPair std::pair < int, class BoundaryPointSet * >
    17 #define PointTestPair std::pair < PointMap::iterator, bool >
     18#include <list>
     19#include <map>
     20#include <set>
    1821
    19 #define CandidateList std::list <class CandidateForTesselation *>
    20 #define CandidateMap std::map <class BoundaryLineSet *, class CandidateForTesselation *>
     22typedef std::map <int, int> IndexToIndex;
    2123
    22 #define LineMap std::multimap < int, class BoundaryLineSet * >
    23 #define LineSet std::set < class BoundaryLineSet * >
    24 #define LineList std::list < class BoundaryLineSet * >
    25 #define LinePair std::pair < int, class BoundaryLineSet * >
    26 #define LineTestPair std::pair < LineMap::iterator, bool >
     24typedef std::map < int, class BoundaryPointSet * > PointMap;
     25typedef std::set < class BoundaryPointSet * > PointSet;
     26typedef std::list < class BoundaryPointSet * > PointList;
     27typedef std::pair < int, class BoundaryPointSet * > PointPair;
     28typedef std::pair < PointMap::iterator, bool > PointTestPair;
    2729
    28 #define TriangleMap std::map < int, class BoundaryTriangleSet * >
    29 #define TriangleSet std::set < class BoundaryTriangleSet * >
    30 #define TriangleList std::list < class BoundaryTriangleSet * >
    31 #define TrianglePair std::pair < int, class BoundaryTriangleSet * >
    32 #define TriangleTestPair std::pair < TrianglePair::iterator, bool >
     30typedef std::list <class CandidateForTesselation *> CandidateList;
     31typedef std::map <class BoundaryLineSet *, class CandidateForTesselation *> CandidateMap;
    3332
    34 #define PolygonMap std::map < int, class BoundaryPolygonSet * >
    35 #define PolygonSet std::set < class BoundaryPolygonSet * >
    36 #define PolygonList std::list < class BoundaryPolygonSet * >
     33typedef std::multimap < int, class BoundaryLineSet * > LineMap;
     34typedef std::set < class BoundaryLineSet * > LineSet;
     35typedef std::list < class BoundaryLineSet * > LineList;
     36typedef std::pair < int, class BoundaryLineSet * > LinePair;
     37typedef std::pair < LineMap::iterator, bool > LineTestPair;
    3738
    38 #define DistanceToPointMap std::multimap <double, class BoundaryPointSet * >
    39 #define DistanceToPointPair std::pair <double, class BoundaryPointSet * >
     39typedef std::map < int, class BoundaryTriangleSet * > TriangleMap;
     40typedef std::set < class BoundaryTriangleSet * > TriangleSet;
     41typedef std::list < class BoundaryTriangleSet * > TriangleList;
     42typedef std::pair < int, class BoundaryTriangleSet * > TrianglePair;
     43typedef std::pair < TriangleMap::iterator, bool > TriangleTestPair;
    4044
    41 #define DistanceMultiMap std::multimap <double, std::pair < PointMap::iterator, PointMap::iterator> >
    42 #define DistanceMultiMapPair std::pair <double, std::pair < PointMap::iterator, PointMap::iterator> >
     45typedef std::map < int, class BoundaryPolygonSet * > PolygonMap;
     46typedef std::set < class BoundaryPolygonSet * > PolygonSet;
     47typedef std::list < class BoundaryPolygonSet * > PolygonList;
    4348
    44 #define TesselPointList std::list <TesselPoint *>
    45 #define TesselPointSet std::set <TesselPoint *>
     49typedef std::multimap <double, class BoundaryPointSet * > DistanceToPointMap;
     50typedef std::pair <double, class BoundaryPointSet * > DistanceToPointPair;
    4651
    47 #define ListOfTesselPointList std::list<std::list <TesselPoint *> *>
     52typedef std::multimap <double, std::pair < PointMap::iterator, PointMap::iterator> > DistanceMultiMap;
     53typedef std::pair <double, std::pair < PointMap::iterator, PointMap::iterator> > DistanceMultiMapPair;
     54
     55typedef std::list <TesselPoint *> TesselPointList;
     56typedef std::set <TesselPoint *> TesselPointSet;
     57
     58typedef std::list<std::list <TesselPoint *> *> ListOfTesselPointList;
    4859
    4960enum centers {Opt, OtherOpt};
    5061
    51 #define HULLEPSILON 1e-9 //!< TODO: Get rid of HULLEPSILON, points to numerical instabilities
    5262
    5363
  • src/BoundaryTriangleSet.hpp

    r44de80 r88b400  
    1111#include "BoundaryMaps.hpp"
    1212#include "LinearAlgebra/Vector.hpp"
    13 
    14 #include <set>
    1513
    1614class BoundaryLineSet;
  • src/CandidateForTesselation.cpp

    r44de80 r88b400  
    2525
    2626using namespace std;
     27
     28
     29const double CandidateForTesselation::HULLEPSILON = 1e-9;
     30
    2731
    2832/** Constructor of class CandidateForTesselation.
  • src/CandidateForTesselation.hpp

    r44de80 r88b400  
    3838  double ShortestAngle;
    3939  double OtherShortestAngle;
     40
     41  private:
     42  static const double HULLEPSILON; //!< TODO: Get rid of HULLEPSILON, points to numerical instabilities
    4043};
    4144
  • src/Makefile.am

    r44de80 r88b400  
    157157  config.cpp \
    158158  ConfigFileBuffer.cpp \
     159  defs.cpp \
    159160  element.cpp \
    160161  elements_db.cpp \
  • src/ThermoStatContainer.hpp

    r44de80 r88b400  
    1616class ConfigFileBuffer;
    1717
    18 #define MaxThermostats 6      //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented
     18enum { MaxThermostats=6 };      //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented
    1919enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover };   //!< Thermostat names for output
    2020
  • src/analysis_bonds.hpp

    r44de80 r88b400  
    2020/*********************************************** defines ***********************************/
    2121
    22 #define HBRIDGEDISTANCE 3.5   //!< HBridge distance from PCCP Vol 10. 4802-4813
     22const double HBRIDGEDISTANCE=3.5;   //!< HBridge distance from PCCP Vol 10. 4802-4813
    2323
    2424/****************************************** forward declarations *****************************/
  • src/bondgraph.cpp

    r44de80 r88b400  
    2121#include "periodentafel.hpp"
    2222#include "LinearAlgebra/Vector.hpp"
     23
     24const double BondGraph::BondThreshold = 0.4;   //!< CSD threshold in bond check which is the width of the interval whose center is the sum of the covalent radii
    2325
    2426/** Constructor of class BondGraph.
     
    147149  MinDistance = OtherWalker->getType()->CovalentRadius + Walker->getType()->CovalentRadius;
    148150  MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem;
    149   MaxDistance = MinDistance + BONDTHRESHOLD;
    150   MinDistance -= BONDTHRESHOLD;
     151  MaxDistance = MinDistance + BondThreshold;
     152  MinDistance -= BondThreshold;
    151153};
    152154
     
    168170    MinDistance = GetBondLength(Walker->getType()->Z-1, OtherWalker->getType()->Z-1);
    169171    MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem;
    170     MaxDistance = MinDistance + BONDTHRESHOLD;
    171     MinDistance -= BONDTHRESHOLD;
     172    MaxDistance = MinDistance + BondThreshold;
     173    MinDistance -= BondThreshold;
    172174  }
    173175};
  • src/bondgraph.hpp

    r44de80 r88b400  
    2020#include <iosfwd>
    2121
    22 /*********************************************** defines ***********************************/
    23 
    24 #define BONDTHRESHOLD 0.4   //!< CSD threshold in bond check which is the width of the interval whose center is the sum of the covalent radii
    2522
    2623/****************************************** forward declarations *****************************/
     
    4845
    4946private:
     47  static const double BondThreshold;
     48
    5049  MatrixContainer *BondLengthMatrix;
    5150  double max_distance;
  • src/boundary.hpp

    r44de80 r88b400  
    3434/********************************************** definitions *********************************/
    3535
    36 #define DEBUG 1
    37 #define DoSingleStepOutput 0
    38 #define SingleStepWidth 10
     36enum { DEBUG=1 };
     37enum { DoSingleStepOutput=0 };
     38enum { SingleStepWidth=10 };
    3939
    40 #define DistancePair pair < double, atom* >
    41 #define DistanceMap multimap < double, atom* >
    42 #define DistanceTestPair pair < DistanceMap::iterator, bool>
     40typedef std::pair < double, class atom* > DistancePair;
     41typedef std::multimap < double, class atom* > DistanceMap;
     42typedef std::pair < DistanceMap::iterator, bool> DistanceTestPair;
    4343
    44 #define Boundaries map <double, DistancePair >
    45 #define BoundariesPair pair<double, DistancePair >
    46 #define BoundariesTestPair pair< Boundaries::iterator, bool>
     44typedef std::map <double, DistancePair > Boundaries;
     45typedef std::pair<double, DistancePair > BoundariesPair;
     46typedef std::pair< Boundaries::iterator, bool> BoundariesTestPair;
    4747
    4848/********************************************** declarations *******************************/
  • src/defs.hpp

    r44de80 r88b400  
    88#define DEFS_HPP_
    99
    10 #define MYEPSILON 1e-13   //!< machine epsilon precision
    11 #define NDIM  3   //!< number of spatial dimensions
    12 #define MAX_ELEMENTS 128  //!< maximum number of elements for certain lookup tables
    13 #define AtomicLengthToAngstroem  0.52917721 //!< conversion factor from atomic length/bohrradius to angstroem
    14 #define AtomicEnergyToKelvin 315774.67  //!< conversion factor from atomic energy to kelvin via boltzmann factor
    15 #define KelvinToAtomicTemperature 3.1668152e-06    //!< conversion factor for Kelvin to atomic temperature (Hartree over k_B)
    16 #define KelvinToeV 8.6173422e-05                   //!< conversion factor for Kelvin to Ht (k_B * T = energy), thus Boltzmann constant in eV/K
    17 #define AtomicMassUnitsToeV 931494088.        //!< conversion factor for atomic weight in units to mass in eV
    18 #define AtomicMassUnitsToHt 34480864.        //!< conversion factor for atomic weight in units to mass in Ht (protonmass/electronmass * electron_mass_in_Ht
    19 #define ElectronMass_Ht 18778.865            //!< electron mass in Ht
    20 #define ElectronMass_eV 510998.903           //!< electron mass in eV
    21 #define Units2Electronmass (AtomicMassUnitsToeV/ElectronMass_eV) //!< atomic mass unit in eV/ electron mass in eV = 1 822.88863
    22 #define Atomictime2Femtoseconds 0.024188843     //!< Atomictime in fs
     10enum { NDIM = 3 };   //!< number of spatial dimensions
     11enum { MAX_ELEMENTS = 128}; //!< maximum number of elements for certain lookup tables
    2312
    24 #define VERSIONSTRING "v1.0"
     13extern "C" const double MYEPSILON;  //!< machine epsilon precision
     14extern "C" const double AtomicLengthToAngstroem; //!< conversion factor from atomic length/bohrradius to angstroem
     15extern "C" const double AtomicEnergyToKelvin;  //!< conversion factor from atomic energy to kelvin via boltzmann factor
     16extern "C" const double KelvinToAtomicTemperature;    //!< conversion factor for Kelvin to atomic temperature (Hartree over k_B)
     17extern "C" const double KelvinToeV;                   //!< conversion factor for Kelvin to Ht (k_B * T = energy), thus Boltzmann constant in eV/K
     18extern "C" const double AtomicMassUnitsToeV;        //!< conversion factor for atomic weight in units to mass in eV
     19extern "C" const double AtomicMassUnitsToHt;        //!< conversion factor for atomic weight in units to mass in Ht (protonmass/electronmass * electron_mass_in_Ht
     20extern "C" const double ElectronMass_Ht;            //!< electron mass in Ht
     21extern "C" const double ElectronMass_eV;           //!< electron mass in eV
     22extern "C" const double Units2Electronmass; //!< atomic mass unit in eV/ electron mass in eV = 1 822.88863
     23extern "C" const double Atomictime2Femtoseconds;     //!< Atomictime in fs
    2524
    26 #define LocalPath "./"
     25extern "C" const char* VERSIONSTRING;
     26
     27extern "C" const char* LocalPath;
    2728
    2829//enum BondOrderScheme { NoScheme, BottomUp, TopDown, ANOVA, Combined }; //!< Fragmentation scheme used in BOSS
     
    4849
    4950// maximum length of any char array
    50 #define MAXSTRINGSIZE 255
     51enum { MAXSTRINGSIZE = 255 };
    5152
    5253// various standard filenames
    53 #define DEFAULTCONFIG "main_pcp_linux"    //!< default filename of config file
    54 #define CONVEXENVELOPE "ConvexEnvelope.dat"    //!< default filename of convex envelope tecplot data file
    55 #define KEYSETFILE "KeySets.dat"    //!< default filename of BOSSANOVA key sets file
    56 #define ADJACENCYFILE "Adjacency.dat"    //!< default filename of BOSSANOVA adjacancy file
    57 #define TEFACTORSFILE "TE-Factors.dat"    //!< default filename of BOSSANOVA total energy factors file
    58 #define FORCESFILE "Forces-Factors.dat"    //!< default filename of BOSSANOVA force factors file
    59 #define HCORRECTIONSUFFIX "Hcorrection.dat"    //!< default filename of BOSSANOVA H correction file (unwanted saturation interaction)
    60 #define FITCONSTANTSUFFIX "FitConstant.dat"   //!< suffix of default filename of BOSSANOVA fit constants file (unwanted saturation interaction)
    61 #define SHIELDINGSUFFIX "sigma_all.csv"                //!< default filename of BOSSANOVA shieldings file
    62 #define SHIELDINGPASSUFFIX "sigma_all_PAS.csv"                 //!< default filename of BOSSANOVA shieldings PAS file
    63 #define ORDERATSITEFILE "OrderAtSite.dat"    //!< default filename of BOSSANOVA Bond Order at each atom file
    64 #define ENERGYPERFRAGMENT "EnergyPerFragment"    //!< default filename of BOSSANOVA Energy contribution Per Fragment file
    65 #define FRAGMENTPREFIX "BondFragment"    //!< default filename prefix of BOSSANOVA fragment config and directories
    66 #define STANDARDCONFIG "unknown.conf"    //!< default filename of standard config file
    67 #define STANDARDELEMENTSDB "elements.db"    //!< default filename of elements data base with masses, Z, VanDerWaals radii, ...
    68 #define STANDARDVALENCEDB "valence.db"    //!< default filename of valence number per element database
    69 #define STANDARDORBITALDB "orbitals.db"    //!< default filename of orbitals per element database
    70 #define STANDARDHBONDDISTANCEDB "Hbonddistance.db"    //!< default filename of typial bond distance to hydrogen database
    71 #define STANDARDHBONDANGLEDB "Hbondangle.db"    //!< default filename of typial bond angle to hydrogen database
     54extern "C" const char *DEFAULTCONFIG;    //!< default filename of config file
     55extern "C" const char *CONVEXENVELOPE;    //!< default filename of convex envelope tecplot data file
     56extern "C" const char *KEYSETFILE;    //!< default filename of BOSSANOVA key sets file
     57extern "C" const char *ADJACENCYFILE;    //!< default filename of BOSSANOVA adjacancy file
     58extern "C" const char *TEFACTORSFILE;    //!< default filename of BOSSANOVA total energy factors file
     59extern "C" const char *FORCESFILE;    //!< default filename of BOSSANOVA force factors file
     60extern "C" const char *HCORRECTIONSUFFIX;    //!< default filename of BOSSANOVA H correction file (unwanted saturation interaction)
     61extern "C" const char *FITCONSTANTSUFFIX;   //!< suffix of default filename of BOSSANOVA fit constants file (unwanted saturation interaction)
     62extern "C" const char *SHIELDINGSUFFIX;                //!< default filename of BOSSANOVA shieldings file
     63extern "C" const char *SHIELDINGPASSUFFIX;                 //!< default filename of BOSSANOVA shieldings PAS file
     64extern "C" const char *ORDERATSITEFILE;    //!< default filename of BOSSANOVA Bond Order at each atom file
     65extern "C" const char *ENERGYPERFRAGMENT;    //!< default filename of BOSSANOVA Energy contribution Per Fragment file
     66extern "C" const char *FRAGMENTPREFIX;    //!< default filename prefix of BOSSANOVA fragment config and directories
     67extern "C" const char *STANDARDCONFIG;    //!< default filename of standard config file
     68extern "C" const char *STANDARDELEMENTSDB;    //!< default filename of elements data base with masses, Z, VanDerWaals radii, ...
     69extern "C" const char *STANDARDVALENCEDB;    //!< default filename of valence number per element database
     70extern "C" const char *STANDARDORBITALDB;    //!< default filename of orbitals per element database
     71extern "C" const char *STANDARDHBONDDISTANCEDB;    //!< default filename of typial bond distance to hydrogen database
     72extern "C" const char *STANDARDHBONDANGLEDB;    //!< default filename of typial bond angle to hydrogen database
    7273
    7374// some values
    74 #define SOLVENTDENSITY_A 0.6022142
    75 #define SOLVENTDENSITY_a0 0.089238936
     75extern "C" const double SOLVENTDENSITY_A;
     76extern "C" const double SOLVENTDENSITY_a0;
    7677
    7778
    78 #define UPDATECOUNT 10  //!< update ten sites per BOSSANOVA interval
     79extern "C" const int UPDATECOUNT;  //!< update ten sites per BOSSANOVA interval
    7980
    80 #define STD_MENU_LENGTH 60
    81 #define STD_MENU_TITLE_SPACER '='
    82 #define STD_SEPERATOR_SPACER '-'
     81extern "C" const int STD_MENU_LENGTH;
     82extern "C" const char STD_MENU_TITLE_SPACER;
     83extern "C" const char STD_SEPERATOR_SPACER;
    8384
    84 #define MOLECUILDER_NAME "Molecuilder"
     85extern "C" const char *MOLECUILDER_NAME;
    8586
    8687const extern unsigned int MAX_POOL_FRAGMENTATION;
  • src/joiner.cpp

    r44de80 r88b400  
    209209  prefix << dir << ForceFragmentSuffix;
    210210  if (!ForceFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
    211   if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], FRAGMENTPREFIX ENERGYPERFRAGMENT, "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1;
     211  {
     212    std::string fileprefix(FRAGMENTPREFIX);
     213    fileprefix += ENERGYPERFRAGMENT;
     214    if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], fileprefix.c_str(), "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1;
     215  }
    212216  if (!NoHessian) {
    213217    prefix.str(" ");
  • src/molecule.hpp

    r44de80 r88b400  
    2424#include "types.hpp"
    2525#include "graph.hpp"
    26 #include "tesselation.hpp"
     26#include "PointCloud.hpp"
    2727#include "Patterns/Observer.hpp"
    2828#include "Patterns/ObservedIterator.hpp"
  • src/moleculelist.cpp

    r44de80 r88b400  
    3030#include "molecule.hpp"
    3131#include "periodentafel.hpp"
     32#include "tesselation.hpp"
    3233#include "Helpers/Assert.hpp"
    3334#include "LinearAlgebra/Matrix.hpp"
  • src/tesselation.cpp

    r44de80 r88b400  
    3434
    3535class molecule;
     36
     37const char *TecplotSuffix=".dat";
     38const char *Raster3DSuffix=".r3d";
     39const char *VRMLSUffix=".wrl";
     40
     41const double ParallelEpsilon=1e-3;
     42const double Tesselation::HULLEPSILON = 1e-9;
    3643
    3744/** Constructor of class Tesselation.
     
    21252132                        OtherNewSphereCenter += helper;
    21262133                        DoLog(2) && (Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl);
    2127                         alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
    2128                         Otheralpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, OtherNewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
     2134                        alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection, HULLEPSILON);
     2135                        Otheralpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, OtherNewSphereCenter, OldSphereCenter, NormalVector, SearchDirection, HULLEPSILON);
    21292136                        if ((ThirdPoint != NULL) && (Candidate == ThirdPoint->node)) { // in that case only the other circlecenter is valid
    21302137                          if (OldSphereCenter.DistanceSquared(NewSphereCenter) < OldSphereCenter.DistanceSquared(OtherNewSphereCenter))
  • src/tesselation.hpp

    r44de80 r88b400  
    4646/********************************************** definitions *********************************/
    4747
    48 #define DoTecplotOutput 1
    49 #define DoRaster3DOutput 1
    50 #define DoVRMLOutput 0
    51 #define TecplotSuffix ".dat"
    52 #define Raster3DSuffix ".r3d"
    53 #define VRMLSUffix ".wrl"
     48enum { DoTecplotOutput=1 };
     49enum { DoRaster3DOutput=1 };
     50enum { DoVRMLOutput=0 };
    5451
    55 #define ParallelEpsilon 1e-3
     52extern "C" const char *TecplotSuffix;
     53extern "C" const char *Raster3DSuffix;
     54extern "C" const char *VRMLSUffix;
     55
     56extern "C" const double ParallelEpsilon;
    5657
    5758// ======================================================= some template functions =========================================
     
    157158
    158159  private:
     160    static const double HULLEPSILON; //!< TODO: Get rid of HULLEPSILON, points to numerical instabilities
     161
    159162    mutable class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions
    160163
  • src/tesselationhelpers.cpp

    r44de80 r88b400  
    180180 * \param NormalVector normal vector
    181181 * \param SearchDirection search direction to make angle unique on return.
     182 * \param HULLEPSILON machine precision for tesselation points
    182183 * \return Angle between \a NewSphereCenter and \a OldSphereCenter relative to \a CircleCenter, 2.*M_PI if one test fails
    183184 */
    184 double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection)
     185double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection, const double HULLEPSILON)
    185186{
    186187        Info FunctionInfo(__func__);
  • src/tesselationhelpers.hpp

    r44de80 r88b400  
    2222#include <iosfwd>
    2323
     24#include "BoundaryMaps.hpp"
    2425#include "defs.hpp"
    2526
     
    4445void GetCenterOfSphere(Vector& Center, const Vector &a, const Vector &b, const Vector &c, Vector &NewUmkreismittelpunkt, const Vector &Direction, const Vector* const AlternativeDirection, const double HalfplaneIndicator, const double AlternativeIndicator, const double alpha, const double beta, const double gamma, const double RADIUS, const double Umkreisradius);
    4546void GetCenterofCircumcircle(Vector & Center, const Vector &a, const Vector &b, const Vector &c);
    46 double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection);
     47double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection, const double HULLEPSILON);
    4748double CalculateVolumeofGeneralTetraeder(const Vector &a, const Vector &b, const Vector &c, const Vector &d);
    4849double CalculateAreaofGeneralTriangle(const Vector &A, const Vector &B, const Vector &C);
  • src/unittests/AtomDescriptorTest.hpp

    r44de80 r88b400  
    1313#include "types.hpp"
    1414
    15 #define ATOM_COUNT (10)
     15// we prefer enum over define
     16enum { ATOM_COUNT = 10 };
    1617
    1718class atom;
  • src/unittests/MoleculeDescriptorTest.hpp

    r44de80 r88b400  
    1313#include "types.hpp"
    1414
    15 #define MOLECULE_COUNT (10)
     15// we prefer enum over define
     16enum { MOLECULE_COUNT = 10 };
    1617
    1718class molecule;
  • src/unittests/atomsCalculationTest.hpp

    r44de80 r88b400  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #define ATOM_COUNT (10)
     13// we prefer enum over define
     14enum { ATOM_COUNT = 10 };
    1415
    1516#include "types.hpp"
  • src/unittests/manipulateAtomsTest.hpp

    r44de80 r88b400  
    1111#include <cppunit/extensions/HelperMacros.h>
    1212
    13 #define ATOM_COUNT (10)
     13// we prefer enum over define
     14enum { ATOM_COUNT = 10 };
    1415
    1516class atom;
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    r44de80 r88b400  
    2727#endif /*HAVE_TESTRUNNER*/
    2828
    29 #define SPHERERADIUS 2.
     29const double TesselationBoundaryTriangleTest::SPHERERADIUS=2.;
    3030
    3131/********************************************** Test classes **************************************/
  • src/unittests/tesselation_boundarytriangleunittest.hpp

    r44de80 r88b400  
    3434
    3535private:
     36      static const double SPHERERADIUS;
     37
    3638      class BoundaryTriangleSet *triangle;
    3739      class BoundaryLineSet *lines[3];
  • src/unittests/tesselation_insideoutsideunittest.cpp

    r44de80 r88b400  
    2727#endif /*HAVE_TESTRUNNER*/
    2828
    29 #define SPHERERADIUS 2.
     29const double TesselationInOutsideTest::SPHERERADIUS=2.;
    3030
    3131/********************************************** Test classes **************************************/
  • src/unittests/tesselation_insideoutsideunittest.hpp

    r44de80 r88b400  
    3030
    3131private:
     32      static const double SPHERERADIUS;
     33
    3234      class Tesselation *TesselStruct;
    3335      LinkedCell::LinkedNodes Corners;
  • src/unittests/tesselationunittest.cpp

    r44de80 r88b400  
    2626#endif /*HAVE_TESTRUNNER*/
    2727
    28 #define SPHERERADIUS 2.
     28const double TesselationTest::SPHERERADIUS=2.;
    2929
    3030/********************************************** Test classes **************************************/
  • src/unittests/tesselationunittest.hpp

    r44de80 r88b400  
    3333
    3434private:
     35      static const double SPHERERADIUS;
     36
    3537      class Tesselation *TesselStruct;
    3638      LinkedCell::LinkedNodes Corners;
Note: See TracChangeset for help on using the changeset viewer.