[bos #32517][EDF] Dynamic logging: Removed some of _DEBUG_ entries.

This commit is contained in:
Konstantin LEONTEV 2022-10-15 21:56:01 +03:00
parent 18a8413e3b
commit bba2ceaf86
35 changed files with 405 additions and 400 deletions

View File

@ -4425,9 +4425,10 @@ Predicate* ElementsOnShape::clone() const
size += sizeof( myWorkClassifiers[0] ) * myWorkClassifiers.size(); size += sizeof( myWorkClassifiers[0] ) * myWorkClassifiers.size();
if ( size > 1e+9 ) // 1G if ( size > 1e+9 ) // 1G
{ {
#ifdef _DEBUG_
if (SALOME::VerbosityActivated())
std::cout << "Avoid ElementsOnShape::clone(), too large: " << size << " bytes " << std::endl; std::cout << "Avoid ElementsOnShape::clone(), too large: " << size << " bytes " << std::endl;
#endif
return 0; return 0;
} }

View File

@ -28,7 +28,6 @@
#include "SMESH_Comment.hxx" #include "SMESH_Comment.hxx"
//#define _DEBUG_
#include <utilities.h> #include <utilities.h>
using namespace std; using namespace std;
@ -79,9 +78,7 @@ Driver_Mesh::Status Driver_Mesh::addMessage(const std::string& msg,
myErrorMessages.push_back( msg ); myErrorMessages.push_back( msg );
MESSAGE(msg); MESSAGE(msg);
#ifdef _DEBUG_
cout << msg << endl;
#endif
return ( myStatus = isFatal ? DRS_FAIL : DRS_WARN_SKIP_ELEM ); return ( myStatus = isFatal ? DRS_FAIL : DRS_WARN_SKIP_ELEM );
} }

View File

@ -22,7 +22,7 @@
// File : DriverCGNS_Read.cxx // File : DriverCGNS_Read.cxx
// Created : Thu Jun 30 10:33:31 2011 // Created : Thu Jun 30 10:33:31 2011
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
//#define _DEBUG_
#include <utilities.h> #include <utilities.h>
#include "DriverCGNS_Read.hxx" #include "DriverCGNS_Read.hxx"

View File

@ -245,13 +245,14 @@ namespace MED
TGaussInfo::TKey aKey = boost::get<0>(aPreInfo); TGaussInfo::TKey aKey = boost::get<0>(aPreInfo);
aKey2Gauss[aKey] = anInfo; aKey2Gauss[aKey] = anInfo;
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
const EGeometrieElement& aGeom = boost::get<0>(aKey); {
const std::string& aName = boost::get<1>(aKey); const EGeometrieElement& aGeom = boost::get<0>(aKey);
INITMSG("- aGeom = "<<aGeom<<"; aName = '"<<aName<<"'"<<std::endl); const std::string& aName = boost::get<1>(aKey);
#endif INITMSG("- aGeom = "<<aGeom<<"; aName = '"<<aName<<"'"<<std::endl);
}
} }
return aKey2Gauss; return aKey2Gauss;
} }

View File

@ -297,7 +297,7 @@ namespace MED
} }
} }
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
{ {
INITMSG("theGauss: "); INITMSG("theGauss: ");
for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){ for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
@ -309,21 +309,22 @@ namespace MED
ADDMSG("} "); ADDMSG("} ");
} }
ADDMSG(std::endl); ADDMSG(std::endl);
}
for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){ for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
TCCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId); TCCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
INITMSG(""); INITMSG("");
for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){ for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
TCCoordSlice aCoordSlice = aCoordSliceArr[aGaussId]; TCCoordSlice aCoordSlice = aCoordSliceArr[aGaussId];
ADDMSG("{"); ADDMSG("{");
for(TInt aDimId = 0; aDimId < aDim; aDimId++){ for(TInt aDimId = 0; aDimId < aDim; aDimId++){
ADDMSG(aCoordSlice[aDimId]<<" "); ADDMSG(aCoordSlice[aDimId]<<" ");
}
ADDMSG("} ");
} }
ADDMSG("} "); ADDMSG(std::endl);
} }
ADDMSG(std::endl);
} }
#endif
return true; return true;
} }
@ -1956,21 +1957,22 @@ namespace MED
} }
} }
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){ {
TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId); for(TInt anElemId = 0; anElemId < aNbElem; anElemId++){
INITMSG(""); TCoordSliceArr aCoordSliceArr = theGaussCoord.GetCoordSliceArr(anElemId);
for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){ INITMSG("");
TCoordSlice& aCoordSlice = aCoordSliceArr[aGaussId]; for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++){
ADDMSG("{"); TCoordSlice& aCoordSlice = aCoordSliceArr[aGaussId];
for(TInt aDimId = 0; aDimId < aDim; aDimId++){ ADDMSG("{");
ADDMSG(aCoordSlice[aDimId]<<" "); for(TInt aDimId = 0; aDimId < aDim; aDimId++){
ADDMSG(aCoordSlice[aDimId]<<" ");
}
ADDMSG("} ");
} }
ADDMSG("} "); ADDMSG(std::endl);
} }
ADDMSG(std::endl);
} }
#endif
return true; return true;
} }

View File

@ -31,9 +31,7 @@
#include <valarray> #include <valarray>
#include <stdexcept> #include <stdexcept>
//#if defined(_DEBUG_)
# define MED_TCSLICE_CHECK_RANGE # define MED_TCSLICE_CHECK_RANGE
//#endif
namespace MED namespace MED
{ {

View File

@ -26,9 +26,7 @@
#include <vector> #include <vector>
#include <stdexcept> #include <stdexcept>
//#if defined(_DEBUG_)
# define MED_TVECTOR_CHECK_RANGE # define MED_TVECTOR_CHECK_RANGE
//#endif
namespace MED namespace MED
{ {

View File

@ -594,17 +594,18 @@ namespace MED
PFamilyInfo anInfo = CrFamilyInfo(theMeshInfo, aNbGroup, aNbAttr); PFamilyInfo anInfo = CrFamilyInfo(theMeshInfo, aNbGroup, aNbAttr);
GetFamilyInfo(theId, *anInfo, theErr); GetFamilyInfo(theId, *anInfo, theErr);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::string aName = anInfo->GetName(); {
INITMSG("GetPFamilyInfo - aFamilyName = '"<<aName<< std::string aName = anInfo->GetName();
"'; andId = "<<anInfo->GetId()<< INITMSG("GetPFamilyInfo - aFamilyName = '"<<aName<<
"; aNbAttr = "<<aNbAttr<< "'; andId = "<<anInfo->GetId()<<
"; aNbGroup = "<<aNbGroup<<"\n"); "; aNbAttr = "<<aNbAttr<<
for (TInt iGroup = 0; iGroup < aNbGroup; iGroup++) { "; aNbGroup = "<<aNbGroup<<"\n");
aName = anInfo->GetGroupName(iGroup); for (TInt iGroup = 0; iGroup < aNbGroup; iGroup++) {
INITMSG("aGroupName = '"<<aName<<"'\n"); aName = anInfo->GetGroupName(iGroup);
INITMSG("aGroupName = '"<<aName<<"'\n");
}
} }
#endif
return anInfo; return anInfo;
} }
@ -1155,37 +1156,38 @@ namespace MED
PNodeInfo anInfo = CrNodeInfo(theMeshInfo, aNbElems); PNodeInfo anInfo = CrNodeInfo(theMeshInfo, aNbElems);
GetNodeInfo(*anInfo, theErr); GetNodeInfo(*anInfo, theErr);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
TInt aDim = theMeshInfo->myDim;
TInt aNbElem = anInfo->GetNbElem();
INITMSG("GetPNodeInfo: ");
{ {
INITMSG("aCoords: "<<aNbElem<<": "); TInt aDim = theMeshInfo->myDim;
TNodeCoord& aCoord = anInfo->myCoord; TInt aNbElem = anInfo->GetNbElem();
for (TInt iElem = 0; iElem < aNbElem; iElem++) { INITMSG("GetPNodeInfo: ");
for (TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++) { {
ADDMSG(aCoord[anId]<<","); INITMSG("aCoords: "<<aNbElem<<": ");
} TNodeCoord& aCoord = anInfo->myCoord;
ADDMSG(" ");
}
ADDMSG(std::endl);
BEGMSG("GetFamNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(std::endl);
if (anInfo->IsElemNum()) {
BEGMSG("GetElemNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) { for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetElemNum(iElem)<<", "); for (TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++) {
ADDMSG(aCoord[anId]<<",");
}
ADDMSG(" ");
} }
ADDMSG(std::endl); ADDMSG(std::endl);
BEGMSG("GetFamNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(std::endl);
if (anInfo->IsElemNum()) {
BEGMSG("GetElemNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetElemNum(iElem)<<", ");
}
ADDMSG(std::endl);
}
} }
ADDMSG(std::endl);
} }
ADDMSG(std::endl);
#endif
return anInfo; return anInfo;
} }
@ -1540,20 +1542,21 @@ namespace MED
PPolygoneInfo anInfo = CrPolygoneInfo(theMeshInfo, theEntity, theGeom, aNbElem, aConnSize, theConnMode); PPolygoneInfo anInfo = CrPolygoneInfo(theMeshInfo, theEntity, theGeom, aNbElem, aConnSize, theConnMode);
GetPolygoneInfo(anInfo); GetPolygoneInfo(anInfo);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
INITMSG("GetPPolygoneInfo"<< {
" - theGeom = "<<theGeom<< INITMSG("GetPPolygoneInfo"<<
"; aNbElem = "<<aNbElem<<": "); " - theGeom = "<<theGeom<<
for (TInt iElem = 1; iElem < aNbElem; iElem++) { "; aNbElem = "<<aNbElem<<": ");
TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem); for (TInt iElem = 1; iElem < aNbElem; iElem++) {
TInt aConnDim = aConnSlice.size(); TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
for (TInt iConn = 0; iConn < aConnDim; iConn++) { TInt aConnDim = aConnSlice.size();
ADDMSG(aConnSlice[iConn]<<","); for (TInt iConn = 0; iConn < aConnDim; iConn++) {
ADDMSG(aConnSlice[iConn]<<",");
}
ADDMSG(" ");
} }
ADDMSG(" "); ADDMSG(std::endl);
} }
ADDMSG(std::endl);
#endif
return anInfo; return anInfo;
} }
@ -1850,27 +1853,28 @@ namespace MED
PPolyedreInfo anInfo = CrPolyedreInfo(theMeshInfo, theEntity, theGeom, aNbElem, aNbFaces, aConnSize, theConnMode); PPolyedreInfo anInfo = CrPolyedreInfo(theMeshInfo, theEntity, theGeom, aNbElem, aNbFaces, aConnSize, theConnMode);
GetPolyedreInfo(anInfo); GetPolyedreInfo(anInfo);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
INITMSG("GetPPolyedreInfo"<< {
" - theGeom = "<<theGeom<< INITMSG("GetPPolyedreInfo"<<
"; aNbElem = "<<aNbElem<<": "); " - theGeom = "<<theGeom<<
for (TInt iElem = 0; iElem < aNbElem; iElem++) { "; aNbElem = "<<aNbElem<<": ");
TCConnSliceArr aConnSliceArr = anInfo->GetConnSliceArr(iElem); for (TInt iElem = 0; iElem < aNbElem; iElem++) {
TInt aNbFaces = aConnSliceArr.size(); TCConnSliceArr aConnSliceArr = anInfo->GetConnSliceArr(iElem);
ADDMSG("{"); TInt aNbFaces = aConnSliceArr.size();
for (TInt iFace = 0; iFace < aNbFaces; iFace++) { ADDMSG("{");
TCConnSlice aConnSlice = aConnSliceArr[iFace]; for (TInt iFace = 0; iFace < aNbFaces; iFace++) {
TInt aNbConn = aConnSlice.size(); TCConnSlice aConnSlice = aConnSliceArr[iFace];
ADDMSG("["); TInt aNbConn = aConnSlice.size();
for (TInt iConn = 0; iConn < aNbConn; iConn++) { ADDMSG("[");
ADDMSG(aConnSlice[iConn]<<","); for (TInt iConn = 0; iConn < aNbConn; iConn++) {
ADDMSG(aConnSlice[iConn]<<",");
}
ADDMSG("] ");
} }
ADDMSG("] "); ADDMSG("} ");
} }
ADDMSG("} "); ADDMSG(std::endl);
} }
ADDMSG(std::endl);
#endif
return anInfo; return anInfo;
} }
@ -2271,34 +2275,35 @@ namespace MED
PCellInfo anInfo = CrCellInfo(theMeshInfo, theEntity, theGeom, aNbElem, theConnMode); PCellInfo anInfo = CrCellInfo(theMeshInfo, theEntity, theGeom, aNbElem, theConnMode);
GetCellInfo(anInfo, theErr); GetCellInfo(anInfo, theErr);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
TInt aConnDim = anInfo->GetConnDim(); {
INITMSG("GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n"); TInt aConnDim = anInfo->GetConnDim();
BEGMSG("GetPCellInfo - aNbElem: "<<aNbElem<<": "); INITMSG("GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n");
for (TInt iElem = 0; iElem < aNbElem; iElem++) { BEGMSG("GetPCellInfo - aNbElem: "<<aNbElem<<": ");
TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
for (TInt iConn = 0; iConn < aConnDim; iConn++) {
ADDMSG(aConnSlice[iConn]<<",");
}
ADDMSG(" ");
}
ADDMSG(std::endl);
BEGMSG("GetPCellInfo - GetFamNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(std::endl);
if (anInfo->IsElemNum()) {
BEGMSG("GetPCellInfo - GetElemNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) { for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetElemNum(iElem)<<", "); TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
for (TInt iConn = 0; iConn < aConnDim; iConn++) {
ADDMSG(aConnSlice[iConn]<<",");
}
ADDMSG(" ");
}
ADDMSG(std::endl);
BEGMSG("GetPCellInfo - GetFamNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetFamNum(iElem)<<", ");
}
ADDMSG(std::endl);
if (anInfo->IsElemNum()) {
BEGMSG("GetPCellInfo - GetElemNum: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) {
ADDMSG(anInfo->GetElemNum(iElem)<<", ");
}
ADDMSG(std::endl);
} }
ADDMSG(std::endl); ADDMSG(std::endl);
} }
ADDMSG(std::endl);
#endif
return anInfo; return anInfo;
} }
@ -2679,13 +2684,14 @@ namespace MED
PFieldInfo anInfo = CrFieldInfo(theMeshInfo, aNbComp); PFieldInfo anInfo = CrFieldInfo(theMeshInfo, aNbComp);
GetFieldInfo(theId, *anInfo, theErr); GetFieldInfo(theId, *anInfo, theErr);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
INITMSG("GetPFieldInfo "<< {
"- aName = '"<<anInfo->GetName()<<"'"<< INITMSG("GetPFieldInfo "<<
"; aType = "<<anInfo->GetType()<< "- aName = '"<<anInfo->GetName()<<"'"<<
"; aNbComp = "<<aNbComp<< "; aType = "<<anInfo->GetType()<<
std::endl); "; aNbComp = "<<aNbComp<<
#endif std::endl);
}
return anInfo; return anInfo;
} }
@ -3051,15 +3057,16 @@ namespace MED
PTimeStampInfo anInfo = CrTimeStampInfo(theFieldInfo, theEntity, theGeom2Size); PTimeStampInfo anInfo = CrTimeStampInfo(theFieldInfo, theEntity, theGeom2Size);
GetTimeStampInfo(theId, *anInfo, theErr); GetTimeStampInfo(theId, *anInfo, theErr);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
INITMSG("GetPTimeStampInfo - anEntity = "<<anInfo->GetEntity()<<"\n"); {
TGeom2NbGauss& aGeom2NbGauss = anInfo->myGeom2NbGauss; INITMSG("GetPTimeStampInfo - anEntity = "<<anInfo->GetEntity()<<"\n");
TGeom2NbGauss::const_iterator anIter = aGeom2NbGauss.begin(); TGeom2NbGauss& aGeom2NbGauss = anInfo->myGeom2NbGauss;
for (; anIter != aGeom2NbGauss.end(); anIter++) { TGeom2NbGauss::const_iterator anIter = aGeom2NbGauss.begin();
const EGeometrieElement& aGeom = anIter->first; for (; anIter != aGeom2NbGauss.end(); anIter++) {
INITMSG("aGeom = "<<aGeom<<" - "<<aGeom2NbGauss[aGeom]<<";\n"); const EGeometrieElement& aGeom = anIter->first;
INITMSG("aGeom = "<<aGeom<<" - "<<aGeom2NbGauss[aGeom]<<";\n");
}
} }
#endif
return anInfo; return anInfo;
} }
@ -3547,12 +3554,13 @@ namespace MED
theMKey2Profile, theMKey2Profile,
theKey2Gauss, theKey2Gauss,
theErr); theErr);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
if (aFieldInfo->GetType() == eFLOAT64) {
Print<TFloatTimeStampValue>(anInfo); if (aFieldInfo->GetType() == eFLOAT64)
else Print<TFloatTimeStampValue>(anInfo);
Print<TIntTimeStampValue>(anInfo); else
#endif Print<TIntTimeStampValue>(anInfo);
}
return anInfo; return anInfo;
} }
@ -3682,9 +3690,10 @@ namespace MED
GetGrilleInfo(anInfo); GetGrilleInfo(anInfo);
anInfo->SetGrilleType(type); anInfo->SetGrilleType(type);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
INITMSG("GetPGrilleInfo: ");
{ {
INITMSG("GetPGrilleInfo: ");
TInt aNbElem = anInfo->GetNbNodes(); TInt aNbElem = anInfo->GetNbNodes();
BEGMSG("GetFamNumNode: "); BEGMSG("GetFamNumNode: ");
for (TInt iElem = 0; iElem < aNbElem; iElem++) { for (TInt iElem = 0; iElem < aNbElem; iElem++) {
@ -3706,9 +3715,7 @@ namespace MED
ADDMSG(anInfo->GetCoordUnit(iElem)<<", "); ADDMSG(anInfo->GetCoordUnit(iElem)<<", ");
} }
ADDMSG(std::endl); ADDMSG(std::endl);
} }
#endif
return anInfo; return anInfo;
} }

