Reference Guide  2.5.0
psyclone.dynamo0p3.DynReferenceElement Class Reference
Inheritance diagram for psyclone.dynamo0p3.DynReferenceElement:
Collaboration diagram for psyclone.dynamo0p3.DynReferenceElement:

Public Member Functions

def __init__ (self, node)
 
def kern_args (self)
 
def kern_args_symbols (self)
 
def initialise (self, parent)
 
- Public Member Functions inherited from psyclone.domain.lfric.lfric_collection.LFRicCollection
def declarations (self, parent)
 

Detailed Description

Holds all information on the properties of the Reference Element
required by an Invoke or a Kernel stub.

:param node: Kernel or Invoke for which to manage Reference-Element \
             properties.
:type node: :py:class:`psyclone.domain.lfric.LFRicKern` or \
            :py:class:`psyclone.dynamo0p3.LFRicInvoke`

:raises InternalError: if an unsupported reference-element property \
                       is encountered.

Definition at line 823 of file dynamo0p3.py.

Member Function Documentation

◆ initialise()

def psyclone.dynamo0p3.DynReferenceElement.initialise (   self,
  parent 
)
Creates the f2pygen nodes representing the necessary initialisation
code for properties of the reference element.

:param parent: node in the f2pygen tree to which to add statements.
:type parent: :py:class:`psyclone.f2pygen.SubroutineGen`

Reimplemented from psyclone.domain.lfric.lfric_collection.LFRicCollection.

Definition at line 1100 of file dynamo0p3.py.

1100  def initialise(self, parent):
1101  '''
1102  Creates the f2pygen nodes representing the necessary initialisation
1103  code for properties of the reference element.
1104 
1105  :param parent: node in the f2pygen tree to which to add statements.
1106  :type parent: :py:class:`psyclone.f2pygen.SubroutineGen`
1107 
1108  '''
1109  if not (self._properties or self._nfaces_h_required):
1110  return
1111 
1112  parent.add(CommentGen(parent, ""))
1113  parent.add(
1114  CommentGen(parent,
1115  " Get the reference element and query its properties"))
1116  parent.add(CommentGen(parent, ""))
1117 
1118  mesh_obj_name = self._symbol_table.find_or_create_tag("mesh").name
1119  parent.add(AssignGen(parent, pointer=True, lhs=self._ref_elem_name,
1120  rhs=mesh_obj_name+"%get_reference_element()"))
1121 
1122  if self._nfaces_h_symbol:
1123  parent.add(
1124  AssignGen(parent, lhs=self._nfaces_h_symbol.name,
1125  rhs=self._ref_elem_name +
1126  "%get_number_horizontal_faces()"))
1127  if self._nfaces_v_symbol:
1128  parent.add(
1129  AssignGen(
1130  parent, lhs=self._nfaces_v_symbol.name,
1131  rhs=self._ref_elem_name + "%get_number_vertical_faces()"))
1132 
1133  if self._nfaces_symbol:
1134  parent.add(
1135  AssignGen(
1136  parent, lhs=self._nfaces_symbol.name,
1137  rhs=self._ref_elem_name + "%get_number_faces()"))
1138 
1139  if self._horiz_face_normals_symbol:
1140  parent.add(
1141  CallGen(parent,
1142  name=f"{self._ref_elem_name}%get_normals_to_"
1143  f"horizontal_faces("
1144  f"{self._horiz_face_normals_symbol.name})"))
1145 
1146  if self._horiz_face_out_normals_symbol:
1147  parent.add(
1148  CallGen(
1149  parent,
1150  name=f"{self._ref_elem_name}%get_outward_normals_to_"
1151  f"horizontal_faces("
1152  f"{self._horiz_face_out_normals_symbol.name})"))
1153 
1154  if self._vert_face_normals_symbol:
1155  parent.add(
1156  CallGen(parent,
1157  name=f"{self._ref_elem_name}%get_normals_to_vertical_"
1158  f"faces({self._vert_face_normals_symbol.name})"))
1159 
1160  if self._vert_face_out_normals_symbol:
1161  parent.add(
1162  CallGen(
1163  parent,
1164  name=f"{self._ref_elem_name}%get_outward_normals_to_"
1165  f"vertical_faces"
1166  f"({self._vert_face_out_normals_symbol.name})"))
1167 
1168  if self._face_normals_symbol:
1169  parent.add(
1170  CallGen(parent,
1171  name=f"{self._ref_elem_name}%get_normals_to_faces"
1172  f"({self._face_normals_symbol.name})"))
1173 
1174  if self._face_out_normals_symbol:
1175  parent.add(
1176  CallGen(
1177  parent,
1178  name=f"{self._ref_elem_name}%get_outward_normals_to_"
1179  f"faces({self._face_out_normals_symbol.name})"))
1180 
1181 

