Skip to content
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

generalise this #58

Open
github-actions bot opened this issue Jun 22, 2024 · 0 comments
Open

generalise this #58

github-actions bot opened this issue Jun 22, 2024 · 0 comments
Labels

Comments

@github-actions
Copy link

subcompounds = np.array_split(compound, 10) # TODO: generalise this

    def make_compound(self, dim: int, tags: list):
        gmsh.model.occ.synchronize()
        # make sure that tags is a list of integers or numpy array of integers
        if all(isinstance(item, int) for item in tags) or all(
            isinstance(item, (int, np.integer)) for item in tags
        ):
            compound = tags
        else:
            # get a list of the tags of the entities to be combined
            compound = []
            for entity in tags:
                compound.append(entity[0][1])

        # make compound of size 'dim' and tags 'compound'
        if dim == 1:
            subcompounds = np.array_split(compound, 10)  # TODO: generalise this
            for subcomp in subcompounds:
                gmsh.model.mesh.setCompound(dim, subcomp)
        else:
            gmsh.model.mesh.setCompound(dim, compound)
        gmsh.model.occ.synchronize()
        return None
@github-actions github-actions bot added the todo label Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants