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

Public Member Functions

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

Detailed Description

Handles the declaration and initialisation of all function-space-related
quantities required by an Invoke.

:param invoke: the Invoke or Kernel object.

Definition at line 1182 of file dynamo0p3.py.

Member Function Documentation

◆ initialise()

def psyclone.dynamo0p3.DynFunctionSpaces.initialise (   self,
  parent 
)
Create the code that initialises function-space quantities.

:param parent: the node in the f2pygen AST representing the PSy-layer \
               routine.
:type parent: :py:class:`psyclone.f2pygen.SubroutineGen`

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

Definition at line 1255 of file dynamo0p3.py.

1255  def initialise(self, parent):
1256  '''
1257  Create the code that initialises function-space quantities.
1258 
1259  :param parent: the node in the f2pygen AST representing the PSy-layer \
1260  routine.
1261  :type parent: :py:class:`psyclone.f2pygen.SubroutineGen`
1262 
1263  '''
1264  # Loop over all unique function spaces used by the kernels in
1265  # the invoke
1266  for function_space in self._function_spaces:
1267  # Initialise information associated with this function space.
1268  # If we have 1+ kernels that operate on cell-columns then we
1269  # will need ndf and undf. If we don't then we only need undf
1270  # (for the upper bound of the loop over dofs) if we're not
1271  # doing DM.
1272  if not (self._dofs_only and Config.get().distributed_memory):
1273  parent.add(CommentGen(parent, ""))
1274  parent.add(CommentGen(parent,
1275  " Initialise number of DoFs for " +
1276  function_space.mangled_name))
1277  parent.add(CommentGen(parent, ""))
1278 
1279  # Find argument proxy name used to dereference the argument
1280  arg = self._invoke.arg_for_funcspace(function_space)
1281  name = arg.proxy_name_indexed
1282  # Initialise ndf for this function space.
1283  if not self._dofs_only:
1284  ndf_name = function_space.ndf_name
1285  parent.add(AssignGen(parent, lhs=ndf_name,
1286  rhs=name +
1287  "%" + arg.ref_name(function_space) +
1288  "%get_ndf()"))
1289  # If there is a field on this space then initialise undf
1290  # for this function space. However, if the invoke contains
1291  # only kernels that operate on dofs and distributed
1292  # memory is enabled then the number of dofs is obtained
1293  # from the field proxy and undf is not required.
1294  if not (self._dofs_only and Config.get().distributed_memory):
1295  if self._invoke.field_on_space(function_space):
1296  undf_name = function_space.undf_name
1297  parent.add(AssignGen(parent, lhs=undf_name,
1298  rhs=name + "%" +
1299  arg.ref_name(function_space) +
1300  "%get_undf()"))
1301 
1302 

References psyclone.domain.lfric.lfric_collection.LFRicCollection._dofs_only, psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._function_spaces, psyclone.dynamo0p3.DynFunctionSpaces._function_spaces, psyclone.dynamo0p3.DynKernelArgument._function_spaces, psyclone.domain.lfric.lfric_collection.LFRicCollection._invoke, psyclone.nemo.NemoInvokeSchedule._invoke, and psyclone.psyGen.InvokeSchedule._invoke.


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