Reference Guide  2.5.0
psyclone.domain.lfric.lfric_collection.LFRicCollection Class Reference
Inheritance diagram for psyclone.domain.lfric.lfric_collection.LFRicCollection:

Public Member Functions

def __init__ (self, node)
 
def declarations (self, parent)
 
def initialise (self, parent)
 

Detailed Description

Base class for managing the declaration and initialisation of a
group of related entities within an Invoke or Kernel stub

:param node: the Kernel or Invoke for which to manage variable \
             declarations and initialisation.
:type node: :py:class:`psyclone.domain.lfric.LFRicInvoke` or \
            :py:class:`psyclone.domain.lfric.LFRicKern`

:raises InternalError: if the supplied node is not an LFRicInvoke or an \
                       LFRicKern.

Definition at line 50 of file lfric_collection.py.

Member Function Documentation

◆ declarations()

def psyclone.domain.lfric.lfric_collection.LFRicCollection.declarations (   self,
  parent 
)
Insert declarations for all necessary variables into the AST of
the generated code. Simply calls either '_invoke_declarations()' or
'_stub_declarations()' depending on whether we're handling an Invoke
or a Kernel stub.

:param parent: the node in the f2pygen AST representing the routine \
               in which to insert the declarations.
:type parent: :py:class:`psyclone.f2pygen.SubroutineGen`

:raises InternalError: if neither 'self._invoke' nor 'self._kernel' \
                       are set.

Definition at line 92 of file lfric_collection.py.

92  def declarations(self, parent):
93  '''
94  Insert declarations for all necessary variables into the AST of
95  the generated code. Simply calls either '_invoke_declarations()' or
96  '_stub_declarations()' depending on whether we're handling an Invoke
97  or a Kernel stub.
98 
99  :param parent: the node in the f2pygen AST representing the routine \
100  in which to insert the declarations.
101  :type parent: :py:class:`psyclone.f2pygen.SubroutineGen`
102 
103  :raises InternalError: if neither 'self._invoke' nor 'self._kernel' \
104  are set.
105 
106  '''
107  if self._invoke:
108  self._invoke_declarations(parent)
109  elif self._kernel:
110  self._stub_declarations(parent)
111  else:
112  raise InternalError("LFRicCollection has neither a Kernel "
113  "nor an Invoke - should be impossible.")
114 

References psyclone.domain.lfric.lfric_collection.LFRicCollection._invoke, psyclone.nemo.NemoInvokeSchedule._invoke, psyclone.psyGen.InvokeSchedule._invoke, psyclone.domain.lfric.lfric_collection.LFRicCollection._invoke_declarations(), psyclone.domain.lfric.lfric_dofmaps.LFRicDofmaps._invoke_declarations(), psyclone.domain.lfric.lfric_fields.LFRicFields._invoke_declarations(), psyclone.domain.lfric.lfric_loop_bounds.LFRicLoopBounds._invoke_declarations(), psyclone.domain.lfric.lfric_run_time_checks.LFRicRunTimeChecks._invoke_declarations(), psyclone.domain.lfric.lfric_scalar_args.LFRicScalarArgs._invoke_declarations(), psyclone.domain.lfric.lfric_stencils.LFRicStencils._invoke_declarations(), psyclone.dynamo0p3.LFRicMeshProperties._invoke_declarations(), psyclone.dynamo0p3.DynReferenceElement._invoke_declarations(), psyclone.dynamo0p3.DynFunctionSpaces._invoke_declarations(), psyclone.dynamo0p3.DynProxies._invoke_declarations(), psyclone.dynamo0p3.DynCellIterators._invoke_declarations(), psyclone.dynamo0p3.DynLMAOperators._invoke_declarations(), psyclone.dynamo0p3.DynCMAOperators._invoke_declarations(), psyclone.dynamo0p3.DynBasisFunctions._invoke_declarations(), psyclone.dynamo0p3.DynBoundaryConditions._invoke_declarations(), psyclone.domain.lfric.lfric_collection.LFRicCollection._kernel, psyclone.domain.lfric.lfric_collection.LFRicCollection._stub_declarations(), psyclone.domain.lfric.lfric_dofmaps.LFRicDofmaps._stub_declarations(), psyclone.domain.lfric.lfric_fields.LFRicFields._stub_declarations(), psyclone.domain.lfric.lfric_scalar_args.LFRicScalarArgs._stub_declarations(), psyclone.domain.lfric.lfric_stencils.LFRicStencils._stub_declarations(), psyclone.dynamo0p3.LFRicMeshProperties._stub_declarations(), psyclone.dynamo0p3.DynReferenceElement._stub_declarations(), psyclone.dynamo0p3.DynFunctionSpaces._stub_declarations(), psyclone.dynamo0p3.DynCellIterators._stub_declarations(), psyclone.dynamo0p3.DynLMAOperators._stub_declarations(), psyclone.dynamo0p3.DynCMAOperators._stub_declarations(), psyclone.dynamo0p3.DynBasisFunctions._stub_declarations(), and psyclone.dynamo0p3.DynBoundaryConditions._stub_declarations().

Here is the call graph for this function:

◆ initialise()

def psyclone.domain.lfric.lfric_collection.LFRicCollection.initialise (   self,
  parent 
)
Add code to initialise the entities being managed by this class.
We do nothing by default - it is up to the sub-class to override
this method if initialisation is required.

:param parent: the node in the f2pygen AST to which to add \
               initialisation code.
:type parent: :py:class:`psyclone.f2pygen.SubroutineGen`

Reimplemented in psyclone.dynamo0p3.DynBoundaryConditions, psyclone.dynamo0p3.DynBasisFunctions, psyclone.dynamo0p3.DynCMAOperators, psyclone.dynamo0p3.DynCellIterators, psyclone.dynamo0p3.DynProxies, psyclone.dynamo0p3.DynFunctionSpaces, psyclone.dynamo0p3.DynReferenceElement, psyclone.dynamo0p3.LFRicMeshProperties, psyclone.domain.lfric.lfric_stencils.LFRicStencils, psyclone.domain.lfric.lfric_run_time_checks.LFRicRunTimeChecks, psyclone.domain.lfric.lfric_loop_bounds.LFRicLoopBounds, and psyclone.domain.lfric.lfric_dofmaps.LFRicDofmaps.

Definition at line 115 of file lfric_collection.py.

115  def initialise(self, parent):
116  '''
117  Add code to initialise the entities being managed by this class.
118  We do nothing by default - it is up to the sub-class to override
119  this method if initialisation is required.
120 
121  :param parent: the node in the f2pygen AST to which to add \
122  initialisation code.
123  :type parent: :py:class:`psyclone.f2pygen.SubroutineGen`
124 
125  '''
126 

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