Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 155974 | Differences between
and this patch

Collapse All | Expand All

(-)src4.1.4.old/MED_SRC_4.1.4/src/MEDSPLITTER/MEDSPLITTER_MESHCollectionDriver.cxx (-17 / +17 lines)
Lines 182-188 Link Here
182
  med_2_3::med_int njoint = med_2_3::MEDnJoint(fid, meshname);
182
  med_2_3::med_int njoint = med_2_3::MEDnJoint(fid, meshname);
183
  for (int ijoint=0; ijoint<njoint; ijoint++)
183
  for (int ijoint=0; ijoint<njoint; ijoint++)
184
    {
184
    {
185
      int distant;
185
      med_2_3::med_int distant;
186
      char joint_description[MED_TAILLE_DESC];
186
      char joint_description[MED_TAILLE_DESC];
187
      char name[MED_TAILLE_NOM];
187
      char name[MED_TAILLE_NOM];
188
      char name_distant[MED_TAILLE_NOM];
188
      char name_distant[MED_TAILLE_NOM];
Lines 204-210 Link Here
204
                   &cor_typent_local,  &cor_typgeo_local,
204
                   &cor_typent_local,  &cor_typgeo_local,
205
                   &cor_typent_dist, &cor_typgeo_dist
205
                   &cor_typent_dist, &cor_typgeo_dist
206
                   );
206
                   );
207
    int* node_corresp=new int[ncouples];
207
    med_2_3::med_int* node_corresp=new med_2_3::med_int[ncouples];
208
    if (cor_typent_local == med_2_3::MED_NOEUD && cor_typent_dist == med_2_3::MED_NOEUD)
208
    if (cor_typent_local == med_2_3::MED_NOEUD && cor_typent_dist == med_2_3::MED_NOEUD)
209
      {
209
      {
210
      
210
      
Lines 222-228 Link Here
222
    cz->setDistantDomainNumber(distant);
222
    cz->setDistantDomainNumber(distant);
223
    cz->setLocalMesh((m_collection->getMesh())[idomain]);
223
    cz->setLocalMesh((m_collection->getMesh())[idomain]);
224
    cz->setDistantMesh((m_collection->getMesh())[distant]);
224
    cz->setDistantMesh((m_collection->getMesh())[distant]);
225
    cz->setNodeCorresp(node_corresp,ncouples);
225
    cz->setNodeCorresp((int *)node_corresp,ncouples);
226
    (m_collection->getCZ()).push_back(cz);
226
    (m_collection->getCZ()).push_back(cz);
227
        
227
        
228
        }//loop on correspom_topology->nbDomain())ndances
228
        }//loop on correspom_topology->nbDomain())ndances
Lines 233-239 Link Here
233
  int ncell=(m_collection->getMesh())[idomain]->getNumberOfElementsWithPoly(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
233
  int ncell=(m_collection->getMesh())[idomain]->getNumberOfElementsWithPoly(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
234
  if (ncell>0)
234
  if (ncell>0)
235
  {
235
  {
236
    int * array=new int[ncell];
236
    med_2_3::med_int * array=new med_2_3::med_int[ncell];
237
    int offset=0;
237
    int offset=0;
238
    MESSAGE("Reading cell global numbering for mesh "<< idomain);
238
    MESSAGE("Reading cell global numbering for mesh "<< idomain);
239
    list<MED_EN::medGeometryElement>::const_iterator iter;
239
    list<MED_EN::medGeometryElement>::const_iterator iter;
Lines 251-274 Link Here
251
                med_2_3::MED_MAILLE, (med_2_3::med_geometrie_element)type);
251
                med_2_3::MED_MAILLE, (med_2_3::med_geometrie_element)type);
252
        offset+=ntype;
252
        offset+=ntype;
253
      }
253
      }
254
    cellglobal[idomain]=array;
254
    cellglobal[idomain]=(int *)array;
255
    delete[] types;
255
    delete[] types;
256
  } 
256
  } 
257
        
257
        
258
  MESSAGE("Reading node global numbering");
258
  MESSAGE("Reading node global numbering");
259
  int nnode= (m_collection->getMesh())[idomain]->getNumberOfNodes();
259
  int nnode= (m_collection->getMesh())[idomain]->getNumberOfNodes();
