aestimosolver / aestimo

Aestimo 1D Schrödinger-Poisson Solver
https://aestimosolver.github.io
GNU General Public License v3.0
52 stars 23 forks source link

Error of `StructureFrom()` in running Tutorial #1 #43

Closed NN708 closed 1 year ago

NN708 commented 1 year ago

In version 3.0, an error occurred while running model = solver.StructureFrom(structure,adatabase).

Error message:

NameError: name 'Fapplied' is not defined
File /xxx/aestimo.py:1239, in StructureFrom.__init__(self, inputfile, database)
   1237     inputfile = AttrDict(inputfile)
   1238 # Parameters for simulation
-> 1239 self.Fapp = Fapplied
   1240 self.vmax = vmax
   1241 self.vmin = vmin
sblisesivdin commented 1 year ago

Thank you for the comment. Do you use any input file? It seems you did not use Fapplied in your input file. Just add:

Fapplied =  0.0

to your input file.

NN708 commented 1 year ago

Thank you for the reply! In the tutorial, it is run by a Jupyter notebook, instead of an input file.

Fapplied is defined in:

# APPLIED ELECTRIC FIELD
s.Fapplied = 0.00/50e-9 # (V/m)
sblisesivdin commented 1 year ago

The tutorials are a little bit outdated. However, that tutorial also uses an input file. Please just try to run the input files given with Aestimo 3 as:

aestimo.py -d -i name_of_input_file.py

That will be fine.

NN708 commented 1 year ago

What I want is to use Aestimo as a library module. I feel like this is what this tutorial does.