Skip to content

OpenCascade, Boolean union and physical lines #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Oct 28, 2019 · 2 comments
Open

OpenCascade, Boolean union and physical lines #287

ghost opened this issue Oct 28, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 28, 2019

I intend to get the union of few rectangles and still be able to mark the some of their lines as physical line.

I have noticed that in order to get the union / merge rectangles I need to use the OpenCascade engine and use boolean_union. At the same time, the object Rectangle that I create does not give me access to its lines to mark. Here is MWE.

import pygmsh as pg

height = 1.5
inlet_width = 0.2
inlet_depth = 0.2
width = 1.2
MOUTH1 = 2
INLET1 = 1

assert height > 0, "height cannot be 0"
assert width > 0, "width cannot be 0"
size = 2.e-2
geom = pg.opencascade.Geometry(
        characteristic_length_min=size, characteristic_length_max=size)

ymax1 = 0.1
main_rect = geom.add_rectangle([0.0, 0.0, 0.0], width, height)
mouth_inlet1 = geom.add_rectangle([-inlet_depth, ymax1, 0.0], inlet_depth, inlet_width)
geom.add_physical_surface(mouth_inlet1, MOUTH1)
heat_exchanger = geom.boolean_union([main_rect, mouth_inlet1])

geom.add_physical_surface(heat_exchanger, 0)

mesh = pg.generate_mesh(geom, geo_filename="mesh_heat_exchanger.geo")


import meshio
meshio.write("mesh_heat_exchanger.vtk", mesh)

Ideally, I could mark one of the lines in heat_exchanger as well

geom.add_physical_line(heat_exchanger.lines[0], 1)

Is there any way around this?

@liptonfred
Copy link

I have met the same question when I want to set physical line groups after a series of Boolean union and difference.
I wonder if there is a solution for this problem after these years...

@lyyc199586
Copy link

is this package still maintained? looks like the boolean issue for gmsh>=4.8.4 (#519) havn't been fixed for a long time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants