Reading multiple charge types from Gaussian output

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Reading multiple charge types from Gaussian output

Mohammad Mehdi Ghahremanpour
Hello Developers,

Gaussian usually prints more than one charge type in the .log file (Mulliken, ESP, Hirshfeld , etc) based on what is specified in the input file.
Based on the current gaussformat.cpp:1259,  it seems that only one charge type is added to the mol (the charge type that is the last one read from the .log file).

What I need is to read and store all the charge types.
My concern is that if I add this feature, how it will affect other parts of the code or other tools, other places that the partial charges are used to calculate energy, for example.

any comment?

Best,
Mohammad



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reading multiple charge types from Gaussian output

Geoff Hutchison
> What I need is to read and store all the charge types.
> My concern is that if I add this feature, how it will affect other parts of the code or other tools, other places that the partial charges are used to calculate energy, for example.

Partial charges are not used to calculate energy.

You're correct that at the moment, OB only has one mechanism to store atomic partial charges, albeit several charge model calculation methods.

My suggestion is to add another generic data type, either at the OBMol level or the OBAtom level. (I'd probably go with OBMol)

OBPartialChargeList - then have an std::map of std::vector<float> that stores named sets of partial charges.

Does that make sense?

-Geoff
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reading multiple charge types from Gaussian output

Mohammad Mehdi Ghahremanpour

> On Jul 10, 2017, at 8:17 PM, Geoffrey Hutchison <[hidden email]> wrote:
>
>> What I need is to read and store all the charge types.
>> My concern is that if I add this feature, how it will affect other parts of the code or other tools, other places that the partial charges are used to calculate energy, for example.
>
> Partial charges are not used to calculate energy.
>
> You're correct that at the moment, OB only has one mechanism to store atomic partial charges, albeit several charge model calculation methods.
>
> My suggestion is to add another generic data type, either at the OBMol level or the OBAtom level. (I'd probably go with OBMol)
>
> OBPartialChargeList - then have an std::map of std::vector<float> that stores named sets of partial charges.

Thanks for your comment. Your suggestion seems to work.
I was thinking about the OBAtom level by defining a PartialCharge object that has two attributes: the model of the charge and the value, then OBAtom will have a vector of the PartialCharge object like this std::vector<PartialCharge>  _pcharge

Best,
Mohammad

>
> Does that make sense?
>
> -Geoff


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reading multiple charge types from Gaussian output

Geoff Hutchison
I was thinking about the OBAtom level by defining a PartialCharge object that has two attributes: the model of the charge and the value, then OBAtom will have a vector of the PartialCharge object like this std::vector<PartialCharge>  _pcharge

That seems a bit weird. Think about how someone would want to access the data. You'd want to query the OBAtom to find out if it has the particular attribute and then get it.

If you're trying to do key/value on the OBAtom, use OBPairData (http://openbabel.org/api/2.3/classOpenBabel_1_1OBPairData.shtml) or OBPairFloatingPoint

In that case, you can easily call OBAtom *atom ->HasData("MullikenCharge")


Hope that helps,
-Geoff

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reading multiple charge types from Gaussian output

Mohammad Mehdi Ghahremanpour

On Jul 11, 2017, at 10:13 PM, Geoffrey Hutchison <[hidden email]> wrote:

I was thinking about the OBAtom level by defining a PartialCharge object that has two attributes: the model of the charge and the value, then OBAtom will have a vector of the PartialCharge object like this std::vector<PartialCharge>  _pcharge

That seems a bit weird. Think about how someone would want to access the data. You'd want to query the OBAtom to find out if it has the particular attribute and then get it.

Actually, I did not implement it on OBAtom. 
Based on my current implementation, one can write this to get the favorite partial charge.

OpenBabel::OBPcharges     *OBpc;
OBpc = (OpenBabel::OBPcharges *) mol.GetData(“Mulliken Charge”)

I need to write a few lines to read the Hirshfeld charges, too. Then I will push them all and request pull and review. 

Best,
Mohammad


If you're trying to do key/value on the OBAtom, use OBPairData (http://openbabel.org/api/2.3/classOpenBabel_1_1OBPairData.shtml) or OBPairFloatingPoint

In that case, you can easily call OBAtom *atom ->HasData("MullikenCharge")


Hope that helps,
-Geoff


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Loading...