- 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();
- aConnect.resize(aNbNodes);
-
- SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
- 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));
- }
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ if ( myMesh->NbVolumes() )
+ {
+ SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
+ while ( anIter->more())
+ {
+ const SMDS_MeshVolume* anElem = anIter->next();
+ if ( anElem->IsPoly() )
+ continue;
+ int aNbNodes = anElem->NbNodes();
+ int anId = -1;
+ switch(aNbNodes) {
+ case 4: anId = 111; break;
+ case 6: anId = 112; break;
+ case 8: anId = 115; break;
+ case 10: anId = 118; break;
+ case 13: anId = 114; break;
+ case 15: anId = 113; break;
+ case 20:
+ case 27: anId = 116; aNbNodes = 20; break;
+ default:
+ continue;
+ }
+ if(anId>0){
+ TRecord aRec;
+ aRec.label = anElem->GetID();
+ aRec.fe_descriptor_id = anId;
+ aRec.node_labels.reserve(aNbNodes);
+ SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
+ while ( aNodesIter->more() && (int)aRec.node_labels.size() < aNbNodes )
+ {
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ aRec.node_labels.push_back(aNode->GetID());
+ }
+ aDataSet2412.push_back(aRec);
+ }
+ }