Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
filter_fctry.f90
Go to the documentation of this file.
1! Copyright (c) 2025, 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!
33submodule(filter) filter_fctry
35 use pde_filter, only : pde_filter_t
37 implicit none
38
39 ! List of all possible types created by the factory routine
40 character(len=20) :: FILTER_KNOWN_TYPES(2) = [character(len=20) :: &
41 "elementwise", &
42 "PDE"]
43
44contains
50 module subroutine filter_factory(object, type_name, json, coef)
51 class(filter_t), allocatable, intent(inout) :: object
52 character(len=*), intent(in) :: type_name
53 type(coef_t), intent(in) :: coef
54 type(json_file), intent(inout) :: json
55 character(len=:), allocatable :: type_string
56
57 if (allocated(object)) then
58 deallocate(object)
59 else if (trim(type_name) .eq. 'elementwise') then
60 allocate(elementwise_filter_t::object)
61 else if (trim(type_name) .eq. 'PDE') then
62 allocate(pde_filter_t::object)
63 else
64 call neko_type_error("filter type: ", type_name, &
65 filter_known_types)
66 end if
67
68 call object%init(json, coef)
69 end subroutine filter_factory
70
71end submodule filter_fctry
Implements elementwise_filter_t.
Filter to be applied to a scalar field.
Definition filter.f90:38
A PDE based filter.
Utilities.
Definition utils.f90:35
character(:) function, allocatable, public concat_string_array(array, sep, prepend)
Concatenate an array of strings into one string with array items separated by spaces.
Definition utils.f90:294
subroutine, public neko_type_error(base_type, wrong_type, known_types)
Reports an error allocating a type for a particular base pointer class.
Definition utils.f90:251
Implements the elementwise filter for SEM.
A PDE based filter mapping $\rho \mapsto \tilde{\rho}$, see Lazarov & O. Sigmund 2010,...