260
  {
260
  {
261
  int* array=new int[nnode];
261
  med_2_3::med_int* array=new med_2_3::med_int[nnode];
262
  med_2_3::MEDglobalNumLire(fid,meshname, array, nnode,
262
  med_2_3::MEDglobalNumLire(fid,meshname, array, nnode,
263
          med_2_3::MED_NOEUD, med_2_3::MED_POINT1); 
263
          med_2_3::MED_NOEUD, med_2_3::MED_POINT1); 
264
  nodeglobal[idomain]=array;
264
  nodeglobal[idomain]=(int *)array;
265
  } 
265
  } 
266
        
266
        
267
  MESSAGE("Reading face global numbering for mesh "<<idomain);
267
  MESSAGE("Reading face global numbering for mesh "<<idomain);
268
  int nbface=(m_collection->getMesh())[idomain]->getNumberOfElementsWithPoly(MED_EN::MED_FACE,MED_EN::MED_ALL_ELEMENTS);
268
  int nbface=(m_collection->getMesh())[idomain]->getNumberOfElementsWithPoly(MED_EN::MED_FACE,MED_EN::MED_ALL_ELEMENTS);
269
  if (nbface!=0)
269
  if (nbface!=0)
270
    {
270
    {
271
      int* array=new int[nbface];
271
      med_2_3::med_int* array=new med_2_3::med_int[nbface];
272
      int offset=0;
272
      int offset=0;
273
      int nbtypes = (m_collection->getMesh())[idomain]->getNumberOfTypesWithPoly(MED_EN::MED_FACE);
273
      int nbtypes = (m_collection->getMesh())[idomain]->getNumberOfTypesWithPoly(MED_EN::MED_FACE);
274
      MED_EN::medGeometryElement* types =(m_collection->getMesh())[idomain]->getTypesWithPoly(MED_EN::MED_FACE);
274
      MED_EN::medGeometryElement* types =(m_collection->getMesh())[idomain]->getTypesWithPoly(MED_EN::MED_FACE);
Lines 284-290 Link Here
284
            med_2_3::MED_FACE, (med_2_3::med_geometrie_element)type);
284
            med_2_3::MED_FACE, (med_2_3::med_geometrie_element)type);
285
    offset+=ntype;
285
    offset+=ntype;
286
        }
286
        }
287
      faceglobal[idomain]=array;
287
      faceglobal[idomain]=(int *)array;
288
       delete[] types;
288
       delete[] types;
289
    }
289
    }
290
  med_2_3::MEDfermer(fid);
290
  med_2_3::MEDfermer(fid);
Lines 346-352 Link Here
346
             jointSort(node_corresp, nbnodes, false);
346
             jointSort(node_corresp, nbnodes, false);
347
          
347
          
348
        error=
348
        error=
349
    med_2_3::MEDjointEcr(fid, mesh_name, joint_name, node_corresp, nbnodes,
349
    med_2_3::MEDjointEcr(fid, mesh_name, joint_name,(med_2_3::med_int *) node_corresp, nbnodes,
350
             med_2_3::MED_NOEUD, med_2_3::MED_POINT1,med_2_3::MED_NOEUD, med_2_3::MED_POINT1);
350
             med_2_3::MED_NOEUD, med_2_3::MED_POINT1,med_2_3::MED_NOEUD, med_2_3::MED_POINT1);
351
        if (error==-1) cout << "erreur creation de joint "<<endl;
351
        if (error==-1) cout << "erreur creation de joint "<<endl;
352
        
352
        
Lines 366-373 Link Here
366
      // Writing cell global numbering
366
      // Writing cell global numbering
367
      // 
367
      // 
368
      int ncell=m_collection->getTopology()->getCellNumber(idomain);
368
      int ncell=m_collection->getTopology()->getCellNumber(idomain);
369
      int * array=new int[ncell];
369
      med_2_3::med_int * array=new med_2_3::med_int[ncell];
370
      m_collection->getTopology()->getCellList(idomain,array);
370
      m_collection->getTopology()->getCellList(idomain,(int *)array);
371
      int offset=0;
371
      int offset=0;
372
    
372
    
373
      MED_EN::MESH_ENTITIES::const_iterator currentEntity;
373
      MED_EN::MESH_ENTITIES::const_iterator currentEntity;
Lines 404-411 Link Here
404
      offset=0;
404
      offset=0;
405
      int nface= m_collection->getTopology()->getFaceNumber(idomain);
405
      int nface= m_collection->getTopology()->getFaceNumber(idomain);
406
      if (nface >0)
406
      if (nface >0)
407
        array=new int[nface];
407
        array=new med_2_3::med_int[nface];
408
      m_collection->getTopology()->getFaceList(idomain,array);
