Hi Mickaël,

I've needed to do this myself at some point, but I ended up using the
OpenBabel forcefield code directly (this is actually how the
ForceField extension works). AFAIK, there is no way to access an
extension's members from within another extension.

See http://openbabel.org/dev-api/classOpenBabel_1_1OBForceField.shtml
for more, here's one of the examples for a geo opt with conjugate
gradients and MMFF94:

      #include <openbabel/forcefield.h>
      #include <openbabel/mol.h>

      ......

      OBMol mol;
      OBForceField* pFF = OBForceField::FindForceField("MMFF94");
      // Make sure we have a valid pointer
      if (!pFF)
      // exit...
      pFF->SetLogFile(&cerr);
      pFF->SetLogLevel(OBFF_LOGLVL_LOW);
      if (!pFF->Setup(mol)) {
      cerr << "ERROR: could not setup force field." << endl;
      }
      // Perform the actual minimization, maximum 1000 steps
      pFF->ConjugateGradients(1000);
      ......

(The OBMol object can be obtained from your avogadro molecule via
Avogadro::Molecule::OBMol(), then just copy coordinates back or use
setOBMol())

Hope this helps,
Dave

On Mon, Jun 6, 2011 at 4:40 AM, Mickaël Gadroy <[email protected]> wrote:
>
> Hi,
>
>   I would use the method to optimize a geometry (ForceFieldCommand class). 
> But it is a part of an extension with many dependencies and without 
> accessibility. Is there a way to use it easily ?
>
> Regards,
> Mickaël Gadroy
> WebRep
> Overall rating
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Discover what all the cheering's about.
> Get your free trial download today.
> http://p.sf.net/sfu/quest-dev2dev2
> _______________________________________________
> Avogadro-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/avogadro-devel
>

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Avogadro-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Reply via email to