References psyclone.dynamo0p3.DynReferenceElement._face_normals_symbol, psyclone.dynamo0p3.DynReferenceElement._face_out_normals_symbol, psyclone.dynamo0p3.DynReferenceElement._horiz_face_normals_symbol, psyclone.dynamo0p3.DynReferenceElement._horiz_face_out_normals_symbol, psyclone.dynamo0p3.DynReferenceElement._nfaces_h_required, psyclone.dynamo0p3.DynReferenceElement._nfaces_h_symbol, psyclone.dynamo0p3.DynReferenceElement._nfaces_symbol, psyclone.dynamo0p3.DynReferenceElement._nfaces_v_symbol, psyclone.dynamo0p3.LFRicMeshProperties._properties, psyclone.dynamo0p3.DynReferenceElement._properties, psyclone.dynamo0p3.DynReferenceElement._ref_elem_name, psyclone.domain.lfric.lfric_collection.LFRicCollection._symbol_table, psyclone.dynamo0p3.DynMeshes._symbol_table, psyclone.dynamo0p3.HaloDepth._symbol_table, psyclone.psyGen.HaloExchange._symbol_table, psyclone.psyir.backend.sympy_writer.SymPyWriter._symbol_table, psyclone.psyir.nodes.scoping_node.ScopingNode._symbol_table, psyclone.dynamo0p3.DynReferenceElement._vert_face_normals_symbol, and psyclone.dynamo0p3.DynReferenceElement._vert_face_out_normals_symbol.

◆ kern_args()

def psyclone.dynamo0p3.DynReferenceElement.kern_args (   self)
:returns: the argument list for kernel call/stub arguments.
:rtype: List[str]

Definition at line 990 of file dynamo0p3.py.

990  def kern_args(self):
991  '''
992  :returns: the argument list for kernel call/stub arguments.
993  :rtype: List[str]
994 
995  '''
996  argdict = self._arg_properties
997  # Remove duplicate "nfaces" by using OrderedDict
998  nfaces = list(OrderedDict.fromkeys(argdict.values()))
999  kern_args = nfaces + list(argdict.keys())
1000  return [sym.name for sym in kern_args]
1001 

References psyclone.dynamo0p3.DynReferenceElement._arg_properties.

◆ kern_args_symbols()

def psyclone.dynamo0p3.DynReferenceElement.kern_args_symbols (   self)
:returns: the argument symbol list for kernel call/stub arguments.
:rtype: List[:py:class:`psyclone.psyir.symbols.Symbol`]

Definition at line 1002 of file dynamo0p3.py.

1002  def kern_args_symbols(self):
1003  '''
1004  :returns: the argument symbol list for kernel call/stub arguments.
1005  :rtype: List[:py:class:`psyclone.psyir.symbols.Symbol`]
1006 
1007  '''
1008  argdict = self._arg_properties
1009  # Remove duplicate "nfaces" by using OrderedDict
1010  nfaces = list(OrderedDict.fromkeys(argdict.values()))
1011  return nfaces + list(argdict.keys())
1012 

References psyclone.dynamo0p3.DynReferenceElement._arg_properties, psyclone.domain.lfric.lfric_collection.LFRicCollection._invoke, psyclone.nemo.NemoInvokeSchedule._invoke, psyclone.psyGen.InvokeSchedule._invoke, psyclone.dynamo0p3.DynReferenceElement._nfaces_h_required, psyclone.dynamo0p3.DynReferenceElement._nfaces_h_symbol, psyclone.dynamo0p3.LFRicMeshProperties._properties, psyclone.dynamo0p3.DynReferenceElement._properties, psyclone.dynamo0p3.DynReferenceElement._ref_elem_name, psyclone.domain.lfric.lfric_collection.LFRicCollection._symbol_table, psyclone.dynamo0p3.DynMeshes._symbol_table, psyclone.dynamo0p3.HaloDepth._symbol_table, psyclone.psyGen.HaloExchange._symbol_table, psyclone.psyir.backend.sympy_writer.SymPyWriter._symbol_table, and psyclone.psyir.nodes.scoping_node.ScopingNode._symbol_table.


The documentation for this class was generated from the following file: