Salome HOME
Building a version which will be tagged PreV2_0_0 working with KERNEL V1_4_0.
[tools/medcoupling.git] / doc / MEDMEM / MEDMEM_UsersGuide.lyx
1 #LyX 1.1 created this file. For more info see http://www.lyx.org/
2 \lyxformat 218
3 \textclass report
4 \begin_preamble
5 % Packages
6 %%\usepackage[french]{babel}
7 %\usepackage[T1]{fontenc}
8 %\usepackage{epsf}
9 %\usepackage[dvips]{graphicx}
10 %\usepackage{fancyhdr}
11 %\usepackage{pslatex}
12
13 \usepackage[dvips,all,light]{draftcopy}
14
15 \usepackage{verbatim}
16
17 %  ____________________________________________________________________________
18 % |                                                                            |
19 % |                             MISE EN PAGE                                   |
20 % |____________________________________________________________________________|
21
22 \draftcopyName{Projet}{200}
23
24 \setlength{\oddsidemargin}{0cm}
25 \setlength{\marginparsep}{0cm}
26 \setlength{\marginparwidth}{0cm}
27
28 \setlength{\textwidth}{15cm}
29
30 \setlength{\topmargin}{0cm}
31 \setlength{\headheight}{0cm}
32 \setlength{\headsep}{0cm}
33
34 \setlength{\textheight}{23cm}
35
36 %  ____________________________________________________________________________
37 % |                                                                            |
38 % |                             COMMANDES UTILISATEUR                          |
39 % |____________________________________________________________________________|
40
41 \newcommand{\method}[1]{method \mbox{\textbf{#1}}}
42
43 \newcommand{\myref}[1]{\ref{#1}, page \pageref{#1}}
44
45 \newcommand{\fileCxx}[1]{
46   \subsection{Full C++ example~: }
47   \label{#1}
48   \verbatiminput{#1}
49 }
50
51 \newcommand{\filePython}[1]{
52   \subsection{Full Python example~: }
53   \label{#1}
54   \verbatiminput{#1}
55 }
56
57 %  ____________________________________________________________________________
58 % |                                                                            |
59 % |                              LE DOCUMENT                                   |
60 % |____________________________________________________________________________|
61 %
62 \title{User's Guide Of Med Memory}
63 \author{Patrick GOLDBRONN \and Eric Fayolle \and Nadir Bouhamou}
64
65 %  ____________________________________________________________________________
66 % |                                                                            |
67 % |                              DEBUT DU DOCUMENT                             |
68 % |____________________________________________________________________________|
69 %
70 \end_preamble
71 \language english
72 \inputencoding auto
73 \fontscheme default
74 \graphics default
75 \paperfontsize 11
76 \spacing single 
77 \papersize a4paper
78 \paperpackage a4
79 \use_geometry 0
80 \use_amsmath 0
81 \paperorientation portrait
82 \secnumdepth 3
83 \tocdepth 3
84 \paragraph_separation skip
85 \defskip medskip
86 \quotes_language english
87 \quotes_times 2
88 \papercolumns 1
89 \papersides 1
90 \paperpagestyle default
91
92 \layout Standard
93
94
95 \latex latex 
96
97 \backslash 
98 sloppy
99 \layout Standard
100
101
102 \latex latex 
103
104 \backslash 
105 cleardoublepage
106 \newline 
107
108 \latex default 
109
110 \begin_inset LatexCommand \tableofcontents{}
111
112 \end_inset 
113
114
115 \layout Chapter
116
117 Convention
118 \layout Itemize
119
120 All numbering begin at one (take care of array index !) ; 
121 \layout Itemize
122
123 When you get a C type array with a 
124 \family typewriter 
125 get...
126
127 \family default 
128  method, you must not replace some value of it.
129  Access is in read only.
130  Other use may product an impredicable result.
131  To modify a such array use method 
132 \family typewriter 
133 set...
134 \family default 
135 .
136  
137 \layout Itemize
138
139 Difference between local and global number\SpecialChar ~
140 : when we talk about an element
141  number, we could see 
142 \begin_inset Formula \( i^{th} \)
143 \end_inset 
144
145  quadrangle (
146 \begin_inset Formula \( i^{th} \)
147 \end_inset 
148
149  in quadrangles array\SpecialChar ~
150 : local numbering) or 
151 \begin_inset Formula \( j^{th} \)
152 \end_inset 
153
154  element (
155 \begin_inset Formula \( j^{th} \)
156 \end_inset 
157
158  in all elements array\SpecialChar ~
159 : global numbering).
160  This two numbering are equivalent only if we have one geometric type.
161 \layout Chapter
162
163 How to use MESH object
164 \layout Section
165
166 General Information
167 \layout Standard
168
169 We could get some general information about a MESH object such as\SpecialChar ~
170
171 \layout Itemize
172
173 name (
174 \latex latex 
175
176 \backslash 
177 method{getName}
178 \latex default 
179
180 \layout Itemize
181
182 a description (
183 \latex latex 
184
185 \backslash 
186 method{getDescription}
187 \latex default 
188
189 \layout Itemize
190
191 the space dimension (
192 \latex latex 
193
194 \backslash 
195 method{getSpaceDimension}
196 \latex default 
197
198 \layout Itemize
199
200 the mesh dimension (
201 \latex latex 
202
203 \backslash 
204 method{getMeshDimension}
205 \latex default 
206
207 \layout Standard
208
209
210 \latex latex 
211
212 \backslash 
213 fileCxx{MESHgeneral.cxx}
214
215 \backslash 
216 filePython{MESHgeneral.py}
217 \layout Section
218
219 Information about nodes
220 \layout Enumerate
221
222 I want to get the number of nodes\SpecialChar ~
223 : Realy simple, use 
224 \latex latex 
225
226 \backslash 
227 method{getNumberOfNodes}
228 \latex default 
229 .
230  
231 \layout Enumerate
232
233 I want to get the coordinates components names\SpecialChar ~
234 : use 
235 \latex latex 
236
237 \backslash 
238 method{getCoordinatesNames}
239 \latex default 
240  which return a string array (one string for each space dimension) 
241 \layout Enumerate
242
243 I want to get the coordinates components units\SpecialChar ~
244 : use 
245 \latex latex 
246
247 \backslash 
248 method{getCoordinatesUnits}
249 \latex default 
250  which return a string array (one string for each space dimension) 
251 \layout Enumerate
252
253 I want to get the coordinates system\SpecialChar ~
254 : use 
255 \latex latex 
256
257 \backslash 
258 method{getCoordinatesSystem}
259 \latex default 
260  which return a string (
261 \latex latex 
262
263 \backslash 
264 verb+CARTESIAN+
265 \latex default 
266
267 \latex latex 
268
269 \backslash 
270 verb+CYLINDRICAL+
271 \latex default 
272  or 
273 \latex latex 
274
275 \backslash 
276 verb+SPHERICAL+
277 \latex default 
278 ).
279  
280 \layout Enumerate
281
282 I want to get the nodes coordinates\SpecialChar ~
283 : use 
284 \latex latex 
285
286 \backslash 
287 method{getCoordinates}
288 \latex default 
289  which return a pointer to the coordinates array where values are interlace
290  or no.
291  
292 \series bold 
293 Warning\SpecialChar ~
294 :
295 \begin_deeper 
296 \layout Itemize
297
298 When we get coordinates in 
299 \latex latex 
300
301 \backslash 
302 verb+MED_NO_INTERLACE+
303 \latex default 
304  mode, we get an array where values are ordered like (
305 \latex latex 
306
307 \backslash 
308 verb+X1,X2,X..., Y1,Y..., Z1,Z...+
309 \latex default 
310 ).
311  
312 \layout Itemize
313
314 When we get coordinates in 
315 \latex latex 
316
317 \backslash 
318 verb+MED_FULL_INTERLACE+
319 \latex default 
320  mode, we get an array where values are ordered like (
321 \latex latex 
322
323 \backslash 
324 verb+X1,Y1,Z1, X2,Y2,Z2, ...+
325 \latex default 
326 ).
327  
328 \end_deeper 
329 \layout Enumerate
330
331 I want to get one particular value of coordinate\SpecialChar ~
332 : use 
333 \latex latex 
334
335 \backslash 
336 method{getCoordinate}
337 \latex default 
338  which return the value of 
339 \begin_inset Formula \( i^{th} \)
340 \end_inset 
341
342  node and 
343 \begin_inset Formula \( j^{th} \)
344 \end_inset 
345
346  axis.
347 \layout Standard
348
349
350 \latex latex 
351
352 \backslash 
353 fileCxx{MESHcoordinates.cxx}
354
355 \backslash 
356 filePython{MESHcoordinates.py}
357 \layout Section
358
359 Information about cells
360 \layout Enumerate
361
362 I want to get the number of geometric type for a mesh entity\SpecialChar ~
363 : use 
364 \latex latex 
365
366 \backslash 
367 method{getNumberOfTypes}
368 \begin_deeper 
369 \layout Standard
370
371
372 \series bold 
373 C++ Example\SpecialChar ~
374 :
375 \layout Standard
376
377
378 \latex latex 
379
380 \backslash 
381 verb+int NumberOfCellsTypes = myMesh.getNumberOfTypes(MED_CELL);+
382 \end_deeper 
383 \layout Enumerate
384
385 I want to get all geometric type for a mesh entity\SpecialChar ~
386 : use 
387 \latex latex 
388
389 \backslash 
390 method{getTypes}
391 \latex default 
392  to get an array of 
393 \latex latex 
394
395 \backslash 
396 verb+medGeometryElement+
397 \latex default 
398  (to use directly in others methods) or 
399 \latex latex 
400
401 \backslash 
402 method{getCellsTypes}
403 \latex default 
404  to get an array of 
405 \latex latex 
406
407 \backslash 
408 verb+CELLMODEL+
409 \latex default 
410  (to ask mode information\SpecialChar ~
411 : see CellModel) .
412 \begin_deeper 
413 \layout Standard
414
415
416 \series bold 
417 C++ Example\SpecialChar ~
418 :
419 \layout Standard
420
421
422 \latex latex 
423
424 \backslash 
425 verb+medGeometryElement * Types = myMesh.getTypes(MED_CELL);+
426 \layout Standard
427
428
429 \latex latex 
430
431 \backslash 
432 verb+CELLMODEL * CellsTypes = myMesh.getCellsTypes(MED_CELL);+
433 \layout Standard
434
435 (each arrays are size 
436 \latex latex 
437
438 \backslash 
439 verb+NumberOfCellsTypes+
440 \latex default 
441 )
442 \end_deeper 
443 \layout Enumerate
444
445 I want to get the number of cells\SpecialChar ~
446 : use 
447 \latex latex 
448
449 \backslash 
450 method{getNumberOfElements}
451 \latex default 
452  which return this information.
453  You must give the mesh entity (
454 \latex latex 
455
456 \backslash 
457 verb+MED_CELL+
458 \latex default 
459
460 \latex latex 
461
462 \backslash 
463 verb+MED_FACE+
464 \latex default 
465
466 \latex latex 
467
468 \backslash 
469 verb+MED_EDGE+
470 \latex default 
471  or 
472 \latex latex 
473
474 \backslash 
475 verb+MED_NODE+
476 \latex default 
477 ) and a geometric type of this entity.
478 \begin_deeper 
479 \layout Standard
480
481
482 \series bold 
483 C++ Example\SpecialChar ~
484 :
485 \layout Standard
486
487
488 \latex latex 
489
490 \backslash 
491 verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MED_TRIA3);+
492 \layout Standard
493
494
495 \latex latex 
496
497 \backslash 
498 verb+int NumberOfFace = myMesh.getNumberOfElements(MED_FACE,MED_ALL_ELEMENT);+
499 \end_deeper 
500 \layout Enumerate
501
502 I want to get the geometric type of one element\SpecialChar ~
503 : use 
504 \latex latex 
505
506 \backslash 
507 method{getElementType}
508 \latex default 
509  which return a 
510 \latex latex 
511
512 \backslash 
513 verb+medGeometryElement+
514 \latex default 
515 .
516 \begin_deeper 
517 \layout Standard
518
519
520 \series bold 
521 C++ Example\SpecialChar ~
522 :
523 \layout Standard
524
525
526 \latex latex 
527
528 \backslash 
529 verb+medGeometryElement myType = myMesh.getElementType(MED_FACE,10);+
530 \layout Standard
531
532 Return the 
533 \latex latex 
534
535 \backslash 
536 verb+medGeometryElement+
537 \latex default 
538  of 
539 \begin_inset Formula \( 10^{th} \)
540 \end_inset 
541
542  face.
543 \end_deeper 
544 \layout Enumerate
545
546 I want to get a connectivity\SpecialChar ~
547 : use 
548 \latex latex 
549
550 \backslash 
551 method{getConnectivity}
552 \latex default 
553  which return an array with connectivity values.
554 \begin_deeper 
555 \layout Standard
556
557
558 \begin_inset LatexCommand \label{getConnectivity}
559
560 \end_inset 
561
562
563 \layout Standard
564
565
566 \series bold 
567 C++ Example\SpecialChar ~
568 :
569 \layout Standard
570
571
572 \latex latex 
573
574 \backslash 
575 begin{verbatim}
576 \newline 
577 int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MED_TETRA4);
578 \newline 
579 int * TetrahedronConnectivity =
580 \newline 
581          myMesh.getConnectivity(MED_FULL_ENTERLACE,
582 \newline 
583                                 MED_NODAL,
584 \newline 
585                                 MED_CELL,
586 \newline 
587                                 MED_TETRA4);
588 \newline 
589
590 \backslash 
591 end{verbatim} 
592 \backslash 
593 verb+TetrahedronConnectivity+
594 \latex default 
595  contain nodal connectivity of tetrahedron in mesh.
596  It is arranged in full enterlace mode and its size is 
597 \latex latex 
598
599 \backslash 
600 verb+NumberOfTetrahedron x 4+
601 \latex default 
602 .
603 \layout Standard
604
605 If you want to get connectivity of all elements (with 
606 \latex latex 
607
608 \backslash 
609 verb+Type=MED_ALL_ELEMENTS+
610 \latex default 
611 ), you must use the index array (return by 
612 \latex latex 
613
614 \backslash 
615 method{getConnectivityIndex}
616 \latex default 
617 ) to get connectivity for each elements (see example 
618 \latex latex 
619
620 \backslash 
621 myref{MESHconnectivities.cxx}
622 \latex default 
623 ).
624 \end_deeper 
625 \layout Enumerate
626
627 I want to get an element number from a connectivity\SpecialChar ~
628 : use 
629 \latex latex 
630
631 \backslash 
632 method{getElementNumber}
633 \latex default 
634  which return the global number of a given connectivity.
635 \begin_deeper 
636 \layout Standard
637
638
639 \series bold 
640 C++ Example\SpecialChar ~
641 :
642 \layout Standard
643
644
645 \latex latex 
646
647 \backslash 
648 verb+int * myElementConnectivity = {2,10,12,14};+
649 \layout Standard
650
651
652 \latex latex 
653
654 \backslash 
655 verb+int myNumber = myMesh.getElementNumber(MED_NODAL,MED_CELL,myElementConnectiv
656 ity);+
657 \end_deeper 
658 \layout Standard
659
660
661 \latex latex 
662
663 \backslash 
664 fileCxx{MESHconnectivities.cxx}
665
666 \backslash 
667 filePyhton{MESHconnectivities.py}
668 \layout Chapter
669
670 How to use SUPPORT object
671 \layout Section
672
673 Create a SUPPORT object
674 \layout Standard
675
676
677 \begin_inset LatexCommand \label{CreateSupport}
678
679 \end_inset 
680
681
682 \layout Standard
683
684 To create a SUPPORT object, you must give : 
685 \layout Itemize
686
687 a reference to a MESH object 
688 \layout Itemize
689
690 its name 
691 \layout Itemize
692
693 on which mesh entity it apply to 
694 \layout Standard
695
696
697 \series bold 
698 C++ example\SpecialChar ~
699 :
700 \layout Standard
701
702
703 \latex latex 
704
705 \backslash 
706 verb+SUPPORT mySupport(myMesh,''support sur toute les faces'',MED_FACE)
707  ;+
708 \latex default 
709  By default, this support is defined on all element of the given entity.
710 \layout Standard
711
712 If you want a restricted SUPPORT, you must add manualy information about
713  what do you want\SpecialChar ~
714
715 \layout Itemize
716
717 is not on all elements\SpecialChar ~
718
719 \latex latex 
720
721 \backslash 
722 verb+mySupport.setAll(false);+
723 \layout Itemize
724
725 on how many geometric type\SpecialChar ~
726 :
727 \newline 
728
729 \latex latex 
730  
731 \backslash 
732 verb+mySupport.setNumberOfGeometricType(myNumberOfGeometricType);+
733 \layout Itemize
734
735 on which geometric type\SpecialChar ~
736 :
737 \newline 
738
739 \latex latex 
740  
741 \backslash 
742 verb+mySupport.setGeometricType(myGeometricType);+
743 \layout Itemize
744
745 Temporary : the Gauss point number for each geometric type\SpecialChar ~
746 :
747 \newline 
748
749 \latex latex 
750  
751 \backslash 
752 verb+mySupport.setNumberOfGaussPoint(myNumberOfGaussPoint);+
753 \layout Itemize
754
755 the number of elements for each geometric type\SpecialChar ~
756 :
757 \newline 
758
759 \latex latex 
760  
761 \backslash 
762 verb+mySupport.setNumberOfEntities(myNumberOfEntities);+
763 \layout Itemize
764
765 the total number of elements\SpecialChar ~
766 :
767 \newline 
768
769 \latex latex 
770  
771 \backslash 
772 verb+mySupport.setTotalNumberOfEntities(myTotalNumberOfEntities);+
773 \layout Itemize
774
775 the array which contains elements for each geometric type\SpecialChar ~
776 :
777 \newline 
778
779 \latex latex 
780  
781 \backslash 
782 verb+mySupport.setNumber(myNumber);+
783 \layout Standard
784
785 You could also use 
786 \latex latex 
787
788 \backslash 
789 method{setpartial}
790 \latex default 
791  which set all you need.
792 \layout Section
793
794 Use a SUPPORT object
795 \layout Standard
796
797 You could get all basic information (as you set them in 
798 \latex latex 
799
800 \backslash 
801 myref{CreateSupport}
802 \latex default 
803 )\SpecialChar ~
804
805 \layout Itemize
806
807
808 \latex latex 
809
810 \backslash 
811 verb+getName()+
812 \layout Itemize
813
814
815 \latex latex 
816
817 \backslash 
818 verb+getDescription()+
819 \layout Itemize
820
821
822 \latex latex 
823
824 \backslash 
825 verb+getMesh()+
826 \layout Itemize
827
828
829 \latex latex 
830
831 \backslash 
832 verb+getEntity()+
833 \layout Itemize
834
835
836 \latex latex 
837
838 \backslash 
839 verb+isOnAllElements()+
840 \layout Itemize
841
842
843 \latex latex 
844
845 \backslash 
846 verb+getNumberOfTypes()+
847 \layout Itemize
848
849
850 \latex latex 
851
852 \backslash 
853 verb+getTypes()+
854 \layout Itemize
855
856
857 \latex latex 
858
859 \backslash 
860 verb+getNumberOfGaussPoint()+
861 \layout Itemize
862
863
864 \latex latex 
865
866 \backslash 
867 verb+getNumberOfGaussPoint(myGeometricType)+
868 \layout Itemize
869
870
871 \latex latex 
872
873 \backslash 
874 verb+getGeometricTypeNumber()+
875 \layout Itemize
876
877
878 \latex latex 
879
880 \backslash 
881 verb+getNumberOfElements(myGeometricType)+
882 \layout Itemize
883
884
885 \latex latex 
886
887 \backslash 
888 verb+getNumber(myGeometricType)+
889 \layout Itemize
890
891
892 \latex latex 
893
894 \backslash 
895 verb+getNumberIndex()+
896 \layout Standard
897
898 For details about this methods, see the reference manual 
899 \begin_inset LatexCommand \ref{RefManual}
900
901 \end_inset 
902
903 .
904 \layout Standard
905
906 The use of 
907 \latex latex 
908
909 \backslash 
910 method{getNumber}
911 \latex default 
912  and 
913 \latex latex 
914
915 \backslash 
916 method{getNumberIndex}
917 \latex default 
918  are the same as 
919 \latex latex 
920
921 \backslash 
922 method{getConnectivity}
923 \latex default 
924  and 
925 \latex latex 
926
927 \backslash 
928 method{getConnectivityIndex}
929 \latex default 
930  (see item 
931 \latex latex 
932
933 \backslash 
934 myref{getConnectivity}
935 \layout Standard
936
937 There is another particular method to blend another SUPPORT object into
938  it.
939 \layout Standard
940
941 For exemple in C++ : 
942 \latex latex 
943
944 \backslash 
945 begin{verbatim}
946 \newline 
947 SUPPORT mySupport ;
948 \newline 
949 SUPPORT myOtherSupport ;
950 \newline 
951 ...
952 \newline 
953 mySupport.blending(myOtherSupport) ;
954 \newline 
955
956 \backslash 
957 end{verbatim}
958 \layout Standard
959
960
961 \latex latex 
962
963 \backslash 
964 verb+mySupport+
965 \latex default 
966  contain now all elements defined originally in it, more those defined in
967  
968 \latex latex 
969
970 \backslash 
971 verb+myOtherSupport+
972 \latex default 
973 .
974 \layout Section
975
976 Case of FAMILY object
977 \layout Section
978
979 Case of GROUP object
980 \layout Chapter
981
982 How to use Field
983 \layout Standard
984
985
986 \latex latex 
987
988 \backslash 
989 newpage
990 \newline 
991 %
992 \backslash 
993 thebibliography{biblio}
994 \layout Standard
995 \bibitem {RefManual}
996
997 Reference Manual\SpecialChar ~
998
999 \latex latex 
1000 http://www-drn2.cea.fr/MED/MEDMEM/DOC/html/index.html
1001 \layout Chapter
1002
1003 Using drivers
1004 \layout Standard
1005
1006 The generic driver mecanism gives users the possibility to write/read the
1007  content of an object according to a specified file format.
1008  The semantic remains the same whatever the object is (MESH, FIELD, MED).
1009  By the way it allows using several file formats for writting an object.
1010 \layout Section
1011
1012 Invoking a driver
1013 \layout Subsection
1014
1015 Invoking a driver at creation object time
1016 \layout Standard
1017
1018 This is the simplest way of invoking a driver.
1019  The driver parameters are given to the constructor of the object.
1020   Except for the MED object, this way of invoking a driver assume you know
1021  exactly the name of the MESH/FIELD you want read from a file <fileName>
1022  of type <driverType>.
1023 \layout Standard
1024
1025 ex 1.1 : For a FIELD object, invoking FIELD<double> myField(MED_DRIVER,fileName,f
1026 ieldName) create a FIELD object and a driver which loads the mesh <fieldName>
1027  from the MED file <fileName> (Not implemented yet !).
1028 \layout Standard
1029
1030 ex 1.2 : To remove the default driver previously created myField->rmDriver();
1031 \layout Standard
1032
1033 ex 2 : For a MESH object, invoking MESH myMesh(MED_DRIVER,fileName,meshName)
1034  create a MESH object and a driver which loads the mesh <meshName> from
1035  the MED file <fileName>.
1036 \layout Standard
1037
1038 ex 3 : For a MED object, invoking MED myMed(MED_DRIVER,fileName) create
1039  a MED object to explore the MED file <fileName>.
1040 \layout Standard
1041
1042 rem 1 : ex1 is equivalent to 
1043 \begin_inset LatexCommand \ref{sec:invoking_a_driver_from_the_std_drv_method}
1044
1045 \end_inset 
1046
1047  ex1.
1048 \layout Standard
1049
1050 rem 2 : Since the driver has read the object, the associated file is closed.
1051  You can reread the object with the default driver by calling the read()
1052  method : myObject.read().
1053 \layout Standard
1054
1055
1056 \latex latex 
1057
1058 \backslash 
1059 fileCxx{MEDMEM_InvokingDriverAtObjectCreationTime.cxx}
1060 \layout Subsection
1061
1062 Invoking a driver from the standard driver method of an object
1063 \begin_inset LatexCommand \label{sec:invoking_a_driver_from_the_std_drv_method}
1064
1065 \end_inset 
1066
1067
1068 \layout Standard
1069
1070 This way of invoking a driver give the possiblility to add several drivers
1071  to an exiting object.
1072 \layout Standard
1073
1074 ex1 : First we create a FIELD without any driver FIELD<double>\SpecialChar ~
1075 *\SpecialChar ~
1076 myField1\SpecialChar ~
1077 =\SpecialChar ~
1078 new\SpecialChar ~
1079 FIELD
1080 <double>; then we add a driver with int myDriver1 = myField1->addDriver(driverTy
1081 pe1, fileName1, fieldName1); for reading <fieldName1> from file <fileName1>
1082  with myField1->read(myDriver1);
1083 \layout Standard
1084
1085 ex2 : We add a new driver of type <driverType2> int myDriver2 = myField1->addDri
1086 ver(driverType2, fileName2,fieldName2); in order to write myField1 in file
1087  <fileName2> with <fieldName2> name using command myField1->write(myDriver2);
1088 \layout Standard
1089
1090 rem 1 : Files are openned then closed each time you call read() or write()
1091  methods.
1092 \layout Standard
1093
1094 rem 2 : If you use more than a driver you need to keep the driver handlers
1095  (myDriverI ).
1096 \layout Standard
1097
1098
1099 \latex latex 
1100
1101 \backslash 
1102 fileCxx{MEDMEM_InvokingDriverFromStandardObjectMethod.cxx}
1103 \layout Subsection
1104
1105 Invoking a driver and attaching it to an existing object
1106 \layout Standard
1107
1108 The methods exposed in the two previous sections always create drivers in
1109  read/write access mode.
1110  Another way of creating a driver is to create a driver with a specific
1111  access mode.
1112 \layout Standard
1113
1114 ex1 : First we create a FIELD without any driver FIELD<double>\SpecialChar ~
1115 *\SpecialChar ~
1116 myField1\SpecialChar ~
1117 =\SpecialChar ~
1118 new
1119  FIELD<double>(); then we create a read-only driver MED_FIELD_RDONLY_DRIVER<doub
1120 le>\SpecialChar ~
1121 myRdOnlyDriver(fileName1,myField1); and attached it to myField1.
1122  Finally you must set the fieldName1 you want to acess in fileName1 with
1123  myRdOnlyDriver->setFieldName(fieldName1); in order to read the field with
1124  myRdOnlyDriver->open(); myRdOnlyDriver->read();
1125 \layout Standard
1126
1127 Don't forget to close the file with myRdOnlyDriver->close().
1128 \layout Standard
1129
1130 ToDo : By now when you create such specific drivers, the object doesn't
1131  know anything about it.
1132  
1133 \layout Standard
1134
1135
1136 \latex latex 
1137
1138 \backslash 
1139 fileCxx{MEDMEM_InvokingDriverByAttachingItToAnObject.cxx}
1140 \layout Section
1141
1142 Using the MED driver
1143 \layout Standard
1144
1145 The MED object provides the ability of :
1146 \layout Enumerate
1147 \noindent 
1148 Obtainning a reference on the whole structure contained in a file.
1149 \layout Enumerate
1150
1151 Obtainning the list of all the Meshes/Fields names contained in a file.
1152 \layout Enumerate
1153
1154 Obtainning a Mesh/Field reference using a name.
1155 \layout Enumerate
1156
1157 Writting a whole set of independent objects with a simple command.
1158  
1159 \layout Subsection
1160
1161 Exploring files
1162 \layout Standard
1163
1164 In this first use case the user wants to explore the meshes & fields containned
1165  within a file <filename> of type given by the <drivertype> parameter.
1166 \layout Standard
1167
1168 ex 1 : Calling MED * myMed = new MED(driverType1, fileName1); create a MED
1169  object which open fileName1, read all MESHes/FIELDs relations then close
1170  the file.
1171  
1172 \layout Standard
1173
1174 This is equivalent to MED\SpecialChar ~
1175 *\SpecialChar ~
1176 myMed\SpecialChar ~
1177 =\SpecialChar ~
1178 new\SpecialChar ~
1179 MED(); myDriver\SpecialChar ~
1180 =\SpecialChar ~
1181 myMed->addDriver(driverType1,
1182 fileName1); myMed->readFileStruct(myDriver); 
1183 \layout Standard
1184
1185 ex 2 : To get the list of meshNames from a MED object, first ask the object
1186  how many meshes it had by calling int numberOfMeshes\SpecialChar ~
1187 =\SpecialChar ~
1188 myMed->getNumberOfMeshes()
1189 ; then get the list with myMeshNames\SpecialChar ~
1190 =\SpecialChar ~
1191 new string[getMeshNames]; myMed->getMeshNam
1192 es(myMeshNames).
1193  
1194 \layout Standard
1195
1196 Note you can also use the deque<string> getMeshNames() method.
1197  
1198 \layout Standard
1199
1200 ex 3 : To get a list of fieldNames from a MED object, first ask the object
1201  how many fields it had by calling int numberOfFields\SpecialChar ~
1202 =\SpecialChar ~
1203 myMed->getNumberOfFields()
1204 ; then get the list with myFieldNames\SpecialChar ~
1205 =\SpecialChar ~
1206 new string[getFieldNames]; myMed->getField
1207 Names(myFieldNames).
1208 \layout Standard
1209
1210 ex 4 :To get a particular MESH use MESH * myMesh1 = myMED->getMesh(myMeshNames[0
1211 ]) 
1212 \layout Standard
1213
1214 ex 5 :To get a particular FIELD you first need to know what (time step,
1215  iteration number) list is used by calling deque<DT_IT_>\SpecialChar ~
1216 myField1DtIt\SpecialChar ~
1217 =\SpecialChar ~
1218 myMed->getF
1219 ieldIteration(FieldName[0]) ; then you can ask for getting a specific FIELD
1220  with FIELD\SpecialChar ~
1221 *\SpecialChar ~
1222 myField1\SpecialChar ~
1223 =\SpecialChar ~
1224 myMED->getField(myFieldNames[0],myField1DtIt[0].dt,myField1D
1225 tIt[0].it).
1226 \layout Standard
1227
1228 ex2 : To write the whole content of a MED object first add a driver myDriver2\SpecialChar ~
1229 =\SpecialChar ~
1230 my
1231 Med.addDriver(driverType2,\SpecialChar ~
1232 fileName2); then ask for writing the object myMed->writ
1233 e(myDriver2); (not implemented yet !) 
1234 \layout Standard
1235
1236 You can remove the driver with myMed->rmDriver(myDriver2);
1237 \layout Standard
1238
1239 rem 1 : It is possible to use multiple drivers to read a set of FIELDs /
1240  MESHes from various file formats and writing the whole set through a specific
1241  write.(not implemented yet !) 
1242 \layout Subsubsection
1243
1244 Adding existing MESHes/FIELDs objects
1245 \layout Standard
1246
1247 Not yet implemented.
1248 \the_end