22834: [CEA 1347] Viscous layers: be able to choose the extrusion method (imp_1347_viscous_layers.py)

+ fix some regressions
This commit is contained in:
eap 2015-02-17 16:23:19 +03:00
parent 6bac08c1a8
commit 59912620be
5 changed files with 8 additions and 7 deletions

View File

@ -4352,6 +4352,7 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem,
std::swap( itNN[0], itNN[1] ); std::swap( itNN[0], itNN[1] );
std::swap( prevNod[0], prevNod[1] ); std::swap( prevNod[0], prevNod[1] );
std::swap( nextNod[0], nextNod[1] ); std::swap( nextNod[0], nextNod[1] );
isSingleNode.swap( isSingleNode[0], isSingleNode[1] );
if ( nbSame > 0 ) if ( nbSame > 0 )
sames[0] = 1 - sames[0]; sames[0] = 1 - sames[0];
iNotSameNode = 1 - iNotSameNode; iNotSameNode = 1 - iNotSameNode;

View File

@ -4739,7 +4739,6 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID,
SALOMEDS::SObject_wrap aSO = SALOMEDS::SObject_wrap aSO =
_gen_i->PublishGroup( study, mesh, groups[ iG ], _gen_i->PublishGroup( study, mesh, groups[ iG ],
GEOM::GEOM_Object::_nil(), theGroupName); GEOM::GEOM_Object::_nil(), theGroupName);
aSO->_is_nil(); // avoid "unused variable" warning
} }
SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( groups[ iG ]); SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( groups[ iG ]);
if ( !grp_i ) continue; if ( !grp_i ) continue;

View File

@ -144,7 +144,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
reversedEdges, UseExisting = [], reversedEdges reversedEdges, UseExisting = [], reversedEdges
entry = self.MainShapeEntry() entry = self.MainShapeEntry()
reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges) reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges)
if s == []: if not s:
hyp = self.Hypothesis("NumberOfSegments", [n, reversedEdgeInd, entry], hyp = self.Hypothesis("NumberOfSegments", [n, reversedEdgeInd, entry],
UseExisting=UseExisting, UseExisting=UseExisting,
CompareMethod=self._compareNumberOfSegments) CompareMethod=self._compareNumberOfSegments)
@ -152,7 +152,6 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
hyp = self.Hypothesis("NumberOfSegments", [n,s, reversedEdgeInd, entry], hyp = self.Hypothesis("NumberOfSegments", [n,s, reversedEdgeInd, entry],
UseExisting=UseExisting, UseExisting=UseExisting,
CompareMethod=self._compareNumberOfSegments) CompareMethod=self._compareNumberOfSegments)
hyp.SetDistrType( 1 )
hyp.SetScaleFactor(s) hyp.SetScaleFactor(s)
hyp.SetNumberOfSegments(n) hyp.SetNumberOfSegments(n)
hyp.SetReversedEdges( reversedEdgeInd ) hyp.SetReversedEdges( reversedEdgeInd )
@ -1038,11 +1037,10 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
if self.algoType != "RadialPrism_3D": if self.algoType != "RadialPrism_3D":
print "Prism_3D algorith doesn't support any hyposesis" print "Prism_3D algorith doesn't support any hyposesis"
return None return None
if s == []: if not s:
hyp = self.OwnHypothesis("NumberOfSegments", [n]) hyp = self.OwnHypothesis("NumberOfSegments", [n])
else: else:
hyp = self.OwnHypothesis("NumberOfSegments", [n,s]) hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
hyp.SetDistrType( 1 )
hyp.SetScaleFactor(s) hyp.SetScaleFactor(s)
hyp.SetNumberOfSegments(n) hyp.SetNumberOfSegments(n)
return hyp return hyp

View File

@ -185,8 +185,8 @@ void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor)
//throw SALOME_Exception(LOCALIZED("not a scale distribution")); //throw SALOME_Exception(LOCALIZED("not a scale distribution"));
if (scaleFactor < PRECISION) if (scaleFactor < PRECISION)
throw SALOME_Exception(LOCALIZED("scale factor must be positive")); throw SALOME_Exception(LOCALIZED("scale factor must be positive"));
//if (fabs(scaleFactor - 1.0) < PRECISION) if (fabs(scaleFactor - 1.0) < PRECISION)
// throw SALOME_Exception(LOCALIZED("scale factor must not be equal to 1")); _distrType = DT_Regular;
if (fabs(_scaleFactor - scaleFactor) > PRECISION) if (fabs(_scaleFactor - scaleFactor) > PRECISION)
{ {

View File

@ -2920,6 +2920,7 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge,
} }
else // !useGeometry - get _normal using surrounding mesh faces else // !useGeometry - get _normal using surrounding mesh faces
{ {
set<TGeomID> faceIds;
SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator(SMDSAbs_Face); SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator(SMDSAbs_Face);
while ( fIt->more() ) while ( fIt->more() )
@ -2927,6 +2928,8 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge,
const SMDS_MeshElement* face = fIt->next(); const SMDS_MeshElement* face = fIt->next();
if ( eos.GetNormal( face, geomNorm )) if ( eos.GetNormal( face, geomNorm ))
{ {
if ( onShrinkShape && !faceIds.insert( face->getshapeId() ).second )
continue; // use only one mesh face on FACE
edge._normal += geomNorm.XYZ(); edge._normal += geomNorm.XYZ();
totalNbFaces++; totalNbFaces++;
} }