Changeset 10f641


Ignore:
Timestamp:
Apr 28, 2008, 11:36:11 AM (17 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:
140e34
Parents:
b0a0c3
Message:

All filenames (const char *) have been transferred to defs.hpp

Filenames have been transformed into #define's into order to centralise these values. Parser.hpp had these already and they were streamlined to match defs.hpp (which is now included in parser.hpp)

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/defs.hpp

    rb0a0c3 r10f641  
    3737enum value_type { string_type, double_type, int_type, row_int, row_double, grid, lower_trigrid, upper_trigrid};
    3838
     39// various standard filenames
     40#define KEYSETFILE "KeySets.dat"
     41#define ADJACENCYFILE "Adjacency.dat"
     42#define TEFACTORSFILE "TE-Factors.dat"
     43#define FORCESFILE "Forces-Factors.dat"
     44#define FRAGMENTPREFIX "BondFragment"
     45#define STANDARDCONFIG "unknown.conf"
     46#define STANDARDELEMENTSDB "elements.db"
     47#define STANDARDVALENCEDB "valence.db"
     48#define STANDARDORBITALDB "orbitals.db"
     49#define STANDARDHBONDDISTANCEDB "Hbonddistance.db"
     50#define STANDARDHBONDANGLEDB "Hbondangle.db"
     51
    3952
    4053#endif /*DEFS_HPP_*/
  • src/moleculelist.cpp

    rb0a0c3 r10f641  
    385385  strcpy(PathBackup, configuration->GetDefaultPath());
    386386  // open file for the total energy factor
    387   sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, "TE-Factors.dat");
     387  sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, TEFACTORSFILE);
    388388  output.open(TEFilename, ios::out);
    389389  // output TEList (later to file AtomicTEList.dat)
     
    402402 
    403403  // open file for the force factors
    404   sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, "Forces-Factors.dat");
     404  sprintf(TEFilename, "%s/%s%s", PathBackup, prefix, FORCESFILE);
    405405  output.open(TEFilename, ios::out);
    406406  //cout << Verbose(1) << "Final AtomicForcesList: ";
  • src/molecules.cpp

    rb0a0c3 r10f641  
    18951895  cout << Verbose(1) << "Parsing the KeySet file ... ";
    18961896  // open file and read
    1897   sprintf(filename, "%s/%s%s", path, "BondFragment", "KeySets.dat");
     1897  sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, KEYSETFILE);
    18981898  KeySetFile.open(filename);
    18991899  if (KeySetFile != NULL) {
     
    19441944  bool status = true;
    19451945
    1946   sprintf(filename, "%s/%s%s", path, "BondFragment", "Adjacency.dat");
     1946  sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, ADJACENCYFILE);
    19471947  AdjacencyFile.open(filename);
    19481948  cout << Verbose(1) << "Saving adjacency list ... ";
     
    19791979  bool status = true;
    19801980 
    1981   sprintf(filename, "%s/%s%s", path, "BondFragment", "Adjacency.dat");
     1981  sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, ADJACENCYFILE);
    19821982  File.open(filename);
    19831983  *out << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ...";
  • src/parser.cpp

    rb0a0c3 r10f641  
    4343  stringstream line;
    4444
    45   line << argv[1] << FactorsFile;
     45  line << argv[1] << FRAGMENTPREFIX << TEFACTORSFILE;
    4646  return FilePresent(line.str().c_str());
    4747};
     
    106106  // count the number of matrices
    107107  MatrixCounter = -1; // we count one too much
    108   line << name << FactorsFile;
     108  line << name << FRAGMENTPREFIX << TEFACTORSFILE;
    109109  input.open(line.str().c_str(), ios::in);
    110110  if (input == NULL) {
     
    127127    FragmentNumber = FixedDigitNumber(MatrixCounter, i);
    128128    if (i != MatrixCounter) 
    129       line << name << FragmentPrefix << FragmentNumber << "/" << prefix << suffix;
     129      line << name << FRAGMENTPREFIX << FragmentNumber << "/" << prefix << suffix;
    130130    else
    131131      line << name << prefix << suffix;
     
    329329    stringstream line;
    330330    FragmentNumber = FixedDigitNumber(MatrixCounter, i);
    331     line << name << FragmentPrefix << FragmentNumber << "/" << prefix;
     331    line << name << FRAGMENTPREFIX << FragmentNumber << "/" << prefix;
    332332    Free((void **)&FragmentNumber, "*FragmentNumber");
    333333    output.open(line.str().c_str(), ios::out);
     
    424424  cout << "Parsing force indices." << endl;
    425425  Indices = (int **) Malloc(sizeof(int *)*(MatrixCounter+1), "ForceMatrix::ParseIndices: **Indices");
    426   line << name << ForcesFile;
     426  line << name << FRAGMENTPREFIX << FORCESFILE;
    427427  input.open(line.str().c_str(), ios::in);
    428428  //cout << "Opening " << line.str() << " ... "  << input << endl;
     
    439439    Indices[i] = (int *) Malloc(sizeof(int)*RowCounter[i], "ForceMatrix::ParseIndices: *Indices[]");
    440440    FragmentNumber = FixedDigitNumber(MatrixCounter, i);
    441     cout << FragmentPrefix << FragmentNumber << "[" << RowCounter[i] << "]:";
     441    cout << FRAGMENTPREFIX << FragmentNumber << "[" << RowCounter[i] << "]:";
    442442    Free((void **)&FragmentNumber, "ForceMatrix::ParseIndices: *FragmentNumber");
    443443    for(int j=0;(j<RowCounter[i]) && (!line.eof());j++) {
     
    521521  cout << "Parsing key sets." << endl;
    522522  KeySets = (int **) Malloc(sizeof(int *)*FragmentCounter, "KeySetsContainer::ParseKeySets: **KeySets");
    523   line << name << KeySetsFile;
     523  line << name << FRAGMENTPREFIX << KEYSETFILE;
    524524  input.open(line.str().c_str(), ios::in);
    525525  if (input == NULL) {
     
    535535    KeySets[i] = (int *) Malloc(sizeof(int)*AtomCounter[i], "KeySetsContainer::ParseKeySets: *KeySets[]");
    536536    FragmentNumber = FixedDigitNumber(FragmentCounter, i);
    537     cout << FragmentPrefix << FragmentNumber << "[" << AtomCounter[i] << "]:";
     537    cout << FRAGMENTPREFIX << FragmentNumber << "[" << AtomCounter[i] << "]:";
    538538    Free((void **)&FragmentNumber, "KeySetsContainer::ParseKeySets: *FragmentNumber");
    539539    input.getline(filename, 1023);
  • src/parser.hpp

    rb0a0c3 r10f641  
    1818// ======================================= DEFINES ==========================================
    1919
    20 #define FactorsFile "BondFragmentTE-Factors.dat"
    21 #define ForcesFile "BondFragmentForces-Factors.dat"
    22 #define KeySetsFile "BondFragmentKeySets.dat"
    23 #define FragmentPrefix "BondFragment"
    2420#define EnergySuffix ".energy.all"
    2521#define ForcesSuffix ".forces.all"
  • src/periodentafel.cpp

    rb0a0c3 r10f641  
    171171  // fill elements DB
    172172  if (filename == NULL)
    173     infile.open("elements.db");
     173    infile.open(STANDARDELEMENTSDB);
    174174  else
    175175    infile.open(filename);
     
    210210
    211211  // fill valence DB per element
    212   infile.open("valence.db");
     212  infile.open(STANDARDVALENCEDB);
    213213  if (infile != NULL) {
    214214    while (!infile.eof()) {
     
    225225
    226226  // fill valence DB per element
    227   infile.open("orbitals.db");
     227  infile.open(STANDARDORBITALDB);
    228228  if (infile != NULL) {
    229229    while (!infile.eof()) {
     
    240240 
    241241  // fill H-BondDistance DB per element
    242   infile.open("Hbonddistance.db");
     242  infile.open(STANDARDHBONDDISTANCEDB);
    243243  if (infile != NULL) {
    244244    while (!infile.eof()) {
     
    258258 
    259259  // fill H-BondAngle DB per element
    260   infile.open("Hbondangle.db");
     260  infile.open(STANDARDHBONDANGLEDB);
    261261  if (infile != NULL) {
    262262    while (!infile.eof()) {
Note: See TracChangeset for help on using the changeset viewer.