Author Topic: saving calcs with device?  (Read 3952 times)

0 Members and 1 Guest are viewing this topic.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
saving calcs with device?
« on: January 24, 2012, 22:23 »
It seems that when you set the device calculator object, then save the object, it does not save the calculator .. is this correct?  example: 
Code
	device_configuration = nlread(outFileName,DeviceConfiguration)[0]
	device_configuration.setCalculator(calculator)
	device_configuration.update()
	nlsave(outFileName, device_configuration, object_id="cfg")
when i open the "cfg" object later and try to run a calc it says i did not set a calculator ... why?

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: saving calcs with device?
« Reply #1 on: January 24, 2012, 22:52 »
It works for me - so in order to help you - I might see a little more of your script.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: saving calcs with device?
« Reply #2 on: January 24, 2012, 23:02 »
oh ok .. actually i got an error saying that saving of LCAO calcs is not supported .. ?  i changed my script but if i see it again i will post it. 

ed

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: saving calcs with device?
« Reply #3 on: January 24, 2012, 23:51 »
I don't know about the error message you mentioned, that sounds a bit weird. However, disregarding that, the calculator is actually saved with the configuration when you do "update" and then "nlsave". You will however not see it, the calculator is not a separate object, it's attached to the calculator itself. This is the fact which allows you to compute quantities (like transmission spectrum, etc) from the configuration as restored from the NC file without rerunning the self-consistent calculation.

I think we should later make it a bit more obvious that a configuration has a calculator attached to it, but you can see it by dropping the configuration on the Scripter, then it will expand the calculator for you, or rather the parameters defined for the calculator.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: saving calcs with device?
« Reply #4 on: January 24, 2012, 23:57 »
Ok I see what I was doing, I wanted to save the calc seperately inside the nc file then reopen that .. that must be where i got the error . here is that error ...

There is no support for writing this object <class 'NL.Calculators.LCAOCalculator.DeviceLCAOCalculator.DeviceLCAOCalculator'> to a NetCDF file

i think what you are saying though is that the code i posted previously is correct and should work, to save the calc within the device object .. i will check again .. thank you.