22580: EDF 8049 SMESH: Problems with viscous layer

Overcome the problem of thickness limited by radius of curvature of faces
This commit is contained in:
eap 2014-05-28 18:30:52 +04:00
parent 6cd71fc31b
commit 440a39776f
5 changed files with 949 additions and 446 deletions

View File

@ -559,13 +559,20 @@ public:
{ return IsRealSeam( GetMeshDS()->ShapeToIndex( subShape)); }
/*!
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
* has a seam edge
* \retval bool - true if it has
* has a seam edge, i.e. an edge that has two parametric representations
* on a surface
* \retval bool - true if it has
*/
bool HasSeam() const { return !mySeamShapeIds.empty(); }
/*!
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
* has a seam edge that encounters twice in a wire
* \retval bool - true if it has
*/
bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
/*!
* \brief Return index of periodic parametric direction of a closed face
* \retval int - 1 for U, 2 for V direction
* \retval int - 1 for U, 2 for V direction
*/
int GetPeriodicIndex() const { return myParIndex; }
/*!

View File

@ -1553,7 +1553,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
if ( !algo->NeedDiscreteBoundary() && !subFailed )
_computeError =
SMESH_ComputeError::New(COMPERR_BAD_INPUT_MESH,
"Unexpected computed submesh",algo);
"Unexpected computed sub-mesh",algo);
break; // goto exit
}
}
@ -1587,8 +1587,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
{
ret = algo->Compute((*_father), shape);
}
if ( !_computeError || (/* !ret && */_computeError->IsOK() ) ) // algo can set _computeError of submesh
_computeError = algo->GetComputeError();
// algo can set _computeError of submesh
_computeError = SMESH_ComputeError::Worst( _computeError, algo->GetComputeError() );
}
catch ( ::SMESH_ComputeError& comperr ) {
cout << " SMESH_ComputeError caught" << endl;

View File

@ -17,7 +17,7 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SMESH_Hypothesis.hxx
// File : SMESH_ComputeError.hxx
// Author : Edward AGAPOV (eap)
// Module : SMESH
//
@ -89,32 +89,15 @@ struct SMESH_ComputeError
bool IsKO() const { return myName != COMPERR_OK && myName != COMPERR_WARNING; }
bool IsCommon() const { return myName < 0 && myName > COMPERR_LAST_ALGO_ERROR; }
bool HasBadElems() const { return !myBadElements.empty(); }
inline std::string CommonName() const;
// not inline methods are implemented in src/SMESHUtils/SMESH_TryCatch.cxx
// Return myName as text, to be used to dump errors in terminal
std::string CommonName() const;
// Return the most severe error
static SMESH_ComputeErrorPtr Worst( SMESH_ComputeErrorPtr er1,
SMESH_ComputeErrorPtr er2 );
};
#define _case2char(err) case err: return #err;
// Return myName as text, to be used to dump errors in terminal
std::string SMESH_ComputeError::CommonName() const
{
switch( myName ) {
_case2char(COMPERR_OK );
_case2char(COMPERR_BAD_INPUT_MESH );
_case2char(COMPERR_STD_EXCEPTION );
_case2char(COMPERR_OCC_EXCEPTION );
_case2char(COMPERR_SLM_EXCEPTION );
_case2char(COMPERR_EXCEPTION );
_case2char(COMPERR_MEMORY_PB );
_case2char(COMPERR_ALGO_FAILED );
_case2char(COMPERR_BAD_SHAPE );
_case2char(COMPERR_WARNING );
_case2char(COMPERR_CANCELED );
_case2char(COMPERR_NO_MESH_ON_SHAPE);
_case2char(COMPERR_BAD_PARMETERS );
default:;
}
return "";
}
#endif

View File

@ -20,6 +20,7 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// ------------------------------------------------------------------
#include "SMESH_TryCatch.hxx"
void SMESH::throwSalomeEx(const char* txt)
@ -31,4 +32,51 @@ void SMESH::doNothing(const char* txt)
{
MESSAGE( txt << " " << __FILE__ << ": " << __LINE__ );
}
// ------------------------------------------------------------------
#include "SMESH_ComputeError.hxx"
#define _case2char(err) case err: return #err;
// Return SMESH_ComputeError::myName as text, to be used to dump errors in terminal
std::string SMESH_ComputeError::CommonName() const
{
switch( myName ) {
_case2char(COMPERR_OK );
_case2char(COMPERR_BAD_INPUT_MESH );
_case2char(COMPERR_STD_EXCEPTION );
_case2char(COMPERR_OCC_EXCEPTION );
_case2char(COMPERR_SLM_EXCEPTION );
_case2char(COMPERR_EXCEPTION );
_case2char(COMPERR_MEMORY_PB );
_case2char(COMPERR_ALGO_FAILED );
_case2char(COMPERR_BAD_SHAPE );
_case2char(COMPERR_WARNING );
_case2char(COMPERR_CANCELED );
_case2char(COMPERR_NO_MESH_ON_SHAPE);
_case2char(COMPERR_BAD_PARMETERS );
default:;
}
return "";
}
// Return the most severe error
SMESH_ComputeErrorPtr SMESH_ComputeError::Worst( SMESH_ComputeErrorPtr er1,
SMESH_ComputeErrorPtr er2 )
{
if ( !er1 ) return er2;
if ( !er2 ) return er1;
// both not NULL
if ( er1->IsOK() ) return er2;
if ( er2->IsOK() ) return er1;
// both not OK
if ( !er1->IsKO() ) return er2;
if ( !er2->IsKO() ) return er1;
// both KO
bool hasInfo1 = er1->myComment.size() || !er1->myBadElements.empty();
bool hasInfo2 = er2->myComment.size() || !er2->myBadElements.empty();
if ( er1->myName == er2->myName ||
hasInfo1 != hasInfo2 )
return hasInfo1 < hasInfo2 ? er2 : er1;
return er1->myName == COMPERR_CANCELED ? er2 : er1;
}

File diff suppressed because it is too large Load Diff