Salome HOME
Merge from V6_main 19/03/2013
[tools/medcoupling.git] / doc / doxygen / field.dox
1
2 /*!
3 \page field FIELD
4
5 \section FIELD_introduction  Introduction
6
7 MEDMEM fields are used to represent variables over a particular
8 set of elements of the mesh. The region on which the variable is defined
9 is determined through a support object (which can be 
10 retrieved by \a getSupport()
11 method). Each field has a number of components, that could
12  for instance be the different 
13 coordinates of a vector. All these components have a name, a
14 description and a unit. Elements can also contain several
15 Gauss points, in which case, values are defined on each 
16 Gauss point of the element. 
17
18 The fields can contain integer values or floating point values. 
19 In C++, this is reflected by the fact that FIELD is a class template
20 that can be either a \c FIELD<int> or \c FIELD<double>. In Python,
21 two classes \c FIELDINT and \c FIELDDOUBLE exist.
22 In the present section, the methods of the FIELD template
23 will be described as methods of a class \c FIELD_ (from 
24 which the template classes actually inherit). The template 
25 parameter is \c T.
26
27 In MEDMEM, a field is characterized by its name (\c getName) and an optional description (\c getDescription).
28
29 It is also characterized by its computation time : 
30
31 - an iteration number (time step number)
32 - an order number (used if there are internal iterations inside a time step)
33 - the time that corresponds to this iteration number.
34
35 By default, there are no iteration and order number defined (value 
36 MED_NOPDT and MED_NONOR).
37
38 \section field_interlacing Interlacing modes
39 As for the coordinates in the mesh definition, there are two ways to store
40 fields : one consists in interlacing the different components,
41  grouping the data elementwise (MED_FULL_INTERLACE mode), the other one consists in grouping the data componentwise (MED_NO_INTERLACE).
42
43 The situation is further complicated by the introduction of Gauss points. 
44 If the field is defined on several Gauss points, the MEDMEM convention
45 is that the Gauss points are always grouped together. Let us denote 
46 \f$V_{ijk}\f$ the value of the field on the \f$i\f$-th element, for the \f$j\f$-th component
47 on its \f$k\f$-th Gauss point. In {\c MED_FULL_INTERLACE, 
48 elements are nested in a \f$ijk\f$ order, while in \c MED_NO_INTERLACE
49 elements are nested in \f$jik\f$ order.  \\
50
51 For instance, \c MED_FULL_INTERLACE will result in the following ordering (for four Gauss points and two components):
52 \f$V_{111} V_{112} V_{113} V_{114} V_{121} V_{122} V_{123} V_{124} V_{211} V_{212} ... \f$
53
54 \c MED_NO_INTERLACE will result in the following ordering :
55 \f$ 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} \f$
56
57 In this document, only the methods enabling the retrieval of
58 values on fields defined on several Gauss points are presented. 
59 For further information on defining the location of the Gauss points
60 in a reference element, 
61 the reader should consult MED file Web Page : https://hammi.extra.cea.fr/static/MED/web_med/
62
63 \section field_outline Outline
64
65 The following sections describe the FIELD methods :
66 - This section describes how to create a FIELD lying on a support and
67 fill it : \ref FIELD_getset
68 - This section describes I/O methods :\ref FIELD_io
69 - This section details methods for setting and accessing the values: \ref FIELD_value
70 - This section details arithmetic operations performed on fields :
71 \ref FIELD_algo,
72 - This section treats the specific case of fields with several Gauss
73 points : \ref FIELD_gauss.
74
75 \subsection field_io_example Example for I/O routines
76 This program gives an example of creation
77 of a file containing a mesh and fields. This program 
78 is a tool that reads a mesh in an input file, creates a field
79 with the inverse of the cell volume, and creates an output file
80 with the mesh and the field.
81
82  The reader should note that the mesh name
83  passed as an argument to the 
84 \c addDriver() method has to be coherent with the  
85 mesh name (as obtained by \c getName() ).
86 \verbinclude FIELDwrite.cxx
87
88
89 \subsection FIELD_example Example
90 The following example reviews most of the notions seen 
91 in this section.
92 \verbinclude FIELDgeneral.cxx
93
94
95 */
96