- for(; anIter != aDataSet2412.end(); anIter++){
- SMDS_MeshElement* anElement = NULL;
- const TElementLab& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
- int aNbNodes = aRec.node_labels.size();
- if(IsBeam(aRec.fe_descriptor_id)){
- anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aLabel);
- }else if(IsFace(aRec.fe_descriptor_id)){
- switch(aRec.fe_descriptor_id){
- case 71: // TRI3
- case 72:
- case 74:
-
- case 41: // Plane Stress Linear Triangle - TRI3
- case 91: // Thin Shell Linear Triangle - TRI3
-
- case 42: // Plane Stress Quadratic Triangle - TRI6
- case 92: // Thin Shell Quadratic Triangle - TRI6
-
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aLabel);
- break;
-
- case 44: // Plane Stress Linear Quadrilateral - QUAD4
- case 94: // Thin Shell Linear Quadrilateral - QUAD4
-
- case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
- case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aRec.node_labels[3],
- aLabel);
- break;
- }
- }else if(IsVolume(aRec.fe_descriptor_id)){
- switch(aRec.fe_descriptor_id){
-
- case 111: // Solid Linear Tetrahedron - TET4
- case 118: // Solid Quadratic Tetrahedron - TET10
-
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aRec.node_labels[3],
- aLabel);
- break;
-
- case 112: // Solid Linear Prism - PRISM6
-
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aRec.node_labels[4],
- aLabel);
- break;
-
- case 113: // Solid Quadratic Prism - PRISM15
-
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[4],
- aRec.node_labels[2],
- aRec.node_labels[9],
- aRec.node_labels[13],
- aRec.node_labels[11],
- aLabel);
- break;
-
- case 115: // Solid Linear Brick - HEX8
-
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aRec.node_labels[3],
- aRec.node_labels[4],
- aRec.node_labels[5],
- aRec.node_labels[6],
- aRec.node_labels[7],
- aLabel);
- break;
-
- case 116: // Solid Quadratic Brick - HEX20
-
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[4],
- aRec.node_labels[6],
- aRec.node_labels[12],
- aRec.node_labels[14],
- aRec.node_labels[16],
- aRec.node_labels[18],
- aLabel);
- break;
- }
- }
- if(!anElement)
- MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
+ for(; anIter != aDataSet2412.end(); anIter++)
+ {
+ SMDS_MeshElement* anElement = NULL;
+ const TRecord& aRec = *anIter;
+ if(IsBeam(aRec.fe_descriptor_id)) {
+ switch ( aRec.node_labels.size() ) {
+ case 2: // edge with two nodes
+ //MESSAGE("add edge " << aLabel << " " << aRec.node_labels[0] << " " << aRec.node_labels[1]);
+ anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.label);
+ break;
+ case 3: // quadratic edge (with 3 nodes)
+ //MESSAGE("add edge " << aRec.label << " " << aRec.node_labels[0] << " " << aRec.node_labels[1] << " " << aRec.node_labels[2]);
+ anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.label);
+ }
+ }
+ else if(IsFace(aRec.fe_descriptor_id)) {
+ //MESSAGE("add face " << aRec.label);
+ switch(aRec.fe_descriptor_id){
+ case 41: // Plane Stress Linear Triangle
+ case 51: // Plane Strain Linear Triangle
+ case 61: // Plate Linear Triangle
+ case 74: // Membrane Linear Triangle
+ case 81: // Axisymetric Solid Linear Triangle
+ case 91: // Thin Shell Linear Triangle
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aRec.label);
+ break;
+
+ case 42: // Plane Stress Parabolic Triangle
+ case 52: // Plane Strain Parabolic Triangle
+ case 62: // Plate Parabolic Triangle
+ case 72: // Membrane Parabolic Triangle
+ case 82: // Axisymetric Solid Parabolic Triangle
+ case 92: // Thin Shell Parabolic Triangle
+ if ( aRec.node_labels.size() == 7 )
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[6],
+ aRec.label);
+ else
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.label);
+ break;
+
+ case 44: // Plane Stress Linear Quadrilateral
+ case 54: // Plane Strain Linear Quadrilateral
+ case 64: // Plate Linear Quadrilateral
+ case 71: // Membrane Linear Quadrilateral
+ case 84: // Axisymetric Solid Linear Quadrilateral
+ case 94: // Thin Shell Linear Quadrilateral
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aRec.node_labels[3],
+ aRec.label);
+ break;
+
+ case 45: // Plane Stress Parabolic Quadrilateral
+ case 55: // Plane Strain Parabolic Quadrilateral
+ case 65: // Plate Parabolic Quadrilateral
+ case 75: // Membrane Parabolic Quadrilateral
+ case 85: // Axisymetric Solid Parabolic Quadrilateral
+ case 95: // Thin Shell Parabolic Quadrilateral
+ if ( aRec.node_labels.size() == 9 )
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[6],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[7],
+ aRec.node_labels[8],
+ aRec.label);
+ else
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[6],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[7],
+ aRec.label);
+ break;
+ }
+ }
+ else if(IsVolume(aRec.fe_descriptor_id)){
+ //MESSAGE("add volume " << aRec.label);
+ switch(aRec.fe_descriptor_id){
+
+ case 111: // Solid Linear Tetrahedron - TET4
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.label);
+ break;
+
+ case 118: // Solid Quadratic Tetrahedron - TET10
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
+
+ aRec.node_labels[9],
+
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
+
+ aRec.node_labels[6],
+ aRec.node_labels[8],
+ aRec.node_labels[7],
+ aRec.label);
+ break;
+
+ case 112: // Solid Linear Prism - PRISM6
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[4],
+ aRec.label);
+ break;
+
+ case 113: // Solid Quadratic Prism - PRISM15
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
+
+ aRec.node_labels[9],
+ aRec.node_labels[13],
+ aRec.node_labels[11],
+
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
+
+ aRec.node_labels[14],
+ aRec.node_labels[12],
+ aRec.node_labels[10],
+
+ aRec.node_labels[6],
+ aRec.node_labels[8],
+ aRec.node_labels[7],
+ aRec.label);
+ break;
+
+ case 115: // Solid Linear Brick - HEX8
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[3],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[4],
+ aRec.node_labels[7],
+ aRec.node_labels[6],
+ aRec.node_labels[5],
+ aRec.label);
+ break;
+
+ case 116: // Solid Quadratic Brick - HEX20
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
+
+ aRec.node_labels[12],
+ aRec.node_labels[18],
+ aRec.node_labels[16],
+ aRec.node_labels[14],
+
+ aRec.node_labels[7],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
+
+ aRec.node_labels[19],
+ aRec.node_labels[17],
+ aRec.node_labels[15],
+ aRec.node_labels[13],
+
+ aRec.node_labels[8],
+ aRec.node_labels[11],
+ aRec.node_labels[10],
+ aRec.node_labels[9],
+ aRec.label);
+ break;
+
+ case 114: // pyramid of 13 nodes (quadratic) - PIRA13
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
+ aRec.node_labels[7],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
+
+ aRec.node_labels[8],
+ aRec.node_labels[11],
+ aRec.node_labels[10],
+ aRec.node_labels[9],
+ aRec.node_labels[12],
+ aRec.label);
+ break;
+
+ }
+ }
+ if(!anElement)
+ MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aRec.label<<" and type = "<<aRec.fe_descriptor_id);