gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli, \
aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords, \
nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle, nbsegFis, dmoyen, lensegEllipsoide, \
- mailleur="MeshGems"):
+ mailleur="MeshGems", nro_cas=-1):
"""Maillage du bloc partitionné"""
logging.info('start')
+ logging.info("Maillage avec %s pour le cas n°%d", mailleur, nro_cas)
# --- edges de bord à respecter
criteres.append(unCritere)
filtre = smesh.GetFilterFromCriteria(criteres)
bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
- smesh.SetName(bordsLibres, 'bordsLibres')
+ putName(bordsLibres, 'bordsLibres', i_pref=nro_cas)
# --- maillage bloc
hypo2d.SetLocalLength(lensegEllipsoide)
hypo2d.LengthFromEdges()
hypo2d.SetAllowQuadrangles(0)
- putName(algo2d.GetSubMesh(), "sharedFaces", i_aux)
- putName(algo2d, "algo2d_sharedFaces", i_aux)
- putName(hypo2d, "hypo2d_sharedFaces", i_aux)
+ putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas)
+ putName(algo2d, "algo2d_sharedFaces", i_aux, nro_cas)
+ putName(hypo2d, "hypo2d_sharedFaces", i_aux, nro_cas)
for i_aux, sharedEdges_i in enumerate(sharedEdges):
algo1d = bloc1.Segment(geom=sharedEdges_i)
hypo1d = algo1d.LocalLength(lensegEllipsoide)
- putName(algo1d.GetSubMesh(), "sharedEdges", i_aux)
- putName(algo1d, "algo1d_sharedEdges", i_aux)
- putName(hypo1d, "hypo1d_sharedEdges", i_aux)
+ putName(algo1d.GetSubMesh(), "sharedEdges", i_aux, nro_cas)
+ putName(algo1d, "algo1d_sharedEdges", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_sharedEdges", i_aux, nro_cas)
declareAlgoEllipsoideFirst = False
if declareAlgoEllipsoideFirst:
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
hypo3d = algo3d.MaxElementVolume(1000.0)
- putName(algo3d.GetSubMesh(), "ellipsoide")
- putName(algo3d, "algo3d_ellipsoide")
- putName(hypo3d, "hypo3d_ellipsoide")
+ putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
+ putName(algo3d, "algo3d_ellipsoide", i_pref=nro_cas)
+ putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas)
algo3d = bloc1.Prism(geom=tore)
algo2d = bloc1.Quadrangle(geom=tore)
algo1d = bloc1.Segment(geom=tore)
hypo1d = algo1d.NumberOfSegments(nbsegGen)
- putName(algo3d.GetSubMesh(), "tore")
- putName(algo3d, "algo3d_tore")
- putName(algo2d, "algo2d_tore")
- putName(algo1d, "algo1d_tore")
- putName(hypo1d, "hypo1d_tore")
+ putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas)
+ putName(algo3d, "algo3d_tore", i_pref=nro_cas)
+ putName(algo2d, "algo2d_tore", i_pref=nro_cas)
+ putName(algo1d, "algo1d_tore", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_tore", i_pref=nro_cas)
for i_aux, faces_i in enumerate(faces):
algo2d = bloc1.Quadrangle(geom=faces_i)
hypo2d.SetTriaVertex( geompy.GetSubShapeID(blocPartition,centres[i_aux]) )
hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD )
_ = bloc1.AddHypothesis(hypo2d,faces_i)
- putName(algo2d.GetSubMesh(), "faces", i_aux)
- putName(algo2d, "algo2d_faces", i_aux)
- putName(hypo2d, "hypo2d_faces", i_aux)
+ putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas)
+ putName(algo2d, "algo2d_faces", i_aux, nro_cas)
+ putName(hypo2d, "hypo2d_faces", i_aux, nro_cas)
for i_aux, edges_i in enumerate(edges):
algo1d = bloc1.Segment(geom=edges_i)
hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ geompy.GetSubShapeID(blocPartition,edges_i) ])
else:
hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ ])
- putName(algo1d.GetSubMesh(), "edges", i_aux)
- putName(algo1d, "algo1d_edges", i_aux)
- putName(hypo1d, "hypo1d_edges", i_aux)
+ putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas)
+ putName(algo1d, "algo1d_edges", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_edges", i_aux, nro_cas)
for i_aux, circles_i in enumerate(circles):
algo1d = bloc1.Segment(geom=circles_i)
hypo1d = algo1d.NumberOfSegments(nbsegCercle)
- putName(algo1d.GetSubMesh(), "circles", i_aux)
- putName(algo1d, "algo1d_circles", i_aux)
- putName(hypo1d, "hypo1d_circles", i_aux)
+ putName(algo1d.GetSubMesh(), "circles", i_aux, nro_cas)
+ putName(algo1d, "algo1d_circles", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_circles", i_aux, nro_cas)
if len(edgeext) == 1:
densite = int(round(nbsegFis/2))
hypo1d.SetDistrType( 2 )
hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, densite, 0.4, 1, 0.6, 1, 1, densite ] )
- putName(algo1d.GetSubMesh(), "edgeext")
- putName(algo1d, "algo1d_edgeext")
- putName(hypo1d, "hypo1d_edgeext")
+ putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas)
+ putName(algo1d, "algo1d_edgeext", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_edgeext", i_pref=nro_cas)
else:
longTotal = 0
longEdgeExts = list()
hypo1d.SetTableFunction( [ 0, densite, 0.8, 1, 1, 1 ] )
if reverext[i_aux]:
hypo1d.SetReversedEdges([ geompy.GetSubShapeID(blocPartition, edgeext_i) ])
- putName(algo1d.GetSubMesh(), "edgeext", i_aux)
- putName(algo1d, "algo1d_edgeext", i_aux)
- putName(hypo1d, "hypo1d_edgeext", i_aux)
+ putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas)
+ putName(algo1d, "algo1d_edgeext", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_edgeext", i_aux, nro_cas)
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore)
hypo2d = algo2d.LengthFromEdges()
- putName(algo2d.GetSubMesh(), "facefissoutore")
- putName(algo2d, "algo2d_facefissoutore")
- putName(hypo2d, "hypo2d_facefissoutore")
+ putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas)
+ putName(algo2d, "algo2d_facefissoutore", i_pref=nro_cas)
+ putName(hypo2d, "hypo2d_facefissoutore", i_pref=nro_cas)
maxElemArea = 0.5*dmoyen*dmoyen
if edgesBords is None:
algo1d = bloc1.Segment(geom=facesExternes_i)
hypo1d = algo1d.NumberOfSegments(1)
- putName(algo2d.GetSubMesh(), "facesExternes", i_aux)
- putName(algo2d, "algo2d_facesExternes", i_aux)
- putName(hypo2d, "hypo2d_facesExternes", i_aux)
+ putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas)
+ putName(algo2d, "algo2d_facesExternes", i_aux, nro_cas)
+ putName(hypo2d, "hypo2d_facesExternes", i_aux, nro_cas)
if edgesBords is None:
- putName(algo1d, "algo1d_facesExternes", i_aux)
- putName(hypo1d, "hypo1d_facesExternes", i_aux)
+ putName(algo1d, "algo1d_facesExternes", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_facesExternes", i_aux, nro_cas)
for i_aux, aretesInternes_i in enumerate(aretesInternes):
algo1d = bloc1.Segment(geom=aretesInternes_i)
hypo1d = algo1d.NumberOfSegments(nbsegExt)
- putName(algo1d.GetSubMesh(), "aretesInternes", i_aux)
- putName(algo1d, "algo1d_aretesInternes", i_aux)
- putName(hypo1d, "hypo1d_aretesInternes", i_aux)
+ putName(algo1d.GetSubMesh(), "aretesInternes", i_aux, nro_cas)
+ putName(algo1d, "algo1d_aretesInternes", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_aretesInternes", i_aux, nro_cas)
if edgesBords is not None:
algo1d = bloc1.UseExisting1DElements(geom=edgesBords)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
- putName(algo1d.GetSubMesh(), "bordsLibres")
- putName(algo1d, "algo1d_bordsLibres")
- putName(hypo1d, "hypo1d_bordsLibres")
+ putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas)
+ putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas)
if not declareAlgoEllipsoideFirst:
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
hypo3d = algo3d.MaxElementVolume(1000.0)
- putName(algo3d.GetSubMesh(), "ellipsoide")
- putName(algo3d, "algo3d_ellipsoide")
- putName(hypo3d, "hypo3d_ellipsoide")
+ putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
+ putName(algo3d, "algo3d_ellipsoide", i_pref=nro_cas)
+ putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas)
_ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE)
_ = bloc1.GroupOnGeom(gencnt,'nfondfis',SMESH.NODE)
algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN)
hypo3d = algo3d.MaxElementVolume(1000.0)
- putName(algo3d.GetSubMesh(), "bloc")
- putName(algo3d, "algo3d_bloc")
- putName(hypo3d, "hypo3d_bloc")
+ putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas)
+ putName(algo3d, "algo3d_bloc", i_pref=nro_cas)
+ putName(hypo3d, "hypo3d_bloc", i_pref=nro_cas)
is_done = blocMesh.Compute()
text = "blocMesh.Compute"