From: eap Date: Tue, 17 Feb 2015 13:23:19 +0000 (+0300) Subject: 22834: [CEA 1347] Viscous layers: be able to choose the extrusion method (imp_1347_vi... X-Git-Tag: V7_6_0a1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=59912620be9aafb6ecbb8f7be9e53e3bacdff93e;p=modules%2Fsmesh.git 22834: [CEA 1347] Viscous layers: be able to choose the extrusion method (imp_1347_viscous_layers.py) + fix some regressions --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 4e673ebce..20aeb54af 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -4352,6 +4352,7 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem, std::swap( itNN[0], itNN[1] ); std::swap( prevNod[0], prevNod[1] ); std::swap( nextNod[0], nextNod[1] ); + isSingleNode.swap( isSingleNode[0], isSingleNode[1] ); if ( nbSame > 0 ) sames[0] = 1 - sames[0]; iNotSameNode = 1 - iNotSameNode; diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 8ffd46ef7..0e298af61 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -4739,7 +4739,6 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID, SALOMEDS::SObject_wrap aSO = _gen_i->PublishGroup( study, mesh, groups[ iG ], GEOM::GEOM_Object::_nil(), theGroupName); - aSO->_is_nil(); // avoid "unused variable" warning } SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( groups[ iG ]); if ( !grp_i ) continue; diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index 5b962142f..fcb3d2d3f 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -144,7 +144,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm): reversedEdges, UseExisting = [], reversedEdges entry = self.MainShapeEntry() reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges) - if s == []: + if not s: hyp = self.Hypothesis("NumberOfSegments", [n, reversedEdgeInd, entry], UseExisting=UseExisting, CompareMethod=self._compareNumberOfSegments) @@ -152,7 +152,6 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm): hyp = self.Hypothesis("NumberOfSegments", [n,s, reversedEdgeInd, entry], UseExisting=UseExisting, CompareMethod=self._compareNumberOfSegments) - hyp.SetDistrType( 1 ) hyp.SetScaleFactor(s) hyp.SetNumberOfSegments(n) hyp.SetReversedEdges( reversedEdgeInd ) @@ -1038,11 +1037,10 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm): if self.algoType != "RadialPrism_3D": print "Prism_3D algorith doesn't support any hyposesis" return None - if s == []: + if not s: hyp = self.OwnHypothesis("NumberOfSegments", [n]) else: hyp = self.OwnHypothesis("NumberOfSegments", [n,s]) - hyp.SetDistrType( 1 ) hyp.SetScaleFactor(s) hyp.SetNumberOfSegments(n) return hyp diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index db9703352..2f0d05b9d 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -185,8 +185,8 @@ void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor) //throw SALOME_Exception(LOCALIZED("not a scale distribution")); if (scaleFactor < PRECISION) throw SALOME_Exception(LOCALIZED("scale factor must be positive")); - //if (fabs(scaleFactor - 1.0) < PRECISION) - // throw SALOME_Exception(LOCALIZED("scale factor must not be equal to 1")); + if (fabs(scaleFactor - 1.0) < PRECISION) + _distrType = DT_Regular; if (fabs(_scaleFactor - scaleFactor) > PRECISION) { diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 61acb13c5..e6c0dd7be 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -2920,6 +2920,7 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge, } else // !useGeometry - get _normal using surrounding mesh faces { + set faceIds; SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator(SMDSAbs_Face); while ( fIt->more() ) @@ -2927,6 +2928,8 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge, const SMDS_MeshElement* face = fIt->next(); if ( eos.GetNormal( face, geomNorm )) { + if ( onShrinkShape && !faceIds.insert( face->getshapeId() ).second ) + continue; // use only one mesh face on FACE edge._normal += geomNorm.XYZ(); totalNbFaces++; }