2010-05-14 21:32:37 +06:00
|
|
|
// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2.1 of the License.
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
2010-05-14 21:32:37 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH StdMeshers : implementaion of SMESH idl descriptions
|
2004-12-17 16:07:35 +05:00
|
|
|
// File : StdMeshers_Penta_3D.hxx
|
|
|
|
// Module : SMESH
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2004-12-17 16:07:35 +05:00
|
|
|
#ifndef StdMeshers_Penta_3D_HeaderFile
|
|
|
|
#define StdMeshers_Penta_3D_HeaderFile
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
#include "SMESH_StdMeshers.hxx"
|
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// class StdMeshers_SMESHBlock
|
|
|
|
//
|
2005-02-01 13:00:03 +05:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
2004-12-17 16:07:35 +05:00
|
|
|
#include <gp_Pnt.hxx>
|
|
|
|
#include <gp_XYZ.hxx>
|
|
|
|
#include <TopoDS_Vertex.hxx>
|
|
|
|
#include <TopoDS_Shell.hxx>
|
|
|
|
#include <TopTools_IndexedMapOfOrientedShape.hxx>
|
2006-03-13 20:29:49 +05:00
|
|
|
#include <TColStd_MapOfInteger.hxx>
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
#include "SMESH_Block.hxx"
|
2008-03-07 12:47:05 +05:00
|
|
|
#include "SMESH_ComputeError.hxx"
|
2006-05-06 14:51:48 +06:00
|
|
|
#include "SMESH_MesherHelper.hxx"
|
2009-06-29 19:26:16 +06:00
|
|
|
#include "SMESH_3D_Algo.hxx"
|
2006-03-13 20:29:49 +05:00
|
|
|
|
2005-02-01 13:00:03 +05:00
|
|
|
typedef std::map< double, std::vector<const SMDS_MeshNode*> > StdMeshers_IJNodeMap;
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class STDMESHERS_EXPORT StdMeshers_SMESHBlock {
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
public:
|
|
|
|
//
|
|
|
|
StdMeshers_SMESHBlock();
|
|
|
|
|
|
|
|
void Load (const TopoDS_Shell& theShell);
|
|
|
|
|
|
|
|
void Load (const TopoDS_Shell& theShell,
|
2009-12-10 19:52:59 +05:00
|
|
|
const TopoDS_Vertex& theV000,
|
|
|
|
const TopoDS_Vertex& theV001);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
void ComputeParameters(const gp_Pnt& thePnt,
|
2009-12-10 19:52:59 +05:00
|
|
|
gp_XYZ& theXYZ);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
void ComputeParameters(const gp_Pnt& thePnt,
|
2009-12-10 19:52:59 +05:00
|
|
|
const TopoDS_Shape& theShape,
|
|
|
|
gp_XYZ& theXYZ);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
2005-02-01 13:00:03 +05:00
|
|
|
void ComputeParameters(const double& theU,
|
2009-12-10 19:52:59 +05:00
|
|
|
const TopoDS_Shape& theShape,
|
|
|
|
gp_XYZ& theXYZ);
|
2005-02-01 13:00:03 +05:00
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
void Point(const gp_XYZ& theParams,
|
2009-12-10 19:52:59 +05:00
|
|
|
gp_Pnt& thePnt);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
void Point(const gp_XYZ& theParams,
|
2009-12-10 19:52:59 +05:00
|
|
|
const TopoDS_Shape& theShape,
|
|
|
|
gp_Pnt& thePnt);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
int ShapeID(const TopoDS_Shape& theShape);
|
|
|
|
|
|
|
|
const TopoDS_Shape& Shape(const int theID);
|
2005-02-01 13:00:03 +05:00
|
|
|
|
|
|
|
SMESH_Block & Block() { return myTBlock; }
|
|
|
|
|
|
|
|
bool IsForwadEdge(const int theEdgeID);
|
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
int ErrorStatus() const;
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
SMESH_ComputeErrorPtr GetError() const;
|
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
TopoDS_Shell myShell;
|
|
|
|
TopTools_IndexedMapOfOrientedShape myShapeIDMap;
|
|
|
|
SMESH_Block myTBlock;
|
|
|
|
TopoDS_Shape myEmptyShape;
|
2009-02-17 10:27:49 +05:00
|
|
|
std::vector<int> myIsEdgeForward;
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
|
|
|
int myErrorStatus;
|
|
|
|
};
|
2005-02-01 13:00:03 +05:00
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// class StdMeshers_TNode
|
|
|
|
//
|
2005-02-01 13:00:03 +05:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
2004-12-17 16:07:35 +05:00
|
|
|
#include "SMDS_MeshNode.hxx"
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class STDMESHERS_EXPORT StdMeshers_TNode {
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
StdMeshers_TNode(){
|
|
|
|
myNode=NULL;
|
|
|
|
myXYZ.SetCoord(99., 99., 99.);
|
|
|
|
myShapeSupportID=-1;
|
|
|
|
myBaseNodeID=-1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetNode(const SMDS_MeshNode* theNode) {
|
|
|
|
myNode=(SMDS_MeshNode*) theNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
const SMDS_MeshNode* Node()const {
|
|
|
|
return myNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetShapeSupportID (const int theID) {
|
|
|
|
myShapeSupportID=theID;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ShapeSupportID()const {
|
|
|
|
return myShapeSupportID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetNormCoord (const gp_XYZ& theXYZ) {
|
|
|
|
myXYZ=theXYZ;
|
|
|
|
}
|
|
|
|
|
|
|
|
const gp_XYZ& NormCoord ()const{
|
|
|
|
return myXYZ;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetBaseNodeID (const int theID) {
|
|
|
|
myBaseNodeID=theID;
|
|
|
|
}
|
|
|
|
|
|
|
|
int BaseNodeID ()const{
|
|
|
|
return myBaseNodeID;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SMDS_MeshNode* myNode;
|
|
|
|
int myShapeSupportID;
|
|
|
|
gp_XYZ myXYZ;
|
|
|
|
int myBaseNodeID;
|
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// class StdMeshers_Penta_3D
|
|
|
|
//
|
2005-02-01 13:00:03 +05:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
2004-12-17 16:07:35 +05:00
|
|
|
#include "SMESH_Mesh.hxx"
|
|
|
|
#include <TopoDS_Shape.hxx>
|
|
|
|
//
|
2008-03-07 12:47:05 +05:00
|
|
|
class STDMESHERS_EXPORT StdMeshers_Penta_3D {
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
|
|
|
public: // methods
|
|
|
|
StdMeshers_Penta_3D();
|
|
|
|
|
2006-03-13 20:29:49 +05:00
|
|
|
~StdMeshers_Penta_3D();
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
bool Compute(SMESH_Mesh& , const TopoDS_Shape& );
|
|
|
|
|
|
|
|
int ErrorStatus() const {
|
2008-03-07 12:47:05 +05:00
|
|
|
if (myErrorStatus->IsOK())
|
|
|
|
return 0;
|
|
|
|
return myErrorStatus->myName;
|
|
|
|
}
|
|
|
|
|
|
|
|
SMESH_ComputeErrorPtr GetComputeError() const {
|
2004-12-17 16:07:35 +05:00
|
|
|
return myErrorStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetTolerance(const double theTol3D) {
|
|
|
|
myTol3D=theTol3D;
|
|
|
|
}
|
|
|
|
|
|
|
|
double Tolerance() const {
|
|
|
|
return myTol3D;
|
|
|
|
}
|
2005-02-01 13:00:03 +05:00
|
|
|
|
2006-03-13 20:29:49 +05:00
|
|
|
bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
|
|
|
|
const TopoDS_Face& theFace,
|
|
|
|
const TopoDS_Edge& theBaseEdge,
|
|
|
|
SMESHDS_Mesh* theMesh);
|
2005-02-01 13:00:03 +05:00
|
|
|
// Load nodes bound to theFace into column (vectors) and rows
|
|
|
|
// of theIJNodes.
|
|
|
|
// The value of theIJNodes map is a vector of ordered nodes so
|
|
|
|
// that the 0-the one lies on theBaseEdge.
|
|
|
|
// The key of theIJNodes map is a normalized parameter of each
|
|
|
|
// 0-the node on theBaseEdge.
|
|
|
|
|
2009-06-29 19:26:16 +06:00
|
|
|
bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
|
2009-12-10 19:52:59 +05:00
|
|
|
MapShapeNbElems& aResMap);
|
2009-06-29 19:26:16 +06:00
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
protected: // methods
|
|
|
|
|
|
|
|
void CheckData();
|
|
|
|
|
|
|
|
void MakeBlock();
|
|
|
|
|
|
|
|
void MakeNodes();
|
|
|
|
|
2005-02-01 13:00:03 +05:00
|
|
|
double SetHorizEdgeXYZ(const gp_XYZ& aBNXYZ,
|
|
|
|
const int aFaceID,
|
2009-02-17 10:27:49 +05:00
|
|
|
std::vector<const SMDS_MeshNode*>*& aCol1,
|
|
|
|
std::vector<const SMDS_MeshNode*>*& aCol2);
|
2005-02-01 13:00:03 +05:00
|
|
|
|
2004-12-17 16:07:35 +05:00
|
|
|
void ShapeSupportID(const bool theIsUpperLayer,
|
2009-12-10 19:52:59 +05:00
|
|
|
const SMESH_Block::TShapeID theBNSSID,
|
|
|
|
SMESH_Block::TShapeID& theSSID);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
void FindNodeOnShape(const TopoDS_Shape& aS,
|
2009-12-10 19:52:59 +05:00
|
|
|
const gp_XYZ& aParams,
|
2005-02-01 13:00:03 +05:00
|
|
|
const int z,
|
2009-12-10 19:52:59 +05:00
|
|
|
StdMeshers_TNode& aTN);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
void CreateNode(const bool theIsUpperLayer,
|
2009-12-10 19:52:59 +05:00
|
|
|
const gp_XYZ& aParams,
|
|
|
|
StdMeshers_TNode& aTN);
|
2004-12-17 16:07:35 +05:00
|
|
|
|
|
|
|
void ClearMeshOnFxy1();
|
|
|
|
|
|
|
|
void MakeMeshOnFxy1();
|
|
|
|
|
|
|
|
void MakeConnectingMap();
|
|
|
|
|
|
|
|
int GetIndexOnLayer(const int aID);
|
|
|
|
|
|
|
|
void MakeVolumeMesh();
|
|
|
|
|
|
|
|
void SetMesh(SMESH_Mesh& theMesh) {
|
|
|
|
myMesh=(void *)&theMesh;
|
|
|
|
}
|
|
|
|
|
|
|
|
SMESH_Mesh* GetMesh()const {
|
|
|
|
return (SMESH_Mesh*)myMesh;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected: // fields
|
2005-02-01 13:00:03 +05:00
|
|
|
TopoDS_Shape myShape;
|
|
|
|
StdMeshers_SMESHBlock myBlock;
|
|
|
|
void * myMesh;
|
2008-03-07 12:47:05 +05:00
|
|
|
SMESH_ComputeErrorPtr myErrorStatus;
|
2004-12-17 16:07:35 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
std::vector <StdMeshers_TNode> myTNodes;
|
2005-02-01 13:00:03 +05:00
|
|
|
int myISize;
|
|
|
|
int myJSize;
|
|
|
|
double myTol3D; // Tolerance value
|
|
|
|
std::map < int, int > myConnectingMap;
|
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
std::vector<StdMeshers_IJNodeMap> myWallNodesMaps; // nodes on a face
|
|
|
|
std::vector<gp_XYZ> myShapeXYZ; // point on each sub-shape
|
2006-03-13 20:29:49 +05:00
|
|
|
|
|
|
|
bool myCreateQuadratic;
|
2008-03-07 12:47:05 +05:00
|
|
|
SMESH_MesherHelper* myTool; // tool building quadratic elements
|
2004-12-17 16:07:35 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|