408
      m_collection->getTopology()->getFaceList(idomain,(int *)array);
409
      strcpy(meshchar,(m_collection->getMesh())[idomain]->getName().c_str());
409
      strcpy(meshchar,(m_collection->getMesh())[idomain]->getName().c_str());
410
      int nbfacetypes = (m_collection->getMesh())[idomain]->getNumberOfTypesWithPoly(constituent_entity);
410
      int nbfacetypes = (m_collection->getMesh())[idomain]->getNumberOfTypesWithPoly(constituent_entity);
411
      MED_EN::medGeometryElement* facetypes;
411
      MED_EN::medGeometryElement* facetypes;
Lines 429-436 Link Here
429
  //writing node global numbering
429
  //writing node global numbering
430
  
430
  
431
  int nnode= m_collection->getTopology()->getNodeNumber(idomain);
431
  int nnode= m_collection->getTopology()->getNodeNumber(idomain);
432
  array=new int[nnode];
432
  array=new med_2_3::med_int[nnode];
433
  m_collection->getTopology()->getNodeList(idomain,array);
433
  m_collection->getTopology()->getNodeList(idomain,(int *)array);
434
  med_2_3::MEDglobalNumEcr(fid,meshchar, array, nnode,
434
  med_2_3::MEDglobalNumEcr(fid,meshchar, array, nnode,
435
         med_2_3::MED_NOEUD, med_2_3::MED_POINT1);
435
         med_2_3::MED_NOEUD, med_2_3::MED_POINT1);
436
  
436
  
Lines 500-506 Link Here
500
  for (iter= cellmap.begin(); iter != cellmap.end(); iter++)
500
  for (iter= cellmap.begin(); iter != cellmap.end(); iter++)
