Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_geometry.cpp

    ra67d19 r1614174  
    1515#include "memoryallocator.hpp"
    1616#include "molecule.hpp"
    17 #include "World.hpp"
    1817
    1918/************************************* Functions for class molecule *********************************/
     
    2726  bool status = true;
    2827  const Vector *Center = DetermineCenterOfAll();
    29   double * const cell_size = World::get()->cell_size;
    3028  double *M = ReturnFullMatrixforSymmetric(cell_size);
    3129  double *Minv = InverseMatrix(M);
     
    4846{
    4947  bool status = true;
    50   double * const cell_size = World::get()->cell_size;
    5148  double *M = ReturnFullMatrixforSymmetric(cell_size);
    5249  double *Minv = InverseMatrix(M);
     
    104101{
    105102  int Num = 0;
    106   atom *ptr = start;  // start at first in list
     103  atom *ptr = start->next;  // start at first in list
    107104
    108105  Center.Zero();
    109106
    110   if (ptr->next != end) {   //list not empty?
     107  if (ptr != end) {   //list not empty?
    111108    while (ptr->next != end) {  // continue with second if present
    112109      ptr = ptr->next;
     
    229226void molecule::TranslatePeriodically(const Vector *trans)
    230227{
    231   double * const cell_size = World::get()->cell_size;
    232228  double *M = ReturnFullMatrixforSymmetric(cell_size);
    233229  double *Minv = InverseMatrix(M);
     
    256252{
    257253  atom *Walker = start;
    258   double * const cell_size = World::get()->cell_size;
    259254  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
    260255  double *inversematrix = InverseMatrix(cell_size);
     
    280275              if ((fabs(tmp)) > BondDistance) {
    281276                flag = false;
    282                 DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
     277                Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl;
    283278                if (tmp > 0)
    284279                  Translationvector.x[j] -= 1.;
     
    291286        Testvector.MatrixMultiplication(matrix);
    292287        Center.AddVector(&Testvector);
    293         DoLog(1) && (Log() << Verbose(1) << "vector is: ");
     288        Log() << Verbose(1) << "vector is: ";
    294289        Testvector.Output();
    295         DoLog(0) && (Log() << Verbose(0) << endl);
     290        Log() << Verbose(0) << endl;
    296291#ifdef ADDHYDROGEN
    297292        // now also change all hydrogens
     
    303298            Testvector.MatrixMultiplication(matrix);
    304299            Center.AddVector(&Testvector);
    305             DoLog(1) && (Log() << Verbose(1) << "Hydrogen vector is: ");
     300            Log() << Verbose(1) << "Hydrogen vector is: ";
    306301            Testvector.Output();
    307             DoLog(0) && (Log() << Verbose(0) << endl);
     302            Log() << Verbose(0) << endl;
    308303          }
    309304        }
     
    352347  }
    353348  // print InertiaTensor for debugging
    354   DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
     349  Log() << Verbose(0) << "The inertia tensor is:" << endl;
    355350  for(int i=0;i<NDIM;i++) {
    356351    for(int j=0;j<NDIM;j++)
    357       DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
    358     DoLog(0) && (Log() << Verbose(0) << endl);
    359   }
    360   DoLog(0) && (Log() << Verbose(0) << endl);
     352      Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";
     353    Log() << Verbose(0) << endl;
     354  }
     355  Log() << Verbose(0) << endl;
    361356
    362357  // diagonalize to determine principal axis system
     
    370365
    371366  for(int i=0;i<NDIM;i++) {
    372     DoLog(1) && (Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i));
    373     DoLog(0) && (Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl);
     367    Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i);
     368    Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl;
    374369  }
    375370
    376371  // check whether we rotate or not
    377372  if (DoRotate) {
    378     DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... ");
     373    Log() << Verbose(1) << "Transforming molecule into PAS ... ";
    379374    // the eigenvectors specify the transformation matrix
    380375    ActOnAllVectors( &Vector::MatrixMultiplication, (const double *) evec->data );
    381     DoLog(0) && (Log() << Verbose(0) << "done." << endl);
     376    Log() << Verbose(0) << "done." << endl;
    382377
    383378    // summing anew for debugging (resulting matrix has to be diagonal!)
     
    404399    }
    405400    // print InertiaTensor for debugging
    406     DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
     401    Log() << Verbose(0) << "The inertia tensor is:" << endl;
    407402    for(int i=0;i<NDIM;i++) {
    408403      for(int j=0;j<NDIM;j++)
    409         DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
    410       DoLog(0) && (Log() << Verbose(0) << endl);
    411     }
    412     DoLog(0) && (Log() << Verbose(0) << endl);
     404        Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";
     405      Log() << Verbose(0) << endl;
     406    }
     407    Log() << Verbose(0) << endl;
    413408  }
    414409
     
    433428
    434429  // rotate on z-x plane
    435   DoLog(0) && (Log() << Verbose(0) << "Begin of Aligning all atoms." << endl);
     430  Log() << Verbose(0) << "Begin of Aligning all atoms." << endl;
    436431  alpha = atan(-n->x[0]/n->x[2]);
    437   DoLog(1) && (Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ");
     432  Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ";
    438433  while (ptr->next != end) {
    439434    ptr = ptr->next;
     
    451446  n->x[0] =  cos(alpha) * tmp +  sin(alpha) * n->x[2];
    452447  n->x[2] = -sin(alpha) * tmp +  cos(alpha) * n->x[2];
    453   DoLog(1) && (Log() << Verbose(1) << "alignment vector after first rotation: ");
     448  Log() << Verbose(1) << "alignment vector after first rotation: ";
    454449  n->Output();
    455   DoLog(0) && (Log() << Verbose(0) << endl);
     450  Log() << Verbose(0) << endl;
    456451
    457452  // rotate on z-y plane
    458453  ptr = start;
    459454  alpha = atan(-n->x[1]/n->x[2]);
    460   DoLog(1) && (Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ");
     455  Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ";
    461456  while (ptr->next != end) {
    462457    ptr = ptr->next;
     
    475470  n->x[2] = -sin(alpha) * tmp +  cos(alpha) * n->x[2];
    476471
    477   DoLog(1) && (Log() << Verbose(1) << "alignment vector after second rotation: ");
     472  Log() << Verbose(1) << "alignment vector after second rotation: ";
    478473  n->Output();
    479   DoLog(1) && (Log() << Verbose(1) << endl);
    480   DoLog(0) && (Log() << Verbose(0) << "End of Aligning all atoms." << endl);
     474  Log() << Verbose(1) << endl;
     475  Log() << Verbose(0) << "End of Aligning all atoms." << endl;
    481476};
    482477
Note: See TracChangeset for help on using the changeset viewer.