Giter Club home page Giter Club logo

ngstrefftz's Introduction

NGSTrefftz

an add-on to NGSolve for Trefftz methods

Binder Docker Image Version (latest semver) PyPI GitHub Workflow Status status docs

NGSTrefftz provides a framework to implement Trefftz finite element spaces for NGSolve, with several Trefftz spaces already implemented. Additionally, Trefftz-DG on tent-pitched meshes for the acoustic wave equation is implemented using meshes provided by ngstents. Furthermore, the package includes an implementation of the embedded Trefftz method.

Try it out!

You can try out some jupyter notebooks:

  • Launch the Binder here:
    Binder
  • Or run the docker locally (you need to have docker installed):
git clone https://github.com/PaulSt/NGSTrefftz
cd NGSTrefftz && docker build -t ngstrefftz_jupyter .
docker run -p 8888:8888 ngstrefftz_jupyter

Installing the package

You can either:

  • install using pip
pip install ngstrefftz
  • or build from source
git clone --recursive https://github.com/PaulSt/NGSTrefftz
mkdir ./NGSTrefftz/make && cd ./NGSTrefftz/make
cmake ../src && make install

Dependencies

  • if you are using pip to install the package you can install the newest ngsolve and other dependencies using
pip install ngsolve --pre
  • if you build the package from source the following software needs to be installed
    • cmake >= 3.1
    • gcc >= 9 or clang >= 10
    • lapack >= 3.9 (required to access the newest features)
    • ngsolve >= 6.2 (to access the newest features the nightly version of NGSolve works best)

News

⚠️ Oct, 2022: With v0.2.0 the git history has undergone a major cleanup, please make sure to clone the repo anew.

🚀 Oct, 2022: New and improved implementation of the embedded Trefftz method via EmbeddedTrefftzFES!

🚀 Aug, 2022: Three different pip-installer available, now using wheels!

🚀 Mar, 2022: NGSTrefftz now has a website!

⚠️ Feb, 2022: If you are using NGSolve nightly releases: NGSolve@eda758d breaks a dependency and NGSolve@3d52ecd produces import issue. Make sure to update ngstrefftz submodules and move to newest ngsolve version, at least NGSolve@5839a09.

🚀 Jan, 2022: NGSTrefftz is now available via pip!

🚀 Nov, 2021: NGSTrefftz now comes in a docker and with binder notebooks!

Papers using the code

  • Trefftz Discontinuous Galerkin discretization for the Stokes problem
    Philip L. Lederer, Christoph Lehrenfeld, Paul Stocker
    arXiv
  • Unfitted Trefftz discontinuous Galerkin methods for elliptic boundary value problems
    Fabian Heimann, Christoph Lehrenfeld, Paul Stocker, Henry von Wahl
    arXiv
  • Embedded Trefftz discontinuous Galerkin methods
    Christoph Lehrenfeld, Paul Stocker
    arXiv
  • A space-time quasi-Trefftz DG method for the wave equation with piecewise-smooth coefficients
    Lise-Marie Imbert-Gérard, Andrea Moiola, Paul Stocker
    arXiv
  • Tent pitching and Trefftz-DG method for the acoustic wave equation
    Ilaria Perugia, Joachim Schöberl, Paul Stocker, Christoph Wintersteiger
    arXiv

If you are using ngstrefftz in your academic work, please consider citing

Stocker, P., (2022). NGSTrefftz: Add-on to NGSolve for Trefftz methods. 
Journal of Open Source Software, 7(71), 4135, https://doi.org/10.21105/joss.04135

ngstrefftz's People

Contributors

chiaraperinati avatar constanzeheil avatar hvonwah avatar mscroggs avatar paulst avatar schruste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ngstrefftz's Issues

Build fails due incompatible ngtents version

Hi,
I'm trying to build NGSTrefftz from source, but I'm experiencing compile time errors:

  /workspace/ngstents/src/tents.hpp:107:17: error: ‘IVec’ is not a member of ‘ngcore’
    107 |   Array<ngcore::IVec<2,size_t>> felpos;
        |                 ^~~~

See also the failing CI Pipeline.
I think this stems from the specific version of ngstents the git submodule is set to (commit 088d773).
If I checkout the master branch of ngstents, the problem vanishes.

Missing community guidelines