View File

@ -29,9 +29,7 @@
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#endif #endif
#ifdef _DEBUG_
#include <iostream> #include <iostream>
#endif
int main () int main ()
{ {
@ -59,9 +57,9 @@ int main ()
} }
} catch (...) {} } catch (...) {}
// #ifdef _DEBUG_ // if (SALOME::VerbosityActivated())
// std::cout << freeRamKb / 1024 << std::endl; // std::cout << freeRamKb / 1024 << std::endl;
// #endif
return freeRamKb / 1024; return freeRamKb / 1024;
#endif #endif

View File

@ -1575,9 +1575,9 @@ MgAdapt::Status MgAdapt::addMessage(const std::string& msg,
_errorMessages.push_back( msg ); _errorMessages.push_back( msg );
//~MESSAGE(msg); //~MESSAGE(msg);
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::cout << msg << std::endl; std::cout << msg << std::endl;
#endif
return ( _status = isFatal ? MgAdapt::DRS_FAIL : MgAdapt::DRS_WARN_SKIP_ELEM ); return ( _status = isFatal ? MgAdapt::DRS_FAIL : MgAdapt::DRS_WARN_SKIP_ELEM );
} }

View File

@ -524,10 +524,12 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
myReader.SetFile(theFileName); myReader.SetFile(theFileName);
myReader.SetMeshName(theMeshName); myReader.SetMeshName(theMeshName);
Driver_Mesh::Status status = myReader.Perform(); Driver_Mesh::Status status = myReader.Perform();
#ifdef _DEBUG_
SMESH_ComputeErrorPtr er = myReader.GetError(); if (SALOME::VerbosityActivated())
if ( er && !er->IsOK() ) std::cout << er->myComment << std::endl; {
#endif SMESH_ComputeErrorPtr er = myReader.GetError();
if ( er && !er->IsOK() ) std::cout << er->myComment << std::endl;
}
// Reading groups (sub-meshes are out of scope of MED import functionality) // Reading groups (sub-meshes are out of scope of MED import functionality)
std::list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes(); std::list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
@ -1742,9 +1744,8 @@ double SMESH_Mesh::GetComputeProgress() const
rate = algo->GetProgress(); rate = algo->GetProgress();
} }
catch (...) { catch (...) {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::cerr << "Exception in " << algo->GetName() << "::GetProgress()" << std::endl; std::cerr << "Exception in " << algo->GetName() << "::GetProgress()" << std::endl;
#endif
} }
if ( 0. < rate && rate < 1.001 ) if ( 0. < rate && rate < 1.001 )
{ {

View File

@ -5219,13 +5219,12 @@ void SMESH_MeshEditor::makeWalls (TNodeOfNodeListMap & mapNewNodes,
srcEdges.push_back(aMesh->FindEdge (commonNodes[0],commonNodes[1],commonNodes[2])); srcEdges.push_back(aMesh->FindEdge (commonNodes[0],commonNodes[1],commonNodes[2]));
else else
srcEdges.push_back(aMesh->FindEdge (commonNodes[0],commonNodes[1])); srcEdges.push_back(aMesh->FindEdge (commonNodes[0],commonNodes[1]));
#ifdef _DEBUG_
if ( !srcEdges.back() ) if (SALOME::VerbosityActivated() && !srcEdges.back())
{ {
cout << "SMESH_MeshEditor::makeWalls(), no source edge found for a free face #" cout << "SMESH_MeshEditor::makeWalls(), no source edge found for a free face #"
<< iF << " of volume #" << vTool.ID() << endl; << iF << " of volume #" << vTool.ID() << endl;
} }
#endif
} }
} }
if ( freeInd.empty() ) if ( freeInd.empty() )
@ -6816,9 +6815,8 @@ SMESH_MeshEditor::PGroupIDs SMESH_MeshEditor::Offset( TIDSortedElemSet & theElem
for ( size_t i = 0; i < new2OldNodes.size(); ++i ) for ( size_t i = 0; i < new2OldNodes.size(); ++i )
if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first ) if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first )
{ {
#ifndef _DEBUG_
if ( n->NbInverseElements() > 0 ) if (!SALOME::VerbosityActivated() || n->NbInverseElements() > 0 )
#endif
{ {
const SMDS_MeshNode* n2 = const SMDS_MeshNode* n2 =
tgtMeshDS->AddNodeWithID( n->X(), n->Y(), n->Z(), idShift + n->GetID() ); tgtMeshDS->AddNodeWithID( n->X(), n->Y(), n->Z(), idShift + n->GetID() );

View File

@ -3323,9 +3323,9 @@ double SMESH_MesherHelper::GetAngle( const TopoDS_Edge & theE1,
vecRef = du ^ dv; vecRef = du ^ dv;
if ( ++nbLoops > 10 ) if ( ++nbLoops > 10 )
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
cout << "SMESH_MesherHelper::GetAngle(): Captured in a sigularity" << endl; cout << "SMESH_MesherHelper::GetAngle(): Captured in a sigularity" << endl;
#endif
return angle; return angle;
} }
} }
@ -3745,9 +3745,7 @@ namespace { // Structures used by FixQuadraticElements()
mutable vector< const QLink* > _sides; mutable vector< const QLink* > _sides;
mutable bool _sideIsAdded[4]; // added in chain of links mutable bool _sideIsAdded[4]; // added in chain of links
gp_Vec _normal; gp_Vec _normal;
#ifdef _DEBUG_
mutable const SMDS_MeshElement* _face; mutable const SMDS_MeshElement* _face;
#endif
QFace( const vector< const QLink*>& links, const SMDS_MeshElement* face=0 ); QFace( const vector< const QLink*>& links, const SMDS_MeshElement* face=0 );
@ -3861,9 +3859,8 @@ namespace { // Structures used by FixQuadraticElements()
else else
_normal.SetCoord(1e-33,0,0); _normal.SetCoord(1e-33,0,0);
#ifdef _DEBUG_
_face = face; _face = face;
#else
(void)face; // unused in release mode (void)face; // unused in release mode
#endif #endif
} }
@ -4963,12 +4960,11 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
if ( !myMesh->HasShapeToMesh() ) return; if ( !myMesh->HasShapeToMesh() ) return;
SetSubShape( myMesh->GetShapeToMesh() ); SetSubShape( myMesh->GetShapeToMesh() );
#ifdef _DEBUG_
int nbSolids = 0; int nbSolids = 0;
TopTools_IndexedMapOfShape solids; TopTools_IndexedMapOfShape solids;
TopExp::MapShapes(myShape,TopAbs_SOLID,solids); TopExp::MapShapes(myShape,TopAbs_SOLID,solids);
nbSolids = solids.Extent(); nbSolids = solids.Extent();
#endif
TopTools_MapOfShape faces; // faces not in solid or in not meshed solid TopTools_MapOfShape faces; // faces not in solid or in not meshed solid
for ( TopExp_Explorer f(myShape,TopAbs_FACE,TopAbs_SOLID); f.More(); f.Next() ) { for ( TopExp_Explorer f(myShape,TopAbs_FACE,TopAbs_SOLID); f.More(); f.Next() ) {
faces.Add( f.Current() ); // not in solid faces.Add( f.Current() ); // not in solid
@ -4979,9 +4975,8 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
faces.Add( f.Current() ); // in not meshed solid faces.Add( f.Current() ); // in not meshed solid
} }
else { // fix nodes in the solid and its faces else { // fix nodes in the solid and its faces
#ifdef _DEBUG_
MSG("FIX SOLID " << nbSolids-- << " #" << GetMeshDS()->ShapeToIndex(s.Current())); MSG("FIX SOLID " << nbSolids-- << " #" << GetMeshDS()->ShapeToIndex(s.Current()));
#endif
SMESH_MesherHelper h(*myMesh); SMESH_MesherHelper h(*myMesh);
h.SetSubShape( s.Current() ); h.SetSubShape( s.Current() );
h.ToFixNodeParameters(true); h.ToFixNodeParameters(true);
@ -5101,13 +5096,15 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
// hasRectFaces = hasRectFaces || // hasRectFaces = hasRectFaces ||
// ( volTool.GetVolumeType() == SMDS_VolumeTool::QUAD_HEXA || // ( volTool.GetVolumeType() == SMDS_VolumeTool::QUAD_HEXA ||
// volTool.GetVolumeType() == SMDS_VolumeTool::QUAD_PENTA ); // volTool.GetVolumeType() == SMDS_VolumeTool::QUAD_PENTA );
#ifdef _DEBUG_
if ( nbN == 6 ) if (SALOME::VerbosityActivated())
pFace->_face = GetMeshDS()->FindFace(faceNodes[0],faceNodes[2],faceNodes[4]); {
else if ( nbN == 6 )
pFace->_face = GetMeshDS()->FindFace(faceNodes[0],faceNodes[2], pFace->_face = GetMeshDS()->FindFace(faceNodes[0],faceNodes[2],faceNodes[4]);
faceNodes[4],faceNodes[6] ); else
#endif pFace->_face = GetMeshDS()->FindFace(faceNodes[0],faceNodes[2],
faceNodes[4],faceNodes[6] );
}
} }
// collect pyramid apexes for further correction // collect pyramid apexes for further correction
if ( vol->NbCornerNodes() == 5 ) if ( vol->NbCornerNodes() == 5 )
@ -5339,20 +5336,22 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
move = gp_Vec( XYZ((*link1)->_mediumNode), newPnt.Transformed(loc) ); move = gp_Vec( XYZ((*link1)->_mediumNode), newPnt.Transformed(loc) );
if ( SMDS_FacePositionPtr nPos = (*link1)->_mediumNode->GetPosition()) if ( SMDS_FacePositionPtr nPos = (*link1)->_mediumNode->GetPosition())
nPos->SetParameters( newUV.X(), newUV.Y() ); nPos->SetParameters( newUV.X(), newUV.Y() );
#ifdef _DEBUG_
if ( (XYZ((*link1)->node1()) - XYZ((*link1)->node2())).SquareModulus() < if (SALOME::VerbosityActivated())
move.SquareMagnitude())
{ {
gp_XY uv0 = faceHlp.GetNodeUV( face, (*link0)->_mediumNode, 0, &checkUV ); if ( (XYZ((*link1)->node1()) - XYZ((*link1)->node2())).SquareModulus() <
gp_XY uv2 = faceHlp.GetNodeUV( face, (*link2)->_mediumNode, 0, &checkUV ); move.SquareMagnitude())
MSG( "TOO LONG MOVE \t" << {
"uv0: "<<uv0.X()<<", "<<uv0.Y()<<" \t" << gp_XY uv0 = faceHlp.GetNodeUV( face, (*link0)->_mediumNode, 0, &checkUV );
"uv2: "<<uv2.X()<<", "<<uv2.Y()<<" \t" << gp_XY uv2 = faceHlp.GetNodeUV( face, (*link2)->_mediumNode, 0, &checkUV );
"uvOld: "<<oldUV.X()<<", "<<oldUV.Y()<<" \t" << MSG( "TOO LONG MOVE \t" <<
"newUV: "<<newUV.X()<<", "<<newUV.Y()<<" \t"); "uv0: "<<uv0.X()<<", "<<uv0.Y()<<" \t" <<
uv0.SetX( uv2.X() ); // avoid warning: variable set but not used "uv2: "<<uv2.X()<<", "<<uv2.Y()<<" \t" <<
"uvOld: "<<oldUV.X()<<", "<<oldUV.Y()<<" \t" <<
"newUV: "<<newUV.X()<<", "<<newUV.Y()<<" \t");
uv0.SetX( uv2.X() ); // avoid warning: variable set but not used
}
} }
#endif
(*link1)->Move( move, /*sum=*/false, /*is2dFixed=*/true ); (*link1)->Move( move, /*sum=*/false, /*is2dFixed=*/true );
} }
MSG( "Move " << (*link1)->_mediumNode->GetID() << " following " MSG( "Move " << (*link1)->_mediumNode->GetID() << " following "
@ -5587,8 +5586,7 @@ void SMESH_MesherHelper::WriteShape(const TopoDS_Shape& s)
{ {
const char* name = "/tmp/shape.brep"; const char* name = "/tmp/shape.brep";
BRepTools::Write( s, name ); BRepTools::Write( s, name );
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::cout << name << std::endl; std::cout << name << std::endl;
#endif
} }

View File

@ -4925,11 +4925,12 @@ list< SMESH_Pattern::TPoint* > & SMESH_Pattern::getShapePoints(const int theShap
void SMESH_Pattern::DumpPoints() const void SMESH_Pattern::DumpPoints() const
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
vector< TPoint >::const_iterator pVecIt = myPoints.begin(); {
for ( int i = 0; pVecIt != myPoints.end(); pVecIt++, i++ ) vector< TPoint >::const_iterator pVecIt = myPoints.begin();
MESSAGE_ADD ( std::endl << i << ": " << *pVecIt ); for ( int i = 0; pVecIt != myPoints.end(); pVecIt++, i++ )
#endif MESSAGE_ADD ( std::endl << i << ": " << *pVecIt );
}
} }
//======================================================================= //=======================================================================
@ -4939,14 +4940,15 @@ void SMESH_Pattern::DumpPoints() const
SMESH_Pattern::TPoint::TPoint() SMESH_Pattern::TPoint::TPoint()
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
myInitXYZ.SetCoord(7,7,7); {
myInitUV.SetCoord(7.,7.); myInitXYZ.SetCoord(7,7,7);
myInitU = 7; myInitUV.SetCoord(7.,7.);
myXYZ.SetCoord(7,7,7); myInitU = 7;
myUV.SetCoord(7.,7.); myXYZ.SetCoord(7,7,7);
myU = 7; myUV.SetCoord(7.,7.);
#endif myU = 7;
}
} }
//======================================================================= //=======================================================================

