Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    r35b698 r84c494  
    2626#include "ThermoStatContainer.hpp"
    2727#include "World.hpp"
     28#include "Matrix.hpp"
     29#include "Box.hpp"
    2830
    2931/************************************* Functions for class config ***************************/
     
    679681  // Unit cell and magnetic field
    680682  ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
    681   double * const cell_size = World::getInstance().getDomain();
     683  double * cell_size = new double[6];
    682684  cell_size[0] = BoxLength[0];
    683685  cell_size[1] = BoxLength[3];
     
    686688  cell_size[4] = BoxLength[7];
    687689  cell_size[5] = BoxLength[8];
     690  World::getInstance().setDomain(cell_size);
     691  delete cell_size;
    688692  //if (1) fprintf(stderr,"\n");
    689693
     
    883887
    884888  ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
    885   double * const cell_size = World::getInstance().getDomain();
     889  double * cell_size = new double[6];
    886890  cell_size[0] = BoxLength[0];
    887891  cell_size[1] = BoxLength[3];
     
    890894  cell_size[4] = BoxLength[7];
    891895  cell_size[5] = BoxLength[8];
     896  World::getInstance().setDomain(cell_size);
     897  delete[] cell_size;
    892898  if (1) fprintf(stderr,"\n");
    893899  config::DoPerturbation = 0;
     
    10271033  // bring MaxTypes up to date
    10281034  mol->CountElements();
    1029   const double * const cell_size = World::getInstance().getDomain();
     1035  const Matrix &domain = World::getInstance().getDomain().getM();
    10301036  ofstream * const output = new ofstream(filename, ios::out);
    10311037  if (output != NULL) {
     
    10981104    *output << endl;
    10991105    *output << "BoxLength\t\t\t# (Length of a unit cell)" << endl;
    1100     *output << cell_size[0] << "\t" << endl;
    1101     *output << cell_size[1] << "\t" << cell_size[2] << "\t" << endl;
    1102     *output << cell_size[3] << "\t" << cell_size[4] << "\t" << cell_size[5] << "\t" << endl;
     1106    *output << domain.at(0,0) << "\t" << endl;
     1107    *output << domain.at(1,0) << "\t" << domain.at(1,1) << "\t" << endl;
     1108    *output << domain.at(2,0) << "\t" << domain.at(2,1) << "\t" << domain.at(2,2) << "\t" << endl;
    11031109    // FIXME
    11041110    *output << endl;
Note: See TracChangeset for help on using the changeset viewer.