0022100: EDF 2413 SMESH: Take into account TRIA7

-  void SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Shell & S);
+  void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Shell & S);

-  void MoveNode(const SMDS_MeshNode *, double x, double y, double z);
+  virtual void MoveNode(const SMDS_MeshNode *, double x, double y, double z);

+  // biquadratic triangle of 7 nodes
+  virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
+                                       int n12,int n23,int n31, int nCenter, int ID);
This commit is contained in:
eap 2013-05-16 16:32:39 +00:00
parent 6cc3a49ea9
commit 30c56009c3
2 changed files with 112 additions and 36 deletions

View File

@ -202,10 +202,10 @@ SMDS_MeshNode* SMESHDS_Mesh::AddNodeWithID(double x, double y, double z, int ID)
//function : MoveNode //function : MoveNode
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::MoveNode(const SMDS_MeshNode *n, double x, double y, double z) void SMESHDS_Mesh::MoveNode(const SMDS_MeshNode *n, double x, double y, double z)
{ {
SMDS_MeshNode * node=const_cast<SMDS_MeshNode*>(n); SMDS_Mesh::MoveNode( n, x, y, z );
node->setXYZ(x,y,z);
myScript->MoveNode(n->GetID(), x, y, z); myScript->MoveNode(n->GetID(), x, y, z);
} }
@ -1070,58 +1070,63 @@ bool SMESHDS_Mesh::add(const SMDS_MeshElement* elem, SMESHDS_SubMesh* subMesh )
//function : SetNodeOnVolume //function : SetNodeOnVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode* aNode,
const TopoDS_Shell & S) const TopoDS_Shell & S)
{ {
if ( add( aNode, getSubmesh(S) )) if ( add( aNode, getSubmesh(S) ))
aNode->SetPosition ( SMDS_SpacePosition::originSpacePosition() ); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition( SMDS_SpacePosition::originSpacePosition() );
} }
//======================================================================= //=======================================================================
//function : SetNodeOnVolume //function : SetNodeOnVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode * aNode,
const TopoDS_Solid & S) const TopoDS_Solid & S)
{ {
if ( add( aNode, getSubmesh(S) )) if ( add( aNode, getSubmesh(S) ))
aNode->SetPosition ( SMDS_SpacePosition::originSpacePosition() ); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition( SMDS_SpacePosition::originSpacePosition() );
} }
//======================================================================= //=======================================================================
//function : SetNodeOnFace //function : SetNodeOnFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeOnFace(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeOnFace(const SMDS_MeshNode * aNode,
const TopoDS_Face & S, const TopoDS_Face & S,
double u, double u,
double v) double v)
{ {
if ( add( aNode, getSubmesh(S) )) if ( add( aNode, getSubmesh(S) ))
aNode->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition( u, v))); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition( u, v)));
} }
//======================================================================= //=======================================================================
//function : SetNodeOnEdge //function : SetNodeOnEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeOnEdge(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeOnEdge(const SMDS_MeshNode * aNode,
const TopoDS_Edge & S, const TopoDS_Edge & S,
double u) double u)
{ {
if ( add( aNode, getSubmesh(S) )) if ( add( aNode, getSubmesh(S) ))
aNode->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(u))); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(u)));
} }
//======================================================================= //=======================================================================
//function : SetNodeOnVertex //function : SetNodeOnVertex
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeOnVertex(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeOnVertex(const SMDS_MeshNode * aNode,
const TopoDS_Vertex & S) const TopoDS_Vertex & S)
{ {
if ( add( aNode, getSubmesh(S) )) if ( add( aNode, getSubmesh(S) ))
aNode->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition())); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition()));
} }
//======================================================================= //=======================================================================
@ -1414,35 +1419,38 @@ void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode* aNode, int Index)
//function : SetNodeOnFace //function : SetNodeOnFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeOnFace(SMDS_MeshNode* aNode, int Index, double u, double v) void SMESHDS_Mesh::SetNodeOnFace(const SMDS_MeshNode* aNode, int Index, double u, double v)
{ {
//Set Position on Node //Set Position on Node
if ( add( aNode, getSubmesh( Index ))) if ( add( aNode, getSubmesh( Index )))
aNode->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition( u, v))); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition( u, v)));
} }
//======================================================================= //=======================================================================
//function : SetNodeOnEdge //function : SetNodeOnEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeOnEdge(SMDS_MeshNode* aNode, void SMESHDS_Mesh::SetNodeOnEdge(const SMDS_MeshNode* aNode,
int Index, int Index,
double u) double u)
{ {
//Set Position on Node //Set Position on Node
if ( add( aNode, getSubmesh( Index ))) if ( add( aNode, getSubmesh( Index )))
aNode->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(u))); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(u)));
} }
//======================================================================= //=======================================================================
//function : SetNodeOnVertex //function : SetNodeOnVertex
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::SetNodeOnVertex(SMDS_MeshNode* aNode, int Index) void SMESHDS_Mesh::SetNodeOnVertex(const SMDS_MeshNode* aNode, int Index)
{ {
//Set Position on Node //Set Position on Node
if ( add( aNode, getSubmesh( Index ))) if ( add( aNode, getSubmesh( Index )))
aNode->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition())); const_cast< SMDS_MeshNode* >
( aNode )->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition()));
} }
//======================================================================= //=======================================================================
@ -1568,6 +1576,56 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
ID); ID);
} }
//=======================================================================
//function : AddFace
//purpose :
//=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n12,n23,n31,nCenter);
if(anElem) myScript->AddFace(anElem->GetID(),
n1->GetID(), n2->GetID(), n3->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(),
nCenter->GetID());
return anElem;
}
//=======================================================================
//function : AddFaceWithID
//purpose :
//=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3,
int n12,int n23,int n31, int nCenter, int ID)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,nCenter,ID);
if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31,nCenter);
return anElem;
}
//=======================================================================
//function : AddFaceWithID
//purpose :
//=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
int ID)
{
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(),
nCenter->GetID(), ID);
}
//======================================================================= //=======================================================================
//function : AddFace //function : AddFace

