marray_cellvector.f90
Go to the documentation of this file.
1 !#############################################################################
2 !# #
3 !# fosite - 3D hydrodynamical simulation program #
4 !# module: marray_cellvector.f90 #
5 !# #
6 !# Copyright (C) 2018 #
7 !# Tobias Illenseer <tillense@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 !----------------------------------------------------------------------------!
32 !----------------------------------------------------------------------------!
34  USE marray_base_mod
35  IMPLICIT NONE
36  !--------------------------------------------------------------------------!
37  PRIVATE
39  TYPE, EXTENDS(marray_base) :: marray_cellvector
40  REAL, DIMENSION(:,:,:,:), POINTER :: center, & !< geometric center
41  bcenter
42 
43  REAL, DIMENSION(:,:,:,:,:), POINTER :: faces, & !< cell face centers
44  corners
45  CONTAINS
46  PROCEDURE :: assignpointers
47  END TYPE
48  INTERFACE marray_cellvector
49  MODULE PROCEDURE createmarray_cellvector
50  END INTERFACE
51  !--------------------------------------------------------------------------!
52  PUBLIC :: marray_cellvector
53 
54 CONTAINS
55 
56  FUNCTION createmarray_cellvector() RESULT(new_cv)
57  IMPLICIT NONE
58  !-------------------------------------------------------------------!
59  TYPE(marray_cellvector) :: new_cv
60  !-------------------------------------------------------------------!
61  ! only set rank & dims - allocation is done, when cellvector is assigned (with =)
62  new_cv%DIMS(1) = 1+1+6+8
63  new_cv%DIMS(2) = 3
64  new_cv%RANK = 2
65  END FUNCTION createmarray_cellvector
66 
67  SUBROUTINE assignpointers(this)
68  IMPLICIT NONE
69  !------------------------------------------------------------------------!
70  CLASS(marray_cellvector),INTENT(INOUT) :: this
71  !------------------------------------------------------------------------!
72  CALL this%marray_base%AssignPointers()
73  ! assign array pointers
74  this%center => this%RemapBounds(this%data5d(:,:,:,1,:))
75  this%bcenter => this%RemapBounds(this%data5d(:,:,:,2,:))
76  this%faces => this%RemapBounds(this%data5d(:,:,:,3:8,:))
77  this%corners => this%RemapBounds(this%data5d(:,:,:,9:16,:))
78  END SUBROUTINE assignpointers
79 
80 END MODULE marray_cellvector_mod
subroutine assignpointers(this)
assign pointers of different shapes to the 1D data
base class for mesh arrays
Definition: marray_base.f90:36
basic mesh array class
Definition: marray_base.f90:64
derived mesh array class for vector cell data
type(marray_cellvector) function createmarray_cellvector()