Reading multiple charge types from Gaussian output

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

find out

elizadd
This post has NOT been accepted by the mailing list yet.
In reply to this post by Mohammad Mehdi Ghahremanpour
I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!
find out
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

browse around these guys

robertfcrocker
This post has NOT been accepted by the mailing list yet.
In reply to this post by Geoff Hutchison
Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks
browse around these guys
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

you can check here

elizadd
This post has NOT been accepted by the mailing list yet.
In reply to this post by Mohammad Mehdi Ghahremanpour
This is a great article thanks for sharing this informative information.
I will visit your blog regularly for some latest post.
you can check here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

you can check here

elizadd
This post has NOT been accepted by the mailing list yet.
In reply to this post by Geoff Hutchison
Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon!
you can check here
Loading...