Changeset b34306 for src


Ignore:
Timestamp:
Mar 3, 2010, 10:13:19 AM (15 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:
70378e, a837d0, fd179f
Parents:
c5805a
Message:

singleton class World introduced, contains only cell_size from class molecule.

  • class World is actually code from Till Crueger from his branch StructureRefactoring.
  • has been introduced here in minimalistic form to allow molecule::cell_size to be outsourced to World::cell_size
  • access to cell_size can be obtained from anyhwere by invoking World::get()->cell_size
  • INFO: cell_size was placed in class molecule for the fragmentation procedure where the cell_size had to be individually adapted to each fragment.
  • all appearances have been changed accordingly. Where appropriate we have employed a const pointer onto cell_size.

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

Location:
src
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    rc5805a rb34306  
    88ANALYSISHEADER = analysis_bonds.hpp analysis_correlation.hpp
    99
    10 SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp triangleintersectionlist.cpp vector.cpp verbose.cpp
    11 HEADER = ${ANALYSISHEADER} ${ATOMHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp triangleintersectionlist.cpp vector.hpp verbose.hpp
     10SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp triangleintersectionlist.cpp vector.cpp verbose.cpp World.cpp
     11HEADER = ${ANALYSISHEADER} ${ATOMHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp triangleintersectionlist.cpp vector.hpp verbose.hpp World.hpp
    1212
    1313BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
  • src/analysis_correlation.cpp

    rc5805a rb34306  
    1818#include "vector.hpp"
    1919#include "verbose.hpp"
     20#include "World.hpp"
    2021
    2122
     
    5657                if (Walker->nr < OtherWalker->nr)
    5758                  if ((type2 == NULL) || (OtherWalker->type == type2)) {
    58                     distance = Walker->node->PeriodicDistance(OtherWalker->node, (*MolWalker)->cell_size);
     59                    distance = Walker->node->PeriodicDistance(OtherWalker->node, World::get()->cell_size);
    5960                    //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    6061                    outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     
    9798  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    9899    if ((*MolWalker)->ActiveFlag) {
    99       double * FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size);
     100      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    100101      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    101102      eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
     
    175176        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    176177        if ((type == NULL) || (Walker->type == type)) {
    177           distance = Walker->node->PeriodicDistance(point, (*MolWalker)->cell_size);
     178          distance = Walker->node->PeriodicDistance(point, World::get()->cell_size);
    178179          Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
    179180          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     
    209210  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    210211    if ((*MolWalker)->ActiveFlag) {
    211       double * FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size);
     212      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    212213      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    213214      Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
     
    314315  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    315316    if ((*MolWalker)->ActiveFlag) {
    316       double * FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size);
     317      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    317318      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    318319      Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
  • src/boundary.cpp

    rc5805a rb34306  
    1717#include "tesselation.hpp"
    1818#include "tesselationhelpers.hpp"
     19#include "World.hpp"
    1920
    2021#include<gsl/gsl_poly.h>
     
    805806  int N[NDIM];
    806807  int n[NDIM];
    807   double *M =  ReturnFullMatrixforSymmetric(filler->cell_size);
     808  double *M =  ReturnFullMatrixforSymmetric(World::get()->cell_size);
    808809  double Rotations[NDIM*NDIM];
    809810  double *MInverse = InverseMatrix(M);
  • src/builder.cpp

    rc5805a rb34306  
    6868#include "periodentafel.hpp"
    6969#include "version.h"
     70#include "World.hpp"
    7071
    7172/********************************************* Subsubmenu routine ************************************/
     
    103104        Log() << Verbose(0) << "Enter absolute coordinates." << endl;
    104105        first = new atom;
    105         first->x.AskPosition(mol->cell_size, false);
     106        first->x.AskPosition(World::get()->cell_size, false);
    106107        first->type = periode->AskElement();  // give type
    107108        mol->AddAtom(first);  // add to molecule
     
    114115          if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
    115116          Log() << Verbose(0) << "Enter reference coordinates." << endl;
    116           x.AskPosition(mol->cell_size, true);
     117          x.AskPosition(World::get()->cell_size, true);
    117118          Log() << Verbose(0) << "Enter relative coordinates." << endl;
    118           first->x.AskPosition(mol->cell_size, false);
     119          first->x.AskPosition(World::get()->cell_size, false);
    119120          first->x.AddVector((const Vector *)&x);
    120121          Log() << Verbose(0) << "\n";
     
    131132          second = mol->AskAtom("Enter atom number: ");
    132133          Log() << Verbose(0) << "Enter relative coordinates." << endl;
    133           first->x.AskPosition(mol->cell_size, false);
     134          first->x.AskPosition(World::get()->cell_size, false);
    134135          for (int i=NDIM;i--;) {
    135136            first->x.x[i] += second->x.x[i];
     
    358359    case 'b': // normal vector of mirror plane
    359360      Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;
    360       n.AskPosition(mol->cell_size,0);
     361      n.AskPosition(World::get()->cell_size,0);
    361362      n.Normalize();
    362363      break;
     
    425426    case 'b': // normal vector of mirror plane
    426427      Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;
    427       n.AskPosition(mol->cell_size,0);
     428      n.AskPosition(World::get()->cell_size,0);
    428429      n.Normalize();
    429430      break;
     
    865866          x.Zero();
    866867          y.Zero();
    867           y.x[abs(axis)-1] = mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude
     868          y.x[abs(axis)-1] = World::get()->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude
    868869          for (int i=1;i<faktor;i++) {  // then add this list with respective translation factor times
    869870            x.AddVector(&y); // per factor one cell width further
     
    888889            mol->Translate(&x);
    889890          }
    890           mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= faktor;
     891          World::get()->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= faktor;
    891892        }
    892893      }
     
    945946        Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    946947        Log() << Verbose(0) << "Enter translation vector." << endl;
    947         x.AskPosition(mol->cell_size,0);
     948        x.AskPosition(World::get()->cell_size,0);
    948949        mol->Center.AddVector((const Vector *)&x);
    949950     }
     
    10051006        // center at set box dimensions
    10061007        mol->CenterEdge(&center);
    1007         mol->cell_size[0] = center.x[0];
    1008         mol->cell_size[1] = 0;
    1009         mol->cell_size[2] = center.x[1];
    1010         mol->cell_size[3] = 0;
    1011         mol->cell_size[4] = 0;
    1012         mol->cell_size[5] = center.x[2];
     1008        double * const cell_size = World::get()->cell_size;
     1009        cell_size[0] = center.x[0];
     1010        cell_size[1] = 0;
     1011        cell_size[2] = center.x[1];
     1012        cell_size[3] = 0;
     1013        cell_size[4] = 0;
     1014        cell_size[5] = center.x[2];
    10131015        molecules->insert(mol);
    10141016      }
     
    21052107                factor[2] = atof(argv[argptr+2]);
    21062108                mol->Scale((const double ** const)&factor);
     2109                double * const cell_size = World::get()->cell_size;
    21072110                for (int i=0;i<NDIM;i++) {
    21082111                  j += i+1;
    21092112                  x.x[i] = atof(argv[NDIM+i]);
    2110                   mol->cell_size[j]*=factor[i];
     2113                  cell_size[j]*=factor[i];
    21112114                }
    21122115                delete[](factor);
     
    21242127                j = -1;
    21252128                Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     2129                double * const cell_size = World::get()->cell_size;
    21262130                for (int i=0;i<6;i++) {
    2127                   mol->cell_size[i] = atof(argv[argptr+i]);
     2131                  cell_size[i] = atof(argv[argptr+i]);
    21282132                }
    21292133                // center
     
    21422146                j = -1;
    21432147                Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     2148                double * const cell_size = World::get()->cell_size;
    21442149                for (int i=0;i<6;i++) {
    2145                   mol->cell_size[i] = atof(argv[argptr+i]);
     2150                  cell_size[i] = atof(argv[argptr+i]);
    21462151                }
    21472152                // center
     
    21652170                mol->SetBoxDimension(&x);
    21662171                // translate each coordinate by boundary
     2172                double * const cell_size = World::get()->cell_size;
    21672173                j=-1;
    21682174                for (int i=0;i<NDIM;i++) {
    21692175                  j += i+1;
    21702176                  x.x[i] = atof(argv[argptr+i]);
    2171                   mol->cell_size[j] += x.x[i]*2.;
     2177                  cell_size[j] += x.x[i]*2.;
    21722178                }
    21732179                mol->Translate((const Vector *)&x);
     
    23002306              } else {
    23012307                SaveFlag = true;
     2308                double * const cell_size = World::get()->cell_size;
    23022309                for (int axis = 1; axis <= NDIM; axis++) {
    23032310                  int faktor = atoi(argv[argptr++]);
     
    23262333                    x.Zero();
    23272334                    y.Zero();
    2328                     y.x[abs(axis)-1] = mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude
     2335                    y.x[abs(axis)-1] = cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude
    23292336                    for (int i=1;i<faktor;i++) {  // then add this list with respective translation factor times
    23302337                      x.AddVector(&y); // per factor one cell width further
     
    23472354                      mol->Translate(&x);
    23482355                    }
    2349                     mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= faktor;
     2356                    cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] *= faktor;
    23502357                  }
    23512358                }
     
    24162423  if (molecules->ListOfMolecules.size() == 0) {
    24172424    mol = new molecule(periode);
    2418     if (mol->cell_size[0] == 0.) {
     2425    double * const cell_size = World::get()->cell_size;
     2426    if (cell_size[0] == 0.) {
    24192427      Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;
    24202428      for (int i=0;i<6;i++) {
    24212429        Log() << Verbose(1) << "Cell size" << i << ": ";
    2422         cin >> mol->cell_size[i];
     2430        cin >> cell_size[i];
    24232431      }
    24242432    }
  • src/config.cpp

    rc5805a rb34306  
    1919#include "molecule.hpp"
    2020#include "periodentafel.hpp"
     21#include "World.hpp"
    2122
    2223/******************************** Functions for class ConfigFileBuffer **********************/
     
    499500//        case 'j': // BoxLength
    500501//          Log() << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl;
     502//          double * const cell_size = World::get()->cell_size;
    501503//          for (int i=0;i<6;i++) {
    502504//            Log() << Verbose(0) << "Cell size" << i << ": ";
    503 //            cin >> mol->cell_size[i];
     505//            cin >> cell_size[i];
    504506//          }
    505507//          break;
     
    965967  // Unit cell and magnetic field
    966968  ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
    967   mol->cell_size[0] = BoxLength[0];
    968   mol->cell_size[1] = BoxLength[3];
    969   mol->cell_size[2] = BoxLength[4];
    970   mol->cell_size[3] = BoxLength[6];
    971   mol->cell_size[4] = BoxLength[7];
    972   mol->cell_size[5] = BoxLength[8];
     969  double * const cell_size = World::get()->cell_size;
     970  cell_size[0] = BoxLength[0];
     971  cell_size[1] = BoxLength[3];
     972  cell_size[2] = BoxLength[4];
     973  cell_size[3] = BoxLength[6];
     974  cell_size[4] = BoxLength[7];
     975  cell_size[5] = BoxLength[8];
    973976  //if (1) fprintf(stderr,"\n");
    974977
     
    11691172
    11701173  ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
    1171   mol->cell_size[0] = BoxLength[0];
    1172   mol->cell_size[1] = BoxLength[3];
    1173   mol->cell_size[2] = BoxLength[4];
    1174   mol->cell_size[3] = BoxLength[6];
    1175   mol->cell_size[4] = BoxLength[7];
    1176   mol->cell_size[5] = BoxLength[8];
     1174  double * const cell_size = World::get()->cell_size;
     1175  cell_size[0] = BoxLength[0];
     1176  cell_size[1] = BoxLength[3];
     1177  cell_size[2] = BoxLength[4];
     1178  cell_size[3] = BoxLength[6];
     1179  cell_size[4] = BoxLength[7];
     1180  cell_size[5] = BoxLength[8];
    11771181  if (1) fprintf(stderr,"\n");
    11781182  config::DoPerturbation = 0;
     
    13121316  // bring MaxTypes up to date
    13131317  mol->CountElements();
     1318  const double * const cell_size = World::get()->cell_size;
    13141319  ofstream * const output = new ofstream(filename, ios::out);
    13151320  if (output != NULL) {
     
    13821387    *output << endl;
    13831388    *output << "BoxLength\t\t\t# (Length of a unit cell)" << endl;
    1384     *output << mol->cell_size[0] << "\t" << endl;
    1385     *output << mol->cell_size[1] << "\t" << mol->cell_size[2] << "\t" << endl;
    1386     *output << mol->cell_size[3] << "\t" << mol->cell_size[4] << "\t" << mol->cell_size[5] << "\t" << endl;
     1389    *output << cell_size[0] << "\t" << endl;
     1390    *output << cell_size[1] << "\t" << cell_size[2] << "\t" << endl;
     1391    *output << cell_size[3] << "\t" << cell_size[4] << "\t" << cell_size[5] << "\t" << endl;
    13871392    // FIXME
    13881393    *output << endl;
  • src/molecule.cpp

    rc5805a rb34306  
    2323#include "tesselation.hpp"
    2424#include "vector.hpp"
     25#include "World.hpp"
    2526
    2627/************************************* Functions for class molecule *********************************/
     
    4546  for(int i=MAX_ELEMENTS;i--;)
    4647    ElementsInMolecule[i] = 0;
    47   cell_size[0] = cell_size[2] = cell_size[5]= 20.;
    48   cell_size[1] = cell_size[3] = cell_size[4]= 0.;
    4948  strcpy(name,"none");
    5049};
     
    159158  double *matrix = NULL;
    160159  bond *Binder = NULL;
     160  double * const cell_size = World::get()->cell_size;
    161161
    162162//  Log() << Verbose(3) << "Begin of AddHydrogenReplacementAtom." << endl;
     
    603603void molecule::SetBoxDimension(Vector *dim)
    604604{
     605  double * const cell_size = World::get()->cell_size;
    605606  cell_size[0] = dim->x[0];
    606607  cell_size[1] = 0.;
     
    693694bool molecule::CheckBounds(const Vector *x) const
    694695{
     696  double * const cell_size = World::get()->cell_size;
    695697  bool result = true;
    696698  int j =-1;
  • src/molecule.hpp

    rc5805a rb34306  
    8282class molecule : public PointCloud {
    8383  public:
    84     double cell_size[6];//!< cell size
    8584    const periodentafel * const elemente; //!< periodic table with each element
    8685    atom *start;        //!< start of atom list
  • src/molecule_fragmentation.cpp

    rc5805a rb34306  
    1818#include "molecule.hpp"
    1919#include "periodentafel.hpp"
     20#include "World.hpp"
    2021
    2122/************************************* Functions for class molecule *********************************/
     
    843844
    844845  Leaf->BondDistance = mol->BondDistance;
    845   for(int i=NDIM*2;i--;)
    846     Leaf->cell_size[i] = mol->cell_size[i];
    847846
    848847  // first create the minimal set of atoms from the KeySet
     
    16541653  atom *Walker = NULL;
    16551654  atom *OtherWalker = NULL;
     1655  double * const cell_size = World::get()->cell_size;
    16561656  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
    16571657  enum Shading *ColorList = NULL;
  • src/molecule_geometry.cpp

    rc5805a rb34306  
    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::get()->cell_size;
    2830  double *M = ReturnFullMatrixforSymmetric(cell_size);
    2931  double *Minv = InverseMatrix(M);
     
    4648{
    4749  bool status = true;
     50  double * const cell_size = World::get()->cell_size;
    4851  double *M = ReturnFullMatrixforSymmetric(cell_size);
    4952  double *Minv = InverseMatrix(M);
     
    226229void molecule::TranslatePeriodically(const Vector *trans)
    227230{
     231  double * const cell_size = World::get()->cell_size;
    228232  double *M = ReturnFullMatrixforSymmetric(cell_size);
    229233  double *Minv = InverseMatrix(M);
     
    252256{
    253257  atom *Walker = start;
     258  double * const cell_size = World::get()->cell_size;
    254259  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
    255260  double *inversematrix = InverseMatrix(cell_size);
  • src/molecule_graph.cpp

    rc5805a rb34306  
    1717#include "memoryallocator.hpp"
    1818#include "molecule.hpp"
     19#include "World.hpp"
    1920
    2021struct BFSAccounting
     
    106107  LinkedCell *LC = NULL;
    107108  bool free_BG = false;
     109  double * const cell_size = World::get()->cell_size;
    108110
    109111  if (BG == NULL) {
  • src/moleculelist.cpp

    rc5805a rb34306  
    1919#include "memoryallocator.hpp"
    2020#include "periodentafel.hpp"
     21#include "World.hpp"
    2122
    2223/*********************************** Functions for class MoleculeListClass *************************/
     
    638639  int FragmentCounter = 0;
    639640  ofstream output;
    640 
     641  double cell_size_backup[6];
     642  double * const cell_size = World::get()->cell_size;
     643
     644  // backup cell_size
     645  for (int i=0;i<6;i++)
     646    cell_size_backup[i] = cell_size[i];
    641647  // store the fragments as config and as xyz
    642648  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
     
    682688      j += k + 1;
    683689      BoxDimension.x[k] = 2.5 * (configuration->GetIsAngstroem() ? 1. : 1. / AtomicLengthToAngstroem);
    684       (*ListRunner)->cell_size[j] += BoxDimension.x[k] * 2.;
     690      cell_size[j] = BoxDimension.x[k] * 2.;
    685691    }
    686692    (*ListRunner)->Translate(&BoxDimension);
     
    724730  // printing final number
    725731  Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl;
     732
     733  // restore cell_size
     734  for (int i=0;i<6;i++)
     735    cell_size[i] = cell_size_backup[i];
    726736
    727737  return result;
  • src/vector.cpp

    rc5805a rb34306  
    1515#include "vector.hpp"
    1616#include "verbose.hpp"
     17#include "World.hpp"
    1718
    1819#include <gsl/gsl_linalg.h>
Note: See TracChangeset for help on using the changeset viewer.