mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 17:50:34 +05:00
023544: SMESH's performance issues (note 22293)
This commit is contained in:
parent
5e2c97c386
commit
eb177ba645
@ -25,15 +25,18 @@ radial_Quad_algo = mesh.Quadrangle(algo=smeshBuilder.RADIAL_QUAD)
|
||||
|
||||
# The Radial Quadrange algorithm can work without any hypothesis
|
||||
# In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
|
||||
# So by default there will be 15 segments in both radial and circular directions
|
||||
mesh.Compute()
|
||||
|
||||
# The Radial Quadrange uses global or local 1d hypotheses if it does
|
||||
# not have its own hypotheses.
|
||||
# Define global hypotheses to discretize radial edges and a local one for circular edge
|
||||
# So that there will be 5 radial layers and 10 circular segments
|
||||
global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
|
||||
local_Nb_Segments = mesh.Segment(circle).NumberOfSegments(10)
|
||||
mesh.Compute()
|
||||
|
||||
# Define own parameters of Radial Quadrange algorithm
|
||||
# The number of radial layers will be 4
|
||||
radial_Quad_algo.NumberOfLayers( 4 )
|
||||
mesh.Compute()
|
||||
|
@ -2916,9 +2916,10 @@ void SMDS_Mesh::CompactMesh()
|
||||
for ( ; holder != myElemHolders.end(); ++holder )
|
||||
(*holder)->beforeCompacting();
|
||||
}
|
||||
int oldCellSize = myCellFactory->GetMaxID();
|
||||
|
||||
// remove "holes" in SMDS numeration
|
||||
std::vector<int> idNodesOldToNew, idCellsNewToOld;
|
||||
std::vector<int> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew;
|
||||
myNodeFactory->Compact( idNodesOldToNew );
|
||||
myCellFactory->Compact( idCellsNewToOld );
|
||||
|
||||
@ -2927,10 +2928,22 @@ void SMDS_Mesh::CompactMesh()
|
||||
int newCellSize = myCellFactory->NbUsedElements();
|
||||
myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize );
|
||||
|
||||
if ( idsChange && !myElemHolders.empty() )
|
||||
{
|
||||
// idCellsNewToOld -> idCellsOldToNew
|
||||
idCellsOldToNew.resize( oldCellSize, oldCellSize );
|
||||
for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); ++iNew )
|
||||
{
|
||||
if ( idCellsNewToOld[ iNew ] >= (int) idCellsOldToNew.size() )
|
||||
idCellsOldToNew.resize( ( 1 + idCellsNewToOld[ iNew ]) * 1.5, oldCellSize );
|
||||
idCellsOldToNew[ idCellsNewToOld[ iNew ]] = iNew;
|
||||
}
|
||||
}
|
||||
|
||||
std::set< SMDS_ElementHolder* >::iterator holder = myElemHolders.begin();
|
||||
for ( ; holder != myElemHolders.end(); ++holder )
|
||||
if ( idsChange )
|
||||
(*holder)->restoreElements( idNodesOldToNew, idCellsNewToOld );
|
||||
(*holder)->restoreElements( idNodesOldToNew, idCellsOldToNew );
|
||||
else
|
||||
(*holder)->compact();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user