Merge from V6_main 19/03/2013

This commit is contained in:
vsr 2013-03-19 16:22:36 +00:00
parent 31ca0b3e3b
commit de9ffb0699
4 changed files with 57 additions and 13 deletions

View File

@ -0,0 +1,23 @@
# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(docdir ${CMAKE_INSTALL_PREFIX}/share/doc/salome)
FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
INSTALL(FILES ${files} DESTINATION ${docdir}/examples/SMESH)

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH DriverMED : driver to read and write 'med' files // SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_R_SMESHDS_Mesh.cxx // File : DriverMED_R_SMESHDS_Mesh.cxx
// Module : SMESH // Module : SMESH
//
#include "DriverMED_R_SMESHDS_Mesh.h" #include "DriverMED_R_SMESHDS_Mesh.h"
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "utilities.h" #include "utilities.h"
@ -36,6 +35,8 @@
#include "MED_CoordUtils.hxx" #include "MED_CoordUtils.hxx"
#include "MED_Utilities.hxx" #include "MED_Utilities.hxx"
#include <NCollection_Map.hxx>
#include <stdlib.h> #include <stdlib.h>
#ifdef _DEBUG_ #ifdef _DEBUG_
@ -71,7 +72,7 @@ DriverMED_R_SMESHDS_Mesh
::Perform() ::Perform()
{ {
Status aResult = DRS_FAIL; Status aResult = DRS_FAIL;
bool isDescConn = false; bool isDescConn = false; // Mantis issue 0020483
#ifndef _DEXCEPT_ #ifndef _DEXCEPT_
try{ try{
#endif #endif
@ -175,13 +176,17 @@ DriverMED_R_SMESHDS_Mesh
} }
// Are there any MED cells in descending connectivity // Are there any MED cells in descending connectivity
// Mantis issue 0020483
//--------------------------------------------------- //---------------------------------------------------
NCollection_Map<EEntiteMaillage> aDescendingEntitiesMap;
if (!isDescConn) { if (!isDescConn) {
MED::TEntityInfo aEntityInfoDesc = aMed->GetEntityInfo(aMeshInfo, eDESC); MED::TEntityInfo aEntityInfoDesc = aMed->GetEntityInfo(aMeshInfo, eDESC);
MED::TEntityInfo::iterator anEntityIterDesc = aEntityInfoDesc.begin(); MED::TEntityInfo::iterator anEntityIterDesc = aEntityInfoDesc.begin();
for (; anEntityIterDesc != aEntityInfoDesc.end() && !isDescConn; anEntityIterDesc++) { //for (; anEntityIterDesc != aEntityInfoDesc.end() && !isDescConn; anEntityIterDesc++) {
for (; anEntityIterDesc != aEntityInfoDesc.end(); anEntityIterDesc++) {
const EEntiteMaillage& anEntity = anEntityIterDesc->first; const EEntiteMaillage& anEntity = anEntityIterDesc->first;
if (anEntity != eNOEUD) isDescConn = true; aDescendingEntitiesMap.Add(anEntity);
//if (anEntity != eNOEUD) isDescConn = true;
} }
} }
@ -193,6 +198,7 @@ DriverMED_R_SMESHDS_Mesh
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin(); MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
for (; anEntityIter != aEntityInfo.end(); anEntityIter++) { for (; anEntityIter != aEntityInfo.end(); anEntityIter++) {
const EEntiteMaillage& anEntity = anEntityIter->first; const EEntiteMaillage& anEntity = anEntityIter->first;
aDescendingEntitiesMap.Remove(anEntity); // Mantis issue 0020483
if (anEntity == eNOEUD) continue; if (anEntity == eNOEUD) continue;
// Reading MED cells to the corresponding SMDS structure // Reading MED cells to the corresponding SMDS structure
//------------------------------------------------------ //------------------------------------------------------
@ -904,8 +910,9 @@ DriverMED_R_SMESHDS_Mesh
}} }}
} }
} }
} if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483
} } // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++)
} // if aNbMeshes
#ifndef _DEXCEPT_ #ifndef _DEXCEPT_
}catch(const std::exception& exc){ }catch(const std::exception& exc){
INFOS("The following exception was caught:\n\t"<<exc.what()); INFOS("The following exception was caught:\n\t"<<exc.what());
@ -918,6 +925,7 @@ DriverMED_R_SMESHDS_Mesh
if (myMesh) if (myMesh)
myMesh->compactMesh(); myMesh->compactMesh();
// Mantis issue 0020483
if (aResult == DRS_OK && isDescConn) { if (aResult == DRS_OK && isDescConn) {
INFOS("There are some elements in descending connectivity in med file. They were not read !!!"); INFOS("There are some elements in descending connectivity in med file. They were not read !!!");
aResult = DRS_WARN_DESCENDING; aResult = DRS_WARN_DESCENDING;
@ -944,10 +952,10 @@ list<string> DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
aMeshNames.push_back(aMeshInfo->GetName()); aMeshNames.push_back(aMeshInfo->GetName());
} }
} }
}catch(const std::exception& exc){ } catch(const std::exception& exc) {
INFOS("Following exception was caught:\n\t"<<exc.what()); INFOS("Following exception was caught:\n\t"<<exc.what());
theStatus = DRS_FAIL; theStatus = DRS_FAIL;
}catch(...){ } catch(...) {
INFOS("Unknown exception was caught !!!"); INFOS("Unknown exception was caught !!!");
theStatus = DRS_FAIL; theStatus = DRS_FAIL;
} }

View File

@ -160,10 +160,10 @@ SMDS_Mesh::SMDS_Mesh()
myGrid->Initialize(); myGrid->Initialize();
myGrid->Allocate(); myGrid->Allocate();
vtkPoints* points = vtkPoints::New(); vtkPoints* points = vtkPoints::New();
// rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion" // bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
// using double type for storing coordinates of nodes instead float. // Use double type for storing coordinates of nodes instead of float.
points->SetDataType(VTK_DOUBLE); points->SetDataType(VTK_DOUBLE);
points->SetNumberOfPoints(SMDS_Mesh::chunkSize); points->SetNumberOfPoints(0 /*SMDS_Mesh::chunkSize*/);
myGrid->SetPoints( points ); myGrid->SetPoints( points );
points->Delete(); points->Delete();
myGrid->BuildLinks(); myGrid->BuildLinks();

View File

@ -117,6 +117,19 @@ namespace {
*/ */
//================================================================================ //================================================================================
const double a14divPI = 14. / M_PI;
inline double segLength(double S0, double edgeLen, double minLen )
{
// PAL10237
// S = S0 * f(L/Lmin) where f(x) = 1 + (2/Pi * 7 * atan(x/5) )
// =>
// S = S0 * ( 1 + 14/PI * atan( L / ( 5 * Lmin )))
return S0 * ( 1. + a14divPI * atan( edgeLen / ( 5 * minLen )));
}
#if 0
//const double a14divPI = 14. / M_PI; //const double a14divPI = 14. / M_PI;
const double a2div7divPI = 2. / 7. / M_PI; const double a2div7divPI = 2. / 7. / M_PI;
@ -141,7 +154,7 @@ namespace {
const double Lratio = edgeLen / minLen; const double Lratio = edgeLen / minLen;
return S0 * ( 1. + a2div7divPI * Lratio * atan( 5 * Lratio )); return S0 * ( 1. + a2div7divPI * Lratio * atan( 5 * Lratio ));
} }
#endif
//================================================================================ //================================================================================
/*! /*!
* \brief Compute segment length for all edges * \brief Compute segment length for all edges