FastVPINNs

FastVPINNs: An efficient tensor-based Python library for solving partial differential equations using hp-Variational Physics Informed Neural Networks - Published in JOSS (2024)

https://github.com/cmgcds/fastvpinns

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
    Links to: arxiv.org, joss.theoj.org
  • Committers with academic emails
    3 of 4 committers (75.0%) from academic institutions
  • Institutional organization owner
    Organization cmgcds has institutional domain (cmg.cds.iisc.ac.in)
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

deep-learning inverse-problems neural-network partial-differential-equations physics-informed-neural-networks pinn scientific-machine-learning tensorflow2

Scientific Fields

Engineering Computer Science - 40% confidence
Last synced: 4 months ago · JSON representation ·

Repository

FastVPINNs - A tensor-driven acceleration of VPINNs for complex geometries

Basic Info
Statistics
  • Stars: 43
  • Watchers: 3
  • Forks: 67
  • Open Issues: 1
  • Releases: 3
Topics
deep-learning inverse-problems neural-network partial-differential-equations physics-informed-neural-networks pinn scientific-machine-learning tensorflow2
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

Unit tests Integration tests Compatability check codecov PyPI

MIT License Code style: black Python Versions status


FastVPINNs logo

Tensor-driven accelerated framework for hp-variational pinns


Link to Documentation 📚

A robust tensor-based deep learning framework for solving partial differential equations using hp-Variational Physics-Informed Neural Networks (hp-VPINNs). The framework is based on the methodology presented in the FastVPINNs Paper.

This library is a highly optimised version of the the initial implementation of hp-VPINNs by Kharazmi et al.. Refer the hp-VPINNs Paper.

Authors 👨‍💻


Thivin Anandh, Divij Ghose, Sashikumaar Ganesan

STARS Lab, Department of Computational and Data Sciences, Indian Institute of Science, Bangalore, India

Installation 🛠️


The build of the code is currently tested on Python versions (3.8, 3.9, 3.10, 3.11), on OS Ubuntu 20.04 and Ubuntu 22.04, MacOS-latest and Windows-latest (refer compatibility build Compatability check).

You can install the package using pip as follows:

bash pip install fastvpinns

On ubuntu systems with libGL issues caused due to matplotlib or gmsh, please run the following command to install the required dependencies: bash sudo apt-get install -y libglu1-mesa

For more information on the installation process, please refer to our documentation here.

Citing 📜


If you use this code in your research, please consider citing the following paper:

bibtex @misc{anandh2024fastvpinns, title={FastVPINNs: Tensor-Driven Acceleration of VPINNs for Complex Geometries}, author={Thivin Anandh, Divij Ghose, Himanshu Jain and Sashikumaar Ganesan}, year={2024}, eprint={2404.12063}, archivePrefix={arXiv}, primaryClass={cs.LG} }

Usage 🚀


For detailed usage, please refer to our documentation here.

The package provides a simple API to train and solve PDE using VPINNs. The following code snippet demonstrates how to train a hp-VPINN model for the 2D Poisson equation for a structured grid. We could observe that we can solve a PDE using fastvpinns using 15 lines of code.

```python

load the geometry

domain = Geometry2D("quadrilateral", "internal", 100, 100, "./") cells, boundarypoints = domain.generatequadmeshinternal(xlimits=[0, 1],ylimits=[0, 1],ncellsx=4, ncellsy=4, numboundary_points=400)

load the FEspace

fespace = Fespace2D(domain.mesh,cells,boundarypoints,domain.meshtype,feorder=5,fetype="jacobi",quadorder=5,quadtype="legendre", fetransformationtype="bilinear",boundfunctiondict=boundfunctiondict,boundconditiondict=boundconditiondict, forcingfunction=rhs,outputpath=ioutputpath,generatemeshplot=True)

Instantiate Data handler

datahandler = DataHandler2D(fespace, domain, dtype=tf.float32)

Instantiate the model with the loss function for the model

model = DenseModel(layerdims=[2, 30, 30, 30, 1],learningratedict=0.01,paramsdict=paramsdict, lossfunction=pdelosspoisson, ## Loss function of poisson2D inputtensorslist=[intensor, dirin, dirout], origfactormatrices=[datahandler.shapevalmatlist,datahandler.gradxmatlist, datahandler.gradymatlist], forcefunctionlist=datahandler.forcingfunctionlist, tensordtype=tf.float32, useattention=iuseattention, ## Archived (not in use) activation=i_activation, hessian=False)

Train the model

for epoch in range(1000): model.train_step() ```

Note : Supporting functions which define the actual solution and boundary conditions have to be passed to the main code.

Contributing 🤝


This code is currently maintained by the authors as mentioned in the section above. We welcome contributions from the community. Please refer to the documentation for guidelines on contributing to the project.

License 📑


This project is licensed under the MIT License - see the LICENSE file for details.

Owner

  • Name: Computational Mathematics Group (CMG)
  • Login: cmgcds
  • Kind: organization
  • Location: Indian Institute of Science, Bangalore, India

CMG at the Department of Computational and Data Sciences, IISc

JOSS Publication

