Git Product home page Git Product logo

feelpp / book.feelpp.org Goto Github PK

View Code? Open in Web Editor NEW
9.0 22.0 30.0 140.5 MB

:globe_with_meridians: The Feel++ Book

Home Page: https://docs.feelpp.org

License: GNU General Public License v3.0

JavaScript 22.29% Makefile 1.05% TeX 9.40% Shell 1.92% Dockerfile 0.39% Jupyter Notebook 64.95%
feelpp finite-elements fem book user-manual developer-manual toolbox-manual contributor-manual tutorial mathematical-framework

book.feelpp.org's Introduction

Feel++: Finite Element Embedded Library in C++

feelpp DOI

feelpp?color=009688&logo=Riseup&style=flat square feelpp?color=009688&logo=Moleculer&logoColor=white&style=flat square feelpp?color=009688&logo=Bilibili&logoColor=white&style=flat square feelpp?logo=Draugiem feelpp?color=009688&style=flat square&logo=Hack The Box&logoColor=white

Feel++ is a C++ library for continuous or discontinuous Galerkin methods including finite element method(FEM), spectral element methods(SEM), reduced basis methods, discontinuous galerkin methods (DG and HDG) in 1D 2D and 3D and in parallel. Checkout What is Feel++?, Feel++ Features and some Examples.

Releases

The latest release of Feel++ is here feelpp

Feel++ has a DOI provided by Zenodo. Please use this to cite Feel++ if you use it in a publication DOI

Feel++ is split into three components:

feelpp

library and tools

feelpp-toolboxes

mono and multiphysics toolboxes (cfd, csm, heat transfer, fsi, heat and fluid, hdg(poisson and elasticity), thermo-electric and maxwell)

feelpp-mor

model order reduction applications and tools

These components are built and delivered in two distribution channels: stable and latest. The channels are currently available via Docker containers, Debian and Ubuntu packages.

stable

Once a year, sometimes more, we make a release of Feel++ and it becomes the basis of the stable channel. The channel is updated infrequently, only for a new release or a major bug.

latest

Feel++ has a very active development and changes are made everyday with the research done by Cemosis and its collaborators. Each commit in the main development branch triggers a new full build with more than 800 tests from unit test to full pde solves.

Instructions are available here to install Feel++ : https://docs.feelpp.org/user/latest/install/index.html.

Feel++ Documentation

Slack Discussion Forum

We encourage you to ask questions and discuss any aspects of the project on Slack. New contributors are always welcome!

Continuous Integration

Feel++ maintains various branches. At the core, the development model is greatly inspired by existing models out there. The central repo holds two main branches with an infinite lifetime: master and develop

master

Main branch where the source code of HEAD always reflects a production-ready state.

develop

Main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release. Some would call this the “integration branch”. This is where any automatic nightly builds are built from.

