timedisc_generic.f90
Go to the documentation of this file.
1 !#############################################################################
2 !# #
3 !# fosite - 3D hydrodynamical simulation program #
4 !# module: mesh_generic.f90 #
5 !# #
6 !# Copyright (C) 2016 Manuel Jung <mjung@astrophysik.uni-kiel.de> #
7 !# #
8 !# This program is free software; you can redistribute it and/or modify #
9 !# it under the terms of the GNU General Public License as published by #
10 !# the Free Software Foundation; either version 2 of the License, or (at #
11 !# your option) any later version. #
12 !# #
13 !# This program is distributed in the hope that it will be useful, but #
14 !# WITHOUT ANY WARRANTY; without even the implied warranty of #
15 !# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or #
16 !# NON INFRINGEMENT. See the GNU General Public License for more #
17 !# details. #
18 !# #
19 !# You should have received a copy of the GNU General Public License #
20 !# along with this program; if not, write to the Free Software #
21 !# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
22 !# #
23 !#############################################################################
24 !----------------------------------------------------------------------------!
31 !----------------------------------------------------------------------------!
39  USE mesh_base_mod
41  USE common_dict
42 
43 CONTAINS
44 
45  SUBROUTINE new_timedisc(Timedisc,Mesh,Physics,config,IO)
46  IMPLICIT NONE
47  !------------------------------------------------------------------------!
48  CLASS(timedisc_base), ALLOCATABLE :: Timedisc
49  CLASS(mesh_base), INTENT(INOUT) :: Mesh
50  CLASS(physics_base), INTENT(IN) :: Physics
51  TYPE(DICT_TYP), POINTER :: config, IO
52  !------------------------------------------------------------------------!
53  INTEGER :: method
54  !------------------------------------------------------------------------!
55  CALL getattr(config,"method",method)
56 
57  ! allocate data
58  SELECT CASE(method)
59  CASE(modified_euler)
60  ALLOCATE(timedisc_modeuler::timedisc)
61  CASE(rk_fehlberg)
62  ALLOCATE(timedisc_rkfehlberg::timedisc)
63  CASE(cash_karp)
64  ALLOCATE(timedisc_cashkarp::timedisc)
65  CASE(dormand_prince)
66  ALLOCATE(timedisc_dormand_prince::timedisc)
67  CASE(ssprk)
68  ALLOCATE(timedisc_ssprk::timedisc)
69  CASE DEFAULT
70  ALLOCATE(timedisc_modeuler::timedisc)
71  CALL timedisc%Error("new_timedisc","Unknown timedisc integration scheme")
72  END SELECT
73 
74  ! call initialization
75  SELECT TYPE(obj => timedisc)
76  TYPE IS (timedisc_modeuler)
77  CALL obj%InitTimedisc_modeuler(mesh,physics,config,io)
78  TYPE IS (timedisc_rkfehlberg)
79  CALL obj%InitTimedisc_rkfehlberg(mesh,physics,config,io)
80  TYPE IS (timedisc_cashkarp)
81  CALL obj%InitTimedisc_cashkarp(mesh,physics,config,io)
82  TYPE IS (timedisc_dormand_prince)
83  CALL obj%InitTimedisc_dormand_prince(mesh,physics,config,io)
84  TYPE IS (timedisc_ssprk)
85  CALL obj%InitTimedisc_ssprk(mesh,physics,config,io)
86  END SELECT
87  END SUBROUTINE
88 END MODULE timedisc_generic_mod
integer, parameter, public ssprk
subroutines for Dormand-Prince method
constructor for timedisc class
integer, parameter, public modified_euler
Basic physics module.
Dictionary for generic data types.
Definition: common_dict.f90:61
integer, parameter, public rk_fehlberg
subroutines for Runge-Kutta Fehlberg method
subroutines for modified Euler i.e. Runge-Kutta methods
integer, parameter, public dormand_prince
subroutines for strong stability preserving (SSP) Runge Kutta methods
integer, parameter, public cash_karp
subroutine new_timedisc(Timedisc, Mesh, Physics, config, IO)
subroutines for embedded Runge-Kutta method