Giter Site home page Giter Site logo

gdrealm / ngsxfem Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ngsxfem/ngsxfem

0.0 2.0 0.0 8.75 MB

Add-On to NGSolve for unfitted finite element discretizations (XFEM, CutFEM, TraceFEM, etc...)

License: GNU Lesser General Public License v3.0

CMake 2.74% C++ 67.57% Python 29.70%

ngsxfem's Introduction

About ngsxfem

ngsxfem is an Add-on library to Netgen/NGSolve which enables the use of unfitted finite element technologies known as XFEM, CutFEM, TraceFEM, Finite Cell, … . ngsxfem is an academic software. Its primary intention is to facilitate the development and validation of new numerical methods.

The main features

Numerical integration on implicitly described (via a level set function) geometries which are not fitted to the mesh

Given a level set function φ which describes the geometry (e.g. Ω = { φ < 0 }) a piecewise linear approximation is made. On simplices (triangles and tetrahedra) this gives a planar intersection on every element which allows for an explicit decomposition into simple geometries. On these simple (uncut) geometries standard quadrature rules of arbitrary order can be applied which results in quadrature rules for the (approximated) subdomains where the level set is positive/negative/zero.

Tools to work on an “active mesh” only

In unfitted finite element methods some functions and integrals are only defined on a subset of the mesh. Accordingly finite element spaces and integrals have to be defined only on this active mesh. ngsxfem offers the tools to mark the corresponding elements and facets and use the marking during assembly and definition of finite element spaces. On cut elements one often also uses locally modified finite elements, e.g. by restriction of finite elements on the background mesh.

Higher order representation of implicit level-set geometries

To obtain higher order accuracy, we offer a mesh transformation technique in the spirit of isoparametric finite element methods. Thereby the piecewise linear approximation (which is only of second order) is mapped onto a higher order accurate approximation of the true geometry.

Applications

This section is to be added soon …

Installation

Linux Build Steps

You require Netgen/NGSolve to run and build the xfem module (ngsxfem). You can either install it before hand (default option) or let Netgen/NGSolve be installed as an external dependency.

git clone https://github.com/ngsxfem/ngsxfem.git
cd ngsxfem
mkdir build
cd build

Building xfem with pre-installed NGSolve

You have Netgen/NGSolve installed? Perfect. Then let INSTLOCATION be the location Netgen/NGSolve is already installed to. To install xfem make sure that you have write access to that same directory. Then build ngsxfem with

cmake ../ -DCMAKE_INSTALL_PREFIX=INSTLOCATION -DBUILD_NGSOLVE=OFF
make
make install

Fix of potential issues

If you have compiling problems or at run time some NGSolve symbols are not found, it may be (happened in some configurations) that the NGSolve compiler and linker wrapper ngscxx and ngsld were not used. In this case you may add

cmake ... -DCMAKE_CXX_COMPILER=ngscxx -DCMAKE_LINKER=ngsld

to the cmake configuration.

Building the NGS-Suite and ngsxfem together

If you do not have Netgen/NGSolve installed, you may first call

git submodule update --init

which pulls Netgen/NGSolve as external dependencies. Then, just call

cmake ../ -DCMAKE_INSTALL_PREFIX=INSTLOCATION -DBUILD_NGSOLVE=ON
make
make install

For INSTLOCATION you choose a nice installation location. Afterwards make sure that the installed NGS/xfem-libraries and executable will be found by PATH and python.

Updating ngsxfem

To update ngsxfem, update the sources

git pull origin master

As the ngsolve-version that the updated xfem-version depends on can be updated in the mean time, make sure to update NGSolve. If you build NGSolve as an external dependency update the submodule NGSolve:

git submodule update --init --recursive

Otherwise update your NGSolve version manually. As a rule we try to be compatible to the latest release of NGSolve. To be sure check the version in external_dependencies/ngsolve

Examples

To run the python examples be sure to follow the build steps above. Then navigate into the py_tutorials and run

netgen example.py

where example.py stands for any of the available python files.

Testing

Tests are enabled by default. To run the test navigate to the build directory and run make test or ctest. If you need to see specific tests failing use ctest -V. To run individual tests use ctest -R <regex>. E.g. ctest -R cutint to only run cut integration tests. Note that we use pytest (with python version > 3).

pde vs. py files

From version 1.0.0 on there are no pde-files used in this project anymore. Only python-files are used.

Examples

At https://github.com/ngsxfem/ngsxfem-jupyter you can find tutorial-style jupyter notebooks for ngsxfem. Further, in py_tutorials/ there are some simple examples for some known unfitted discretizations:

  • py_tutorials/cutfem.py : stationary interface problem with a (P1) CutFEM method with Nitsche
  • py_tutorials/nxfem.py : stationary interface problem with a (P1) XFEM method with Nitsche (similar to cutfem.py)
  • py_tutorials/nxfem_higher_order.py : stationary interface problem with a higher order isoparametric unfitted FEM with Nitsche (similar to nxfem.py)
  • py_tutorials/fictdom_ghostpen.py : stationary fictitious domain problem with isoparametric CutFEM, Nitsche and ghost penalty stabilization
  • py_tutorials/fictdom_dg_ghostpen.py : stationary fictitious domain problem with isoparametric Cut-DG-FEM, Nitsche and ghost penalty stabilization
  • py_tutorials/stokesxfem.py : stationary Stokes interface problem with an isoparametric (P2X/P1X) Taylor-Hood-Nitsche-XFEM discretization
  • py_tutorials/tracefem.py : stationary 2D surface PDE problem with a TraceFEM discretization (low order)
  • py_tutorials/tracefem3d.py : stationary 3D surface PDE problem with a TraceFEM discretization (higher order)
  • py_tutorials/moving_domain.py : moving fictitous domain problem using a space time unfitted FEM (cf. corresponding tutorial at https://github.com/ngsxfem/ngsxfem-jupyter )

ngsxfem's People

Contributors

fabianheimann avatar schruste avatar newbisi avatar markuswess avatar plederer avatar cwintersteiger avatar janoschpreuss avatar mhochsteger avatar chrlackner avatar

Watchers

James Cloos avatar  avatar

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.