TABLE OF CONTENTS


ABINIT/m_ga [ Modules ]

[ Top ] [ Modules ]

NAME

  m_ga

FUNCTION

  This module provides several routines and datatypes for the
  Genetic algorithm stochastic search implementation.

COPYRIGHT

 Copyright (C) 2012-2018 ABINIT group (MT)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

PARENTS

SOURCE

20 #if defined HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23 
24 #include "abi_common.h"
25 
26 MODULE m_ga
27 
28  use defs_basis
29  use defs_abitypes
30  use m_errors
31  use m_abicore
32 
33  !use m_results_img, only : results_img_type, gather_array_img
34 
35  implicit none
36 
37  private
38 
39 !public procedures
40  public :: ga_init
41  public :: ga_destroy
42  public :: ga_nullify

m_ga/ga_destroy [ Functions ]

[ Top ] [ m_ga ] [ Functions ]

NAME

  ga_destroy

FUNCTION

  Destroy the content of a datastructure of type ga_type.

INPUTS

OUTPUT

SIDE EFFECTS

  ga_param=datastructure of type ga_type.
            parameters for Genetic algorithm search.

PARENTS

      gstateimg

CHILDREN

SOURCE

150 subroutine ga_destroy(ga_param)
151 
152 
153 !This section has been created automatically by the script Abilint (TD).
154 !Do not modify the following lines by hand.
155 #undef ABI_FUNC
156 #define ABI_FUNC 'ga_destroy'
157 !End of the abilint section
158 
159  implicit none
160 
161 !Arguments ------------------------------------
162 !scalars
163  type(ga_type),intent(inout) :: ga_param
164 
165 !************************************************************************
166 
167  if(allocated(ga_param%ga_iatfix))then
168    ABI_DEALLOCATE(ga_param%ga_iatfix)
169  endif
170  call ga_nullify(ga_param)
171 
172 end subroutine ga_destroy

m_ga/ga_init [ Functions ]

[ Top ] [ m_ga ] [ Functions ]

NAME

  ga_init

FUNCTION

  Initialize a datastructure of type ga_type.

INPUTS

  dtset <type(dataset_type)>=all input variables in current dataset

OUTPUT

SIDE EFFECTS

  ga_param=datastructure of type ga_type.
            several parameters for Genetic Algorithm random search.

PARENTS

      gstateimg

CHILDREN

SOURCE

 95 subroutine ga_init(dtset,ga_param)
 96 
 97 
 98 !This section has been created automatically by the script Abilint (TD).
 99 !Do not modify the following lines by hand.
100 #undef ABI_FUNC
101 #define ABI_FUNC 'ga_init'
102 !End of the abilint section
103 
104  implicit none
105 
106 !Arguments ------------------------------------
107 !scalars
108  type(dataset_type),target,intent(in) :: dtset
109  type(ga_type),intent(inout) :: ga_param
110 
111 !************************************************************************
112 
113  if(dtset%imgmov==4)then
114    ga_param%ga_n_rules           = dtset%ga_n_rules
115    ga_param%ga_rules(:)          = dtset%ga_rules
116    ga_param%ga_fitness           = dtset%ga_fitness
117    ga_param%ga_opt_percent       = dtset%ga_opt_percent
118    ga_param%ga_algor             = dtset%ga_algor
119    ABI_ALLOCATE(ga_param%ga_iatfix,(3,dtset%natom))
120    ga_param%ga_iatfix            = dtset%iatfix
121  end if
122 
123 end subroutine ga_init

m_ga/ga_nullify [ Functions ]

[ Top ] [ m_ga ] [ Functions ]

NAME

  ga_nullify

FUNCTION

  Nullify the content of a datastructure of type ga_type.

INPUTS

OUTPUT

SIDE EFFECTS

  ga_param=datastructure of type ga_type.
            several parameters for Genetic algorithm search.

PARENTS

      m_ga

CHILDREN

SOURCE

199 subroutine ga_nullify(ga_param)
200 
201 
202 !This section has been created automatically by the script Abilint (TD).
203 !Do not modify the following lines by hand.
204 #undef ABI_FUNC
205 #define ABI_FUNC 'ga_nullify'
206 !End of the abilint section
207 
208  implicit none
209 
210 !Arguments ------------------------------------
211 !scalars
212  type(ga_type),intent(inout) :: ga_param
213 
214 !************************************************************************
215 
216  ga_param%ga_start  = -1
217  ga_param%ga_n_rules   = -1
218 ! ga_param%ga_algor     = -1
219  ga_param%ga_opt_percent  = zero
220  ga_param%ga_rules(:) = -1
221 
222 end subroutine ga_nullify

m_ga/ga_type [ Types ]

[ Top ] [ m_ga ] [ Types ]

NAME

 ga_type

FUNCTION

 Datatype with the variables required to perform GA random search

NOTES

SOURCE

56  type,public :: ga_type
57 ! Scalars
58   integer  :: ga_start     ! Starting iteration for the Genetic algorithm
59   integer  :: ga_n_rules   ! Number of genetic rules chosen by the user
60   integer  :: ga_fitness   ! Fitness function chosen by the user
61   integer  :: ga_algor     ! Genetic algorithm
62   real(dp) :: ga_opt_percent   ! Percentage of the population that passes from one iteration to the next
63 ! Arrays same dimension as defined for the whole data input data structure
64   integer  :: ga_rules(30)         ! Genetic rules chosen by the user
65   integer,allocatable  :: ga_iatfix(:,:)  ! defined fixed atoms and directions
66  end type ga_type