MG_Hexa = Mesh_mghexa_vl.Hexahedron(algo=smeshBuilder.MG_Hexa)
MG_Hexa_Parameters = MG_Hexa.Parameters()
-MG_Hexa.SetViscousLayers(5,5,3,"Inward",[13,23])
+MG_Hexa.SetViscousLayers(5,5,3,MG_Hexa.Inward,[13,23])
MG_Hexa_Parameters.SetMinSize( 2 )
MG_Hexa_Parameters.SetMaxSize( 4 )
MG_Hexa_Parameters.SetHexesMinLevel( 2 )
from salome.smesh.smesh_algorithm import Mesh_Algorithm
from salome.smesh.smeshBuilder import AssureGeomPublished
+from salome.geom import geomBuilder
# import HexoticPlugin module if possible
noHexoticPlugin = 0
# @internal
docHelper = "Creates hexahedron 3D algorithm for volumes"
+ ## Direction of viscous layers
+ # @internal
+ Inward = True
+ Outward = False
+
## Private constructor.
# @param mesh parent mesh object algorithm is assigned to
# @param geom geometry (shape/sub-shape) algorithm is assigned to;
# boundary layers
# @return hypothesis object
def SetViscousLayers(self, numberOfLayers, firstLayerSize, growth,
- direction="Inward", facesWithLayers=[], imprintedFaces=[]):
+ direction=Inward, facesWithLayers=[], imprintedFaces=[]):
self.Parameters().SetNbLayers(numberOfLayers)
self.Parameters().SetFirstLayerSize(firstLayerSize)
self.Parameters().SetGrowth(growth)
- if direction == "Inward":
- self.Parameters().SetDirection(True)
- elif direction == "Outward":
- self.Parameters().SetDirection(False)
+ self.Parameters().SetDirection(direction)
+ if facesWithLayers and isinstance( facesWithLayers[0], geomBuilder.GEOM._objref_GEOM_Object ):
+ import GEOM
+ facesWithLayersIDs = []
+ for f in facesWithLayers:
+ if self.mesh.geompyD.ShapeIdToType( f.GetType() ) == "GROUP":
+ facesWithLayersIDs += f.GetSubShapeIndices()
+ else:
+ facesWithLayersIDs += [self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f)]
+ facesWithLayers = facesWithLayersIDs
+
+ if imprintedFaces and isinstance( imprintedFaces[0], geomBuilder.GEOM._objref_GEOM_Object ):
+ import GEOM
+ imprintedFacesIDs = []
+ for f in imprintedFaces:
+ if self.mesh.geompyD.ShapeIdToType( f.GetType() ) == "GROUP":
+ imprintedFacesIDs += f.GetSubShapeIndices()
+ else:
+ imprintedFacesIDs += [self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f)]
+ imprintedFaces = imprintedFacesIDs
self.Parameters().SetFacesWithLayers(facesWithLayers)
self.Parameters().SetImprintedFaces(imprintedFaces)
std::vector<int> idsVec = this->GetImpl()->GetFacesWithLayers();
SMESH::long_array_var ids = new SMESH::long_array;
ids->length( idsVec.size() );
- std::vector<int>::const_iterator anIt;
for ( unsigned i = 0; i < idsVec.size(); ++i )
ids[i] = idsVec[i];
return ids._retn();
std::vector<int> idsVec = this->GetImpl()->GetImprintedFaces();
SMESH::long_array_var ids = new SMESH::long_array;
ids->length( idsVec.size() );
- std::vector<int>::const_iterator anIt;
for ( unsigned i = 0; i < idsVec.size(); ++i )
ids[i] = idsVec[i];
return ids._retn();