11 Lattice::Lattice(int Longitude
, int Latitude
,
12 int UnitCellSizeX
, int UnitCellSizeY
) :
13 Latitude(Latitude
), Longitude(Longitude
),
14 UnitCellSizeX(UnitCellSizeX
), UnitCellSizeY(UnitCellSizeY
)
16 // FIXME: add error handling
17 this->adsorbates
.resize(Longitude
* UnitCellSizeX
+ 1,
18 Latitude
* UnitCellSizeY
+ 1);
19 this->adsorbates
= empty
;
20 this->surface
.resize(this->adsorbates
.shape());
21 this->surface
= empty
;
25 Lattice::extendUnitCell(void)
27 extendUnitCell(adsorbates
, UnitCellSizeX
, UnitCellSizeY
);
28 extendUnitCell(surface
, UnitCellSizeX
, UnitCellSizeY
);
32 Lattice::extendUnitCell(LatticeType lattice
, int dimX
, int dimY
)
34 for (LatticeType::iterator i
= lattice
.begin(); i
!= lattice
.end(); i
++) {
35 int x
= i
.position()[0];
36 int y
= i
.position()[1];
37 lattice(x
, y
) = lattice(x
% dimX
, y
% dimY
);
44 Lattice::assessInteractions(Interactions interactions
)
46 for (LatticeType::iterator i
= adsorbates
.begin(); i
!= adsorbates
.end(); i
++) {
47 if (adsorbates(i
.position()) == empty
)
50 for (Interactions::iterator interaction
= interactions
.begin();
51 interaction
!= interactions
.end(); interaction
++) {
52 for (Directions::iterator direction
= interaction
->directions
.begin();
53 direction
!= interaction
->directions
.end(); direction
++) {
54 // FIXME: what about symmetry operations??
55 int x
= (i
.position()[firstDim
] + (int)(direction
->x
* UnitCellSizeX
)) %
56 (UnitCellSizeX
* Longitude
);
57 int y
= (i
.position()[secondDim
] + (int)(direction
->y
* UnitCellSizeY
)) %
58 (UnitCellSizeY
* Latitude
);
59 if (adsorbates(x
, y
) != empty
)
60 interaction
->multiplicity
++;
69 // FIXME: IMPLEMENTATION HERE