View File

@ -138,6 +138,25 @@ public:
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31); const SMDS_MeshNode * n31);
// biquadratic triangle of 7 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
int n12,int n23,int n31, int nCenter, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter);
// 2d order quadrangle // 2d order quadrangle
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n34,int n41, int ID); int n12,int n23,int n34,int n41, int ID);
@ -159,7 +178,7 @@ public:
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41); const SMDS_MeshNode * n41);
// bi-quadratic quadrangle of 9 nodes // biquadratic quadrangle of 9 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n34,int n41, int nCenter, int ID); int n12,int n23,int n34,int n41, int nCenter, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
@ -502,7 +521,7 @@ public:
(const std::vector<const SMDS_MeshNode*>& nodes, (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void MoveNode(const SMDS_MeshNode *, double x, double y, double z); virtual void MoveNode(const SMDS_MeshNode *, double x, double y, double z);
virtual void RemoveNode(const SMDS_MeshNode *); virtual void RemoveNode(const SMDS_MeshNode *);
void RemoveElement(const SMDS_MeshElement *); void RemoveElement(const SMDS_MeshElement *);
@ -526,22 +545,26 @@ public:
bool ModifyCellNodes(int smdsVolId, std::map<int,int> localClonedNodeIds); bool ModifyCellNodes(int smdsVolId, std::map<int,int> localClonedNodeIds);
void Renumber (const bool isNodes, const int startID=1, const int deltaID=1); void Renumber (const bool isNodes, const int startID=1, const int deltaID=1);
void SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Shell & S); void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Shell & S);
void SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Solid & S); void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Solid & S);
void SetNodeOnFace(SMDS_MeshNode * aNode, const TopoDS_Face & S, double u=0., double v=0.); void SetNodeOnFace (const SMDS_MeshNode * aNode, const TopoDS_Face& S, double u=0.,double v=0.);
void SetNodeOnEdge(SMDS_MeshNode * aNode, const TopoDS_Edge & S, double u=0.); void SetNodeOnEdge (const SMDS_MeshNode * aNode, const TopoDS_Edge& S, double u=0.);
void SetNodeOnVertex(SMDS_MeshNode * aNode, const TopoDS_Vertex & S); void SetNodeOnVertex(const SMDS_MeshNode * aNode, const TopoDS_Vertex & S);
void UnSetNodeOnShape(const SMDS_MeshNode * aNode); void UnSetNodeOnShape(const SMDS_MeshNode * aNode);
void SetMeshElementOnShape(const SMDS_MeshElement * anElt, void SetMeshElementOnShape (const SMDS_MeshElement * anElt, const TopoDS_Shape & S);
const TopoDS_Shape & S); void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt, const TopoDS_Shape & S);
void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt, void SetNodeInVolume(const SMDS_MeshNode * aNode, int Index);
const TopoDS_Shape & S); void SetNodeOnFace (const SMDS_MeshNode * aNode, int Index, double u=0., double v=0.);
void SetNodeOnEdge (const SMDS_MeshNode * aNode, int Index, double u=0.);
void SetNodeOnVertex(const SMDS_MeshNode * aNode, int Index);
void SetMeshElementOnShape(const SMDS_MeshElement * anElt, int Index);
bool HasMeshElements(const TopoDS_Shape & S) const; bool HasMeshElements(const TopoDS_Shape & S) const;
SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const; SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const;
SMESHDS_SubMesh * MeshElements(const int Index) const; SMESHDS_SubMesh * MeshElements(const int Index) const;
std::list<int> SubMeshIndices() const; std::list<int> SubMeshIndices() const;
const std::map<int,SMESHDS_SubMesh*>& SubMeshes() const const std::map<int,SMESHDS_SubMesh*>& SubMeshes() const
{ return myShapeIndexToSubMesh; } { return myShapeIndexToSubMesh; }
const TopoDS_Shape& GetCurrentSubShape() const { return myCurSubShape; }
bool HasHypothesis(const TopoDS_Shape & S); bool HasHypothesis(const TopoDS_Shape & S);
const std::list<const SMESHDS_Hypothesis*>& GetHypothesis(const TopoDS_Shape & S) const; const std::list<const SMESHDS_Hypothesis*>& GetHypothesis(const TopoDS_Shape & S) const;
@ -555,11 +578,6 @@ public:
SMESHDS_SubMesh * NewSubMesh(int Index); SMESHDS_SubMesh * NewSubMesh(int Index);
int AddCompoundSubmesh(const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE); int AddCompoundSubmesh(const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE);
void SetNodeInVolume(const SMDS_MeshNode * aNode, int Index);
void SetNodeOnFace(SMDS_MeshNode * aNode, int Index , double u=0., double v=0.);
void SetNodeOnEdge(SMDS_MeshNode * aNode, int Index , double u=0.);
void SetNodeOnVertex(SMDS_MeshNode * aNode, int Index);
void SetMeshElementOnShape(const SMDS_MeshElement * anElt, int Index);
// Groups. SMESHDS_Mesh is not an owner of groups // Groups. SMESHDS_Mesh is not an owner of groups
void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(theGroup); } void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(theGroup); }