- // load grid
- TParam2ColumnMap u2nodesMap;
- if ( !helper.LoadNodeColumns( u2nodesMap, F, baseE, meshDS, proxymesh.get() ))
- {
- SMESH_ComputeErrorPtr err = ComputePentahedralMesh(aMesh, aShape, proxymesh.get());
- return error( err );
- }
- // store u2nodesMap
- if ( iE == 0 )
- {
- aCubeSide[i]._u2nodesMap.swap( u2nodesMap );
- }
- else // unite 2 maps
- {
- if ( eOri[0] == eOri[iE] )
- append( aCubeSide[i]._u2nodesMap, u2nodesMap.begin(), u2nodesMap.end());
- else
- append( aCubeSide[i]._u2nodesMap, u2nodesMap.rbegin(), u2nodesMap.rend());
- }
+ // load grid
+ bool ok =
+ helper.LoadNodeColumns( aCubeSide[i]._u2nodesMap, F, baseEdges, meshDS, proxymesh.get());
+ if ( ok )
+ {
+ // check if the loaded grid corresponds to nb of quadrangles on the FACE
+ const SMESHDS_SubMesh* faceSubMesh =
+ proxymesh ? proxymesh->GetSubMesh( F ) : meshDS->MeshElements( F );
+ const int nbQuads = faceSubMesh->NbElements();
+ const int nbHor = aCubeSide[i]._u2nodesMap.size() - 1;
+ const int nbVer = aCubeSide[i]._u2nodesMap.begin()->second.size() - 1;
+ ok = ( nbQuads == nbHor * nbVer );