Salome HOME
Merge from V6_main 19/03/2013
[modules/med.git] / doc / doxygen / medcouplingexamples.doxy
1 /*!
2 \page medcouplingcppexamples MEDCoupling C++ examples
3
4
5 \anchor cpp_mcpointset_
6 <br><h2>  </h2>
7
8 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_
9 \snippet MEDCouplingExamplesTest.py PySnippet_MEDCouplingPointSet_
10 \snippet MEDCouplingExamplesTest.py Snippet_MEDCouplingPointSet_
11
12
13 \anchor cpp_mcpointset_scale
14 <br><h2> Scaling the mesh </h2>
15
16 First, we create a 2D mesh with 4 nodes and no cells.
17 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_scale_1
18 Then we scale it by a factor of 2 with a center (0.,0.).
19 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_scale_2
20 Finally we check that all node coordinates have changed by more than 0.9.
21 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_scale_3
22
23
24
25
26 \anchor cpp_mcpointset_translate
27 <br><h2> Translating the mesh </h2>
28
29 First, we create a 2D mesh with 4 nodes and no cells.
30 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_translate_1
31 Then we translate it by a vector (1.,1.).
32 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_translate_2
33 Finally we check that all node coordinates have changed by more than 0.9.
34 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_translate_3
35
36
37
38 \anchor cpp_mcpointset_rotate
39 <br><h2> Rotating the mesh </h2>
40
41 First, we create a 2D mesh with 4 nodes and no cells.
42 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_1
43 Then we rotate it around a point (0.,0.) by 90 degrees clockwise.
44 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_2
45 Next, we make a 3D mesh from the 2D one and rotate it around the Z axis by 90 degrees
46 counter-clockwise. 
47 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_3
48 Finally we transform the mesh back to 2D space and check that all nodes get back to the
49 initial location.
50 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_rotate_4
51
52 \anchor cpp_mcpointset_getBoundingBox
53 <br><h2> Getting a minimum box bounding nodes </h2>
54
55 First, we create a 3D mesh with 2 nodes, so that the first one has minimal coordinates and
56 the second one has maximal coordinates.
57 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getBoundingBox_1
58 Now we get a bounding box enclosing these nodes. This bounding box should contain
59 coordinates of our two nodes (but in "no interlace" mode), as the nodes coincide with
60 points returned by the bounding box.
61 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getBoundingBox_2
62
63
64 \anchor cpp_mcpointset_getnodeidsnearpoint
65 <br><h2> Getting nodes close to a point </h2>
66
67 The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
68 "MEDCouplingUMesh" with 5 nodes and no cells.
69 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_1
70 Now we define an array of coordinates of a point close to nodes #0, #2 and #4.
71
72 Thus we expect that 
73 \ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoint "getNodeIdsNearPoint()" that
74 we are going to use,
75 if called with \b eps = 0.003, would return ids of nodes #0, #2 and #4.
76 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_2
77
78
79 \anchor cpp_mcpointset_getnodeidsnearpoints
80 <br><h2> Getting nodes close to some points </h2>
81
82 The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
83 "MEDCouplingUMesh" with 7 nodes and no cells.
84 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_1
85 Now we define an array of coordinates of 3 points near which we want to find nodes of the mesh.
86 - Point #0 is at distance 0.001 from the node #1.
87 - Point #1 is rather far from all nodes.
88 - Point #2 is close to nodes #3, #4 and #5.
89
90 Thus we expect that 
91 \ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoints "getNodeIdsNearPoints()" that
92 we are going to use,
93 if called with \b eps = 0.003, would return ids of close nodes #1, #3, #4 and #5.
94 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_2
95 \b idsIndex returns [0, 1, 1, 4] which means that:
96 - Point #0 is close to 1 (== \b idsIndex[1] - \b idsIndex[0]) node whose id is 
97 \b ids[ \b idsIndex[ 0 ]].
98 - Point #1 is close to 0 (== \b idsIndex[2] - \b idsIndex[1]) nodes.
99 - Point #2 is close to 3 (== \b idsIndex[3] - \b idsIndex[2]) nodes whose ids are
100 \b ids[ \b idsIndex[ 2 ]], \b ids[ \b idsIndex[ 2 ] + 1 ] and \b ids[ \b idsIndex[ 2 ] + 2 ].
101
102
103 \anchor cpp_mcpointset_findcommonnodes
104 <br><h2> Finding coincident nodes </h2>
105
106 First, we create a mesh with 6 nodes, of which two nodes (#3 and #4) are fully coincident
107 and 3 nodes (#0, #2 and #5) have distance less than 0.004 between them.
108 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_findCommonNodes_1
109 Then, we use \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" to find
110 coincident nodes, and check that (1) calling 
111 \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" with \b prec
112 == 1e-13 finds the two fully coincident nodes only and (2)
113 \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes"(0.004) finds 5
114 equal nodes.
115 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_findCommonNodes_2
116
117 \anchor cpp_mcpointset_getcoordinatesofnode
118 <br><h2> Getting coordinates of a node </h2>
119
120 The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
121 "MEDCouplingUMesh" with 3 nodes and no cells.
122 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_1
123 Here we get coordinates of the second node and check its two coordinates.
124 \snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_2
125
126 \anchor cpp_mcdataarrayint_getTuple
127 <br><h2> Getting a tuple of DataArrayInt </h2>
128
129 In this simple example we create an array of integers arranged into 3
130 tuples per 2 components, and finally print the second tuple.
131 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_getTuple_1
132 The output is
133 <pre> [9, 10] </pre>
134 Note that we can traverse all tuples in the array by simply iterating
135 over it as the code below does.
136 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_getTuple_2
137 Its output follows.
138 <pre>
139 (7, 8)
140 (9, 10)
141 (11, 12)
142 </pre>
143
144 \anchor cpp_mcdataarrayint_buildpermutationarr
145 <br><h2> Building a permutation array </h2>
146
147 Here we create two arrays containing same values but in different order and then we use
148 \ref ParaMEDMEM::DataArrayInt::buildPermutationArr "DataArrayInt::buildPermutationArr()" to get
149 an array showing in what places the values of \b b array are located in \b a array.
150 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_buildPermutationArr_1
151 The result array \b c contains [1,0,4,2,3].
152
153 <br><h2> Inverting renumbering maps </h2>
154 \anchor cpp_mcdataarrayint_invertarrayo2n2n2o
155 <h3> invertArrayO2N2N2O() </h3>
156
157 In this example we create a DataArrayInt containing a renumbering map in 
158 "Old to New" mode, convert it into the renumbering map in "New to Old" mode and check the
159 result.
160 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_invertArrayO2N2N2O_1
161
162 \anchor cpp_mcdataarrayint_invertarrayn2o2o2n
163 <br><h3> invertArrayN2O2O2N() </h3>
164
165 In this example we create a DataArrayInt containing a renumbering map in 
166 "New to Old" mode, convert it into the renumbering map in "Old to New" mode and check the
167 result.
168 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_invertArrayN2O2O2N_1
169
170
171
172 \anchor cpp_mcdataarraydouble_getidsinrange
173 <br><h2> Finding values in range in  DataArrayDouble</h2>
174
175 In this example we create an array \b da containing same values as ones returned by
176 \c range( \c 10 ). Then we get an array of indices of values of \b da being in
177 range [ 2.5, 6 ].
178 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_getIdsInRange_1
179 As result contents of the array \b da2 are as follows.
180 <pre>
181     Tuple #0 : 3
182     Tuple #1 : 4
183     Tuple #2 : 5
184     Tuple #3 : 6
185 </pre>
186
187
188 \anchor cpp_mcdataarraydouble_setselectedcomponents
189 <br><h2> Set part of values of DataArrayDouble </h2>
190 <h3> setSelectedComponents() </h3>
191 First, we create a 'source' array.
192 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents1
193 Now we create a larger zero array and assign the array \b da into it.
194 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents2
195 As result contents of the array \b dv are as follows.
196 <pre>
197 Info of components : "a2"   "a1"   "v3"   "v4"   
198     Tuple #0 : 2 1 0 0 
199     Tuple #1 : 4 3 0 0 
200     Tuple #2 : 6 5 0 0 
201     Tuple #3 : 0 0 0 0 
202 </pre>
203 The same result can be achieved other way (except that component info
204 is not copied):
205 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setSelectedComponents3
206
207 \anchor cpp_mcdataarraydouble_setpartofvalues1
208 <br><h3> setPartOfValues1() </h3>
209 We create two arrays: 
210 - a "large" (4x4) zero array \b da to assign to and
211 - a smaller (2x2) array \b dv filled with values [7.,8.,9.,10].
212
213 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_1
214 Now we copy \b dv to the middle of \b da.
215 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_2
216 As result contents of the array \b da are as follows.
217 <pre>
218     Info of components :"v1"   "v2"   "v3"   "v4"
219     Tuple #0 : 0 0 0 0 
220     Tuple #1 : 0 7 8 0 
221     Tuple #2 : 0 9 10 0 
222     Tuple #3 : 0 0 0 0 
223 </pre>
224
225 Here we re-fill \b da with zeros and copy \b dv into a component of \b da.
226
227 Note that the last parameter \a strictCompoCompare should be \a False
228 in this case, else \ref ParaMEDMEM::DataArrayDouble::setPartOfValues1() 
229 throws an exception because \b da has 2 components but only one target
230 component is specified.
231 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_3
232 <pre>
233     Tuple #0 : 0 7 0 0 
234     Tuple #1 : 0 8 0 0 
235     Tuple #2 : 0 9 0 0 
236     Tuple #3 : 0 10 0 0 
237 </pre>
238 Below more two variants of location of target values are shown.
239 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_4
240 <pre>
241     Tuple #0 : 0 0 0 0 
242     Tuple #1 : 7 8 9 10 
243     Tuple #2 : 0 0 0 0 
244     Tuple #3 : 0 0 0 0 
245 </pre>
246
247 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_5
248 <pre>
249     Tuple #0 : 0 7 0 8 
250     Tuple #1 : 0 0 0 0 
251     Tuple #2 : 0 9 0 10 
252     Tuple #3 : 0 0 0 0 
253 </pre>
254 The same result can be achieved other way:
255 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_6
256
257
258
259 \anchor cpp_mcdataarraydouble_setpartofvaluessimple1
260 <br><h3> setPartOfValuesSimple1() </h3>
261 We create an array (4x4) \b da to assign to and define a value \b dv to assign.
262 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_1
263 Now we assign \b dv to the middle of \b da.
264 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_2
265 As result contents of the array \b da are as follows.
266 <pre>
267     Tuple #0 : 0 0 0 0 
268     Tuple #1 : 0 7 7 0 
269     Tuple #2 : 0 7 7 0 
270     Tuple #3 : 0 0 0 0 
271 </pre>
272
273 Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
274 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_3
275 <pre>
276     Tuple #0 : 0 7 0 0 
277     Tuple #1 : 0 7 0 0 
278     Tuple #2 : 0 7 0 0 
279     Tuple #3 : 0 7 0 0 
280 </pre>
281 Below more two variants of location of target values are shown.
282 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_4
283 <pre>
284     Tuple #0 : 0 0 0 0 
285     Tuple #1 : 7 7 7 7 
286     Tuple #2 : 0 0 0 0 
287     Tuple #3 : 0 0 0 0 
288 </pre>
289
290 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_5
291 <pre>
292     Tuple #0 : 0 7 0 7 
293     Tuple #1 : 0 0 0 0 
294     Tuple #2 : 0 7 0 7 
295     Tuple #3 : 0 0 0 0 
296 </pre>
297 The same result can be achieved other way:
298 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple1_6
299
300
301 \anchor cpp_mcdataarraydouble_setpartofvaluessimple2
302 <br><h3> setPartOfValuesSimple2() </h3>
303 We create an array (4x4) \b da to assign to and define a value \b dv to assign.
304 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_1
305 Now we assign \b dv to the middle of \b da.
306 We explicitly specify tuples and component to assign to by a list [1,2].
307 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_2
308 As result contents of the array \b da are as follows.
309 <pre>
310     Tuple #0 : 0 0 0 0 
311     Tuple #1 : 0 7 7 0 
312     Tuple #2 : 0 7 7 0 
313     Tuple #3 : 0 0 0 0 
314 </pre>
315
316 Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
317 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_3
318 <pre>
319     Tuple #0 : 0 7 0 0 
320     Tuple #1 : 0 7 0 0 
321     Tuple #2 : 0 7 0 0 
322     Tuple #3 : 0 7 0 0 
323 </pre>
324 Below more two variants of location of target values are shown.
325 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_4
326 <pre>
327     Tuple #0 : 0 0 0 0 
328     Tuple #1 : 7 7 7 7 
329     Tuple #2 : 0 0 0 0 
330     Tuple #3 : 0 0 0 0 
331 </pre>
332
333 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple2_5
334 <pre>
335     Tuple #0 : 0 7 0 7 
336     Tuple #1 : 0 0 0 0 
337     Tuple #2 : 0 7 0 7 
338     Tuple #3 : 0 0 0 0 
339 </pre>
340 \note \ref ParaMEDMEM::DataArrayDouble::setPartOfValuesSimple2() can't
341 be explicitly called in Python.
342
343
344 \anchor cpp_mcdataarraydouble_setpartofvaluessimple3
345 <br><h3> setPartOfValuesSimple3() </h3>
346 We create an array (4x4) \b da to assign to and define a value \b dv to assign.
347 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_1
348 Now we assign \b dv to the middle of \b da.
349 We explicitly specify tuples to assign to by a list [1,2]. And we specify
350 components to assign to using slicing: 1:3.
351 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_2
352 As result contents of the array \b da are as follows.
353 <pre>
354     Tuple #0 : 0 0 0 0 
355     Tuple #1 : 0 7 7 0 
356     Tuple #2 : 0 7 7 0 
357     Tuple #3 : 0 0 0 0 
358 </pre>
359
360 Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
361 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_3
362 <pre>
363     Tuple #0 : 0 7 0 0 
364     Tuple #1 : 0 7 0 0 
365     Tuple #2 : 0 7 0 0 
366     Tuple #3 : 0 7 0 0 
367 </pre>
368 Below more two variants of location of target values are shown.
369 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_4
370 <pre>
371     Tuple #0 : 0 0 0 0 
372     Tuple #1 : 7 7 7 7 
373     Tuple #2 : 0 0 0 0 
374     Tuple #3 : 0 0 0 0 
375 </pre>
376
377 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValuesSimple3_5
378 <pre>
379     Tuple #0 : 0 7 0 7 
380     Tuple #1 : 0 0 0 0 
381     Tuple #2 : 0 7 0 7 
382     Tuple #3 : 0 0 0 0 
383 </pre>
384 \note \ref ParaMEDMEM::DataArrayDouble::setPartOfValuesSimple3() can't
385 be explicitly called in Python.
386
387
388 \anchor cpp_mcdataarraydouble_setpartofvalues2
389 <br><h3> setPartOfValues2() </h3>
390 We create two arrays: 
391 - a "large" (4x7) zero array \b da to assign to,
392 - a smaller (3x2) array \b dv filled with values [7.,8.,9.,10.,11.,12.].
393
394 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues2_1
395 Now we assign the two components of \b dv to the components of \b da
396 with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
397   indices [0,1,2]. This is the first mode of usage.
398 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues2_2
399 As result contents of the array \b da are as follows.
400 <pre>
401     Tuple #0 : 0  7  0  8  0  0  0  
402     Tuple #1 : 0  9  0 10  0  0  0 
403     Tuple #2 : 0 11  0 12  0  0  0 
404     Tuple #3 : 0  0  0  0  0  0  0
405 </pre>
406 Every value of \b dv has been assigned to its own location within \b da.
407
408 Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
409 And we assign \b dv to the tuples of \b da with indices [0,2,3] .
410 This is the second mode of usage.
411 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues2_3
412 The contents of \b dv have been assigned to each of specified tuples of \b da.
413 Every value of \b dv is repeated in the 3 specified tuples within \b da.
414 <pre>
415     Tuple #0 : 7  0  8  9 10 11 12
416     Tuple #1 : 0  0  0  0  0  0  0   
417     Tuple #2 : 7  0  8  9 10 11 12
418     Tuple #3 : 7  0  8  9 10 11 12
419 </pre>
420 \note \ref ParaMEDMEM::DataArrayDouble::setPartOfValues2() can't
421 be explicitly called in Python.
422
423
424 \anchor cpp_mcdataarraydouble_setpartofvalues3
425 <br><h3> setPartOfValues3() </h3>
426 We create two arrays: 
427 - a "large" (4x7) zero array \b da to assign to,
428 - a smaller (3x2) array \b dv filled with values [7.,8.,9.,10.,11.,12.].
429
430 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues3_1
431 Now we assign the two components of \b dv to the components of \b da
432 with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
433 indices [0,1,2] which are specified using slicing: "0:3". 
434 This is the first mode of usage.
435 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues3_2
436 As result contents of the array \b da are as follows.
437 <pre>
438     Tuple #0 : 0  7  0  8  0  0  0  
439     Tuple #1 : 0  9  0 10  0  0  0 
440     Tuple #2 : 0 11  0 12  0  0  0 
441     Tuple #3 : 0  0  0  0  0  0  0
442 </pre>
443 Every value of \b dv has been assigned to its own location within \b da.
444
445 Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
446 And we assign \b dv to the tuples of \b da with indices [0,2] using \a
447 slice notation "0:4:2". This is the second mode of usage.
448 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues3_3
449 The contents of \b dv have been assigned to each of specified tuples of \b da.
450 Every value of \b dv is repeated in the 3 specified tuples within \b da.
451 <pre>
452     Tuple #0 : 7  0  8  9 10 11 12
453     Tuple #1 : 0  0  0  0  0  0  0   
454     Tuple #2 : 7  0  8  9 10 11 12
455     Tuple #3 : 0  0  0  0  0  0  0   
456 </pre>
457 \note \ref ParaMEDMEM::DataArrayDouble::setPartOfValues3() can't
458 be explicitly called in Python.
459
460
461 \anchor cpp_mcdataarrayint_setselectedcomponents
462 <br><h2> Set part of values of DataArrayInt </h2>
463 <h3> setSelectedComponents() </h3>
464 First, we create a 'source' array.
465 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents1
466 Now we create a larger zero array and assign the array \b da to it.
467 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents2
468 As result contents of the array \b dv are as follows.
469 <pre>
470 Info of components : "a2"   "a1"   "v3"   "v4"   
471     Tuple #0 : 2 1 0 0 
472     Tuple #1 : 4 3 0 0 
473     Tuple #2 : 6 5 0 0 
474     Tuple #3 : 0 0 0 0 
475 </pre>
476 The same result can be achieved other way (except that component info
477 is not copied):
478 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setSelectedComponents3
479
480 \anchor cpp_mcdataarrayint_setpartofvalues1
481 <br><h3> setPartOfValues1() </h3>
482 We create two arrays: 
483 - a "large" (4x4) zero array \b da to assign to and
484 - a smaller (2x2) array \b dv filled with values [7,8,9,10].
485
486 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_1
487 Now we copy \b dv to the middle of \b da.
488 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_2
489 As result contents of the array \b da are as follows.
490 <pre>
491     Info of components :"v1"   "v2"   "v3"   "v4"
492     Tuple #0 : 0 0 0 0 
493     Tuple #1 : 0 7 8 0 
494     Tuple #2 : 0 9 10 0 
495     Tuple #3 : 0 0 0 0 
496 </pre>
497
498 Here we re-fill \b da with zeros and copy \b dv into a component of \b da.
499
500 Note that the last parameter \a strictCompoCompare should be \a False
501 in this case, else \ref ParaMEDMEM::DataArrayInt::setPartOfValues1() 
502 throws an exception because \b da has 2 components but only one target
503 component is specified.
504 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_3
505 <pre>
506     Tuple #0 : 0 7 0 0 
507     Tuple #1 : 0 8 0 0 
508     Tuple #2 : 0 9 0 0 
509     Tuple #3 : 0 10 0 0 
510 </pre>
511 Below more two variants of location of target values are shown.
512 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_4
513 <pre>
514     Tuple #0 : 0 0 0 0 
515     Tuple #1 : 7 8 9 10 
516     Tuple #2 : 0 0 0 0 
517     Tuple #3 : 0 0 0 0 
518 </pre>
519
520 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_5
521 <pre>
522     Tuple #0 : 0 7 0 8 
523     Tuple #1 : 0 0 0 0 
524     Tuple #2 : 0 9 0 10 
525     Tuple #3 : 0 0 0 0 
526 </pre>
527 The same result can be achieved other way:
528 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_6
529
530
531
532 \anchor cpp_mcdataarrayint_setpartofvaluessimple1
533 <br><h3> setPartOfValuesSimple1() </h3>
534 We create an array (4x4) \b da to assign to and define a value \b dv to assign.
535 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_1
536 Now we assign \b dv to the middle of \b da.
537 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_2
538 As result contents of the array \b da are as follows.
539 <pre>
540     Tuple #0 : 0 0 0 0 
541     Tuple #1 : 0 7 7 0 
542     Tuple #2 : 0 7 7 0 
543     Tuple #3 : 0 0 0 0 
544 </pre>
545
546 Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
547 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_3
548 <pre>
549     Tuple #0 : 0 7 0 0 
550     Tuple #1 : 0 7 0 0 
551     Tuple #2 : 0 7 0 0 
552     Tuple #3 : 0 7 0 0 
553 </pre>
554 Below more two variants of location of target values are shown.
555 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_4
556 <pre>
557     Tuple #0 : 0 0 0 0 
558     Tuple #1 : 7 7 7 7 
559     Tuple #2 : 0 0 0 0 
560     Tuple #3 : 0 0 0 0 
561 </pre>
562
563 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_5
564 <pre>
565     Tuple #0 : 0 7 0 7 
566     Tuple #1 : 0 0 0 0 
567     Tuple #2 : 0 7 0 7 
568     Tuple #3 : 0 0 0 0 
569 </pre>
570 The same result can be achieved other way:
571 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple1_6
572
573
574 \anchor cpp_mcdataarrayint_setpartofvaluessimple2
575 <br><h3> setPartOfValuesSimple2() </h3>
576 We create an array (4x4) \b da to assign to and define a value \b dv to assign.
577 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_1
578 Now we assign \b dv to the middle of \b da.
579 We explicitly specify tuples and component to assign to by a list [1,2].
580 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_2
581 As result contents of the array \b da are as follows.
582 <pre>
583     Tuple #0 : 0 0 0 0 
584     Tuple #1 : 0 7 7 0 
585     Tuple #2 : 0 7 7 0 
586     Tuple #3 : 0 0 0 0 
587 </pre>
588
589 Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
590 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_3
591 <pre>
592     Tuple #0 : 0 7 0 0 
593     Tuple #1 : 0 7 0 0 
594     Tuple #2 : 0 7 0 0 
595     Tuple #3 : 0 7 0 0 
596 </pre>
597 Below more two variants of location of target values are shown.
598 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_4
599 <pre>
600     Tuple #0 : 0 0 0 0 
601     Tuple #1 : 7 7 7 7 
602     Tuple #2 : 0 0 0 0 
603     Tuple #3 : 0 0 0 0 
604 </pre>
605
606 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple2_5
607 <pre>
608     Tuple #0 : 0 7 0 7 
609     Tuple #1 : 0 0 0 0 
610     Tuple #2 : 0 7 0 7 
611     Tuple #3 : 0 0 0 0 
612 </pre>
613 \note \ref ParaMEDMEM::DataArrayInt::setPartOfValuesSimple2() can't
614 be explicitly called in Python.
615
616
617 \anchor cpp_mcdataarrayint_setpartofvaluessimple3
618 <br><h3> setPartOfValuesSimple3() </h3>
619 We create an array (4x4) \b da to assign to and define a value \b dv to assign.
620 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_1
621 Now we assign \b dv to the middle of \b da.
622 We explicitly specify tuples to assign to by a list [1,2]. And we specify
623 components to assign to using slicing: 1:3.
624 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_2
625 As result contents of the array \b da are as follows.
626 <pre>
627     Tuple #0 : 0 0 0 0 
628     Tuple #1 : 0 7 7 0 
629     Tuple #2 : 0 7 7 0 
630     Tuple #3 : 0 0 0 0 
631 </pre>
632
633 Here we re-fill \b da with zeros and assign \b dv to a component of \b da.
634 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_3
635 <pre>
636     Tuple #0 : 0 7 0 0 
637     Tuple #1 : 0 7 0 0 
638     Tuple #2 : 0 7 0 0 
639     Tuple #3 : 0 7 0 0 
640 </pre>
641 Below more two variants of location of target values are shown.
642 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_4
643 <pre>
644     Tuple #0 : 0 0 0 0 
645     Tuple #1 : 7 7 7 7 
646     Tuple #2 : 0 0 0 0 
647     Tuple #3 : 0 0 0 0 
648 </pre>
649
650 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValuesSimple3_5
651 <pre>
652     Tuple #0 : 0 7 0 7 
653     Tuple #1 : 0 0 0 0 
654     Tuple #2 : 0 7 0 7 
655     Tuple #3 : 0 0 0 0 
656 </pre>
657 \note \ref ParaMEDMEM::DataArrayInt::setPartOfValuesSimple3() can't
658 be explicitly called in Python.
659
660
661 \anchor cpp_mcdataarrayint_setpartofvalues2
662 <br><h3> setPartOfValues2() </h3>
663 We create two arrays: 
664 - a "large" (4x7) zero array \b da to assign to,
665 - a smaller (3x2) array \b dv filled with values [7,8,9,10,11,12].
666
667 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues2_1
668 Now we assign the two components of \b dv to the components of \b da
669 with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
670   indices [0,1,2]. This is the first mode of usage.
671 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues2_2
672 As result contents of the array \b da are as follows.
673 <pre>
674     Tuple #0 : 0  7  0  8  0  0  0  
675     Tuple #1 : 0  9  0 10  0  0  0 
676     Tuple #2 : 0 11  0 12  0  0  0 
677     Tuple #3 : 0  0  0  0  0  0  0
678 </pre>
679 Every value of \b dv has been assigned to its own location within \b da.
680
681 Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
682 And we assign \b dv to the tuples of \b da with indices [0,2,3] .
683 This is the second mode of usage.
684 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues2_3
685 The contents of \b dv have been assigned to each of specified tuples of \b da.
686 Every value of \b dv is repeated in the 3 specified tuples within \b da.
687 <pre>
688     Tuple #0 : 7  0  8  9 10 11 12
689     Tuple #1 : 0  0  0  0  0  0  0   
690     Tuple #2 : 7  0  8  9 10 11 12
691     Tuple #3 : 7  0  8  9 10 11 12
692 </pre>
693 \note \ref ParaMEDMEM::DataArrayInt::setPartOfValues2() can't
694 be explicitly called in Python.
695
696
697 \anchor cpp_mcdataarrayint_setpartofvalues3
698 <br><h3> setPartOfValues3() </h3>
699 We create two arrays: 
700 - a "large" (4x7) zero array \b da to assign to,
701 - a smaller (3x2) array \b dv filled with values [7,8,9,10,11,12].
702
703 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues3_1
704 Now we assign the two components of \b dv to the components of \b da
705 with indices [1,3], and the 3 tuples of \b dv to the 3 tuples of \b da with
706 indices [0,1,2] which are specified using slicing: "0:3". 
707 This is the first mode of usage.
708 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues3_2
709 As result contents of the array \b da are as follows.
710 <pre>
711     Tuple #0 : 0  7  0  8  0  0  0  
712     Tuple #1 : 0  9  0 10  0  0  0 
713     Tuple #2 : 0 11  0 12  0  0  0 
714     Tuple #3 : 0  0  0  0  0  0  0
715 </pre>
716 Every value of \b dv has been assigned to its own location within \b da.
717
718 Now we re-fill \b da with zeros and rearrange \b dv to have 6 components.
719 And we assign \b dv to the tuples of \b da with indices [0,2] using \a
720 slice notation "0:4:2". This is the second mode of usage.
721 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues3_3
722 The contents of \b dv have been assigned to each of specified tuples of \b da.
723 Every value of \b dv is repeated in the 3 specified tuples within \b da.
724 <pre>
725     Tuple #0 : 7  0  8  9 10 11 12
726     Tuple #1 : 0  0  0  0  0  0  0   
727     Tuple #2 : 7  0  8  9 10 11 12
728     Tuple #3 : 0  0  0  0  0  0  0   
729 </pre>
730 \note \ref ParaMEDMEM::DataArrayInt::setPartOfValues3() can't
731 be explicitly called in Python.
732
733
734 \anchor cpp_mcdataarraydouble_getdifferentvalues
735 <br><h2> Excluding coincident tuples from DataArrayDouble</h2>
736
737 The code below creates an array of real values and than an array of
738   unique values, not closer one to another than 0.2, is retrieved from it.
739 \snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_getDifferentValues1
740
741
742 \anchor cpp_mcdataarraydouble_findcommontuples
743 <br><h2> Finding coincident tuples in DataArrayDouble</h2>
744
745 Let's create an array of 6 tuples and 2 components that can be
746   considered as coordinates of 6 points in 2D space.
747 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_findCommonTuples1
748 Now we find points that are not far each from other than 1e-1.
749 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_findCommonTuples2
750 As we can realize from the above code, a hardcoded array \b expected3 is equal
751   to the raw data of a DataArrayInt \b c and a hardcoded array \b expected4 is equal
752   to the raw data of the DataArrayInt \b cI.
753
754 The array \b c contains indices of 5 coincident points. The array \b
755   cI shows us boundaries of (cI->getNumberOfTuples()-1) = 2 groups of coincident points: 
756 - The first group starts at index 0 and includes (3 - 0) = 3 points: 0,3,4.
757 - The second group starts at index 3 and includes (5 - 3) = 2 points: 1,2.
758
759 \anchor cpp_mcdataarraydouble_meldwith
760 <br><h2> Concatenating DataArrayDouble's by appending components </h2>
761
762 In this example we create two data arrays including \b same number of
763 tuples and then we concatenate them using \ref
764 ParaMEDMEM::DataArrayDouble::meldWith "meldWith()".
765 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_Meld1_1
766 Now the array \b da1 includes 7 tuples (as before) of 3 components
767 each. Its components are: "c0da1","c1da1","c0da2".
768
769
770 \anchor cpp_mcdataarrayint_meldwith
771 <br><h2> Concatenating DataArrayInt's by appending components </h2>
772
773 In this example we create two data arrays including \b same number of
774 tuples and then we concatenate them using \ref
775 ParaMEDMEM::DataArrayInt::meldWith "meldWith()".
776 \snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_Meld1_1
777 Now the array \b da1 includes 7 tuples (as before) of 3 components
778 each. Its components are: "c0da1","c1da1","c0da2".
779
780
781 \anchor cpp_mcdataarraydouble_KeepSelectedComponents
782
783 <br><h2>Creation of a sub-part of the DataArrayDouble by selecting components</h2>
784
785 \snippet MEDCouplingExamplesTest.py SnippeDataArrayDoubleKeepSelectedComponents1_1
786 We created an array \b a1 containing 5 tuples of 4 components each (20
787 values). Now we are going to create an array \b a2 containing some
788 components of \b a1.
789 \snippet MEDCouplingExamplesTest.py SnippeDataArrayDoubleKeepSelectedComponents1_2
790 Now each tuple of \b a2 includes components named "b","c","b","c","a","a". Thus
791 the result array \b a2 includes 30 elements (5 tuples per 6 components).
792
793 \anchor cpp_mcfielddouble_subpart1
794
795 \anchor cpp_mcdataarrayint_keepselectedcomponents
796
797 <br><h2>Creation of a sub-part of the DataArrayInt by selecting components</h2>
798
799 \snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_1
800 We created an array \b a1 containing 5 tuples of 4 components each (20
801 values). Now we are going to create an array \b a2 containing some
802 components of \b a1.
803 \snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_2
804 Now each tuple of \b a2 includes components named "b","c","b","c","a","a". Thus
805 the result array \b a2 includes 30 elements (5 tuples per 6 components).
806
807 Note that
808 \ref ParaMEDMEM::DataArrayInt::keepSelectedComponents() "DataArrayInt::keepSelectedComponents()" 
809 is called, providing the same result, by the following python code:
810 \snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_3
811
812 \anchor cpp_mcfielddouble_subpart1
813
814
815 <br><h2>Creation of a sub part of a field</h2>
816 <br><h3>Creation of a sub part of a field on cells</h3>
817 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_1
818 The field on cells \b f1 lies on a mesh containing 5 cells and 9 nodes.         
819 So this field \b f1 contains 5 tuples of 2 components each (10 values).
820 Now let's create a subfield on cells \b f2 from \b f1.
821 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_2
822
823 \b f1 is a field on cells, \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on cells too.
824
825 So the array \b part1 lists ids on cells.
826
827 - cell #0 of \b f2 is the same cell of cell #2 of \b f1
828 - cell #1 of \b f2 is the same cell of cell #1 of \b f1
829 - cell #2 of \b f2 is the same cell of cell #4 of \b f1
830
831 So \b f2 contains 3 tuples with 2 components.
832
833 The underlying mesh of \b f2 contains a newly created mesh with 3 cells (not as \b mesh1 in \b f1) and 9 nodes (as \b mesh1 in \b f1).
834 \n For fields on cells the number of tuples of the returned field is always equal to the number of ids given in input (here \b part1).
835 \nOnly fields on cells have this particular behaviour.
836
837 <br><h3>Creation of a sub part of a field on nodes</h3>
838 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_3
839 The field on nodes \b f1 lies on a mesh containing 5 cells and 9 nodes.
840 So this field \b f1 contains 9 tuples of 2 components each (18 values).
841 Now let's create a subfield on nodes \b f2 from \b f1.
842 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_4
843
844 \b f1 is a field on nodes, but \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on \b cells.
845
846 After the call of \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" on node field \b f1, \b f1 will be reduced on a
847 submesh of \b mesh1 containing cells whoses ids are in \b part2. So here the number of cells of \b f2 is 2 and the number of nodes is 4.
848 \nSo contrary to fields on cells, it is normal for fields on nodes that number of tuples of the returned field of \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" 
849 method does not match the size of the input array (here \b part2).
850
851 */
852
853 /*!
854 \page medcouplingcppexamplesUmeshStdBuild1 <br><h1> Example of standard build of an unstructured mesh from scratch in C++ </h1>
855
856 Firstly retrieve basic data in full interlace mode for coordinates, and nodal connectivity cell per cell.
857 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_1
858
859 Then create ParaMEDMEM::MEDCouplingUMesh instance giving its meshdimension (2 here) and a name.
860
861 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_2
862
863 Gives an upper bound of the number of cells to be inserted into the unstructured mesh.
864 \n Then enter nodal connectivity of all cells, cell per cell using ParaMEDMEM::MEDCouplingUMesh::insertNextCell method.
865 \n When the nodal connectivity cell per cell has been finished, call ParaMEDMEM::MEDCouplingUMesh::finishInsertingCells method in order to restore \b mesh instance.
866
867 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_3
868
869 At this level the connectivity part of the mesh \b mesh as been defined. Now let's set the coordinates using array \b coords defined above.
870
871 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_4
872
873 At this level mesh is usable. When this mesh is no more needed simply call decrRef to decrement its reference counter.
874
875 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_5
876
877 */
878
879 /*!
880 \page medcouplingcppexamplesUmeshAdvBuild1 <br><h1> Example of advanced build of an unstructured mesh from scratch in C++ </h1>
881
882 Firstly retrieve basic data in full interlace mode for coordinates, and nodal connectivity cell per cell, cell type \b included (3 for INTERP_KERNEL::NORM_TRI3 and 4 for INTERP_KERNEL::QUAD4).
883 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_1
884
885 Then create ParaMEDMEM::MEDCouplingUMesh instance giving its meshdimension (2 here) and a name.
886
887 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_2
888
889 Then enter nodal connectivity at once.
890
891 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_3
892
893 At this level the connectivity part of the mesh \b mesh as been defined. Now let's set the coordinates using array \b coords defined above.
894
895 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_4
896
897 At this level mesh is usable. When this mesh is no more needed simply call decrRef() to decrement its reference counter.
898
899 \snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_5
900
901 */
902
903 /*!
904 \page medcouplingcppexamplesCmeshStdBuild1 <br><h1> Example of standard build of an cartesian mesh from scratch in C++ </h1>
905
906 We are going to build a 2D cartesian mesh, constituted from 9 nodes along X axis, and 7 nodes along Y axis.
907
908 Firstly retrieve for each direction the discretization and build a \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instance" on the corresponding direction.
909
910 \snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_1
911
912 Then create ParaMEDMEM::MEDCouplingCMesh instance giving the 2 instances of \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" obtained above.
913
914 There are 2 techniques to get it.
915
916 Either :
917
918 \snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_2
919
920 Or :
921
922 \snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_2bis
923
924 \c mesh is now available for use :
925
926 \snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_3
927
928 When this mesh is no more needed simply call decrRef to decrement its reference counter.
929
930 \snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_4
931
932 */
933
934 /*!
935 \page medcouplingcppexamplesFieldDoubleBuild1 <br><h1> Examples in C++ of standard build of a tensor field on cells with no time attached  </h1>
936
937 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild1_1
938
939 */
940
941 /*!
942 \page medcouplingcppexamplesFieldDoubleBuild2 <br><h1> Examples in C++ of standard build of a scalar field on nodes with no time attached </h1>
943
944 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild2_1
945
946 */
947
948 /*!
949 \page medcouplingcppexamplesFieldDoubleBuild3 <br><h1> Examples in C++ of standard build of a vector field on cells with with one time attached and no time interval </h1>
950
951 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild3_1
952
953 */
954
955 /*!
956 \page medcouplingcppexamplesFieldDoubleBuild4 <br><h1> Examples in C++ of standard build of a vector field on nodes defined on a time interval with a constant value during this interval </h1>
957
958 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild4_1
959
960 */
961
962 /*!
963 \page medcouplingcppexamplesFieldDoubleBuild5 <br><h1> Examples in C++ of operation that can be carried out on fields on cells </h1>
964
965 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild1_2
966
967 The decrementation of ref counter should be carried out in CPlusPlus only ...
968
969 \snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuild1_3
970
971 */