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 !----------------------------------------------------------------------------!
36  USE marray_base_mod
41 ! USE physics_euler3Dit_mod
42 ! USE physics_euler3D_mod
43 ! USE physics_euler2Dit_mod
44 ! USE physics_euler2D_mod
45  USE mesh_base_mod
46  USE common_dict
47 
48 ! INTERFACE physics_base
49 ! MODULE PROCEDURE new_physics
50 ! END INTERFACE
51 
52 CONTAINS
53 
55  SUBROUTINE new_physics(Physics,Mesh,config,IO)
56  IMPLICIT NONE
57  !------------------------------------------------------------------------!
58  CLASS(physics_base), ALLOCATABLE :: Physics
59  CLASS(mesh_base), INTENT(IN) :: Mesh
60  TYPE(DICT_TYP), POINTER :: config, IO
61  !------------------------------------------------------------------------!
62  INTEGER :: problem
63  !------------------------------------------------------------------------!
64  CALL getattr(config,"problem",problem)
65 
66  ! allocate data
67  SELECT CASE(problem)
68  CASE(euler_isotherm)
69  ALLOCATE(physics_eulerisotherm::physics)
70  CASE(euler)
71  ALLOCATE(physics_euler::physics)
72 ! CASE(EULER3D_ISOTHERM)
73 ! ALLOCATE(physics_euler3Dit::Physics)
74 ! CASE(EULER3D)
75 ! ALLOCATE(physics_euler3D::Physics)
76 ! CASE(EULER2D_ISOTHERM)
77 ! ALLOCATE(physics_euler2Dit::Physics)
78 ! CASE(EULER2D)
79 ! ALLOCATE(physics_euler2D::Physics)
80  CASE DEFAULT
81  CALL physics%Error("physics_generic::new_physics","uninitialized or unknown physics")
82  END SELECT
83 
84  ! call initialization and print some information on the screen
85  SELECT TYPE(obj => physics)
86  TYPE IS (physics_eulerisotherm)
87  CALL obj%InitPhysics_eulerisotherm(mesh,config,io)
88  CALL obj%PrintConfiguration_eulerisotherm()
89  TYPE IS (physics_euler)
90  CALL obj%InitPhysics_euler(mesh,config,io)
91  CALL obj%PrintConfiguration_euler()
92 ! TYPE IS (physics_euler3Dit)
93 ! CALL obj%InitPhysics_euler3Dit(Mesh,config,IO)
94 ! TYPE IS (physics_euler3D)
95 ! CALL obj%InitPhysics_euler3D(Mesh,config,IO)
96 ! TYPE IS (physics_euler2Dit)
97 ! CALL obj%InitPhysics_euler2Dit(Mesh,config,IO)
98 ! TYPE IS (physics_euler2D)
99 ! CALL obj%InitPhysics_euler2D(Mesh,config,IO)
100  END SELECT
101  END SUBROUTINE
102 
103 END MODULE physics_generic_mod
derived class for compound of mesh arrays
base class for mesh arrays
Definition: marray_base.f90:36
constructor for physics class
physics module for 1D,2D and 3D isothermal Euler equations
integer, parameter, public euler_isotherm
Basic physics module.
Dictionary for generic data types.
Definition: common_dict.f90:61
physics module for 1D,2D and 3D non-isothermal Euler equations
subroutine new_physics(Physics, Mesh, config, IO)
allocate and initialize new physics class
integer, parameter, public euler