1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
20 // File: SMESH_MesherHelper.cxx
21 // Created: 15.02.06 15:22:41
22 // Author: Sergey KUUL
23 // Copyright: Open CASCADE 2006
26 #include "SMESH_MesherHelper.hxx"
28 #include "SMDS_FacePosition.hxx"
29 #include "SMDS_EdgePosition.hxx"
30 #include "SMESH_MeshEditor.hxx"
32 #include <BRepAdaptor_Surface.hxx>
33 #include <BRepTools.hxx>
34 #include <BRep_Tool.hxx>
35 #include <Geom2d_Curve.hxx>
36 #include <Geom_Curve.hxx>
37 #include <Geom_Surface.hxx>
38 #include <TopExp_Explorer.hxx>
39 #include <TopTools_MapOfShape.hxx>
40 #include <gp_Pnt2d.hxx>
41 #include <ShapeAnalysis.hxx>
43 //=======================================================================
44 //function : CheckShape
46 //=======================================================================
48 bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
50 SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
51 // we can create quadratic elements only if all elements
52 // created on subshapes of given shape are quadratic
53 // also we have to fill myNLinkNodeMap
54 myCreateQuadratic = true;
55 mySeamShapeIds.clear();
56 TopAbs_ShapeEnum subType( aSh.ShapeType()==TopAbs_FACE ? TopAbs_EDGE : TopAbs_FACE );
57 SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge );
59 TopExp_Explorer exp( aSh, subType );
60 for (; exp.More() && myCreateQuadratic; exp.Next()) {
61 if ( SMESHDS_SubMesh * subMesh = meshDS->MeshElements( exp.Current() )) {
62 if ( SMDS_ElemIteratorPtr it = subMesh->GetElements() ) {
64 const SMDS_MeshElement* e = it->next();
65 if ( e->GetType() != elemType || !e->IsQuadratic() ) {
66 myCreateQuadratic = false;
71 switch ( e->NbNodes() ) {
73 AddNLinkNode(e->GetNode(0),e->GetNode(1),e->GetNode(2)); break;
75 AddNLinkNode(e->GetNode(0),e->GetNode(1),e->GetNode(3));
76 AddNLinkNode(e->GetNode(1),e->GetNode(2),e->GetNode(4));
77 AddNLinkNode(e->GetNode(2),e->GetNode(0),e->GetNode(5)); break;
79 AddNLinkNode(e->GetNode(0),e->GetNode(1),e->GetNode(4));
80 AddNLinkNode(e->GetNode(1),e->GetNode(2),e->GetNode(5));
81 AddNLinkNode(e->GetNode(2),e->GetNode(3),e->GetNode(6));
82 AddNLinkNode(e->GetNode(3),e->GetNode(0),e->GetNode(7));
85 myCreateQuadratic = false;
94 if(!myCreateQuadratic) {
95 myNLinkNodeMap.clear();
100 return myCreateQuadratic;
103 //================================================================================
105 * \brief Set geomerty to make elements on
106 * \param aSh - geomertic shape
108 //================================================================================
110 void SMESH_MesherHelper::SetSubShape(const int aShID)
112 if ( aShID == myShapeID )
115 SetSubShape( GetMesh()->GetMeshDS()->IndexToShape( aShID ));
117 SetSubShape( TopoDS_Shape() );
120 //================================================================================
122 * \brief Set geomerty to make elements on
123 * \param aSh - geomertic shape
125 //================================================================================
127 void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
129 if ( !myShape.IsNull() && !aSh.IsNull() && myShape.IsSame( aSh ))
133 mySeamShapeIds.clear();
135 if ( myShape.IsNull() ) {
139 SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
140 myShapeID = meshDS->ShapeToIndex(aSh);
142 // treatment of periodic faces
143 if ( aSh.ShapeType() == TopAbs_FACE )
145 const TopoDS_Face& face = TopoDS::Face( aSh );
146 BRepAdaptor_Surface surface( face );
147 if ( surface.IsUPeriodic() || surface.IsVPeriodic() )
149 // look for a seam edge
150 for ( TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next()) {
151 const TopoDS_Edge& edge = TopoDS::Edge( exp.Current() );
152 if ( BRep_Tool::IsClosed( edge, face )) {
153 // initialize myPar1, myPar2 and myParIndex
154 if ( mySeamShapeIds.empty() ) {
156 BRep_Tool::UVPoints( edge, face, uv1, uv2 );
157 if ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Abs( uv1.Coord(2) - uv2.Coord(2) ))
159 myParIndex = 1; // U periodic
160 myPar1 = surface.FirstUParameter();
161 myPar2 = surface.LastUParameter();
164 myParIndex = 2; // V periodic
165 myPar1 = surface.FirstVParameter();
166 myPar2 = surface.LastVParameter();
169 // store shapes indices
170 mySeamShapeIds.insert( meshDS->ShapeToIndex( exp.Current() ));
171 for ( TopExp_Explorer v( exp.Current(), TopAbs_VERTEX ); v.More(); v.Next() )
172 mySeamShapeIds.insert( meshDS->ShapeToIndex( v.Current() ));
179 //================================================================================
181 * \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
182 * \param F - the face
183 * \retval bool - return true if the face is periodic
185 //================================================================================
187 bool SMESH_MesherHelper::GetNodeUVneedInFaceNode(const TopoDS_Face& F) const
189 if ( F.IsNull() ) return !mySeamShapeIds.empty();
191 if ( !F.IsNull() && !myShape.IsNull() && myShape.IsSame( F ))
192 return !mySeamShapeIds.empty();
194 Handle(Geom_Surface) aSurface = BRep_Tool::Surface( F );
195 if ( !aSurface.IsNull() )
196 return ( aSurface->IsUPeriodic() || aSurface->IsVPeriodic() );
201 //=======================================================================
202 //function : IsMedium
204 //=======================================================================
206 bool SMESH_MesherHelper::IsMedium(const SMDS_MeshNode* node,
207 const SMDSAbs_ElementType typeToCheck)
209 return SMESH_MeshEditor::IsMedium( node, typeToCheck );
212 //=======================================================================
213 //function : AddNLinkNode
215 //=======================================================================
217 * Auxilary function for filling myNLinkNodeMap
219 void SMESH_MesherHelper::AddNLinkNode(const SMDS_MeshNode* n1,
220 const SMDS_MeshNode* n2,
221 const SMDS_MeshNode* n12)
223 NLink link( n1, n2 );
224 if ( n1 > n2 ) link = NLink( n2, n1 );
225 // add new record to map
226 myNLinkNodeMap.insert( make_pair(link,n12));
229 //=======================================================================
231 * \brief Select UV on either of 2 pcurves of a seam edge, closest to the given UV
232 * \param uv1 - UV on the seam
233 * \param uv2 - UV within a face
234 * \retval gp_Pnt2d - selected UV
236 //=======================================================================
238 gp_Pnt2d SMESH_MesherHelper::GetUVOnSeam( const gp_Pnt2d& uv1, const gp_Pnt2d& uv2 ) const
240 double p1 = uv1.Coord( myParIndex );
241 double p2 = uv2.Coord( myParIndex );
242 double p3 = ( Abs( p1 - myPar1 ) < Abs( p1 - myPar2 )) ? myPar2 : myPar1;
243 if ( Abs( p2 - p1 ) > Abs( p2 - p3 ))
245 gp_Pnt2d result = uv1;
246 result.SetCoord( myParIndex, p1 );
250 //=======================================================================
252 * \brief Return node UV on face
253 * \param F - the face
254 * \param n - the node
255 * \param n2 - a node of element being created located inside a face
256 * \retval gp_XY - resulting UV
258 * Auxilary function called form GetMediumNode()
260 //=======================================================================
262 gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
263 const SMDS_MeshNode* n,
264 const SMDS_MeshNode* n2)
267 const SMDS_PositionPtr Pos = n->GetPosition();
268 if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE) {
269 // node has position on face
270 const SMDS_FacePosition* fpos =
271 static_cast<const SMDS_FacePosition*>(n->GetPosition().get());
272 uv = gp_Pnt2d(fpos->GetUParameter(),fpos->GetVParameter());
274 else if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE) {
275 // node has position on edge => it is needed to find
276 // corresponding edge from face, get pcurve for this
277 // edge and recieve value from this pcurve
278 const SMDS_EdgePosition* epos =
279 static_cast<const SMDS_EdgePosition*>(n->GetPosition().get());
280 SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
281 int edgeID = Pos->GetShapeId();
282 TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
285 Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
286 uv = C2d->Value( epos->GetUParameter() );
287 // for a node on a seam edge select one of UVs on 2 pcurves
288 if ( n2 && mySeamShapeIds.find( edgeID ) != mySeamShapeIds.end() )
289 uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
291 else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) {
292 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
293 int vertexID = n->GetPosition()->GetShapeId();
294 const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
295 uv = BRep_Tool::Parameters( V, F );
296 if ( n2 && mySeamShapeIds.find( vertexID ) != mySeamShapeIds.end() )
297 uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
302 //=======================================================================
304 * \brief Return node U on edge
305 * \param E - the Edge
306 * \param n - the node
307 * \retval double - resulting U
309 * Auxilary function called form GetMediumNode()
311 //=======================================================================
313 double SMESH_MesherHelper::GetNodeU(const TopoDS_Edge& E,
314 const SMDS_MeshNode* n)
317 const SMDS_PositionPtr Pos = n->GetPosition();
318 if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE) {
319 const SMDS_EdgePosition* epos =
320 static_cast<const SMDS_EdgePosition*>(n->GetPosition().get());
321 param = epos->GetUParameter();
323 else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) {
324 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
325 int vertexID = n->GetPosition()->GetShapeId();
326 const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
327 param = BRep_Tool::Parameter( V, E );
332 //=======================================================================
333 //function : GetMediumNode
335 //=======================================================================
337 * Special function for search or creation medium node
339 const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
340 const SMDS_MeshNode* n2,
343 TopAbs_ShapeEnum shapeType = myShape.IsNull() ? TopAbs_SHAPE : myShape.ShapeType();
345 NLink link(( n1 < n2 ? n1 : n2 ), ( n1 < n2 ? n2 : n1 ));
346 ItNLinkNode itLN = myNLinkNodeMap.find( link );
347 if ( itLN != myNLinkNodeMap.end() ) {
348 return (*itLN).second;
351 // create medium node
353 SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS();
354 int faceID = -1, edgeID = -1;
355 const SMDS_PositionPtr Pos1 = n1->GetPosition();
356 const SMDS_PositionPtr Pos2 = n2->GetPosition();
358 if( myShape.IsNull() )
360 if( Pos1->GetTypeOfPosition()==SMDS_TOP_FACE ) {
361 faceID = Pos1->GetShapeId();
363 else if( Pos2->GetTypeOfPosition()==SMDS_TOP_FACE ) {
364 faceID = Pos2->GetShapeId();
367 if( Pos1->GetTypeOfPosition()==SMDS_TOP_EDGE ) {
368 edgeID = Pos1->GetShapeId();
370 if( Pos2->GetTypeOfPosition()==SMDS_TOP_EDGE ) {
371 edgeID = Pos2->GetShapeId();
376 // we try to create medium node using UV parameters of
377 // nodes, else - medium between corresponding 3d points
378 if(faceID>-1 || shapeType == TopAbs_FACE) {
379 // obtaining a face and 2d points for nodes
381 if( myShape.IsNull() )
382 F = TopoDS::Face(meshDS->IndexToShape(faceID));
384 F = TopoDS::Face(myShape);
388 gp_XY p1 = GetNodeUV(F,n1,n2);
389 gp_XY p2 = GetNodeUV(F,n2,n1);
391 //checking if surface is periodic
392 Handle(Geom_Surface) S = BRep_Tool::Surface(F);
393 Standard_Real UF,UL,VF,VL;
394 S->Bounds(UF,UL,VF,VL);
397 Standard_Boolean isUPeriodic = S->IsUPeriodic();
399 Standard_Real UPeriod = S->UPeriod();
400 Standard_Real p2x = p2.X()+ShapeAnalysis::AdjustByPeriod(p2.X(),p1.X(),UPeriod);
401 Standard_Real pmid = (p1.X()+p2x)/2.;
402 u = pmid+ShapeAnalysis::AdjustToPeriod(pmid,UF,UL);
405 u= (p1.X()+p2.X())/2.;
407 Standard_Boolean isVPeriodic = S->IsVPeriodic();
409 Standard_Real VPeriod = S->VPeriod();
410 Standard_Real p2y = p2.Y()+ShapeAnalysis::AdjustByPeriod(p2.Y(),p1.Y(),VPeriod);
411 Standard_Real pmid = (p1.Y()+p2y)/2.;
412 v = pmid+ShapeAnalysis::AdjustToPeriod(pmid,VF,VL);
415 v = (p1.Y()+p2.Y())/2.;
417 gp_Pnt P = S->Value(u, v);
418 n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
419 meshDS->SetNodeOnFace(n12, faceID, u, v);
420 myNLinkNodeMap.insert(NLinkNodeMap::value_type(link,n12));
423 if (edgeID>-1 || shapeType == TopAbs_EDGE) {
426 if( myShape.IsNull() )
427 E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
429 E = TopoDS::Edge(myShape);
433 double p1 = GetNodeU(E,n1);
434 double p2 = GetNodeU(E,n2);
437 Handle(Geom_Curve) C = BRep_Tool::Curve(E, f, l);
440 Standard_Boolean isPeriodic = C->IsPeriodic();
443 Standard_Real Period = C->Period();
444 Standard_Real p = p2+ShapeAnalysis::AdjustByPeriod(p2,p1,Period);
445 Standard_Real pmid = (p1+p)/2.;
446 u = pmid+ShapeAnalysis::AdjustToPeriod(pmid,C->FirstParameter(),C->LastParameter());
451 gp_Pnt P = C->Value( u );
452 n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
453 meshDS->SetNodeOnEdge(n12, edgeID, u);
454 myNLinkNodeMap.insert(NLinkNodeMap::value_type(link,n12));
460 double x = ( n1->X() + n2->X() )/2.;
461 double y = ( n1->Y() + n2->Y() )/2.;
462 double z = ( n1->Z() + n2->Z() )/2.;
463 n12 = meshDS->AddNode(x,y,z);
465 meshDS->SetNodeOnEdge(n12, edgeID);
467 meshDS->SetNodeOnFace(n12, faceID);
469 meshDS->SetNodeInVolume(n12, myShapeID);
470 myNLinkNodeMap.insert(NLinkNodeMap::value_type(link,n12));
475 //=======================================================================
476 //function : AddQuadraticEdge
478 //=======================================================================
480 * Special function for creation quadratic edge
482 SMDS_QuadraticEdge* SMESH_MesherHelper::AddQuadraticEdge(const SMDS_MeshNode* n1,
483 const SMDS_MeshNode* n2,
487 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
489 const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
491 myCreateQuadratic = true;
494 return (SMDS_QuadraticEdge*)(meshDS->AddEdgeWithID(n1, n2, n12, id));
496 return (SMDS_QuadraticEdge*)(meshDS->AddEdge(n1, n2, n12));
499 //=======================================================================
502 //=======================================================================
504 * Special function for creation quadratic triangle
506 SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
507 const SMDS_MeshNode* n2,
508 const SMDS_MeshNode* n3,
512 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
513 if(!myCreateQuadratic) {
515 return meshDS->AddFaceWithID(n1, n2, n3, id);
517 return meshDS->AddFace(n1, n2, n3);
520 const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
521 const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
522 const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
525 return meshDS->AddFaceWithID(n1, n2, n3, n12, n23, n31, id);
527 return meshDS->AddFace(n1, n2, n3, n12, n23, n31);
531 //=======================================================================
534 //=======================================================================
536 * Special function for creation quadratic quadrangle
538 SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
539 const SMDS_MeshNode* n2,
540 const SMDS_MeshNode* n3,
541 const SMDS_MeshNode* n4,
545 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
546 if(!myCreateQuadratic) {
548 return meshDS->AddFaceWithID(n1, n2, n3, n4, id);
550 return meshDS->AddFace(n1, n2, n3, n4);
553 const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
554 const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
555 const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
556 const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
559 return meshDS->AddFaceWithID(n1, n2, n3, n4, n12, n23, n34, n41, id);
561 return meshDS->AddFace(n1, n2, n3, n4, n12, n23, n34, n41);
565 //=======================================================================
566 //function : AddVolume
568 //=======================================================================
570 * Special function for creation quadratic volume
572 SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
573 const SMDS_MeshNode* n2,
574 const SMDS_MeshNode* n3,
575 const SMDS_MeshNode* n4,
576 const SMDS_MeshNode* n5,
577 const SMDS_MeshNode* n6,
581 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
582 if(!myCreateQuadratic) {
584 return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, id);
586 return meshDS->AddVolume(n1, n2, n3, n4, n5, n6);
589 const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
590 const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
591 const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
593 const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
594 const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
595 const SMDS_MeshNode* n64 = GetMediumNode(n6,n4,force3d);
597 const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
598 const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
599 const SMDS_MeshNode* n36 = GetMediumNode(n3,n6,force3d);
602 return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
603 n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
605 return meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
606 n12, n23, n31, n45, n56, n64, n14, n25, n36);
610 //=======================================================================
611 //function : AddVolume
613 //=======================================================================
615 * Special function for creation quadratic volume
617 SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
618 const SMDS_MeshNode* n2,
619 const SMDS_MeshNode* n3,
620 const SMDS_MeshNode* n4,
624 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
625 if(!myCreateQuadratic) {
627 return meshDS->AddVolumeWithID(n1, n2, n3, n4, id);
629 return meshDS->AddVolume(n1, n2, n3, n4);
632 const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
633 const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
634 const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
636 const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
637 const SMDS_MeshNode* n24 = GetMediumNode(n2,n4,force3d);
638 const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
641 return meshDS->AddVolumeWithID(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34, id);
643 return meshDS->AddVolume(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34);
647 //=======================================================================
648 //function : AddVolume
650 //=======================================================================
652 * Special function for creation quadratic volume
654 SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
655 const SMDS_MeshNode* n2,
656 const SMDS_MeshNode* n3,
657 const SMDS_MeshNode* n4,
658 const SMDS_MeshNode* n5,
659 const SMDS_MeshNode* n6,
660 const SMDS_MeshNode* n7,
661 const SMDS_MeshNode* n8,
665 SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS();
666 if(!myCreateQuadratic) {
668 return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, id);
670 return meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
673 const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
674 const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
675 const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
676 const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
678 const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
679 const SMDS_MeshNode* n67 = GetMediumNode(n6,n7,force3d);
680 const SMDS_MeshNode* n78 = GetMediumNode(n7,n8,force3d);
681 const SMDS_MeshNode* n85 = GetMediumNode(n8,n5,force3d);
683 const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
684 const SMDS_MeshNode* n26 = GetMediumNode(n2,n6,force3d);
685 const SMDS_MeshNode* n37 = GetMediumNode(n3,n7,force3d);
686 const SMDS_MeshNode* n48 = GetMediumNode(n4,n8,force3d);
689 return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8,
690 n12, n23, n34, n41, n56, n67,
691 n78, n85, n15, n26, n37, n48, id);
693 return meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8,
694 n12, n23, n34, n41, n56, n67,
695 n78, n85, n15, n26, n37, n48);