This issue is created as part of the review of the JOSS paper (openjournals/joss-reviews#4135).

The review implies checking if proper community guidelines are present. Here are the requirements:

Community guidelines: Are there clear guidelines for third parties wishing to

  1. Contribute to the software
  2. Report issues or problems with the software
  3. Seek support

I did not find such guidelines. You may want to have a look at this example from one of my personal projects: https://github.com/thelfer/MFrontGenericInterfaceSupport/blob/master/CONTRIBUTING.md

Error while compiling `master` branch of `NGSTrefftz` against the `master` branch of `NGSolve`

This issue is created as part of the review of the JOSS paper (openjournals/joss-reviews#4135).

The compilation of master branch of NGSTrefftz against the master branch of NGSolve fails. Please find below a complete log.

The README.md file in the top level directory of NGSTrefftz do not seem to mention compatible versions. Would you provide some insights to get started ?

$ cmake ../NGSTrefftz/src/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/th202608/codes/NGSTrefftz/master/install
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Netgen: /home/th202608/codes/NGSolve/master/install/lib/cmake/netgen
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "3") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so (found suitable version "3.7.3", minimum required is "3") 
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libopenblas.so  
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
With 'make install' the python package will be installed to: /home/th202608/codes/NGSTrefftz/master/install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/th202608/codes/NGSTrefftz/master/src/build
th202608@pleiades093:~/codes/NGSTrefftz/master/src/build$ make
Scanning dependencies of target _pytents
[  9%] Building CXX object CMakeFiles/_pytents.dir/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/python_tents.cpp.o
[ 18%] Building CXX object CMakeFiles/_pytents.dir/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp.o
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp: In member function ‘virtual void GradPhiCoefficientFunction::GenerateCode(ngfem::Code&, ngcore::FlatArray<int>, int) const’:
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp:31:3: error: ‘TraverseDimensions’ was not declared in this scope
   TraverseDimensions( dims, [&](int ind, int i, int j) {
   ^~~~~~~~~~~~~~~~~~
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp:31:3: note: suggested alternative: ‘SetDimensions’
   TraverseDimensions( dims, [&](int ind, int i, int j) {
   ^~~~~~~~~~~~~~~~~~
   SetDimensions
make[2]: *** [CMakeFiles/_pytents.dir/build.make:76: CMakeFiles/_pytents.dir/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:622: CMakeFiles/_pytents.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Structure of the installation directory

This issue is created as part of the review of the JOSS paper (openjournals/joss-reviews#4135).

The installation directory of NGSTrefftz is currently as follows:

$ tree -d .
.
├── ngstents
└── ngstrefftz

This structure is not standard and worse, not compatible with the one of NGSolve which installs its python module in lib/python3/dist-packages/.

Tests does not work out of the box

This issue is created as part of the review of the JOSS paper (openjournals/joss-reviews#4135).

The tests do not work out of the box. To run them, I had to:

  1. install the package
  2. update my environment variables (PYTHONPATH in practice)
  3. run the tests with make test

This is fairly cumbersome and unsual and incompatible with most common practices and package managers.

Review of the JOSS paper

This issue is created as part of the review of the JOSS paper (openjournals/joss-reviews#4135).

My biggest concern with the paper concerns the following statements:

  1. line 19: NGSTrefftz provides a framework to implement Trefftz finite element spaces
  2. line 40: The aim of this package is to facilitate research into Trefftz methods and to make them more
    accessible to a broad audience.

My feeling is that the NGSTrefftz currently does not provide an appealing introduction to the Trefftz method (not in the paper, but on the website and a reference to it in the paper) that would make the reader want to give it a try and maybe contribute to your project.

I would have expected to find, for example, a introductive text to the method that would be accessible to standard engineer. A minima, a description of the advantages of the Trefftz method (regarding other methods) would help to explain why "research into Trefftz methods" are important.

I have understood that the main drawback of the Trefftz metho is that it requires knowledge of the PDE to solve, but I did not see how I could extend NGSTrefftz for my particular PDE (example: linear elasticity or hyperelastictity). Shall I go at the C++ level. Shall I use the "general framework to produce Trefftz spaces implicitly" ?

By that, I do mean that one can not expect the interrested user to go through the provided notebooks (unless you're more than lucky).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.