Neko  0.9.0
A portable framework for high-order spectral element flow simulations
rhs_maker_fctry.f90
Go to the documentation of this file.
1 ! Copyright (c) 2022-2024, 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 !
34 submodule(rhs_maker) rhs_maker_fctry
42 
43 contains
44 
49  module subroutine rhs_maker_sumab_fctry(object)
50  class(rhs_maker_sumab_t), allocatable, intent(inout) :: object
51 
52  if (allocated(object)) then
53  deallocate(object)
54  end if
55 
56  if (neko_bcknd_sx .eq. 1) then
57  allocate(rhs_maker_sumab_sx_t::object)
58  else if (neko_bcknd_device .eq. 1) then
59  allocate(rhs_maker_sumab_device_t::object)
60  else
61  allocate(rhs_maker_sumab_cpu_t::object)
62  end if
63 
64  end subroutine rhs_maker_sumab_fctry
65 
69  module subroutine rhs_maker_ext_fctry(object)
70  class(rhs_maker_ext_t), allocatable, intent(inout) :: object
71 
72  if (allocated(object)) then
73  deallocate(object)
74  end if
75 
76  if (neko_bcknd_sx .eq. 1) then
77  allocate(rhs_maker_ext_sx_t::object)
78  else if (neko_bcknd_device .eq. 1) then
79  allocate(rhs_maker_ext_device_t::object)
80  else
81  allocate(rhs_maker_ext_cpu_t::object)
82  end if
83 
84  end subroutine rhs_maker_ext_fctry
85 
89  module subroutine rhs_maker_bdf_fctry(object)
90  class(rhs_maker_bdf_t), allocatable, intent(inout) :: object
91 
92  if (allocated(object)) then
93  deallocate(object)
94  end if
95 
96  if (neko_bcknd_sx .eq. 1) then
97  allocate(rhs_maker_bdf_sx_t::object)
98  else if (neko_bcknd_device .eq. 1) then
99  allocate(rhs_maker_bdf_device_t::object)
100  else
101  allocate(rhs_maker_bdf_cpu_t::object)
102  end if
103 
104  end subroutine rhs_maker_bdf_fctry
105 
109  module subroutine rhs_maker_oifs_fctry(object)
110  class(rhs_maker_oifs_t), allocatable, intent(inout) :: object
111 
112  if (allocated(object)) then
113  deallocate(object)
114  end if
115 
116  if (neko_bcknd_sx .eq. 1) then
117  allocate(rhs_maker_oifs_sx_t::object)
118  else
119  allocate(rhs_maker_oifs_cpu_t::object)
120  end if
121 
122  end subroutine rhs_maker_oifs_fctry
123 
124 end submodule rhs_maker_fctry
Build configurations.
Definition: neko_config.f90:34
integer, parameter neko_bcknd_sx
Definition: neko_config.f90:39
integer, parameter neko_bcknd_device
Definition: neko_config.f90:44
Routines to generate the right-hand sides for the convection-diffusion equation. Employs the EXT/BDF ...
Definition: rhs_maker.f90:38