I modify my script following your advices. But it still doesn't work. (
(it nearly drive me crazy!))
the code:
central_region = BulkConfiguration(
bravais_lattice=central_region_lattice,
elements=central_region_elements,
cartesian_coordinates=coordinate*Ang
)
device_configuration = DeviceConfiguration(
central_region,
[left_electrode, right_electrode]
)
is part of the loop "for add in [0.1,0.2,0.3,0.4]: "
the code after modify :
central_region_coordinates=central_region_coordinates.inUnitsOf(Ang)
for add in [0.1,0.2,0.3,0.4]:
vector_a = [10.0, 0.0, 0.0]*Angstrom
vector_b = [0.0, 10.0, 0.0]*Angstrom
vector_c = [0.0, 0.0, 24.9]*Angstrom
vector_c[2]+=2*add*Ang
print vector_c
central_region_lattice = UnitCell(vector_a, vector_b, vector_c)
for coordinate in central_region_coordinates:
if coordinate[2]>=12.1:
coordinate[2]=coordinate[2]+add
if coordinate[2]>(12.8+add):
coordinate[2]=coordinate[2]+add
central_region = BulkConfiguration(
bravais_lattice=central_region_lattice,
elements=central_region_elements,
cartesian_coordinates=coordinate*Ang
)
device_configuration = DeviceConfiguration(
central_region,
[left_electrode, right_electrode]
)