Molcas Forum

Support and discussions for Molcas and OpenMolcas users and developers

You are not logged in.

Announcement

Welcome to the Molcas forum. You can choose an avatar and change the default style by going to "Profile" → "Personality" or "Display".

#1 2026-02-11 08:27:16

Anugraha
Member
Registered: 2025-12-17
Posts: 22

Constraint geometry optimization:Syntax error

Dear Molcas Developers,

I am perfoming a CASSCF constraint geometry optimization and i need to fix the difference in distance between two bonds during geometry optimization.
In the Gateway module of my input i have given the following constraint block.

 Constraints
 r1 = bond O7 H8
 r2 = bond H8 O9
 a = 1.0 r1 - 1.0 r2
Values
 a = -0.9 angstrom
end of constraints

However the calculation terminates with an error like this :

++ Constraints section
                                  CONSTRAINTS

********************************************************************************
 R1 = BOND O7 H8
 R2 = BOND H8 O9
 A = 1.0 R1 - 1.0 R2
VALUES
 A = -0.9 ANGSTROM
********************************************************************************


 *************************************************************
 * Values of the primitive constraints                       *
 *************************************************************
  R1     : Bond Length=  0.977221 / angstrom  1.846680 / bohr
  R2     : Bond Length=  1.865635 / angstrom  3.525539 / bohr
 ###############################################################################
 ###############################################################################
 ###                                                                         ###
 ###                                                                         ###
 ###    ERROR: Error in DefInt2                                              ###
 ###                                                                         ###
 ###                                                                         ###
 ###############################################################################
 ###############################################################################
  Line contains syntax error!
 A = 1.0 R1 - 1.0 R2                                                                                                   
--- Stop Module: slapaf at Wed Feb 11 06:54:54 2026 /rc=_RC_INPUT_ERROR_ ---


I would be thankful if anyone can suggest how to resolve this issue.

Thank You
Anugraha

Offline

#2 2026-02-11 09:35:36

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,204

Re: Constraint geometry optimization:Syntax error

Have you tried this?

a = 1.0 r1 + -1.0 r2

Offline

#3 2026-02-11 09:48:01

Anugraha
Member
Registered: 2025-12-17
Posts: 22

Re: Constraint geometry optimization:Syntax error

Ignacio wrote:

Have you tried this?

a = 1.0 r1 + -1.0 r2

Yes Sir . It is also giving the same error

********************************************************************************
 R1 = BOND O7 H8
R2 = BOND H8 O9
A = 1.0 R1 + -1.0 R2
VALUES
A = -0.9 ANGSTROM
********************************************************************************


 *************************************************************
 * Values of the primitive constraints                       *
 *************************************************************
  R1     : Bond Length=  0.977221 / angstrom  1.846680 / bohr
 R2       : Bond Length=  1.865635 / angstrom  3.525539 / bohr
 ###############################################################################
 ###############################################################################
 ###                                                                         ###
 ###                                                                         ###
 ###    ERROR: Error in DefInt2                                              ###
 ###                                                                         ###
 ###                                                                         ###
 ###############################################################################
 ###############################################################################
  Line contains syntax error!
A = 1.0 R1 + -1.0 R2                                                                                                    
--- Stop Module: slapaf at Wed Feb 11 08:45:15 2026 /rc=_RC_INPUT_ERROR_ ---

Offline

#4 2026-02-11 15:25:43

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,204

Re: Constraint geometry optimization:Syntax error

If I understand the docs correctly, for constraints you should specify the function in the VALUE part, i.e.:

Constraints
 r1 = bond O7 H8
 r2 = bond H8 O9
Values
 1.0 r1 - 1.0 r2 = -0.9 angstrom
End of Constraints

Offline

#5 2026-02-12 08:46:25

Anugraha
Member
Registered: 2025-12-17
Posts: 22

Re: Constraint geometry optimization:Syntax error

Ignacio wrote:

If I understand the docs correctly, for constraints you should specify the function in the VALUE part, i.e.:

Constraints
 r1 = bond O7 H8
 r2 = bond H8 O9
Values
 1.0 r1 - 1.0 r2 = -0.9 angstrom
End of Constraints

Thank you so much Sir. It is working.

Offline

Board footer

Powered by FluxBB 1.5.11

Last refresh: Today 09:42:10