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

Adds support for meshing in-vessel components #178

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

tokamaster
Copy link
Collaborator

This pull request introduces a method for generating a tetrahedral mesh of individual in-vessel components and exporting the mesh in .h5m format. The process involves the following steps:

  1. Importing the STEP file: The method imports the STEP file corresponding to the component.
  2. Mesh Generation: Using Cubit, a tetrahedral mesh is created for the imported component.
  3. Exporting Mesh: The resulting meshed volume is exported in .exo format, which is then converted to .h5m using MOAB.

When using the method, the names of the in-vessel components must match the names specified in the radial build dictionary. Also, the mesh size can be customized using the mesh_size argument. More information on mesh sizing functions can be found here.

@tokamaster tokamaster linked an issue Nov 20, 2024 that may be closed by this pull request
4 tasks
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tokamaster - this looks pretty good to me. I have made one minor request for future readability, but want to make sure @connoramoreno has a chance to chime in as well.

@@ -205,3 +205,14 @@ def export_dagmc_cubit_native(
# exports
if delete_upon_export:
cubit.cmd(f"delete mesh volume all propagate")


def create_new_cubit_instance():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thin it would be helpful to inser this immediately after init_cubit() so that folks can find it and associate it with that method more easily.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this makes sense; I'll insert it after init_cubit().

@gonuke gonuke requested a review from connoramoreno November 23, 2024 22:09
Copy link
Collaborator

@connoramoreno connoramoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @tokamaster! I just have a couple small thoughts on naming, otherwise this looks good to me

@@ -346,6 +346,33 @@ def export_cad_to_dagmc(self, dagmc_filename="dagmc", export_dir=""):

model.export_dagmc_h5m_file(filename=str(export_path))

def export_invessel_component_mesh(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is part of the InVesselBuild class, I don't think it's necessary to specify in the name that this method is for in-vessel components. We may want to shorten the name to something like export_mesh for brevity and also to match the method name we use for the magnets.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I agree 'invessel' here is redundant. Yet, I think I would keep 'components' in the name of the method, since it meshes, and exports, specific components and not the whole radial build. Something like export_component_mesh would be more appropriate in my opinion. A similar logic follows for generate_components method in the InVesselBuild class.

@@ -191,6 +191,27 @@ def export_invessel_build(
dagmc_filename=dagmc_filename, export_dir=export_dir
)

def export_invessel_component_mesh(
Copy link
Collaborator

@connoramoreno connoramoreno Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want to match the name of this method to that of the corresponding class for consistency, i.e., export_invessel_build_mesh.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still keep 'component' in the method's name since it meshes specific components, defined as an argument, rather than the entire radial build. We could have another method for meshing the entire build, though.

Copy link
Collaborator

@connoramoreno connoramoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment about the call to export_mesh_cubit in the InVesselBuild.export_component_mesh method.

parastell/invessel_build.py Outdated Show resolved Hide resolved
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - thanks @tokamaster

Copy link
Collaborator

@connoramoreno connoramoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well, thanks for this contribution @tokamaster!

@connoramoreno connoramoreno merged commit ae1d1ff into main Nov 27, 2024
3 checks passed
@connoramoreno connoramoreno deleted the 94-add-support-for-meshing-invessel-components branch December 17, 2024 17:26
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

Successfully merging this pull request may close these issues.

Add support for meshing invessel components
3 participants