Reference Guide  2.5.0
psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata Class Reference
Inheritance diagram for psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata:
Collaboration diagram for psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata:

Public Member Functions

def __init__ (self, meta_mesh_args)
 
def fortran_string (self)
 
def meta_mesh_args (self)
 
def meta_mesh_args (self, values)
 

Static Public Member Functions

def create_from_fparser2 (fparser2_tree)
 

Public Attributes

 meta_mesh_args
 

Additional Inherited Members

Detailed Description

Class to capture the values of the LFRic kernel
meta_mesh metadata. This class supports the creation,
modification and Fortran output of this metadata.

meta_mesh metadata specifies properties of the LFRic mesh object
that are required by a kernel.

:param meta_mesh_args: a list of meta_mesh arguments.
:type meta_mesh_args: List[:py:class:`psyclone.domain.lfric.kernel.\
    MetaMeshArgMetadata`]

Definition at line 46 of file meta_mesh_metadata.py.

Member Function Documentation

◆ create_from_fparser2()

def psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata.create_from_fparser2 (   fparser2_tree)
static
Create an instance of MetaMeshMetadata from an fparser2
tree.

LFRic meta mesh metadata is in array form. Two
versions of the array form are supported:

type(mesh_data_type) :: meta_mesh(1) = (/ ... /)
type(mesh_data_type), dimension(1) :: meta_mesh = (/ ... /)

:param fparser2_tree: fparser2 tree capturing the meta \
    mesh metadata.

:type fparser2_tree: :py:class:`fparser.two.Fortran2003.\
    Data_Component_Def_Stmt`

:returns: an instance of MetaMeshMetadata.
:rtype: :py:class:`psyclone.domain.lfric.kernel.\
    MetaMeshMetadata`

Reimplemented from psyclone.domain.lfric.kernel.common_metadata.CommonMetadata.

Definition at line 72 of file meta_mesh_metadata.py.

72  def create_from_fparser2(fparser2_tree):
73  '''Create an instance of MetaMeshMetadata from an fparser2
74  tree.
75 
76  LFRic meta mesh metadata is in array form. Two
77  versions of the array form are supported:
78 
79  type(mesh_data_type) :: meta_mesh(1) = (/ ... /)
80  type(mesh_data_type), dimension(1) :: meta_mesh = (/ ... /)
81 
82  :param fparser2_tree: fparser2 tree capturing the meta \
83  mesh metadata.
84 
85  :type fparser2_tree: :py:class:`fparser.two.Fortran2003.\
86  Data_Component_Def_Stmt`
87 
88  :returns: an instance of MetaMeshMetadata.
89  :rtype: :py:class:`psyclone.domain.lfric.kernel.\
90  MetaMeshMetadata`
91 
92  '''
93  values_list = MetaMeshMetadata.get_derived_array_declaration(
94  fparser2_tree, "MESH_DATA_TYPE", "META_MESH")
95  meta_obj_list = []
96  for value in values_list:
97  meta_obj_list.append(
98  MetaMeshArgMetadata.create_from_fortran_string(value))
99  return MetaMeshMetadata(meta_obj_list)
100 
Here is the caller graph for this function:

◆ fortran_string()

def psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata.fortran_string (   self)
:returns: the meta_mesh metadata as Fortran.
:rtype: str

Definition at line 63 of file meta_mesh_metadata.py.

63  def fortran_string(self):
64  '''
65  :returns: the meta_mesh metadata as Fortran.
66  :rtype: str
67  '''
68  return self.type_declaration_string(
69  "MESH_DATA_TYPE", "META_MESH", self._meta_mesh_args)
70 

References psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata._meta_mesh_args, and psyclone.domain.lfric.kernel.common_declaration_metadata.CommonDeclarationMetadata.type_declaration_string().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ meta_mesh_args() [1/2]

def psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata.meta_mesh_args (   self)
:returns: a list of meta mesh argument objects.
:rtype: List[:py:class:`psyclone.domain.lfric.kernel.\
    MetaMeshArgMetadata`]

Definition at line 102 of file meta_mesh_metadata.py.

102  def meta_mesh_args(self):
103  '''
104  :returns: a list of meta mesh argument objects.
105  :rtype: List[:py:class:`psyclone.domain.lfric.kernel.\
106  MetaMeshArgMetadata`]
107  '''
108  return self._meta_mesh_args[:]
109 

References psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata._meta_mesh_args.

◆ meta_mesh_args() [2/2]

def psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata.meta_mesh_args (   self,
  values 
)
:param values: set the meta_mesh metadata to the \
    supplied list of values.
:type values: List[:py:class:`psyclone.domain.lfric.kernel.\
    MetaMeshArgMetadata`]

Definition at line 111 of file meta_mesh_metadata.py.

111  def meta_mesh_args(self, values):
112  '''
113  :param values: set the meta_mesh metadata to the \
114  supplied list of values.
115  :type values: List[:py:class:`psyclone.domain.lfric.kernel.\
116  MetaMeshArgMetadata`]
117 
118  '''
119  self.validate_list(values, MetaMeshArgMetadata)
120  # Take a copy of the list so that it can't be modified
121  # externally.
122  self._meta_mesh_args = values[:]
123 
124 

References psyclone.domain.lfric.kernel.meta_mesh_metadata.MetaMeshMetadata._meta_mesh_args, and psyclone.domain.lfric.kernel.common_declaration_metadata.CommonDeclarationMetadata.validate_list().

Here is the call graph for this function:

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