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

Refactoring load_mesh function into a Mesh class with support for multiple providers and global numeration #1

Open
2 of 3 tasks
boorlakov opened this issue Feb 13, 2024 · 0 comments

Comments

@boorlakov
Copy link

boorlakov commented Feb 13, 2024

Issue Description

Currently, codebase includes a load_mesh function responsible for loading meshes, but it lacks extensibility and flexibility. To improve maintainability and add support for multiple mesh provider options (such as GMSH, NETGEN, etc.), as well as to make the default numeration global and move numeration localization into the FETI class because of FEMProblem, we need to refactor this function into a Mesh class.

Proposed Changes

Proposed API example

mesh = Mesh.load(
    # The path to the geometry file
    "dipole2d.geo", # Or "dipole2d.msh"
    # How many times to refine the mesh by half (0 means no refinement)
    refine_k=3,
    # How many partitions to make (0 means no partitions)
    num_part=0
)
domains = [FemDomain(domain) for domain in mesh]
problem = FemProblem(domains)

or

mesh = Mesh.load(
    # The path to the geometry file
    "dipole2d.geo", # Or "dipole2d.msh"
    # How many times to refine the mesh by half (0 means no refinement)
    refine_k=3,
    # How many partitions to make (0 means no partitions)
    num_part=0
)
mesh.localize_numaration()
domains = [FemDomain(domain) for domain in mesh]
problem = FetiProblem(domains)

Expected Benefits

  • Improved code organization and maintainability by encapsulating mesh loading functionality into a dedicated class.
  • Enhanced flexibility to support multiple mesh provider options without modifying existing code extensively.
  • Global default numeration allows for consistent behavior (FEMProblem) across the application.
  • Localization of numeration within the FETI class ensures separation of concerns and better modularization.

Additional Considerations

  • Write comprehensive unit tests to validate the functionality of the Mesh class and its methods.
  • Document the usage of the Mesh class and any changes in numeration handling for developers' reference.
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

1 participant