Metadata-Version: 2.1
Name: pyde-fem
Version: 1.0.0
Summary: Python package for Finite Element Method (FEM) for solving Partial Differential Equations (PDEs)
Home-page: https://github.com/RyanTmi/pyde-fem
Author: Ryan Timeus
Author-email: timeusryan@gmail.com
License: Apache License 2.0
Keywords: finite element method,partial differential equations,mesh,numerical analysis
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib
Requires-Dist: numpy>=1.26
Requires-Dist: scipy

# Pyde FEM

**pyde_fem** is a Python package designed for efficient mesh manipulation and analysis, tailored for
Finite Element Method (FEM) applications and solving Partial Differential Equations (PDEs) using the
Galerkin method. With `pyde_fem`, you can easily create, modify, visualize, and analyze meshes,
making it a powerful tool for numerical simulations.

## Features

- **Mesh Creation:** Generate rectangular meshes with customizable subdivisions and dimensions.
- **Mesh Manipulation:** Refine meshes by adding midpoints to edges, and extract boundary
  information.
- **Mesh Analysis:** Calculate mass and stiffness matrices for FEM, and identify connected
  components.
- **Visualization:** Plot meshes with optional visualizations of connected components, boundary
  segments, and boundary normals.

## Installation

You can install `pyde_fem` using from PyPI pip:

```shell
pip install pyde-fem
```

## Quick Start

Here’s a quick example to get you started:

```python
import pyde_fem as pf

# Load a mesh from a file
vertices, indices = pf.mesh.load("mesh.msh")

# Plot the mesh
pf.mesh.plot(vertices, indices)
```

## Examples Usage

```python
import pyde_fem as pf
import matplotlib.pyplot as plt

# 1. Generating a Mesh:
vertices, indices = pf.mesh.generate(10, 10, 1.0, 1.0)
pf.mesh.plot(vertices, indices)
plt.show()

# 2. Generating a Mesh:
refined_vertices, refined_indices = pf.mesh.refine(vertices, indices)
pf.mesh.plot(vertices, indices)
plt.show()

# 3. Calculating Mass and Stiffness Matrices:
mass_matrix = pf.mass(vertices, indices)
stiffness_matrix = pf.stiffness(vertices, indices)


# 4. Plotting the Mesh with Boundary Information:
boundary_faces, boundary_indices = pf.mesh.boundary(indices)
boundary_normals = pf.mesh.boundary_normals(vertices, boundary_indices)

pf.mesh.plot(
    vertices,
    indices,
    boundary_indices=boundary_indices,
    boundary_normals=boundary_normals
)
plt.show()
```

## License

`pyde_fem` is licensed under the Apache Software License. See the [LICENSE](LICENSE) file for more details.

## Contact

For any inquiries, please contact me at `timeusryan@gmail.com`.
