geometry optimization with constraints

174 views
Skip to first unread message

Drew Parsons

unread,
Aug 3, 2021, 10:04:04 PM8/3/21
to NWChem Forum
I'm trying to calculate energies controlling the distance between 2 specific atoms. So I want to perform a geometry optimization with the constraint of a fixed distance (bond length) between the two atoms.

I've learnt how to do this using
  geometry
    ...
    zcoord
      bond 1 2 3.14 constant
    end
  end

This approach using zcoord should work best for me. But I understood from https://nwchemgit.github.io/Constraints.html that it should be possible to achieve a similar result using CONSTRAINTS with a spring bond. I'd like to understand how to apply that approach.

When I try adding a constraints section, it seems to get ignored.  The spring bond is read in, but it does not affect the geometry optimization.

Here is a sample input file, attempting to construct a distorted water geometry with the second OH bond constrained to 3.14 a0 using a stiff spring with constant k=100 au.

start water
 title "water test bond length control"
 charge 0
 geometry  noautosym
  O     -1.58195    1.23767    0.00626
  H     -0.76502    0.97602    0.69485
  H     -1.24809    2.02345   -0.68735
 end
 basis
   * library def2-svpd
 end
 CONSTRAINTS fixedbond
   spring bond  7 15 100  3.14
 END
 SCF
   direct
   maxiter 100
   noprint "final vectors analysis"
 end
 driver
  xyz
 end
 task scf optimize

But it optimizes to standard symmetric water with bond lengths 1.7826 au.
What needs to be done to apply the spring bond constraint?

Edoardo Aprà

unread,
Aug 3, 2021, 10:25:20 PM8/3/21
to NWChem Forum
"name - optional keyword that associates a name with a given set of constraints. Any unnamed set of constraints will be given a name default and will be automatically loaded prior to a calculation. Any constraints with the name other than default will have to be loaded manually using SET directive."
This should translate in the following input section in your case
CONSTRAINTS fixedbond
   spring bond  1 2 100  3.14
 END

set constraints  fixedbond

Drew Parsons

unread,
Aug 4, 2021, 10:34:14 AM8/4/21
to NWChem Forum
I see it, thanks Edoardo.  That means it also works without "set constraints  fixedbond", if I don't provide the label to the constraints section.

 (the constrained atoms should have been 1 and 2 of course as you noticed, not 7 and 15
)
Reply all
Reply to author
Forward
0 new messages