https://github.com/casus/surfgeopy
A Python 3 library for approximating surface integrals over smooth embedded manifolds. Mirror of the surfgeopy repository. Please do not post issues or pull requests here. Use https://github.com/zavala92/surfgeopy instead.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Repository
A Python 3 library for approximating surface integrals over smooth embedded manifolds. Mirror of the surfgeopy repository. Please do not post issues or pull requests here. Use https://github.com/zavala92/surfgeopy instead.
Basic Info
- Host: GitHub
- Owner: casus
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://github.com/zavala92/surfgeopy
- Size: 16.3 MB
Statistics
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Surfgeopy
surfgeopy is a Python package that is freely available and open-source. Its purpose is to calculate approximations of surface integrals over smooth embedded manifolds.
🎉Table of Contents
Background
surfgeopy rests on curved surface triangulations realised due to $k^{\text{th}}$-order interpolation of the closest point projection, extending initial linear surface approximations. It achieves this by employing a novel technique called square-squeezing, which involves transforming the interpolation tasks of triangulated manifolds to the standard hypercube using a cube-to-simplex transformation that has been recently introduced.
To ensure the stability and accuracy of the computations, surfgeopy leverages classic Chebyshev-Lobatto grids. These grids enable the calculation of high-order interpolants for the surface geometry while avoiding Runge's phenomenon, a common issue in numerical analysis.
Surface approximation using polynomial interpolation!

Consider an element $T_{i}$ in a reference surface $T$. We consider the affine transformation and closest point projection:
- $\taui : \Delta2 \rightarrow T_i$
- $\pii : Ti \rightarrow S_i$
Setting
$\varphii : \square2 \rightarrow Si, \quad \varphii = \pii \circ \taui\circ \sigma$ where $\sigma$ is a mapping from the reference square $\square2$ to the the reference triangle $\Delta2$.
We compute $Q{G{2,k}} \varphii$ be the vector-valued tensor-polynomial interpolant of $\varphii$ in the Chebyshev--Lobbatto grid
$Q{G{2,k}} \varphii = \sum{\alpha \in A{2,k}} \varphii(p\alpha)L{\alpha} = \sum{\alpha \in A{2,k}}b\alpha N{\alpha}$ where the coefficients $b_\alpha \in \mathbf{R}$ of the Newton interpolation can be computed in closed form.
Substituting the surface geometry $\varphii$ with Chebyshev–Lobatto interpolants $Q{G{2,k}} \varphii$, yields a closed-form expression for the integral. This expression can be accurately computed using high-order quadrature rules.
$\intS fdS \approx\sum{i=1,...,K} \int{\square2} (f\circ\varphii)(\mathrm{x}) \sqrt{\det((DQ{G{2,k}}\varphii(\mathrm{x}))^T DQ{G{2,k}}\varphii(\mathrm{x}))} d\mathrm{x}\approx \sum{i=1,...,K} \sum{\mathrm{p} \in P}\omega{\mathrm{p}} (f \circ\varphii)(\mathrm{p})\sqrt{\det((DQ{G{2,k}}\varphii(\mathrm{p}))^T DQ{G{2,k}}\varphi_i(\mathrm{p}))}.$
Square-triangle transformation
- Square-triangle transformations: Deformations of an equidistant grid (left picture) under Duffy's transformation (middle picture) and square-squeezing (right picture)

Results !
Refinement
As a refinement procedure, we use the so called triangular quadrisection when the initial triangle is replaced with four triangles until a certain tol is reached. Triangular quadrisection is a linear subdivision procedure which inserts new vertices at the edge midpoints of the input mesh, thereby producing four new faces for every face of the original mesh:
x3 x3
/ \ subdivision / \
/ \ ====> v3__v2
/ \ / \ / \
x1________x2 x1___v1___x2
Original vertices : x1, x2, x3
New vertices : v1, v2, v3
New faces : [x1 v1 v3; x2 v2 v1; x3 v3 v2; v1 v2 v3]
🎉 Roadmap
We are currently working on:
- Incorporating distmesh for generating mesh in python
- Extending HOSQ for a wide range of non-parametrized surfaces
More Coming soon...
🛠️ Install
Since this implementation is a prototype, we currently only provide the installation by self-building from source. We recommend to using git to get the surfgeopy source:
bash
git clone https://codebase.helmholtz.cloud/interpol/surfgeopy.git
🚧 Switch to the
condaorvenvvirtual environment of your choice where you would like to install the library.
From within the environment, install using [pip],
bash
pip install -e .
The -e argument specifies to install softlinks so that any changes made by the user to the source in the source folders are reflected in the install when importing modules.
You must not use the command
python setup.py installto installsurfgeopy, as you cannot always assume the filessetup.pywill always be present in the further development ofsurfgeopy.
- If you would like to use
surfgeopyin MATLAB, please refer to this link. - Documentation: https://surfgeopy.readthedocs.io
Testing
After installation, we encourage you to at least run the unit tests of surfgeopy,
where we use pytest to run the tests.
If you want to run all tests, type:
bash
pytest [-vvv]
Contributing to surfgeopy
Contributions to the surfgeopy packages are highly welcome.
We recommend you have a look at the CONTRIBUTING.md first.
Credits and contributors
This work was partly funded by the Center for Advanced Systems Understanding (CASUS) that is financed by Germany’s Federal Ministry of Education and Research (BMBF) and by the Saxony Ministry for Science, Culture and Tourism (SMWK) with tax funds on the basis of the budget approved by the Saxony State Parliament.
👷 Development team
Main code development
- Gentian Zavalani (HZDR/CASUS) g.zavalani@hzdr.de
Mathematical foundation
- Gentian Zavalani (HZDR/CASUS) g.zavalani@hzdr.de
- Oliver Sander (TU Dresden) oliver.sander@tu-dresden.de
- Michael Hecht (HZDR/CASUS) m.hecht@hzdr.de
Acknowledgement
- Minterpy development team
Reference
👉 If you use surfgeopy in a program or publication, please
acknowledge its authors by adding a reference to the paper
below.
bibtex
@article{...,
title={High-order integration on regular triangulated manifolds reaches super-algebraic approximation rates through cubical re-parameterizations},
author={Zavalani, G., Sander, O. and Hecht, M.},
journal={arXiv preprint arXiv:2311.13909},
year={2023}
}
License
Owner
- Name: Center for Advanced Systems Understanding
- Login: casus
- Kind: organization
- Email: m.bussmann@hzdr.de
- Location: Görlitz, Germany
- Website: www.casus.science
- Repositories: 8
- Profile: https://github.com/casus
Official Github Organization account of the Center for Advanced Systems Understanding
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Dependencies
- attrs >=20.3.0
- matplotlib >=3.4.2
- minterpy *
- minterpy_levelsets >=0.1.0
- numba >=0.53.1
- numpy >=1.13.3
- pytest >=4.6
- pytest-cov >=2.12.0
- scipy >=1.6.3
- sphinx_rtd_theme *
- attrs >=20.3.0
- matplotlib >=3.4.2
- numba >=0.53.1
- numpy >=1.13.3
- pytest >=4.6
- pytest-cov >=2.12.0
- scipy >=1.6.3
- sphinx_rtd_theme *