Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fleur
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
52
Issues
52
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
fleur
fleur
Commits
41570f84
Commit
41570f84
authored
Feb 08, 2019
by
Daniel Wortmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input for Pulay added
parent
7ffd7fed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
10 deletions
+28
-10
io/r_inpXML.F90
io/r_inpXML.F90
+2
-0
io/xml/FleurInputSchema.xsd
io/xml/FleurInputSchema.xsd
+1
-0
main/mix.F90
main/mix.F90
+7
-3
mix/mixing_history.F90
mix/mixing_history.F90
+18
-7
No files found.
io/r_inpXML.F90
View file @
41570f84
...
...
@@ -329,6 +329,8 @@ CONTAINS
input
%
imix
=
5
CASE
(
'Anderson'
)
input
%
imix
=
7
CASE
(
"Pulay"
)
input
%
imix
=
9
CASE
DEFAULT
STOP
'Error: unknown mixing scheme selected!'
END
SELECT
...
...
io/xml/FleurInputSchema.xsd
View file @
41570f84
...
...
@@ -879,6 +879,7 @@
<xsd:enumeration
value=
"Broyden1"
/>
<xsd:enumeration
value=
"Broyden2"
/>
<xsd:enumeration
value=
"Anderson"
/>
<xsd:enumeration
value=
"Pulay"
/>
</xsd:restriction>
</xsd:simpleType>
...
...
main/mix.F90
View file @
41570f84
...
...
@@ -78,8 +78,10 @@ contains
write
(
6
,
fmt
=
'(a,f10.5)'
)
'BROYDEN SECOND MIXING'
,
input
%
alpha
case
(
7
)
write
(
6
,
fmt
=
'(a,f10.5)'
)
'ANDERSON GENERALIZED'
,
input
%
alpha
case
(
9
)
write
(
6
,
fmt
=
'(a,f10.5)'
)
'PULAY MIXING'
,
input
%
alpha
case
default
call
juDFT_error
(
"mix: input%imix =/= 0,3,5,7 "
,
calledby
=
"mix"
)
call
juDFT_error
(
"mix: input%imix =/= 0,3,5,7
,9
"
,
calledby
=
"mix"
)
end
select
if
(
input
%
jspins
==
2
.and.
input
%
imix
/
=
0
)
then
...
...
@@ -119,8 +121,10 @@ contains
!if(it>1.and.input%imix==9) CALL pulay(input%alpha,fsm,sm)
if
(
it
>
1.
and
.
(
input
%
imix
==
3.
or
.
input
%
imix
==
5.
or
.
input
%
imix
==
7
))
Call
broyden
(
input
%
alpha
,
fsm
,
sm
)
!PRINT *,"ATTENTION Broyden replaced by Pulay"
IF
(
it
>
1.
and
.
input
%
imix
==
9
)
CALL
pulay
(
input
%
alpha
,
fsm
,
sm
)
IF
(
it
>
1.
and
.
input
%
imix
==
9
)
THEN
CALL
pulay
(
input
%
alpha
,
fsm
,
sm
)
if
(
it
==
input
%
maxiter
)
call
mixing_history_limit
(
1
)
endif
!extracte mixed density
inDen
%
pw
=
0.0
;
inDen
%
mt
=
0.0
IF
(
ALLOCATED
(
inDen
%
vacz
))
inden
%
vacz
=
0.0
...
...
mix/mixing_history.F90
View file @
41570f84
...
...
@@ -10,7 +10,7 @@ MODULE m_mixing_history
INTEGER
::
iter_stored
=
0
TYPE
(
t_mixvector
),
ALLOCATABLE
::
sm_store
(:),
fsm_store
(:)
PUBLIC
::
mixing_history
,
mixing_history_reset
,
mixing_history_store
PUBLIC
::
mixing_history_open
,
mixing_history_close
PUBLIC
::
mixing_history_open
,
mixing_history_close
,
mixing_history_limit
CONTAINS
SUBROUTINE
mixing_history_open
(
mpi
,
maxiter
)
...
...
@@ -82,7 +82,7 @@ CONTAINS
endif
IF
(
iter_stored
+1
==
maxiter
.AND.
imix
.NE.
9
)
iter_stored
=
0
!This is a broyden method which has to
!be reset as soon as maxiter is reached
it
=
MIN
(
iter_stored
+1
,
maxiter
+1
)
it
=
iter_stored
+1
allocate
(
sm
(
it
),
fsm
(
it
))
CALL
sm
(
it
)
%
alloc
()
CALL
fsm
(
it
)
%
alloc
()
...
...
@@ -90,17 +90,17 @@ CONTAINS
CALL
fsm
(
it
)
%
from_density
(
outDen
)
!store the difference fsm - sm in fsm
fsm
(
it
)
=
fsm
(
it
)
-
sm
(
it
)
do
n
=
it
-1
,
1
,
-1
!Copy from storage
do
n
=
1
,
it
-1
!Copy from storage
sm
(
n
)
=
sm_store
(
n
)
fsm
(
n
)
=
fsm_store
(
n
)
ENDDO
if
(
iter_stored
<
maxiter
)
THEN
iter_stored
=
iter_stored
+1
sm_store
(
:
iter_stored
)
=
sm
(:
iter_stored
)
fsm_store
(
:
iter_stored
)
=
fsm
(:
iter_stored
)
sm_store
(
iter_stored
)
=
sm
(
iter_stored
)
fsm_store
(
iter_stored
)
=
fsm
(
iter_stored
)
else
sm_store
(:
maxiter
-1
)
=
sm
(
2
:
maxiter
)
fsm_store
(:
maxiter
-1
)
=
fsm
(
2
:
maxiter
)
sm_store
(:
maxiter
)
=
sm
(
2
:
maxiter
+1
)
fsm_store
(:
maxiter
)
=
fsm
(
2
:
maxiter
+1
)
endif
end
subroutine
mixing_history
...
...
@@ -112,6 +112,17 @@ CONTAINS
PRINT
*
,
"Reset of history"
IF
(
mpi
%
irank
==
0
)
CALL
system
(
'rm mixing_history*'
)
END
SUBROUTINE
mixing_history_reset
subroutine
mixing_history_limit
(
len
)
IMPLICIT
NONE
INTEGER
,
INTENT
(
in
)::
len
if
(
iter_stored
>
len
)
then
fsm_store
(:
len
)
=
fsm_store
(
iter_stored
-
len
+1
:
iter_stored
)
sm_store
(:
len
)
=
sm_store
(
iter_stored
-
len
+1
:
iter_stored
)
iter_stored
=
len
end
if
end
subroutine
mixing_history_limit
SUBROUTINE
mixing_history_store
(
fsm
)
IMPLICIT
NONE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment