DOUG 0.2

globals.F90

Go to the documentation of this file.
00001 ! DOUG - Domain decomposition On Unstructured Grids
00002 ! Copyright (C) 1998-2006 Faculty of Computer Science, University of Tartu and
00003 ! Department of Mathematics, University of Bath
00004 !
00005 ! This library is free software; you can redistribute it and/or
00006 ! modify it under the terms of the GNU Lesser General Public
00007 ! License as published by the Free Software Foundation; either
00008 ! version 2.1 of the License, or (at your option) any later version.
00009 !
00010 ! This library is distributed in the hope that it will be useful,
00011 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 ! Lesser General Public License for more details.
00014 !
00015 ! You should have received a copy of the GNU Lesser General Public
00016 ! License along with this library; if not, write to the Free Software
00017 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 ! or contact the authors (University of Tartu, Faculty of Computer Science, Chair
00019 ! of Distributed Systems, Liivi 2, 50409 Tartu, Estonia, http://dougdevel.org,
00020 ! mailto:info(at)dougdevel.org)
00021 
00022 !--------------------------------------------------
00023 ! module : globals
00024 !          globaly defined:
00025 !            MPI, log stream, control & some others
00026 !          variables
00027 !--------------------------------------------------
00028 module globals
00029 
00030   use parameters
00031   use RealKind
00032 
00033   implicit none
00034 
00035 #include<doug_config.h>
00036 
00037   include 'mpif.h'
00038 
00039   integer, parameter :: pointerk=SIZEOF_VOID_P !< kind corresponding to basic integer  type capable of holding any pointer
00040 
00041   real(kind=xyzk), parameter :: eps=0.000000001_xyzk
00042 
00043   ! Stdout control
00044   integer :: D_MSGLVL   = 2 ! messaging level
00045   integer :: D_DEBUGLVL = 0 ! debugging output
00046 
00047   ! DOUG control file
00048   character(100) :: D_CtrlFileName = 'DOUG.dat'
00049 
00050   ! Master log file name - parallel mode.
00051   ! Can be overwritten with "-q file_name" option.
00052   character(100) :: D_PMASTER_LOG_FN = 'log.0'
00053 
00054   ! Master log file name - serial mode.
00055   ! Can be overwritten with "-q file_name" option.
00056   character(100) :: D_SMASTER_LOG_FN = 'log.DOUG'
00057 
00058   ! profile file name prefix
00059   ! Can be overwritten with "-p file_name" option.
00060   character(100) :: D_PROF_FN = 'prof'
00061 
00062   ! MPI:
00063   integer :: D_INIT_TYPE
00064   integer :: numprocs
00065   integer :: myrank = 0
00066   logical :: D_MPI_WAS_INITED = .false.
00067   integer :: MPI_rkind
00068   integer :: MPI_ckind
00069   integer :: MPI_fkind
00070   integer :: MPI_xyzkind
00071 
00072   ! Log stream
00073   integer :: stream = 6      ! print to stdout
00074   logical :: master_stdout = .true.
00075   logical :: slave_stdout  = .false.
00076 
00077   ! Profiling file stream
00078   integer :: pstream = 55
00079 
00080   integer, parameter, private :: L = 150
00081 
00082   !----------------------------------
00083   ! Shared general control parameters
00084   !----------------------------------
00085   type SharedCtrlData
00086      integer       :: solver           = -1
00087      integer       :: method           = -1
00088      integer       :: fine_method      = -1
00089      integer       :: num_iters        = -1
00090      integer       :: coarse_method    = -1
00091      integer       :: num_subdomains   = -1
00092      integer       :: levels           = -1
00093      integer       :: overlap          = -1
00094      integer       :: smoothers        = -1
00095      integer       :: input_type       = -1
00096      integer       :: grid_size        = -1
00097      integer       :: matrix_type      = -1
00098      integer       :: initial_guess    = -1
00099      integer       :: number_of_blocks = -1
00100      integer       :: radius1          = -1
00101      integer       :: radius2          = -1
00102      integer       :: minasize1        = -1
00103      integer       :: minasize2        = -1
00104      integer       :: maxasize1        = -1
00105      integer       :: maxasize2        = -1
00106      integer       :: debug            = -1
00107      integer       :: verbose          = -1
00108      integer       :: plotting         = -1
00109      real(kind=rk) :: strong1          = -1.0_rk
00110      real(kind=rk) :: strong2          = -1.0_rk
00111      real(kind=rk) :: solve_tolerance  = -1.0_rk
00112      integer       :: solve_maxiters   = -1
00113      logical       :: symmstruct       = .false.
00114      logical       :: symmnumeric      = .false.
00115      integer       :: interpolation_type  = -1 ! bilinear
00116      logical       :: useAggregatedRHS = .false. ! Not set in control file. Depends on whether
00117                                                  ! mctls%assembled_rhs_file exists in filesystem.
00118   end type SharedCtrlData
00119   !
00120   ! global variable:
00121   !
00122   type(SharedCtrlData), save :: sctls
00123   ! Derived MPI type to represent 'SharedCtrlData' type
00124   integer              :: D_MPI_SCTLS_TYPE
00125 
00126   !---------------------------------
00127   ! Mater general control parameters
00128   !---------------------------------
00129   type MasterCtrlData
00130      ! elemental input data
00131      character(L) :: assembled_mtx_file   = '' ! assembled matrix data
00132      integer      :: assembled_mtx_format = -1 ! 0 == text, 2 == XDR
00133      character(L) :: assembled_rhs_file   = '' ! assembled matrix RHS
00134      integer      :: assembled_rhs_format = -1 ! 0 == text, 1 == binary(TODO:, 2 == like in matrix)
00135      character(L) :: info_file            = '' ! info data for the mesh
00136      character(L) :: elemmat_rhs_file     = '' ! elemental matrix and RHS
00137      character(L) :: freedom_lists_file   = ''
00138      character(L) :: coords_file          = ''
00139      character(L) :: freemap_file         = ''
00140      character(L) :: freedom_mask_file    = '' ! block system
00141      character(L) :: start_vec_file       = '' ! initial estimate in a file
00142      character(L) :: solution_file        = ''
00143      integer      :: start_vec_type       = -1
00144      integer      :: solution_format      = -1 ! 0 == text, 1 == binary(TODO:, 2 == like in matrix)
00145      logical      :: dump_matrix_only     = .false. ! dump matrix after assembling and exit?
00146      character(L) :: dump_matrix_file     = ''
00147 
00148      ! Geom. Coarse grid parameters
00149      integer       :: maxcie           = -1
00150      integer       :: maxnd            = -1
00151      integer       :: cutbal           = -1
00152      integer       :: center_type      = -1
00153      logical       :: hanging_nodes    = .false.
00154   end type MasterCtrlData
00155   !
00156   ! global variable:
00157   !
00158   type(MasterCtrlData), save :: mctls
00159 
00160   type indlist
00161     integer :: ninds
00162     integer,dimension(:),pointer :: inds
00163   end type indlist
00164 
00165 end module globals