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
[bos #41978][EDF] Edit table of density on wire discretization. Load properly the...
[modules/smesh.git]
/
src
/
SMESHDS
/
SMESHDS_GroupOnFilter.cxx
diff --git
a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx
b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx
index e5b2fb736bd3d75362f0f6aae9a85343fc3cf8bf..d8ea06fdac80901e5ac6c4349b697fb5c3af35ee 100644
(file)
--- a/
src/SMESHDS/SMESHDS_GroupOnFilter.cxx
+++ b/
src/SMESHDS/SMESHDS_GroupOnFilter.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
16 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-20
24 CEA, EDF
, 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
@@
-79,7
+79,7
@@
void SMESHDS_GroupOnFilter::SetPredicate( const SMESH_PredicatePtr& thePredicate
*/
//================================================================================
*/
//================================================================================
-
int
SMESHDS_GroupOnFilter::Extent() const
+
smIdType
SMESHDS_GroupOnFilter::Extent() const
{
update();
return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 );
{
update();
return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 );
@@
-120,7
+120,7
@@
bool SMESHDS_GroupOnFilter::IsEmpty()
*/
//================================================================================
*/
//================================================================================
-bool SMESHDS_GroupOnFilter::Contains (const
int
theID)
+bool SMESHDS_GroupOnFilter::Contains (const
smIdType
theID)
{
return myPredicate && myPredicate->IsSatisfy( theID );
}
{
return myPredicate && myPredicate->IsSatisfy( theID );
}
@@
-147,6
+147,7
@@
namespace // Iterator
size_t myNbToFind, myNbFound, myTotalNb;
vector< const SMDS_MeshElement*>& myFoundElems;
bool & myFoundElemsOK;
size_t myNbToFind, myNbFound, myTotalNb;
vector< const SMDS_MeshElement*>& myFoundElems;
bool & myFoundElemsOK;
+ bool myFoundElemsChecked;
TIterator( const SMESH_PredicatePtr& filter,
SMDS_ElemIteratorPtr& elems,
TIterator( const SMESH_PredicatePtr& filter,
SMDS_ElemIteratorPtr& elems,
@@
-161,14
+162,15
@@
namespace // Iterator
myNbFound( 0 ),
myTotalNb( totalNb ),
myFoundElems( foundElems ),
myNbFound( 0 ),
myTotalNb( totalNb ),
myFoundElems( foundElems ),
- myFoundElemsOK( foundElemsOK )
+ myFoundElemsOK( foundElemsOK ),
+ myFoundElemsChecked( false )
{
myFoundElemsOK = false;
next();
}
~TIterator()
{
{
myFoundElemsOK = false;
next();
}
~TIterator()
{
- if ( !myFoundElemsOK )
+ if ( !myFoundElems
Checked && !myFoundElems
OK )
clearVector( myFoundElems );
}
virtual bool more()
clearVector( myFoundElems );
}
virtual bool more()
@@
-225,6
+227,8
@@
namespace // Iterator
}
if ( !myFoundElemsOK )
clearVector( myFoundElems );
}
if ( !myFoundElemsOK )
clearVector( myFoundElems );
+
+ myFoundElemsChecked = true; // in destructor: not to clearVector() which may already die
}
};
}
};
@@
-284,7
+288,7
@@
SMDS_ElemIteratorPtr SMESHDS_GroupOnFilter::GetElements() const
*/
//================================================================================
*/
//================================================================================
-std::vector<
int
> SMESHDS_GroupOnFilter::GetMeshInfo() const
+std::vector<
smIdType
> SMESHDS_GroupOnFilter::GetMeshInfo() const
{
update();
return myMeshInfo;
{
update();
return myMeshInfo;
@@
-311,7
+315,7
@@
int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
if ( IsUpToDate() )
{
for ( ; elIt->more(); curID += idSize )
if ( IsUpToDate() )
{
for ( ; elIt->more(); curID += idSize )
- (*(
int
*) curID) = elIt->next()->GetID();
+ (*(
smIdType
*) curID) = elIt->next()->GetID();
}
else
{
}
else
{
@@
-321,11
+325,11
@@
int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
me->myMeshInfo.assign( SMDSEntity_Last, 0 );
me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
me->myMeshInfo.assign( SMDSEntity_Last, 0 );
me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
- (*(
int
*) curID) = firstOkElem->GetID();
+ (*(
smIdType
*) curID) = firstOkElem->GetID();
for ( curID += idSize; elIt->more(); curID += idSize )
{
const SMDS_MeshElement* e = elIt->next();
for ( curID += idSize; elIt->more(); curID += idSize )
{
const SMDS_MeshElement* e = elIt->next();
- (*(
int
*) curID) = e->GetID();
+ (*(
smIdType
*) curID) = e->GetID();
me->myMeshInfo[ e->GetEntityType() ]++;
}
}
me->myMeshInfo[ e->GetEntityType() ]++;
}
}
@@
-391,6
+395,14
@@
void SMESHDS_GroupOnFilter::update() const
//================================================================================
#ifdef WITH_TBB
//================================================================================
#ifdef WITH_TBB
+#ifdef WIN32
+// See https://docs.microsoft.com/en-gb/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2019
+// Windows 10 = 0x0A00
+#define WINVER 0x0A00
+#define _WIN32_WINNT 0x0A00
+
+#endif
+
#include <tbb/parallel_for.h>
#include "tbb/enumerable_thread_specific.h"
#include <tbb/parallel_for.h>
#include "tbb/enumerable_thread_specific.h"
@@
-431,7
+443,7
@@
bool SMESHDS_GroupOnFilter::updateParallel() const
return false; // no sense in parallel work
SMDS_ElemIteratorPtr elemIt = GetMesh()->elementsIterator( GetType() );
return false; // no sense in parallel work
SMDS_ElemIteratorPtr elemIt = GetMesh()->elementsIterator( GetType() );
- const
int
minID = elemIt->next()->GetID();
+ const
smIdType
minID = elemIt->next()->GetID();
myPredicate->IsSatisfy( minID ); // make myPredicate fully initialized for clone()
SMESH_PredicatePtr clone( myPredicate->clone() );
if ( !clone )
myPredicate->IsSatisfy( minID ); // make myPredicate fully initialized for clone()
SMESH_PredicatePtr clone( myPredicate->clone() );
if ( !clone )
@@
-440,7
+452,7
@@
bool SMESHDS_GroupOnFilter::updateParallel() const
TLocalPredicat threadPredicates;
threadPredicates.local() = clone;
TLocalPredicat threadPredicates;
threadPredicates.local() = clone;
-
int
maxID = ( GetType() == SMDSAbs_Node ) ? GetMesh()->MaxNodeID() : GetMesh()->MaxElementID();
+
smIdType
maxID = ( GetType() == SMDSAbs_Node ) ? GetMesh()->MaxNodeID() : GetMesh()->MaxElementID();
vector< char > isElemOK( 1 + maxID );
tbb::parallel_for ( tbb::blocked_range<size_t>( 0, isElemOK.size() ),
vector< char > isElemOK( 1 + maxID );
tbb::parallel_for ( tbb::blocked_range<size_t>( 0, isElemOK.size() ),