-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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
- Create a Mesh class and use it inside PyQuasar classes. Create a Mesh class with separated
localize_numerationmethod and use it inside PyQuasar classes. #2 - Separate numeration localization method into another method. Create a Mesh class with separated
localize_numerationmethod and use it inside PyQuasar classes. #2 - Implement class methods within Mesh for each mesh provider option (e.g., from_gmsh, from_netgen, etc.).
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.
Metadata
Metadata
Assignees
Labels
No labels