Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    r632bc3 r68f03d  
    17411741                  DoLog(2) && (Log() << Verbose(2) << "found element " << first->type->name << endl);
    17421742                for (int i=NDIM;i--;)
    1743                   first->x.x[i] = atof(argv[argptr+1+i]);
     1743                  first->x[i] = atof(argv[argptr+1+i]);
    17441744                if (first->type != NULL) {
    17451745                  mol->AddAtom(first);  // add to molecule
     
    20132013                first = World::getInstance().createAtom();
    20142014                first->type = periode->FindElement(1);
    2015                 first->x.Init(0.441, -0.143, 0.);
     2015                first->x = Vector(0.441, -0.143, 0.);
    20162016                filler->AddAtom(first);
    20172017                second = World::getInstance().createAtom();
    20182018                second->type = periode->FindElement(1);
    2019                 second->x.Init(-0.464, 1.137, 0.0);
     2019                second->x = Vector(-0.464, 1.137, 0.0);
    20202020                filler->AddAtom(second);
    20212021                third = World::getInstance().createAtom();
    20222022                third->type = periode->FindElement(8);
    2023                 third->x.Init(-0.464, 0.177, 0.);
     2023                third->x = Vector(-0.464, 0.177, 0.);
    20242024                filler->AddAtom(third);
    20252025                filler->AddBond(first, third, 1);
     
    21862186                    first = second;
    21872187                    second = first->next;
    2188                     if (first->x.DistanceSquared((const Vector *)&third->x) > tmp1*tmp1) // distance to first above radius ...
     2188                    if (first->x.DistanceSquared(third->x) > tmp1*tmp1) // distance to first above radius ...
    21892189                      mol->RemoveAtom(first);
    21902190                  }
     
    22062206                DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl);
    22072207                for (int i=NDIM;i--;)
    2208                   x.x[i] = atof(argv[argptr+i]);
     2208                  x[i] = atof(argv[argptr+i]);
    22092209                mol->Translate((const Vector *)&x);
    22102210                argptr+=3;
     
    22222222                DoLog(1) && (Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl);
    22232223                for (int i=NDIM;i--;)
    2224                   x.x[i] = atof(argv[argptr+i]);
     2224                  x[i] = atof(argv[argptr+i]);
    22252225                mol->TranslatePeriodically((const Vector *)&x);
    22262226                argptr+=3;
     
    22452245                for (int i=0;i<NDIM;i++) {
    22462246                  j += i+1;
    2247                   x.x[i] = atof(argv[NDIM+i]);
     2247                  x[i] = atof(argv[NDIM+i]);
    22482248                  cell_size[j]*=factor[i];
    22492249                }
     
    23092309                for (int i=0;i<NDIM;i++) {
    23102310                  j += i+1;
    2311                   x.x[i] = atof(argv[argptr+i]);
    2312                   cell_size[j] += x.x[i]*2.;
     2311                  x[i] = atof(argv[argptr+i]);
     2312                  cell_size[j] += x[i]*2.;
    23132313                }
    23142314                mol->Translate((const Vector *)&x);
     
    24682468                    x.Zero();
    24692469                    y.Zero();
    2470                     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
     2470                    y[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
    24712471                    for (int i=1;i<faktor;i++) {  // then add this list with respective translation factor times
    2472                       x.AddVector(&y); // per factor one cell width further
     2472                      x += y; // per factor one cell width further
    24732473                      for (int k=count;k--;) { // go through every atom of the original cell
    24742474                        first = World::getInstance().createAtom(); // create a new body
    2475                         first->x.CopyVector(vectors[k]);  // use coordinate of original atom
    2476                         first->x.AddVector(&x);      // translate the coordinates
     2475                        first->x = (*vectors[k]) + x;
    24772476                        first->type = Elements[k];  // insert original element
    24782477                        mol->AddAtom(first);        // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...)
     
    24842483                    // correct cell size
    24852484                    if (axis < 0) { // if sign was negative, we have to translate everything
    2486                       x.Zero();
    2487                       x.AddVector(&y);
    2488                       x.Scale(-(faktor-1));
     2485                      x =(-(faktor-1)) * y;
    24892486                      mol->Translate(&x);
    24902487                    }
     
    25542551  ActionRegistry::purgeInstance();
    25552552  ActionHistory::purgeInstance();
     2553  Memory::getState();
    25562554}
    25572555
     
    26192617  cleanUp(configuration);
    26202618
    2621   Memory::getState();
    26222619  return (0);
    26232620}
Note: See TracChangeset for help on using the changeset viewer.