Salome HOME
7th step - Update doc.
[tools/medcoupling.git] / doc / user / doxygen / doxfiles / faq.dox
1 /*!
2
3 \page faq FAQ - Frequently asked questions
4
5 Many points covered in this FAQ are illustrated via Python scripts. Remember that the
6 Python API is almost 100% identical to the C++ one, with the \ref python-api "rules listed here".
7
8 \section Questions
9
10 \ref faq-general
11     -# \ref f-newbie
12     -# \ref f-mehsf
13     -# \ref f-constel
14     -# \ref f-visu
15     -# \ref f-p0p1
16     -# \ref f-number
17     
18 \ref faq-python
19     -# \ref f-hellow
20     -# \ref f-pyimport
21     -# \ref f-meshscratch
22     -# \ref f-fieldscratch
23     -# \ref f-io
24     -# \ref f-coher
25     -# \ref f-groups
26     -# \ref f-unstruc
27
28 \ref faq-interp
29     -# \ref f-proj
30     -# \ref f-proj-formula
31
32 \ref faq-cpp
33     -# \ref f-cpp-guide
34     -# \ref f-cpp-segfault
35
36 \section Answers
37 \subsection faq-general General questions
38 \subsubsection f-newbie "I am a complete newbie, where should I start?"
39 Take a look at the \ref start "getting started" section and the \ref tutorial.
40
41 \subsubsection f-mehsf "What is a mesh, what is a field?"
42 Take a look at \ref terminology
43
44 \subsubsection f-constel "What is a the difference between MED file, MEDCoupling and the SALOME MED module?"
45 Take a look at \ref library
46
47 \subsubsection f-visu "How can I visualize a mesh and/or a field?"
48 Use the PARAVIS module of SALOME to visualize your MED file. The following dedicated fitlers have been 
49 written specifically for MED files: Extract group, Extract cell types, ELNO Mesh, ELNO Points, ELNO Surface.
50
51 \subsubsection f-p0p1 "What does a P0- (or P1-) field mean?"
52 Take a look at \ref terminology
53
54 \subsubsection f-number "What does surjective/old-2-new/new-2-old format mean?"
55 Take a look at \ref numbering
56
57 \subsection faq-python MEDCoupling scripts in Python 
58 \subsubsection f-hellow "Can you show me a simple example to get me started"
59 TODO
60
61
62 \subsubsection f-pyimport "When trying to execute my Python script I have 'ImportError: No module named MEDCoupling'"
63 Check that the environment variables PYTHONPATH and LD_LIBRARY_PATH (PATH under Windows) are correctly set. 
64 If you have a full SALOME installation, use the 'shell' command that will automatically set up everything as it
65 should be:
66 \code{.sh}
67 cd <salome_install>
68 salome shell
69 \endcode
70
71 With a custom installation you may want to set the variable manually:
72 \code{.sh}
73 export PYTHONPATH=<install_root>/lib/python2.7/site-packages/salome
74 export LD_LIBRARY_PATH=<install_root>/lib/salome
75 \endcode
76
77 \subsubsection f-meshscratch "How to build a mesh from scratch"
78 Take a look at this example: \ref medcouplingpyexamplesUmeshStdBuild1
79
80 \subsubsection f-fieldscratch "How to build a field from scratch"
81 Take a look at this example: \ref medcouplingpyexamplesFieldDoubleBuild1
82
83 \subsubsection f-io "How to write/read a mesh to/from a file"
84 For starter, take a look at the \ref MEDLoaderBasicAPIPage "basic MEDLoader API".
85
86 \subsubsection f-coher "How to control the validity of my mesh"
87 Use the methods \ref MEDCoupling::MEDCouplingUMesh::checkCoherency() "MEDCouplingUMesh::checkCoherency()" or
88 \ref MEDCoupling::MEDCouplingUMesh::checkCoherency1() "MEDCouplingUMesh::checkCoherency1()" 
89
90 \subsubsection f-groups "How can I read/write groups on a mesh"
91 Take a look at \ref AdvMEDLoaderAPIMeshReading and \ref AdvMEDLoaderAPIMeshWriting.
92
93 \subsubsection f-unstruc "How can I transform a structured mesh into an unstructured one"
94 Use the method \ref  MEDCoupling::MEDCouplingCMesh::buildUnstructured() "MEDCouplingCMesh::buildUnstructured()"
95
96 \subsection faq-interp Projection, interpolation, remapping
97 \subsubsection f-proj How to project a field from one mesh to the other
98 This the job of the interpolation algorithms in the MED library. For starters, take a look at the 
99 \ref interpolation "general introduction on interpolation". Also 
100 \ref cpp_mcfield_remapper_highlevel "this simple example" gives a good first illustration.
101 Finally, if you are intereseted in parallel projection (C++ only!), you should take a 
102 look at the \ref para-dec "DEC".  
103
104 \subsubsection f-proj-formula Which formula are used in the field projection algorithms
105 The documentation for non \ref glossary "P0 field" (i.e. non \ref glossary "cell-based fields") is still an
106 on-going work, but for the P0->P0 case, \ref InterpKerRemapGlobal "this page" gives a good overview.
107
108 \subsection faq-cpp C++ specific questions
109 \subsubsection f-cpp-guide Is there some coding guidelines that I should follow
110 Yes. Please:
111 - document your code (this is true for Python too!)
112 - write some tests (this is true for Python too!)
113 - and finally, take a look at the page \ref cpp
114
115 \subsubsection f-cpp-segfault My C++ program produces a SIGSEGV, what should I do
116 Re-compile in debug mode (with \c CMAKE_BUILD_TYPE=Debug), and use either valgrind or gdb
117 to spot the place where the segfault happens.
118 The most common source of mistake is some memory mis-allocation and/or deallocation.
119 With this respect using the auto pointer class 
120 \ref MEDCoupling::MEDCouplingAutoRefCountObjectPtr "MEDCouplingAutoRefCountObjectPtr"
121 can be of great help.  
122  
123 \n
124 \n
125 \n
126 \n
127 \n
128 \n
129 \n
130 \n
131 \n
132 \n
133 \n
134 \n
135 \n
136 \n
137 \n
138 \n
139 \n
140 \n
141 \n
142 \n
143 \n
144 \n
145 \n
146 \n
147 \n
148 \n
149 \n
150 \n
151 \n
152 \n
153 \n
154 \n
155 \n
156
157 \n
158 \n
159 \n
160 \n
161 \n
162 \n
163 \n
164 \n
165 \n
166 \n
167 \n
168 \n
169 \n
170 \n
171 \n
172
173
174 */