Back to index

salome-med  6.5.0


MEDMEM fields are used to represent variables over a particular set of elements of the mesh. The region on which the variable is defined is determined through a support object (which can be retrieved by getSupport() method). Each field has a number of components, that could for instance be the different coordinates of a vector. All these components have a name, a description and a unit. Elements can also contain several Gauss points, in which case, values are defined on each Gauss point of the element.

The fields can contain integer values or floating point values. In C++, this is reflected by the fact that FIELD is a class template that can be either a FIELD<int> or FIELD<double>. In Python, two classes FIELDINT and FIELDDOUBLE exist. In the present section, the methods of the FIELD template will be described as methods of a class FIELD_ (from which the template classes actually inherit). The template parameter is T.

In MEDMEM, a field is characterized by its name (getName) and an optional description (getDescription).

It is also characterized by its computation time :

By default, there are no iteration and order number defined (value MED_NOPDT and MED_NONOR).

Interlacing modes

As for the coordinates in the mesh definition, there are two ways to store fields : one consists in interlacing the different components, grouping the data elementwise (MED_FULL_INTERLACE mode), the other one consists in grouping the data componentwise (MED_NO_INTERLACE).

The situation is further complicated by the introduction of Gauss points. If the field is defined on several Gauss points, the MEDMEM convention is that the Gauss points are always grouped together. Let us denote $V_{ijk}$ the value of the field on the $i$-th element, for the $j$-th component on its $k$-th Gauss point. In {MED_FULL_INTERLACE, elements are nested in a $ijk$ order, while in MED_NO_INTERLACE elements are nested in $jik$ order. \

For instance, MED_FULL_INTERLACE will result in the following ordering (for four Gauss points and two components): $V_{111} V_{112} V_{113} V_{114} V_{121} V_{122} V_{123} V_{124} V_{211} V_{212} ... $

MED_NO_INTERLACE will result in the following ordering : $ V_{111} V_{112} V_{113} V_{114} V_{211} V_{212} V_{213} V_{214} V_{311} V_{312} ... V_{121} V_{122} V_{123} $

In this document, only the methods enabling the retrieval of values on fields defined on several Gauss points are presented. For further information on defining the location of the Gauss points in a reference element, the reader should consult MED file Web Page :


The following sections describe the FIELD methods :

Example for I/O routines

This program gives an example of creation of a file containing a mesh and fields. This program is a tool that reads a mesh in an input file, creates a field with the inverse of the cell volume, and creates an output file with the mesh and the field.

The reader should note that the mesh name passed as an argument to the addDriver() method has to be coherent with the mesh name (as obtained by getName() ).


The following example reviews most of the notions seen in this section.