View File

@ -184,9 +184,9 @@ void SMESHDS_GroupBase::SetColorGroup(int theColorGroup)
if ( aR < 0. || aR > 1. || // PAL19395 if ( aR < 0. || aR > 1. || // PAL19395
aG < 0. || aG > 1. || aG < 0. || aG > 1. ||
aB < 0. || aB > 1. ) aB < 0. || aB > 1. )
// #ifdef _DEBUG_ // if (SALOME::VerbosityActivated())
// cout << "SMESHDS_GroupBase::SetColorGroup("<<theColorGroup<<"), invalid color ignored"<<endl; // cout << "SMESHDS_GroupBase::SetColorGroup("<<theColorGroup<<"), invalid color ignored"<<endl;
// #endif
return; return;
Quantity_Color aColor( aR, aG, aB, Quantity_TOC_RGB ); Quantity_Color aColor( aR, aG, aB, Quantity_TOC_RGB );
SetColor( aColor ); SetColor( aColor );

View File

@ -1060,9 +1060,9 @@ void SMESHGUI_BaseComputeOp::computeMesh()
} }
} }
catch (...) { catch (...) {
#ifdef _DEBUG_
MESSAGE ( "Exception thrown during mesh visualization" ); MESSAGE ( "Exception thrown during mesh visualization" );
#endif
if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning? if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
SMESH::OnVisuException(); SMESH::OnVisuException();
} }

