Skip to main content

Python package for Finite Element Method (FEM) for solving Partial Differential Equations (PDEs)

Project description

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:

pip install pyde-fem

Quick Start

Here’s a quick example to get you started:

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

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 file for more details.

Contact

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyde_fem-1.0.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

pyde_fem-1.0.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file pyde_fem-1.0.0.tar.gz.

File metadata

  • Download URL: pyde_fem-1.0.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for pyde_fem-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0e608adcc931e804bc362274cdbb0bab6e39921a0dec667f17d367773fb7eb92
MD5 907d411a25637bc84364616a3677e4d0
BLAKE2b-256 90a5651e38d7915bbdbccfe4096393dbcea6168abdeaef0a97b25c053ef3b6ab

See more details on using hashes here.

File details

Details for the file pyde_fem-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyde_fem-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for pyde_fem-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c6d1961a8e7b76fb37798a105b495b1885007bb6c6f464d0bd64738585c05dd
MD5 60fb1e87ef211675da5e9e1435a5fcff
BLAKE2b-256 43d09f4a8ffdda8d47d67ba09cc72cef5d51d6b50a9ad1551880ae865cea6748

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page