]> SALOME platform Git repositories - modules/med.git/blob - src/INTERPOLATION/UseCaseMapping.cxx
Salome HOME
updating the main trunk with the CEA debug devellopment from the branch
[modules/med.git] / src / INTERPOLATION / UseCaseMapping.cxx
1 #include "stdio.h"
2 #include "stdlib.h"
3
4 #include <iostream.h>
5
6 #include "MEDMEM_InterpolationHighLevelObjects.hxx"
7
8 #ifdef _DEBUG_
9 #include "LocalTraceCollector.hxx"
10 #endif /* ifdef _DEBUG_*/
11
12 using namespace MEDMEM;
13 using namespace MED_EN;
14
15 int main (void) 
16 {
17 #ifdef _DEBUG_
18   LocalTraceCollector::instance();
19 #endif /* ifdef _DEBUG_*/
20
21 int i;
22
23 const int DIMENSION = 3;
24
25 const int isConvexFromMesh = 1;
26
27 const char * fromFileName  = "fromMesh.med";
28 const char * fromMeshName  = "fromMesh";
29
30 MESH * fromMesh = new MESH(MED_DRIVER,fromFileName,fromMeshName);
31
32 const char * toFileName    = "toMesh.med";
33 const char * toMeshName    = "toMesh";
34
35 MESH * toMesh   = new MESH(MED_DRIVER,toFileName,toMeshName);
36
37 Meta_Wrapper<DIMENSION> * fromWrapper = new Meta_Wrapper<DIMENSION>
38                                         (
39                                         fromMesh->getNumberOfNodes(),
40                                         const_cast<double *> (fromMesh->getCoordinates(MED_FULL_INTERLACE)),
41                                         const_cast<CONNECTIVITY *> (fromMesh->getConnectivityptr())
42                                         );
43
44 Meta_Wrapper<DIMENSION> * toWrapper   = new Meta_Wrapper<DIMENSION>
45                                         (
46                                         toMesh->getNumberOfNodes(),
47                                         const_cast<double *> (toMesh->getCoordinates(MED_FULL_INTERLACE))
48                                         );
49
50 Meta_Mapping<DIMENSION> * mapping     = new  Meta_Mapping<DIMENSION> (fromWrapper,toWrapper);
51
52 mapping->Cree_Mapping(isConvexFromMesh);
53                                                 
54 vector<int> vectormapping = mapping->Get_Mapping();
55
56 for (i=0;i<vectormapping.size();i++)
57         {
58         cout<<"Le noeud "<<i<<" de "<<toMeshName<<" est contenu dans la maille "<<vectormapping[i]<<" de "<<fromMeshName<<endl; 
59         }
60
61 }