View File

@ -1557,23 +1557,26 @@ int SMESH_Block::GetOrderedEdges (const TopoDS_Face& theFace,
theEdges.begin(), ++theEdges.begin()); theEdges.begin(), ++theEdges.begin());
TopExp::Vertices( theEdges.front(), vv[0], vv[1], true ); TopExp::Vertices( theEdges.front(), vv[0], vv[1], true );
if ( iE++ > theNbEdgesInWires.back() ) { if ( iE++ > theNbEdgesInWires.back() ) {
#ifdef _DEBUG_
gp_Pnt p = BRep_Tool::Pnt( theFirstVertex ); if (SALOME::VerbosityActivated())
MESSAGE ( " : Warning : vertex "<< theFirstVertex.TShape().operator->()
<< " ( " << p.X() << " " << p.Y() << " " << p.Z() << " )"
<< " not found in outer wire of face "<< theFace.TShape().operator->()
<< " with vertices: " );
wExp.Init( *wlIt, theFace );
for ( int i = 0; wExp.More(); wExp.Next(), i++ )
{ {
TopoDS_Edge edge = wExp.Current(); gp_Pnt p = BRep_Tool::Pnt( theFirstVertex );
edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() )); MESSAGE ( " : Warning : vertex "<< theFirstVertex.TShape().operator->()
TopoDS_Vertex v = TopExp::FirstVertex( edge, true ); << " ( " << p.X() << " " << p.Y() << " " << p.Z() << " )"
gp_Pnt p = BRep_Tool::Pnt( v ); << " not found in outer wire of face "<< theFace.TShape().operator->()
MESSAGE_ADD ( i << " " << v.TShape().operator->() << " " << " with vertices: " );
<< p.X() << " " << p.Y() << " " << p.Z() << " " << std::endl ); wExp.Init( *wlIt, theFace );
for ( int i = 0; wExp.More(); wExp.Next(), i++ )
{
TopoDS_Edge edge = wExp.Current();
edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
TopoDS_Vertex v = TopExp::FirstVertex( edge, true );
gp_Pnt p = BRep_Tool::Pnt( v );
MESSAGE_ADD ( i << " " << v.TShape().operator->() << " "
<< p.X() << " " << p.Y() << " " << p.Z() << " " << std::endl );
}
} }
#endif
break; // break infinite loop break; // break infinite loop
} }
} }

View File

@ -286,10 +286,8 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
TElementBoxPool& elBoPool = getLimitAndPool()->_elBoPool; TElementBoxPool& elBoPool = getLimitAndPool()->_elBoPool;
#ifdef _DEBUG_ if (SALOME::VerbosityActivated() && theElemIt && !theElemIt->more() )
if ( theElemIt && !theElemIt->more() )
std::cout << "WARNING: ElementBndBoxTree constructed on empty iterator!" << std::endl; std::cout << "WARNING: ElementBndBoxTree constructed on empty iterator!" << std::endl;
#endif
SMDS_ElemIteratorPtr elemIt = theElemIt ? theElemIt : mesh.elementsIterator( elemType ); SMDS_ElemIteratorPtr elemIt = theElemIt ? theElemIt : mesh.elementsIterator( elemType );
while ( elemIt->more() ) while ( elemIt->more() )

View File

@ -2019,12 +2019,15 @@ namespace SMESH_MeshAlgos
{ {
if ( nodes[i] == nodes[i+1] || nodes[i] == nodes[i+2] || nodes[i+1] == nodes[i+2] ) if ( nodes[i] == nodes[i+1] || nodes[i] == nodes[i+2] || nodes[i+1] == nodes[i+2] )
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::cerr << "BAD tria" << std::endl; {
cf.Dump(); std::cerr << "BAD tria" << std::endl;
#else cf.Dump();
if ( i < 0 ) cf.Dump(); // avoid "CutFace::Dump() unused in release mode" }
#endif else
{
if ( i < 0 ) cf.Dump(); // avoid "CutFace::Dump() unused in release mode"
}
continue; continue;
} }
if (!( tria = myMesh->FindFace( nodes[i], nodes[i+1], nodes[i+2] ))) if (!( tria = myMesh->FindFace( nodes[i], nodes[i+1], nodes[i+2] )))

View File

@ -41,11 +41,8 @@ const char* SMESH::returnError(const char* txt)
void SMESH::printErrorInDebugMode(const char* txt) void SMESH::printErrorInDebugMode(const char* txt)
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::cerr << txt << " " << __FILE__ << ": " << __LINE__ << std::endl; std::cerr << txt << " " << __FILE__ << ": " << __LINE__ << std::endl;
#else
(void)txt; // unused in release mode
#endif
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -932,11 +932,13 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
"Geom_POLYHEDRA", "Geom_BALL" }; "Geom_POLYHEDRA", "Geom_BALL" };
if ( -1 < iGeom && iGeom < nbTypes ) if ( -1 < iGeom && iGeom < nbTypes )
Threshold = SMESH + types[ iGeom ]; Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_
// is types complete? (compilation failure means that enum GeometryType changed) if (SALOME::VerbosityActivated())
static_assert( sizeof(types) / sizeof(const char*) == nbTypes, {
"Update names of GeometryType's!!!" ); // is types complete? (compilation failure means that enum GeometryType changed)
#endif static_assert( sizeof(types) / sizeof(const char*) == nbTypes,
"Update names of GeometryType's!!!" );
}
} }
if (Type == "SMESH.FT_EntityType") if (Type == "SMESH.FT_EntityType")
{ {
@ -953,11 +955,13 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
"Entity_Polyhedra", "Entity_Quad_Polyhedra", "Entity_Ball" }; "Entity_Polyhedra", "Entity_Quad_Polyhedra", "Entity_Ball" };
if ( -1 < iGeom && iGeom < nbTypes ) if ( -1 < iGeom && iGeom < nbTypes )
Threshold = SMESH + types[ iGeom ]; Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_
// is 'types' complete? (compilation failure means that enum EntityType changed) if (SALOME::VerbosityActivated())
static_assert( sizeof(types) / sizeof(const char*) == nbTypes, {
"Update names of EntityType's!!!" ); // is 'types' complete? (compilation failure means that enum EntityType changed)
#endif static_assert( sizeof(types) / sizeof(const char*) == nbTypes,
"Update names of EntityType's!!!" );
}
} }
} }
if ( ThresholdID.Length() != 2 ) // neither '' nor "" if ( ThresholdID.Length() != 2 ) // neither '' nor ""

View File

