Line data Source code
1 : !!****m* ABINIT/m_lattice_dummy_mover
2 : !! NAME
3 : !! m_lattice_dummy_mover
4 : !!
5 : !! FUNCTION
6 : !! This module contains the dummy lattice mover.
7 : !! With this the lattice does not move. This is for test only.
8 : !!
9 : !! Datatypes:
10 : !!
11 : !! * lattice_dummy_mover_t: defines the lattice movers
12 : !!
13 : !! Subroutines:
14 : !! TODO: add this when F2003 doc style is determined.
15 : !!
16 : !!
17 : !! COPYRIGHT
18 : !! Copyright (C) 2001-2026 ABINIT group (hexu)
19 : !! This file is distributed under the terms of the
20 : !! GNU General Public License, see ~abinit/COPYING
21 : !! or http://www.gnu.org/copyleft/gpl.txt .
22 : !! For the initials of contributors, see ~abinit/doc/developers/contributors.txt .
23 : !!
24 : !! SOURCE
25 :
26 :
27 :
28 : #if defined HAVE_CONFIG_H
29 : #include "config.h"
30 : #endif
31 :
32 : #include "abi_common.h"
33 :
34 : module m_lattice_dummy_mover
35 : use defs_basis
36 : use m_abicore
37 : use m_errors
38 :
39 : use m_multibinit_dataset, only: multibinit_dtset_type
40 : use m_abstract_potential, only: abstract_potential_t
41 : use m_abstract_mover, only: abstract_mover_t
42 : use m_lattice_mover, only: lattice_mover_t
43 : use m_multibinit_cell, only: mbcell_t, mbsupercell_t
44 : use m_random_xoroshiro128plus, only: rng_t
45 : use m_hashtable_strval, only: hash_table_t
46 : !!***
47 :
48 : implicit none
49 :
50 : private
51 :
52 : type, public, extends(lattice_mover_t) :: lattice_dummy_mover_t
53 : contains
54 : procedure :: initialize
55 : procedure :: finalize
56 : procedure :: run_one_step
57 : end type lattice_dummy_mover_t
58 :
59 : contains
60 :
61 :
62 0 : subroutine initialize(self,params, supercell, rng)
63 : class(lattice_dummy_mover_t), intent(inout) :: self
64 : type(multibinit_dtset_type), target, intent(in):: params
65 : type(mbsupercell_t), target, intent(in) :: supercell
66 : type(rng_t), target, intent(in) :: rng
67 0 : call self%lattice_mover_t%initialize(params, supercell, rng)
68 0 : self%label = "Velocity Dummy lattice mover"
69 0 : end subroutine initialize
70 :
71 0 : subroutine finalize(self)
72 : class(lattice_dummy_mover_t), intent(inout) :: self
73 0 : call self%lattice_mover_t%finalize()
74 0 : end subroutine finalize
75 :
76 :
77 : !===================== run_one_step===============================!
78 : ! run one md step
79 : ! effpot: effective potential
80 : ! displacement: Should NOT be given, because it is stored in the mover already.
81 : ! strain: Should Not be given. Because 1) it is stored in the mover,
82 : ! and 2) this is a constant volume mover.
83 : ! spin: spin of atoms. Useful with spin-lattice coupling.
84 : ! lwf: lattice wannier function. Useful with lattice-lwf coupling (perhaps useless.)
85 0 : subroutine run_one_step(self, effpot,displacement, strain, spin, lwf, energy_table)
86 : class(lattice_dummy_mover_t), intent(inout) :: self
87 : class(abstract_potential_t), intent(inout) :: effpot
88 : real(dp), optional, intent(inout) :: displacement(:,:), strain(:,:), spin(:,:), lwf(:)
89 : type(hash_table_t), optional, intent(inout) :: energy_table
90 : integer :: i
91 : character(len=40) :: key
92 :
93 :
94 0 : self%forces(:, :) =0.0
95 0 : self%energy = 0.0
96 : call effpot%calculate( displacement=self%displacement, strain=self%strain, &
97 0 : & spin=spin, lwf=lwf, force=self%forces, stress=self%stress, energy=self%energy, energy_table=energy_table)
98 : ! set velocity to zero.
99 0 : do i=1, self%natom
100 : !self%current_vcart(:,i) = self%current_vcart(:,i) + &
101 : ! & (0.5_dp * self%dt) * self%forces(:,i)/self%masses(i)
102 0 : self%current_vcart(:,i)=0.0
103 : end do
104 :
105 : !self%displacement(:,:) = self%displacement(:,:)+self%current_vcart(:,:) * self%dt
106 :
107 0 : call self%get_T_and_Ek()
108 0 : if (present(energy_table)) then
109 0 : key = 'Lattice kinetic energy'
110 0 : call energy_table%put(key, self%Ek)
111 : end if
112 :
113 0 : ABI_UNUSED_A(strain)
114 0 : ABI_UNUSED_A(displacement)
115 0 : ABI_UNUSED_A(energy_table)
116 0 : end subroutine run_one_step
117 :
118 :
119 0 : end module m_lattice_dummy_mover
120 :
|