// N3 +----+----+ N5 +----+----+
// | |11 | | | |
// | | | | | | Central nodes
-// | +13 | QUADRATIC | 17 + | of bi-quadratic
+// | +13 | QUADRATIC | 16 + | of bi-quadratic
// | | | PENTAHEDRON | + | + | PENTAHEDRON
-// 12+ | +14 + | 16 +
+// 12+ | +14 + | 17 +
// | | | | 18| |
// | | | | | |
// | + N1 | | + |
static int BiQuadPenta_F[5][9] = { // FORWARD
{ 0, 6, 1, 7, 2, 8, 0, 0, 0 },
{ 3, 11,5, 10,4, 9, 3, 3, 3 },
- { 0, 12,3, 9, 4, 13,1, 6, 17}, //!
- { 1, 13,4, 10,5, 14,2, 7, 16}, //!
+ { 0, 12,3, 9, 4, 13,1, 6, 16}, //!
+ { 1, 13,4, 10,5, 14,2, 7, 17}, //!
{ 0, 8, 2, 14,5, 11,3, 12,18} }; //!
static int BiQuadPenta_RE[5][9] = { // REVERSED -> EXTERNAL
{ 0, 8, 2, 7, 1, 6, 0, 0, 0 },
return faceIndex + 19;
}
}
+ else if (myAllFacesNbNodes && myVolumeNodes.size() == 18) // element with 18 nodes
+ {
+ switch (faceIndex) {
+ case 2: return 15;
+ case 3: return 16;
+ case 4: return 17;
+ default:
+ return -2;
+ }
+ }
return -1;
}
{
if ( !myAllFacesNodeIndices_F )
{
- //std::cout << myVolumeNodes.size() << std::endl;
// choose data for an element type
switch ( myVolumeNodes.size() ) {
case 4:
void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theToBiQuad)
{
- /*
- // remove medium nodes
- for ( size_t i = nbCornerNodes; i < nodes.size(); ++i )
- if ( nodes[i]->NbInverseElements() == 0 )
- meshDS->RemoveFreeNode( nodes[i], theSm );
- */
//MESSAGE("ConvertToQuadratic "<< theForce3d << " " << theToBiQuad);
SMESHDS_Mesh* meshDS = GetMeshDS();
if (iQuad)
for ( inode = 1; inode < nbFaceNodes; inode += 2)
nodes.push_back( nn[inode] ); // add medium nodes
+
+ // for triangle face for Penta18 (BiQuadratic pentahedron) return -2
+ // because we haven't center node on triangle side, but it's need for create biquadratic face
int iCenter = vTool.GetCenterNodeIndex(iface); // for HEX27
- if ( iCenter > 0 )
- nodes.push_back( vTool.GetNodes()[ iCenter ] );
- if (const SMDS_MeshElement * f = aMesh->FindElement( nodes,
- SMDSAbs_Face, /*noMedium=*/false ))
- presentBndElems.push_back( f );
+ // for triangle faces for Penta18 (BiQuadratic pentahedron) firstly check, exist face or not
+ // if not - create node in middle face
+ if (iCenter == -2)
+ {
+ SMDS_ElemIteratorPtr itF = nodes[0]->GetInverseElementIterator(SMDSAbs_Face);
+ bool isFound = false;
+ while (itF->more())
+ {
+ const SMDS_MeshElement* e = itF->next();
+ int nbNodesToCheck = e->NbNodes();
+ if (nbNodesToCheck == (int)nodes.size() + 1)
+ {
+ for (size_t i = 1; e && i < nodes.size() - 1; ++i)
+ {
+ int nodeIndex = e->GetNodeIndex(nodes[i]);
+ if (nodeIndex < 0 || nodeIndex >= nbNodesToCheck)
+ e = 0;
+ }
+ if (e)
+ {
+ presentBndElems.push_back(e);
+ isFound = true;
+ }
+ }
+ }
+
+ if (!isFound)
+ {
+ SMESH_MesherHelper aHelper(*myMesh);
+ double bc[3];
+ vTool.GetFaceBaryCenter(iface, bc[0], bc[1], bc[2]);
+ auto aNodeC = aHelper.AddNode(bc[0], bc[1], bc[2]);
+ nodes.push_back(aNodeC);
+ missingBndElems.push_back(nodes);
+ }
+ }
else
- missingBndElems.push_back( nodes );
+ {
+ if (iCenter > 0)
+ nodes.push_back(vTool.GetNodes()[iCenter]);
+
+ if (const SMDS_MeshElement* f = aMesh->FindElement(nodes,
+ SMDSAbs_Face, /*noMedium=*/false))
+ presentBndElems.push_back(f);
+ else
+ missingBndElems.push_back(nodes);
+ }
if ( targetMesh != myMesh )
{