@ -627,14 +627,19 @@ void SMESH_Gen_i::SetEmbeddedMode( CORBA::Boolean theMode )
if (!envNoCatchSignals || !atoi(envNoCatchSignals)) if (!envNoCatchSignals || !atoi(envNoCatchSignals))
{ {
bool raiseFPE; bool raiseFPE;
#ifdef _DEBUG_
raiseFPE = true; if (SALOME::VerbosityActivated())
char* envDisableFPE = getenv("DISABLE_FPE"); {
if (envDisableFPE && atoi(envDisableFPE)) raiseFPE = true;
char* envDisableFPE = getenv("DISABLE_FPE");
if (envDisableFPE && atoi(envDisableFPE))
raiseFPE = false;
}
else
{
raiseFPE = false; raiseFPE = false;
#else }
raiseFPE = false;
#endif
OSD::SetSignal( raiseFPE ); OSD::SetSignal( raiseFPE );
} }
// else OSD::SetSignal() is called in GUI // else OSD::SetSignal() is called in GUI
@ -6504,8 +6509,8 @@ CORBA::Boolean SMESH_Gen_i::IsApplicable ( const char* theAlgoType,
SMESH_CATCH( SMESH::doNothing ); SMESH_CATCH( SMESH::doNothing );
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
cout << "SMESH_Gen_i::IsApplicable(): exception in " << ( theAlgoType ? theAlgoType : "") << endl; cout << "SMESH_Gen_i::IsApplicable(): exception in " << ( theAlgoType ? theAlgoType : "") << endl;
#endif
return true; return true;
} }

View File

@ -591,9 +591,10 @@ void HOMARD_Cas_i::AddBoundaryGroup(const char* BoundaryName, const char* Group)
// //
SALOME::ExceptionStruct es; SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM; es.type = SALOME::BAD_PARAM;
#ifdef _DEBUG_
texte += "\nInvalid AddBoundaryGroup"; if (SALOME::VerbosityActivated())
#endif texte += "\nInvalid AddBoundaryGroup";
INFOS(texte); INFOS(texte);
es.text = CORBA::string_dup(texte.c_str()); es.text = CORBA::string_dup(texte.c_str());
throw SALOME::SALOME_Exception(es); throw SALOME::SALOME_Exception(es);

View File

@ -926,9 +926,9 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
// -- Most probably a bad study was saved when there were // -- Most probably a bad study was saved when there were
// not fixed bugs in SMDS_MeshInfo // not fixed bugs in SMDS_MeshInfo
if ( elemSet.size() < nbElems ) { if ( elemSet.size() < nbElems ) {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
cout << "SMESH_Gen_i::Load(), warning: Node position data is invalid" << endl; cout << "SMESH_Gen_i::Load(), warning: Node position data is invalid" << endl;
#endif
nbElems = elemSet.size(); nbElems = elemSet.size();
} }
// add elements to sub-meshes // add elements to sub-meshes

View File

@ -687,11 +687,8 @@ namespace SMESH
void printException( const char* text ) void printException( const char* text )
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::endl; std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::endl;
#else
(void)text; // unused in release mode
#endif
} }
//======================================================================= //=======================================================================

View File

@ -1317,9 +1317,9 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh,
if ( iLoop > 20 ) if ( iLoop > 20 )
{ {
#ifdef _DEBUG_ if(SALOME::VerbosityActivated())
cout << "Infinite loop in AdaptiveAlgo::Compute()" << endl; cout << "Infinite loop in AdaptiveAlgo::Compute()" << endl;
#endif
sizeDecreased = false; sizeDecreased = false;
break; break;
} }

View File

@ -977,10 +977,7 @@ namespace
int _origNodeInd; // index of _hexNodes[0] node within the _grid int _origNodeInd; // index of _hexNodes[0] node within the _grid
size_t _i,_j,_k; size_t _i,_j,_k;
bool _hasTooSmall; bool _hasTooSmall;
#ifdef _DEBUG_
int _cellID; int _cellID;
#endif
public: public:
Hexahedron(Grid* grid); Hexahedron(Grid* grid);
@ -2429,11 +2426,9 @@ namespace
tgtLink._link = _hexLinks + ( srcLink._link - other._hexLinks ); tgtLink._link = _hexLinks + ( srcLink._link - other._hexLinks );
} }
} }
#ifdef _DEBUG_
_cellID = cellID; if (SALOME::VerbosityActivated())
#else _cellID = cellID;
(void)cellID; // unused in release mode
#endif
} }
//================================================================================ //================================================================================
@ -4249,11 +4244,10 @@ namespace
h->_eIntPoints.reserve(2); h->_eIntPoints.reserve(2);
h->_eIntPoints.push_back( ip ); h->_eIntPoints.push_back( ip );
added = true; added = true;
#ifdef _DEBUG_
// check if ip is really inside the hex // check if ip is really inside the hex
if ( h->isOutParam( ip->_uvw )) if (SALOME::VerbosityActivated() && h->isOutParam( ip->_uvw ))
throw SALOME_Exception("ip outside a hex"); throw SALOME_Exception("ip outside a hex");
#endif
} }
} }
return added; return added;
@ -4816,11 +4810,13 @@ namespace
helper.GetMeshDS()->RemoveFreeElement( v, /*sm=*/nullptr, /*fromGroups=*/false ); helper.GetMeshDS()->RemoveFreeElement( v, /*sm=*/nullptr, /*fromGroups=*/false );
v = nullptr; v = nullptr;
//_hasTooSmall = true; //_hasTooSmall = true;
#ifdef _DEBUG_
std::cout << "Remove INVALID polyhedron, _cellID = " << _cellID if (SALOME::VerbosityActivated())
<< " ijk = ( " << _i << " " << _j << " " << _k << " ) " {
<< " solid " << volDef->_solidID << std::endl; std::cout << "Remove INVALID polyhedron, _cellID = " << _cellID
#endif << " ijk = ( " << _i << " " << _j << " " << _k << " ) "
<< " solid " << volDef->_solidID << std::endl;
}
} }
} }
} }
@ -5253,14 +5249,14 @@ namespace
*/ */
bool Hexahedron::debugDumpLink( Hexahedron::_Link* link ) bool Hexahedron::debugDumpLink( Hexahedron::_Link* link )
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
gp_Pnt p1 = link->_nodes[0]->Point(), p2 = link->_nodes[1]->Point(); {
cout << "BUG: not shared link. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl gp_Pnt p1 = link->_nodes[0]->Point(), p2 = link->_nodes[1]->Point();
<< "n1 (" << p1.X() << ", "<< p1.Y() << ", "<< p1.Z() << " )" << endl cout << "BUG: not shared link. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl
<< "n2 (" << p2.X() << ", "<< p2.Y() << ", "<< p2.Z() << " )" << endl; << "n1 (" << p1.X() << ", "<< p1.Y() << ", "<< p1.Z() << " )" << endl
#else << "n2 (" << p2.X() << ", "<< p2.Y() << ", "<< p2.Z() << " )" << endl;
(void)link; // unused in release mode }
#endif
return false; return false;
} }
//================================================================================ //================================================================================

View File

@ -1242,12 +1242,13 @@ bool _QuadFaceGrid::Init(const TopoDS_Face& f, SMESH_ProxyMesh& mesh)
if (mySides.size() != 4) if (mySides.size() != 4)
return false; return false;
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
{
mySides.GetSide( Q_BOTTOM )->SetID( Q_BOTTOM ); mySides.GetSide( Q_BOTTOM )->SetID( Q_BOTTOM );
mySides.GetSide( Q_RIGHT )->SetID( Q_RIGHT ); mySides.GetSide( Q_RIGHT )->SetID( Q_RIGHT );
mySides.GetSide( Q_TOP )->SetID( Q_TOP ); mySides.GetSide( Q_TOP )->SetID( Q_TOP );
mySides.GetSide( Q_LEFT )->SetID( Q_LEFT ); mySides.GetSide( Q_LEFT )->SetID( Q_LEFT );
#endif }
return true; return true;
} }

View File

