Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typo-fix by Kunda + fix user doc generation
[modules/smesh.git]
/
src
/
StdMeshers
/
StdMeshers_Adaptive1D.cxx
diff --git
a/src/StdMeshers/StdMeshers_Adaptive1D.cxx
b/src/StdMeshers/StdMeshers_Adaptive1D.cxx
index 7bcfca77d6a8f71eadc62ab64c2a55a45c5955ff..8d98249022e7c0f9b0028b576e6b394ed347d4c8 100644
(file)
--- a/
src/StdMeshers/StdMeshers_Adaptive1D.cxx
+++ b/
src/StdMeshers/StdMeshers_Adaptive1D.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-24,12
+24,13
@@
//
#include "StdMeshers_Adaptive1D.hxx"
//
#include "StdMeshers_Adaptive1D.hxx"
+#include "SMESHDS_Mesh.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Gen.hxx"
+#include "SMESH_HypoFilter.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_Octree.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_Octree.hxx"
#include "SMESH_subMesh.hxx"
-#include "SMESH_HypoFilter.hxx"
#include <Utils_SALOME_Exception.hxx>
#include <Utils_SALOME_Exception.hxx>
@@
-154,7
+155,7
@@
namespace // internal utils
class AdaptiveAlgo : public StdMeshers_Regular_1D
{
public:
class AdaptiveAlgo : public StdMeshers_Regular_1D
{
public:
- AdaptiveAlgo(int hypId,
int studyId,
SMESH_Gen* gen);
+ AdaptiveAlgo(int hypId, SMESH_Gen* gen);
virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape );
virtual bool Evaluate(SMESH_Mesh & theMesh,
const TopoDS_Shape & theShape,
virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape );
virtual bool Evaluate(SMESH_Mesh & theMesh,
const TopoDS_Shape & theShape,
@@
-535,7
+536,7
@@
namespace // internal utils
for ( int i = 0; i < 3; ++i )
{
const gp_Pnt& pn = myNodes->Value(n[i]);
for ( int i = 0; i < 3; ++i )
{
const gp_Pnt& pn = myNodes->Value(n[i]);
- if (
avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2
))
+ if (
( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 )
))
break;
if ( !projectedOnly )
minD2 = Min( minD2, pn.SquareDistance( p ));
break;
if ( !projectedOnly )
minD2 = Min( minD2, pn.SquareDistance( p ));
@@
-703,7
+704,7
@@
namespace // internal utils
void ElementBndBoxTree::buildChildrenData()
{
ElemTreeData* data = GetElemData();
void ElementBndBoxTree::buildChildrenData()
{
ElemTreeData* data = GetElemData();
- for (
in
t i = 0; i < _elementIDs.size(); ++i )
+ for (
size_
t i = 0; i < _elementIDs.size(); ++i )
{
const Bnd_B3d* elemBox = data->GetBox( _elementIDs[i] );
for (int j = 0; j < 8; j++)
{
const Bnd_B3d* elemBox = data->GetBox( _elementIDs[i] );
for (int j = 0; j < 8; j++)
@@
-718,7
+719,7
@@
namespace // internal utils
{
ElementBndBoxTree* child = static_cast<ElementBndBoxTree*>( myChildren[j] );
child->_elementIDs = data->myWorkIDs[ j ];
{
ElementBndBoxTree* child = static_cast<ElementBndBoxTree*>( myChildren[j] );
child->_elementIDs = data->myWorkIDs[ j ];
- if ( child->_elementIDs.size() <= theMaxNbElemsInLeaf )
+ if (
(int)
child->_elementIDs.size() <= theMaxNbElemsInLeaf )
child->myIsLeaf = true;
data->myWorkIDs[ j ].clear();
}
child->myIsLeaf = true;
data->myWorkIDs[ j ].clear();
}
@@
-741,7
+742,7
@@
namespace // internal utils
if ( isLeaf() )
{
ElemTreeData* data = GetElemData();
if ( isLeaf() )
{
ElemTreeData* data = GetElemData();
- for (
in
t i = 0; i < _elementIDs.size(); ++i )
+ for (
size_
t i = 0; i < _elementIDs.size(); ++i )
if ( !data->GetBox( _elementIDs[i] )->IsOut( center, radius ))
foundElemIDs.push_back( _elementIDs[i] );
}
if ( !data->GetBox( _elementIDs[i] )->IsOut( center, radius ))
foundElemIDs.push_back( _elementIDs[i] );
}
@@
-915,9
+916,8
@@
namespace // internal utils
//function : StdMeshers_Adaptive1D
//purpose : Constructor
StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(int hypId,
//function : StdMeshers_Adaptive1D
//purpose : Constructor
StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(int hypId,
- int studyId,
SMESH_Gen * gen)
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId,
studyId,
gen)
+ :SMESH_Hypothesis(hypId, gen)
{
myMinSize = 1e-10;
myMaxSize = 1e+10;
{
myMinSize = 1e-10;
myMaxSize = 1e+10;
@@
-992,7
+992,7
@@
ostream & StdMeshers_Adaptive1D::SaveTo(ostream & save)
istream & StdMeshers_Adaptive1D::LoadFrom(istream & load)
{
int dummyParam;
istream & StdMeshers_Adaptive1D::LoadFrom(istream & load)
{
int dummyParam;
- bool isOK = (load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
+ bool isOK =
static_cast<bool>
(load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
return load;
if (!isOK)
load.clear(ios::badbit | load.rdstate());
return load;
@@
-1075,7
+1075,7
@@
SMESH_Algo* StdMeshers_Adaptive1D::GetAlgo() const
if ( !myAlgo )
{
AdaptiveAlgo* newAlgo =
if ( !myAlgo )
{
AdaptiveAlgo* newAlgo =
- new AdaptiveAlgo( _gen->GetANewId(), _
studyId, _
gen );
+ new AdaptiveAlgo( _gen->GetANewId(), _gen );
newAlgo->SetHypothesis( this );
((StdMeshers_Adaptive1D*) this)->myAlgo = newAlgo;
newAlgo->SetHypothesis( this );
((StdMeshers_Adaptive1D*) this)->myAlgo = newAlgo;
@@
-1090,9
+1090,8
@@
SMESH_Algo* StdMeshers_Adaptive1D::GetAlgo() const
//================================================================================
AdaptiveAlgo::AdaptiveAlgo(int hypId,
//================================================================================
AdaptiveAlgo::AdaptiveAlgo(int hypId,
- int studyId,
SMESH_Gen* gen)
SMESH_Gen* gen)
- : StdMeshers_Regular_1D( hypId,
studyId,
gen ),
+ : StdMeshers_Regular_1D( hypId, gen ),
myHyp(NULL)
{
_name = "AdaptiveAlgo_1D";
myHyp(NULL)
{
_name = "AdaptiveAlgo_1D";
@@
-1197,7
+1196,7
@@
bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh,
StdMeshers_Regular_1D::_value[ DEFLECTION_IND ] = myHyp->GetDeflection();
list< double > params;
StdMeshers_Regular_1D::_value[ DEFLECTION_IND ] = myHyp->GetDeflection();
list< double > params;
- for (
in
t iE = 0; iE < myEdges.size(); ++iE )
+ for (
size_
t iE = 0; iE < myEdges.size(); ++iE )
{
EdgeData& eData = myEdges[ iE ];
//cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
{
EdgeData& eData = myEdges[ iE ];
//cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
@@
-1243,7
+1242,7
@@
bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh,
triaSearcher->SetSizeByTrias( sizeTree, myHyp->GetDeflection() );
triaSearcher->SetSizeByTrias( sizeTree, myHyp->GetDeflection() );
- for (
in
t iE = 0; iE < myEdges.size(); ++iE )
+ for (
size_
t iE = 0; iE < myEdges.size(); ++iE )
{
EdgeData& eData = myEdges[ iE ];
{
EdgeData& eData = myEdges[ iE ];
@@
-1290,6
+1289,7
@@
bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh,
//cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
sizeDecreased = false;
const gp_Pnt* avoidPnt = & eData.First().myP;
//cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
sizeDecreased = false;
const gp_Pnt* avoidPnt = & eData.First().myP;
+ EdgeData::TPntIter pItLast = --eData.myPoints.end(), pItFirst = eData.myPoints.begin();
for ( pIt1 = eData.myPoints.begin(); pIt1 != eData.myPoints.end(); )
{
double distToFace =
for ( pIt1 = eData.myPoints.begin(); pIt1 != eData.myPoints.end(); )
{
double distToFace =
@@
-1307,19
+1307,16
@@
bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh,
// << "\t SetSize " << allowedSize << " at "
// << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<<pIt1->myP.Z() << endl;
pIt2 = pIt1;
// << "\t SetSize " << allowedSize << " at "
// << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<<pIt1->myP.Z() << endl;
pIt2 = pIt1;
- if (
--pIt2 != eData.myPoints.end() && pIt2
->mySegSize > allowedSize )
+ if (
pIt1 != pItFirst && ( --pIt2 )
->mySegSize > allowedSize )
sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
pIt2 = pIt1;
sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
pIt2 = pIt1;
- if (
++pIt2 != eData.myPoints.end() && pIt2
->mySegSize > allowedSize )
+ if (
pIt1 != pItLast && ( ++pIt2 )
->mySegSize > allowedSize )
sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
}
pIt1->mySegSize = allowedSize;
}
++pIt1;
sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
}
pIt1->mySegSize = allowedSize;
}
++pIt1;
- if ( & (*pIt1) == & eData.Last() )
- avoidPnt = & eData.Last().myP;
- else
- avoidPnt = NULL;
+ avoidPnt = ( pIt1 == pItLast ) ? & eData.Last().myP : NULL;
if ( iLoop > 20 )
{
if ( iLoop > 20 )
{
@@
-1356,7
+1353,7
@@
bool AdaptiveAlgo::makeSegments()
vector< double > nbSegs, params;
vector< double > nbSegs, params;
- for (
in
t iE = 0; iE < myEdges.size(); ++iE )
+ for (
size_
t iE = 0; iE < myEdges.size(); ++iE )
{
EdgeData& eData = myEdges[ iE ];
{
EdgeData& eData = myEdges[ iE ];
@@
-1367,13
+1364,13
@@
bool AdaptiveAlgo::makeSegments()
edgeMinSize = Min( edgeMinSize,
Min( pIt1->mySegSize, mySizeTree->GetSize( pIt1->myP )));
edgeMinSize = Min( edgeMinSize,
Min( pIt1->mySegSize, mySizeTree->GetSize( pIt1->myP )));
- const double f = eData.myC3d.FirstParameter(), l = eData.myC3d.LastParameter();
+ const double
f = eData.myC3d.FirstParameter(), l = eData.myC3d.LastParameter();
const double parLen = l - f;
const int nbDivSeg = 5;
const double parLen = l - f;
const int nbDivSeg = 5;
-
int
nbDiv = Max( 1, int ( eData.myLength / edgeMinSize * nbDivSeg ));
+
size_t
nbDiv = Max( 1, int ( eData.myLength / edgeMinSize * nbDivSeg ));
// compute nb of segments
// compute nb of segments
- bool toRecompute = true;
+ bool
toRecompute = true;
double maxSegSize = 0;
size_t i = 1, segCount;
//cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
double maxSegSize = 0;
size_t i = 1, segCount;
//cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
@@
-1431,7
+1428,7
@@
bool AdaptiveAlgo::makeSegments()
}
// compute parameters of nodes
}
// compute parameters of nodes
-
in
t nbSegFinal = Max( 1, int(floor( nbSegs.back() + 0.5 )));
+
size_
t nbSegFinal = Max( 1, int(floor( nbSegs.back() + 0.5 )));
double fact = nbSegFinal / nbSegs.back();
if ( maxSegSize / fact > myHyp->GetMaxSize() )
fact = ++nbSegFinal / nbSegs.back();
double fact = nbSegFinal / nbSegs.back();
if ( maxSegSize / fact > myHyp->GetMaxSize() )
fact = ++nbSegFinal / nbSegs.back();
@@
-1504,7
+1501,7
@@
bool AdaptiveAlgo::Evaluate(SMESH_Mesh & theMesh,
for ( ; edExp.More(); edExp.Next() )
{
for ( ; edExp.More(); edExp.Next() )
{
- const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
+
//
const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
StdMeshers_Regular_1D::Evaluate( theMesh, theShape, theResMap );
}
return true;
StdMeshers_Regular_1D::Evaluate( theMesh, theShape, theResMap );
}
return true;