Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
mapping_fctry.f90
1
34!
36submodule(mapping) mapping_fctry
37 use utils, only: neko_type_error
39 use pde_filter, only: pde_filter_t
41 use json_utils, only : json_get
42 use utils, only : concat_string_array, neko_error
43 implicit none
44
45 ! List of all possible types created by the factory routine
46 character(len=20) :: MAPPING_KNOWN_TYPES(3) = [character(len=20) :: &
47 "linear", &
48 "PDE_filter", &
49 "RAMP"]
50
51contains
52
56 module subroutine mapping_factory(object, json, coef)
57 class(mapping_t), allocatable, intent(inout) :: object
58 type(json_file), intent(inout) :: json
59 type(coef_t), intent(inout) :: coef
60 character(len=:), allocatable :: type_name
61
62 call json_get(json, "type", type_name)
63
64 select case (trim(type_name))
65 case ("linear")
66 allocate(linear_mapping_t::object)
67 case ("PDE_filter")
68 allocate(pde_filter_t::object)
69 case ("RAMP")
70 allocate(ramp_mapping_t::object)
71 case default
72 call neko_type_error("Mapping function", type_name, mapping_known_types)
73 end select
74
75 ! Initialize
76 call object%init(json, coef)
77
78 end subroutine mapping_factory
79
80end submodule mapping_fctry
A linear mapping of coefficients.
Mappings to be applied to a scalar field.
Definition mapping.f90:36
A PDE based filter.
A RAMP mapping of coefficients.
A linear mapping of coefficients $f(x) = f_{min} + (f_{max} - f_{min}) x$.
A PDE based filter mapping , see Lazarov & O. Sigmund 2010, by solving an equation of the form .
A RAMP mapping of coefficients This is the standard RAMP described in https://doi....