Changeset e138de for src/boundary.cpp


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/boundary.cpp

    r7326b2 re138de  
    1111#include "helpers.hpp"
    1212#include "linkedcell.hpp"
     13#include "log.hpp"
    1314#include "memoryallocator.hpp"
    1415#include "molecule.hpp"
     
    3031 * \return NDIM array of the diameters
    3132 */
    32 double *GetDiametersOfCluster(ofstream *out, const Boundaries *BoundaryPtr, const molecule *mol, Tesselation *&TesselStruct, const bool IsAngstroem)
     33double *GetDiametersOfCluster(const Boundaries *BoundaryPtr, const molecule *mol, Tesselation *&TesselStruct, const bool IsAngstroem)
    3334{
    3435  // get points on boundary of NULL was given as parameter
     
    4950  if (BoundaryPtr == NULL) {
    5051    BoundaryFreeFlag = true;
    51     BoundaryPoints = GetBoundaryPoints(out, mol, TesselStruct);
     52    BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    5253  } else {
    5354    BoundaryPoints = BoundaryPtr;
    54     *out << Verbose(1) << "Using given boundary points set." << endl;
     55    Log() << Verbose(1) << "Using given boundary points set." << endl;
    5556  }
    5657  // determine biggest "diameter" of cluster for each axis
     
    5960  for (int axis = 0; axis < NDIM; axis++)
    6061    { // regard each projected plane
    61       //*out << Verbose(1) << "Current axis is " << axis << "." << endl;
     62      //Log() << Verbose(1) << "Current axis is " << axis << "." << endl;
    6263      for (int j = 0; j < 2; j++)
    6364        { // and for both axis on the current plane
    6465          component = (axis + j + 1) % NDIM;
    6566          Othercomponent = (axis + 1 + ((j + 1) & 1)) % NDIM;
    66           //*out << Verbose(1) << "Current component is " << component << ", Othercomponent is " << Othercomponent << "." << endl;
     67          //Log() << Verbose(1) << "Current component is " << component << ", Othercomponent is " << Othercomponent << "." << endl;
    6768          for (Boundaries::const_iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    68               //*out << Verbose(2) << "Current runner is " << *(runner->second.second) << "." << endl;
     69              //Log() << Verbose(2) << "Current runner is " << *(runner->second.second) << "." << endl;
    6970              // seek for the neighbours pair where the Othercomponent sign flips
    7071              Neighbour = runner;
     
    8182                  DistanceVector.CopyVector(&runner->second.second->x);
    8283                  DistanceVector.SubtractVector(&Neighbour->second.second->x);
    83                   //*out << Verbose(3) << "OldComponent is " << OldComponent << ", new one is " << DistanceVector.x[Othercomponent] << "." << endl;
     84                  //Log() << Verbose(3) << "OldComponent is " << OldComponent << ", new one is " << DistanceVector.x[Othercomponent] << "." << endl;
    8485                } while ((runner != Neighbour) && (fabs(OldComponent / fabs(
    8586                  OldComponent) - DistanceVector.x[Othercomponent] / fabs(
     
    9091                    OtherNeighbour = BoundaryPoints[axis].end();
    9192                  OtherNeighbour--;
    92                   //*out << Verbose(2) << "The pair, where the sign of OtherComponent flips, is: " << *(Neighbour->second.second) << " and " << *(OtherNeighbour->second.second) << "." << endl;
     93                  //Log() << Verbose(2) << "The pair, where the sign of OtherComponent flips, is: " << *(Neighbour->second.second) << " and " << *(OtherNeighbour->second.second) << "." << endl;
    9394                  // now we have found the pair: Neighbour and OtherNeighbour
    9495                  OtherVector.CopyVector(&runner->second.second->x);
    9596                  OtherVector.SubtractVector(&OtherNeighbour->second.second->x);
    96                   //*out << Verbose(2) << "Distances to Neighbour and OtherNeighbour are " << DistanceVector.x[component] << " and " << OtherVector.x[component] << "." << endl;
    97                   //*out << Verbose(2) << "OtherComponents to Neighbour and OtherNeighbour are " << DistanceVector.x[Othercomponent] << " and " << OtherVector.x[Othercomponent] << "." << endl;
     97                  //Log() << Verbose(2) << "Distances to Neighbour and OtherNeighbour are " << DistanceVector.x[component] << " and " << OtherVector.x[component] << "." << endl;
     98                  //Log() << Verbose(2) << "OtherComponents to Neighbour and OtherNeighbour are " << DistanceVector.x[Othercomponent] << " and " << OtherVector.x[Othercomponent] << "." << endl;
    9899                  // do linear interpolation between points (is exact) to extract exact intersection between Neighbour and OtherNeighbour
    99100                  w1 = fabs(OtherVector.x[Othercomponent]);
     
    102103                      * OtherVector.x[component]) / (w1 + w2));
    103104                  // mark if it has greater diameter
    104                   //*out << Verbose(2) << "Comparing current greatest " << GreatestDiameter[component] << " to new " << tmp << "." << endl;
     105                  //Log() << Verbose(2) << "Comparing current greatest " << GreatestDiameter[component] << " to new " << tmp << "." << endl;
    105106                  GreatestDiameter[component] = (GreatestDiameter[component]
    106107                      > tmp) ? GreatestDiameter[component] : tmp;
    107108                } //else
    108               //*out << Verbose(2) << "Saw no sign flip, probably top or bottom node." << endl;
     109              //Log() << Verbose(2) << "Saw no sign flip, probably top or bottom node." << endl;
    109110            }
    110111        }
    111112    }
    112   *out << Verbose(0) << "RESULT: The biggest diameters are "
     113  Log() << Verbose(0) << "RESULT: The biggest diameters are "
    113114      << GreatestDiameter[0] << " and " << GreatestDiameter[1] << " and "
    114115      << GreatestDiameter[2] << " " << (IsAngstroem ? "angstrom"
     
    132133 * \param *&TesselStruct pointer to Tesselation structure
    133134 */
    134 Boundaries *GetBoundaryPoints(ofstream *out, const molecule *mol, Tesselation *&TesselStruct)
     135Boundaries *GetBoundaryPoints(const molecule *mol, Tesselation *&TesselStruct)
    135136{
    136137  atom *Walker = NULL;
     
    138139  LineMap LinesOnBoundary;
    139140  TriangleMap TrianglesOnBoundary;
    140   Vector *MolCenter = mol->DetermineCenterOfAll(out);
     141  Vector *MolCenter = mol->DetermineCenterOfAll();
    141142  Vector helper;
    142143  BoundariesTestPair BoundaryTestPair;
     
    148149  double angle = 0.;
    149150
    150   *out << Verbose(1) << "Finding all boundary points." << endl;
     151  Log() << Verbose(1) << "Finding all boundary points." << endl;
    151152  // 3a. Go through every axis
    152153  for (int axis = 0; axis < NDIM; axis++) {
     
    158159    AngleReferenceNormalVector.x[(axis + 2) % NDIM] = 1.;
    159160
    160     *out << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl;
     161    Log() << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl;
    161162
    162163    // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours
     
    175176        angle = 0.; // otherwise it's a vector in Axis Direction and unimportant for boundary issues
    176177
    177       //*out << "Checking sign in quadrant : " << ProjectedVector.Projection(&AngleReferenceNormalVector) << "." << endl;
     178      //Log() << Verbose(0) << "Checking sign in quadrant : " << ProjectedVector.Projection(&AngleReferenceNormalVector) << "." << endl;
    178179      if (ProjectedVector.ScalarProduct(&AngleReferenceNormalVector) > 0) {
    179180        angle = 2. * M_PI - angle;
    180181      }
    181       *out << Verbose(2) << "Inserting " << *Walker << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl;
     182      Log() << Verbose(2) << "Inserting " << *Walker << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl;
    182183      BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, DistancePair (radius, Walker)));
    183184      if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity
    184         *out << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl;
    185         *out << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl;
    186         *out << Verbose(2) << "New vector: " << *Walker << endl;
     185        Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl;
     186        Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl;
     187        Log() << Verbose(2) << "New vector: " << *Walker << endl;
    187188        const double ProjectedVectorNorm = ProjectedVector.NormSquared();
    188189        if ((ProjectedVectorNorm - BoundaryTestPair.first->second.first) > MYEPSILON) {
    189190          BoundaryTestPair.first->second.first = ProjectedVectorNorm;
    190191          BoundaryTestPair.first->second.second = Walker;
    191           *out << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;
     192          Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;
    192193        } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) {
    193194          helper.CopyVector(&Walker->x);
     
    198199          if (helper.NormSquared() < oldhelperNorm) {
    199200            BoundaryTestPair.first->second.second = Walker;
    200             *out << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl;
     201            Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl;
    201202          } else {
    202             *out << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl;
     203            Log() << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl;
    203204          }
    204205        } else {
    205           *out << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;
     206          Log() << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;
    206207        }
    207208      }
     
    209210    // printing all inserted for debugging
    210211    //    {
    211     //      *out << Verbose(2) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;
     212    //      Log() << Verbose(2) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;
    212213    //      int i=0;
    213214    //      for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    214215    //        if (runner != BoundaryPoints[axis].begin())
    215     //          *out << ", " << i << ": " << *runner->second.second;
     216    //          Log() << Verbose(0) << ", " << i << ": " << *runner->second.second;
    216217    //        else
    217     //          *out << i << ": " << *runner->second.second;
     218    //          Log() << Verbose(0) << i << ": " << *runner->second.second;
    218219    //        i++;
    219220    //      }
    220     //      *out << endl;
     221    //      Log() << Verbose(0) << endl;
    221222    //    }
    222223    // 3c. throw out points whose distance is less than the mean of left and right neighbours
    223224    bool flag = false;
    224     *out << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl;
     225    Log() << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl;
    225226    do { // do as long as we still throw one out per round
    226227      flag = false;
     
    248249          SideA.SubtractVector(MolCenter);
    249250          SideA.ProjectOntoPlane(&AxisVector);
    250           //          *out << "SideA: ";
     251          //          Log() << Verbose(0) << "SideA: ";
    251252          //          SideA.Output(out);
    252           //          *out << endl;
     253          //          Log() << Verbose(0) << endl;
    253254
    254255          SideB.CopyVector(&right->second.second->x);
    255256          SideB.SubtractVector(MolCenter);
    256257          SideB.ProjectOntoPlane(&AxisVector);
    257           //          *out << "SideB: ";
     258          //          Log() << Verbose(0) << "SideB: ";
    258259          //          SideB.Output(out);
    259           //          *out << endl;
     260          //          Log() << Verbose(0) << endl;
    260261
    261262          SideC.CopyVector(&left->second.second->x);
    262263          SideC.SubtractVector(&right->second.second->x);
    263264          SideC.ProjectOntoPlane(&AxisVector);
    264           //          *out << "SideC: ";
     265          //          Log() << Verbose(0) << "SideC: ";
    265266          //          SideC.Output(out);
    266           //          *out << endl;
     267          //          Log() << Verbose(0) << endl;
    267268
    268269          SideH.CopyVector(&runner->second.second->x);
    269270          SideH.SubtractVector(MolCenter);
    270271          SideH.ProjectOntoPlane(&AxisVector);
    271           //          *out << "SideH: ";
     272          //          Log() << Verbose(0) << "SideH: ";
    272273          //          SideH.Output(out);
    273           //          *out << endl;
     274          //          Log() << Verbose(0) << endl;
    274275
    275276          // calculate each length
     
    284285          const double delta = SideC.Angle(&SideH);
    285286          const double MinDistance = a * sin(beta) / (sin(delta)) * (((alpha < M_PI / 2.) || (gamma < M_PI / 2.)) ? 1. : -1.);
    286           //*out << Verbose(2) << " I calculated: a = " << a << ", h = " << h << ", beta(" << left->second.second->Name << "," << left->second.second->Name << "-" << right->second.second->Name << ") = " << beta << ", delta(" << left->second.second->Name << "," << runner->second.second->Name << ") = " << delta << ", Min = " << MinDistance << "." << endl;
    287           *out << Verbose(1) << "Checking CoG distance of runner " << *runner->second.second << " " << h << " against triangle's side length spanned by (" << *left->second.second << "," << *right->second.second << ") of " << MinDistance << "." << endl;
     287          //Log() << Verbose(2) << " I calculated: a = " << a << ", h = " << h << ", beta(" << left->second.second->Name << "," << left->second.second->Name << "-" << right->second.second->Name << ") = " << beta << ", delta(" << left->second.second->Name << "," << runner->second.second->Name << ") = " << delta << ", Min = " << MinDistance << "." << endl;
     288          Log() << Verbose(1) << "Checking CoG distance of runner " << *runner->second.second << " " << h << " against triangle's side length spanned by (" << *left->second.second << "," << *right->second.second << ") of " << MinDistance << "." << endl;
    288289          if ((fabs(h / fabs(h) - MinDistance / fabs(MinDistance)) < MYEPSILON) && ((h - MinDistance)) < -MYEPSILON) {
    289290            // throw out point
    290             *out << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl;
     291            Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl;
    291292            BoundaryPoints[axis].erase(runner);
    292293            flag = true;
     
    308309 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename.
    309310 */
    310 void FindConvexBorder(ofstream *out, const molecule* mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename)
     311void FindConvexBorder(const molecule* mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename)
    311312{
    312313  bool BoundaryFreeFlag = false;
    313314  Boundaries *BoundaryPoints = NULL;
    314315
    315   cout << Verbose(1) << "Begin of FindConvexBorder" << endl;
     316  Log() << Verbose(1) << "Begin of FindConvexBorder" << endl;
    316317
    317318  if (TesselStruct != NULL) // free if allocated
     
    322323  if (BoundaryPoints == NULL) {
    323324      BoundaryFreeFlag = true;
    324       BoundaryPoints = GetBoundaryPoints(out, mol, TesselStruct);
     325      BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    325326  } else {
    326       *out << Verbose(1) << "Using given boundary points set." << endl;
     327      Log() << Verbose(1) << "Using given boundary points set." << endl;
    327328  }
    328329
     
    330331  for (int axis=0; axis < NDIM; axis++)
    331332    {
    332       *out << Verbose(2) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;
     333      Log() << Verbose(2) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;
    333334      int i=0;
    334335      for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    335336        if (runner != BoundaryPoints[axis].begin())
    336           *out << ", " << i << ": " << *runner->second.second;
     337          Log() << Verbose(0) << ", " << i << ": " << *runner->second.second;
    337338        else
    338           *out << i << ": " << *runner->second.second;
     339          Log() << Verbose(0) << i << ": " << *runner->second.second;
    339340        i++;
    340341      }
    341       *out << endl;
     342      Log() << Verbose(0) << endl;
    342343    }
    343344
     
    346347    for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++)
    347348        if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0))
    348           *out << Verbose(3) << "WARNING: Point " << *(runner->second.second) << " is already present!" << endl;
    349 
    350   *out << Verbose(2) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;
     349          Log() << Verbose(3) << "WARNING: Point " << *(runner->second.second) << " is already present!" << endl;
     350
     351  Log() << Verbose(2) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;
    351352  // now we have the whole set of edge points in the BoundaryList
    352353
    353354  // listing for debugging
    354   //  *out << Verbose(1) << "Listing PointsOnBoundary:";
     355  //  Log() << Verbose(1) << "Listing PointsOnBoundary:";
    355356  //  for(PointMap::iterator runner = PointsOnBoundary.begin(); runner != PointsOnBoundary.end(); runner++) {
    356   //    *out << " " << *runner->second;
     357  //    Log() << Verbose(0) << " " << *runner->second;
    357358  //  }
    358   //  *out << endl;
     359  //  Log() << Verbose(0) << endl;
    359360
    360361  // 3a. guess starting triangle
    361   TesselStruct->GuessStartingTriangle(out);
     362  TesselStruct->GuessStartingTriangle();
    362363
    363364  // 3b. go through all lines, that are not yet part of two triangles (only of one so far)
    364   TesselStruct->TesselateOnBoundary(out, mol);
     365  TesselStruct->TesselateOnBoundary(mol);
    365366
    366367  // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point
    367   if (!TesselStruct->InsertStraddlingPoints(out, mol, LCList))
    368     *out << Verbose(1) << "Insertion of straddling points failed!" << endl;
    369 
    370   *out << Verbose(2) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
     368  if (!TesselStruct->InsertStraddlingPoints(mol, LCList))
     369    Log() << Verbose(1) << "Insertion of straddling points failed!" << endl;
     370
     371  Log() << Verbose(2) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
    371372
    372373  // 4. Store triangles in tecplot file
     
    377378      OutputName.append(TecplotSuffix);
    378379      ofstream *tecplot = new ofstream(OutputName.c_str());
    379       WriteTecplotFile(out, tecplot, TesselStruct, mol, 0);
     380      WriteTecplotFile(tecplot, TesselStruct, mol, 0);
    380381      tecplot->close();
    381382      delete(tecplot);
     
    386387      OutputName.append(Raster3DSuffix);
    387388      ofstream *rasterplot = new ofstream(OutputName.c_str());
    388       WriteRaster3dFile(out, rasterplot, TesselStruct, mol);
     389      WriteRaster3dFile(rasterplot, TesselStruct, mol);
    389390      rasterplot->close();
    390391      delete(rasterplot);
     
    399400    for (LineMap::iterator LineRunner = TesselStruct->LinesOnBoundary.begin(); LineRunner != TesselStruct->LinesOnBoundary.end(); LineRunner++) {
    400401      line = LineRunner->second;
    401       *out << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
    402       if (!line->CheckConvexityCriterion(out)) {
    403         *out << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
     402      Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
     403      if (!line->CheckConvexityCriterion()) {
     404        Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
    404405
    405406        // flip the line
    406         if (TesselStruct->PickFarthestofTwoBaselines(out, line) == 0.)
    407           *out << Verbose(1) << "ERROR: Correction of concave baselines failed!" << endl;
     407        if (TesselStruct->PickFarthestofTwoBaselines(line) == 0.)
     408          Log() << Verbose(1) << "ERROR: Correction of concave baselines failed!" << endl;
    408409        else {
    409           TesselStruct->FlipBaseline(out, line);
    410           *out << Verbose(1) << "INFO: Correction of concave baselines worked." << endl;
     410          TesselStruct->FlipBaseline(line);
     411          Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl;
    411412        }
    412413      }
     
    416417  // 3e. we need another correction here, for TesselPoints that are below the surface (i.e. have an odd number of concave triangles surrounding it)
    417418//  if (!TesselStruct->CorrectConcaveTesselPoints(out))
    418 //    *out << Verbose(1) << "Correction of concave tesselpoints failed!" << endl;
    419 
    420   *out << Verbose(2) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
     419//    Log() << Verbose(1) << "Correction of concave tesselpoints failed!" << endl;
     420
     421  Log() << Verbose(2) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
    421422
    422423  // 4. Store triangles in tecplot file
     
    426427      OutputName.append(TecplotSuffix);
    427428      ofstream *tecplot = new ofstream(OutputName.c_str());
    428       WriteTecplotFile(out, tecplot, TesselStruct, mol, 0);
     429      WriteTecplotFile(tecplot, TesselStruct, mol, 0);
    429430      tecplot->close();
    430431      delete(tecplot);
     
    434435      OutputName.append(Raster3DSuffix);
    435436      ofstream *rasterplot = new ofstream(OutputName.c_str());
    436       WriteRaster3dFile(out, rasterplot, TesselStruct, mol);
     437      WriteRaster3dFile(rasterplot, TesselStruct, mol);
    437438      rasterplot->close();
    438439      delete(rasterplot);
     
    445446    delete[] (BoundaryPoints);
    446447
    447   cout << Verbose(1) << "End of FindConvexBorder" << endl;
     448  Log() << Verbose(1) << "End of FindConvexBorder" << endl;
    448449};
    449450
     
    455456 * \return true - all removed, false - something went wrong
    456457 */
    457 bool RemoveAllBoundaryPoints(ofstream *out, class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename)
     458bool RemoveAllBoundaryPoints(class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename)
    458459{
    459460  int i=0;
     
    461462
    462463  if ((TesselStruct == NULL) || (TesselStruct->PointsOnBoundary.empty())) {
    463     *out << Verbose(2) << "ERROR: TesselStruct is empty." << endl;
     464    Log() << Verbose(2) << "ERROR: TesselStruct is empty." << endl;
    464465    return false;
    465466  }
     
    467468  PointMap::iterator PointRunner;
    468469  while (!TesselStruct->PointsOnBoundary.empty()) {
    469     *out << Verbose(2) << "Remaining points are: ";
     470    Log() << Verbose(2) << "Remaining points are: ";
    470471    for (PointMap::iterator PointSprinter = TesselStruct->PointsOnBoundary.begin(); PointSprinter != TesselStruct->PointsOnBoundary.end(); PointSprinter++)
    471       *out << *(PointSprinter->second) << "\t";
    472       *out << endl;
     472      Log() << Verbose(0) << *(PointSprinter->second) << "\t";
     473    Log() << Verbose(0) << endl;
    473474
    474475    PointRunner = TesselStruct->PointsOnBoundary.begin();
    475476    // remove point
    476     TesselStruct->RemovePointFromTesselatedSurface(out, PointRunner->second);
     477    TesselStruct->RemovePointFromTesselatedSurface(PointRunner->second);
    477478
    478479    // store envelope
    479480    sprintf(number, "-%04d", i++);
    480     StoreTrianglesinFile(out, mol, (const Tesselation *&)TesselStruct, filename, number);
     481    StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, number);
    481482  }
    482483
     
    508509 * \return volume difference between the non- and the created convex envelope
    509510 */
    510 double ConvexizeNonconvexEnvelope(ofstream *out, class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename)
     511double ConvexizeNonconvexEnvelope(class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename)
    511512{
    512513  double volume = 0;
     
    523524  int run = 0;
    524525
    525   *out << Verbose(0) << "Begin of ConvexizeNonconvexEnvelope" << endl;
     526  Log() << Verbose(0) << "Begin of ConvexizeNonconvexEnvelope" << endl;
    526527
    527528  // check whether there is something to work on
    528529  if (TesselStruct == NULL) {
    529     *out << Verbose(1) << "ERROR: TesselStruct is empty!" << endl;
     530    Log() << Verbose(1) << "ERROR: TesselStruct is empty!" << endl;
    530531    return volume;
    531532  }
     
    535536    Concavity = false;
    536537    sprintf(dummy, "-first-%d", run);
    537     //CalculateConcavityPerBoundaryPoint(out, TesselStruct);
    538     StoreTrianglesinFile(out, mol, (const Tesselation *&)TesselStruct, filename, dummy);
     538    //CalculateConcavityPerBoundaryPoint(TesselStruct);
     539    StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, dummy);
    539540
    540541    PointRunner = TesselStruct->PointsOnBoundary.begin();
     
    543544      PointAdvance++;
    544545      point = PointRunner->second;
    545       *out << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
     546      Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
    546547      for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
    547548        line = LineRunner->second;
    548         *out << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;
    549         if (!line->CheckConvexityCriterion(out)) {
     549        Log() << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;
     550        if (!line->CheckConvexityCriterion()) {
    550551          // remove the point if needed
    551           *out << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl;
    552           volume += TesselStruct->RemovePointFromTesselatedSurface(out, point);
     552          Log() << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl;
     553          volume += TesselStruct->RemovePointFromTesselatedSurface(point);
    553554          sprintf(dummy, "-first-%d", ++run);
    554           StoreTrianglesinFile(out, mol, (const Tesselation *&)TesselStruct, filename, dummy);
     555          StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, dummy);
    555556          Concavity = true;
    556557          break;
     
    561562
    562563    sprintf(dummy, "-second-%d", run);
    563     //CalculateConcavityPerBoundaryPoint(out, TesselStruct);
    564     StoreTrianglesinFile(out, mol, (const Tesselation *&)TesselStruct, filename, dummy);
     564    //CalculateConcavityPerBoundaryPoint(TesselStruct);
     565    StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, dummy);
    565566
    566567    // second step: PickFarthestofTwoBaselines
     
    570571      LineAdvance++;
    571572      line = LineRunner->second;
    572       *out << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl;
     573      Log() << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl;
    573574      // take highest of both lines
    574       if (TesselStruct->IsConvexRectangle(out, line) == NULL) {
    575         const double tmp = TesselStruct->PickFarthestofTwoBaselines(out, line);
     575      if (TesselStruct->IsConvexRectangle(line) == NULL) {
     576        const double tmp = TesselStruct->PickFarthestofTwoBaselines(line);
    576577        volume += tmp;
    577578        if (tmp != 0.) {
    578           TesselStruct->FlipBaseline(out, line);
     579          TesselStruct->FlipBaseline(line);
    579580          Concavity = true;
    580581        }
     
    584585    run++;
    585586  } while (Concavity);
    586   //CalculateConcavityPerBoundaryPoint(out, TesselStruct);
    587   //StoreTrianglesinFile(out, mol, filename, "-third");
     587  //CalculateConcavityPerBoundaryPoint(TesselStruct);
     588  //StoreTrianglesinFile(mol, filename, "-third");
    588589
    589590  // third step: IsConvexRectangle
     
    593594//    LineAdvance++;
    594595//    line = LineRunner->second;
    595 //    *out << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
     596//    Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
    596597//    //if (LineAdvance != TesselStruct->LinesOnBoundary.end())
    597 //      //*out << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl;
     598//      //Log() << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl;
    598599//    if (!line->CheckConvexityCriterion(out)) {
    599 //      *out << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
     600//      Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
    600601//
    601602//      // take highest of both lines
    602 //      point = TesselStruct->IsConvexRectangle(out, line);
     603//      point = TesselStruct->IsConvexRectangle(line);
    603604//      if (point != NULL)
    604 //        volume += TesselStruct->RemovePointFromTesselatedSurface(out, point);
     605//        volume += TesselStruct->RemovePointFromTesselatedSurface(point);
    605606//    }
    606607//    LineRunner = LineAdvance;
    607608//  }
    608609
    609   CalculateConcavityPerBoundaryPoint(out, TesselStruct);
    610   StoreTrianglesinFile(out, mol, (const Tesselation *&)TesselStruct, filename, "");
     610  CalculateConcavityPerBoundaryPoint(TesselStruct);
     611  StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, "");
    611612
    612613  // end
    613   *out << Verbose(1) << "Volume is " << volume << "." << endl;
    614   *out << Verbose(0) << "End of ConvexizeNonconvexEnvelope" << endl;
     614  Log() << Verbose(1) << "Volume is " << volume << "." << endl;
     615  Log() << Verbose(0) << "End of ConvexizeNonconvexEnvelope" << endl;
    615616  return volume;
    616617};
     
    624625 * \return determined volume of the cluster in cubed config:GetIsAngstroem()
    625626 */
    626 double VolumeOfConvexEnvelope(ofstream *out, class Tesselation *TesselStruct, class config *configuration)
     627double VolumeOfConvexEnvelope(class Tesselation *TesselStruct, class config *configuration)
    627628{
    628629  bool IsAngstroem = configuration->GetIsAngstroem();
     
    632633
    633634  // 6a. Every triangle forms a pyramid with the center of gravity as its peak, sum up the volumes
    634   *out << Verbose(1)
     635  Log() << Verbose(1)
    635636      << "Calculating the volume of the pyramids formed out of triangles and center of gravity."
    636637      << endl;
     
    649650      const double h = x.Norm(); // distance of CoG to triangle
    650651      const double PyramidVolume = (1. / 3.) * G * h; // this formula holds for _all_ pyramids (independent of n-edge base or (not) centered peak)
    651       *out << Verbose(2) << "Area of triangle is " << setprecision(10) << G << " "
     652      Log() << Verbose(2) << "Area of triangle is " << setprecision(10) << G << " "
    652653          << (IsAngstroem ? "angstrom" : "atomiclength") << "^2, height is "
    653654          << h << " and the volume is " << PyramidVolume << " "
     
    655656      volume += PyramidVolume;
    656657    }
    657   *out << Verbose(0) << "RESULT: The summed volume is " << setprecision(6)
     658  Log() << Verbose(0) << "RESULT: The summed volume is " << setprecision(8)
    658659      << volume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3."
    659660      << endl;
     
    669670 * \param *extraSuffix intermediate suffix
    670671 */
    671 void StoreTrianglesinFile(ofstream *out, const molecule * const mol, const Tesselation *&TesselStruct, const char *filename, const char *extraSuffix)
     672void StoreTrianglesinFile(const molecule * const mol, const Tesselation *&TesselStruct, const char *filename, const char *extraSuffix)
    672673{
    673674  // 4. Store triangles in tecplot file
     
    678679      OutputName.append(TecplotSuffix);
    679680      ofstream *tecplot = new ofstream(OutputName.c_str());
    680       WriteTecplotFile(out, tecplot, TesselStruct, mol, 0);
     681      WriteTecplotFile(tecplot, TesselStruct, mol, 0);
    681682      tecplot->close();
    682683      delete(tecplot);
     
    687688      OutputName.append(Raster3DSuffix);
    688689      ofstream *rasterplot = new ofstream(OutputName.c_str());
    689       WriteRaster3dFile(out, rasterplot, TesselStruct, mol);
     690      WriteRaster3dFile(rasterplot, TesselStruct, mol);
    690691      rasterplot->close();
    691692      delete(rasterplot);
     
    703704 * \param celldensity desired average density in final cell
    704705 */
    705 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity)
     706void PrepareClustersinWater(config *configuration, molecule *mol, double ClusterVolume, double celldensity)
    706707{
    707708  bool IsAngstroem = true;
     
    718719
    719720  // transform to PAS
    720   mol->PrincipalAxisSystem(out, true);
     721  mol->PrincipalAxisSystem(true);
    721722
    722723  IsAngstroem = configuration->GetIsAngstroem();
    723   GreatestDiameter = GetDiametersOfCluster(out, BoundaryPoints, mol, TesselStruct, IsAngstroem);
    724   BoundaryPoints = GetBoundaryPoints(out, mol, TesselStruct);
     724  GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem);
     725  BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    725726  LinkedCell LCList(mol, 10.);
    726   FindConvexBorder(out, mol, TesselStruct, &LCList, NULL);
     727  FindConvexBorder(mol, TesselStruct, &LCList, NULL);
    727728
    728729  // some preparations beforehand
    729730  if (ClusterVolume == 0)
    730     clustervolume = VolumeOfConvexEnvelope(out, TesselStruct, configuration);
     731    clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration);
    731732  else
    732733    clustervolume = ClusterVolume;
     
    741742      totalmass += Walker->type->mass;
    742743  }
    743   *out << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl;
    744   *out << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     744  Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl;
     745  Log() << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
    745746
    746747  // solve cubic polynomial
    747   *out << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl;
     748  Log() << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl;
    748749  if (IsAngstroem)
    749750    cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_A - (totalmass / clustervolume)) / (celldensity - 1);
    750751  else
    751752    cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_a0 - (totalmass / clustervolume)) / (celldensity - 1);
    752   *out << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     753  Log() << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
    753754
    754755  double minimumvolume = TotalNoClusters * (GreatestDiameter[0] * GreatestDiameter[1] * GreatestDiameter[2]);
    755   *out << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     756  Log() << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
    756757  if (minimumvolume > cellvolume) {
    757     cerr << Verbose(0) << "ERROR: the containing box already has a greater volume than the envisaged cell volume!" << endl;
    758     cout << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl;
     758    eLog() << Verbose(0) << "ERROR: the containing box already has a greater volume than the envisaged cell volume!" << endl;
     759    Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl;
    759760    for (int i = 0; i < NDIM; i++)
    760761      BoxLengths.x[i] = GreatestDiameter[i];
    761     mol->CenterEdge(out, &BoxLengths);
     762    mol->CenterEdge(&BoxLengths);
    762763  } else {
    763764    BoxLengths.x[0] = (repetition[0] * GreatestDiameter[0] + repetition[1] * GreatestDiameter[1] + repetition[2] * GreatestDiameter[2]);
     
    768769    double x2 = 0.;
    769770    if (gsl_poly_solve_cubic(BoxLengths.x[0], BoxLengths.x[1], BoxLengths.x[2], &x0, &x1, &x2) == 1) // either 1 or 3 on return
    770       *out << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl;
     771      Log() << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl;
    771772    else {
    772       *out << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl;
     773      Log() << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl;
    773774      x0 = x2; // sorted in ascending order
    774775    }
     
    781782
    782783    // set new box dimensions
    783     *out << Verbose(0) << "Translating to box with these boundaries." << endl;
     784    Log() << Verbose(0) << "Translating to box with these boundaries." << endl;
    784785    mol->SetBoxDimension(&BoxLengths);
    785     mol->CenterInBox((ofstream *) &cout);
     786    mol->CenterInBox();
    786787  }
    787788  // update Box of atoms by boundary
    788789  mol->SetBoxDimension(&BoxLengths);
    789   *out << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     790  Log() << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
    790791};
    791792
     
    803804 * \return *mol pointer to new molecule with filled atoms
    804805 */
    805 molecule * FillBoxWithMolecule(ofstream *out, MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandomAtomDisplacement, double RandomMolDisplacement, bool DoRandomRotation)
     806molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandomAtomDisplacement, double RandomMolDisplacement, bool DoRandomRotation)
    806807{
    807808  molecule *Filling = new molecule(filler->elemente);
     
    822823  class Tesselation *TesselStruct[List->ListOfMolecules.size()];
    823824
    824   *out << Verbose(0) << "Begin of FillBoxWithMolecule" << endl;
     825  Log() << Verbose(0) << "Begin of FillBoxWithMolecule" << endl;
    825826
    826827  i=0;
    827828  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
    828     *out << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl;
     829    Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl;
    829830    LCList[i] = new LinkedCell((*ListRunner), 5.); // get linked cell list
    830831    if (TesselStruct[i] == NULL) {
    831       *out << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
    832       FindNonConvexBorder((ofstream *)&cout, (*ListRunner), TesselStruct[i], (const LinkedCell *&)LCList[i], 5., NULL);
     832      Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
     833      FindNonConvexBorder((*ListRunner), TesselStruct[i], (const LinkedCell *&)LCList[i], 5., NULL);
    833834    }
    834835    i++;
     
    836837
    837838  // Center filler at origin
    838   filler->CenterOrigin(out);
     839  filler->CenterOrigin();
    839840  filler->Center.Zero();
    840841
    841   filler->CountAtoms(out);
     842  filler->CountAtoms();
    842843  atom * CopyAtoms[filler->AtomCount];
    843844
     
    845846  FillerDistance.Init(distance[0], distance[1], distance[2]);
    846847  FillerDistance.InverseMatrixMultiplication(M);
    847   *out << Verbose(1) << "INFO: Grid steps are ";
     848  Log() << Verbose(1) << "INFO: Grid steps are ";
    848849  for(int i=0;i<NDIM;i++) {
    849850    N[i] = (int) ceil(1./FillerDistance.x[i]);
    850     *out << N[i];
     851    Log() << Verbose(0) << N[i];
    851852    if (i != NDIM-1)
    852       *out<< ", ";
     853      Log() << Verbose(0)<< ", ";
    853854    else
    854       *out << "." << endl;
     855      Log() << Verbose(0) << "." << endl;
    855856  }
    856857
     
    862863        CurrentPosition.Init((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]);
    863864        CurrentPosition.MatrixMultiplication(M);
    864         *out << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "." << endl;
     865        Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "." << endl;
    865866        // Check whether point is in- or outside
    866867        FillIt = true;
     
    869870          // get linked cell list
    870871          if (TesselStruct[i] == NULL) {
    871             *out << Verbose(1) << "ERROR: TesselStruct of " << (*ListRunner) << " is NULL. Didn't we pre-create it?" << endl;
     872            Log() << Verbose(1) << "ERROR: TesselStruct of " << (*ListRunner) << " is NULL. Didn't we pre-create it?" << endl;
    872873            FillIt = false;
    873874          } else {
    874             FillIt = FillIt && (!TesselStruct[i]->IsInnerPoint(out, CurrentPosition, LCList[i]));
     875            FillIt = FillIt && (!TesselStruct[i]->IsInnerPoint(CurrentPosition, LCList[i]));
    875876            i++;
    876877          }
     
    879880        if (FillIt) {
    880881          // fill in Filler
    881           *out << Verbose(2) << "Space at " << CurrentPosition << " is unoccupied by any molecule, filling in." << endl;
     882          Log() << Verbose(2) << "Space at " << CurrentPosition << " is unoccupied by any molecule, filling in." << endl;
    882883
    883884          // create molecule random translation vector ...
    884885          for (int i=0;i<NDIM;i++)
    885886            FillerTranslations.x[i] = RandomMolDisplacement*(rand()/(RAND_MAX/2.) - 1.);
    886           *out << Verbose(3) << "INFO: Translating this filler by " << FillerTranslations << "." << endl;
     887          Log() << Verbose(3) << "INFO: Translating this filler by " << FillerTranslations << "." << endl;
    887888
    888889          // go through all atoms
     
    924925
    925926            // FIXME: gives completely different results if CopyAtoms[..] used instead of Walker, why???
    926             *out << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;
     927            Log() << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;
    927928            Filling->AddAtom(CopyAtoms[Walker->nr]);
    928929          }
     
    932933          while(Binder->next != filler->last) {
    933934            Binder = Binder->next;
    934             *out << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;
     935            Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;
    935936            Filling->AddBond(CopyAtoms[Binder->leftatom->nr], CopyAtoms[Binder->rightatom->nr], Binder->BondDegree);
    936937          }
    937938        } else {
    938939          // leave empty
    939           *out << Verbose(2) << "Space at " << CurrentPosition << " is occupied." << endl;
     940          Log() << Verbose(2) << "Space at " << CurrentPosition << " is occupied." << endl;
    940941        }
    941942      }
    942   *out << Verbose(0) << "End of FillBoxWithMolecule" << endl;
     943  Log() << Verbose(0) << "End of FillBoxWithMolecule" << endl;
    943944
    944945  return Filling;
     
    954955 * \param *filename filename prefix for output of vertex data
    955956 */
    956 void FindNonConvexBorder(ofstream *out, const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)
     957void FindNonConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)
    957958{
    958959  bool freeLC = false;
     
    962963  bool TesselationFailFlag = false;
    963964
    964   *out << Verbose(1) << "Entering search for non convex hull. " << endl;
     965  Log() << Verbose(1) << "Entering search for non convex hull. " << endl;
    965966  if (TesselStruct == NULL) {
    966     *out << Verbose(1) << "Allocating Tesselation struct ..." << endl;
     967    Log() << Verbose(1) << "Allocating Tesselation struct ..." << endl;
    967968    TesselStruct= new Tesselation;
    968969  } else {
    969970    delete(TesselStruct);
    970     *out << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl;
     971    Log() << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl;
    971972    TesselStruct = new Tesselation;
    972973  }
    973974
    974   *out << Verbose(0) << "Begin of FindNonConvexBorder\n";
     975  Log() << Verbose(0) << "Begin of FindNonConvexBorder\n";
    975976
    976977  // initialise Linked Cell
     
    981982
    982983  // 1. get starting triangle
    983   TesselStruct->FindStartingTriangle(out, RADIUS, LCList);
     984  TesselStruct->FindStartingTriangle(RADIUS, LCList);
    984985
    985986  // 2. expand from there
     
    989990    if (baseline->second->triangles.size() == 1) {
    990991      // 3. find next triangle
    991       TesselationFailFlag = TesselStruct->FindNextSuitableTriangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, LCList); //the line is there, so there is a triangle, but only one.
     992      TesselationFailFlag = TesselStruct->FindNextSuitableTriangle(*(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, LCList); //the line is there, so there is a triangle, but only one.
    992993      OneLoopWithoutSuccessFlag = OneLoopWithoutSuccessFlag || TesselationFailFlag;
    993994      if (!TesselationFailFlag)
    994         cerr << "WARNING: FindNextSuitableTriangle failed." << endl;
     995        eLog() << Verbose(0) << "WARNING: FindNextSuitableTriangle failed." << endl;
    995996
    996997      // write temporary envelope
    997998      if (filename != NULL) {
    998999        if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration
    999           TesselStruct->Output(out, filename, mol);
     1000          TesselStruct->Output(filename, mol);
    10001001        }
    10011002      }
    10021003      baseline = TesselStruct->LinesOnBoundary.end();
    1003       *out << Verbose(2) << "Baseline set to end." << endl;
     1004      Log() << Verbose(2) << "Baseline set to end." << endl;
    10041005    } else {
    1005       //cout << Verbose(1) << "Line " << *baseline->second << " has " << baseline->second->triangles.size() << " triangles adjacent" << endl;
     1006      //Log() << Verbose(1) << "Line " << *baseline->second << " has " << baseline->second->triangles.size() << " triangles adjacent" << endl;
    10061007      if (baseline->second->triangles.size() != 2)
    1007         *out << Verbose(1) << "ERROR: TESSELATION FINISHED WITH INVALID TRIANGLE COUNT!" << endl;
     1008        Log() << Verbose(1) << "ERROR: TESSELATION FINISHED WITH INVALID TRIANGLE COUNT!" << endl;
    10081009    }
    10091010
     
    10151016  }
    10161017  // check envelope for consistency
    1017   CheckListOfBaselines(out, TesselStruct);
     1018  CheckListOfBaselines(TesselStruct);
    10181019
    10191020  // look whether all points are inside of the convex envelope, otherwise add them via degenerated triangles
    1020   //->InsertStraddlingPoints(out, mol, LCList);
     1021  //->InsertStraddlingPoints(mol, LCList);
    10211022//  mol->GoToFirst();
    10221023//  class TesselPoint *Runner = NULL;
    10231024//  while (!mol->IsEnd()) {
    10241025//    Runner = mol->GetPoint();
    1025 //    *out << Verbose(1) << "Checking on " << Runner->Name << " ... " << endl;
    1026 //    if (!->IsInnerPoint(out, Runner, LCList)) {
    1027 //      *out << Verbose(2) << Runner->Name << " is outside of envelope, adding via degenerated triangles." << endl;
    1028 //      ->AddBoundaryPointByDegeneratedTriangle(out, Runner, LCList);
     1026//    Log() << Verbose(1) << "Checking on " << Runner->Name << " ... " << endl;
     1027//    if (!->IsInnerPoint(Runner, LCList)) {
     1028//      Log() << Verbose(2) << Runner->Name << " is outside of envelope, adding via degenerated triangles." << endl;
     1029//      ->AddBoundaryPointByDegeneratedTriangle(Runner, LCList);
    10291030//    } else {
    1030 //      *out << Verbose(2) << Runner->Name << " is inside of or on envelope." << endl;
     1031//      Log() << Verbose(2) << Runner->Name << " is inside of or on envelope." << endl;
    10311032//    }
    10321033//    mol->GoToNext();
     
    10371038
    10381039  // check envelope for consistency
    1039   CheckListOfBaselines(out, TesselStruct);
     1040  CheckListOfBaselines(TesselStruct);
    10401041
    10411042  // write final envelope
    1042   CalculateConcavityPerBoundaryPoint(out, TesselStruct);
    1043   StoreTrianglesinFile(out, mol, (const Tesselation *&)TesselStruct, filename, "");
     1043  CalculateConcavityPerBoundaryPoint(TesselStruct);
     1044  StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, "");
    10441045
    10451046  if (freeLC)
    10461047    delete(LCList);
    1047   *out << Verbose(0) << "End of FindNonConvexBorder\n";
     1048  Log() << Verbose(0) << "End of FindNonConvexBorder\n";
    10481049};
    10491050
     
    10551056 * \return *Vector new center of \a *srcmol for embedding relative to \a this
    10561057 */
    1057 Vector* FindEmbeddingHole(ofstream *out, MoleculeListClass *mols, molecule *srcmol)
     1058Vector* FindEmbeddingHole(MoleculeListClass *mols, molecule *srcmol)
    10581059{
    10591060  Vector *Center = new Vector;
Note: See TracChangeset for help on using the changeset viewer.