41 character(len=20) :: AVM_KNOWN_TYPES(1) = [character(len=20) :: &
50 module subroutine avm_factory(object, type_name,
case, json)
51 class(avm_t),
allocatable,
intent(inout) :: object
52 character(len=*),
intent(in) :: type_name
53 class(case_t),
intent(inout),
target :: case
54 type(json_file),
intent(inout) :: json
55 character(len=:),
allocatable :: type_string
57 call avm_allocator(object, type_name)
58 call object%init(
case, json)
59 end subroutine avm_factory
64 module subroutine avm_allocator(object, type_name)
65 class(avm_t),
allocatable,
intent(inout) :: object
66 character(len=*),
intent(in) :: type_name
69 if (
allocated(object))
then
74 select case (trim(type_name))
75 case (
'entropy_viscosity')
78 do i = 1, avm_registry_size
79 if (trim(type_name) == trim(avm_registry(i)%type_name))
then
80 call avm_registry(i)%allocator(object)
86 type_name, avm_known_types)
89 end subroutine avm_allocator
96 module subroutine register_avm(type_name, allocator)
97 character(len=*),
intent(in) :: type_name
98 procedure(avm_allocate),
pointer,
intent(in) :: allocator
99 type(allocator_entry),
allocatable :: temp(:)
102 do i = 1,
size(avm_known_types)
103 if (trim(type_name) .eq. trim(avm_known_types(i)))
then
109 do i = 1, avm_registry_size
110 if (trim(type_name) .eq. trim(avm_registry(i)%type_name))
then
117 if (avm_registry_size == 0)
then
118 allocate(avm_registry(1))
120 allocate(temp(avm_registry_size + 1))
121 temp(1:avm_registry_size) = avm_registry
122 call move_alloc(temp, avm_registry)
125 avm_registry_size = avm_registry_size + 1
126 avm_registry(avm_registry_size)%type_name = type_name
127 avm_registry(avm_registry_size)%allocator => allocator
128 end subroutine register_avm
130end submodule artificial_viscosity_model_fctry
Defines a simulation case.
Implements the entropy-based artificial viscosity model.
subroutine, public neko_type_registration_error(base_type, wrong_type, known)
subroutine, public neko_type_error(base_type, wrong_type, known_types)
Reports an error allocating a type for a particular base pointer class.
Entropy-based artificial viscosity model for compressible flow.