39 '''This module creates the expected arguments for an LFRic coded
40 kernel based on the kernel metadata.
55 '''Create the kernel arguments for the supplied kernel as specified by
56 the associated kernel metadata and the kernel ordering rules
57 encoded in the ArgOrdering base class as method callbacks.
59 A PSyIR symbol table is created containing appropriate LFRic PSyIR
60 symbols to specify the arguments. If an argument is an array with
61 one or more dimension sizes specified by another argument, then
62 the associated array symbol is created so that it references the
65 Related arguments - e.g. a field has an associated dofmap - are
66 not directly connected, they must be inferred from the function
67 space names. It is not yet clear whether this would be useful or
70 TODO #928: This class should replace the current kernel stub generation
71 code when all of its methods are implemented.
73 :param kern: the kernel for which to create arguments.
74 :type kern: :py:class:`psyclone.domain.lfric.LFRicKern`
80 "integer":
"IntegerFieldDataSymbol",
81 "real":
"RealFieldDataSymbol",
82 "logical":
"LogicalFieldDataSymbol"}
85 vector_field_mapping = {
86 "integer":
"IntegerVectorFieldDataSymbol",
87 "real":
"RealVectorFieldDataSymbol",
88 "logical":
"LogicalVectorFieldDataSymbol"}
92 "gh_quadrature_xyoz":
"BasisFunctionQrXyozDataSymbol",
93 "gh_quadrature_face":
"BasisFunctionQrFaceDataSymbol",
94 "gh_quadrature_edge":
"BasisFunctionQrEdgeDataSymbol"}
97 diff_basis_mapping = {
98 "gh_quadrature_xyoz":
"DiffBasisFunctionQrXyozDataSymbol",
99 "gh_quadrature_face":
"DiffBasisFunctionQrFaceDataSymbol",
100 "gh_quadrature_edge":
"DiffBasisFunctionQrEdgeDataSymbol"}
101 _read_access = ArgumentInterface(ArgumentInterface.Access.READ)
103 def __init__(self, kern):
104 super().__init__(kern)
113 '''Call the generate base class then add the argument list as it can't
114 be appended as we go along.
116 :param var_accesses: an unused optional argument that stores \
117 information about variable accesses.
118 :type var_accesses: :\
119 py:class:`psyclone.core.VariablesAccessInfo`
122 super().
generate(var_accesses=var_accesses)
136 mapping = {ArgumentInterface.Access.READ: AccessType.READ,
137 ArgumentInterface.Access.READWRITE: AccessType.READWRITE,
138 ArgumentInterface.Access.WRITE: AccessType.WRITE}
140 for symbol
in self.
_symtab_symtab.symbols:
141 self.
appendappend(symbol.name, var_accesses,
142 mode=mapping[symbol.interface.access])
146 '''Create an LFRic cell-position object and add it to the symbol table
149 :param var_accesses: an unused optional argument that stores \
150 information about variable accesses.
151 :type var_accesses: :\
152 py:class:`psyclone.core.VariablesAccessInfo`
155 symbol = self.
_symtab_symtab.find_or_create_tag(
156 "cell", symbol_type=
LFRicTypes(
"CellPositionDataSymbol"),
161 '''Create an LFRic mesh height object and add it to the symbol table
164 :param var_accesses: an unused optional argument that stores \
165 information about variable accesses.
166 :type var_accesses: :\
167 py:class:`psyclone.core.VariablesAccessInfo`
170 symbol = self.
_symtab_symtab.find_or_create_tag(
171 "nlayers", symbol_type=
LFRicTypes(
"MeshHeightDataSymbol"),
175 def _mesh_ncell2d(self, var_accesses=None):
178 :param var_accesses: an unused optional argument that stores \
179 information about variable accesses.
180 :type var_accesses: :\
181 py:class:`psyclone.core.VariablesAccessInfo`
183 :raises NotImplementedError: as this method is not implemented.
186 raise NotImplementedError(
"TODO #928: _mesh_ncell2d not implemented")
188 def _mesh_ncell2d_no_halos(self, var_accesses=None):
191 :param var_accesses: an unused optional argument that stores \
192 information about variable accesses.
193 :type var_accesses: :\
194 py:class:`psyclone.core.VariablesAccessInfo`
196 :raises NotImplementedError: as this method is not implemented.
199 raise NotImplementedError(
200 "TODO #928: _mesh_ncell2d_no_halos not implemented")
205 :param var_accesses: an unused optional argument that stores \
206 information about variable accesses.
207 :type var_accesses: :\
208 py:class:`psyclone.core.VariablesAccessInfo`
210 :raises NotImplementedError: as this method is not implemented.
213 raise NotImplementedError(
"TODO #928: cell_map not implemented")
216 '''Create LFRic field vector arguments and add them to the symbol
217 table and argument list. Also declare the associated "undf"
218 symbol if it has not already been declared so that it can be
219 used to dimension the field vector arguments.
221 :param argvect: the field vector to add.
222 :type argvect: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
223 :param var_accesses: an unused optional argument that stores \
224 information about variable accesses.
225 :type var_accesses: :\
226 py:class:`psyclone.core.VariablesAccessInfo`
228 :raises NotImplementedError: if the datatype of the vector \
229 field is not supported.
232 fs_name = argvect.function_space.orig_name
233 undf_symbol = self.
_symtab_symtab.find_or_create_tag(
234 f
"undf_{fs_name}", fs=fs_name,
235 symbol_type=
LFRicTypes(
"NumberOfUniqueDofsDataSymbol"),
238 interface = ArgumentInterface(INTENT_MAPPING[argvect.intent])
242 except KeyError
as info:
243 message = (f
"kernel interface does not support a vector field of "
244 f
"type '{argvect.intrinsic_type}'.")
245 raise NotImplementedError(message)
from info
246 for idx
in range(argvect.vector_size):
247 tag = f
"{argvect.name}_v{idx}"
248 field_data_symbol = self.
_symtab_symtab.find_or_create_tag(
249 tag, symbol_type=field_class, dims=[Reference(undf_symbol)],
250 fs=fs_name, interface=interface)
253 argvect.metadata_index)
256 def field(self, arg, var_accesses=None):
257 '''Create an LFRic field argument and add it to the symbol table and
258 argument list. Also declare the associated "undf" symbol if it
259 has not already been declared so that it can be used to
260 dimension the field argument.
262 :param arg: the field to add.
263 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
264 :param var_accesses: an unused optional argument that stores \
265 information about variable accesses.
266 :type var_accesses: :\
267 py:class:`psyclone.core.VariablesAccessInfo`
269 :raises NotImplementedError: if the datatype of the field is \
273 fs_name = arg.function_space.orig_name
275 undf_symbol = self.
_symtab_symtab.find_or_create_tag(
277 symbol_type=
LFRicTypes(
"NumberOfUniqueDofsDataSymbol"),
281 type_name = self.
field_mappingfield_mapping[arg.intrinsic_type]
283 except KeyError
as info:
284 message = (f
"kernel interface does not support a field of type "
285 f
"'{arg.intrinsic_type}'.")
286 raise NotImplementedError(message)
from info
287 field_data_symbol = self.
_symtab_symtab.find_or_create_tag(
288 arg.name, interface=ArgumentInterface(INTENT_MAPPING[arg.intent]),
289 symbol_type=field_class, dims=[Reference(undf_symbol)], fs=fs_name)
298 :param arg: the kernel argument with which the stencil is associated.
299 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
300 :param var_accesses: an unused optional argument that stores \
301 information about variable accesses.
302 :type var_accesses: :\
303 py:class:`psyclone.core.VariablesAccessInfo`
305 :raises NotImplementedError: as this method is not implemented.
308 raise NotImplementedError(
309 "TODO #928: stencil_unknown_extent not implemented")
314 :param arg: the kernel argument with which the stencil is associated.
315 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
316 :param var_accesses: an unused optional argument that stores \
317 information about variable accesses.
318 :type var_accesses: :\
319 py:class:`psyclone.core.VariablesAccessInfo`
321 :raises NotImplementedError: as this method is not implemented.
324 raise NotImplementedError(
325 "TODO #928: stencil_unknown_direction not implemented")
330 :param arg: the kernel argument with which the stencil is associated.
331 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
332 :param var_accesses: an unused optional argument that stores \
333 information about variable accesses.
334 :type var_accesses: :\
335 py:class:`psyclone.core.VariablesAccessInfo`
337 :raises NotImplementedError: as this method is not implemented.
340 raise NotImplementedError(
"TODO #928: stencil not implemented")
343 '''Create an LFRic operator argument and an ncells argument and add
344 them to the symbol table and argument list. Also declare the
345 associated 'fs_from', 'fs_to' symbols if they have not already
346 been declared so that they can be used to dimension the
347 operator symbol (as well as ncells).
349 :param arg: the operator to add.
350 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
351 :param var_accesses: an unused optional argument that stores
352 information about variable accesses.
353 :type var_accesses: :py:class:`psyclone.core.VariablesAccessInfo`
355 :raises NotImplementedError: if the datatype of the field is
359 fs_from_name = arg.function_space_from.orig_name
361 ndf_symbol_from = self.
_symtab_symtab.find_or_create_tag(
362 f
"ndf_{fs_from_name}", fs=fs_from_name,
363 symbol_type=
LFRicTypes(
"NumberOfDofsDataSymbol"),
365 fs_to_name = arg.function_space_to.orig_name
366 ndf_symbol_to = self.
_symtab_symtab.find_or_create_tag(
367 f
"ndf_{fs_to_name}", fs=fs_to_name,
368 symbol_type=
LFRicTypes(
"NumberOfDofsDataSymbol"),
373 ncells = self.
_symtab_symtab.find_or_create(
375 symbol_type=
LFRicTypes(
"NumberOfCellsDataSymbol"),
379 op_arg_symbol = self.
_symtab_symtab.find_or_create_tag(
380 arg.name, symbol_type=
LFRicTypes(
"OperatorDataSymbol"),
381 dims=[Reference(ndf_symbol_from), Reference(ndf_symbol_to),
383 fs_from=fs_from_name, fs_to=fs_to_name,
384 interface=ArgumentInterface(INTENT_MAPPING[arg.intent]))
393 :param arg: the CMA operator argument.
394 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
395 :param var_accesses: an unused optional argument that stores \
396 information about variable accesses.
397 :type var_accesses: :\
398 py:class:`psyclone.core.VariablesAccessInfo`
400 :raises NotImplementedError: as this method is not implemented.
403 raise NotImplementedError(
"TODO #928: cma_operator not implemented")
405 def scalar(self, scalar_arg, var_accesses=None):
406 '''Create an LFRic scalar argument and add it to the symbol table and
409 :param scalar_arg: the scalar to add.
410 :type scalar_arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
411 :param var_accesses: an unused optional argument that stores \
412 information about variable accesses.
413 :type var_accesses: :\
414 py:class:`psyclone.core.VariablesAccessInfo`
416 :raises NotImplementedError: if the datatype of the scalar is \
421 "integer":
LFRicTypes(
"LFRicIntegerScalarDataSymbol"),
422 "real":
LFRicTypes(
"LFRicRealScalarDataSymbol"),
423 "logical":
LFRicTypes(
"LFRicLogicalScalarDataSymbol")}
425 symbol = self.
_symtab_symtab.find_or_create_tag(
427 symbol_type=mapping[scalar_arg.intrinsic_type],
428 interface=ArgumentInterface(INTENT_MAPPING[scalar_arg.intent]))
429 except KeyError
as info:
431 f
"scalar of type '{scalar_arg.intrinsic_type}' not implemented"
432 f
" in KernelInterface class.")
433 raise NotImplementedError(message)
from info
435 scalar_arg.metadata_index)
439 '''Create any arguments that are common to a particular function
440 space. At this time the only common argument is the number of
441 degrees of freedom. Create the associated LFRic symbol, and
442 add it to the symbol table and argument list.
444 :param function_space: the function space for any common arguments.
445 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
446 :param var_accesses: an unused optional argument that stores \
447 information about variable accesses.
448 :type var_accesses: :\
449 py:class:`psyclone.core.VariablesAccessInfo`
452 fs_name = function_space.orig_name
453 ndf_symbol = self.
_symtab_symtab.find_or_create_tag(
454 f
"ndf_{fs_name}", fs=fs_name,
455 symbol_type=
LFRicTypes(
"NumberOfDofsDataSymbol"),
462 :param arg: the CMA operator argument.
463 :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
464 :param var_accesses: an unused optional argument that stores \
465 information about variable accesses.
466 :type var_accesses: :\
467 py:class:`psyclone.core.VariablesAccessInfo`
469 :raises NotImplementedError: as this method is not implemented.
472 raise NotImplementedError(
"TODO #928: fs_intergrid not implemented")
475 '''Create any arguments that are compulsory for a field on a
476 particular function space. At this time the compulsory
477 arguments are the unique number of degrees of freedom and the
478 dofmap. Create the associated LFRic symbol, and add it to the
479 symbol table and argument list. Also declare the number of
480 degrees of freedom and add to the symbol table if one has not
483 :param function_space: the function space for any compulsory arguments.
484 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
485 :param var_accesses: an unused optional argument that stores \
486 information about variable accesses.
487 :type var_accesses: :\
488 py:class:`psyclone.core.VariablesAccessInfo`
491 fs_name = function_space.orig_name
492 undf_symbol = self.
_symtab_symtab.find_or_create_tag(
493 f
"undf_{fs_name}", fs=fs_name,
494 symbol_type=
LFRicTypes(
"NumberOfUniqueDofsDataSymbol"),
498 fs_name = function_space.orig_name
499 ndf_symbol = self.
_symtab_symtab.find_or_create_tag(
500 f
"ndf_{fs_name}", fs=fs_name,
501 symbol_type=
LFRicTypes(
"NumberOfDofsDataSymbol"),
504 dofmap_symbol = self.
_symtab_symtab.find_or_create_tag(
505 f
"dofmap_{fs_name}", fs=fs_name,
507 dims=[Reference(ndf_symbol)], interface=self.
_read_access_read_access)
513 :param function_space: the function space for this dofmap.
514 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
515 :param var_accesses: an unused optional argument that stores \
516 information about variable accesses.
517 :type var_accesses: :\
518 py:class:`psyclone.core.VariablesAccessInfo`
520 :raises NotImplementedError: as this method is not implemented.
523 raise NotImplementedError(
"TODO #928: banded_dofmap not implemented")
529 :param function_space: the function space for this dofmap.
530 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
531 :param operator: the CMA operator.
532 :type operator: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
533 :param var_accesses: an unused optional argument that stores \
534 information about variable accesses.
535 :type var_accesses: :\
536 py:class:`psyclone.core.VariablesAccessInfo`
538 :raises NotImplementedError: as this method is not implemented.
541 raise NotImplementedError(
542 "TODO #928: indirection_dofmap not implemented")
544 def basis(self, function_space, var_accesses=None):
545 '''Create an LFRic basis function argument and add it to the symbol
546 table and argument list.
548 :param function_space: the function space for this basis function.
549 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
550 :param var_accesses: an unused optional argument that stores \
551 information about variable accesses.
552 :type var_accesses: :\
553 py:class:`psyclone.core.VariablesAccessInfo`
556 basis_name_func = function_space.get_basis_name
560 first_dim_value_func = DynBasisFunctions.basis_first_dim_value
562 basis_name_func, first_dim_value_func)
565 '''Create an LFRic differential basis function argument and add it to
566 the symbol table and argument list.
568 :param function_space: the function space for this \
569 differential basis function.
570 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
571 :param var_accesses: an unused optional argument that stores \
572 information about variable accesses.
573 :type var_accesses: :\
574 py:class:`psyclone.core.VariablesAccessInfo`
577 basis_name_func = function_space.get_diff_basis_name
581 first_dim_value_func = DynBasisFunctions.diff_basis_first_dim_value
583 basis_name_func, first_dim_value_func)
586 '''Create the boundary-dofs mask argument required for the
587 enforce_bc_code kernel. Adds it to the symbol table and the argument
590 :param function_space: the function space for this boundary condition.
591 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
592 :param var_accesses: an unused optional argument that stores
593 information about variable accesses.
594 :type var_accesses: :py:class:`psyclone.core.VariablesAccessInfo`
596 :raises InternalError: if the kernel does not have a single field as
598 :raises InternalError: if the field argument is not on the
599 'ANY_SPACE_1' function space.
604 if (len(self.
_kern_kern.arguments.args) != 1
or
605 not self.
_kern_kern.arguments.args[0].is_field):
608 f
"Kernel '{self._kern.name}' applies boundary conditions to a "
609 f
"field and therefore should have a single, field argument "
610 f
"(one of {const.VALID_FIELD_NAMES}) but got "
611 f
"{[arg.argument_type for arg in self._kern.arguments.args]}")
612 farg = self.
_kern_kern.arguments.args[0]
613 fspace = farg.function_space
616 if fspace.orig_name !=
"any_space_1":
618 f
"Kernel '{self._kern.name}' applies boundary conditions to a "
619 f
"field but the supplied argument, '{farg.name}', is on "
620 f
"'{fspace.orig_name}' rather than the expected 'ANY_SPACE_1'")
622 ndf_symbol = self.
_symtab_symtab.find_or_create_tag(
623 f
"ndf_{fspace.orig_name}", fs=fspace.orig_name,
624 symbol_type=
LFRicTypes(
"NumberOfDofsDataSymbol"),
628 sym = self.
_symtab_symtab.find_or_create_tag(
629 f
"boundary_dofs_{farg.name}",
631 symbol_type=
LFRicTypes(
"VerticalBoundaryDofMaskDataSymbol"),
632 dims=[Reference(ndf_symbol), 2])
638 :param function_space: the function space for this bcs kernel
639 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
640 :param var_accesses: an unused optional argument that stores \
641 information about variable accesses.
642 :type var_accesses: :\
643 py:class:`psyclone.core.VariablesAccessInfo`
645 :raises NotImplementedError: as this method is not implemented.
648 raise NotImplementedError(
649 "TODO #928: operator_bcs_kernel not implemented")
652 ''' Properties associated with the reference element
654 :param var_accesses: an unused optional argument that stores \
655 information about variable accesses.
656 :type var_accesses: :\
657 py:class:`psyclone.core.VariablesAccessInfo`
663 ''' Properties associated with the mesh
665 :param var_accesses: an unused optional argument that stores \
666 information about variable accesses.
667 :type var_accesses: :\
668 py:class:`psyclone.core.VariablesAccessInfo`
674 '''Create LFRic arguments associated with the required quadrature, if
675 they do not already exist, and add them to the symbol table
676 and argument list. The arguments depend on the type of
677 quadrature requested.
679 :param var_accesses: an unused optional argument that stores \
680 information about variable accesses.
681 :type var_accesses: :\
682 py:class:`psyclone.core.VariablesAccessInfo`
684 :raises InternalError: if an unsupported quadrature shape is \
689 for shape
in self._kern.qr_rules:
690 if shape ==
"gh_quadrature_xyoz":
691 nqp_xy = self._symtab.find_or_create_tag(
693 symbol_type=
LFRicTypes(
"NumberOfQrPointsInXyDataSymbol"),
694 interface=self._read_access)
695 nqp_z = self._symtab.find_or_create_tag(
697 symbol_type=
LFRicTypes(
"NumberOfQrPointsInZDataSymbol"),
698 interface=self._read_access)
699 weights_xy = self._symtab.find_or_create_tag(
701 symbol_type=
LFRicTypes(
"QrWeightsInXyDataSymbol"),
702 dims=[Reference(nqp_xy)], interface=self._read_access)
703 weights_z = self._symtab.find_or_create_tag(
705 symbol_type=
LFRicTypes(
"QrWeightsInZDataSymbol"),
706 dims=[Reference(nqp_z)], interface=self._read_access)
707 self._arglist.
extend([nqp_xy, nqp_z, weights_xy, weights_z])
708 elif shape ==
"gh_quadrature_face":
709 nfaces = self._symtab.find_or_create_tag(
711 symbol_type=
LFRicTypes(
"NumberOfFacesDataSymbol"),
712 interface=self._read_access)
713 nqp = self._symtab.find_or_create_tag(
716 "NumberOfQrPointsInFacesDataSymbol"),
717 interface=self._read_access)
718 weights = self._symtab.find_or_create_tag(
720 symbol_type=
LFRicTypes(
"QrWeightsInFacesDataSymbol"),
721 dims=[Reference(nqp)], interface=self._read_access)
722 self._arglist.
extend([nfaces, nqp, weights])
723 elif shape ==
"gh_quadrature_edge":
724 nedges = self._symtab.find_or_create_tag(
726 symbol_type=
LFRicTypes(
"NumberOfEdgesDataSymbol"),
727 interface=self._read_access)
728 nqp = self._symtab.find_or_create_tag(
731 "NumberOfQrPointsInEdgesDataSymbol"),
732 interface=self._read_access)
733 weights = self._symtab.find_or_create_tag(
735 symbol_type=
LFRicTypes(
"QrWeightsInEdgesDataSymbol"),
736 dims=[Reference(nqp)], interface=self._read_access)
737 self._arglist.
extend([nedges, nqp, weights])
739 raise InternalError(f
"Unsupported quadrature shape '{shape}' "
740 f
"found in kernel_interface.")
742 def _create_basis(self, function_space, mapping, basis_name_func,
743 first_dim_value_func):
744 '''Internal utility to create an LFRic basis or differential basis
745 function argument specific to the particular quadrature that
746 is being used and add it to the symbol table and argument
747 list. Also declare the associated "ndf" symbol and any
748 quadrature-specific symbols if they have not already been
749 declared so that they can be used to dimension the basis or
750 differential basis symbol.
752 This utility function is used to avoid code replication as the
753 structure of a basis function is very similar to the structure
754 of a differential basis function.
756 :param function_space: the function space that this basis or \
757 differential basis function is on.
758 :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
759 :param dict mapping: a mapping from quadrature type to basis \
760 or differential basis class name.
761 :param method basis_name_func: a method that returns the name \
762 of the basis or differential basis function for the \
763 current function space.
764 :param function first_dim_value_func: a function that returns \
765 the size of the first dimension of the basis or \
766 differential basis function for the current function \
769 :raises NotImplementedError: if an evaluator shape is found \
770 that is not a quadrature shape (currently just \
772 :raises InternalError: if the supplied evaluator shape is not \
778 for shape
in self._kern.eval_shapes:
779 fs_name = function_space.orig_name
780 ndf_symbol = self._symtab.find_or_create_tag(
782 symbol_type=
LFRicTypes(
"NumberOfDofsDataSymbol"),
783 fs=fs_name, interface=self._read_access)
787 quad_name = shape.split(
"_")[-1]
788 basis_tag = basis_name_func(qr_var=
"qr_"+quad_name)
789 if shape ==
"gh_quadrature_xyoz":
790 nqp_xy = self._symtab.find_or_create_tag(
792 symbol_type=
LFRicTypes(
"NumberOfQrPointsInXyDataSymbol"),
793 interface=self._read_access)
794 nqp_z = self._symtab.find_or_create_tag(
796 symbol_type=
LFRicTypes(
"NumberOfQrPointsInZDataSymbol"),
797 interface=self._read_access)
798 type_name = mapping[
"gh_quadrature_xyoz"]
800 basis_tag, [int(first_dim_value_func(function_space)),
801 Reference(ndf_symbol), Reference(nqp_xy),
803 fs_name, interface=self._read_access)
804 elif shape ==
"gh_quadrature_face":
805 nfaces = self._symtab.find_or_create_tag(
807 symbol_type=
LFRicTypes(
"NumberOfFacesDataSymbol"),
808 interface=self._read_access)
809 nqp = self._symtab.find_or_create_tag(
812 "NumberOfQrPointsInFacesDataSymbol"),
813 interface=self._read_access)
814 type_name = mapping[
"gh_quadrature_face"]
816 basis_tag, [int(first_dim_value_func(function_space)),
817 Reference(ndf_symbol), Reference(nqp),
819 fs_name, interface=self._read_access)
820 elif shape ==
"gh_quadrature_edge":
821 nedges = self._symtab.find_or_create_tag(
823 symbol_type=
LFRicTypes(
"NumberOfEdgesDataSymbol"),
824 interface=self._read_access)
825 nqp = self._symtab.find_or_create_tag(
828 "NumberOfQrPointsInEdgesDataSymbol"),
829 interface=self._read_access)
830 type_name = mapping[
"gh_quadrature_edge"]
832 basis_tag, [int(first_dim_value_func(function_space)),
833 Reference(ndf_symbol), Reference(nqp),
835 fs_name, interface=self._read_access)
836 elif shape
in const.VALID_EVALUATOR_SHAPES:
841 for _, _
in self._kern.eval_targets.items():
842 raise NotImplementedError(
843 "TODO #928: Evaluator shapes not implemented in "
844 "kernel_interface class.")
847 f
"Unrecognised quadrature or evaluator shape '{shape}'. "
848 f
"Expected one of: {const.VALID_EVALUATOR_SHAPES}.")
849 self._symtab.add(arg)
_arg_index_to_metadata_index
def append(self, var_name, var_accesses=None, var_access_name=None, mode=AccessType.READ, metadata_posn=None)
def extend(self, list_var_name, var_accesses=None, mode=AccessType.READ, list_metadata_posn=None)
def ref_element_properties(self, var_accesses=None)
def banded_dofmap(self, function_space, var_accesses=None)
def field_vector(self, argvect, var_accesses=None)
def _create_basis(self, function_space, mapping, basis_name_func, first_dim_value_func)
def fs_common(self, function_space, var_accesses=None)
def mesh_properties(self, var_accesses=None)
def basis(self, function_space, var_accesses=None)
dictionary vector_field_mapping
def indirection_dofmap(self, function_space, operator=None, var_accesses=None)
def diff_basis(self, function_space, var_accesses=None)
def generate(self, var_accesses=None)
def fs_intergrid(self, function_space, var_accesses=None)
def stencil(self, arg, var_accesses=None)
def stencil_unknown_extent(self, arg, var_accesses=None)
def mesh_height(self, var_accesses=None)
def scalar(self, scalar_arg, var_accesses=None)
dictionary diff_basis_mapping
def stencil_unknown_direction(self, arg, var_accesses=None)
def quad_rule(self, var_accesses=None)
def cell_map(self, var_accesses=None)
def field(self, arg, var_accesses=None)
def field_bcs_kernel(self, function_space, var_accesses=None)
def operator_bcs_kernel(self, function_space, var_accesses=None)
def cma_operator(self, arg, var_accesses=None)
def fs_compulsory_field(self, function_space, var_accesses=None)
def operator(self, arg, var_accesses=None)
def cell_position(self, var_accesses=None)