Ignore:
Timestamp:
Nov 4, 2009, 7:56:04 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:
1614174, e5ad5c
Parents:
7326b2
Message:

Huge change from ofstream * (const) out --> Log().

  • first shift was done via regular expressions
  • then via error messages from the code
  • note that class atom, class element and class molecule kept in parts their output stream, was they print to file.
  • make check runs fine
  • MISSING: Verbosity is not fixed for everything (i.e. if no endl; is present and next has Verbose(0) ...)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/periodentafel.cpp

    r7326b2 re138de  
    1313#include "helpers.hpp"
    1414#include "lists.hpp"
     15#include "log.hpp"
    1516#include "periodentafel.hpp"
    1617#include "verbose.hpp"
     
    4748  pointer->sort = &pointer->Z;
    4849  if (pointer->Z < 1 && pointer->Z >= MAX_ELEMENTS)
    49     cout << Verbose(0) << "Invalid Z number!\n";
     50    Log() << Verbose(0) << "Invalid Z number!\n";
    5051  return add(pointer, end);
    5152};
     
    102103  int Z;
    103104  do {
    104     cout << Verbose(0) << "Atomic number Z: ";
     105    Log() << Verbose(0) << "Atomic number Z: ";
    105106    cin >> Z;
    106107    walker = this->FindElement(Z);  // give type
     
    116117  element *walker = NULL;
    117118  int Z = -1;
    118   cout << Verbose(0) << "Atomic number: " << Z << endl;
     119  Log() << Verbose(0) << "Atomic number: " << Z << endl;
    119120  cin >> Z;
    120121  walker = FindElement(Z);
    121122  if (walker == NULL) {
    122     cout << Verbose(0) << "Element not found in database, please enter." << endl;
     123    Log() << Verbose(0) << "Element not found in database, please enter." << endl;
    123124    walker = new element;
    124125    walker->Z = Z;
    125     cout << Verbose(0) << "Mass: " << endl;
     126    Log() << Verbose(0) << "Mass: " << endl;
    126127    cin >> walker->mass;
    127     cout << Verbose(0) << "Name [max 64 chars]: " << endl;
     128    Log() << Verbose(0) << "Name [max 64 chars]: " << endl;
    128129    cin >> walker->name;
    129     cout << Verbose(0) << "Short form [max 3 chars]: " << endl;
     130    Log() << Verbose(0) << "Short form [max 3 chars]: " << endl;
    130131    cin >> walker->symbol;
    131132    periodentafel::AddElement(walker);
     
    196197    infile.getline(header1, MAXSTRINGSIZE);
    197198    infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
    198     cout <<  "Parsed elements:";
     199    Log() << Verbose(0) <<  "Parsed elements:";
    199200    while (!infile.eof()) {
    200201      element *neues = new element;
     
    218219      //infile >> ws;
    219220      infile >> ws;
    220       cout << " " << neues->symbol;
     221      Log() << Verbose(0) << " " << neues->symbol;
    221222      //neues->Output((ofstream *)&cout);
    222223      if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS))
    223224        periodentafel::AddElement(neues);
    224225      else {
    225         cout << "Could not parse element: ";
     226        Log() << Verbose(0) << "Could not parse element: ";
    226227        neues->Output((ofstream *)&cout);
    227228        delete(neues);
    228229      }
    229230    }
    230     cout << endl;
     231    Log() << Verbose(0) << endl;
    231232    infile.close();
    232233    infile.clear();
     
    245246      infile >> FindElement((int)tmp)->Valence;
    246247      infile >> ws;
    247       //cout << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;
     248      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;
    248249    }
    249250    infile.close();
     
    263264      infile >> FindElement((int)tmp)->NoValenceOrbitals;
    264265      infile >> ws;
    265       //cout << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;
     266      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;
    266267    }
    267268    infile.close();
     
    284285      infile >> ptr->HBondDistance[2];
    285286      infile >> ws;
    286       //cout << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;
     287      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;
    287288    }
    288289    infile.close();
     
    305306      infile >> ptr->HBondAngle[2];
    306307      infile >> ws;
    307       //cout << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;
     308      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;
    308309    }
    309310    infile.close();
     
    312313
    313314  if (!otherstatus)
    314     cerr << "WARNING: Something went wrong while parsing the other databases!" << endl;
     315    eLog() << Verbose(0) << "WARNING: Something went wrong while parsing the other databases!" << endl;
    315316
    316317  return status;
Note: See TracChangeset for help on using the changeset viewer.