recursive occ.copy
Context:
The model is prepared using several boolean operations with a set of primitives S. In order to create boundary elements for prescribing BC, currently use this approach:
- We select boundary dimtags by auxiliary intersection with the boundary of some primitives from S.
- We add selected boundaries into the list of meshed entities and assign some region labels to them (using a map: dimtag -> region)
- After meshing, we use the region ma to assign regions to the elements.
This is a workaround for slow region/physical group operations in OCC.
We use the Python API.
Problem:
The problem is that boolean operations break the original entities, so we want to apply boolean ops to the copies. However, OCC.copy is not recursive.. It does not copy dimtag boundaries. Therefore, the boundary of the primitives is broken, and if we try to use some_primitive_copy.get_boundary() to select boundary elements through the intersection, the boundary is already invalid. We have to explicitly make copies of the boundaries we want to use later on.
There are two questions:
- Is this approach appropriate? How do you deal with boundary marking?
- Is it possible to perform a recursive copy in OCC model somehow?