FastVPINNs: An efficient tensor-based Python library for solving partial differential equations using hp-Variational Physics Informed Neural Networks
Published
July 30, 2024
Volume 9, Issue 99, Page 6764
Authors
Thivin Anandh ORCID
Department of Computational and Data Sciences, Indian Institute of Science, Bangalore, India
Divij Ghose ORCID
Department of Computational and Data Sciences, Indian Institute of Science, Bangalore, India
Sashikumaar Ganesan ORCID
Department of Computational and Data Sciences, Indian Institute of Science, Bangalore, India
Editor
Patrick Diehl ORCID
Tags
python physics-informed neural networks scientific machine learning partial differential equations hp-variational physics informed neural networks tensorflow

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Anandh
  given-names: Thivin
  orcid: "https://orcid.org/0000-0003-4969-3242"
- family-names: Ghose
  given-names: Divij
  orcid: "https://orcid.org/0009-0005-6295-543X"
- family-names: Ganesan
  given-names: Sashikumaar
  orcid: "https://orcid.org/0000-0003-1858-3972"
contact:
- family-names: Anandh
  given-names: Thivin
  orcid: "https://orcid.org/0000-0003-4969-3242"
- family-names: Ganesan
  given-names: Sashikumaar
  orcid: "https://orcid.org/0000-0003-1858-3972"
doi: 10.5281/zenodo.13127234
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Anandh
    given-names: Thivin
    orcid: "https://orcid.org/0000-0003-4969-3242"
  - family-names: Ghose
    given-names: Divij
    orcid: "https://orcid.org/0009-0005-6295-543X"
  - family-names: Ganesan
    given-names: Sashikumaar
    orcid: "https://orcid.org/0000-0003-1858-3972"
  date-published: 2024-07-30
  doi: 10.21105/joss.06764
  issn: 2475-9066
  issue: 99
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 6764
  title: "FastVPINNs: An efficient tensor-based Python library for
    solving partial differential equations using hp-Variational Physics
    Informed Neural Networks"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.06764"
  volume: 9
title: "FastVPINNs: An efficient tensor-based Python library for solving
  partial differential equations using hp-Variational Physics Informed
  Neural Networks"

GitHub Events

Total
  • Watch event: 23
  • Delete event: 4
  • Issue comment event: 1
  • Push event: 20
  • Pull request event: 2
  • Fork event: 55
  • Create event: 3
Last Year
  • Watch event: 23
  • Delete event: 4
  • Issue comment event: 1
  • Push event: 20
  • Pull request event: 2
  • Fork event: 55
  • Create event: 3

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 152
  • Total Committers: 4
  • Avg Commits per committer: 38.0
  • Development Distribution Score (DDS): 0.171
Past Year
  • Commits: 12
  • Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
thivin t****h@i****n 126
divijghose d****e@i****n 24
Ziyi Yin z****n@g****u 1
Prof. Sashikumaar Ganesan s****n 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 4
  • Total pull requests: 20
  • Average time to close issues: 14 days
  • Average time to close pull requests: about 15 hours
  • Total issue authors: 4
  • Total pull request authors: 5
  • Average comments per issue: 3.25
  • Average comments per pull request: 0.2
  • Merged pull requests: 16
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 8
  • Average time to close issues: 1 day
  • Average time to close pull requests: 1 day
  • Issue authors: 2
  • Pull request authors: 5
  • Average comments per issue: 1.5
  • Average comments per pull request: 0.25
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ziyiyin97 (1)
  • pescap (1)
  • tsarikahin (1)
  • margecruz (1)
  • divijghose (1)
Pull Request Authors
  • thivinanandh (14)
  • divijghose (8)
  • jaihimanshu (2)
  • ziyiyin97 (1)
  • danielskatz (1)
Top Labels
Issue Labels
enhancement (3)
Pull Request Labels
enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 22 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: fastvpinns

A fast tensor-driven variational physics-informed neural network library for solving PDEs.

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 22 Last month
Rankings
Dependent packages count: 9.4%
Average: 35.7%
Dependent repos count: 62.0%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/code-quality-control.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/integration-tests.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/unit-tests.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
fastvpinns/FastVPINNs.egg-info/requires.txt pypi
  • gmsh *
  • matplotlib *
  • numba *
  • numpy *
  • pandas *
  • pyDOE *
  • pygmsh *
  • pytest *
  • pyvista *
  • pyyaml *
  • scipy *
  • seaborn *
  • sympy *
  • tensorflow *
  • tqdm *
  • vtk *
  • wandb *
pyproject.toml pypi
requirements.txt pypi
  • black *
  • gmsh *
  • matplotlib *
  • numpy ==1.21.4
  • pandas *
  • pre-commit *
  • pyDOE *
  • pygmsh *
  • pytest *
  • pyyaml *
  • rich ==12.5.1
  • scipy *
  • seaborn *
  • tensorflow ==2.9.1
  • tqdm *
  • vtk *
setup.py pypi
.github/workflows/code-coverage.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v4.2.0 composite
.github/workflows/compatibility-tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/documentation-deployment.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/pypi-deployment.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite