Ignore:
Timestamp:
Apr 27, 2010, 2:25:42 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
90c4460
Parents:
1561e2 (diff), 2bc713 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'Analysis_PairCorrelation' into StructureRefactoring

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/World.cpp
molecuilder/src/World.hpp
molecuilder/src/boundary.cpp
molecuilder/src/builder.cpp
molecuilder/src/log.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/periodentafel.cpp
molecuilder/src/tesselation.cpp
molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
molecuilder/src/unittests/Makefile.am
molecuilder/src/unittests/bondgraphunittest.cpp
molecuilder/src/unittests/gslvectorunittest.cpp
molecuilder/src/unittests/logunittest.cpp
molecuilder/src/unittests/tesselation_boundarytriangleunittest.hpp
molecuilder/src/vector.cpp
molecuilder/tests/Tesselations/defs.in

Conflicts have been many and too numerous to listen here, just the few general cases

  • new molecule() replaced by World::getInstance().createMolecule()
  • new atom() replaced by World::getInstance().createAtom() where appropriate.
  • Some DoLog()s added interfered with changes to the message produced by Log() << Verbose(.) << ...
  • DoLog() has been erroneously added to TestRunner.cpp as well, there cout is appropriate
  • ...

Additionally, there was a bug in atom::clone(), sort was set to atom::nr of the atom to clone not of the clone itself. This caused a failure of the fragmentation.

This merge has been fully checked from a clean build directory with subsequent configure,make all install and make check.
It configures, compiles and runs all test cases and the test suite without errors.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule_geometry.cpp

    r1561e2 r075729  
    1515#include "memoryallocator.hpp"
    1616#include "molecule.hpp"
     17#include "World.hpp"
    1718
    1819/************************************* Functions for class molecule *********************************/
     
    2627  bool status = true;
    2728  const Vector *Center = DetermineCenterOfAll();
     29  double * const cell_size = World::getInstance().getDomain();
    2830  double *M = ReturnFullMatrixforSymmetric(cell_size);
    2931  double *Minv = InverseMatrix(M);
     
    4648{
    4749  bool status = true;
     50  double * const cell_size = World::getInstance().getDomain();
    4851  double *M = ReturnFullMatrixforSymmetric(cell_size);
    4952  double *Minv = InverseMatrix(M);
     
    226229void molecule::TranslatePeriodically(const Vector *trans)
    227230{
     231  double * const cell_size = World::getInstance().getDomain();
    228232  double *M = ReturnFullMatrixforSymmetric(cell_size);
    229233  double *Minv = InverseMatrix(M);
     
    252256{
    253257  atom *Walker = start;
     258  double * const cell_size = World::getInstance().getDomain();
    254259  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
    255260  double *inversematrix = InverseMatrix(cell_size);
     
    275280              if ((fabs(tmp)) > BondDistance) {
    276281                flag = false;
    277                 Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl;
     282                DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
    278283                if (tmp > 0)
    279284                  Translationvector.x[j] -= 1.;
     
    286291        Testvector.MatrixMultiplication(matrix);
    287292        Center.AddVector(&Testvector);
    288         Log() << Verbose(1) << "vector is: ";
     293        DoLog(1) && (Log() << Verbose(1) << "vector is: ");
    289294        Testvector.Output();
    290         Log() << Verbose(0) << endl;
     295        DoLog(0) && (Log() << Verbose(0) << endl);
    291296#ifdef ADDHYDROGEN
    292297        // now also change all hydrogens
     
    298303            Testvector.MatrixMultiplication(matrix);
    299304            Center.AddVector(&Testvector);
    300             Log() << Verbose(1) << "Hydrogen vector is: ";
     305            DoLog(1) && (Log() << Verbose(1) << "Hydrogen vector is: ");
    301306            Testvector.Output();
    302             Log() << Verbose(0) << endl;
     307            DoLog(0) && (Log() << Verbose(0) << endl);
    303308          }
    304309        }
     
    347352  }
    348353  // print InertiaTensor for debugging
    349   Log() << Verbose(0) << "The inertia tensor is:" << endl;
     354  DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
    350355  for(int i=0;i<NDIM;i++) {
    351356    for(int j=0;j<NDIM;j++)
    352       Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";
    353     Log() << Verbose(0) << endl;
    354   }
    355   Log() << Verbose(0) << endl;
     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);
    356361
    357362  // diagonalize to determine principal axis system
     
    365370
    366371  for(int i=0;i<NDIM;i++) {
    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;
     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);
    369374  }
    370375
    371376  // check whether we rotate or not
    372377  if (DoRotate) {
    373     Log() << Verbose(1) << "Transforming molecule into PAS ... ";
     378    DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... ");
    374379    // the eigenvectors specify the transformation matrix
    375380    ActOnAllVectors( &Vector::MatrixMultiplication, (const double *) evec->data );
    376     Log() << Verbose(0) << "done." << endl;
     381    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    377382
    378383    // summing anew for debugging (resulting matrix has to be diagonal!)
     
    399404    }
    400405    // print InertiaTensor for debugging
    401     Log() << Verbose(0) << "The inertia tensor is:" << endl;
     406    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
    402407    for(int i=0;i<NDIM;i++) {
    403408      for(int j=0;j<NDIM;j++)
    404         Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";
    405       Log() << Verbose(0) << endl;
    406     }
    407     Log() << Verbose(0) << endl;
     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);
    408413  }
    409414
     
    428433
    429434  // rotate on z-x plane
    430   Log() << Verbose(0) << "Begin of Aligning all atoms." << endl;
     435  DoLog(0) && (Log() << Verbose(0) << "Begin of Aligning all atoms." << endl);
    431436  alpha = atan(-n->x[0]/n->x[2]);
    432   Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ";
     437  DoLog(1) && (Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ");
    433438  while (ptr->next != end) {
    434439    ptr = ptr->next;
     
    446451  n->x[0] =  cos(alpha) * tmp +  sin(alpha) * n->x[2];
    447452  n->x[2] = -sin(alpha) * tmp +  cos(alpha) * n->x[2];
    448   Log() << Verbose(1) << "alignment vector after first rotation: ";
     453  DoLog(1) && (Log() << Verbose(1) << "alignment vector after first rotation: ");
    449454  n->Output();
    450   Log() << Verbose(0) << endl;
     455  DoLog(0) && (Log() << Verbose(0) << endl);
    451456
    452457  // rotate on z-y plane
    453458  ptr = start;
    454459  alpha = atan(-n->x[1]/n->x[2]);
    455   Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ";
     460  DoLog(1) && (Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ");
    456461  while (ptr->next != end) {
    457462    ptr = ptr->next;
     
    470475  n->x[2] = -sin(alpha) * tmp +  cos(alpha) * n->x[2];
    471476
    472   Log() << Verbose(1) << "alignment vector after second rotation: ";
     477  DoLog(1) && (Log() << Verbose(1) << "alignment vector after second rotation: ");
    473478  n->Output();
    474   Log() << Verbose(1) << endl;
    475   Log() << Verbose(0) << "End of Aligning all atoms." << endl;
     479  DoLog(1) && (Log() << Verbose(1) << endl);
     480  DoLog(0) && (Log() << Verbose(0) << "End of Aligning all atoms." << endl);
    476481};
    477482
Note: See TracChangeset for help on using the changeset viewer.