Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mGFD: Meshless Generalized Finite Differences 📐

mGFD logo

GitHub Python NumPy SciPy License: MIT

A high-performance Python package for solving 2D PDEs on highly irregular domains using Generalized Finite Differences.

🌟 Overview

mGFD is a meshless computational engine designed to solve Partial Differential Equations (PDEs) directly on unstructured point clouds. Unlike traditional Finite Element or Finite Volume methods, mGFD requires no mesh generation, making it exceptionally powerful for complex, irregular geometries like geographic lakes, islands, or custom engineering domains.

Features

  • 📐 Pure Meshless Discretization: Solves PDEs using only local neighbor stencils.
  • ⚡ Stationary Solvers: Out-of-the-box support for Poisson-type problems.
  • 🔥 Transient Solvers: First-order (Heat, Advection-Diffusion) and Second-order (Wave) time integrations.
  • ⚙️ Extensible API: Easily define custom operators, forcing functions, and boundary conditions using standard Python callbacks.

📦 Installation

mGFD requires Python 3.8+ and standard scientific libraries (numpy, scipy).

To install the package directly from GitHub:

pip install git+https://github.com/gstinoco/mGFD.git

For development or local testing, clone the repository and install it in editable mode:

git clone https://github.com/gstinoco/mGFD.git
cd mGFD
pip install -e .

🚀 Quick Start API

mGFD makes solving complex PDEs simple. Here is a minimal example of solving a Stationary Equation over a custom point cloud:

import numpy as np
from mGFD import Stationary

# 1. Provide a point cloud `p` of shape (m, 3). 
# Columns are [x, y, flag], where flag=0 is interior, flag=0.5 is boundary.
p = np.array([
    [0.5, 0.5, 0.0],  # Interior point
    [0.0, 0.5, 0.5],  # Boundary point
    # ... your points here
])

# 2. Define the analytical boundary condition
phi = lambda x, y: 2 * np.exp(2*x + y)

# 3. Define the right-hand side forcing function
f = lambda x, y: 10 * np.exp(2*x + y)

# 4. Solve the equation!
u_ap, u_ex, vec = Stationary(p, phi, f)

The mGFD module exports three main solvers:

  • Stationary(p, phi, f): For time-independent equations.
  • TimeDerivative1(p, f, t, coef): For 1st-order transient PDEs (e.g. Heat).
  • TimeDerivative2(p, f, g, t, coef): For 2nd-order transient PDEs (e.g. Wave).

🔬 Research, Datasets & Benchmarks

Are you looking for the mathematical formulation, the lake point-cloud datasets (Caspio, Poopo, etc.), or the reproducible benchmarking scripts?

👉 Go to the Research Laboratory (/research/README.md)

The research folder contains the complete academic suite, including historical experiment data, visualization scripts, VTK results, and theoretical explanations associated with our scientific publications.


📝 Citation & License

This project is open-sourced under the MIT License.

If you use this library or the core mathematical methodology in your research, please cite our reference paper:

@software{tinoco2024mGFD,
  title={mGFD: Meshless Generalized Finite Differences for Partial Differential Equations},
  author={Tinoco-Guerrero, Gerardo and Domínguez-Mota, Francisco Javier and Guzmán-Torres, José Alberto and Arias-Rojas, Heriberto},
  year={2024},
  institution={Universidad Michoacana de San Nicolás de Hidalgo},
  url={https://github.com/gstinoco/mGFD}
}
Built with ❤️ by the scientific computing community in Morelia, México.
Report a Bug | Contact Author

About

Meshless Generalized Finite Differences (mGFD) solver and reference point-cloud datasets for 2D PDEs on irregular domains, with reproducible batches and benchmarks.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Contributors

Languages