]> SALOME platform Git repositories - plugins/netgenplugin.git/blobdiff - src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx
Salome HOME
Copyright update 2021
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis.cxx
index b9826dbc706f468c9d548ff353e1f1a1b88ab495..91a3a0f00dad5f2952aa7d43bb6b2995bcd1fb87 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -642,8 +642,8 @@ istream & NETGENPlugin_Hypothesis::LoadFrom(istream & load)
  * \retval bool - always false
  */
 //================================================================================
-bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
-                                                  const TopoDS_Shape& theShape)
+bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   /*theMesh*/,
+                                                  const TopoDS_Shape& /*theShape*/)
 {
   return false;
 }
@@ -666,5 +666,14 @@ bool NETGENPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  dflts,
   else if ( theMesh && theMesh->HasShapeToMesh() )
     _minSize    = NETGENPlugin_Mesher::GetDefaultMinSize( theMesh->GetShapeToMesh(), _maxSize );
 
+  if ( dflts._way == SMESH_Hypothesis::BY_AVERAGE_LENGTH )
+  {
+    _minSize      = dflts._elemLength / 100.;
+    _nbSegPerEdge = 1;
+    _chordalError = dflts._elemLength / 2.;
+    _chordalErrorEnabled = true;
+    _quadAllowed  = dflts._quadDominated;
+  }
+
   return _nbSegPerEdge && _maxSize > 0;
 }