Commit f16fc490 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'relaxation' into develop

Conflicts:
	io/xml/inputSchema.h.backup
parents 458fdd5c 1a89bb26
docs/mkdocs/site
init/compileinfo.h
io/xml/inputSchema.h
Testing/*
......
......@@ -36,8 +36,8 @@ SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,moments)
END DO
8000 FORMAT (/,/,10x,'spin density at the nucleus:',/,10x,'type',t25,&
'input%total',t42,'valence',t65,'core',t90,&
'majority valence and input%total density',/)
'total',t42,'valence',t65,'core',t90,&
'majority valence and total density',/)
8010 FORMAT (i13,2x,3e20.8,5x,2e20.8)
WRITE (6,FMT=8020)
......
# Welcome to FLEUR
This is the documentation of the [MaX release of FLEUR](https://www.flapw.de/pm/index.php?n=FLEUR.Downloads).
[![MaX-logo](img/MaX.png)](http://www.max-centre.eu)
For older versions of FLEUR you find the
[documentation here](https://www.flapw.de/pm/index.php?n=User-Documentation.OldDocs).
* [Installation of FLEUR](Install.md) including some hints for configuration.
* [Running FLEUR](Running.md) describes the standard workflow to perform a FLEUR calculation.
* [Using the input-generator](inpgen.md) to generate the full input out of a simple file.
* [XML based IO](xmlio.md): documentation of the input of FLEUR, its features and hints how to use them.
* [The AiiDA interface to FLEUR](http://aiida-fleur.readthedocs.io/en/develop/) can be used to generate, run and store complex workflows.
If you are a more expert user or developer, you might be interested in:
* The [Fleur gitlab repository.](https://iffgit.fz-juelich.de/fleur/fleur/)
* [Information for developers](developers.md) with the doxygen documentation of the source.
* [The doxygen documentation of the source code](https://fleur.iffgit.fz-juelich.de/fleur/html|) You will also find some hints for developing FLEUR there.
* [The coverage analysis](https://fleur.iffgit.fz-juelich.de/fleur/coverage_html) of the source code showing which part of the code are covered by the standard tests.
* Discussion of reasons why v27 gives [differences](v26differences.md) to v26.
* A [Guide/Manual](developers.md) for developers of FLEUR.
Configuration and Installation of FLEUR
=========================================
We are aware of the fact that installing FLEUR can be a tricky task on many machines. While we tried to make the process
as userfriendly as possible, there are still a couple of challenges you might encounter. Please check with your system administrator to
see if all requirements for using FLEUR can be fulfilled on your system. For help register at the [MailingList](support.md) and post your questions there.
If you manage to compile on some system that can be of general interest, please consider to adjust the 'machines.md' file in the docs (Or report to fleur@fz-juelich.de if you do not know how to do that).
* [QuickInstall](#quick-guide)
* [Requirements](#requirements)
* [The configure.sh script & cmake](#configure)
* [How to adjust to your configuration](#how-to-adjust-the-configuration)
* [Running the automatic tests](#ci-tests)
#Quick guide
If you are extremely lucky (and/or your system is directly supported by us) installation can be very simple:
* run the configuration script `'PATH_TO_SOURCE_CODE/configure.sh`. You can do that in any directory in which the 'build' directory should be created. The script accepts some useful arguments, you can run the script with `configure.sh -h` to get a list of supported arguments.
* The script creates the build directory and runs cmake. If all goes well (look at the output) you can then change to the build directory and run `cd build; make`
* If make does not report any error you are done!
Please be aware that there are different executables that could be be build:
* `inpgen`: The input generator used to construct the full input file for FLEUR
* `fleur`: A serial version (i.e. no MPI distributed memory parallelism, multithreading might still be used)
* `fleur_MPI`: A parallel version of FLEUR able to run on multiple nodes using MPI.
Usually only the serial or the MPI version will be build. You can run the MPI-version in serial while it is of course not possible to use the non-MPI version with MPI.
You might want to [run the automatic tests](#ci-tests).
#Requirements
There are a couple of external dependencies in the build process of FLEUR.
**Required are:**
* *cmake*: The build process uses cmake to configure FLEUR. You should have at least version 3.0. Some options might require newer versions. Cmake is available for free at [www.cmake.org](http://www.cmake.org).
* *Compilers*: You will need a Fortran compiler and a corresponding C-compiler (i.e. the two have to be able to work together via the iso-c bindings of Fortran). Please check our [list of compilers](#compilers) to see if your compiler should work.
* *BLAS/LAPACK*: These standard linear algebra libraries are required. You should try your best not to use a reference implementation from [Netlib](http://www.netlib.org) but look for an optimized version for your system. In general compiler and/or hardware vendors provide optimized libraries such as the MKL (Intel) or ESSL (IBM). If you do not have access to those, check [openBLAS](http://www.openbas.net).
* *libxml2*: this is a standard XML-library that is available on most systems. If it is missing on your computer you should really complain with your admin. *Please note that you might need a development package of this library as well.* To compile this library yourself, see [xmlsoft.org](http://xmlsoft.org).
**Optional**:
FLEUR can benefit significantly if the following further software components are available. Please be aware that some of these can be difficult to use for FLEUR and see the [Instructions for adjusting your configuration](#configure) for details on how to provide input into the build process to use these libraries.
* *MPI*: Probably most important is the possibility to compile a version of FLEUR running on multiple nodes using MPI. If you have a proper MPI installation on your system this should be straightforward to use.
* *HDF5*: FLEUR can use the HDF5 library for input/output. This is useful in two situations. On the one hand you might want to use HDF5 for reading/writing your charge density files to avoid having a machine-dependent format that can prevent portability. Also the HDF5 IO gives you some more features here. On the other hand you have to use parallel-HDF5 if you do IO of the eigenvectors in a MPI parallel calculation. This is needed if you can not store the data in memory or want to preprocess the eigenvectors. Please be aware that you need the Fortran-90 interface of the HDF5!
* *SCALAPACK/ELPA*: If you use MPI and want to solve a single eigenvalue problem with more than a single MPI-Task, you need a Library with a distributed memory eigensolver. Here you can use the SCALAPACK or [[http://elpa.mpcdf.mpg.de/|ELPA]] library. Please note that the ELPA library changed its API several times, hence you might see problems in compiling with it.
* *MAGMA*: FLEUR can also use the MAGMA library to run on GPUs. If you intend to use this feature, please get in contact with us.
You should also check the output of `configure.sh -h` for further dependencies and hints.
#Configure
The `configure.sh` script found in the main FLEUR source directory can (and should) be used to start the configuration of FLEUR.
It is called as
`configure.sh [-l LABEL ] [-d] [CONFIG]`
The most used options are:
* -l LABEL specifies a label for the build. This is used to custimize the build-directory to build.LABEL and can be used
to facilitate different builds from the same source.
* -d specifies a debugging build.
* CONFIG is a string to choose one of the preconfigured configurations. It can be useful if you find one which matches your setup.
More options are available. Please check the output of `configure.sh -h`
The `configure.sh` script performs the following steps:
1. It creates a subdirectory called 'build' or 'build.LABEL'. If this directory is already present, the old directory will be overwritten.
2. It copies the CONFIG dependent configuration into this directory (this is actually done in the script 'cmake/machines.sh'). The special choice of "AUTO" for CONFIG will not provide any further configuration but relies completely on cmake. You can specify a config.cmake file in the working directory (from which you call configure.sh) to modify this AUTO mode.
3 Finally cmake is run in the build directory to determine your configuration.
If you specify -d as argument of configure.sh, the string "debug" will be added to LABEL and a debugging version of FLEUR will be build, i.e. the corresponding compiler switches will be set.
#How to adjust the Configuration
While `cmake` and the `configure.sh` script can determine the correct compilation switches automatically in some cases (mostly those known to us), in many other instances
fine-tuning is needed. In particular you might have to:
* provide hints on which compiler to use
* provide hints on how to use libraries.
## Setting of the compiler to use
By defining the environment variables FC and CC to point to the Fortran and C compiler you can make sure that cmake uses the correct compilers. E.g. you might want to say
`export FC=mpif90`.
Please be aware that the use of CONFIG specific settings might overwrite the environment variable.
###Adding flags for the compiler
This should be done using the `-flag` option to `configure.sh`. So for example you might want to say `configure.sh -flag "-r8 -nowarn"`.
In general for a compiler [not known](#compilers) in cmake/compilerflags.cmake you need at least an option to specify the promotion of standard real variables to double precision (like the `-r8`). But additional switches can/should be used.
###Adding include directories
For libraries with a Fortran-90 interface, ELPA, HDF5, MAGMA, ... you probably will have to give an include path. This can
be achieved using the `-includedir` option. So you might want to say something like
`configure.sh -includedir SOMEPATH`
###Adding linker flags
To add flags to the linker you can do
* add a directory in which the linker looks for libraries with `-libdir SOMEDIR`
* add the corresponding link option(s) with e.g. `-link "-lxml2;-llapack;-lblas"`. Please note that the specification is different from the compiler switches as different switches are separated by ';'.
### Further options:
There are more options you might find useful. Please
check `configure.sh -h` for a list.
##Compilers
FLEUR is known to work with the following compilers:
**INTEL**:
The Intel Fortran compilers (ifort) is able to compile FLEUR. Depending on the version you might experience the following problems:
1. Versions <13.0 will most probably not work correctly
2. Version 19.0 has issues with the debugging version of FLEUR.
**GFortran:**
GFortran is knwon to work with versions newer thant 6.3.
**PGI:**
The PGI compilers also can compile FLEUR. Here you need ad least version 18.4 but might still run into some problems.
#CI-Tests
After the build was finished you might want to run the automatic test.
Just type `ctest` in the build directory for this purpose.
Please note:
* The tests run on the computer you just compiled on. Hence a cross-compiled executable will not run.
* You can use the environment variables `juDFT_MPI` to specify any additional command needed to start FLEUR_MPI. E.g. say `export juDFT_MPI="mpirun -n2 " `to run with
two MPI tasks.
* You can use the environment variable `juDFT` to give command line arguments to FLEUR. E.g. say `export juDFT='-mem'`.
* To run a specific test only (or a range of tests) use the `-I` option of ctest (check `ctest -h` for details)
* The tests are run in Testing/work. You can check this directory to see why a specific test fails.
This diff is collapsed.
FLEUR development team
----------------------
FLEUR is mainly developed at the Forschungszentrum Jülich at the Institute of Advanced Simulation and the Peter Grünberg Institut.
# IMPRESSUM
Forschungszentrum Jülich GmbH
Wilhelm-Johnen-Straße
52428 Jülich
Postanschrift:
52425 Jülich
Lieferanschrift:
Leo-Brandt-Straße
52428 Jülich
Eingetragen im Handelsregister des Amtsgerichts Düren Nr. HR B 3498
Umsatzsteuer-Id-Nr. gem. § 27 a Umsatzsteuergesetz: DE 122624631
Steuer-Nr.: 213/5700/0033
Geschäftsführung:
Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender)
Karsten Beneke (Stellvertr. Vorsitzender)
Prof. Dr. Sebastian M. Schmidt
Prof. Dr. Harald Bolt
Vorsitzender des Aufsichtsrats:
Ministerialdirektor Dr. Karl Eugen Huthmacher
Verantwortlicher nach § 55, Abs. 2, Rundfunkstaatsvertrag:
Prof. Dr. Stefan Blügel
IAS-1/PGI-1
Forschungszentrum Jülich
Wilhelm-Johnen-Straße, 52428 Jülich
Kontakt:
Telefon-Sammel-Nr. 02461 61-0
Internet: http://www.fz-juelich.de
Mailadresse: info@fz-juelich.de
##Haftungsausschluss
Inhalt der eigenen Seiten
Wir haben die Internet-Seiten sorgfältig zusammengestellt. Allerdings übernehmen wir keine Gewähr oder Haftung für die Aktualität, Vollständigkeit und Richtigkeit der angebotenen Informationen.
Links auf externe Web-Seiten
Die Internet-Seiten enthalten Links auf die Web-Seiten Dritter. Diese Links auf die Web-Seiten Dritter stellen keine Zustimmung zu deren Inhalt dar. Wir haben keinen Einfluss auf die aktuelle oder zukünftige Gestaltung dieser Seiten. Wir übernehmen daher keine Haftung für die Verfügbarkeit oder den Inhalt solcher Web-Seiten und keine Haftung für Schäden, die aus der Nutzung solcher Inhalte entstehen.
##Datenschutz:
Bei jedem Zugriff eines Nutzers auf eine Seite aus dem Angebot der Forschungszentrum Jülich GmbH und bei jedem Abruf einer Datei werden Daten über diesen Vorgang in einer Protokolldatei gespeichert. Diese Daten sind nicht personenbezogen; wir können also nicht nachvollziehen, welcher Nutzer welche Daten abgerufen hat. Personenbezogene Nutzerprofile können daher nicht gebildet werden. Die gespeicherten Daten werden nur zu statistischen Zwecken ausgewertet. Eine Weitergabe an Dritte findet im Falle eines solchen Zugriffs nicht statt.
[Weitere Informationen zum Datenschutz](http://www.fz-juelich.de/portal/DE/datenschutz/_node.html)
Welcome to the developers documentation of FLEUR
========================
These pages are complementing the <A HREF="http://www.flapw.de/pm/index.php?n=User-Documentation.Documentation"> User documentation </A> in which the actual use of FLEUR is documented.
Here we collect information useful for developers or advanced users that actually will modify the source code.
## GitLab
The development process is performed using gitlab. You can access the <A HREF="https://iffgit.fz-juelich.de/fleur/fleur"> main gitlab page here.</A>
If you checkout the code please be aware that there are several branches. The release branch contains the code of the last release published on <A HREF="http://www.flapw.de/pm/index.php?n=FLEUR.Downloads"> the FLEUR webpage</A>. You can *not* push to this branch directly.
You probably want to use the development branch to insert your changes. If your changes are large, it might be a good idea to create your own branch first.
Contributors guide
======================================
Everyone is very welcome to contribute to the enhancement of FLEUR.
Please use the [gitlab service] (https://iffgit.fz-juelich.de/fleur/fleur) to obtain the
latest development version of FLEUR.
##Coding rules for FLEUR:
In no particular order we try to collect items to consider when writing code for FLEUR
- Instead of 'stop' use calls to judft_error, judft_warn, judft_end
- Do not read and write any files. Files are neither replacements for common-blocks nor a
storage for status variables.
Only exceptions:
+ you create nice IO subroutines in the subdirectory io
+ you write to the typical FLEUR output files
Useful info for developers
==============================================
## Using fleur with the HDF5 library and debugging it with valgrind
HDF5 has to be built with the same compiler that is also used to compile fleur. If adapted the following commands can be used to compile a HDF5 library for fleur:
+ 'FC=/usr/local/intel/impi/4.0.3.008/intel64/bin/mpiifort CC=/usr/local/intel/impi/4.0.3.008/intel64/bin/mpiicc CXX=/usr/local/intel/impi/4.0.3.008/intel64/bin/mpiicc ./configure --enable-fortran --enable-fortran2003 --enable-parallel --enable-using-memchecker --enable-clear-file-buffers'
+ 'make'
+ 'make install'
+ 'make check' (optional)
Note:
+ The paths have to be adjusted such that that compiler is used which is also used to compile fleur.
+ The parallel switch is not needed for every calculation: Only for parallel calculations in which HDF5 is also used for the eigenvector IO.
+ The last two command line switches in the configure command turn on initializations of irrelevant array parts in HDF5. If valgrind is not needed it is probably the better choice to leave them away. If left away valgrind will complain about missing initializations in the HDF5 library.
+ valgrind gives partially strange behavior if used together with the intel compiler. It would be better to use it together with gfortran.
+ At the moment HDF5 is needed in version 1.8.*. Usage of version 1.10.* yields some problems.
Furthermore to configure and start fleur with HDF5 the following has to be done:
+ In your .bashrc the HDF5 library has to be added to the LD_LIBRARY_PATH. This implies a line like 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/hdf5/current/hdf5/lib'
+ configure fleur with some line like 'CMAKE_Fortran_FLAGS="-I~/hdf5/current/hdf5/include" FLEUR_LIBRARIES="-L~/hdf5/current/hdf5/lib;-lhdf5_fortran;-lhdf5" ./fleur/configure.sh IFF'
Downloads of the FLEUR code
====================================
![](http://www.flapw.de/pm/datapool/pics/linie_570.jpg)
![](http://www.flapw.de/pm/uploads/FLEUR/max.png)
![](http://www.flapw.de/pm/datapool/pics/linie_570.jpg)
Within the [MaX project](http://www.max-centre.eu) we created a series of FLEUR-releases which can be downloaded here:
* [FLEUR MaX Release 3 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR3.tgz) Current as of 30/06/2018
* [FLEUR MaX Release 2.1 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR2.1.tgz) Current as of 30/11/2017
* [FLEUR MaX Release 2 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR2.tgz) Current as of 31/08/2017
* [FLEUR MaX Release 1.3 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR1.3.tgz) Current as of 27/06/2017
* [FLEUR MaX Release 1.2 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR1.2.tgz) Current as of 04/05/2017
* [FLEUR MaX Release 1.1 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR1.1.tgz) Current as of 06/12/2016
* [FLEUR MaX Release 1 of Version 0.27](http://www.flapw.de/pm/uploads/FLEUR/fleurMaXR1.tgz) Current as of 31/08/2016
Quantum Mobile -- A virtual machine with all MaX-codes and AiiDA installed can be found on [Github](https://github.com/marvel-nccr/quantum-mobile/releases).
There is also a page with a few [[BinariesDownloads| precompiled binaries]].
After downloading the source we strongly recommend to have a look at the [[User-Documentation/Documentation]].
http://www.flapw.de/pm/datapool/pics/linie_570.jpg
[+ Releases of older FLEUR versions: +]
(You have to [[Main.Registration|register]] first to obtain a userID for these Downloads)
[+ Here you can download the FLEUR code +]
* [[http://www.flapw.de/WIKI-links/v22.tar.gz | Version 0.22]] Current as of 26/10/2001
* [[http://www.flapw.de/WIKI-links/v23.tar.gz | Version 0.23]] Current as of 25/02/2005
* [[http://www.flapw.de/WIKI-links/v24_NIC.tgz | Version 0.24]] Current as of 14/02/2006 (Version used at NIC winterschool 2006)
* [[http://www.flapw.de/WIKI-links/v25.tgz | Version 0.25]] Current as of 05/07/2006
* [[http://www.flapw.de/WIKI-links/v26e.tgz | Version 0.26]] Current as of 02/02/2017 ([[VesNotes | update]] v0.26e)
[+ Useful helpers +]
* [[http://www.flapw.de/WIKI-links/scripts.tgz | Scripts archive]] Current as of Feb 15, 2005
->Please note that assembly of these script is a task i.tgz Version 0.25n progress.
->The contents of this archive are preliminary and may change with time.
->Currently, it contains: \
scripts [[Symmetry Of Bands | band3xmgr]] and [[User-Documentation.CalculatingTheBandStructure | kptsgen.pl]], program [[User-Documentation.SortingBandsInABandStructurePlot | sortbands.f.]]
* [[http://www.flapw.de/WIKI-links/Sso-08-2009.tar.gz | Archive]] Current as of Sep 16, 2009
-> containing an external program for the analysis of the SOC matrix elements when calculating [[User-Documentation.SsoHowto | spin-spirals + SOC]].
[+ Beta versions +]
* [[http://www.flapw.de/WIKI-links/v25g.tgz | Version 0.25g]] Current as of 08/06/2009 \
(last [[Bug-fixes | bugfix]] from 24/02/2010)
* [[http://www.flapw.de/WIKI-links/v26b.tgz | Version 0.26b]] Version as of 06/12/2011 \
(containing complete wannier-part, [[Bug-fixes | bugfixes]] and some new functionality)
* [[http://www.flapw.de/WIKI-links/v26d.tgz | Version 0.26d]] Version as of 26/10/2012 \
(including spin-spirals & SOC, some new functionality for inpgen and [[Bug-fixes | bugfixes]])
* [[http://www.flapw.de/WIKI-links/wann_v25h.tgz | Wannier-version 0.25h]] Current as of 20/11/2009
* [[http://www.flapw.de/WIKI-links/fleur_v27_beta.tgz| Beta Version 0.27]] Current as of 19/09/2014 (includes new IO module with the option to keep more data in memory and first OpenMP parallel parts)
# Welcome to the FLEUR-project
This is the homepage of FLEUR, a feature-full, freely available FLAPW (full potential linearized augmented planewave) code, based on density-functional theory.
The FLAPW-Method (Full Potential Linearized Augmented Plane Wave Method) is an all-electron method which within density functional theory is universally applicable to all atoms of the periodic table and to systems with compact as well as open structures. It is widely considered to be the most precise electronic structure method in solid state physics.
FLEUR is one of the flagship codes of the MaX-Centre of Excellence. Within MaX we aim at creating a new FLEUR version fit for the challenges of high-throughput and exascale computing.
[![MaX-logo](img/MaX.png)](http://www.max-centre.eu)
Please feel free to [download](downloads.md) and [run our code](Docu-Main.md).
Fleur is part of the [juDFT family](http://www.judft.de) of codes developed in Jülich.
This diff is collapsed.
#Support for FLEUR-users
We have established a mailing list for all users and developers of the FLEUR code. To subscribe to the list simply send a mail to <fleur-join@fz-juelich.de>.
\ No newline at end of file
#Differences between FLEUR v0.26 and v0.27
v0.27 is a major refactoring of FLEUR. Hence one can expect new errors, fixed bugs and in general slightly different results from this release. Here a list of factors that typically lead to changed results:
* When using inpgen new defaults have been set. This will usually result in more LOs and can change results.
* The behaviour of qpw_to_nmt is changed when using inp.xml. There is a new cutoff parameter for the l-expansion which is usually set to 0. This will change the core-tail correction and the generation of the starting charge density. Setting it to a large enough value (>=lmax) will switch back to the old behaviour.
* The previous precompiler option CPP_CORE is now standard. It can be switched in inp.xml.
* The precision of the eV-to-Hartree conversion factor increased. It was 27.2 in the old fleur version and now is 27.21138602. This factor is relevant for the generation of data files for DOS and bandstructure plots.
* The precision of the core solver has been increased. This will also have an influence on the starting density and the energy parameters.
\ No newline at end of file
This diff is collapsed.
site_name: FLEUR
repo_url: https://iffgit.fz-juelich.de/fleur/fleur/
site_url: https://www.flapw.de/s/
repo_name: GIT
edit_url: edit/develop/docs/mkdocs/
nav:
- Welcome: index.md
- Further support: support.md
- User Guide:
- Overview: Docu-Main.md
- Installation: Install.md
- Running FLEUR: Running.md
- The input-generator: inpgen.md
- The FLEUR input file: xmlio.md
- The FLEUR-AiiDA interface: http://aiida-fleur.readthedocs.io/en/develop/
- Developers Infomation:
- Fleur-GITLAB: https://iffgit.fz-juelich.de/fleur/fleur/
- The DOXYGEN documentation of the source code: https://fleur.iffgit.fz-juelich.de/fleur/html
- The coverage analysis: https://fleur.iffgit.fz-juelich.de/fleur/coverage_html
- Developers Guide/Manual: developers.md
- About/Impressum: about.md
set(fleur_F77 ${fleur_F77}
force/relax.F
#force/relax.F
)
set(fleur_F90 ${fleur_F90}
force/bfgs0.f90
force/bfgs.f90
#force/bfgs0.f90
#force/bfgs.f90
force/force_b8.f90
force/force_0.f90
#force/force_0.f90
force/force_a12.f90
force/force_a21.F90
force/force_a21_U.f90
......@@ -16,7 +16,9 @@ force/force_a4_add.f90
force/force_a8.F90
force/force_b8.f90
force/force_sf.F90
force/force_w.f90
force/geo.f90
force/force_w.F90
force/fix_by_gaussian.F90
#force/geo.f90
force/stern.f90
force/relaxation.F90
)
!--------------------------------------------------------------------------------
! Copyright (c) 2019 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_fix_by_gaussian
USE m_judft
IMPLICIT NONE
CONTAINS
SUBROUTINE fix_by_gaussian(shift,atoms,stars,mpi,sym,vacuum,sphhar,input,oned,cell,noco,den)
!The idea of this fix is to add an Gaussian to the INT which make the charge flat at the MT-boundary and to
!shift this Gaussian with the displacement.
USE m_qfix
USE m_spgrot
USE m_constants
USE m_types
IMPLICIT NONE
REAL,INTENT(in) :: shift(:,:)
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_potden),INTENT(INOUT):: den
REAL :: slope1,slope2,dr,alpha
REAL :: sigma,a_fac,gauss,x,fix
INTEGER :: kr(3,sym%nop)
COMPLEX :: sf,phas(sym%nop)
INTEGER :: js,n,l,k,nat,j
DO js=1,input%jspins
DO n=1,atoms%ntype
DO l=0,0 !Currently only l=0
! alpha = LOG( den%mt(atoms%jri(n)-1,l,n,js) / den%mt(atoms%jri(n),l,n,js) )
! alpha = SQRT(alpha / ( atoms%rmt(n)*atoms%rmt(n)*( 1.0-EXP( -2.0*atoms%dx(n) ) ) ))
! A_fac= den%mt(atoms%jri(n),l,n,js)/gaussian_r(atoms%rmt(n),alpha)
dr=atoms%rmsh(atoms%jri(n)-1,n)-atoms%rmsh(atoms%jri(n),n)
slope1=(den%mt(atoms%jri(n)-1,l,n,js)/atoms%rmsh(atoms%jri(n)-1,n)**2-den%mt(atoms%jri(n),l,n,js)/atoms%rmsh(atoms%jri(n),n)**2)/dr
slope1=(den%mt(atoms%jri(n)-1,l,n,js)-den%mt(atoms%jri(n),l,n,js))/dr/atoms%rmt(n)**2
sigma=atoms%rmt(n)/2.0
alpha=1/sigma
slope2=(gaussian_r(atoms%rmsh(atoms%jri(n)-1,n),alpha)-gaussian_r(atoms%rmsh(atoms%jri(n),n),alpha))/dr
A_fac=slope1/slope2
PRINT *, a_fac, 1/alpha
DO k=2,stars%ng3
gauss=A_fac*gaussian_g(stars%sk3(k),alpha)
CALL spgrot(sym%nop,sym%symor,sym%mrot,sym%tau,sym%invtab,stars%kv3(:,k),kr,phas)
DO nat=SUM(atoms%neq(:n-1))+1,SUM(atoms%neq(:n))
sf=0.0
DO j = 1,sym%nop
x=-tpi_const*DOT_PRODUCT(1.*kr(:,j),atoms%taual(:,nat))
sf = sf + CMPLX(COS(x),SIN(x))*CONJG(phas(j))
x=-tpi_const*DOT_PRODUCT(1.*kr(:,j),atoms%taual(:,nat)+shift(:,nat))
sf = sf - CMPLX(COS(x),SIN(x))*CONJG(phas(j))
ENDDO
ENDDO
den%pw(k,js)=den%pw(k,js)+gauss*sf/sym%nop/cell%omtil
ENDDO
ENDDO
END DO
END DO
CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
den,noco%l_noco,mpi%isize==1,force_fix=.TRUE.,fix=fix,fix_pw_only=.true.)
END SUBROUTINE fix_by_gaussian
FUNCTION gaussian_r(r,alpha)
REAL,INTENT(IN) :: r,alpha
real :: gaussian_r
gaussian_r=EXP(-r**2*alpha**2)
END FUNCTION gaussian_r
FUNCTION gaussian_g(g,alpha)
USE m_constants
REAL,INTENT(IN) :: g,alpha
REAL :: gaussian_g
gaussian_g=SQRT(pi_const**3)/alpha**3*EXP(-0.25*g**2/alpha**2)
END FUNCTION gaussian_g
END MODULE m_fix_by_gaussian
This diff is collapsed.
!--------------------------------------------------------------------------------
! Copyright (c) 2019 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_forcew
! ************************************************************
! Printing force components
! ************************************************************
CONTAINS
SUBROUTINE force_w(mpi,input,atoms,sym,results,cell,oneD,vacuum)
USE m_types
USE m_xmlOutput
USE m_relaxation
IMPLICIT NONE
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_results),INTENT(INOUT):: results
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_input),INTENT(IN) :: input
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_vacuum),INTENT(IN) :: vacuum
! ..
! .. Local Scalars ..
REAL,PARAMETER:: zero=0.0
REAL sum
INTEGER i,jsp,n,nat1,ierr
REAL eps_force
LOGICAL :: l_new,l_relax
! ..
! .. Local Arrays ..
REAL forcetot(3,atoms%ntype)
CHARACTER(LEN=20) :: attributes(7)
#ifdef CPP_MPI
include 'mpif.h'
#endif
!
! write spin-dependent forces
!
IF (mpi%irank==0) THEN
nat1 = 1
DO n = 1,atoms%ntype
IF (atoms%l_geo(n)) THEN
IF (input%jspins.EQ.2) THEN
DO jsp = 1,input%jspins
WRITE (6,FMT=8000) jsp,n, (atoms%pos(i,nat1),i=1,3),&
& (results%force(i,n,jsp),i=1,3)
END DO
END IF
8000 FORMAT ('SPIN-',i1,1x,'FORCE FOR ATOM TYPE=',i3,2x,'X=',f7.3,&
& 3x,'Y=',f7.3,3x,'Z=',f7.3,5x,' FX_SP =',f9.6,' FY_SP =',&
& f9.6,' FZ_SP =',f9.6)
ENDIF
nat1 = nat1 + atoms%neq(n)
END DO
!
! write total forces
!
WRITE (6,8005)
8005 FORMAT (/,' ***** TOTAL FORCES ON ATOMS ***** ',/)
IF (input%l_f) CALL openXMLElement('totalForcesOnRepresentativeAtoms',(/'units'/),(/'Htr/bohr'/))
nat1 = 1
DO n = 1,atoms%ntype
IF (atoms%l_geo(n)) THEN
DO i = 1,3
forcetot(i,n) = zero
END DO
DO jsp = 1,input%jspins
DO i = 1,3
forcetot(i,n) = forcetot(i,n) + results%force(i,n,jsp)
END DO
END DO
WRITE (6,FMT=8010) n, (atoms%pos(i,nat1),i=1,3),&
& (forcetot(i,n),i=1,3)
8010 FORMAT (' TOTAL FORCE FOR ATOM TYPE=',i3,2x,'X=',f7.3,3x,'Y=',