Salome HOME
Further fix for CaseReader Py3 ...
[tools/medcoupling.git] / doc / user / input / basic_concepts.rst
1 Basic concepts
2 ==============
3
4 Your're invited to start here.
5
6 This section explains in a concise way fundamental concepts
7 (incarnated by classes) for a better understanding of examples in FAQ_.
8
9 .. _FAQ: ../../developer/faq.html
10
11 The objects presented in this section are objects dedicated to data manipulation.
12
13 Later in advanced section, other objects will be presented to more complex data, as composite of objects presented here.
14
15 medcoupling Fields
16 ------------------
17 The most fundamental object is field. Fields are incarnated by MEDCouplingFieldDouble_.
18
19 .. _MEDCouplingFieldDouble: ../../developer/classMEDCoupling_1_1MEDCouplingFieldDouble.html
20
21 A field is an object able to give a value on every points geometrically covered by its support. The field support is a :ref:`mesh <medcoupling_Meshes>`.
22
23 Depending on the physics relative to the field, medcoupling fields proposes different spatial discretizations : cells, nodes, Gauss points.
24
25 The spatial discretization defines an algorithm giving the value of field on point given the position of a point inside the domain covered by the :ref:`mesh <medcoupling_Meshes>` and an :ref:`array <medcoupling_Arrays>` of float, integers located on specific location of mesh.
26
27 .. A tiny image of field
28
29 .. image:: ../images/pointe_fieldnodeint.png
30
31
32 .. _medcoupling_Meshes:
33
34 medcoupling Meshes
35 ------------------
36
37 Meshes are incarnated by MEDCouplingMesh_ (and their subclasses).
38 A mesh contains cells and nodes (indifferently called points). A
39 cell has a geometric type (TRI3, QUAD4, TETRA4).
40
41 .. _MEDCouplingMesh: ../../developer/classMEDCoupling_1_1MEDCouplingUMesh.html
42
43 All cells contained in a medcoupling mesh must have the same
44 dimension. This dimension is called meshdimension.
45
46 The set of points of a medcoupling mesh are stored into coordinates
47 :ref:`array <medcoupling_Arrays>`. The number of components of coordinates of coordinates
48 array is called the space dimension.
49
50 The space dimension is always greater or equal to mesh dimension.
51
52 .. _medcoupling_Arrays:
53
54 medcoupling Arrays
55 ------------------
56
57 One of the challenges faced by medcoupling is the reduction of memory
58 footprints. In medcoupling, memory expensive attributes are arrays
59 or composite of arrays.
60
61 To do so, medcoupling arrays represent contiguous arrays in the most
62 compact way to guaranty at most locality.
63
64 The type of elements contained in arrays is fix. Today int32,
65 float32 and float64 arrays are available. Elements in arrays are
66 grouped into fixed size packets called tuple.
67
68 This size of every tuple is called number of components.
69
70 Consequently number of elements in an array is equal to number of
71 tuples times number of components.
72
73 A typical usage of medcoupling array is for coordinates of points
74 storage. Number of components will be equal to space dimension and
75 number of tuples will be equal to number of points.
76
77 A medcoupling array has a name. And each component of array has also
78 a name. The component name use the following convention to put an
79 optional unity ("X cote [mm]").
80
81 If you are already a fan of `numpy <http://docs.scipy.org/doc/>`_ (you're right
82 it's an amazing/wonderful standard package), medcoupling arrays
83 behaves just like numpy arrays and anyway there are zero copy
84 gateways between medcoupling arrays and numpy.
85
86 medcoupling arrays implement different algorithms like reordering,
87 cloud comparisons, arithmetic, geometry helpers in addition to algorithms
88 proposed by numpy.
89