Giter Site home page Giter Site logo

istupakov / pyquasar Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 18 KB

Finite and boundary element methods on Python

License: MIT License

Python 100.00%
boundary-element-method domain-decomposition electromagnetic-simulation finite-element-method numerical-methods numerical-simulation

pyquasar's Introduction

pyquasar

Finite and boundary element methods on Python

pyquasar's People

Contributors

istupakov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyquasar's Issues

Add documentation for public classes & methods

As for now project lacks of any documentation and can be confusing for the users. To enhance clarity for users, we need to add comprehensive documentation to the project.

This will provide clear instructions and explanations, reducing confusion and improving user experience.

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

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. #2
  • Separate numeration localization method into another method. #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.

Add type hints

Type hints enhance code readability and maintainability by specifying the types of variables, function parameters, and return values. Adding type hints to the project will improve code quality and facilitate better understanding for developers working on the project.

Restructure Attributes and Methods for Improved Encapsulation and Readability

To enhance code clarity and maintainability, we need to refactor certain attributes and methods in the classes. This involves making some attributes non-public to encapsulate their behavior and prevent direct access from outside the class. Additionally, we should convert most attributes into properties to provide clear documentation and enforce read-only access where appropriate. By implementing these changes, we can improve code readability, prevent unintended modifications, and promote best practices in our codebase.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.