Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
map.f90
Go to the documentation of this file.
1
3module map
4 use mesh, only : mesh_t
5 implicit none
6
8 type :: map_t
9 integer :: nel, nlv
10 integer, allocatable :: imap(:)
11 integer, allocatable :: vertex(:,:)
12 contains
14 generic :: init => init_nel_nelv, init_mesh
15 procedure, private, pass(this) :: init_common => map_init_common
16 procedure, private, pass(this) :: init_nel_nelv => map_init_nel_nelv
17 procedure, private, pass(this) :: init_mesh => map_init_mesh
18 procedure, pass(this) :: init_nel_ => map_free
20 procedure, pass(this) :: free => map_free
21 end type map_t
22
23contains
24
25 subroutine map_init_mesh(this, msh)
26 class(map_t), intent(inout) :: this
27 type(mesh_t), intent(in) :: msh
28
29 call this%free()
30
31 this%nel = msh%nelv
32 this%nlv = msh%npts
33
34 call this%init_common()
35
36 end subroutine map_init_mesh
37
38 subroutine map_init_nel_nelv(this, nel, nlv)
39 class(map_t), intent(inout) :: this
40 integer, intent(in) :: nel
41 integer, intent(in) :: nlv
42
43 call this%free()
44
45 this%nel = nel
46 this%nlv = nlv
47
48 call this%init_common()
49
50 end subroutine map_init_nel_nelv
51
52 subroutine map_init_common(this)
53 class(map_t), intent(inout) :: this
54
55 allocate(this%imap(this%nel))
56
57 allocate(this%vertex(this%nlv, this%nel))
58
59 end subroutine map_init_common
60
61 subroutine map_free(this)
62 class(map_t), intent(inout) :: this
63
64 if (allocated(this%imap)) then
65 deallocate(this%imap)
66 end if
67
68 if (allocated(this%vertex)) then
69 deallocate(this%vertex)
70 end if
71 end subroutine map_free
72
73end module map
NEKTON map.
Definition map.f90:3
subroutine map_init_nel_nelv(this, nel, nlv)
Definition map.f90:39
subroutine map_init_common(this)
Definition map.f90:53
subroutine map_init_mesh(this, msh)
Definition map.f90:26
subroutine map_free(this)
Definition map.f90:62
Defines a mesh.
Definition mesh.f90:34
NEKTON vertex mapping.
Definition map.f90:8