@ -1148,7 +1148,9 @@ void StdMeshers_FaceSide::reverseProxySubmesh( const TopoDS_Edge& E )
void StdMeshers_FaceSide::dump(const char* msg) const void StdMeshers_FaceSide::dump(const char* msg) const
{ {
#ifdef _DEBUG_ if (!SALOME::VerbosityActivated())
return;
if (msg) MESSAGE ( std::endl << msg ); if (msg) MESSAGE ( std::endl << msg );
MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() ); MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() ); MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
@ -1176,9 +1178,6 @@ void StdMeshers_FaceSide::dump(const char* msg) const
MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] ); MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl ); MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
} }
#else
(void)msg; // unused in release mode
#endif
} }
//================================================================================ //================================================================================

View File

@ -712,15 +712,14 @@ namespace
void pointsToPython(const std::vector<gp_XYZ>& p) void pointsToPython(const std::vector<gp_XYZ>& p)
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
for ( size_t i = SMESH_Block::ID_V000; i < p.size(); ++i )
{ {
cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ; for ( size_t i = SMESH_Block::ID_V000; i < p.size(); ++i )
SMESH_Block::DumpShapeID( i, cout ) << endl; {
cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ;
SMESH_Block::DumpShapeID( i, cout ) << endl;
}
} }
#else
(void)p; // unused in release mode
#endif
} }
} // namespace } // namespace
@ -3283,10 +3282,12 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA
continue; continue;
} }
} }
#ifdef _DEBUG_
TopTools_IndexedMapOfShape allShapes; // usage: allShapes.FindIndex( s ) if (SALOME::VerbosityActivated())
TopExp::MapShapes( shape, allShapes ); {
#endif TopTools_IndexedMapOfShape allShapes; // usage: allShapes.FindIndex( s )
TopExp::MapShapes( shape, allShapes );
}
TopTools_IndexedDataMapOfShapeListOfShape facesOfEdge; TopTools_IndexedDataMapOfShapeListOfShape facesOfEdge;
TopTools_ListIteratorOfListOfShape faceIt; TopTools_ListIteratorOfListOfShape faceIt;
@ -3475,9 +3476,11 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA
if ( iLoop > allFaces.Extent() * 10 ) if ( iLoop > allFaces.Extent() * 10 )
{ {
isOK = false; isOK = false;
#ifdef _DEBUG_
cerr << "BUG: infinite loop in StdMeshers_Prism_3D::IsApplicable()" << endl; if(SALOME::VerbosityActivated())
#endif {
cerr << "BUG: infinite loop in StdMeshers_Prism_3D::IsApplicable()" << endl;
}
} }
} // while hasAdvanced } // while hasAdvanced
@ -4342,7 +4345,9 @@ bool StdMeshers_PrismAsBlock::IsForwardEdge(SMESHDS_Mesh* meshDS,
void StdMeshers_PrismAsBlock::faceGridToPythonDump(const SMESH_Block::TShapeID face, void StdMeshers_PrismAsBlock::faceGridToPythonDump(const SMESH_Block::TShapeID face,
const int nb) const int nb)
{ {
#ifdef _DEBUG_ if(!SALOME::VerbosityActivated())
return;
gp_XYZ pOnF[6] = { gp_XYZ(0,0,0), gp_XYZ(0,0,1), gp_XYZ pOnF[6] = { gp_XYZ(0,0,0), gp_XYZ(0,0,1),
gp_XYZ(0,0,0), gp_XYZ(0,1,0), gp_XYZ(0,0,0), gp_XYZ(0,1,0),
gp_XYZ(0,0,0), gp_XYZ(1,0,0) }; gp_XYZ(0,0,0), gp_XYZ(1,0,0) };
@ -4378,10 +4383,6 @@ void StdMeshers_PrismAsBlock::faceGridToPythonDump(const SMESH_Block::TShapeID f
<< n << ", " << n+1 << ", " << n << ", " << n+1 << ", "
<< n+nb+2 << ", " << n+nb+1 << "]) " << endl; << n+nb+2 << ", " << n+nb+1 << "]) " << endl;
} }
#else
(void)face; // unused in release mode
(void)nb; // unused in release mode
#endif
} }
//================================================================================ //================================================================================
@ -4989,7 +4990,9 @@ int StdMeshers_PrismAsBlock::TSideFace::InsertSubShapes(TBlockShapes& shapeMap)
void StdMeshers_PrismAsBlock::TSideFace::dumpNodes(int nbNodes) const void StdMeshers_PrismAsBlock::TSideFace::dumpNodes(int nbNodes) const
{ {
#ifdef _DEBUG_ if (!SALOME::VerbosityActivated())
return;
cout << endl << "NODES OF FACE "; SMESH_Block::DumpShapeID( myID, cout ) << endl; cout << endl << "NODES OF FACE "; SMESH_Block::DumpShapeID( myID, cout ) << endl;
THorizontalEdgeAdaptor* hSize0 = (THorizontalEdgeAdaptor*) HorizCurve(0); THorizontalEdgeAdaptor* hSize0 = (THorizontalEdgeAdaptor*) HorizCurve(0);
cout << "Horiz side 0: "; hSize0->dumpNodes(nbNodes); cout << endl; cout << "Horiz side 0: "; hSize0->dumpNodes(nbNodes); cout << endl;
@ -5000,9 +5003,6 @@ void StdMeshers_PrismAsBlock::TSideFace::dumpNodes(int nbNodes) const
TVerticalEdgeAdaptor* vSide1 = (TVerticalEdgeAdaptor*) VertiCurve(1); TVerticalEdgeAdaptor* vSide1 = (TVerticalEdgeAdaptor*) VertiCurve(1);
cout << "Verti side 1: "; vSide1->dumpNodes(nbNodes); cout << endl; cout << "Verti side 1: "; vSide1->dumpNodes(nbNodes); cout << endl;
delete hSize0; delete hSize1; delete vSide0; delete vSide1; delete hSize0; delete hSize1; delete vSide0; delete vSide1;
#else
(void)nbNodes; // unused in release mode
#endif
} }
//================================================================================ //================================================================================
@ -5043,14 +5043,13 @@ gp_Pnt StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::Value(const Standard_Real
void StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::dumpNodes(int nbNodes) const void StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::dumpNodes(int nbNodes) const
{ {
#ifdef _DEBUG_ if (!SALOME::VerbosityActivated())
return;
for ( int i = 0; i < nbNodes && i < (int)myNodeColumn->size(); ++i ) for ( int i = 0; i < nbNodes && i < (int)myNodeColumn->size(); ++i )
cout << (*myNodeColumn)[i]->GetID() << " "; cout << (*myNodeColumn)[i]->GetID() << " ";
if ( nbNodes < (int) myNodeColumn->size() ) if ( nbNodes < (int) myNodeColumn->size() )
cout << myNodeColumn->back()->GetID(); cout << myNodeColumn->back()->GetID();
#else
(void)nbNodes; // unused in release mode
#endif
} }
//================================================================================ //================================================================================
@ -5074,7 +5073,9 @@ gp_Pnt StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::Value(const Standard_Rea
void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) const void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) const
{ {
#ifdef _DEBUG_ if (!SALOME::VerbosityActivated())
return;
// Not bedugged code. Last node is sometimes incorrect // Not bedugged code. Last node is sometimes incorrect
const TSideFace* side = mySide; const TSideFace* side = mySide;
double u = 0; double u = 0;
@ -5108,9 +5109,6 @@ void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) con
side->GetColumns( u , col, col2 ); side->GetColumns( u , col, col2 );
if ( n != col->second[ i ] ) if ( n != col->second[ i ] )
cout << col->second[ i ]->GetID(); cout << col->second[ i ]->GetID();
#else
(void)nbNodes; // unused in release mode
#endif
} }
//================================================================================ //================================================================================

View File