501
  {
501
  {
502
    int size= iter->second.size();
502
    int size= iter->second.size();
503
    int *corresp = new int[size];
503
    med_2_3::med_int *corresp = new med_2_3::med_int[size];
504
    for (int ind=0; ind < size; ind++)
504
    for (int ind=0; ind < size; ind++)
505
      corresp[ind]=(iter->second)[ind];
505
      corresp[ind]=(iter->second)[ind];
506
    med_2_3::med_geometrie_element local_geo_elem=(med_2_3::med_geometrie_element)iter->first.first;
506
    med_2_3::med_geometrie_element local_geo_elem=(med_2_3::med_geometrie_element)iter->first.first;
(-)src4.1.4.old/MED_SRC_4.1.4/src/MEDSPLITTER/Test/MEDSPLITTERTest_MESHCollection.cxx (-12 / +12 lines)
Lines 312-324 Link Here
312
  char desc1[MED_TAILLE_DESC];
312
  char desc1[MED_TAILLE_DESC];
313
  char maa_dist1[MED_TAILLE_NOM], jn1[MED_TAILLE_NOM];
313
  char maa_dist1[MED_TAILLE_NOM], jn1[MED_TAILLE_NOM];
314
  char desc2[MED_TAILLE_DESC], maa_dist2[MED_TAILLE_NOM], jn2[MED_TAILLE_NOM];
314
  char desc2[MED_TAILLE_DESC], maa_dist2[MED_TAILLE_NOM], jn2[MED_TAILLE_NOM];
315
  int dom1, dom2;
315
  med_2_3::med_int dom1, dom2;
316
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
316
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
317
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
317
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
318
	CPPUNIT_ASSERT(strcmp(jn1,"joint_2")==0);
318
	CPPUNIT_ASSERT(strcmp(jn1,"joint_2")==0);
319
	CPPUNIT_ASSERT(strcmp(jn2,"joint_1")==0);
319
	CPPUNIT_ASSERT(strcmp(jn2,"joint_1")==0);
320
  CPPUNIT_ASSERT_EQUAL(dom1,1);
320
  CPPUNIT_ASSERT_EQUAL((int)dom1,1);
321
  CPPUNIT_ASSERT_EQUAL(dom2,0);
321
  CPPUNIT_ASSERT_EQUAL((int)dom2,0);
322
  
322
  
323
  // testing node-node correspondency
323
  // testing node-node correspondency
324
  med_2_3::med_entite_maillage typ_ent_loc=med_2_3::MED_NOEUD;
324
  med_2_3::med_entite_maillage typ_ent_loc=med_2_3::MED_NOEUD;
Lines 482-492 Link Here
482
  char desc1[MED_TAILLE_DESC];
482
  char desc1[MED_TAILLE_DESC];
483
  char maa_dist1[MED_TAILLE_NOM], jn1[MED_TAILLE_NOM];
483
  char maa_dist1[MED_TAILLE_NOM], jn1[MED_TAILLE_NOM];
484
  char desc2[MED_TAILLE_DESC], maa_dist2[MED_TAILLE_NOM], jn2[MED_TAILLE_NOM];
484
  char desc2[MED_TAILLE_DESC], maa_dist2[MED_TAILLE_NOM], jn2[MED_TAILLE_NOM];
485
  int dom1, dom2;
485
  med_2_3::med_int dom1, dom2;
486
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
486
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
487
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
487
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
488
  CPPUNIT_ASSERT_EQUAL(dom1,1);
488
  CPPUNIT_ASSERT_EQUAL(((int)dom1),1);
489
  CPPUNIT_ASSERT_EQUAL(dom2,0);
489
  CPPUNIT_ASSERT_EQUAL(((int)dom2),0);
490
  
490
  
491
  // testing node-node correspondency
491
  // testing node-node correspondency
492
  med_2_3::med_entite_maillage typ_ent_loc=med_2_3::MED_NOEUD;
492
  med_2_3::med_entite_maillage typ_ent_loc=med_2_3::MED_NOEUD;
Lines 564-570 Link Here
564
  //testing cells global numbering
564
  //testing cells global numbering
565
  num = new med_2_3::med_int[2];
565
  num = new med_2_3::med_int[2];
566
  MEDglobalNumLire(fid1, meshname1, num, 2, typ_ent_loc, typ_geo_loc);
566
  MEDglobalNumLire(fid1, meshname1, num, 2, typ_ent_loc, typ_geo_loc);
567
  med_2_3::med_int* globcellref = new int[2];
567
  med_2_3::med_int* globcellref = new med_2_3::med_int[2];
568
  globcellref[0]=1;
568
  globcellref[0]=1;
569
  globcellref[1]=3;
569
  globcellref[1]=3;
570
  
570
  
Lines 798-805 Link Here
798
  med_2_3::med_int dom1, dom2;
798
  med_2_3::med_int dom1, dom2;
799
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
799
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
800
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
800
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
801
  CPPUNIT_ASSERT_EQUAL(dom1,1);
801
  CPPUNIT_ASSERT_EQUAL(((int)dom1),1);
802
  CPPUNIT_ASSERT_EQUAL(dom2,0);
802
  CPPUNIT_ASSERT_EQUAL(((int)dom2),0);
803
803
804
  // testing node-node correspondency
804
  // testing node-node correspondency
805
  med_2_3::med_entite_maillage typ_ent_loc=med_2_3::MED_NOEUD;
805
  med_2_3::med_entite_maillage typ_ent_loc=med_2_3::MED_NOEUD;
Lines 1176-1186 Link Here
1176
  char desc1[MED_TAILLE_DESC+1];
1176
  char desc1[MED_TAILLE_DESC+1];
1177
  char maa_dist1[MED_TAILLE_NOM+1], jn1[MED_TAILLE_NOM+1];
1177
  char maa_dist1[MED_TAILLE_NOM+1], jn1[MED_TAILLE_NOM+1];
1178
  char desc2[MED_TAILLE_DESC+1], maa_dist2[MED_TAILLE_NOM+1], jn2[MED_TAILLE_NOM+1];
1178
  char desc2[MED_TAILLE_DESC+1], maa_dist2[MED_TAILLE_NOM+1], jn2[MED_TAILLE_NOM+1];
1179
  int dom1, dom2;
1179
  med_2_3::med_int dom1, dom2;
1180
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
1180
  med_2_3::MEDjointInfo(fid1, meshname1, 1, jn1, desc1, &dom1, maa_dist1);
1181
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
1181
  med_2_3::MEDjointInfo(fid2, meshname2, 1, jn2, desc2, &dom2, maa_dist2);
1182
  CPPUNIT_ASSERT_EQUAL(dom1,1);
1182
  CPPUNIT_ASSERT_EQUAL(((int)dom1),1);
1183
  CPPUNIT_ASSERT_EQUAL(dom2,0);
1183
  CPPUNIT_ASSERT_EQUAL(((int)dom2),0);
1184
  
1184
  
1185
1185
1186
	int nbEdgesFamilies1= med_2_3::MEDnFam(fid1, meshname1);
1186
	int nbEdgesFamilies1= med_2_3::MEDnFam(fid1, meshname1);

Return to bug 155974