- if (NbNodes == 3) {
- elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2]);
- }
- else if (NbNodes == 4) {
- elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3]);
- }
- else if (NbNodes == 6) {
- elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
- nodes[4], nodes[5]);
- }
- else if (NbNodes == 8) {
- elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
- nodes[4], nodes[5], nodes[6], nodes[7]);
- }
- else if (NbNodes == 9) {
- elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
- nodes[4], nodes[5], nodes[6], nodes[7], nodes[8] );
- }
- else if (NbNodes > 2) {
- elem = getMeshDS()->AddPolygonalFace(nodes);
+ switch (NbNodes) {
+ case 3: elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2]); break;
+ case 4: elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3]); break;
+ case 6: elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
+ nodes[4], nodes[5]); break;
+ case 7: elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
+ nodes[4], nodes[5], nodes[6]); break;
+ case 8: elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
+ nodes[4], nodes[5], nodes[6], nodes[7]); break;
+ case 9: elem = getMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
+ nodes[4], nodes[5], nodes[6], nodes[7],
+ nodes[8] ); break;
+ default: elem = getMeshDS()->AddPolygonalFace(nodes);