Skip to content
/ surfpy Public

surfpy is a Python package for computing surface integrals over smooth embedded manifolds using spectral differentiation.

License

Notifications You must be signed in to change notification settings

casus/surfpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0d6eec7 · Jan 29, 2024

History

15 Commits
Dec 2, 2023
Dec 2, 2023
Dec 15, 2023
Dec 15, 2023
Jan 29, 2024
Dec 2, 2023
Dec 15, 2023

Repository files navigation

License Python 3.8

About surfpy

surfpy is a Python package for computing surface integrals over smooth embedded manifolds.

Surface Approximation through Polynomial Interpolation

drawing

Let's consider an element T i within a reference surface S h . This involves employing both an affine transformation and the closest point projection:

  • τ i : Δ 2 T i
  • π i : T i V i

In this context, we define the coordinate mapping φ i : 2 V i , given by φ i = π i τ i σ , where σ maps the reference square 2 to the reference triangle Δ 2 .

We say that the mesh is order k if each element has been provided as a set of nodes φ i ( p α ) , α A 2 , k sampled at ( p α ) , α A 2 , k on S . Consequently, we can numerically approximate the coordinate mapping on each element through interpolation using the nodes φ i ( p α ) , α A 2 , k . In other words, our goal is to compute a k th -order polynomial approximation:

Q G 2 , k φ i ( x ) = α A 2 , k φ i ( p α ) L α , i = 1 , , K

with G 2 , k being the tensorial Chebyshev–Lobatto grid and A 2 , k a multi-index set.

To obtain partial derivatives, forming the Jacobian matrix D Q G 2 , k φ i , we utilize numerical spectral differentiation.

Surface Integral Approximation

The surface integral:

S f d S i = 1 , . . . , K 2 f ( φ ( x ) ) det ( ( D Q d , k φ i ( x ) ) T D Q d , k φ i ( x ) ) d x i = 1 , . . . , K p P ω p f ( φ i ( p ) ) det ( ( D Q d , k φ i ( p ) ) T D Q d , k φ i ( p ) )

This approach provides a robust method for accurate surface integral computations in the context of surfpy.

Installation

To install, you can either download a .zip file or clone the directory with Git.

Option 1: Download a .zip file

Download a .zip of surfpy from:

https://github.com/casus/surfpy/archive/refs/heads/main.zip

Option 2: Clone with Git

To clone the surfpy repository, first navigate in a terminal to where you want the repository cloned, then type:

https://github.com/casus/surfpy

Getting started

Check out the examples folder — happy computing!

Any comment or question, send an email to: g.zavalani@hzdr.de

License

MIT

About

surfpy is a Python package for computing surface integrals over smooth embedded manifolds using spectral differentiation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages