Ignore:
Timestamp:
Apr 7, 2010, 3:45:38 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
0f55b2
Parents:
770138
Message:

Made data internal data-structure of vector class private

  • Replaced occurences of access to internals with operator
  • moved Vector-class into LinAlg-Module
  • Reworked Vector to allow clean modularization
  • Added Plane class to describe arbitrary planes in 3d space
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r770138 r71910a  
    14871487                  Log() << Verbose(2) << "found element " << first->type->name << endl;
    14881488                for (int i=NDIM;i--;)
    1489                   first->x.x[i] = atof(argv[argptr+1+i]);
     1489                  first->x[i] = atof(argv[argptr+1+i]);
    14901490                if (first->type != NULL) {
    14911491                  mol->AddAtom(first);  // add to molecule
     
    18371837                Log() << Verbose(1) << "Translating all ions by given vector." << endl;
    18381838                for (int i=NDIM;i--;)
    1839                   x.x[i] = atof(argv[argptr+i]);
     1839                  x[i] = atof(argv[argptr+i]);
    18401840                mol->Translate((const Vector *)&x);
    18411841                argptr+=3;
     
    18531853                Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl;
    18541854                for (int i=NDIM;i--;)
    1855                   x.x[i] = atof(argv[argptr+i]);
     1855                  x[i] = atof(argv[argptr+i]);
    18561856                mol->TranslatePeriodically((const Vector *)&x);
    18571857                argptr+=3;
     
    18751875                for (int i=0;i<NDIM;i++) {
    18761876                  j += i+1;
    1877                   x.x[i] = atof(argv[NDIM+i]);
     1877                  x[i] = atof(argv[NDIM+i]);
    18781878                  mol->cell_size[j]*=factor[i];
    18791879                }
     
    19361936                for (int i=0;i<NDIM;i++) {
    19371937                  j += i+1;
    1938                   x.x[i] = atof(argv[argptr+i]);
    1939                   mol->cell_size[j] += x.x[i]*2.;
     1938                  x[i] = atof(argv[argptr+i]);
     1939                  mol->cell_size[j] += x[i]*2.;
    19401940                }
    19411941                mol->Translate((const Vector *)&x);
     
    20942094                    x.Zero();
    20952095                    y.Zero();
    2096                     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
     2096                    y[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
    20972097                    for (int i=1;i<faktor;i++) {  // then add this list with respective translation factor times
    20982098                      x.AddVector(&y); // per factor one cell width further
Note: See TracChangeset for help on using the changeset viewer.