mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-04 14:55:38 +05:00
[SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
+ /*! + * \brief Return an alternative parameter for a node on seam + */ + double GetOtherParam(const double param) const;
This commit is contained in:
parent
b27af1c2d2
commit
794f960633
@ -318,7 +318,6 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
|
|||||||
int edgeID = Pos->GetShapeId();
|
int edgeID = Pos->GetShapeId();
|
||||||
TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
|
TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
|
||||||
double f, l;
|
double f, l;
|
||||||
TopLoc_Location loc;
|
|
||||||
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
|
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
|
||||||
uv = C2d->Value( epos->GetUParameter() );
|
uv = C2d->Value( epos->GetUParameter() );
|
||||||
// for a node on a seam edge select one of UVs on 2 pcurves
|
// for a node on a seam edge select one of UVs on 2 pcurves
|
||||||
@ -884,19 +883,19 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Load nodes bound to face into a map of node columns
|
* \brief Load nodes bound to face into a map of node columns
|
||||||
* \param theParam2ColumnMap - map of node columns to fill
|
* \param theParam2ColumnMap - map of node columns to fill
|
||||||
* \param theFace - the face on which nodes are searched for
|
* \param theFace - the face on which nodes are searched for
|
||||||
* \param theBaseEdge - the edge nodes of which are columns' bases
|
* \param theBaseEdge - the edge nodes of which are columns' bases
|
||||||
* \param theMesh - the mesh containing nodes
|
* \param theMesh - the mesh containing nodes
|
||||||
* \retval bool - false if something is wrong
|
* \retval bool - false if something is wrong
|
||||||
*
|
*
|
||||||
* The key of the map is a normalized parameter of each
|
* The key of the map is a normalized parameter of each
|
||||||
* base node on theBaseEdge.
|
* base node on theBaseEdge.
|
||||||
* This method works in supposition that nodes on the face
|
* This method works in supposition that nodes on the face
|
||||||
* forms a rectangular grid and elements can be quardrangles or triangles
|
* forms a rectangular grid and elements can be quardrangles or triangles
|
||||||
*/
|
*/
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
||||||
@ -998,14 +997,14 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
|||||||
|
|
||||||
// load nodes from theBaseEdge
|
// load nodes from theBaseEdge
|
||||||
|
|
||||||
set<const SMDS_MeshNode*> loadedNodes;
|
std::set<const SMDS_MeshNode*> loadedNodes;
|
||||||
const SMDS_MeshNode* nullNode = 0;
|
const SMDS_MeshNode* nullNode = 0;
|
||||||
|
|
||||||
vector<const SMDS_MeshNode*> & nVecf = theParam2ColumnMap[ 0.];
|
std::vector<const SMDS_MeshNode*> & nVecf = theParam2ColumnMap[ 0.];
|
||||||
nVecf.resize( vsize, nullNode );
|
nVecf.resize( vsize, nullNode );
|
||||||
loadedNodes.insert( nVecf[ 0 ] = smVfb->GetNodes()->next() );
|
loadedNodes.insert( nVecf[ 0 ] = smVfb->GetNodes()->next() );
|
||||||
|
|
||||||
vector<const SMDS_MeshNode*> & nVecl = theParam2ColumnMap[ 1.];
|
std::vector<const SMDS_MeshNode*> & nVecl = theParam2ColumnMap[ 1.];
|
||||||
nVecl.resize( vsize, nullNode );
|
nVecl.resize( vsize, nullNode );
|
||||||
loadedNodes.insert( nVecl[ 0 ] = smVlb->GetNodes()->next() );
|
loadedNodes.insert( nVecl[ 0 ] = smVlb->GetNodes()->next() );
|
||||||
|
|
||||||
@ -1024,7 +1023,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
double u = ( pos->GetUParameter() - f ) / range;
|
double u = ( pos->GetUParameter() - f ) / range;
|
||||||
vector<const SMDS_MeshNode*> & nVec = theParam2ColumnMap[ u ];
|
std::vector<const SMDS_MeshNode*> & nVec = theParam2ColumnMap[ u ];
|
||||||
nVec.resize( vsize, nullNode );
|
nVec.resize( vsize, nullNode );
|
||||||
loadedNodes.insert( nVec[ 0 ] = node );
|
loadedNodes.insert( nVec[ 0 ] = node );
|
||||||
}
|
}
|
||||||
@ -1034,7 +1033,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
|||||||
|
|
||||||
// load nodes from e1
|
// load nodes from e1
|
||||||
|
|
||||||
map< double, const SMDS_MeshNode*> sortedNodes; // sort by param on edge
|
std::map< double, const SMDS_MeshNode*> sortedNodes; // sort by param on edge
|
||||||
nIt = sm1->GetNodes();
|
nIt = sm1->GetNodes();
|
||||||
while ( nIt->more() ) {
|
while ( nIt->more() ) {
|
||||||
node = nIt->next();
|
node = nIt->next();
|
||||||
@ -1045,10 +1044,10 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
|||||||
if ( !pos ) {
|
if ( !pos ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sortedNodes.insert( make_pair( pos->GetUParameter(), node ));
|
sortedNodes.insert( std::make_pair( pos->GetUParameter(), node ));
|
||||||
}
|
}
|
||||||
loadedNodes.insert( nVecf[ vsize - 1 ] = smVft->GetNodes()->next() );
|
loadedNodes.insert( nVecf[ vsize - 1 ] = smVft->GetNodes()->next() );
|
||||||
map< double, const SMDS_MeshNode*>::iterator u_n = sortedNodes.begin();
|
std::map< double, const SMDS_MeshNode*>::iterator u_n = sortedNodes.begin();
|
||||||
int row = rev1 ? vsize - 1 : 0;
|
int row = rev1 ? vsize - 1 : 0;
|
||||||
int dRow = rev1 ? -1 : +1;
|
int dRow = rev1 ? -1 : +1;
|
||||||
for ( ; u_n != sortedNodes.end(); u_n++ ) {
|
for ( ; u_n != sortedNodes.end(); u_n++ ) {
|
||||||
@ -1145,11 +1144,14 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
/**
|
/**
|
||||||
* Check mesh without geometry for: if all elements on this shape are quadratic,
|
* Check mesh without geometry for: if all elements on this shape are quadratic,
|
||||||
* quadratic elements will be created.
|
* quadratic elements will be created.
|
||||||
* Used then generated 3D mesh without geometry.
|
* Used then generated 3D mesh without geometry.
|
||||||
*/
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
|
SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
|
||||||
{
|
{
|
||||||
int NbAllEdgsAndFaces=0;
|
int NbAllEdgsAndFaces=0;
|
||||||
@ -1177,3 +1179,13 @@ SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
|
|||||||
return SMESH_MesherHelper::COMP;
|
return SMESH_MesherHelper::COMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return an alternative parameter for a node on seam
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
double SMESH_MesherHelper::GetOtherParam(const double param) const
|
||||||
|
{
|
||||||
|
return fabs(param-myPar1) < fabs(param-myPar2) ? myPar2 : myPar1;
|
||||||
|
}
|
||||||
|
@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
typedef pair<const SMDS_MeshNode*, const SMDS_MeshNode*> NLink;
|
typedef std::pair<const SMDS_MeshNode*, const SMDS_MeshNode*> NLink;
|
||||||
typedef map<NLink, const SMDS_MeshNode*> NLinkNodeMap;
|
typedef std::map<NLink, const SMDS_MeshNode*> NLinkNodeMap;
|
||||||
typedef map<NLink, const SMDS_MeshNode*>::iterator ItNLinkNode;
|
typedef std::map<NLink, const SMDS_MeshNode*>::iterator ItNLinkNode;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief It helps meshers to add elements
|
* \brief It helps meshers to add elements
|
||||||
@ -296,6 +296,10 @@ public:
|
|||||||
* \retval int - 1 for U, 2 for V direction
|
* \retval int - 1 for U, 2 for V direction
|
||||||
*/
|
*/
|
||||||
int GetPeriodicIndex() const { return myParIndex; }
|
int GetPeriodicIndex() const { return myParIndex; }
|
||||||
|
/*!
|
||||||
|
* \brief Return an alternative parameter for a node on seam
|
||||||
|
*/
|
||||||
|
double GetOtherParam(const double param) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special function for search or creation medium node
|
* Special function for search or creation medium node
|
||||||
|
Loading…
Reference in New Issue
Block a user