Skip to content

Mathmode/trunk-spaces-quadrature

Repository files navigation

Efficient Quadratures on 2D and 3D with Trunk Spaces

This repository contains the code related to the experimental results shown in the manuscript: T. Teijeiro, P. Behnoudfar, J.M. Taylor, D. Pardo, V.M. Calo, Efficient Numerical Integration for Finite Element Trunk Spaces in 2D and 3D using Machine Learning: A new Optimisation Paradigm to Construct Application-Specific Quadrature Rules (https://arxiv.org/abs/2506.23741).

Structure of the Repository:

  • quadrature_rule_discovery.ipynb: Main code, presented as an interactive Jupyter Notebook that can create exact quadrature rules for different 2D and 3D polynomial spaces built from Trunk Spaces.
  • trunk_spaces.py: Auxiliary module with the functionality required to create 1D, 2D and 3D polynomial Trunk spaces using hierarchic shape functions.
  • gauss_quadrature.py: Auxiliary module containing functionality to calculate exact integrals using Gaussian quadrature rules.
  • 2D_rules.json, 3D_rules.json: Pre-computed exact quadrature rules for 2D and 3D spaces. Each rule has the p attribute determining the maximum degree supporting exact integration, and then the x, y, and w attributes, which are lists with the quadrature points. In 3D, the additional z attribute is present for each rule.

Installation

There's no installation required, as all the relevant methods are implemented in a single module. Still, there are some dependencies required that may be installed with the following command:

$ pip install -r requirements.txt

License

This software is licensed under the GPL-v3 license.

About

Algorithms and pre-computed rules for exact numerical integration on 2D and 3D polynomial trunk spaces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published