geometry_generic.f90
Go to the documentation of this file.
1 !#############################################################################
2 !# #
3 !# fosite - 3D hydrodynamical simulation program #
4 !# module: geometry_generic.f90 #
5 !# #
6 !# Copyright (C) 2016 Tobias Illenseer <tillense@astrophysik.uni-kiel.de> #
7 !# Jannes Klee <jklee@astrophysik.uni-kiel.de> #
8 !# Manuel Jung <mjung@astrophysik.uni-kiel.de> #
9 !# #
10 !# This program is free software; you can redistribute it and/or modify #
11 !# it under the terms of the GNU General Public License as published by #
12 !# the Free Software Foundation; either version 2 of the License, or (at #
13 !# your option) any later version. #
14 !# #
15 !# This program is distributed in the hope that it will be useful, but #
16 !# WITHOUT ANY WARRANTY; without even the implied warranty of #
17 !# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or #
18 !# NON INFRINGEMENT. See the GNU General Public License for more #
19 !# details. #
20 !# #
21 !# You should have received a copy of the GNU General Public License #
22 !# along with this program; if not, write to the Free Software #
23 !# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
24 !# #
25 !#############################################################################
26 !----------------------------------------------------------------------------!
34 !----------------------------------------------------------------------------!
42  USE common_dict
43 
44 ! INTERFACE geometry_base
45 ! MODULE PROCEDURE new_geometry
46 ! END INTERFACE
47 
48 CONTAINS
49 
50  SUBROUTINE new_geometry(Geometry,config)
51  IMPLICIT NONE
52  !------------------------------------------------------------------------!
53  CLASS(geometry_base), ALLOCATABLE :: Geometry
54  TYPE(DICT_TYP), POINTER :: config
55  !------------------------------------------------------------------------!
56  INTEGER :: geometry_type
57  !------------------------------------------------------------------------!
58  CALL getattr(config,"geometry",geometry_type)
59  ! allocate data
60  SELECT CASE(geometry_type)
61  CASE(cartesian)
62  ALLOCATE(geometry_cartesian::geometry)
63  CASE(cylindrical)
64  ALLOCATE(geometry_cylindrical::geometry)
65  CASE(logcylindrical)
66  ALLOCATE(geometry_logcylindrical::geometry)
67  CASE(logspherical)
68  ALLOCATE(geometry_logspherical::geometry)
69  CASE(spherical)
70  ALLOCATE(geometry_spherical::geometry)
71  CASE DEFAULT
72  CALL geometry%Error("new_geometry","Unknown geometry")
73  END SELECT
74 
75  ! call initialization
76  SELECT TYPE(geometry_child => geometry)
77  TYPE IS (geometry_cartesian)
78  CALL geometry_child%InitGeometry_cartesian(config)
79  TYPE IS (geometry_cylindrical)
80  CALL geometry_child%InitGeometry_cylindrical(config)
81  TYPE IS (geometry_logcylindrical)
82  CALL geometry_child%InitGeometry_logcylindrical(config)
83  TYPE IS (geometry_logspherical)
84  CALL geometry_child%InitGeometry_logspherical(config)
85  TYPE IS (geometry_spherical)
86  CALL geometry_child%InitGeometry_spherical(config)
87  END SELECT
88  END SUBROUTINE
89 END MODULE geometry_generic_mod
integer, parameter, public logspherical
defines properties of a 3D logspherical mesh
defines properties of a 3D logcylindrical mesh
defines properties of a 3D cylindrical mesh
defines properties of a 3D spherical mesh
constructor for geometry class
integer, parameter, public cartesian
base class for geometrical properties
integer, parameter, public logcylindrical
subroutine new_geometry(Geometry, config)
defines properties of a 3D cartesian mesh
integer, parameter, public spherical
Dictionary for generic data types.
Definition: common_dict.f90:61
integer, parameter, public cylindrical