Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
ax.f90
Go to the documentation of this file.
1! Copyright (c) 2020-2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
35 use utils, only : neko_typename_len
36 use num_types, only : rp
37 use coefs, only : coef_t
38 use space, only : space_t
39 use mesh, only : mesh_t
40 implicit none
41 private
42
44 type, public, abstract :: ax_t
45 contains
46 procedure(ax_compute), pass(this), deferred :: compute
47 procedure(ax_compute_vector), pass(this), deferred :: compute_vector
48 procedure, pass(this) :: free => ax_free
49 end type ax_t
50
51 interface
52
56 module subroutine ax_helm_allocator(object, type_name)
57 class(ax_t), allocatable, intent(inout) :: object
58 character(len=*), intent(in) :: type_name
59 end subroutine ax_helm_allocator
60 end interface
61
62 !
63 ! Machinery for injecting user-defined types
64 !
65
69 abstract interface
70 subroutine ax_helm_allocate(obj)
71 import ax_t
72 class(ax_t), allocatable, intent(inout) :: obj
73 end subroutine ax_helm_allocate
74 end interface
75
76 interface
77
78 module subroutine register_ax_helm(type_name, allocator)
79 character(len=*), intent(in) :: type_name
80 procedure(ax_helm_allocate), pointer, intent(in) :: allocator
81 end subroutine register_ax_helm
82 end interface
83
85 type ax_helm_allocator_entry
86 character(len=NEKO_TYPENAME_LEN) :: type_name
87 procedure(ax_helm_allocate), pointer, nopass :: allocator
88 end type ax_helm_allocator_entry
89
91 type(ax_helm_allocator_entry), allocatable :: ax_helm_registry(:)
92
94 integer :: ax_helm_registry_size = 0
95
96 public :: ax_helm_allocator, register_ax_helm, ax_helm_allocate
97
105 abstract interface
106 subroutine ax_compute(this, w, u, coef, msh, Xh)
107 import space_t
108 import mesh_t
109 import coef_t
110 import ax_t
111 import rp
112 implicit none
113 class(ax_t), intent(in) :: this
114 type(space_t), intent(in) :: Xh
115 type(mesh_t), intent(in) :: msh
116 type(coef_t), intent(in) :: coef
117 real(kind=rp), intent(inout) :: w(xh%lx, xh%ly, xh%lz, msh%nelv)
118 real(kind=rp), intent(in) :: u(xh%lx, xh%ly, xh%lz, msh%nelv)
119 end subroutine ax_compute
120 end interface
121
133 abstract interface
134 subroutine ax_compute_vector(this, au, av, aw, u, v, w, coef, msh, Xh)
135 import space_t
136 import mesh_t
137 import coef_t
138 import ax_t
139 import rp
140 implicit none
141 class(ax_t), intent(in) :: this
142 type(space_t), intent(in) :: Xh
143 type(mesh_t), intent(in) :: msh
144 type(coef_t), intent(in) :: coef
145 real(kind=rp), intent(inout) :: au(xh%lx, xh%ly, xh%lz, msh%nelv)
146 real(kind=rp), intent(inout) :: av(xh%lx, xh%ly, xh%lz, msh%nelv)
147 real(kind=rp), intent(inout) :: aw(xh%lx, xh%ly, xh%lz, msh%nelv)
148 real(kind=rp), intent(in) :: u(xh%lx, xh%ly, xh%lz, msh%nelv)
149 real(kind=rp), intent(in) :: v(xh%lx, xh%ly, xh%lz, msh%nelv)
150 real(kind=rp), intent(in) :: w(xh%lx, xh%ly, xh%lz, msh%nelv)
151 end subroutine ax_compute_vector
152 end interface
153
154contains
155
161 subroutine ax_free(this)
162 class(ax_t), intent(inout) :: this
163 end subroutine ax_free
164
165end module ax_product
Abstract interface for computing inside a Krylov method, taking 3 components of a vector field in a ...
Definition ax.f90:134
Abstract interface for computing inside a Krylov method.
Definition ax.f90:106
Defines a Matrix-vector product.
Definition ax.f90:34
subroutine ax_free(this)
Release resources held by a matrix-vector product.
Definition ax.f90:162
Coefficients.
Definition coef.f90:34
Defines a mesh.
Definition mesh.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Defines a function space.
Definition space.f90:34
Utilities.
Definition utils.f90:35
integer, parameter, public neko_typename_len
Definition utils.f90:44
Base type for a matrix-vector product providing .
Definition ax.f90:44
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:136
The function space for the SEM solution fields.
Definition space.f90:64