- 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,2,1,3,6,5,4,7,9,8};
- aConn = anIds;
- anId = 118;
- break;
- }
- case 13: {
- static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
- aConn = anIds;
- anId = 114;
- break;
- }
- case 15: {
- static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
- aConn = anIds;
- anId = 113;
- break;
- }
- case 20: {
- static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
- 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();
+ int aNbNodes = anElem->NbNodes();
+ //MESSAGE("aNbNodes="<<aNbNodes);
+ SMDS_ElemIteratorPtr aNodesIter;
+ aNodesIter = anElem->nodesIteratorToUNV();
+ if ( anElem->IsPoly() ) {
+ continue;
+ // MESSAGE("anElem->IsPoly");
+ // if ( const SMDS_VtkVolume* ph =
+ // dynamic_cast<const SMDS_VtkVolume*> (anElem))
+ // {
+ // aNbNodes = ph->NbUniqueNodes();
+ // aNodesIter = ph->uniqueNodesIterator();
+ // }
+ }
+
+ 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);
+ while ( aNodesIter->more() && aRec.node_labels.size() < aNbNodes )
+ {
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ aRec.node_labels.push_back(aNode->GetID());
+ }
+ aDataSet2412.push_back(aRec);
+ }
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());