- fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
-
- /****************************************************************************
- * ECRITURE DES ELEMENTS *
- ****************************************************************************/
- fprintf(stdout, "\n(**************************)\n");
- fprintf(stdout, "(* ELEMENTS DU MAILLAGE : *)\n");
- fprintf(stdout, "(**************************)");
- /* Ecriture des connectivites, noms, numeros des mailles */
-
- fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
- fprintf(myFileId, "%s\n", sELT_UNV_ID);
-
- SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
- while(itEdges->more())
- {
- const SMDS_MeshElement * elem = itEdges->next();
- SMDS_ElemIteratorPtr itn=elem->nodesIterator();
-
- switch (elem->NbNodes())
- {
- case 2:
- fprintf(myFileId, sELT_BEAM_DESC1, elem->GetID(), 21,
- elem->NbNodes());
- fprintf(myFileId, sELT_BEAM_DESC2);
- fprintf(myFileId, "%10d%10d\n", itn->next()->GetID(),
- itn->next()->GetID());
- break;
-
- case 3:
- fprintf(myFileId, sELT_BEAM_DESC1, elem->GetID(), 24,
- elem->NbNodes());
- fprintf(myFileId, sELT_BEAM_DESC2);
- fprintf(myFileId, "%10d%10d%10d\n", itn->next()->GetID(),
- itn->next()->GetID(), itn->next()->GetID());
-
- break;
- }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ }
+
+ MESSAGE("Perform - myMesh->NbVolumes() = "<<myMesh->NbVolumes());
+ if(myMesh->NbVolumes()){
+ SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshVolume* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
+
+ int aNbNodes = anElem->NbNodes();
+ SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+ if ( anElem->IsPoly() ) {
+ if ( const SMDS_PolyhedralVolumeOfNodes* ph =
+ dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
+ {
+ aNbNodes = ph->NbUniqueNodes();
+ aNodesIter = ph->uniqueNodesIterator();
+ }
+ }
+ aConnect.resize(aNbNodes);
+ GetConnect(aNodesIter,aConnect);
+
+ int anId = -1;
+ int* aConn = NULL;
+ switch(aNbNodes){
+ case 4: {
+ static int anIds[] = {0,2,1,3};
+ aConn = anIds;
+ anId = 111;
+ break;
+ }
+ case 6: {
+ static int anIds[] = {0,2,1,3,5,4};
+ aConn = anIds;
+ anId = 112;
+ break;
+ }
+ case 8: {
+ static int anIds[] = {0,3,2,1,4,7,6,5};
+ aConn = anIds;
+ anId = 115;
+ break;
+ }
+ case 10: {
+ static int anIds[] = {0,4,2,9,5,3, 1,6,8, 7};
+ aConn = anIds;
+ anId = 118;
+ break;
+ }
+ case 13: {
+ static int anIds[] = {0,6,4,2,7,5,3,1,8,11,10,9,12};
+ aConn = anIds;
+ anId = 114;
+ break;
+ }
+ case 15: {
+ static int anIds[] = {0,4,2,9,13,11,5,3,1,14,12,10,6,8,7};
+ aConn = anIds;
+ anId = 113;
+ break;
+ }
+ case 20: {
+ static int anIds[] = {0,6, 4,2, 12,18,16,14,7, 5, 3, 1, 19,17,15,13,8, 11,10,9};
+ aConn = anIds;
+ anId = 116;
+ break;
+ }
+ default:
+ continue;
+ }
+ if(aConn){
+ TRecord aRec;
+ aRec.fe_descriptor_id = anId;
+ aRec.node_labels.resize(aNbNodes);
+ for(int aNodeId = 0; aNodeId < aNbNodes; aNodeId++){
+ aRec.node_labels[aConn[aNodeId]] = aConnect[aNodeId];
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }