if (!_study->_is_nil())
MESSAGE("_study->StudyId() = " << _study->StudyId());
- _compute_canceled = false;
+ _computeCanceled = false;
+ _progressAdvance = 1e-4;
}
//=============================================================================
std::map<const SMDS_MeshNode*,int> aNodeToGhs3dIdMap;
std::vector<std::string> aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId;
+ MG_Tetra_API mgTetra( _computeCanceled, _progress );
+
+ _isLibUsed = mgTetra.IsLibrary();
+ if ( theMesh.NbQuadrangles() > 0 )
+ _progressAdvance /= 10;
+ if ( _viscousLayersHyp )
+ _progressAdvance /= 10;
+
// proxyMesh must live till readGMFFile() as a proxy face can be used by
// MG-Tetra for domain indication
SMESH_ProxyMesh::Ptr proxyMesh( new SMESH_ProxyMesh( theMesh ));
return false;
}
StdMeshers_QuadToTriaAdaptor* q2t = new StdMeshers_QuadToTriaAdaptor;
- q2t->Compute( theMesh, expBox.Current(), proxyMesh.get() );
+ Ok = q2t->Compute( theMesh, expBox.Current(), proxyMesh.get() );
components.push_back( SMESH_ProxyMesh::Ptr( q2t ));
+ if ( !Ok )
+ return false;
}
proxyMesh.reset( new SMESH_ProxyMesh( components ));
}
return false;
}
- MG_Tetra_API mgTetra( _compute_canceled, _progress );
-
- _isLibUsed = mgTetra.IsLibrary();
-
int anInvalidEnforcedFlags = 0;
Ok = writeGMFFile(&mgTetra,
aGMFFileName.ToCString(),
std::cout << "MG-Tetra execution..." << std::endl;
std::cout << cmd << std::endl;
- _compute_canceled = false;
+ _computeCanceled = false;
std::string errStr;
Ok = mgTetra.Compute( cmd.ToCString(), errStr ); // run
}
if ( !_keepFiles ) {
- if (! Ok && _compute_canceled )
+ if (! Ok && _computeCanceled )
removeFile( aLogFileName );
removeFile( aGMFFileName );
removeFile( aRequiredVerticesFileName );
std::map<const SMDS_MeshNode*,int> aNodeToGhs3dIdMap;
std::vector<std::string> aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId;
+
+ MG_Tetra_API mgTetra( _computeCanceled, _progress );
+
+ _isLibUsed = mgTetra.IsLibrary();
+ if ( theMesh.NbQuadrangles() > 0 )
+ _progressAdvance /= 10;
+
// proxyMesh must live till readGMFFile() as a proxy face can be used by
// MG-Tetra for domain indication
SMESH_ProxyMesh::Ptr proxyMesh( new SMESH_ProxyMesh( theMesh ));
if ( theMesh.NbQuadrangles() > 0 )
{
StdMeshers_QuadToTriaAdaptor* aQuad2Trias = new StdMeshers_QuadToTriaAdaptor;
- aQuad2Trias->Compute( theMesh );
+ Ok = aQuad2Trias->Compute( theMesh );
proxyMesh.reset( aQuad2Trias );
+ if ( !Ok )
+ return false;
}
- MG_Tetra_API mgTetra( _compute_canceled, _progress );
-
- _isLibUsed = mgTetra.IsLibrary();
-
int anInvalidEnforcedFlags = 0;
Ok = writeGMFFile(&mgTetra,
aGMFFileName.ToCString(), aRequiredVerticesFileName.ToCString(), aSolFileName.ToCString(),
std::cout << "MG-Tetra execution..." << std::endl;
std::cout << cmd << std::endl;
- _compute_canceled = false;
+ _computeCanceled = false;
std::string errStr;
Ok = mgTetra.Compute( cmd.ToCString(), errStr ); // run
if ( !_keepFiles )
{
- if (! Ok && _compute_canceled)
+ if (! Ok && _computeCanceled)
removeFile( aLogFileName );
removeFile( aGMFFileName );
removeFile( aResultFileName );
void GHS3DPlugin_GHS3D::CancelCompute()
{
- _compute_canceled = true;
+ _computeCanceled = true;
#ifdef WIN32
#else
std::string cmd = "ps xo pid,args | grep " + _genericName;
const std::string& log,
const _Ghs2smdsConvertor & toSmdsConvertor )
{
- if(_compute_canceled)
+ if(_computeCanceled)
return error(SMESH_Comment("interruption initiated by user"));
// read file
if ( _progress < 0.1 ) // the first message is at 10%
me->_progress = GetProgressByTic();
else if ( _progress < 0.98 )
- me->_progress += 1e-4;
+ me->_progress += _progressAdvance;
return _progress;
}