feature/*

Feature branches (or sometimes called topic branches) are used to develop new features for the upcoming or a distant future release. When starting development of a feature, the target release in which this feature will be incorporated may well be unknown at that point. The essence of a feature branch is that it exists as long as the feature is in development, but will eventually be merged back into develop (to definitely add the new feature to the upcoming release) or discarded (in case of a disappointing experiment).

What is Feel++?

Feel++ is a C++ library for continuous or discontinuous Galerkin methods including finite element method(FEM), spectral element methods(SEM), reduced basis methods, discontinuous Galerkin methods (DG and HDG) in 1D 2D and 3D and in parallel. The objectives of this framework are quite ambitious; ambitions which could be expressed in various ways such as :

  • the creation of a versatile mathematical kernel solving easily problems using different techniques thus allowing testing and comparing methods, e.g. cG versus dG,

  • the creation of a small and manageable library which shall nevertheless encompass a wide range of numerical methods and techniques,

  • build mathematical software that follows closely the mathematical abstractions associated with partial differential equations (PDE),

  • the creation of a library entirely in C++ allowing to create complex and typically multi-physics applications such as fluid-structure interaction or mass transport in haemodynamic.

Features

  • 1D 2D and 3D (including high order) geometries and also lower topological dimension 1D(curve) in 2D and 3D or 2D(surface) in 3D

  • continuous and discontinuous (dG and hdG) arbitrary order Galerkin Methods in 1D, 2D and 3D including finite and spectral element methods

  • domain specific embedded language in C++ for variational formulations

  • interfaced with PETSc for linear and non-linear solvers

  • seamless parallel computations using PETSc

  • interfaced with SLEPc for large-scale sparse standard and generalized eigenvalue solvers

  • supports Gmsh for mesh generation

  • supports Gmsh for post-processing (including on high order geometries)

  • supports Paraview and CEI/Ensight for post-processing and the following file formats: ensight gold, gmsh, xdmf.

Contributing

In the spirit of free software, everyone is encouraged to help improve this project. If you discover errors or omissions in the source code, documentation, or website content, please don’t hesitate to submit an issue or open a pull request with a fix. New contributors are always welcome!

Here are some ways you can contribute:

  • by using develop versions

  • by reporting bugs

  • by suggesting new features

  • by writing or editing documentation

  • by writing specifications

  • by writing code — No patch is too small.

    • fix typos

    • add comments

    • write examples!

    • write tests!

  • by refactoring code

  • by fixing issues

  • by reviewing Pull Requests

The Contributing guide provides information on how to create, style, and submit issues, feature requests, code, and documentation to the Feel++ Project.

Getting Help

The Feel++ project is developed to help you easily do (i) modelisation simulation and optimisation and (ii) high performance computing. But we can’t do it without your feedback! We encourage you to ask questions and discuss any aspects of the project on the discussion list, on Twitter or in the chat room.

Twitter

#feelpp hashtag or @feelpp mention

Chat (Slack)

Slack

Further information and documentation about Feel++ can be found on the project’s website.

Home | News | Docs

The Feel++ organization on GitHub hosts the project’s source code, issue tracker, and sub-projects.

Source repository (git)

https://github.com/feelpp/feelpp

Issue tracker

https://github.com/feelpp/feelpp/issues

Feel++ organization on GitHub

https://github.com/feelpp

Copyright © 2011-2023 Feel++ Consortium. Free use of this software is granted under the terms of the GPL License.

See the LICENSE file for details.

Authors

Feel++ is led by Christophe Prud’homme and has received contributions from many other individuals.

Examples

Laplacian in 2D using P3 Lagrange basis functions

Here is a full example to solve

-\Delta u = f \mbox{ in } \Omega,\quad u=g \mbox{ on } \partial \Omega

#include <feel/feel.hpp>

int main(int argc, char**argv )
{
    using namespace Feel;
    Environment env( _argc=argc, _argv=argv,
                     _desc=feel_options(),
                     _about=about(_name="qs_laplacian",
                                  _author="Feel++ Consortium",
                                  _email="[email protected]"));

    auto mesh = unitSquare();
    auto Vh = Pch<1>( mesh );
    auto u = Vh->element();
    auto v = Vh->element();

    auto l = form1( _test=Vh );
    l = integrate(_range=elements(mesh),
                  _expr=id(v));

    auto a = form2( _trial=Vh, _test=Vh );
    a = integrate(_range=elements(mesh),
                  _expr=gradt(u)*trans(grad(v)) );
    a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u,
          _expr=constant(0.) );
    a.solve(_rhs=l,_solution=u);

    auto e = exporter( _mesh=mesh, _name="qs_laplacian" );
    e->add( "u", u );
    e->save();
    return 0;
}

Bratu equation in 2D

Here is a full non-linear example - the Bratu equation - to solve

\[-\Delta u + e^u = 0 \mbox{ in } \Omega,\quad u=0 \mbox{ on } \partial \Omega$$.\]
#include <feel/feel.hpp>

inline
Feel::po::options_description
makeOptions()
{
    Feel::po::options_description bratuoptions( "Bratu problem options" );
    bratuoptions.add_options()
    ( "lambda", Feel::po::value<double>()->default_value( 1 ),
                "exp() coefficient value for the Bratu problem" )
    ( "penalbc", Feel::po::value<double>()->default_value( 30 ),
                 "penalisation parameter for the weak boundary conditions" )
    ( "hsize", Feel::po::value<double>()->default_value( 0.1 ),
               "first h value to start convergence" )
    ( "export-matlab", "export matrix and vectors in matlab" )
    ;
    return bratuoptions.add( Feel::feel_options() );
}

/**
 * Bratu Problem
 *
 * solve \f$ -\Delta u + \lambda \exp(u) = 0, \quad u_\Gamma = 0\f$ on \f$\Omega\f$
 */
