Skip to content

Commit

Permalink
Merge pull request #1434 from bhourahine/hybridStressStop
Browse files Browse the repository at this point in the history
Trap for missing stress with hybrids
  • Loading branch information
bhourahine committed Apr 11, 2024
2 parents cec361b + 93f6ce4 commit c16ab71
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 41 deletions.
3 changes: 2 additions & 1 deletion src/dftbp/dftbplus/initprogram.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,8 @@ subroutine initProgramVariables(this, input, env)

! requires stress to already be possible and it being a periodic calculation
! with forces
this%tStress = (this%tPeriodic .and. this%tForces .and. .not.this%tNegf .and. this%tStress)
this%tStress = (this%tPeriodic .and. this%tForces .and. .not.this%tNegf .and. this%tStress&
& .and. .not. this%isHybridXc)

this%nMovedAtom = input%ctrl%nrMoved
this%nMovedCoord = 3 * this%nMovedAtom
Expand Down
7 changes: 7 additions & 0 deletions src/dftbp/dftbplus/parser.F90
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,9 @@ subroutine readDriver(node, parent, geom, ctrl)
ctrl%BarostatStrength = 0.0_dp
call getChild(node, "Barostat", child, requested=.false.)
if (associated(child)) then
if (allocated(ctrl%hybridXcInp)) then
call detailedError(node, "Barostating not currently implemented for hybrid functionals")
end if
if (ctrl%nrMoved /= geom%nAtom) then
call error("Dynamics for a subset of atoms is not currently&
& possible when using a barostat")
Expand Down Expand Up @@ -953,6 +956,10 @@ subroutine commonGeoOptions(node, ctrl, geom, atomsRange, isMaxStepNeeded)

call getChildValue(node, "LatticeOpt", ctrl%tLatOpt, .false.)
if (ctrl%tLatOpt) then
if (allocated(ctrl%hybridXcInp)) then
call detailedError(node, "Lattice optimisation not currently implemented for hybrid&
& functionals")
end if
call getChildValue(node, "Pressure", ctrl%pressure, 0.0_dp, modifier=modifier, child=child)
call convertUnitHsd(char(modifier), pressureUnits, child, ctrl%pressure)
call getChildValue(node, "FixAngles", ctrl%tLatOptFixAng, .false.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ forces :real:2:3,6
0.841660967120195E-002 0.697051031432246E-001 0.513195666348540E-001
-0.620943202995113E-002 0.634863771762222E-001 0.275900765775735E-001
0.497820956029776E-001 -0.891614303165121E-001 -0.445325050423699E-001
stress :real:2:3,3
-0.281999257658939E-005 -0.158116756538915E-005 0.102667636911802E-005
-0.156358396136917E-005 -0.252276970467409E-004 -0.522593971446003E-005
0.114245562571053E-005 -0.471287324240145E-005 -0.129752725811918E-003
mermin_energy :real:0:
-0.948497872629297E+001
end_coords :real:2:3,6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ forces :real:2:3,24
0.493238878787503E-015 -0.959662094714747E-002 0.923325535891134E-003
-0.269250933995395E-015 0.720775339666282E-002 0.518856670313658E-005
-0.450523667348162E-015 -0.719861523598164E-002 -0.936432014589893E-003
stress :real:2:3,3
0.755590898324902E-015 -0.189935845010847E-028 0.000000000000000E+000
-0.505614948936562E-024 -0.117762105292865E-008 -0.145094833627475E-009
-0.103626319007240E-022 -0.144659133375066E-009 0.559114273422329E-008
mermin_energy :real:0:
-0.369576859354938E+002
end_coords :real:2:3,24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ forces :real:2:3,24
0.493238878787503E-015 -0.959662094714747E-002 0.923325535891134E-003
-0.269250933995395E-015 0.720775339666282E-002 0.518856670313658E-005
-0.450523667348162E-015 -0.719861523598164E-002 -0.936432014589893E-003
stress :real:2:3,3
0.755590898324902E-015 -0.189935845010847E-028 0.000000000000000E+000
-0.505614948936562E-024 -0.117762105292865E-008 -0.145094833627475E-009
-0.103626319007240E-022 -0.144659133375066E-009 0.559114273422329E-008
mermin_energy :real:0:
-0.369576859354938E+002
end_coords :real:2:3,24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ forces :real:2:3,6
0.841660967120195E-002 0.697051031432246E-001 0.513195666348540E-001
-0.620943202995113E-002 0.634863771762222E-001 0.275900765775735E-001
0.497820956029776E-001 -0.891614303165121E-001 -0.445325050423699E-001
stress :real:2:3,3
-0.281999257658939E-005 -0.158116756538915E-005 0.102667636911802E-005
-0.156358396136917E-005 -0.252276970467409E-004 -0.522593971446003E-005
0.114245562571053E-005 -0.471287324240145E-005 -0.129752725811918E-003
mermin_energy :real:0:
-0.948497872629297E+001
end_coords :real:2:3,6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ forces :real:2:3,6
0.490814414093120E-001 0.689735135036105E-001 0.959798797873647E-001
-0.924262124944980E-002 0.232218750518948E+000 0.857296606840727E-001
0.938494492111061E-001 -0.177009363276372E+000 -0.877839911175921E-001
stress :real:2:3,3
-0.674095774857295E-005 -0.360531043796975E-005 0.343569648098372E-005
-0.359597537879627E-005 -0.828906667405799E-004 -0.821376769563750E-005
0.350845297205745E-005 -0.791977911498074E-005 -0.227688487849422E-003
mermin_energy :real:0:
-0.128558094165303E+002
end_coords :real:2:3,6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ forces :real:2:3,6
-0.154838545150892E-002 0.833123500998445E-001 0.102729355302494E-001
0.408344670576044E-002 0.394272079707581E+000 0.126300821241770E+000
-0.329638582134210E-001 0.147473193591006E+000 -0.549694766448895E-002
stress :real:2:3,3
0.122230902158787E-005 -0.687135951653311E-005 0.409370727878236E-005
-0.685421381117794E-005 0.169600681378801E-004 0.123588330362186E-004
0.423611578595749E-005 0.130163090530549E-004 -0.516524942088586E-004
mermin_energy :real:0:
-0.926212417308193E+001
end_coords :real:2:3,6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ forces :real:2:3,6
-0.307830339046029E-002 0.723949733495977E-001 0.270782304449810E-001
-0.269126109792879E-002 0.793805739166834E-001 0.504923173775043E-001
-0.240518378954985E-001 0.105740086928808E+000 -0.130951813750250E-001
stress :real:2:3,3
0.738061845006802E-006 -0.481962470220905E-005 0.190589688228491E-005
-0.479019782201099E-005 0.202081325354995E-006 0.229470360298319E-005
0.201193025664104E-005 0.224556383825435E-005 0.203526301219277E-004
mermin_energy :real:0:
-0.909710016832326E+001
end_coords :real:2:3,6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ forces :real:2:3,6
-0.307830339046029E-002 0.723949733495977E-001 0.270782304449810E-001
-0.269126109792879E-002 0.793805739166834E-001 0.504923173775043E-001
-0.240518378954985E-001 0.105740086928808E+000 -0.130951813750250E-001
stress :real:2:3,3
0.738061845006802E-006 -0.481962470220905E-005 0.190589688228491E-005
-0.479019782201099E-005 0.202081325354995E-006 0.229470360298319E-005
0.201193025664104E-005 0.224556383825435E-005 0.203526301219277E-004
mermin_energy :real:0:
-0.909710016832326E+001
end_coords :real:2:3,6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ forces :real:2:3,48
0.173915854201560E-002 0.578944820816400E-002 0.419946079869956E-003
0.458366266793410E-002 0.412820938522018E-003 -0.446265655259587E-002
-0.253065808366456E-002 0.289574034634869E-002 0.350199532970742E-002
stress :real:2:3,3
0.263269711953852E-003 0.193483529876307E-014 -0.183212067691962E-014
0.162827533779606E-014 0.408303206956582E-003 -0.880483910343211E-015
0.397758224151406E-015 0.714146595131474E-016 0.266694692658430E-003
mermin_energy :real:0:
-0.589841478128182E+002
end_coords :real:2:3,48
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ forces :real:2:3,48
0.173915854220047E-002 0.578944820859538E-002 0.419946079940238E-003
0.458366266809072E-002 0.412820938622417E-003 -0.446265655278975E-002
-0.253065808383862E-002 0.289574034663917E-002 0.350199533001377E-002
stress :real:2:3,3
0.263269711953544E-003 0.160733664759151E-014 -0.209355959048147E-014
0.149725566887498E-014 0.408303206956204E-003 -0.921743650861119E-015
0.471214975994564E-015 -0.213959479251713E-015 0.266694692660646E-003
mermin_energy :real:0:
-0.589841478128179E+002
end_coords :real:2:3,48
Expand Down

0 comments on commit c16ab71

Please sign in to comment.