Meshing of two solid whose share a Face
-
Hi,
I want to mesh a composition of two solids : domain = MakeCompound([domain_1,domain_2]).
Those two solids share a Face. I have to fix a boundary condition on this Face.
What do I have to build whith GEOM Component for make a meshing of domain ?
Thanks in advance,
Thomas B.-
Hello,
A small code, better that a long explain (perhaps !)
from geompy import *
import smesh
# Géométrie
# =========
# 2 boites avec une face commune dont on veut la mettre dans un groupe afin d'y poser une condition limite.
# Paramètres
# ----------
nom = "ex22_group"
boite_x = 0
boite_y = 0
boite_z = 0
cote = 60
# Boites
# ------
delta = cote/2.0
boite_1 = MakeBox(boite_x-delta, boite_y-delta, boite_z-delta, boite_x+delta, boite_y+delta, boite_z+delta)
boite_2 = MakeTranslation(boite_1, cote, 0, 0)
# Pièce
# -----
cpd = MakeCompound([boite_1, boite_2])
piece = MakeGlueFaces(cpd, 0.01)
addToStudy(piece, nom)
# Groupe de face
# --------------
cl = CreateGroup(piece, ShapeType["FACE"])
cl_nom = nom + ":cl"
addToStudy(cl, cl_nom)
cl.SetName(cl_nom)
face = GetFaceNearPoint(piece, MakeVertex(boite_x+delta, 0, 0))
UnionList(cl, [face])
# Maillage
# ========
# Définition du maillage
# ----------------------
tetra = smesh.Mesh(piece, nom)
algo1d = tetra.Segment()
algo1d.LocalLength(10)
algo2d = tetra.Triangle()
algo2d.LengthFromEdges()
algo3d = tetra.Tetrahedron(smesh.NETGEN)
algo3d.MaxElementVolume(100)
tetra.Compute()
# Groupe de maille pour la condition limite
# -----------------------------------------
tetra.Group(cl)
# -------------------------
You see in the study the mesh and a group of triangle based on the geometric common face.
Francis KLOSS
-
Powered by
Ploneboard