@ -124,14 +124,19 @@ namespace {
bool storeShapeForDebug(const TopoDS_Shape& shape) bool storeShapeForDebug(const TopoDS_Shape& shape)
{ {
bool toShow; bool toShow;
#ifdef _DEBUG_
const char* type[] ={"COMPOUND","COMPSOLID","SOLID","SHELL","FACE","WIRE","EDGE","VERTEX"}; if (SALOME::VerbosityActivated())
BRepTools::Write( shape, SMESH_Comment("/tmp/") << type[shape.ShapeType()] << "_" {
<< shape.TShape().operator->() << ".brep"); const char* type[] ={"COMPOUND","COMPSOLID","SOLID","SHELL","FACE","WIRE","EDGE","VERTEX"};
toShow = !theMeshDS[0]; // no show BRepTools::Write( shape, SMESH_Comment("/tmp/") << type[shape.ShapeType()] << "_"
#else << shape.TShape().operator->() << ".brep");
toShow = theMeshDS[0]; // no show toShow = !theMeshDS[0]; // no show
#endif }
else
{
toShow = theMeshDS[0]; // no show
}
if ( toShow ) { if ( toShow ) {
show_shape( shape, "avoid warning: show_shape() defined but not used"); show_shape( shape, "avoid warning: show_shape() defined but not used");
show_list( "avoid warning: show_list() defined but not used", list< TopoDS_Edge >() ); show_list( "avoid warning: show_list() defined but not used", list< TopoDS_Edge >() );
@ -542,10 +547,11 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
// b) find association of a couple of vertices and recall self. // b) find association of a couple of vertices and recall self.
// //
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
theMeshDS[0] = theMesh1->GetMeshDS(); // debug {
theMeshDS[1] = theMesh2->GetMeshDS(); theMeshDS[0] = theMesh1->GetMeshDS(); // debug
#endif theMeshDS[1] = theMesh2->GetMeshDS();
}
// ================================================================================= // =================================================================================
// 1) Is it the case of associating a group member -> another group? (PAL16202, 16203) // 1) Is it the case of associating a group member -> another group? (PAL16202, 16203)
@ -2803,10 +2809,10 @@ namespace StdMeshers_ProjectionUtils
const double D = M.Determinant(); const double D = M.Determinant();
if ( D < 1e-3 * ( newSrcOrig - _srcOrig ).Modulus() ) if ( D < 1e-3 * ( newSrcOrig - _srcOrig ).Modulus() )
{ {
#ifdef _DEBUG_ if (SALOME::VerbosityActivated())
cerr << "TrsfFinder3D::Invert()" cerr << "TrsfFinder3D::Invert()"
<< "D " << M.Determinant() << " IsSingular " << M.IsSingular() << endl; << "D " << M.Determinant() << " IsSingular " << M.IsSingular() << endl;
#endif
return false; return false;
} }
gp_Mat Minv = M.Inverted(); gp_Mat Minv = M.Inverted();

View File

@ -2507,9 +2507,8 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
TAssocTool::Morph morph( srcWires ); TAssocTool::Morph morph( srcWires );
morph.Perform( helper, tgtWires, helper.GetSurface( tgtFace ), morph.Perform( helper, tgtWires, helper.GetSurface( tgtFace ),
_src2tgtNodes, /*moveAll=*/true ); _src2tgtNodes, /*moveAll=*/true );
#ifdef _DEBUG_ if(SALOME::VerbosityActivated())
cout << "StdMeshers_Projection_2D: Projection mesh IsDistorted2D() ==> do morph" << endl; cout << "StdMeshers_Projection_2D: Projection mesh IsDistorted2D() ==> do morph" << endl;
#endif
if ( !fixDistortedFaces( helper, tgtWires )) // smooth and check if ( !fixDistortedFaces( helper, tgtWires )) // smooth and check
return error("Invalid mesh generated"); return error("Invalid mesh generated");

View File

@ -1194,10 +1194,8 @@ namespace
theVariants.insert( *this ); theVariants.insert( *this );
#ifndef _DEBUG_ if (SALOME::VerbosityActivated() && theVariants.size() > 1 ) // erase a worse variant
if ( theVariants.size() > 1 ) // erase a worse variant
theVariants.erase( ++theVariants.begin() ); theVariants.erase( ++theVariants.begin() );
#endif
}; };
// first criterion - equality of nbSeg of opposite sides // first criterion - equality of nbSeg of opposite sides

View File

@ -4644,7 +4644,9 @@ void _Simplex::SortSimplices(vector<_Simplex>& simplices)
void _ViscousBuilder::makeGroupOfLE() void _ViscousBuilder::makeGroupOfLE()
{ {
#ifdef _DEBUG_ if (!SALOME::VerbosityActivated())
return;
for ( size_t i = 0 ; i < _sdVec.size(); ++i ) for ( size_t i = 0 ; i < _sdVec.size(); ++i )
{ {
if ( _sdVec[i]._n2eMap.empty() ) continue; if ( _sdVec[i]._n2eMap.empty() ) continue;
@ -4700,7 +4702,6 @@ void _ViscousBuilder::makeGroupOfLE()
<< "'%s-%s' % (faceId1+1, faceId2))"); << "'%s-%s' % (faceId1+1, faceId2))");
dumpFunctionEnd(); dumpFunctionEnd();
} }
#endif
} }
//================================================================================ //================================================================================
@ -5835,27 +5836,26 @@ void _ViscousBuilder::putOnOffsetSurface( _EdgesOnShape& eos,
} }
} }
if (SALOME::VerbosityActivated())
#ifdef _DEBUG_
// dumpMove() for debug
size_t i = 0;
for ( ; i < eos._edges.size(); ++i )
if ( eos._edges[i]->Is( _LayerEdge::MARKED ))
break;
if ( i < eos._edges.size() )
{ {
dumpFunction(SMESH_Comment("putOnOffsetSurface_") << eos.ShapeTypeLetter() << eos._shapeID // dumpMove() for debug
<< "_InfStep" << infStep << "_" << Abs( smooStep )); size_t i = 0;
for ( ; i < eos._edges.size(); ++i ) for ( ; i < eos._edges.size(); ++i )
if ( eos._edges[i]->Is( _LayerEdge::MARKED ))
break;
if ( i < eos._edges.size() )
{ {
if ( eos._edges[i]->Is( _LayerEdge::MARKED )) { dumpFunction(SMESH_Comment("putOnOffsetSurface_") << eos.ShapeTypeLetter() << eos._shapeID
dumpMove( eos._edges[i]->_nodes.back() ); << "_InfStep" << infStep << "_" << Abs( smooStep ));
for ( ; i < eos._edges.size(); ++i )
{
if ( eos._edges[i]->Is( _LayerEdge::MARKED )) {
dumpMove( eos._edges[i]->_nodes.back() );
}
} }
dumpFunctionEnd();
} }
dumpFunctionEnd();
} }
#endif
_ConvexFace* cnvFace; _ConvexFace* cnvFace;
if ( moveAll != _LayerEdge::UPD_NORMAL_CONV && if ( moveAll != _LayerEdge::UPD_NORMAL_CONV &&

View File

@ -240,9 +240,7 @@ namespace VISCOUS_2D
bool SetNewLength( const double length ); bool SetNewLength( const double length );
#ifdef _DEBUG_ int _ID; // debug
int _ID;
#endif
}; };
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
/*! /*!
@ -674,9 +672,10 @@ bool _ViscousBuilder2D::error(const string& text )
_error->myAlgo = smError->myAlgo; _error->myAlgo = smError->myAlgo;
smError = _error; smError = _error;
} }
#ifdef _DEBUG_
cout << "_ViscousBuilder2D::error " << text << endl; if (SALOME::VerbosityActivated())
#endif cout << "_ViscousBuilder2D::error " << text << endl;
return false; return false;
} }
@ -1339,9 +1338,9 @@ void _ViscousBuilder2D::setLayerEdgeData( _LayerEdge& lEdge,
lEdge._ray.SetDirection( lEdge._normal2D ); lEdge._ray.SetDirection( lEdge._normal2D );
lEdge._isBlocked = false; lEdge._isBlocked = false;
lEdge._length2D = 0; lEdge._length2D = 0;
#ifdef _DEBUG_
lEdge._ID = _nbLE++; if (SALOME::VerbosityActivated())
#endif lEdge._ID = _nbLE++;
} }
//================================================================================ //================================================================================