echo
start h2o

basis
  O library 6-31g*
  H library 6-31g*
end


geometry noautoz noautosym nocenter units au
 O                     0.00000000     0.00000000     0.00000000
 H                     0.23701217     0.50006465    -0.66134565
 H                     0.08518191    -0.91769081    -0.30894068
end
driver
clear
maxiter 40
end

####################################
#      TESTING HARM BONDS          #
####################################

#one spring bond
constraints 
  spring bond 1 3 5.0 1.30 
  fix atom 1:2
end
dft
 convergence energy 1d-8
end
driver
 clear
 tight
end
task dft optimize

constraints
clear
end

#two spring bonds
constraints 
  spring bond 1 3 5.0 1.30 
  spring bond 1 2 5.0 1.70 
  fix atom 1
end
dft;print low;end
driver
 clear
 tight
end
task dft optimize

constraints
clear
end

#same thing but without clearing constraints in between
geometry noautoz noautosym nocenter units au
 O                     0.00000000     0.00000000     0.00000000
 H                     0.23701217     0.50006465    -0.66134565
 H                     0.08518191    -0.91769081    -0.30894068
end

constraints 
  spring bond 1 3 5.0 1.30 
  fix atom 1:2
end
driver
 clear
 tight
end
task dft optimize

constraints 
  spring bond 1 2 5.0 1.70 
  unfix atom 2
end
driver
 clear
 tight
end
task dft optimize

constraints
clear
end

#same thing but using namespaces
geometry noautoz noautosym nocenter units au
 O                     0.00000000     0.00000000     0.00000000
 H                     0.23701217     0.50006465    -0.66134565
 H                     0.08518191    -0.91769081    -0.30894068
end

constraints one
  spring bond 1 3 5.0 1.30 
  fix atom 1:2
end

constraints two
  spring bond 1 3 5.0 1.30 
  spring bond 1 2 5.0 1.70 
  fix atom 1
end

set constraints one
driver
 clear
 tight
end
task dft optimize

set constraints two
driver
 clear
 tight
end
task dft optimize


