mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 08:50:35 +05:00
0020182: EDF SMESH 965 : SIGSEV at study opening with SMESH
be patient to studies with invalid node positions data
This commit is contained in:
parent
ef7a7ed667
commit
455ceefa49
@ -3727,8 +3727,13 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
|
|||||||
while ( nIt->more() ) elemSet.insert( nIt->next() );
|
while ( nIt->more() ) elemSet.insert( nIt->next() );
|
||||||
else
|
else
|
||||||
while ( eIt->more() ) elemSet.insert( eIt->next() );
|
while ( eIt->more() ) elemSet.insert( eIt->next() );
|
||||||
ASSERT( elemSet.size() == nbElems );
|
//ASSERT( elemSet.size() == nbElems ); -- issue 20182
|
||||||
|
// -- Most probably a bad study was saved when there were
|
||||||
|
// not fixed bugs in SMDS_MeshInfo
|
||||||
|
if ( elemSet.size() < nbElems ) {
|
||||||
|
cout << "Warning: Node position data is invalid" << endl;
|
||||||
|
nbElems = elemSet.size();
|
||||||
|
}
|
||||||
// add elements to submeshes
|
// add elements to submeshes
|
||||||
TIDSortedElemSet::iterator iE = elemSet.begin();
|
TIDSortedElemSet::iterator iE = elemSet.begin();
|
||||||
for ( int i = 0; i < nbElems; ++i, ++iE )
|
for ( int i = 0; i < nbElems; ++i, ++iE )
|
||||||
@ -3845,17 +3850,23 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
|
|||||||
SMDS_PositionPtr aPos = node->GetPosition();
|
SMDS_PositionPtr aPos = node->GetPosition();
|
||||||
ASSERT( aPos )
|
ASSERT( aPos )
|
||||||
if ( onFace ) {
|
if ( onFace ) {
|
||||||
ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE );
|
// ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE );-- issue 20182
|
||||||
SMDS_FacePosition* fPos = const_cast<SMDS_FacePosition*>
|
// -- Most probably a bad study was saved when there were
|
||||||
( static_cast<const SMDS_FacePosition*>( aPos.get() ));
|
// not fixed bugs in SMDS_MeshInfo
|
||||||
fPos->SetUParameter( aUPos[ iNode ]);
|
if ( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ) {
|
||||||
fPos->SetVParameter( aVPos[ iNode ]);
|
SMDS_FacePosition* fPos = const_cast<SMDS_FacePosition*>
|
||||||
|
( static_cast<const SMDS_FacePosition*>( aPos.get() ));
|
||||||
|
fPos->SetUParameter( aUPos[ iNode ]);
|
||||||
|
fPos->SetVParameter( aVPos[ iNode ]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE );
|
// ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE );-- issue 20182
|
||||||
SMDS_EdgePosition* fPos = const_cast<SMDS_EdgePosition*>
|
if ( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ) {
|
||||||
( static_cast<const SMDS_EdgePosition*>( aPos.get() ));
|
SMDS_EdgePosition* fPos = const_cast<SMDS_EdgePosition*>
|
||||||
fPos->SetUParameter( aUPos[ iNode ]);
|
( static_cast<const SMDS_EdgePosition*>( aPos.get() ));
|
||||||
|
fPos->SetUParameter( aUPos[ iNode ]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user