physics_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 #
7!# Manuel Jung <mjung@astrophysik.uni-kiel.de> #
8!# #
9!# This program is free software; you can redistribute it and/or modify #
10!# it under the terms of the GNU General Public License as published by #
11!# the Free Software Foundation; either version 2 of the License, or (at #
12!# your option) any later version. #
13!# #
14!# This program is distributed in the hope that it will be useful, but #
15!# WITHOUT ANY WARRANTY; without even the implied warranty of #
16!# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or #
17!# NON INFRINGEMENT. See the GNU General Public License for more #
18!# details. #
19!# #
20!# You should have received a copy of the GNU General Public License #
21!# along with this program; if not, write to the Free Software #
22!# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
23!# #
24!#############################################################################
25!----------------------------------------------------------------------------!
34!----------------------------------------------------------------------------!
42 USE common_dict
43
44CONTAINS
45
47 SUBROUTINE new_physics(Physics,Mesh,config,IO)
48 IMPLICIT NONE
49 !------------------------------------------------------------------------!
50 CLASS(physics_base), ALLOCATABLE :: Physics
51 CLASS(mesh_base), INTENT(IN) :: Mesh
52 TYPE(dict_typ), POINTER :: config, IO
53 !------------------------------------------------------------------------!
54 INTEGER :: problem
55 !------------------------------------------------------------------------!
56 CALL getattr(config,"problem",problem)
57
58 ! allocate data
59 SELECT CASE(problem)
60 CASE(euler_isotherm)
61 ALLOCATE(physics_eulerisotherm::physics)
62 CASE(euler)
63 ALLOCATE(physics_euler::physics)
64 CASE DEFAULT
65 CALL physics%Error("physics_generic::new_physics","uninitialized or unknown physics")
66 END SELECT
67
68 ! call initialization
69 SELECT TYPE(phy => physics)
70 CLASS IS(physics_eulerisotherm) ! including derived types
71 CALL phy%InitPhysics(mesh,config,io)
72 CLASS DEFAULT
73 CALL physics%Error("physics_generic::new_physics","physics initialization failed")
74 END SELECT
75
76 END SUBROUTINE
77
78END MODULE physics_generic_mod
Dictionary for generic data types.
Definition: common_dict.f90:61
base class for mesh arrays
Definition: marray_base.f90:36
derived class for compound of mesh arrays
basic mesh module
Definition: mesh_base.f90:72
Basic physics module.
integer, parameter, public euler_isotherm
integer, parameter, public euler
physics module for 1D,2D and 3D non-isothermal Euler equations
physics module for 1D,2D and 3D isothermal Euler equations
constructor for physics class
subroutine new_physics(Physics, Mesh, config, IO)
allocate and initialize new physics class
mesh data structure
Definition: mesh_base.f90:122