Salome HOME
c286f03e7c328e2a37f95da9cf71e81402a1b59d
[modules/med.git] / src / MEDCouplingCorba / Test / MEDCouplingMeshFieldFactoryComponent.cxx
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 #include "MEDCouplingMeshFieldFactoryComponent.hxx"
22 #include "MEDCouplingMappedExtrudedMesh.hxx"
23 #include "MEDCouplingFieldDouble.hxx"
24 #include "MEDCouplingFieldTemplate.hxx"
25 #include "MEDCouplingMultiFields.hxx"
26 #include "MEDCouplingFieldOverTime.hxx"
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCoupling1GTUMesh.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "MEDCouplingIMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33
34 #include <cmath>
35 #include <algorithm>
36
37 namespace SALOME_TEST
38 {
39   MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build1DMesh()
40   {
41     double coords[4]={ 0.0, 0.3, 0.75, 1.0 };
42     mcIdType conn[2*3]={ 0,1, 1,2, 2,3 };
43     MEDCoupling::MEDCouplingUMesh *mesh=MEDCoupling::MEDCouplingUMesh::New("1DMeshForCorba",1);
44     mesh->setDescription("build1DMesh");
45     mesh->allocateCells(3);
46     mesh->setTime(5.6,7,8);
47     mesh->setTimeUnit("ms");
48     mesh->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn);
49     mesh->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+2);
50     mesh->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+4);
51     mesh->finishInsertingCells();
52     MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New();
53     myCoords->alloc(4,1);
54     std::copy(coords,coords+4,myCoords->getPointer());
55     mesh->setCoords(myCoords);
56     myCoords->decrRef();
57     mesh->changeSpaceDimension(3);
58     myCoords=mesh->getCoords();
59     myCoords->setInfoOnComponent(0,"X1D [m]");
60     myCoords->setInfoOnComponent(1,"Y1D [dm]");
61     myCoords->setInfoOnComponent(2,"Z1D [pm]");
62     double center[3]={0.,0.,0.};
63     double vector[3]={0,1,0};
64     mesh->rotate(center,vector,-M_PI/2.);
65     return mesh;
66   }
67
68   MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build2DMesh()
69   {
70     double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
71     mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
72     MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New();
73     targetMesh->setMeshDimension(2);
74     targetMesh->setName("MyMesh2D");
75     targetMesh->setDescription("build2DMesh");
76     targetMesh->allocateCells(5);
77     targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
78     targetMesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+4);
79     targetMesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+7);
80     targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+10);
81     targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+14);
82     targetMesh->finishInsertingCells();
83     MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New();
84     myCoords->alloc(9,2);
85     std::copy(targetCoords,targetCoords+18,myCoords->getPointer());
86     targetMesh->setCoords(myCoords);
87     myCoords->decrRef();
88     return targetMesh;
89   }
90
91   MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build3DMesh()
92   {
93     double targetCoords[81]={ 0., 0., 0., 50., 0., 0. , 200., 0., 0.  , 0., 50., 0., 50., 50., 0. , 200., 50., 0.,   0., 200., 0., 50., 200., 0. , 200., 200., 0. ,
94                               0., 0., 50., 50., 0., 50. , 200., 0., 50.  , 0., 50., 50., 50., 50., 50. , 200., 50., 50.,   0., 200., 50., 50., 200., 50. , 200., 200., 50. ,
95                               0., 0., 200., 50., 0., 200. , 200., 0., 200.  , 0., 50., 200., 50., 50., 200. , 200., 50., 200.,   0., 200., 200., 50., 200., 200. , 200., 200., 200. };
96     mcIdType targetConn[64]={0,1,4,3,9,10,13,12, 1,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16,
97                         9,10,13,12,18,19,22,21, 10,11,14,13,19,20,23,22, 12,13,16,15,21,22,25,24, 13,14,17,16,22,23,26,25};
98     MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New();
99     targetMesh->setMeshDimension(3);
100     targetMesh->setName("MyMesh3D");
101     targetMesh->setDescription("build3DMesh");
102     targetMesh->allocateCells(12);
103     for(int i=0;i<8;i++)
104       targetMesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,targetConn+8*i);
105     targetMesh->finishInsertingCells();
106     MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New();
107     myCoords->alloc(27,3);
108     std::copy(targetCoords,targetCoords+81,myCoords->getPointer());
109     targetMesh->setCoords(myCoords);
110     myCoords->setName("check in case");
111     myCoords->decrRef();
112     return targetMesh;
113   }
114
115   MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build3DSurfMesh()
116   {
117     double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5};
118     mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
119     MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New();
120     targetMesh->setMeshDimension(2);
121     targetMesh->setName("MyMesh3DSurf");
122     targetMesh->setDescription("build3DSurfMesh");
123     targetMesh->allocateCells(5);
124     targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
125     targetMesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+4);
126     targetMesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+7);
127     targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+10);
128     targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+14);
129     targetMesh->finishInsertingCells();
130     MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New();
131     myCoords->alloc(9,3);
132     std::copy(targetCoords,targetCoords+27,myCoords->getPointer());
133     targetMesh->setCoords(myCoords);
134     myCoords->setInfoOnComponent(0,"X [m]");
135     myCoords->setInfoOnComponent(1,"X [dm]");
136     myCoords->setInfoOnComponent(2,"X [m]");
137     myCoords->decrRef();
138     return targetMesh;
139   }
140
141   MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build0DMesh()
142   {
143     double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5};
144     const mcIdType targetConn[]={0,1,2,3,4,5,7,6};
145     MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New();
146     targetMesh->setMeshDimension(0);
147     targetMesh->allocateCells(8);
148     targetMesh->setName("Wonderful 0D mesh");
149     targetMesh->setDescription("build0DMesh");
150     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn);
151     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+1);
152     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+2);
153     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+3);
154     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+4);
155     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+5);
156     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+6);
157     targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+7);
158     targetMesh->finishInsertingCells();
159     MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New();
160     myCoords->alloc(9,3);
161     std::copy(targetCoords,targetCoords+27,myCoords->getPointer());
162     targetMesh->setCoords(myCoords);
163     myCoords->setInfoOnComponent(0,"X [m]");
164     myCoords->setInfoOnComponent(1,"YY [Pm]");
165     myCoords->setInfoOnComponent(2,"ZZZ [m]");
166     myCoords->decrRef();
167     //
168     targetMesh->checkConsistencyLight();
169     return targetMesh;
170   }
171
172   MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::buildM1DMesh()
173   {
174     MEDCoupling::MEDCouplingUMesh *meshM1D=MEDCoupling::MEDCouplingUMesh::New("wonderful -1 D mesh",-1);
175     meshM1D->setDescription("buildM1DMesh");
176     meshM1D->checkConsistencyLight();
177     return meshM1D;
178   }
179
180   MEDCoupling::MEDCouplingMappedExtrudedMesh *MEDCouplingCorbaServBasicsTest::buildExtrudedMesh(MEDCoupling::MEDCouplingUMesh *&m2D)
181   {
182     m2D=build2DMesh();
183     m2D->changeSpaceDimension(3);
184     MEDCoupling::MEDCouplingUMesh *m1D=build1DMesh();
185     MEDCoupling::MEDCouplingUMesh *retu=m2D->buildExtrudedMesh(m1D,0);
186     m1D->decrRef();
187     MEDCoupling::MEDCouplingMappedExtrudedMesh *ret=MEDCoupling::MEDCouplingMappedExtrudedMesh::New(retu,m2D,2);
188     ret->setName("ExtrudedTestForCorbaTest");
189     ret->setDescription("buildExtrudedMesh");
190     retu->decrRef();
191     return ret;
192   }
193
194   MEDCoupling::MEDCouplingCMesh *MEDCouplingCorbaServBasicsTest::buildCMesh()
195   {
196     MEDCoupling::MEDCouplingCMesh *targetMesh=MEDCoupling::MEDCouplingCMesh::New();
197     targetMesh->setTime(2.3,4,5);
198     targetMesh->setTimeUnit("us");
199     targetMesh->setName("Example of CMesh");
200     targetMesh->setDescription("buildCMesh");
201     MEDCoupling::DataArrayDouble *a1=MEDCoupling::DataArrayDouble::New();
202     a1->alloc(5,1);
203     a1->setInfoOnComponent(0,"SmthX");
204     const double a1Data[5]={3.,4.,5.,6.,7.};
205     std::copy(a1Data,a1Data+5,a1->getPointer());
206     MEDCoupling::DataArrayDouble *a2=MEDCoupling::DataArrayDouble::New();
207     a2->alloc(6,1);
208     a2->setInfoOnComponent(0,"SmthZ");
209     const double a2Data[6]={2.78,3.,4.,5.,6.,7.};
210     std::copy(a2Data,a2Data+6,a2->getPointer());
211     //
212     targetMesh->setCoordsAt(0,a1);
213     targetMesh->setCoordsAt(1,a2);
214     //
215     a1->decrRef();
216     a2->decrRef();
217     //
218     targetMesh->checkConsistencyLight();
219     //
220     return targetMesh;
221   }
222     
223
224   MEDCoupling::MEDCouplingIMesh *MEDCouplingCorbaServBasicsTest::buildIMesh()
225   {
226     MEDCoupling::MEDCouplingIMesh *targetMesh(MEDCoupling::MEDCouplingIMesh::New());
227     targetMesh->setTime(2.3,4,5);
228     targetMesh->setTimeUnit("us");
229     targetMesh->setName("Example of IMesh");
230     targetMesh->setDescription("buildIMesh");
231     mcIdType ns[3]={6,7,8};
232     double orig[3]={4.25,3.75,-6.125};
233     double inter[3]={0.5,0.375,0.75};
234     targetMesh->setSpaceDimension(3);
235     targetMesh->setNodeStruct(ns,ns+3);
236     targetMesh->setOrigin(orig,orig+3);
237     targetMesh->setDXYZ(inter,inter+3);
238     targetMesh->setAxisUnit("mm");
239     return targetMesh;
240   }
241
242   MEDCoupling::MEDCouplingCurveLinearMesh *MEDCouplingCorbaServBasicsTest::buildCLMesh()
243   {
244     MEDCoupling::MEDCouplingCurveLinearMesh *targetMesh=MEDCoupling::MEDCouplingCurveLinearMesh::New();
245     targetMesh->setTime(2.3,4,5);
246     targetMesh->setTimeUnit("us");
247     targetMesh->setName("Example of Cuve linear mesh");
248     targetMesh->setDescription("buildCLMesh");
249     MEDCoupling::DataArrayDouble *a1=MEDCoupling::DataArrayDouble::New();
250     a1->alloc(3*20,1);
251     a1->iota(7.);
252     a1->rearrange(3);
253     targetMesh->setCoords(a1);
254     a1->decrRef();
255     mcIdType structure[2]={4,5};
256     targetMesh->setNodeGridStructure(structure,structure+2);
257     //
258     targetMesh->checkConsistencyLight();
259     //
260     return targetMesh;
261   }
262
263   MEDCoupling::MEDCoupling1SGTUMesh *MEDCouplingCorbaServBasicsTest::build1SGTUMesh()
264   {
265     MEDCoupling::MEDCoupling1SGTUMesh *targetMesh=MEDCoupling::MEDCoupling1SGTUMesh::New("Mesh1SGT",INTERP_KERNEL::NORM_QUAD4);
266     targetMesh->setTime(2.3,44,-55);
267     targetMesh->setTimeUnit("us");
268     targetMesh->setDescription("My Description of 1SGTU");
269     MEDCoupling::DataArrayDouble *a1=MEDCoupling::DataArrayDouble::New(); a1->alloc(10,3); a1->setInfoOnComponent(0,"X1 [m]");  a1->setInfoOnComponent(1,"YY2 [km]"); a1->setInfoOnComponent(2,"ZZZ3 [km]");
270     const double coords[30]={1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.};
271     const mcIdType conn[16]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2,9};
272     std::copy(coords,coords+30,a1->getPointer()); targetMesh->setCoords(a1); a1->decrRef();
273     MEDCoupling::DataArrayIdType *a2(MEDCoupling::DataArrayIdType::New()); a2->alloc(4*4,1);
274     std::copy(conn,conn+16,a2->getPointer());
275     targetMesh->setNodalConnectivity(a2); a2->decrRef();
276     //
277     targetMesh->checkConsistencyLight();
278     //
279     return targetMesh;
280   }
281   
282   MEDCoupling::MEDCoupling1DGTUMesh *MEDCouplingCorbaServBasicsTest::build1DGTUMesh()
283   {
284     MEDCoupling::MEDCoupling1DGTUMesh *targetMesh=MEDCoupling::MEDCoupling1DGTUMesh::New("Mesh1DGT",INTERP_KERNEL::NORM_POLYGON);
285     targetMesh->setTime(2.3,55,-66);
286     targetMesh->setTimeUnit("us");
287     targetMesh->setDescription("My Description of 1DGTU");
288     MEDCoupling::DataArrayDouble *a1=MEDCoupling::DataArrayDouble::New(); a1->alloc(10,3); a1->setInfoOnComponent(0,"X1 [m]");  a1->setInfoOnComponent(1,"YY2 [km]"); a1->setInfoOnComponent(2,"ZZZ3 [km]");
289     const double coords[30]={1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.};
290     const mcIdType conn[15]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2};
291     const mcIdType conni[5]={0,4,8,12,15};
292     std::copy(coords,coords+30,a1->getPointer()); targetMesh->setCoords(a1); a1->decrRef();
293     MEDCoupling::DataArrayIdType *a2(MEDCoupling::DataArrayIdType::New()); a2->alloc(15,1);
294     std::copy(conn,conn+15,a2->getPointer());
295     MEDCoupling::DataArrayIdType *a3(MEDCoupling::DataArrayIdType::New()); a3->alloc(5,1);
296     std::copy(conni,conni+5,a3->getPointer());
297     targetMesh->setNodalConnectivity(a2,a3); a2->decrRef(); a3->decrRef();
298     //
299     targetMesh->checkConsistencyLight();
300     //
301     return targetMesh;
302   }
303
304   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DNT()
305   {
306     MEDCoupling::MEDCouplingUMesh *mesh=build2DMesh();
307     MEDCoupling::MEDCouplingFieldDouble *fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
308     fieldOnCells->setTimeUnit("ms");
309     fieldOnCells->setName("toto");
310     fieldOnCells->setMesh(mesh);
311     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
312     array->alloc(mesh->getNumberOfCells(),6);
313     fieldOnCells->setArray(array);
314     double *tmp=array->getPointer();
315     array->decrRef();
316     std::fill(tmp,tmp+mesh->getNumberOfCells()*6,7.);
317     mesh->decrRef();
318     fieldOnCells->checkConsistencyLight();
319     return fieldOnCells;
320   }
321
322   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldNodeScalarOn2DNT()
323   {
324     MEDCoupling::MEDCouplingUMesh *mesh=build2DMesh();
325     MEDCoupling::MEDCouplingFieldDouble *fieldOnNodes=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::NO_TIME);
326     fieldOnNodes->setName("toto2");
327     fieldOnNodes->setTimeUnit("s");
328     fieldOnNodes->setDescription("my wonderful field toto2");
329     fieldOnNodes->setMesh(mesh);
330     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
331     array->alloc(mesh->getNumberOfNodes(),5);
332     fieldOnNodes->setArray(array);
333     double *tmp=array->getPointer();
334     array->decrRef();
335     std::fill(tmp,tmp+mesh->getNumberOfNodes()*5,7.1234);
336     mesh->decrRef();
337     fieldOnNodes->checkConsistencyLight();
338     return fieldOnNodes;
339   }
340
341   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DNT()
342   {
343     MEDCoupling::MEDCouplingUMesh *mesh=build3DMesh();
344     MEDCoupling::MEDCouplingFieldDouble *fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
345     fieldOnCells->setNature(MEDCoupling::IntensiveMaximum);
346     fieldOnCells->setName("toto");
347     fieldOnCells->setDescription("my wonderful 3D field toto2");
348     fieldOnCells->setMesh(mesh);
349     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
350     array->alloc(mesh->getNumberOfCells(),6);
351     fieldOnCells->setArray(array);
352     double *tmp=array->getPointer();
353     array->decrRef();
354     std::fill(tmp,tmp+mesh->getNumberOfCells()*6,7.);
355     mesh->decrRef();
356     fieldOnCells->checkConsistencyLight();
357     return fieldOnCells;
358   }
359
360   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DSurfWT()
361   {
362     MEDCoupling::MEDCouplingUMesh *mesh=build3DSurfMesh();
363     MEDCoupling::MEDCouplingFieldDouble *fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
364     fieldOnCells->setName("toto25");
365     fieldOnCells->setDescription("my wonderful 3D surf field toto25");
366     fieldOnCells->setTimeUnit("us");
367     fieldOnCells->setMesh(mesh);
368     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
369     array->alloc(mesh->getNumberOfCells(),3);
370     array->setInfoOnComponent(0,"aaa"); array->setInfoOnComponent(1,"bbbb"); array->setInfoOnComponent(2,"ccccc");
371     fieldOnCells->setArray(array);
372     double *tmp=array->getPointer();
373     array->decrRef();
374     std::fill(tmp,tmp+mesh->getNumberOfCells()*3,7.);
375     mesh->decrRef();
376     fieldOnCells->setTime(6.7,1,4);
377     fieldOnCells->checkConsistencyLight();
378     return fieldOnCells;
379   }
380
381   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DSurfCOTI()
382   {
383     MEDCoupling::MEDCouplingUMesh *mesh=build3DSurfMesh();
384     MEDCoupling::MEDCouplingFieldDouble *fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
385     fieldOnCells->setName("toto26");
386     fieldOnCells->setDescription("my wonderful 3D surf field toto26");
387     fieldOnCells->setTimeUnit("us");
388     fieldOnCells->setMesh(mesh);
389     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
390     array->alloc(mesh->getNumberOfCells(),3);
391     fieldOnCells->setArray(array);
392     double *tmp=array->getPointer();
393     array->decrRef();
394     std::fill(tmp,tmp+mesh->getNumberOfCells()*3,7.);
395     mesh->decrRef();
396     fieldOnCells->setStartTime(6.7,1,4);
397     fieldOnCells->setEndTime(7.2,2,8);
398     fieldOnCells->checkConsistencyLight();
399     return fieldOnCells;
400   }
401
402   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DLT()
403   {
404     MEDCoupling::MEDCouplingUMesh *mesh=build2DMesh();
405     MEDCoupling::MEDCouplingFieldDouble *fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::LINEAR_TIME);
406     fieldOnCells->setName("toto27");
407     fieldOnCells->setDescription("my wonderful 2D field toto27");
408     fieldOnCells->setTimeUnit("ms");
409     fieldOnCells->setMesh(mesh);
410     MEDCoupling::DataArrayDouble *array1=MEDCoupling::DataArrayDouble::New();
411     array1->alloc(mesh->getNumberOfCells(),4);
412     fieldOnCells->setArray(array1);
413     double *tmp=array1->getPointer();
414     array1->decrRef();
415     const double arr1[20]={1.2,1.02,1.002,1.0002, 3.4,3.04,3.004,3.0004, 5.6,5.06,5.006,5.0006, 7.8,7.08,7.008,7.0008, 9.1,9.01,9.001,9.0001};
416     std::copy(arr1,arr1+20,tmp);
417     MEDCoupling::DataArrayDouble *array2=MEDCoupling::DataArrayDouble::New();
418     array2->alloc(mesh->getNumberOfCells(),4);
419     fieldOnCells->setEndArray(array2);
420     tmp=array2->getPointer();
421     array2->decrRef();
422     mesh->decrRef();
423     const double arr2[20]={71.2,71.02,71.002,71.0002, 73.4,73.04,73.004,73.0004, 75.6,75.06,75.006,75.0006, 77.8,77.08,77.008,77.0008, 79.1,79.01,79.001,79.0001};
424     std::copy(arr2,arr2+20,tmp);
425     fieldOnCells->setStartTime(6.7,25,26);
426     fieldOnCells->setEndTime(17.2,125,126);
427     fieldOnCells->checkConsistencyLight();
428     return fieldOnCells;
429   }
430
431   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldGaussPt2DWT()
432   {
433     const double _a=0.446948490915965;
434     const double _b=0.091576213509771;
435     const double _p1=0.11169079483905;
436     const double _p2=0.0549758718227661;
437     const double refCoo1[6]={ 0.,0., 1.,0., 0.,1. };
438     const double gsCoo1[12]={ 2*_b-1, 1-4*_b, 2*_b-1, 2.07*_b-1, 1-4*_b,
439                               2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 };
440     const double wg1[6]={ 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 };
441     std::vector<double> _refCoo1(refCoo1,refCoo1+6);
442     std::vector<double> _gsCoo1(gsCoo1,gsCoo1+12);
443     std::vector<double> _wg1(wg1,wg1+6);
444     MEDCoupling::MEDCouplingUMesh *m=build2DMesh();
445     MEDCoupling::MEDCouplingFieldDouble *f=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_GAUSS_PT,MEDCoupling::ONE_TIME);
446     f->setTime(6.7,1,4);
447     f->setMesh(m);
448     m->decrRef();
449     f->setGaussLocalizationOnType(INTERP_KERNEL::NORM_TRI3,_refCoo1,_gsCoo1,_wg1);
450     const double refCoo2[8]={ 0.,0., 1.,0., 1.,1., 0.,1. };
451     std::vector<double> _refCoo2(refCoo2,refCoo2+8);
452     _gsCoo1.resize(4); _wg1.resize(2);
453     f->setGaussLocalizationOnType(INTERP_KERNEL::NORM_QUAD4,_refCoo2,_gsCoo1,_wg1);
454     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
455     array->alloc(18,2);
456     array->setInfoOnComponent(0,"Power [MW]");
457     array->setInfoOnComponent(1,"Density [kg/m^3]");
458     double *ptr=array->getPointer();
459     for(int i=0;i<18*2;i++)
460       ptr[i]=(double)(i+1);
461     f->setArray(array);
462     f->setName("MyFirstFieldOnGaussPoint");
463     f->setTimeUnit("ms");
464     f->setDescription("mmmmmmmmmmmm");
465     array->decrRef();
466     f->checkConsistencyLight();
467     return f;
468   }
469
470   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldGaussPtNE2DWT()
471   {
472     MEDCoupling::MEDCouplingUMesh *m=build2DMesh();
473     MEDCoupling::MEDCouplingFieldDouble *f=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_GAUSS_NE,MEDCoupling::ONE_TIME);
474     f->setTime(6.8,11,8);
475     f->setMesh(m);
476     f->setTimeUnit("ms");
477     f->setName("MyFirstFieldOnNE");
478     f->setDescription("MyDescriptionNE");
479     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
480     array->alloc(18,2);
481     array->setInfoOnComponent(0,"Power [MW]");
482     array->setInfoOnComponent(1,"Density [kg/m^3]");
483     double *ptr=array->getPointer();
484     for(int i=0;i<18*2;i++)
485       ptr[i]=(double)(i+7);
486     f->setArray(array);
487     array->decrRef();
488     //
489     f->checkConsistencyLight();
490     m->decrRef();
491     return f;
492   }
493
494   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldVectorOnExtrudedWT()
495   {
496     MEDCoupling::MEDCouplingUMesh *m2D=0;
497     MEDCoupling::MEDCouplingMappedExtrudedMesh *ext=buildExtrudedMesh(m2D);
498     //
499     MEDCoupling::MEDCouplingFieldDouble *f=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
500     f->setTime(6.8,11,8);
501     f->setMesh(ext);
502     f->setName("MyFieldOnExtruM");
503     f->setDescription("desc of MyFiOnExtruM");
504     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
505     int nbOfCells=ext->getNumberOfCells();
506     array->alloc(nbOfCells,2);
507     array->setInfoOnComponent(0,"Power [MW]");
508     array->setInfoOnComponent(1,"Density [kg/m^3]");
509     double *ptr=array->getPointer();
510     for(int i=0;i<nbOfCells*2;i++)
511       ptr[i]=(double)(i/2+7)+(double)((i%2)*1000);
512     f->setArray(array);
513     array->decrRef();
514     //
515     f->checkConsistencyLight();
516     //
517     m2D->decrRef();
518     ext->decrRef();
519     return f;
520   }
521
522   MEDCoupling::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldVectorOnCMeshWT()
523   {
524     MEDCoupling::MEDCouplingCMesh *m=buildCMesh();
525     MEDCoupling::MEDCouplingFieldDouble *f=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
526     f->setTime(6.8,11,8);
527     f->setMesh(m);
528     m->decrRef();
529     f->setName("MyFieldOnCMesh");
530     f->setDescription("desc of MyFiOnCMesh");
531     MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
532     int nbOfCells=m->getNumberOfCells();
533     array->alloc(nbOfCells,2);
534     array->setInfoOnComponent(0,"Power [GW]");
535     array->setInfoOnComponent(1,"Density [kg/m^3]");
536     double *ptr=array->getPointer();
537     for(int i=0;i<nbOfCells*2;i++)
538       ptr[i]=(double)(i/2+7)+(double)((i%2)*1000);
539     f->setArray(array);
540     array->decrRef();
541     //
542     f->checkConsistencyLight();
543     //
544     return f;
545   }
546
547   MEDCoupling::MEDCouplingFieldTemplate *MEDCouplingCorbaServBasicsTest::buildFieldTemplateCellOn2D()
548   {
549     MEDCoupling::MEDCouplingFieldDouble *f1=buildFieldScalarOn2DNT();
550     MEDCoupling::MEDCouplingFieldTemplate *f2=MEDCoupling::MEDCouplingFieldTemplate::New(*f1);
551     f2->setNature(MEDCoupling::NoNature);
552     f1->decrRef();
553     return f2;
554   }
555
556   MEDCoupling::MEDCouplingFieldTemplate *MEDCouplingCorbaServBasicsTest::buildFieldTemplateNodeOn2D()
557   {
558     MEDCoupling::MEDCouplingFieldDouble *f1=buildFieldNodeScalarOn2DNT();
559     MEDCoupling::MEDCouplingFieldTemplate *f2=MEDCoupling::MEDCouplingFieldTemplate::New(*f1);
560     f2->setNature(MEDCoupling::IntensiveMaximum);
561     f1->decrRef();
562     return f2;
563   }
564
565   MEDCoupling::MEDCouplingFieldTemplate *MEDCouplingCorbaServBasicsTest::buildFieldTemplateGaussPtOn2D()
566   {
567     MEDCoupling::MEDCouplingFieldDouble *f1=buildFieldGaussPt2DWT();
568     MEDCoupling::MEDCouplingFieldTemplate *f2=MEDCoupling::MEDCouplingFieldTemplate::New(*f1);
569     f2->setNature(MEDCoupling::ExtensiveMaximum);
570     f1->decrRef();
571     return f2;
572   }
573
574   MEDCoupling::MEDCouplingFieldTemplate *MEDCouplingCorbaServBasicsTest::buildFieldTemplateGaussNEOn2D()
575   {
576     MEDCoupling::MEDCouplingFieldDouble *f1=buildFieldGaussPtNE2DWT();
577     MEDCoupling::MEDCouplingFieldTemplate *f2=MEDCoupling::MEDCouplingFieldTemplate::New(*f1);
578     f2->setNature(MEDCoupling::ExtensiveConservation);
579     f1->decrRef();
580     return f2;
581   }
582
583   MEDCoupling::MEDCouplingMultiFields *MEDCouplingCorbaServBasicsTest::buildMultiFields1()
584   {
585     MEDCoupling::MEDCouplingUMesh *m1=build2DMesh();
586     m1->setName("m1");
587     MEDCoupling::MEDCouplingUMesh *m2=build2DMesh();
588     m2->setName("m2");
589     const double vals0[]={-0.7,-1.,-2.,-3.,-4.};
590     const double vals1[]={0.,1.,2.,3.,4.,0.1,0.2,0.3,0.4};
591     const double vals1_1[]={170.,171.,172.,173.,174.,170.1,170.2,170.3,170.4};
592     const double vals2[]={5.,6.,7.,8.,9.};
593     const double vals4[]={15.,16.,17.,18.,19.};
594     //
595     MEDCoupling::DataArrayDouble *d0=MEDCoupling::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
596     MEDCoupling::DataArrayDouble *d1=MEDCoupling::DataArrayDouble::New(); d1->alloc(9,1); std::copy(vals1,vals1+9,d1->getPointer());
597     MEDCoupling::DataArrayDouble *d1_1=MEDCoupling::DataArrayDouble::New(); d1_1->alloc(9,1); std::copy(vals1_1,vals1_1+9,d1_1->getPointer());
598     MEDCoupling::DataArrayDouble *d2=MEDCoupling::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
599     MEDCoupling::DataArrayDouble *d4=MEDCoupling::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
600     //
601     d0->setName("d0"); d1->setName("d1"); d1_1->setName("d1_1"); d2->setName("d2"); d4->setName("d4");
602     d0->setInfoOnComponent(0,"c1");
603     d1->setInfoOnComponent(0,"c6");
604     d1_1->setInfoOnComponent(0,"c9");
605     d2->setInfoOnComponent(0,"c5");
606     d4->setInfoOnComponent(0,"c7");
607     //
608     MEDCoupling::MEDCouplingFieldDouble *f0=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
609     f0->setMesh(m1);
610     f0->setArray(d0);
611     f0->setTime(0.2,5,6);
612     f0->setName("f0");
613     MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::LINEAR_TIME);
614     f1->setMesh(m1);
615     std::vector<MEDCoupling::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
616     f1->setArrays(d1s);
617     f1->setStartTime(0.7,7,8);
618     f1->setEndTime(1.2,9,10);
619     f1->setName("f1");
620     MEDCoupling::MEDCouplingFieldDouble *f2=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
621     f2->setMesh(m2);
622     f2->setArray(d2);
623     f2->setTime(1.2,11,12);
624     f2->setEndTime(1.5,13,14);
625     f2->setName("f2");
626     MEDCoupling::MEDCouplingFieldDouble *f3=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
627     f3->setMesh(m1);
628     f3->setArray(d2);
629     f3->setTime(1.7,15,16);
630     f3->setName("f3");
631     MEDCoupling::MEDCouplingFieldDouble *f4=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
632     f4->setMesh(m2);
633     f4->setArray(d4);
634     f4->setName("f4");
635     //
636     std::vector<MEDCoupling::MEDCouplingFieldDouble *> fs(5);
637     fs[0]=f0; fs[1]=f1; fs[2]=f2; fs[3]=f3; fs[4]=f4;
638     MEDCoupling::MEDCouplingMultiFields *ret=MEDCoupling::MEDCouplingMultiFields::New(fs);
639     //
640     m1->decrRef();
641     m2->decrRef();
642     d0->decrRef();
643     d1->decrRef();
644     d1_1->decrRef();
645     d2->decrRef();
646     d4->decrRef();
647     f0->decrRef();
648     f1->decrRef();
649     f2->decrRef();
650     f3->decrRef();
651     f4->decrRef();
652     //
653     return ret;
654   }
655
656   MEDCoupling::DataArrayDouble *MEDCouplingCorbaServBasicsTest::buildArrayDouble1()
657   {
658     MEDCoupling::DataArrayDouble *ret=MEDCoupling::DataArrayDouble::New();
659     ret->alloc(4,3);
660     const double vals[12]={2.4,3.2,5.6,9.6,47.6,20.4,24.6,278.1,2.01,3.3,2.4,9.4};
661     std::copy(vals,vals+12,ret->getPointer());
662     ret->setName("toto");
663     ret->setInfoOnComponent(0,"sss");
664     ret->setInfoOnComponent(1,"ppp");
665     ret->setInfoOnComponent(2,"ttt");
666     return ret;
667   }
668
669   MEDCoupling::DataArrayDouble *MEDCouplingCorbaServBasicsTest::buildArrayDouble2()
670   {
671     MEDCoupling::DataArrayDouble *ret=MEDCoupling::DataArrayDouble::New();
672     ret->setName("titi");
673     return ret;
674   }
675
676   MEDCoupling::DataArrayDouble *MEDCouplingCorbaServBasicsTest::buildArrayDouble3()
677   {
678     MEDCoupling::DataArrayDouble *ret=MEDCoupling::DataArrayDouble::New();
679     ret->setName("titi");
680     ret->alloc(0,3);
681     ret->setInfoOnComponent(0,"sss");
682     ret->setInfoOnComponent(1,"ppp");
683     ret->setInfoOnComponent(2,"ttt");
684     return ret;
685   }
686
687   MEDCoupling::DataArrayInt *MEDCouplingCorbaServBasicsTest::buildArrayInt1()
688   {
689     MEDCoupling::DataArrayInt *ret=MEDCoupling::DataArrayInt::New();
690     ret->alloc(4,3);
691     const int vals[12]={2,3,5,9,47,20,24,278,2,3,2,9};
692     std::copy(vals,vals+12,ret->getPointer());
693     ret->setName("toto");
694     ret->setInfoOnComponent(0,"sss");
695     ret->setInfoOnComponent(1,"ppp");
696     ret->setInfoOnComponent(2,"ttt");
697     return ret;
698   }
699
700   MEDCoupling::DataArrayInt *MEDCouplingCorbaServBasicsTest::buildArrayInt2()
701   {
702     MEDCoupling::DataArrayInt *ret=MEDCoupling::DataArrayInt::New();
703     ret->setName("titi");
704     return ret;
705   }
706
707   MEDCoupling::DataArrayInt *MEDCouplingCorbaServBasicsTest::buildArrayInt3()
708   {
709     MEDCoupling::DataArrayInt *ret=MEDCoupling::DataArrayInt::New();
710     ret->setName("titi");
711     ret->alloc(0,3);
712     ret->setInfoOnComponent(0,"sss");
713     ret->setInfoOnComponent(1,"ppp");
714     ret->setInfoOnComponent(2,"ttt");
715     return ret;
716   }
717
718   MEDCoupling::MEDCouplingFieldOverTime *MEDCouplingCorbaServBasicsTest::buildMultiFields2()
719   {
720     MEDCoupling::MEDCouplingUMesh *m1=build2DMesh();
721     m1->setName("m1");
722     MEDCoupling::MEDCouplingUMesh *m2=build2DMesh();
723     m2->setName("m2");
724     const double vals0[]={-0.7,-1.,-2.,-3.,-4.};
725     const double vals1[]={0.,1.,2.,3.,4.};
726     const double vals1_1[]={170.,171.,172.,173.,174.};
727     const double vals2[]={5.,6.,7.,8.,9.};
728     const double vals4[]={15.,16.,17.,18.,19.};
729     //
730     MEDCoupling::DataArrayDouble *d0=MEDCoupling::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
731     MEDCoupling::DataArrayDouble *d1=MEDCoupling::DataArrayDouble::New(); d1->alloc(5,1); std::copy(vals1,vals1+5,d1->getPointer());
732     MEDCoupling::DataArrayDouble *d1_1=MEDCoupling::DataArrayDouble::New(); d1_1->alloc(5,1); std::copy(vals1_1,vals1_1+5,d1_1->getPointer());
733     MEDCoupling::DataArrayDouble *d2=MEDCoupling::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
734     MEDCoupling::DataArrayDouble *d4=MEDCoupling::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
735     //
736     d0->setName("d0"); d1->setName("d1"); d1_1->setName("d1_1"); d2->setName("d2"); d4->setName("d4");
737     d0->setInfoOnComponent(0,"c1");
738     d1->setInfoOnComponent(0,"c6");
739     d1_1->setInfoOnComponent(0,"c9");
740     d2->setInfoOnComponent(0,"c5");
741     d4->setInfoOnComponent(0,"c7");
742     //
743     MEDCoupling::MEDCouplingFieldDouble *f0=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
744     f0->setMesh(m1);
745     f0->setArray(d0);
746     f0->setTime(0.2,5,6);
747     f0->setName("f0");
748     MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::LINEAR_TIME);
749     f1->setMesh(m1);
750     std::vector<MEDCoupling::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
751     f1->setArrays(d1s);
752     f1->setStartTime(0.7,7,8);
753     f1->setEndTime(1.2,9,10);
754     f1->setName("f1");
755     MEDCoupling::MEDCouplingFieldDouble *f2=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
756     f2->setMesh(m2);
757     f2->setArray(d2);
758     f2->setTime(1.2,11,12);
759     f2->setEndTime(1.5,13,14);
760     f2->setName("f2");
761     MEDCoupling::MEDCouplingFieldDouble *f3=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
762     f3->setMesh(m1);
763     f3->setArray(d2);
764     f3->setTime(1.7,15,16);
765     f3->setName("f3");
766     MEDCoupling::MEDCouplingFieldDouble *f4=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
767     f4->setMesh(m2);
768     f4->setArray(d4);
769     f4->setName("f4");
770     f4->setTime(2.7,25,26);
771     //
772     std::vector<MEDCoupling::MEDCouplingFieldDouble *> fs(5);
773     fs[0]=f0; fs[1]=f1; fs[2]=f2; fs[3]=f3; fs[4]=f4;
774     MEDCoupling::MEDCouplingFieldOverTime *ret=MEDCoupling::MEDCouplingFieldOverTime::New(fs);
775     ret->checkConsistencyLight();
776     //
777     m1->decrRef();
778     m2->decrRef();
779     d0->decrRef();
780     d1->decrRef();
781     d1_1->decrRef();
782     d2->decrRef();
783     d4->decrRef();
784     f0->decrRef();
785     f1->decrRef();
786     f2->decrRef();
787     f3->decrRef();
788     f4->decrRef();
789     //
790     return ret;
791   }
792
793   std::string MEDCouplingCorbaServBasicsTest::buildFileNameForIOR()
794   {
795     std::string tmpdir;
796     if (getenv("TMP"))
797       tmpdir = getenv("TMP");
798     if (tmpdir == "")
799       tmpdir = "/tmp";
800
801     std::string username;
802     if ( getenv("USERNAME") )
803       username = std::string(getenv("USERNAME"))+"_";
804     else if ( getenv("USER") )
805       username = std::string(getenv("USER"))+"_";
806
807     std::string ret = tmpdir+"/"+username+"entryPointMEDCouplingCorba.ior";
808     return ret;
809   }
810 }