Salome HOME
Changes in doc organization.
[modules/med.git] / doc / doxygen / input / medcoupling / NatureOfField.dox
1
2 /*!
3     \defgroup NatureOfField Nature of a field
4
5     \section  IntExtFields Overview: intensive and extensive field
6
7 \c NatureOfField is an enum which helps in determining some physical significance of the field and affects the choice of the interpolation formula (see \ref TableNatureOfField).
8 It has five possible values:
9 -      "NoNature", the default value, does not allow the use of any interpolation tools
10
11 For intensive fields:
12 -      \ref TableNatureOfFieldExampleConservVol "ConservativeVolumic", for intensive field with the maximum principle favored over conservativity. Relevant for temperature, pressure fields.
13
14 -      \ref TableNatureOfFieldExampleRevIntegral "RevIntegral", for intensive field with the conservativity favored over maximum principle. Relevant for power density fields.
15
16 For extensive fields:
17 -      \ref TableNatureOfFieldExampleIntegral "Integral", for extensive field with the maximum principle favored over conservativity. Relevant for power fields.
18
19 -      \ref TableNatureOfFieldExampleIntegralGlobConstraint "IntegralGlobConstraint", for extensive fields with conservativity favored over the maximum principle. Relevant for power fields.
20
21 \n
22
23 By intensive field we mean a field that represents an intensive physical variable such as density (\f$kg.m^{-3}\f$), power density (\f$W.m^{-3}\f$), temperature (\f$K\f$) or pressure (\f$Pa\f$). Typically the physical value doesn't scale with the size of the underlying geometry.<br>
24 By extensive (or integral) field we mean a field that represents an extensive physical quantity such as mass (\f$kg\f$), volume (\f$m^3\f$), a momentum (\f$kg.m.s^{-1}\f$) or power \f$(W\f$).
25 Typically the field value scales linearly with respect to the underlying geometry size.
26 For fields with a P0 representation (cell based), conservativity formulas are different depending on whether the field is extensive or intensive (see \ref InterpKerP0P0Int and \ref InterpKerP0P0Ext).<br>
27 These two notions are themselves split into two sub-categories.
28 Indeed in some cases (e.g. non \ref MeshOverlap "overlapping meshes"), it is impossible to fulfill both the conservation principle and the maximum principle during the interpolation. The nature of the fields determines the formula to be used for non overlapping cells and thus the property that we will be satisfied.
29 Finally we consider that fields with P1 or P2 representations are necessarily intensive.
30
31 \section Usage
32
33 In order to use the various \ref interptools, you have to specify the nature of your field.
34 When the source and target meshes do not overlap, different treatments will be employed depending on the nature of the source and target fields.
35 You can specify the nature of the field when you create a \ref medcoupling field with the following constructor:
36 \code
37 MEDCouplingFieldDouble(NatureOfField n, MEDCouplingTimeDiscretization *td, MEDCouplingFieldDiscretization *type);
38 \endcode
39
40 If you read or copy an already existing field, or later after its creation, you may want to change/set its nature.
41 In order to do so, you can use the function
42
43 \code
44 void setNature(NatureOfField nat);
45 \endcode
46
47 Here is an example
48
49 \code
50 ...
51 const char sourceFileName[]="source.med";
52 MEDCouplingFieldDouble *sourceField=MEDLoader::ReadFieldCell(sourceFileName,"Source_Mesh",0,"Density",/*iteration*/0,/*order*/0);
53 const char targetFileName[]="target.med";
54 MEDCouplingUMesh *med_target_mesh=MEDLoader::ReadUMeshFromFile(targetFileName,"Target_Mesh",0);
55 //
56 sourceField->setNature(ConservativeVolumic);
57 ...
58 \endcode
59
60 */