Ok, well the question is general ... basically I want to know if I can save the initial calculation somehow to save time later, for example, if i want to run the same cfg with a different bias, or maybe a different gate voltage .... here is what i was trying to do:
Somewhere in the start of my doTransmissionCalc function, I do:
#read in the old configuration
device_configuration = nlread(<filename>, object_id="cfg")[0]
metallic_region0 = device_configuration.metallicRegions()[0]
metallic_region1 = None
if oList["doubleGate"]:
metallic_region1 = device_configuration.metallicRegions()[1]
calculator = my_DeviceHuckelCalculator(oList)
device_configuration.setCalculator(calculator, initial_state=device_configuration)
device_configuration.update()
nlsave(<filename>, device_configuration, object_id="cfg")
So the basic question is, by saving the configuration after the update() line, does that speed things up next time because of the
initial_state parameter?
I suppose the answer is no, because when i run again, it always says there is no initial state saved ... but i don't understand why ... how do i save the initial state?
It's pseudocode because the syntax <filename> is not allowed in Python :)
But - are you sure the object_id "cfg" has the calculation, and not just the geometry?
And even if it does have a calculator, as soon as you set a new calculator on the device_configuration, you erase the old state. You need something like (real pseudocode ;) ):
old_calculation = nlread(<filename>, object_id="cfg")[0]
device_configuration = nlread(<filename>, object_id="cfg", read_state = False)[0]
...
device_configuration.setCalculator(calculator, initial_state=old_calculation)
device_configuration.update()
nlsave - with another object_id!