3 \page faq FAQ - Frequently asked questions
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".
22 -# \ref f-fieldscratch
30 -# \ref f-proj-formula
34 -# \ref f-cpp-segfault
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.
41 \subsubsection f-mehsf "What is a mesh, what is a field?"
42 Take a look at \ref terminology
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
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.
51 \subsubsection f-p0p1 "What does a P0- (or P1-) field mean?"
52 Take a look at \ref terminology
54 \subsubsection f-number "What does surjective/old-2-new/new-2-old format mean?"
55 Take a look at \ref numbering
57 \subsection faq-python MEDCoupling scripts in Python
58 \subsubsection f-hellow "Can you show me a simple example to get me started"
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
71 With a custom installation you may want to set the variable manually:
73 export PYTHONPATH=<install_root>/lib/python2.7/site-packages/salome
74 export LD_LIBRARY_PATH=<install_root>/lib/salome
77 \subsubsection f-meshscratch "How to build a mesh from scratch"
78 Take a look at this example: \ref medcouplingpyexamplesUmeshStdBuild1
80 \subsubsection f-fieldscratch "How to build a field from scratch"
81 Take a look at this example: \ref medcouplingpyexamplesFieldDoubleBuild1
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".
86 \subsubsection f-coher "How to control the validity of my mesh"
87 Use the methods \ref ParaMEDMEM::MEDCouplingUMesh::checkCoherency() "MEDCouplingUMesh::checkCoherency()" or
88 \ref ParaMEDMEM::MEDCouplingUMesh::checkCoherency1() "MEDCouplingUMesh::checkCoherency1()"
90 \subsubsection f-groups "How can I read/write groups on a mesh"
91 Take a look at \ref AdvMEDLoaderAPIMeshReading and \ref AdvMEDLoaderAPIMeshWriting.
93 \subsubsection f-unstruc "How can I transform a structured mesh into an unstructured one"
94 Use the method \ref ParaMEDMEM::MEDCouplingCMesh::buildUnstructured() "MEDCouplingCMesh::buildUnstructured()"
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".
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.
108 \subsection faq-cpp C++ specific questions
109 \subsubsection f-cpp-guide Is there some coding guidelines that I should follow
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
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 ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr "MEDCouplingAutoRefCountObjectPtr"
121 can be of great help.