13
« on: August 17, 2012, 19:14 »
Helllo,
I've got the error message after the running as follows.
Traceback (most recent call last):
File "FLG_MD_1L.py", line 19, in <module>
bulk_configuration.setCalculator(calculator)
NameError: name 'bulk_configuration' is not defined
My script is given below.
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = GGABasis.DoubleZetaPolarized
#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = GGA.PBE
calculator = LCAOCalculator(
basis_set=basis_set,
exchange_correlation=exchange_correlation,
)
bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()
nlsave('analysis.nc', bulk_configuration)
# -------------------------------------------------------------
# Bulk configuration
# -------------------------------------------------------------
# Set up lattice
lattice = Triclinic(12.741*Angstrom, 12.26*Angstrom, 20.0*Angstrom, 90.0*Degrees, 90.0*Degrees, 90.0*Degrees)
# Define elements
elements = [Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon, Carbon,
Carbon, Carbon, Carbon, Carbon]
# Define coordinates
cartesian_coordinates = [[ 3.53919498e+00, 1.22587740e+00, 1.00000000e+01],
[ 1.41590733e+00, 6.12323400e-16, 1.00000000e+01],
[ 2.12366988e+00, 1.22612260e+00, 1.00000000e+01],
[ 6.12323400e-16, 6.12323400e-16, 1.00000000e+01],
[ 7.78627992e+00, 1.22587740e+00, 1.00000000e+01],
[ 5.66286486e+00, 6.12323400e-16, 1.00000000e+01],
[ 6.37062741e+00, 1.22612260e+00, 1.00000000e+01],
[ 4.24695753e+00, 6.12323400e-16, 1.00000000e+01],
[ 1.20332374e+01, 1.22587740e+00, 1.00000000e+01],
[ 9.90994980e+00, 6.12323400e-16, 1.00000000e+01],
[ 1.06177123e+01, 1.22612260e+00, 1.00000000e+01],
[ 8.49404247e+00, 6.12323400e-16, 1.00000000e+01],
[ 3.53919498e+00, 3.67787740e+00, 1.00000000e+01],
[ 1.41590733e+00, 2.45200000e+00, 1.00000000e+01],
[ 2.12366988e+00, 3.67812260e+00, 1.00000000e+01],
[ 7.62465097e-16, 2.45200000e+00, 1.00000000e+01],
[ 7.78627992e+00, 3.67787740e+00, 1.00000000e+01],
[ 5.66286486e+00, 2.45200000e+00, 1.00000000e+01],
[ 6.37062741e+00, 3.67812260e+00, 1.00000000e+01],
[ 4.24695753e+00, 2.45200000e+00, 1.00000000e+01],
[ 1.20332374e+01, 3.67787740e+00, 1.00000000e+01],
[ 9.90994980e+00, 2.45200000e+00, 1.00000000e+01],
[ 1.06177123e+01, 3.67812260e+00, 1.00000000e+01],
[ 8.49404247e+00, 2.45200000e+00, 1.00000000e+01],
[ 3.53919498e+00, 6.12987740e+00, 1.00000000e+01],
[ 1.41590733e+00, 4.90400000e+00, 1.00000000e+01],
[ 2.12366988e+00, 6.13012260e+00, 1.00000000e+01],
[ 9.12606795e-16, 4.90400000e+00, 1.00000000e+01],
[ 7.78627992e+00, 6.12987740e+00, 1.00000000e+01],
[ 5.66286486e+00, 4.90400000e+00, 1.00000000e+01],
[ 6.37062741e+00, 6.13012260e+00, 1.00000000e+01],
[ 4.24695753e+00, 4.90400000e+00, 1.00000000e+01],
[ 1.20332374e+01, 6.12987740e+00, 1.00000000e+01],
[ 9.90994980e+00, 4.90400000e+00, 1.00000000e+01],
[ 1.06177123e+01, 6.13012260e+00, 1.00000000e+01],
[ 8.49404247e+00, 4.90400000e+00, 1.00000000e+01],
[ 3.53919498e+00, 8.58187740e+00, 1.00000000e+01],
[ 1.41590733e+00, 7.35600000e+00, 1.00000000e+01],
[ 2.12366988e+00, 8.58212260e+00, 1.00000000e+01],
[ 1.06274849e-15, 7.35600000e+00, 1.00000000e+01],
[ 7.78627992e+00, 8.58187740e+00, 1.00000000e+01],
[ 5.66286486e+00, 7.35600000e+00, 1.00000000e+01],
[ 6.37062741e+00, 8.58212260e+00, 1.00000000e+01],
[ 4.24695753e+00, 7.35600000e+00, 1.00000000e+01],
[ 1.20332374e+01, 8.58187740e+00, 1.00000000e+01],
[ 9.90994980e+00, 7.35600000e+00, 1.00000000e+01],
[ 1.06177123e+01, 6.13012260e+00, 1.00000000e+01],
[ 8.49404247e+00, 4.90400000e+00, 1.00000000e+01],
[ 3.53919498e+00, 8.58187740e+00, 1.00000000e+01],
[ 1.41590733e+00, 7.35600000e+00, 1.00000000e+01],
[ 2.12366988e+00, 8.58212260e+00, 1.00000000e+01],
[ 1.06274849e-15, 7.35600000e+00, 1.00000000e+01],
[ 7.78627992e+00, 8.58187740e+00, 1.00000000e+01],
[ 5.66286486e+00, 7.35600000e+00, 1.00000000e+01],
[ 6.37062741e+00, 8.58212260e+00, 1.00000000e+01],
[ 4.24695753e+00, 7.35600000e+00, 1.00000000e+01],
[ 1.20332374e+01, 8.58187740e+00, 1.00000000e+01],
[ 9.90994980e+00, 7.35600000e+00, 1.00000000e+01],
[ 1.06177123e+01, 8.58212260e+00, 1.00000000e+01],
[ 8.49404247e+00, 7.35600000e+00, 1.00000000e+01],
[ 3.53919498e+00, 1.10338774e+01, 1.00000000e+01],
[ 1.41590733e+00, 9.80800000e+00, 1.00000000e+01],
[ 2.12366988e+00, 1.10341226e+01, 1.00000000e+01],
[ 1.21289019e-15, 9.80800000e+00, 1.00000000e+01],
[ 7.78627992e+00, 1.10338774e+01, 1.00000000e+01],
[ 5.66286486e+00, 9.80800000e+00, 1.00000000e+01],
[ 6.37062741e+00, 1.10341226e+01, 1.00000000e+01],
[ 4.24695753e+00, 9.80800000e+00, 1.00000000e+01],
[ 1.20332374e+01, 1.10338774e+01, 1.00000000e+01],
[ 9.90994980e+00, 9.80800000e+00, 1.00000000e+01],
[ 1.06177123e+01, 1.10341226e+01, 1.00000000e+01],
[ 8.49404247e+00, 9.80800000e+00, 1.00000000e+01]]*Angstrom
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
cartesian_coordinates=cartesian_coordinates
)
initial_velocity = MaxwellBoltzmannDistribution(
temperature=300.0*Kelvin
)
method = VelocityVerlet(
time_step=1.0*femtoSecond,
initial_velocity=initial_velocity
)
molecular_dynamics = MolecularDynamics(
bulk_configuration,
constraints=[],
log_filename='trajectory.nc',
steps=100,
log_interval=10,
method=method
)
nlsave('analysis.nc', molecular_dynamics)
nlprint(molecular_dynamics)
# -------------------------------------------------------------
# Stress
# -------------------------------------------------------------
stress = Stress(bulk_configuration)
nlsave('analysis.nc', stress)
nlprint(stress)
# -------------------------------------------------------------
# Total energy
# -------------------------------------------------------------
total_energy = TotalEnergy(bulk_configuration)
nlsave('/home/yijhon/ATK/FLG_MD/1L/1L_FLG_MD.nc', total_energy)
nlprint(total_energy)
The block named Bulk existed originally in script section when I moved to building step to script generator step.
What's wrong and what should I do for it?
Best regards,
Young
The block named Bulk was present originally in script section when I move to script generator step from buiding step.
What's wrong and what should I do for it?
The block named Bulk was present originally in script section when I move to script generator step from buiding step.
What's wrong and what should I do for it?