int
main( int argc, char** argv )
{

    using namespace Feel;
    Environment env( _argc=argc, _argv=argv,
                     _desc=makeOptions(),
                     _about=about(_name="bratu",
                                  _author="Christophe Prud'homme",
                                  _email="[email protected]"));
    auto mesh = unitSquare();
    auto Vh = Pch<3>( mesh );
    auto u = Vh->element();
    auto v = Vh->element();
    double penalbc = option(_name="penalbc").as<double>();
    double lambda = option(_name="lambda").as<double>();

    auto Jacobian = [=](const vector_ptrtype& X, sparse_matrix_ptrtype& J)
        {
            auto a = form2( _test=Vh, _trial=Vh, _matrix=J );
            a = integrate( elements( mesh ), gradt( u )*trans( grad( v ) ) );
            a += integrate( elements( mesh ), lambda*( exp( idv( u ) ) )*idt( u )*id( v ) );
            a += integrate( boundaryfaces( mesh ),
               ( - trans( id( v ) )*( gradt( u )*N() ) - trans( idt( u ) )*( grad( v )*N()  + penalbc*trans( idt( u ) )*id( v )/hFace() ) );
        };
    auto Residual = [=](const vector_ptrtype& X, vector_ptrtype& R)
        {
            auto u = Vh->element();
            u = *X;
            auto r = form1( _test=Vh, _vector=R );
            r = integrate( elements( mesh ), gradv( u )*trans( grad( v ) ) );
            r +=  integrate( elements( mesh ),  lambda*exp( idv( u ) )*id( v ) );
            r +=  integrate( boundaryfaces( mesh ),
               ( - trans( id( v ) )*( gradv( u )*N() ) - trans( idv( u ) )*( grad( v )*N() ) + penalbc*trans( idv( u ) )*id( v )/hFace() ) );
        };
    u.zero();
    backend()->nlSolver()->residual = Residual;
    backend()->nlSolver()->jacobian = Jacobian;
    backend()->nlSolve( _solution=u );

    auto e = exporter( _mesh=mesh );
    e->add( "u", u );
    e->save();
}

book.feelpp.org's People

Contributors

cdaversin avatar ddrous avatar dependabot[bot] avatar francoisdh avatar gdolle avatar ggrossetie avatar gqmp avatar guillaume-steimer avatar idrissaniakh avatar jbwahl avatar lberti avatar lsala avatar miinguyen avatar olmes-sch avatar philippericka avatar prudhomm avatar romainhild avatar thomas-saigre avatar trophime avatar valletromain avatar vincentchabannes avatar youssefessousy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

book.feelpp.org's Issues

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

review and update dev manual

The dev manual is currently in a sorry state and split in non-comprehensive structure.
it needs a major overhaul

Add documentation of basic toolbox usage

Add in book.feelpp.org and book.mso4sc CSM toolbox usage, eg torsionbar ?
use include in order to deploy on book.mso4sc
describe

  • model
  • expected results
  • expected performance

This is necessary for the MSO4SC project to verify and validate that the application that we run, are indeed running properly

Document usage of Exporter including within loops

We should document the way Exporter should be used within loops (eg time loops)

For example writing this in a loop

    auto e = exporter( _mesh=mesh );
    e->addRegions();
    e->step(t)->add( "u", u );
    e->step(t)->add( "p", p );
    e->save();

at time t would overwrite results at previous time steps.
It should have written this way instead.

auto e = exporter( _mesh=mesh );
for( double t = dt; t < T; t += dt )
{
    // do stuff with u and p
    e->step(t)->add( "u", u );
    e->step(t)->add( "p", p );
    e->save();
}

Document Feel++ data management plan

The Feel++ data management needs to be documented and should be available online in the feelpp books/docs.

  • A first idea: create a module that should appear in the user, dev and toolbox manuals and contain the overall strategy.
  • A second idea: split the management plan between user, dev and toolbox manuals

what do you think?
I would prefer a overall picture in one module

review and update dev manual

The dev manual is currently in a sorry state and split in non-comprehensive structure.
it needs a major overhaul

Documentation FSI

I can't find the FSI toolbox documentation explaining the various possible options that one can choose, (neither in books nor in docs)

Create a functional analysis book

All the functional analysis theory should go in one book for

  • finite element method
  • reduced basis method
  • hybridized discontinuous Galerking method

and more...

Add documentation for singularity

Provide documentation for Feel++ singularity images

  • how to download
  • how to run applications
  • provides examples for sequential and parallel applications

update documentation after update of feelpp-env

Now feelpp-env incorporates tools to

  • make a release automatically of feel++ using various tools (curl, jq, github_changelog_generator...)
  • asciidoctor tools suite for book.feelpp.org

We could probably have the book install in a docker image very soon

Bool missing files

@prudhomm it seems there the file math/fem/macros.tex is missing and the stylesheet (for index.html, stylesheets/custom.css) seems not up to date, I'have blank background from my side

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

review and update dev manual

The dev manual is currently in a sorry state and split in non-comprehensive structure.
it needs a major overhaul

move book architecture to antora

Context

book.feelpp.org is based currently on Jekyll and Asciidoc. Antora has been developed and provides a nice framework to document code using Asciidoc.
After a few tests, it is clear that it is the way to go for our documentation.

Architecture

Antora has a flexible architecture described here.

I propose that we split book into several manuals as currently done on the website and reorganize ala antora. We would have

  • User Manual
  • Developer Manual
  • The Mathematics of Feel++ (we merge fem, anafunc, rb and hdg)
  • Feel++ Toolboxes Manual
  • Infrastructure manual (Atlas, Mesocentre, ...)

/cc @feelpp/mso4sc

review and update dev manual

The dev manual is currently in a sorry state and split in non-comprehensive structure.
it needs a major overhaul

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

Missing link on Feel++ book on how to Compile Boost C++ library

@lberti commented on Mon Apr 09 2018

I was trying to install Feel++ in my computer but it's Ubuntu 16.04 and it has the following problem, already reported in the webpage. The link on how to recompile Boost is not working.

"We are unfortunately stung by the ABI change in GCC 6 when using clang. You need to recompile the Boost C++ libraries to be able to use clang, see the section in the Annexes on Compiling Boost."


@gdolle commented on Mon Apr 09 2018

Hi @lberti,

Here you have the documentation on how to compile boost,
https://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html

you can have a look at how we build boost for Feel++ on our ubuntu-16.04 docker images:
https://github.com/feelpp/docker/blob/2b53fc9ab1a730327b6f52ed4d06e691d6d36cc8/feelpp-env/Dockerfile-boost

Currently this issue is documentation related, I move this issue in the appropriate repository and close this one.

NB: We are currently moving/updating the documentation to this http://docs.feelpp.org don't hesitate to give us feedback.

Add ADR, Stokes and Elasticity examples

There is addition of the ADR, Stokes and Elasticity examples to be added to the math manual and incorporated into the user manual in the learn by example section.

the Laplacian example should be most to the math manual to be consistent

Add postprocessing section documentation

We should add a section to explain how to post process data with feel++ (basics, + ref to paraview, gmsh, ... doc)

In particular, how to use

  • paraview Insitu with feel++
  • paraview pvserver
  • paraweb (later)
  • gmsh

etc...

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

Review User Manual

review the user manual and proposes fixes, modifications, additions...
http://docs.feelpp.org/user/0.1/index.html

  • Does it answer basic questions about Feel++?
  • Does it provide proper installation procedures?
  • Does it provide basic examples?
  • Does it enable a quick start with Feel++? (within 1 hour counting software download)

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

Feature/antora

The PR provides an entirely new framework for our documentation. It is based on Antora .
It implements:

  • #53 review/update dev manual
  • #52 add angiotk manual
  • #51 documentation for data mangement plan
  • #50 journaling and benchmarking documentation
  • #49 the documentation for alsacalcul
  • #48 a review of the user manual
  • #47 re-design the architecture to fit Antora design
  • #45 new toolbox examples and benchmarks from http://github.com/feelpp/toolbox
  • #44 basic documentation for toolbox usage
  • #43 math fixes in dev man for algebraic solutions

Add CmakeLists.txt template

Looking at the minimal example there is no cmake file example, unless I'm mistaken.

Maybe we should add the following:

cmake_minimum_required(VERSION 2.8)

if ( ${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 3 )
  message(STATUS "[feelpp] use OLD policy CMP0064" )
  cmake_policy(SET CMP0064 OLD)
endif()

project(minimalexample)
set(PROJECT_SHORTNAME "me")

if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
 find_package(Feel++ PATHS $ENV{FEELPP_DIR}/share/feelpp/feel/cmake/modules /usr/share/feelpp/feel/cmake/modules /usr/local/share/feelpp/feel/cmake/modules ) 
 if(NOT FEELPP_FOUND)
      message(FATAL_ERROR "Feel++ was not found on your system. Make sure to install it and specify the FEELPP_DIR to reference the installation directory.")
  endif()
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

feelpp_add_application( myapp SRCS myapp.cpp CFG myapp.cfg )

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.