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::checkInteractions(LatticeType lattice
, Interactions interactions
, int pos_x
, int pos_y
)
46 // checkInteractions(interactions, pos_x, pos_y);
47 // checkInteractions(interactions);
49 for (LatticeType::iterator i
= lattice
.begin(); i
!= lattice
.end(); i
++) {
53 int x
= i
.position()[0];
54 int y
= i
.position()[1];
55 Interactions::iterator interaction
= interactions
.begin();
56 Interactions::iterator last_interaction
= interactions
.end();
57 while (interaction
!= last_interaction
) {
58 Directions::iterator direction
= interaction
->directions
.begin();
59 Directions::iterator last_direction
= interaction
->directions
.end();
60 while (direction
!= last_direction
) {
61 if (lattice((x
+ direction
->x
),(y
+ direction
->y
)))
62 interaction
->multiplicity
++;
76 // IMPLEMENTATION HERE