diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000000000000000000000000000000000000..60cf9d536e56d8675468717814ffb5698298cf1e
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,11 @@
+---
+# https://clang.llvm.org/docs/ClangFormatStyleOptions.html#
+# the "Visual Studio" style is similar to:
+BasedOnStyle: LLVM
+UseTab: Never
+IndentWidth: 4
+BreakBeforeBraces: Allman
+AccessModifierOffset: -4
+SortIncludes: false
+ColumnLimit: 0
+...
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000000000000000000000000000000000..de6044b96d078e062de7f658aef508ff77461564
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,8 @@
+# EditorConfig is awesome: https://EditorConfig.org
+
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 4
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..c75d6969122a3061d7857371e186724cef740f0d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,66 @@
+# Compiled Object files
+*.slo
+*.lo
+*.o
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+
+# Misc
+core
+*.pyc
+__pycache__/
+*.*~
+
+# OS
+.DS_Store
+*.swp
+*.bak
+
+# Workspace
+workspace
+workspace.tar.gz
+*.tar.gz
+*.tgz
+
+# build dir
+build
+
+# gitlab-ci / clang-format
+patches
+
+# Ansys
+*.apdl
+!*_lfs.apdl
+*.ansys
+!*_lfs.ansys
+
+# Gmsh
+*.pos
+*.msh # do not commit the mesh...
+!*_lfs.msh # ... except in the lfs
+#*.opt
+
+# sge output
+*.o*
+*.po*
+
+# matlab
+*.asv
+
+# paraview
+*.ogv
+*.pvsm
+
+# IDE
+.project
+.pydevproject
+.settings
+.vscode
+.vscode/*
diff --git a/.gitlab-ci.yml.tmp b/.gitlab-ci.yml.tmp
new file mode 100644
index 0000000000000000000000000000000000000000..d905eed8307f4b078806ba9f3aa1f400902aede4
--- /dev/null
+++ b/.gitlab-ci.yml.tmp
@@ -0,0 +1,116 @@
+# gitlab-ci file for waves
+
+default:
+    image: rboman/waves-py3:2020.3
+    before_script:
+        - source /opt/intel/mkl/bin/mklvars.sh intel64
+        - source /opt/intel/tbb/bin/tbbvars.sh intel64
+        - echo $(nproc)
+        - printenv | sort
+
+.global_tag: &global_tag_def
+    tags:
+        - mn2l
+#        - warson   # you can choose a set of runners here
+
+variables:
+    GIT_SUBMODULE_STRATEGY: recursive
+    GIT_STRATEGY: clone # workaround full clone for each pipeline (https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26993)
+    GIT_LFS_SKIP_SMUDGE: 1 # do not pull LFS
+
+stages:
+    - build
+    - test
+
+format:
+    <<: *global_tag_def
+    stage: build
+    script:
+        - clang-format --version # we use clang-format-10 exclusively
+        - ./ext/amfe/scripts/format_code.py
+        - mkdir -p patches
+        - if git diff --patch --exit-code > patches/clang-format.patch; then echo "Clang format changed nothing"; else echo "Clang format found changes to make!"; false; fi
+    artifacts:
+        paths:
+            - patches/
+        expire_in: 1 day
+        when: on_failure
+    allow_failure: true
+
+build-no-tlnos:
+    <<: *global_tag_def
+    stage: build
+    script:
+        - git submodule init
+        - git submodule update
+        - rm -rf build workspace
+        - mkdir build
+        - cd build
+        - cmake -Wno-dev -C ../CMake/disable-trilinos.cmake ..
+        - make -j 8
+
+build:
+    <<: *global_tag_def
+    stage: build
+    script:
+        - git submodule init
+        - git submodule update
+        - rm -rf build workspace
+        - mkdir build
+        - cd build
+        - cmake -Wno-dev ..
+        - make -j 8
+    artifacts:
+        paths:
+            - build/
+        expire_in: 1 day
+
+build-red:
+    <<: *global_tag_def
+    image: rboman/waves-py3-red:2020.3
+    stage: build
+    script:
+        - git submodule init
+        - git submodule update
+        - rm -rf build workspace
+        - mkdir build
+        - cd build
+        - cmake -Wno-dev ..
+        - make -j 8
+    artifacts:
+        paths:
+            - build/
+        expire_in: 1 day
+            
+doxygen:
+    <<: *global_tag_def
+    stage: test
+    script:
+        - cd build
+        - make dox
+    artifacts:
+        paths:
+            - build/doxygen/
+        expire_in: 1 week
+    dependencies:
+        - build
+
+ctest:
+    <<: *global_tag_def
+    stage: test
+    script:
+        - cd build
+        - ctest --output-on-failure -j 8
+    #timeout: 10 hours  # will be available in 12.3
+    dependencies:
+        - build
+        
+ctest-red:
+    <<: *global_tag_def
+    image: rboman/waves-py3-red:2020.3
+    stage: test
+    script:
+        - cd build
+        - ctest --output-on-failure -j 8 -R katoptron
+    dependencies:
+        - build-red
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..60aedd4ac583ff94c109bb26b2b215562f5c9634
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,144 @@
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# ----------------------------------------------------------------------------
+PROJECT(amfe-solvers)
+# ----------------------------------------------------------------------------
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
+IF(${CMAKE_VERSION} VERSION_GREATER "3.14.0") # we might want to update the project and use the NEW behavior here
+    cmake_policy(SET CMP0078 OLD)
+    cmake_policy(SET CMP0086 OLD)
+ENDIF()
+
+# -- I/O
+# Lib/Exe dir
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
+                        "Single output directory for building all libraries.")
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
+                        "Single output directory for building all executables.")
+MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
+
+# Build type
+IF(NOT CMAKE_BUILD_TYPE)
+    SET( CMAKE_BUILD_TYPE "Release" CACHE STRING 
+         "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+         FORCE)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake")
+
+# -- C++11
+SET(CMAKE_CXX_STANDARD 11) # newer way to set C++11 (requires cmake>=3.1)
+SET(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+# Set specific languages flags
+IF((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel"))
+    IF(NOT APPLE)
+        SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
+    ENDIF()
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # add verbosity
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Wno-unknown-pragmas -Wno-sign-compare") # merge trilinos
+ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE)
+    ADD_DEFINITIONS(-D_USE_MATH_DEFINES) # otherwise M_PI is undefined
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")  # parallel build with MSVC
+    #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")  # add verbosity
+ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
+    #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything") # add verbosity
+ENDIF()
+
+# -- OS related (from Kim)
+IF(APPLE)
+    SET(CMAKE_MACOSX_RPATH TRUE)
+ENDIF()
+
+# -- Search for Python
+IF (CMAKE_VERSION VERSION_LESS 3.12.0)
+    FIND_PACKAGE(PythonInterp 3.6 REQUIRED)
+    FIND_PACKAGE(PythonLibs 3.6 REQUIRED)
+ELSE()
+    FIND_PACKAGE(Python3 COMPONENTS Interpreter Development)
+    # use Python3_ROOT_DIR if wrong python found (e.g. anaconda)
+    SET(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+    SET(PYTHON_LIBRARIES ${Python3_LIBRARIES})
+    SET(PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS}) 
+    SET(PYTHONLIBS_VERSION_STRING ${Python3_VERSION})     
+ENDIF()
+MESSAGE(STATUS "PYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}")
+MESSAGE(STATUS "PYTHON_LIBRARIES:FILEPATH=${PYTHON_LIBRARIES}")
+MESSAGE(STATUS "PYTHON_INCLUDE_PATH:FILEPATH=${PYTHON_INCLUDE_PATH}")
+MESSAGE(STATUS "PYTHON_FRAMEWORK_INCLUDES=${PYTHON_FRAMEWORK_INCLUDES}")
+MESSAGE(STATUS "PYTHONLIBS_VERSION_STRING=${PYTHONLIBS_VERSION_STRING}")
+MESSAGE(STATUS "Python_FRAMEWORKS=${Python_FRAMEWORKS}")
+
+# -- Search for SWIG
+FIND_PACKAGE(SWIG REQUIRED)
+IF(CMAKE_GENERATOR MATCHES "Visual Studio") # not MSVC because of nmake & jom
+    SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}/$(Configuration)/")
+ELSE()
+    SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}")
+ENDIF()
+
+# -- Doxygen (https://vicrucann.github.io/tutorials/quick-cmake-doxygen/)
+# check if Doxygen is installed
+FIND_PACKAGE(Doxygen)
+IF(DOXYGEN_FOUND)
+    # set input and output files
+    SET(DOXYGEN_IN ${PROJECT_SOURCE_DIR}/Doxyfile.in)
+    SET(DOXYGEN_OUT ${PROJECT_BINARY_DIR}/Doxyfile)
+    # request to configure the file
+    CONFIGURE_FILE(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
+    # note the option ALL which allows to build the docs together with the application
+    # "make dox" rebuilds the doc
+    ADD_CUSTOM_TARGET( dox #ALL
+        COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        COMMENT "Generating API documentation with Doxygen"
+        VERBATIM )
+ELSE()
+    MESSAGE("Doxygen needs to be installed to generate the doxygen documentation")
+ENDIF()
+
+INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) # to find "amfe_def.h"
+
+# -- CTest
+ENABLE_TESTING()
+
+# -- INSTALL
+IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+    EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m site --user-site OUTPUT_VARIABLE PY_SITE OUTPUT_STRIP_TRAILING_WHITESPACE)
+    SET(CMAKE_INSTALL_PREFIX "${PY_SITE}/amfe-solvers" CACHE STRING "Install location" FORCE)
+    SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
+ENDIF()
+IF(UNIX AND NOT APPLE)
+    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
+ENDIF()
+
+# -- Sub directories
+
+ADD_SUBDIRECTORY( ext )
+ADD_SUBDIRECTORY( heat )
+ADD_SUBDIRECTORY( waves )
+
+# -- FINAL
+MESSAGE(STATUS "PROJECT: ${CMAKE_PROJECT_NAME}")
+MESSAGE(STATUS "* SYSTEM NAME=\"${CMAKE_SYSTEM_NAME}\"")
+MESSAGE(STATUS "* CXX COMPILER: ${CMAKE_CXX_COMPILER_ID}")
+MESSAGE(STATUS "* CXX STANDARD: ${CMAKE_CXX_STANDARD}")
+MESSAGE(STATUS "* INSTALL DIR: ${CMAKE_INSTALL_PREFIX}")
+MESSAGE(STATUS "* BUILD TYPE: ${CMAKE_BUILD_TYPE}")
+MESSAGE(STATUS "* VTK SUPPORT: ${USE_VTK}")
+MESSAGE(STATUS "* MKL SUPPORT: ${USE_MKL}")
+MESSAGE(STATUS "* MUMPS SUPPORT: ${USE_MUMPS}")
diff --git a/Doxyfile.in b/Doxyfile.in
new file mode 100644
index 0000000000000000000000000000000000000000..471f6ee75068d6a59a4da7ee3e5d9f34a880a417
--- /dev/null
+++ b/Doxyfile.in
@@ -0,0 +1,2493 @@
+# Doxyfile 1.8.11
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME           = amfe-solvers
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER         = 
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = "Examples of FE solvers built with amfe"
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO           = @PROJECT_SOURCE_DIR@/dox/logo.jpg
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = @PROJECT_BINARY_DIR@/doxygen
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS         = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES    = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES        = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES                = 
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST              = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING      = 
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC  = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE            = 
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES         = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS               = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC       = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR          = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
+
+INPUT                  = @PROJECT_SOURCE_DIR@/README.md \
+                         @PROJECT_SOURCE_DIR@/flow/src \
+                         @PROJECT_SOURCE_DIR@/fwk/src \
+                         @PROJECT_SOURCE_DIR@/heat/src \
+                         @PROJECT_SOURCE_DIR@/mirrors/src \
+                         @PROJECT_SOURCE_DIR@/katoptron/src \
+                         @PROJECT_SOURCE_DIR@/tbox/src \
+                         @PROJECT_SOURCE_DIR@/waves/src 
+
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
+# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
+
+FILE_PATTERNS          = *.c \
+                         *.cpp \
+                         *.h \
+                         *.hpp \
+                         *.md
+
+#FILE_PATTERNS          = *.c \
+#                         *.cc \
+#                         *.cxx \
+#                         *.cpp \
+#                         *.c++ \
+#                         *.java \
+#                         *.ii \
+#                         *.ixx \
+#                         *.ipp \
+#                         *.i++ \
+#                         *.inl \
+#                         *.idl \
+#                         *.ddl \
+#                         *.odl \
+#                         *.h \
+#                         *.hh \
+#                         *.hxx \
+#                         *.hpp \
+#                         *.h++ \
+#                         *.cs \
+#                         *.d \
+#                         *.php \
+#                         *.php4 \
+#                         *.php5 \
+#                         *.phtml \
+#                         *.inc \
+#                         *.m \
+#                         *.markdown \
+#                         *.md \
+#                         *.mm \
+#                         *.dox \
+#                         *.py \
+#                         *.pyw \
+#                         *.f90 \
+#                         *.f \
+#                         *.for \
+#                         *.tcl \
+#                         *.vhd \
+#                         *.vhdl \
+#                         *.ucf \
+#                         *.qsf \
+#                         *.as \
+#                         *.js
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH             = @PROJECT_SOURCE_DIR@/dox/
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS = 
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =  README.md
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS        = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS       = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse-libclang=ON option for CMake.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS          = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX     = NO
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET        = 
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET  = 
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES       = 
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET        = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP      = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE               = 
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION           = 
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI           = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING     = 
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME   = 
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS  = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS  = 
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION           = 
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW      = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH         = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX            = YES
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS     = 
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE       = 
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL       = 
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID     = 
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS  = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES         = amsmath
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER           = 
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER           = 
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET = 
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES      = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE        = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES     = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE        = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP        = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE    = 
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE        = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION          = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR             = 
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT             = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK       = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT         = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sf.net) file that captures the
+# structure of the code including all documentation. Note that this feature is
+# still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS        = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES         = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            = 
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH               = 
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: YES.
+
+HAVE_DOT               = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS        = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH          = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
+# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
+# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG        = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS           = 
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS           = 
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS           = 
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH      = 
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH  = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP            = YES
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..8dada3edaf50dbc082c9a125058f25def75e625a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/README.md b/README.md
index 25b6eccc5fb9e60f89302d46d88b67e389964b08..e38d97e1cdde4ca1f761b996fc2653d4b982a648 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,39 @@
-# amfe-solvers
+# waves
+Waves is a collection of general utilities and finite element tools for solving various PDE. The code is written in C++ interfaced in python through SWIG, and is developed at the University of Liège.
 
+![](/dox/img.png)
 
+## Features
+Set of python/C++ modules:
+  - [waves](/waves): 3D(Hex8) transient wave equation solver (FEM)
+  - [flow](https://gitlab.uliege.be/am-dept/dartflo): 2D(Tri3) and 3D(Tetra4) steady full potential equation solver (FEM) - moved to [dartflo](https://gitlab.uliege.be/am-dept/dartflo)
+  - [heat](/heat): 2D(Tri3) steady nonlinear heat equation solver (multiscale FE²M)
+  - [katoptron](/katoptron): 3D(Hex8 and Tetra4) linear thermomechanical equations with contact (FEM)
+  - [tlnos](/tlnos): basic Trilinos examples
 
-## Getting started
+Additional features:
+  - [x] [Gmsh](http://geuz.org/gmsh/) support for mesh and post-processing
+  - [x] [VTK](http://www.vtk.org/)/[PyQt](https://riverbankcomputing.com/software/pyqt/intro) support for post processing and basic GUI
+  - [x] [OpenBLAS](http://www.openblas.net/) or [Intel MKL](https://software.intel.com/en-us/intel-mkl) support
+  - [x] [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page) support for linear algebra
+     - [Intel Pardiso](https://software.intel.com/content/www/us/en/develop/documentation/mkl-developer-reference-c/top/sparse-solver-routines/intel-mkl-pardiso-parallel-direct-sparse-solver-interface/pardiso.html) support
+     - [MUMPS](http://mumps.enseeiht.fr/) support
+  - [x] [TBB](https://www.threadingbuildingblocks.org/) support for multithreading
+  - [x] [mpi4py](https://bitbucket.org/mpi4py/mpi4py) support for parallelization
+  - [x] [Trilinos](https://trilinos.github.io/) support (for some modules)
 
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
+## Build
 
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
+Detailed build instructions can be found in the [wiki](https://gitlab.uliege.be/am-dept/waves/wikis/home).
 
-## Add your files
+## References
 
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
+Liegeois Kim, [GMRES with embedded ensemble propagation for the efficient solution of parametric linear systems in uncertainty quantification of computational models with application to the thermomechanical simulation of an ITER front mirror](http://hdl.handle.net/2268/249334), University of Liège, 2020.
 
-```
-cd existing_repo
-git remote add origin https://gitlab.uliege.be/am-dept/amfe-solvers.git
-git branch -M main
-git push -uf origin main
-```
+Crovato Adrien, [Steady Transonic Aerodynamic and Aeroelastic Modeling for Preliminary Aircraft Design](http://hdl.handle.net/2268/251906), University of Liège, 2020.
 
-## Integrate with your tools
+Liegeois K., Boman R., Phipps E., Wiesner T., and Arnst M., [GMRES with embedded ensemble propagation for the efficient solution of parametric linear systems in uncertainty quantification of computational models](http://hdl.handle.net/2268/248201), Computer Methods in Applied Mechanics and Engineering, Vol. 369, 2020.
 
-- [ ] [Set up project integrations](https://gitlab.uliege.be/am-dept/amfe-solvers/-/settings/integrations)
+Crovato A., Boman R., Guner H., Terrapon V., Dimitriadis G., Almeida H., Prado A., Breviglieri C., Cabral P., and Silva, G., [A Full Potential Static Aeroelastic Solver for Preliminary Aircraft Design](http://hdl.handle.net/2268/237955), 18th International Forum on Aeroelasticity and Structural Dynamics, IFASD 2019.
 
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!).  Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+Bilocq Amaury, [Implementation of a viscous-inviscid interaction scheme in a finite element full potential solver](http://hdl.handle.net/2268/252195), University of Liège, 2020.
diff --git a/dox/logo.jpg b/dox/logo.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..17aeb3377b96b8ec85fed719dd8b3fdc25bd6913
Binary files /dev/null and b/dox/logo.jpg differ
diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3c75cd0707ae6ec472aabfbed5bcf7d2af61160b
--- /dev/null
+++ b/ext/CMakeLists.txt
@@ -0,0 +1 @@
+ADD_SUBDIRECTORY(amfe)
diff --git a/heat/CMakeLists.txt b/heat/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3fc1d71d25d74fd03c14d0e794807c594316f0c5
--- /dev/null
+++ b/heat/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Add source dir
+ADD_SUBDIRECTORY( src )
+ADD_SUBDIRECTORY( _src )
+
+# Add test dir
+MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests)
diff --git a/heat/__init__.py b/heat/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..312d11ecf6d795f091f148cd1385acec26d3ab61
--- /dev/null
+++ b/heat/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# heat MODULE initialization file
+
+import fwk
+import tbox
+from heatw import *
diff --git a/heat/_src/CMakeLists.txt b/heat/_src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3507ecc2e766b1c480874612b9cabec1d43ed158
--- /dev/null
+++ b/heat/_src/CMakeLists.txt
@@ -0,0 +1,52 @@
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# CMake input file of the SWIG wrapper around "heatw.so"
+
+INCLUDE(${SWIG_USE_FILE})
+
+FILE(GLOB SRCS *.h *.cpp *.inl *.swg)
+FILE(GLOB ISRCS *.i)
+
+SET(CMAKE_SWIG_FLAGS "")
+SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON)
+
+SET(SWINCFLAGS 
+-I${PROJECT_SOURCE_DIR}/heat/src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src
+)
+SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES SWIG_FLAGS "${SWINCFLAGS}")
+
+if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
+    SWIG_ADD_MODULE(heatw python ${ISRCS} ${SRCS})
+else()
+    SWIG_ADD_LIBRARY(heatw LANGUAGE python SOURCES ${ISRCS} ${SRCS})
+endif()
+MACRO_DebugPostfix(_heatw)
+
+TARGET_INCLUDE_DIRECTORIES(_heatw PRIVATE ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src
+                                          ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src
+                                          ${PYTHON_INCLUDE_PATH}
+)
+
+SWIG_LINK_LIBRARIES(heatw 
+                    heat tbox fwk ${PYTHON_LIBRARIES}
+)
+
+INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/heatw.py DESTINATION ${CMAKE_INSTALL_PREFIX})
+INSTALL(TARGETS _heatw DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/heat/_src/heatw.i b/heat/_src/heatw.i
new file mode 100644
index 0000000000000000000000000000000000000000..0e9b0695c57735bfd900e9dd201697f864ede0b9
--- /dev/null
+++ b/heat/_src/heatw.i
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// SWIG input file of the 'heat' module
+
+%feature("autodoc","1");
+
+%module(docstring=
+"'heatw' module: projet MP 2015/2016
+(c) ULg - A&M",
+directors="1",
+threads="1"
+) heatw
+%{
+
+#include <string>
+#include <sstream>
+#include <typeinfo>
+#include "heat.h"
+
+#include "wProblem.h"
+
+#include "wBoundary.h"
+#include "wMedium.h"
+#include "wSource.h"
+#include "wDirichlet.h"
+#include "wPeriodic.h"
+
+#include "wSolver.h"
+
+#include "wCompiledFct.h"
+
+#include "wDisplayHook.h"
+
+#include "fwkw.h"
+#include "tboxw.h"
+
+#include "wExtractor.h"
+
+%}
+
+
+%include "fwkw.swg"
+
+// ----------- MODULES UTILISES ------------
+%import "tboxw.i"
+
+// ----------- HEAT CLASSES ----------------
+%include "heat.h"
+
+%shared_ptr(heat::Medium);
+%shared_ptr(heat::Source);
+%shared_ptr(heat::Dirichlet);
+%shared_ptr(heat::Boundary);
+%shared_ptr(heat::Periodic);
+%shared_ptr(heat::Problem);
+%shared_ptr(heat::Solver);
+
+
+
+%feature("director") heat::DisplayHook;
+%include "wDisplayHook.h"
+
+%feature("director:except") {
+    if ($error != NULL) {
+        std::cout << "[in director:except]\n";
+        //throw Swig::DirectorMethodException();
+        throw std::runtime_error("Director problem");
+    }
+}
+
+%include "wDirichlet.h"
+%include "wMedium.h"
+%include "wSource.h"
+%include "wBoundary.h"
+%include "wPeriodic.h"
+%shared_ptr(heat::CompiledFct1a);
+%shared_ptr(heat::CompiledFct2a);
+%shared_ptr(heat::CompiledFct1b);
+%shared_ptr(heat::CompiledFct2b);
+%include "wCompiledFct.h"
+%include "wExtractor.h"
+
+%immutable heat::Problem::msh; // avoids the creation of the setter method
+%include "wProblem.h"
+
+%immutable heat::Solver::pbl; // avoids the creation of the setter method
+%immutable heat::Solver::tms; // avoid the creation of the setter method
+%include "wSolver.h"
diff --git a/heat/broken/heat_multiscale.py b/heat/broken/heat_multiscale.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8d6cd58712be4784c2efe6eb15b058cd1158bba
--- /dev/null
+++ b/heat/broken/heat_multiscale.py
@@ -0,0 +1,111 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# 1er test multiscale (sans MPI)
+
+
+
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+import math
+
+class MicroModel(tbox.Fct2UdU):
+    def __init__(self):
+        tbox.Fct2UdU.__init__(self)
+        print("[m] creation of the micro model")
+
+        self.msh = gmsh.MeshLoader("heat_ms_micro.geo", __file__).execute()
+        self.pbl = h.Problem(self.msh)
+    
+        self.solver = h.Solver(self.pbl)
+        self.solver.nthreads = 1
+        self.solver.save = False
+        self.solver.verbose = 0
+        
+        h.Medium(self.pbl, "Matrix",    tbox.Fct2C(1.,1.,0), 1.0)
+        h.Medium(self.pbl, "Inclusion", tbox.Fct2C(100.,100.,0), 1.0)
+        self.p = h.Periodic(self.pbl, 0.0, 0.0, 0.0)    
+       
+    def eval(self, elem, npg, u, gradu, k, fake):           
+    #def eval(self, u, gradu, k, fake):
+        verb=False
+        
+        TM   = u
+        dTxM = gradu[0]
+        dTyM = gradu[1]
+        dTnorm = math.sqrt(dTxM*dTxM+dTyM*dTyM)
+        if dTnorm==0.0:
+            dTxM = 1.0
+            dTyM = 1.0
+            dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+            
+        if verb: 
+            print("-"*10)
+            print("**solving micro problem...")
+            print("[m] TM   =",TM)
+            print("[m] dTxM =",dTxM)
+            print("[m] dTyM =",dTyM)
+            
+        #if dTxM==0: dTxM=1e-5
+        #if dTyM==0: dTyM=1e-5
+      
+        self.p.reset(TM, dTxM, dTyM)
+        self.solver.start() 
+        
+        qMx = self.p.qM[0]
+        qMy = self.p.qM[1] 
+        
+        if verb:
+            print("[m] qMx =", qMx) 
+            print("[m] qMy =", qMy) 
+        
+        dTnorm = math.sqrt(dTxM*dTxM+dTyM*dTyM)
+        qnorm  = math.sqrt(qMx*qMx+qMy*qMy)
+        ampl   = qnorm / dTnorm
+        
+        ps = -(dTxM*qMx+dTyM*qMy)/dTnorm/qnorm
+        if ps>1.0: ps=1.0
+        if ps<-1.0: ps=-1.0
+        
+        #print ps
+        ang = math.acos(ps)
+        print("ang=", ang, "ampl=", ampl)
+        #print "qMx=", qMx, "ampl*dT=", dTxM*ampl, "res=", qMx-dTxM*ampl
+        cos = math.cos(ang)
+        sin = math.sin(ang)
+        K11 = cos*ampl
+        K21 = sin*ampl
+        K22 = K11
+        K12 = -K21
+          
+        k[0,0]=K11
+        k[1,1]=K22 
+        k[1,0]=K21
+        k[0,1]=K12             
+
+        if verb:
+            print(k)
+
+def main():
+
+    msh = gmsh.MeshLoader("heat_ms_macro.geo", __file__).execute()
+    pbl = h.Problem(msh)
+
+    solver = h.Solver(pbl)
+    solver.nthreads = 1
+    
+    myk = MicroModel()
+    h.Medium(pbl, "S1", myk)
+    
+    h.Dirichlet(pbl,"Left", 0.)
+    h.Dirichlet(pbl,"Right", 10.)
+
+    solver.restol = 1e-6
+    solver.start()
+
+    from heat.viewer import GUI
+    GUI().open('heat_ms_macro')
+    
+if __name__ == "__main__":
+    main()
diff --git a/heat/broken/honeycomb_jalil.geo b/heat/broken/honeycomb_jalil.geo
new file mode 100644
index 0000000000000000000000000000000000000000..325d850d5789184e4c9ad844e49b3fa223d911f6
--- /dev/null
+++ b/heat/broken/honeycomb_jalil.geo
@@ -0,0 +1,71 @@
+// Gmsh project created on Tue Mar 31 15:09:01 2015
+
+L=3; // Length of the cell
+l=2; // Width of the cell
+e=0.15; //width of the hexagonal path
+d=0.75; //Side of the hexagon
+density=0.1;
+
+
+Point(1) = {0, 0, 0, density};
+Point(2) = {0, L, 0, density};
+Point(3) = {l, L, 0, density};
+Point(4) = {l, 0, 0, density};
+Point(5) = {l/2-e/2, L, 0, density};
+Point(6) = {l/2+e/2, L, 0, density};
+Point(7) = {l/2+e/2, 0, 0, density};
+Point(8) = {l/2-e/2, 0, 0, density};
+Point(9) = {l/2-e/2, d/2, 0, density};
+Point(10) = {l/2+e/2, d/2, 0, density};
+Point(11) = {l/2+e/2, L-d/2, 0, density};
+Point(12) = {l/2-e/2, L-d/2, 0, density};
+Point(13) = {0, L/2-d/2, 0, density};
+Point(14) = {0, L/2+d/2, 0, density};
+Point(15) = {l, L/2+d/2, 0, density};
+Point(16) = {l, L/2-d/2, 0, density};
+Point(17) = {l/2, d/2+e/2, 0, density};
+Point(18) = {l/2, L-d/2-e/2, 0, density};
+Point(19) = {e/2, L/2-d/2+e/2, 0, density};
+Point(20) = {e/2, L/2+d/2-e/2, 0, density};
+Point(21) = {l-e/2, L/2+d/2-e/2, 0, density};
+Point(22) = {l-e/2, L/2-d/2+e/2, 0, density};
+Line(1) = {1, 8};
+Line(2) = {8, 7};
+Line(3) = {7, 4};
+Line(4) = {4, 16};
+Line(5) = {16, 15};
+Line(6) = {15, 3};
+Line(7) = {3, 6};
+Line(8) = {6, 5};
+Line(9) = {5, 2};
+Line(10) = {2, 14};
+Line(11) = {14, 13};
+Line(12) = {13, 1};
+Line(13) = {8, 9};
+Line(14) = {7, 10};
+Line(15) = {10, 16};
+Line(16) = {15, 11};
+Line(17) = {11, 6};
+Line(18) = {12, 5};
+Line(19) = {12, 14};
+Line(20) = {13, 9};
+Line(21) = {17, 22};
+Line(22) = {22, 21};
+Line(23) = {21, 18};
+Line(24) = {18, 20};
+Line(25) = {20, 19};
+Line(26) = {19, 17};
+Line Loop(27) = {2, 14, 15, 5, 16, 17, 8, -18, 19, 11, 20, -13};
+Line Loop(28) = {21, 22, 23, 24, 25, 26};
+Plane Surface(29) = {27, 28};
+Line Loop(30) = {1, 13, -20, 12};
+Plane Surface(31) = {30};
+Line Loop(32) = {3, 4, -15, -14};
+Plane Surface(33) = {32};
+Line Loop(34) = {6, 7, -17, -16};
+Plane Surface(35) = {34};
+Line Loop(36) = {9, 10, -19, 18};
+Plane Surface(37) = {36};
+Plane Surface(38) = {28};
+Physical Surface("Skeleton") = {29};
+Physical Surface("Air") = {38, 37, 35, 31, 33};
diff --git a/heat/broken/honeycomb_jalil.py b/heat/broken/honeycomb_jalil.py
new file mode 100644
index 0000000000000000000000000000000000000000..b6d1d7525098a299539db17dc42fba1be8413d90
--- /dev/null
+++ b/heat/broken/honeycomb_jalil.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# test periodic BCs
+
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+
+def main():
+    msh = gmsh.MeshLoader("honeycomb_jalil.geo", __file__).execute()
+    pbl = h.Problem(msh)
+
+    solver = h.Solver(pbl)
+    solver.nthreads = 6
+
+    fa=tbox.PwLf()
+    fa.add(0, 80)
+    fa.add(300, 80)
+    fa.add(350, 20)
+    fa.add(450, 10)
+    fa.add(550, 5)
+    fa.add(750, 1)
+    fa.add(1000, 1)
+
+    fs=tbox.PwLf()
+    fs.add(0, 140)
+    fs.add(300, 140)
+    fs.add(350, 180)
+    fs.add(450, 200)
+    fs.add(550, 210)
+    fs.add(750, 220)
+    fs.add(1000, 220)
+
+    fz = tbox.PwLf()
+    fz.add(0,0)
+
+    h.Medium(pbl, "Air", tbox.Fct2PwLf(fa,fa,fz), 1.)
+    h.Medium(pbl, "Skeleton", tbox.Fct2PwLf(fs,fs,fz), 1.)
+
+    TM   = 600.0
+    dTxM = 0.
+    dTyM = 200.
+    p = h.Periodic(pbl, TM, dTxM, dTyM)
+
+    solver.restol = 1e-6
+    solver.start()
+
+    print("mean flux=", p.qM)
+
+    from heat.viewer import GUI
+    GUI().open('honeycomb_jalil')
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/broken/jalil1.py b/heat/broken/jalil1.py
new file mode 100644
index 0000000000000000000000000000000000000000..4b546fdd8c21c914803557d24387c01399c74d29
--- /dev/null
+++ b/heat/broken/jalil1.py
@@ -0,0 +1,247 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# test multiscale
+
+# exc:   mpiexec.openmpi -n 12 ./jalil1.py
+
+
+
+
+
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+import math
+import mpi4py.MPI as mpi
+
+comm = mpi.COMM_WORLD
+rank = comm.rank
+siz  = comm.size
+
+"""
+if siz!=2:
+    print "error! siz=%d"% siz
+    import sys; sys.exit()
+"""
+
+class Job:
+    def __init__(self, TM, dTxM, dTyM):
+        # input
+        self.TM   = TM
+        self.dTxM = dTxM
+        self.dTyM = dTyM
+        # output
+        self.K11 = 0.0
+        self.K22 = 0.0
+        self.K12 = 0.0
+        self.K21 = 0.0
+        # killme
+        self.killme = False
+
+class MicroModel(tbox.Fct2UdU):
+    def __init__(self):
+        tbox.Fct2UdU.__init__(self)
+        print("[m] creation of the micro model")
+
+        self.msh = gmsh.MeshLoader("jalil1_micro.geo", __file__).execute()
+        self.pbl = h.Problem(self.msh)
+    
+        self.solver = h.Solver(self.pbl)
+        self.solver.nthreads = 1
+        self.solver.save = False
+        self.solver.verbose = 0
+        
+        h.Medium(self.pbl, "Matrix",    tbox.Fct2C(10.,10.,0), 1.0)
+        h.Medium(self.pbl, "Inclusion", tbox.Fct2C(140.,140.,0), 1.0)
+        self.p = h.Periodic(self.pbl, 0.0, 0.0, 0.0)    
+       
+        self.verb = False
+        
+        self.jobs = []
+        self.ijob = 0
+        
+    def execute(self, job):
+
+        TM   = job.TM
+        dTxM = job.dTxM
+        dTyM = job.dTyM 
+    
+        self.p.reset(TM, dTxM, dTyM)
+        self.solver.start() 
+        
+        # resulting flux qM
+        qMx = self.p.qM[0]
+        qMy = self.p.qM[1]     
+ 
+        if self.verb:
+            print("[m] qMx =", qMx) 
+            print("[m] qMy =", qMy) 
+        
+        # convert flux to an anisotropic conductivity "k(2,2)"
+        dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+        qnorm=math.sqrt(qMx*qMx+qMy*qMy)
+        ampl=qnorm/dTnorm
+        
+        ps=-(dTxM*qMx+dTyM*qMy)/dTnorm/qnorm
+        if ps>1.0: ps=1.0
+        if ps<-1.0: ps=-1.0
+        
+        #print ps
+        ang=math.acos(ps)
+        #print "ang=", ang, "ampl=", ampl
+        #print "qMx=", qMx, "ampl*dT=", dTxM*ampl, "res=", qMx-dTxM*ampl
+        cos=math.cos(ang)
+        sin=math.sin(ang)
+        job.K11 = cos*ampl
+        job.K21 = sin*ampl
+        job.K22 = job.K11   # => K22 inutile!
+        job.K12 = -job.K21  # => K12 inutile!
+       
+    def eval(self, elem, npg, u, gradu, k, fake):  # tjs exécuté par rank#0
+        if fake: # on cree un job
+            TM   = u
+            dTxM = gradu[0]
+            dTyM = gradu[1]        
+            dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+            if dTnorm==0.0:
+                dTxM = 1.0
+                dTyM = 1.0
+                dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+                
+            if self.verb: 
+                print("[m] TM   =",TM)
+                print("[m] dTxM =",dTxM)
+                print("[m] dTyM =",dTyM)
+                
+            if self.ijob==0:
+                job = Job(TM, dTxM, dTyM)
+                self.jobs.append(job)
+                #print "[%d] adding job #%d" % (rank,len(self.jobs))
+            else:
+                if self.ijob==len(self.jobs):
+                    self.ijob=0
+                job = self.jobs[self.ijob] 
+                job.TM=TM
+                job.dTxM=dTxM
+                job.dTyM=dTyM
+                self.ijob+=1
+                
+        else: # on retourne le resultat du job 
+            if self.ijob==len(self.jobs):
+                self.ijob=0
+            #print "[%d] retrieving results from job #%d/%d" % (rank, self.ijob, len(self.jobs))
+            job = self.jobs[self.ijob]
+            k[0,0]=job.K11
+            k[1,1]=job.K22 
+            k[1,0]=job.K21
+            k[0,1]=job.K12             
+            self.ijob+=1
+
+
+    def evalall(self):   # tjs exécuté par rank#0
+        #print "looping on %d jobs" % len(self.jobs)
+        
+        # version 1 proc (master travaille seul)
+        if siz==1:
+            for job in self.jobs:
+                self.execute(job) 
+            return
+        
+        # version 2 procs (1 slave - 1 master)
+        """
+        for job in self.jobs:
+            #self.execute(job) 
+            
+            print "[%d] sending job to 1.." % rank          
+            comm.send(job, dest = 1)
+            print "[%d] waiting job from 1.." % rank          
+            job2 = comm.recv(source = 1)
+            print "[%d] job received from 1!" % rank          
+            job.K11=job2.K11
+            job.K22=job2.K22
+            job.K12=job2.K12
+            job.K21=job2.K21
+        """
+        
+        # version N procs
+        i=0
+        njobs=len(self.jobs)
+        slaves=list(range(1,siz))
+        while True:
+            #send jobs to slaves
+            jlist=[]
+            for s in slaves:
+                if i==njobs: break
+                job = self.jobs[i]
+                jlist.append( (job,s) )
+                if self.verb: print("[%d] sending job #%d to %s.." % (rank,i,s))          
+                comm.send(job, dest = s)
+                i+=1
+                
+            if not jlist:
+                break
+                    
+            #receive jobs
+            for (job,s) in jlist:
+                if self.verb: print("[%d] waiting job from %d.." % (rank,s))          
+                job2 = comm.recv(source = s)
+                if self.verb: print("[%d] job received from %d!" % (rank,s))
+                job.K11=job2.K11
+                job.K22=job2.K22
+                job.K12=job2.K12
+                job.K21=job2.K21                
+           
+
+def main():
+   
+    myk = MicroModel() # chaque process a son objet "modèle micro" (distinct)
+        
+    if rank==0:
+        if myk.verb: print("[%d] démarrage du modèle macro" % rank)
+        msh = gmsh.MeshLoader("jalil1_corner.geo", __file__).execute()
+        pbl = h.Problem(msh)
+
+        solver = h.Solver(pbl)
+        solver.nthreads = 1
+
+        h.Medium(pbl, "Volume", myk)
+        
+        h.Dirichlet(pbl,"Top BC", 400.)
+        h.Dirichlet(pbl,"Right BC", 600.)
+
+        solver.restol = 1e-6
+        solver.start()
+
+        # kill slaves:
+        slaves=list(range(1,siz))
+        for s in slaves:
+            job=Job(0,0,0); job.killme=True
+            if myk.verb: print("[%d] sending suicide job to %d" % (rank,s))
+            comm.send(job, dest = s)
+
+        from heat.viewer import GUI
+        GUI().open('jalil1_corner')       
+        
+    else:
+        myk.verb=False
+        if myk.verb: print("[%d] démarrage d'un modèle micro" % rank)
+               
+        while True:
+            # attend un gradient et cree un job
+            if myk.verb: print("[%d] waiting job from 0.." % rank)
+            job = comm.recv(source = 0)  # recoit un job
+            
+            if job.killme:
+                if myk.verb: print("[%d] Aaargl!" % rank)
+                break
+                
+            if myk.verb: print("[%d] job received from 0!" % rank)
+            myk.execute(job)             # execute le job
+            if myk.verb: print("[%d] sending job to 0.." % rank)
+            comm.send(job, dest = 0)     # envoie le resultat
+            if myk.verb: print("[%d] job sent to 0.." % rank)
+
+if __name__ == "__main__":
+    main()
+    print("[%d] end." % rank)
diff --git a/heat/broken/jalil1_corner.geo b/heat/broken/jalil1_corner.geo
new file mode 100644
index 0000000000000000000000000000000000000000..3f7caf4ae590294fedc3e3fc3155da03620c7b22
--- /dev/null
+++ b/heat/broken/jalil1_corner.geo
@@ -0,0 +1,23 @@
+// Gmsh project created on Sun May 10 12:08:39 2015
+L=10; //Length of each branch
+w=2; // Width of the branch
+d=2; //Density of elements
+d=0.5; //Density of elements
+
+Point(1) = {0, 0, 0, d};
+Point(2) = {L, 0, 0, d};
+Point(3) = {L, w, 0, d};
+Point(4) = {0, L, 0, d};
+Point(5) = {w, L, 0, d};
+Point(6) = {w, w, 0, d};
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 6};
+Line(4) = {6, 5};
+Line(5) = {5, 4};
+Line(6) = {4, 1};
+Line Loop(7) = {6, 1, 2, 3, 4, 5};
+Plane Surface(8) = {7};
+Physical Line("Top BC") = {5};
+Physical Line("Right BC") = {2};
+Physical Surface("Volume") = {8};
diff --git a/heat/broken/jalil1_micro.geo b/heat/broken/jalil1_micro.geo
new file mode 100644
index 0000000000000000000000000000000000000000..73f9a94a731d26b6b4d154c084b098ad9ef9e502
--- /dev/null
+++ b/heat/broken/jalil1_micro.geo
@@ -0,0 +1,60 @@
+// RVE
+
+Lx = 0.01;
+Ly = Lx;
+
+lc = Lx/10;
+
+ix = 6*Lx/10;
+iy = 6*Lx/10;
+iR = 3*Lx/10;
+
+// -- outer boundary
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+// -- inclusion
+
+Point(11) = { ix-iR,  iy, 0, lc};
+Point(12) = { ix,     iy, 0, lc};
+Point(13) = { ix+iR,  iy, 0, lc};
+
+Circle(10) = {11, 12, 13};
+Circle(11) = {13, 12, 11};
+
+Line Loop(11) = {11, 10};
+
+Plane Surface(11) = {11};
+
+// -- matrix
+
+Plane Surface(1) = {1, 11};
+
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("Matrix") = {1};
+Physical Surface("Inclusion") = {11};
+
+
+
+
+
diff --git a/heat/broken/jalil1_micro.py b/heat/broken/jalil1_micro.py
new file mode 100644
index 0000000000000000000000000000000000000000..086a8eaf211e5f70078cf0116d3bff32598b8b5f
--- /dev/null
+++ b/heat/broken/jalil1_micro.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# simple RVE with 2 materials for testing periodic BCs
+
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+
+def main():
+
+    msh = gmsh.MeshLoader("jalil1_micro.geo", __file__).execute()
+
+    pbl = h.Problem(msh)
+
+    solver = h.Solver(pbl)
+    solver.nthreads = 4
+
+    h.Medium(pbl, "Matrix",    tbox.Fct2C(10.,10.,0), 1.0)
+    h.Medium(pbl, "Inclusion", tbox.Fct2C(140.,140.,0), 1.0)
+
+    TM   = 0.0
+    dTxM = 1.0
+    dTyM = 1.0
+    p = h.Periodic(pbl, TM, dTxM, dTyM)
+
+    solver.start()
+    print("flux=", p.qM)
+    
+    from heat.viewer import GUI
+    GUI().open('jalil1_micro')
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/broken/jalil2.py b/heat/broken/jalil2.py
new file mode 100644
index 0000000000000000000000000000000000000000..cecfa9747193ee3a5bc60c31f95b240ef0cae783
--- /dev/null
+++ b/heat/broken/jalil2.py
@@ -0,0 +1,270 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# test multiscale
+
+# mpiexec.openmpi --bycore --bind-to-core -n 6 ./run.py heat/tests/jalil2.py
+
+
+
+
+
+
+
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+import math
+
+try:
+    import mpi4py.MPI as mpi
+    comm = mpi.COMM_WORLD
+    rank = comm.rank
+    siz  = comm.size
+    name = mpi.Get_processor_name()
+    print("info: MPI found")
+except:
+    comm = None
+    rank = 0
+    siz  = 1
+    name = "noname"
+    print("info: MPI not found => MPI disabled")
+
+class Job:
+    """ Class containing data transmitted between MPI procs
+    """
+    def __init__(self, id, TM, dTxM, dTyM):
+        # input
+        self.id = id   # debug
+        self.TM   = TM
+        self.dTxM = dTxM
+        self.dTyM = dTyM
+        # output
+        self.K11 = 0.0
+        self.K22 = 0.0 # useless (=K11)
+        self.K12 = 0.0
+        self.K21 = 0.0 # useless (=-K12)
+        # killme
+        self.killme = False
+
+
+class MicroModel(tbox.Fct2UdU):
+    def __init__(self):
+        """
+        creation du micro modele
+        """
+        tbox.Fct2UdU.__init__(self)
+        print("[m] creation of the micro model")
+
+        self.msh = gmsh.MeshLoader("jalil2_honey.geo", __file__).execute()
+        self.pbl = h.Problem(self.msh)
+    
+        self.solver = h.Solver(self.pbl)
+        self.solver.nthreads = 1
+        self.solver.save = False
+        self.solver.verbose = 0
+        
+        self.fa=tbox.PwLf()
+        self.fa.add(0, 80)
+        self.fa.add(300, 80)
+        self.fa.add(350, 20)
+        self.fa.add(450, 10)
+        self.fa.add(550, 5)
+        self.fa.add(750, 1)
+        self.fa.add(1000, 1)
+        
+        self.fs=tbox.PwLf()
+        self.fs.add(0, 140)
+        self.fs.add(300, 140)
+        self.fs.add(350, 180)
+        self.fs.add(450, 200)
+        self.fs.add(550, 210)
+        self.fs.add(750, 220)
+        self.fs.add(1000, 220)
+        
+        self.fz = tbox.PwLf()
+        self.fz.add(0,0) 
+           
+        h.Medium(self.pbl, "Air", tbox.Fct2PwLf(self.fa,self.fa,self.fz), 1.)
+        h.Medium(self.pbl, "Skeleton", tbox.Fct2PwLf(self.fs,self.fs,self.fz), 1.)
+        
+        self.p = h.Periodic(self.pbl, 0.0, 0.0, 0.0)    
+       
+        self.verb = False
+        
+        self.jbz = {}      # liste des jobs
+        
+    def execute(self, job):
+
+        TM   = job.TM
+        dTxM = job.dTxM
+        dTyM = job.dTyM 
+    
+        self.p.reset(TM, dTxM, dTyM)
+        self.solver.start() 
+        
+        # resulting flux qM
+        qMx = self.p.qM[0]
+        qMy = self.p.qM[1]     
+ 
+        if self.verb:
+            print("[m] qMx =", qMx) 
+            print("[m] qMy =", qMy) 
+        
+        # convert flux to an anisotropic conductivity "k(2,2)"
+        dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+        qnorm=math.sqrt(qMx*qMx+qMy*qMy)
+        ampl=qnorm/dTnorm
+        
+        ps=-(dTxM*qMx+dTyM*qMy)/dTnorm/qnorm
+        if ps>1.0: ps=1.0
+        if ps<-1.0: ps=-1.0
+        
+        #print ps
+        ang=math.acos(ps)
+        #print "ang=", ang, "ampl=", ampl
+        #print "qMx=", qMx, "ampl*dT=", dTxM*ampl, "res=", qMx-dTxM*ampl
+        cos=math.cos(ang)
+        sin=math.sin(ang)
+        job.K11 = cos*ampl
+        job.K21 = sin*ampl
+        job.K22 = job.K11   # => K22 inutile!
+        job.K12 = -job.K21  # => K12 inutile!
+       
+    def eval(self, elem, npg, u, gradu, k, fake):  # tjs exécuté par rank#0
+        if fake: # on cree un job
+            TM   = u
+            dTxM = gradu[0]
+            dTyM = gradu[1]        
+            dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+            if dTnorm==0.0:
+                dTxM = 1.0
+                dTyM = 1.0
+                dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+                
+            if self.verb: 
+                print("[m] TM   =",TM)
+                print("[m] dTxM =",dTxM)
+                print("[m] dTyM =",dTyM)
+            
+            job = self.jbz.get((elem.no,npg))
+            if job: # job existe deja, on le modifie
+                job.TM=TM
+                job.dTxM=dTxM
+                job.dTyM=dTyM            
+            else: # on ajoute ce job
+                self.jbz[(elem.no,npg)] = Job((elem.no,npg), TM, dTxM, dTyM)
+                #print "[m] creating job", (elem.no,npg)
+                
+                
+        else: # on retourne le resultat du job 
+            
+            job = self.jbz.get((elem.no,npg))
+            if not job:
+                print("[m] job", (elem.no,npg), "not found!")
+            #else:
+            #    print "[m] job", (elem.no,npg), "OK!"
+            k[0,0]=job.K11
+            k[1,1]=job.K22 
+            k[1,0]=job.K21
+            k[0,1]=job.K12
+
+
+    def evalall(self):   # tjs exécuté par rank#0
+    
+        #print "looping on %d jobs" % len(self.jobs)
+        
+        # version 1 proc (master travaille seul)
+        if siz==1:
+            #for job in self.jbz.itervalues():
+            for id,job in self.jbz.items():
+                self.execute(job) 
+            return
+
+        # version N procs
+        it=self.jbz.__iter__()
+        njobs=len(self.jbz)
+        slaves=list(range(1,siz))
+        while True:
+            #send jobs to slaves
+            jlist=[]
+            for s in slaves:
+                try:
+                    jobk = next(it) # get next job
+                except:
+                    break
+                job = self.jbz[jobk]
+                jlist.append( (job,s) )
+                if self.verb: 
+                    print("[%d] sending job %s to %s.." % (rank,jobk,s))          
+                comm.send(job, dest = s)
+                
+            if not jlist: # plus de job?
+                break
+                    
+            #receive jobs
+            for (job,s) in jlist:
+                if self.verb: print("[%d] waiting job from %d.." % (rank,s))          
+                job2 = comm.recv(source = s)
+                if self.verb: print("[%d] job received from %d!" % (rank,s))
+                job.K11=job2.K11
+                job.K22=job2.K22
+                job.K12=job2.K12
+                job.K21=job2.K21                
+       
+
+def main():
+   
+    myk = MicroModel() # chaque process a son objet "modèle micro" (distinct)
+    
+    # faire en sorte que le rank0 charge le micro en 1er
+    
+    if rank==0:
+        if myk.verb: print("[%d] démarrage du modèle macro" % rank)
+        msh = gmsh.MeshLoader("jalil1_corner.geo", __file__).execute()
+        pbl = h.Problem(msh)
+
+        solver = h.Solver(pbl)
+        solver.nthreads = 1
+
+        h.Medium(pbl, "Volume", myk)
+        
+        h.Dirichlet(pbl,"Top BC", 400.)
+        h.Dirichlet(pbl,"Right BC", 600.)
+
+        solver.restol = 1e-6
+        solver.start()
+
+        # kill slaves:
+        slaves=list(range(1,siz))
+        for s in slaves:
+            job=Job((0,0),0,0,0); job.killme=True
+            if myk.verb: print("[%d] sending suicide job to %d" % (rank,s))
+            comm.send(job, dest = s)
+
+        from heat.viewer import GUI
+        GUI().open('jalil1_corner')        
+        
+    else:
+        myk.verb=False
+        if myk.verb: print("[%d] démarrage d'un modèle micro" % rank)
+               
+        while True:
+            # attend un gradient et cree un job
+            if myk.verb: print("[%d] waiting for job from 0.." % rank)
+            job = comm.recv(source = 0)  # recoit un job
+            
+            if job.killme:
+                if myk.verb: print("[%d] Aaargl!" % rank)
+                break
+                
+            if myk.verb: print("[%d] job received from 0!" % rank)
+            myk.execute(job)             # execute le job
+            if myk.verb: print("[%d] sending job results to 0.." % rank)
+            comm.send(job, dest = 0)     # envoie le resultat
+            if myk.verb: print("[%d] job results sent to 0.." % rank)
+
+if __name__ == "__main__":
+    main()
+    print("[%d] end." % rank)
+    
diff --git a/heat/broken/jalil2_honey.geo b/heat/broken/jalil2_honey.geo
new file mode 100644
index 0000000000000000000000000000000000000000..dd5e1d29e41961c6e6fc41ee40a8abcfa35a13e5
--- /dev/null
+++ b/heat/broken/jalil2_honey.geo
@@ -0,0 +1,71 @@
+// Gmsh project created on Tue Mar 31 15:09:01 2015
+
+L=0.003; // Length of the cell
+l=0.002; // Width of the cell
+e=0.00015; //width of the hexagonal path
+d=0.00075; //Side of the hexagon
+density=0.0002;
+
+
+Point(1) = {0, 0, 0, density};
+Point(2) = {0, L, 0, density};
+Point(3) = {l, L, 0, density};
+Point(4) = {l, 0, 0, density};
+Point(5) = {l/2-e/2, L, 0, density};
+Point(6) = {l/2+e/2, L, 0, density};
+Point(7) = {l/2+e/2, 0, 0, density};
+Point(8) = {l/2-e/2, 0, 0, density};
+Point(9) = {l/2-e/2, d/2, 0, density};
+Point(10) = {l/2+e/2, d/2, 0, density};
+Point(11) = {l/2+e/2, L-d/2, 0, density};
+Point(12) = {l/2-e/2, L-d/2, 0, density};
+Point(13) = {0, L/2-d/2, 0, density};
+Point(14) = {0, L/2+d/2, 0, density};
+Point(15) = {l, L/2+d/2, 0, density};
+Point(16) = {l, L/2-d/2, 0, density};
+Point(17) = {l/2, d/2+e/2, 0, density};
+Point(18) = {l/2, L-d/2-e/2, 0, density};
+Point(19) = {e/2, L/2-d/2+e/2, 0, density};
+Point(20) = {e/2, L/2+d/2-e/2, 0, density};
+Point(21) = {l-e/2, L/2+d/2-e/2, 0, density};
+Point(22) = {l-e/2, L/2-d/2+e/2, 0, density};
+Line(1) = {1, 8};
+Line(2) = {8, 7};
+Line(3) = {7, 4};
+Line(4) = {4, 16};
+Line(5) = {16, 15};
+Line(6) = {15, 3};
+Line(7) = {3, 6};
+Line(8) = {6, 5};
+Line(9) = {5, 2};
+Line(10) = {2, 14};
+Line(11) = {14, 13};
+Line(12) = {13, 1};
+Line(13) = {8, 9};
+Line(14) = {7, 10};
+Line(15) = {10, 16};
+Line(16) = {15, 11};
+Line(17) = {11, 6};
+Line(18) = {12, 5};
+Line(19) = {12, 14};
+Line(20) = {13, 9};
+Line(21) = {17, 22};
+Line(22) = {22, 21};
+Line(23) = {21, 18};
+Line(24) = {18, 20};
+Line(25) = {20, 19};
+Line(26) = {19, 17};
+Line Loop(27) = {2, 14, 15, 5, 16, 17, 8, -18, 19, 11, 20, -13};
+Line Loop(28) = {21, 22, 23, 24, 25, 26};
+Plane Surface(29) = {27, 28};
+Line Loop(30) = {1, 13, -20, 12};
+Plane Surface(31) = {30};
+Line Loop(32) = {3, 4, -15, -14};
+Plane Surface(33) = {32};
+Line Loop(34) = {6, 7, -17, -16};
+Plane Surface(35) = {34};
+Line Loop(36) = {9, 10, -19, 18};
+Plane Surface(37) = {36};
+Plane Surface(38) = {28};
+Physical Surface("Skeleton") = {29};
+Physical Surface("Air") = {38, 37, 35, 31, 33};
diff --git a/heat/broken/jalil2_honey.py b/heat/broken/jalil2_honey.py
new file mode 100644
index 0000000000000000000000000000000000000000..8f352db38a11ff388cd3f8fa105dd43052430f34
--- /dev/null
+++ b/heat/broken/jalil2_honey.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# simple RVE with 2 materials for testing periodic BCs
+
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+
+def main():
+
+    msh = gmsh.MeshLoader("jalil2_honey.geo", __file__).execute()
+
+    pbl = h.Problem(msh)
+
+    solver = h.Solver(pbl)
+    solver.nthreads = 4
+
+    fa = tbox.PwLf()
+    fa.add(0, 80)
+    fa.add(300, 80)
+    fa.add(350, 20)
+    fa.add(450, 10)
+    fa.add(550, 5)
+    fa.add(750, 1)
+    fa.add(1000, 1)
+
+    fs = tbox.PwLf()
+    fs.add(0, 140)
+    fs.add(300, 140)
+    fs.add(350, 180)
+    fs.add(450, 200)
+    fs.add(550, 210)
+    fs.add(750, 220)
+    fs.add(1000, 220)
+
+    fz = tbox.PwLf()
+    fz.add(0,0)
+
+    h.Medium(pbl, "Air", tbox.Fct2PwLf(fa,fa,fz), 1.)
+    h.Medium(pbl, "Skeleton", tbox.Fct2PwLf(fs,fs,fz), 1.)
+
+    TM   = 500.0
+    dTxM = 1.0
+    dTyM = 0.0
+    p= h.Periodic(pbl, TM, dTxM, dTyM)
+
+    solver.start()
+    print("flux=", p.qM)
+    from heat.viewer import GUI
+    GUI().open('jalil2_honey')
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/broken/jalil2_taskpull.py b/heat/broken/jalil2_taskpull.py
new file mode 100644
index 0000000000000000000000000000000000000000..8335695e0ce04573ce70120cf252616bd671ef6d
--- /dev/null
+++ b/heat/broken/jalil2_taskpull.py
@@ -0,0 +1,82 @@
+
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# test multiscale - version "task pull"
+# exc:
+# mpiexec.openmpi --bycore --bind-to-core -n 6 ./run.py heat/tests/jalil2_taskpull.py
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+import heat.fe2 as fe2
+
+class HoneyComb:
+    def __init__(self):
+        self.msh = gmsh.MeshLoader("jalil2_honey.geo", __file__).execute()
+        self.pbl = h.Problem(self.msh)
+    
+        self.solver = h.Solver(self.pbl)
+        self.solver.nthreads = 1
+        self.solver.save = False
+        self.solver.verbose = 0
+        
+        self.fa=tbox.PwLf()
+        self.fa.add(0, 80)
+        self.fa.add(300, 80)
+        self.fa.add(350, 20)
+        self.fa.add(450, 10)
+        self.fa.add(550, 5)
+        self.fa.add(750, 1)
+        self.fa.add(1000, 1)
+        
+        self.fs=tbox.PwLf()
+        self.fs.add(0, 140)
+        self.fs.add(300, 140)
+        self.fs.add(350, 180)
+        self.fs.add(450, 200)
+        self.fs.add(550, 210)
+        self.fs.add(750, 220)
+        self.fs.add(1000, 220)
+        
+        self.fz = tbox.PwLf()
+        self.fz.add(0,0) 
+           
+        h.Medium(self.pbl, "Air", tbox.Fct2PwLf(self.fa,self.fa,self.fz), 1.)
+        h.Medium(self.pbl, "Skeleton", tbox.Fct2PwLf(self.fs,self.fs,self.fz), 1.) 
+           
+        self.p = h.Periodic(self.pbl, 0.0, 0.0, 0.0) 
+
+
+class Lshape:
+    def __init__(self, law):
+        self.msh = gmsh.MeshLoader("jalil1_corner.geo", __file__).execute()
+        self.pbl = h.Problem(self.msh)
+
+        self.solver = h.Solver(self.pbl)
+        self.solver.nthreads = 1
+
+        h.Medium(self.pbl, "Volume", law)
+        
+        h.Dirichlet(self.pbl,"Top BC", 400.)
+        h.Dirichlet(self.pbl,"Right BC", 600.)
+
+        self.solver.restol = 1e-6
+
+
+
+if __name__ == "__main__":
+
+    micro = HoneyComb()
+
+    if fe2.rank==0:
+        law = fe2.FE2(micro)
+        macro = Lshape(law)
+        master = fe2.Master(macro)
+        master.start()
+    else:
+        worker = fe2.Worker(micro)
+        worker.start()
+
+    
+
+
diff --git a/heat/broken/rve.geo b/heat/broken/rve.geo
new file mode 100644
index 0000000000000000000000000000000000000000..2d6ba6b4037cfa1a4054d6688d59ce6f659cc358
--- /dev/null
+++ b/heat/broken/rve.geo
@@ -0,0 +1,60 @@
+// RVE
+
+Lx = 1.0;
+Ly = Lx;
+
+lc = Lx/20;
+
+ix = Lx/2;
+iy = Ly/2;
+iR = Lx/4;
+
+// -- outer boundary
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+// -- inclusion
+
+Point(11) = { ix-iR,  iy, 0, lc};
+Point(12) = { ix,     iy, 0, lc};
+Point(13) = { ix+iR,  iy, 0, lc};
+
+Circle(10) = {11, 12, 13};
+Circle(11) = {13, 12, 11};
+
+Line Loop(11) = {11, 10};
+
+Plane Surface(11) = {11};
+
+// -- matrix
+
+Plane Surface(1) = {1, 11};
+
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("Matrix") = {1};
+Physical Surface("Inclusion") = {11};
+
+
+
+
+
diff --git a/heat/broken/rve.py b/heat/broken/rve.py
new file mode 100644
index 0000000000000000000000000000000000000000..c474fddf05de7217d53be80d09d4ea8bb91b891a
--- /dev/null
+++ b/heat/broken/rve.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# simple RVE with 2 materials for testing periodic BCs
+
+import heat as h
+import tbox
+import tbox.gmsh as gmsh
+
+def main():
+
+    msh = gmsh.MeshLoader("rve.geo", __file__).execute()
+
+    pbl = h.Problem(msh)
+
+    solver = h.Solver(pbl)
+    solver.nthreads = 4
+
+    h.Medium(pbl, "Matrix",    tbox.Fct2C(10.,1.,0), 1.0)
+    h.Medium(pbl, "Inclusion", tbox.Fct2C(100.,100.,0), 1.0)
+
+    TM   = 55.0
+    dTxM = 30.0
+    dTyM = 1.0
+    h.Periodic(pbl, TM, dTxM, dTyM)
+
+    solver.start()
+
+    from heat.viewer import GUI
+    GUI().open(pbl.msh.name)
+    
+if __name__ == "__main__":
+    main()
diff --git a/heat/fe2.py b/heat/fe2.py
new file mode 100644
index 0000000000000000000000000000000000000000..268d97a0a0b651d815a2bcd8813993d620a25756
--- /dev/null
+++ b/heat/fe2.py
@@ -0,0 +1,305 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# FE² for "heat" - version "MPI task pull"
+
+import heat as h
+import tbox
+import math
+
+verb = False  # set to True for (a lot of) debug info
+
+try:
+    import mpi4py.MPI as mpi
+    comm = mpi.COMM_WORLD
+    rank = comm.rank
+    siz  = comm.size
+    name = mpi.Get_processor_name()
+    status = mpi.Status()
+    print("info: MPI found")
+except:
+    comm = None
+    rank = 0
+    siz  = 1
+    name = "noname"
+    print("info: MPI not found => MPI disabled")
+
+def barrier():
+    if comm:
+        comm.Barrier()
+
+def enum(*sequential, **named):
+    enums = dict(list(zip(sequential, list(range(len(sequential))))), **named)
+    return type('Enum', (), enums)
+
+tags = enum('READY', 'DONE', 'EXIT', 'START', 'WAKEUP', 'SUICIDE')
+
+
+
+class Job:
+    """ Class containing data transmitted between MPI procs
+    """
+    def __init__(self, id, TM, dTxM, dTyM):
+        # input
+        self.id = id
+        self.TM   = TM
+        self.dTxM = dTxM
+        self.dTyM = dTyM
+        # output
+        self.K11 = 0.0
+        self.K22 = 0.0 # useless (=K11)
+        self.K12 = 0.0
+        self.K21 = 0.0 # useless (=-K12)
+        
+    def execute(self, fem):
+        """
+        [executed by worker processes]
+        solve a given job and calculate "k"
+        """
+        TM   = self.TM
+        dTxM = self.dTxM
+        dTyM = self.dTyM 
+    
+        fem.p.reset(TM, dTxM, dTyM)
+        fem.solver.start(fem.gmshWriter) 
+        
+        # resulting flux qM
+        qMx = fem.p.qM[0]
+        qMy = fem.p.qM[1]     
+ 
+        if verb:
+            print("[%d] qMx = %f" % (rank,qMx)) 
+            print("[%d] qMy = %f" % (rank,qMy)) 
+        
+        # convert flux to an anisotropic conductivity "k(2,2)"
+        dTnorm = math.sqrt(dTxM*dTxM+dTyM*dTyM)
+        qnorm  = math.sqrt(qMx*qMx+qMy*qMy)
+        ampl   = qnorm / dTnorm
+        
+        if 1:
+            cos=-(dTxM*qMx+dTyM*qMy)/dTnorm/qnorm
+            sin=-(dTxM*qMy-dTyM*qMx)/dTnorm/qnorm
+        else:
+            ps=-(dTxM*qMx+dTyM*qMy)/dTnorm/qnorm
+            if ps>1.0: ps=1.0
+            if ps<-1.0: ps=-1.0
+            
+            #print ps
+            ang = math.acos(ps)
+            #print "ang=", ang, "ampl=", ampl
+            #print "qMx=", qMx, "ampl*dT=", dTxM*ampl, "res=", qMx-dTxM*ampl
+            cos = math.cos(ang)
+            sin = math.sin(ang)
+            
+        self.K11 = cos*ampl
+        self.K21 = sin*ampl
+        self.K22 = self.K11   # => K22 inutile!
+        self.K12 = -self.K21  # => K12 inutile!
+
+
+class FE2(tbox.Fct2UdU):
+    def __init__(self, femicro):
+        """
+        creation du micro modele
+        """
+        tbox.Fct2UdU.__init__(self)
+
+        self.fem = femicro     # micro model (utile uniqt si 1 thread)  
+        self.jbz = {}          # list of jobs
+        
+        if verb: print("[%d] creation of the micro model" % rank)
+
+    def eval(self, elem, npg, u, gradu, k, fake):  # tjs exécuté par rank#0
+        """
+        [executed by the master process]
+        compute "k" from "u" and "gradu" 
+        at element #elem and gauss point #npg
+        if "fake=True" => create a job to be run later in parallel
+        """
+        if fake: # on cree un job
+            TM   = u
+            dTxM = gradu[0]
+            dTyM = gradu[1]        
+            dTnorm = math.sqrt(dTxM*dTxM+dTyM*dTyM)
+            if dTnorm==0.0:
+                dTxM = 1.0
+                dTyM = 1.0
+                dTnorm=math.sqrt(dTxM*dTxM+dTyM*dTyM)
+                
+            if verb: 
+                print("[m] TM   =",TM)
+                print("[m] dTxM =",dTxM)
+                print("[m] dTyM =",dTyM)
+            
+            job = self.jbz.get((elem.no,npg))
+            if job: # job existe deja, on le modifie
+                job.TM   = TM
+                job.dTxM = dTxM
+                job.dTyM = dTyM            
+            else: # on ajoute ce job
+                self.jbz[(elem.no,npg)] = Job((elem.no,npg), TM, dTxM, dTyM)
+                #print "[m] creating job", (elem.no,npg)
+ 
+        else: # on retourne le resultat du job 
+            
+            job = self.jbz.get((elem.no,npg))
+            if not job:
+                print("[m] job", (elem.no,npg), "not found!")
+            k.resize(2, 2)
+            k[0,0] = job.K11
+            k[1,1] = job.K22 
+            k[1,0] = job.K21
+            k[0,1] = job.K12
+
+    def evalall(self):   # tjs exécuté par rank#0
+    
+        import sys
+        sys.stdout.flush()
+        
+        if verb: print("[0] looping on %d jobs" % len(self.jbz))
+        
+        # version 1 proc (master works alone)
+        if siz==1:
+            #for job in self.jbz.itervalues():
+            for id,job in self.jbz.items():
+                job.execute(self.fem) 
+            return
+
+        # version N procs
+        it=self.jbz.__iter__()
+        njobs=len(self.jbz)
+        slaves=list(range(1,siz))
+        
+        for s in slaves:
+            if verb: print("[0] sending wake-up signal to worker", s)
+            comm.send(None, dest=s, tag=tags.WAKEUP)
+        
+        num_workers = siz-1
+        closed_workers = 0
+        while closed_workers<num_workers:
+            # get a msg from any source
+            data = comm.recv(source=mpi.ANY_SOURCE, 
+                             tag=mpi.ANY_TAG, status=status)
+            source = status.Get_source()
+            tag = status.Get_tag()
+            if tag == tags.READY:
+                if verb: print("[0] worker %d is ready" % source)
+                # worker is ready - send a new task
+                job = None
+                try:
+                    jobk = next(it) # get next job
+                    job = self.jbz[jobk]
+                except:
+                    pass
+                if job:
+                    if verb: print("[0] sending job to %d" % source)
+                    comm.send(job, dest=source, tag=tags.START)
+                else:
+                    if verb: print("[0] job list is empty! sending EXIT to %d" % source)
+                    comm.send(None, dest=source, tag=tags.EXIT)
+                    # other workers are still calculating...
+                    # master should wait for them
+            elif tag==tags.DONE:
+                if verb: print("[0] worker %d gives me its results" % source)
+                # worker has done its job - get the results
+                job = self.jbz[data.id]
+                job.K11=data.K11
+                job.K22=data.K22
+                job.K12=data.K12
+                job.K21=data.K21
+            elif tag==tags.EXIT:
+                closed_workers+=1
+                if verb: print("[0] worker %d exited (%d worker(s) still running)" % (source, num_workers-closed_workers))
+                
+        if verb: print("[0] done.")
+        
+class Master:
+    """
+    MPI Process with rank #0
+    """
+    def __init__(self, macro):
+        self.macro = macro
+
+    def start(self):
+        """
+        master loop
+        """
+        global rank
+        if rank!=0: 
+            raise Exception("this routine should be called with MPI rank=0")
+        if verb: print("[%d] starting master" % rank)
+        self.macro.solver.start(self.macro.gmshWriter)
+
+        self.killslaves()
+        
+        # show results if requested
+        from fwk.wutils import parseargs
+        args = parseargs()
+        if not args.nogui:
+            print("\n<CLOSE gmsh to quit!>")    
+            from heat.viewer import GUI
+            GUI().open(self.macro.msh.name)
+        
+    def killslaves(self):
+        slaves=list(range(1,siz))
+        for s in slaves:
+            if verb: print("[%d] sending suicide job to %d" % (rank,s))
+            comm.send(None, dest=s, tag=tags.SUICIDE)
+
+
+class Worker:
+    """
+    MPI Process with rank #1-#n
+    """
+    def __init__(self, micro):
+        self.micro = micro
+        
+    def start(self):
+        """
+        worker loop
+        """
+        global rank
+        if rank==0: 
+            raise Exception("this routine should be called with MPI rank!=0")
+        
+        if verb: print("[%d] starting worker" % rank)
+        while True:
+            comm.recv(source=0, tag=mpi.ANY_TAG, status=status)
+            tag = status.Get_tag()
+            if tag==tags.WAKEUP:
+                if verb: print("[%d] waking up" % rank)
+                while True:
+                    comm.send(None, dest=0, tag=tags.READY)
+                    job = comm.recv(source=0, tag=mpi.ANY_TAG, status=status)
+                    tag = status.Get_tag()
+                    if tag==tags.START:
+                        if verb: print("[%d] starting job" % rank)
+                        job.execute(self.micro)
+                        if verb: print("[%d] sending job results" % rank)
+                        comm.send(job, dest=0, tag=tags.DONE)
+                    elif tag==tags.EXIT:
+                        if verb: print("[%d] sending exit confirmation" % rank)
+                        comm.send(None, dest=0, tag=tags.EXIT)
+                        break
+            elif tag==tags.SUICIDE:
+                if verb: print("[%d] I'm dying..." % rank)
+                if rank==2:
+                    print(self.micro.solver.tms)
+                break
+
+   
diff --git a/heat/matlab/rotK.m b/heat/matlab/rotK.m
new file mode 100644
index 0000000000000000000000000000000000000000..0f952d70a404e2e8ac5abeeee2cd55cbc1ebedae
--- /dev/null
+++ b/heat/matlab/rotK.m
@@ -0,0 +1,26 @@
+
+self_theta = 20;
+self_kx=1;
+self_ky=100;
+u=0;
+
+t = (self_theta) * pi/180.0
+u1 = 0. ; t1=-t;
+u2 = 10. ; t2 = t;
+
+t = t1+(t2-t1)/(u2-u1)*(u-u1);
+
+kx = self_kx;
+ky = self_ky;
+
+co = cos(t);
+si = sin(t);
+
+R = [[co, -si],
+              [si, co]];
+Kt = [[kx, 0.0],
+                [0.0, ky]];
+Tmp = R*Kt;
+Kxy = Tmp*R';
+
+Kxy
diff --git a/heat/models/__init__.py b/heat/models/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/heat/models/honeycomb.geo b/heat/models/honeycomb.geo
new file mode 100644
index 0000000000000000000000000000000000000000..ba4ec75fa4dca456ad353b1cad32aba6431d83f7
--- /dev/null
+++ b/heat/models/honeycomb.geo
@@ -0,0 +1,93 @@
+// honeycomb structure
+
+DefineConstant[ l = { 10.0, Min 1, Max 20, Step 1, Name "Lengths/hex edge length" }  ];
+DefineConstant[ k = {  1.0, Min 1, Max  2, Step 1, Name "Lengths/bound. thickness" }  ];
+DefineConstant[ lc = {  1./3, Min 1e-5, Max  1, Step 1e-5, Name "Mesh/density" }  ];
+
+
+alp=30*Pi/180;
+
+Point(1) = {0, 0, 0, lc};
+Point(2) = {l*Cos(alp), l*Sin(alp), 0, lc};
+Point(3) = {l*Cos(alp), l*Sin(alp)+l, 0, lc};
+Point(4) = {0, 2*l*Sin(alp)+l, 0, lc};
+Point(5) = {-l*Cos(alp), l*Sin(alp), 0, lc};
+Point(6) = {-l*Cos(alp), l*Sin(alp)+l, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 6};
+Line(5) = {6, 5};
+Line(6) = {5, 1};
+
+Point(7) = {-k*Sin(alp), -k*Cos(alp), 0, lc};
+Point(8) = {+k*Sin(alp), -k*Cos(alp), 0, lc};
+Point(9) = {-k*Sin(alp)-l*Cos(alp), -k*Cos(alp)+l*Sin(alp), 0, lc};
+Point(10) = {+k*Sin(alp)+l*Cos(alp), -k*Cos(alp)+l*Sin(alp), 0, lc};
+Point(11) = {-k*Sin(alp), -k*Cos(alp)-l/2, 0, lc};
+Point(12) = {+k*Sin(alp), -k*Cos(alp)-l/2, 0, lc};
+Point(13) = {-k*Sin(alp)-l*Cos(alp), -k*Cos(alp)-l/2, 0, lc};
+Point(14) = {+k*Sin(alp)+l*Cos(alp), -k*Cos(alp)-l/2, 0, lc};
+
+
+Point(15) = {-k*Sin(alp), 2*l*Sin(alp)+l+k*Cos(alp), 0, lc};
+Point(16) = {+k*Sin(alp), 2*l*Sin(alp)+l+k*Cos(alp), 0, lc};
+Point(17) = {-k*Sin(alp)-l*Cos(alp), 2*l*Sin(alp)+l+k*Cos(alp)-l*Sin(alp), 0, lc};
+Point(18) = {+k*Sin(alp)+l*Cos(alp), 2*l*Sin(alp)+l+k*Cos(alp)-l*Sin(alp), 0, lc};
+Point(19) = {-k*Sin(alp), 2*l*Sin(alp)+l+k*Cos(alp)+l/2, 0, lc};
+Point(20) = {+k*Sin(alp), 2*l*Sin(alp)+l+k*Cos(alp)+l/2, 0, lc};
+Point(21) = {-k*Sin(alp)-l*Cos(alp), 2*l*Sin(alp)+l+k*Cos(alp)+l/2, 0, lc};
+Point(22) = {+k*Sin(alp)+l*Cos(alp), 2*l*Sin(alp)+l+k*Cos(alp)+l/2, 0, lc};
+
+
+Line(7) = {13, 11};
+Line(8) = {11, 12};
+Line(9) = {12, 14};
+Line(10) = {14, 10};
+Line(11) = {10, 18};
+Line(12) = {18, 22};
+Line(13) = {22, 20};
+Line(14) = {20, 19};
+Line(15) = {19, 21};
+Line(16) = {21, 17};
+Line(17) = {17, 9};
+Line(18) = {9, 13};
+Line(19) = {11, 7};
+Line(20) = {7, 9};
+Line(21) = {8, 12};
+Line(22) = {8, 10};
+Line(23) = {18, 16};
+Line(24) = {16, 20};
+Line(25) = {19, 15};
+Line(26) = {15, 17};
+
+
+Line Loop(27) = {4, 5, 6, 1, 2, 3};
+Plane Surface(28) = {27};
+Line Loop(29) = {20, 18, 7, 19};
+Plane Surface(30) = {29};
+Line Loop(31) = {-22, +10, +9, +21};
+Plane Surface(32) = {31};
+Line Loop(33) = {-23, -24, +13, +12};
+Plane Surface(34) = {33};
+Line Loop(35) = {-26, +16, +15, -25};
+Plane Surface(36) = {35};
+
+Line Loop(37) = {-26, -17, +20, +19, -8, +21, -22, -11, -23, -24, -14, -25};
+Plane Surface(38) = {27, 37};
+
+Physical Line("Left") = {16, 17, 18};
+Physical Line("Right") = {10, 11, 12};
+Physical Line("Bottom") = {7, 8, 9};
+Physical Line("Top") = {15, 14, 13};
+
+Physical Surface("Hexagon") = {28, 32, 30, 36, 34};
+Physical Surface("Borders") = {38};
+
+
+
+Physical Point("P1") = {13};
+
+
+
diff --git a/heat/models/rect.geo b/heat/models/rect.geo
new file mode 100644
index 0000000000000000000000000000000000000000..03c11edf69f4ff591e744da8aecb9e2c6b93f8cf
--- /dev/null
+++ b/heat/models/rect.geo
@@ -0,0 +1,33 @@
+// rectangle (unstructured triangles)
+
+DefineConstant[ Lx = {  10, Min 1, Max 20, Step 1, Name "Lengths/Lx" }  ];
+DefineConstant[ Ly = {  10, Min 1, Max 20, Step 1, Name "Lengths/Ly" }  ];
+
+DefineConstant[ lc = { 1.2, Min 0.1, Max 20, Step 1, Name "Mesh/lc" }  ];
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+Plane Surface(1) = {1};
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("S1") = {1};
+
diff --git a/heat/models/rect.py b/heat/models/rect.py
new file mode 100644
index 0000000000000000000000000000000000000000..a723332782c18bc2d64cbccf1e98960a02130cde
--- /dev/null
+++ b/heat/models/rect.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# simple test on a square using 'heat'
+
+import heat as h
+import heat.utils
+import tbox
+import tbox.gmsh as gmsh
+
+def main(**d):
+    
+    # default params
+    p={}
+    p['Lx'] = 10.
+    p['Ly'] = 10.
+    p['Nx'] = 10    # structured mesh params
+    p['Ny'] = 10
+    p['lc'] = 0.5   # unstructured mesh params
+    p['stru'] = False 
+    p['src'] = False 
+    p['bc'] = 'dirichletx'
+    p.update(d)    
+
+    # configure/build mesh
+    if p['stru']:
+        pars={ 'Lx' : p['Lx'] , 'Ly' : p['Ly'], 'Nx' : p['Nx'], 'Ny' : p['Ny']}
+        msh = gmsh.MeshLoader("rect_stru.geo",__file__).execute(**pars)    
+    else:
+        pars={ 'Lx' : p['Lx'] , 'Ly' : p['Ly'], 'lc' : p['lc']}
+        msh = gmsh.MeshLoader("rect.geo",__file__).execute(**pars)
+    # define mesh writer
+    gmshWriter = tbox.GmshExport(msh)
+
+    pbl = h.Problem(msh)
+
+    # medium/boundary conditions
+    pbl.add(h.Medium(msh, "S1", tbox.Fct2C(1e-5,1e-5, 0)))
+    
+    if p['bc']=='dirichletx':
+        pbl.add(h.Dirichlet(msh,"Left",  3.))
+        pbl.add(h.Dirichlet(msh,"Right", 5.))
+    elif p['bc']=='dirichlety':
+        pbl.add(h.Dirichlet(msh,"Bottom", 3.))
+        pbl.add(h.Dirichlet(msh,"Top",    5.))
+
+    if p['src']:    
+        pbl.add(h.Source(msh, "S1", tbox.Fct0C(1e-6)))
+
+    # solve problem
+    solver = heat.utils.solve(pbl, gmshWriter)  
+    return solver
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/models/rect_stru.geo b/heat/models/rect_stru.geo
new file mode 100644
index 0000000000000000000000000000000000000000..ba5dd5b3dcfaaf4e1a31518f9606eaaa3dfd0d0f
--- /dev/null
+++ b/heat/models/rect_stru.geo
@@ -0,0 +1,44 @@
+// rectangle (unstructured triangles)
+
+DefineConstant[ Lx = { 10, Min 1, Max 20, Step 1, Name "Lengths/Lx" }  ];
+DefineConstant[ Ly = { 10, Min 1, Max 20, Step 1, Name "Lengths/Ly" }  ];
+
+DefineConstant[ Nx = { 10, Min 1, Max 20, Step 1, Name "Mesh/Nx" }  ];
+DefineConstant[ Ny = { 10, Min 1, Max 20, Step 1, Name "Mesh/Ny" }  ];
+
+lc=Lx/Nx;
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+Plane Surface(1) = {1};
+
+
+// regular mesh
+Transfinite Line {1, 3} = Nx+1 Using Progression 1;
+Transfinite Line {4, 2} = Ny+1 Using Progression 1;
+Transfinite Surface {1};
+//Recombine Surface {1}; // for quads
+
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("S1") = {1};
+
diff --git a/heat/src/CMakeLists.txt b/heat/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..84c672b35a141ca36cd2d29e05580abf75555b66
--- /dev/null
+++ b/heat/src/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# CMake input file of heat.so
+
+FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
+
+ADD_LIBRARY(heat SHARED ${SRCS})
+MACRO_DebugPostfix(heat)
+TARGET_INCLUDE_DIRECTORIES(heat PUBLIC ${PROJECT_SOURCE_DIR}/heat/src)
+
+TARGET_LINK_LIBRARIES(heat tbox)
+
+INSTALL(TARGETS heat DESTINATION ${CMAKE_INSTALL_PREFIX})
+
+SOURCE_GROUP(base REGULAR_EXPRESSION ".*\\.(cpp|inl|hpp|h)")
diff --git a/heat/src/heat.h b/heat/src/heat.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef7f46174dd741ebcef3f38c191f3b1c296276b3
--- /dev/null
+++ b/heat/src/heat.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// global header of the "heat" module
+
+#ifndef HEAT_H
+#define HEAT_H
+
+#if defined(WIN32)
+#ifdef heat_EXPORTS
+#define HEAT_API __declspec(dllexport)
+#else
+#define HEAT_API __declspec(dllimport)
+#endif
+#else
+#define HEAT_API
+#endif
+
+#include "tbox.h"
+
+/**
+ * @brief this namespace avoids conflicts with similar names in 'waves'
+ */
+
+namespace heat
+{
+class Problem;
+class Medium;
+class Dirichlet;
+class Solver;
+class Periodic;
+class Boundary;
+class Source;
+class Extractor;
+
+class NodePair;
+
+class HeatTerm;
+
+// not used yet
+class DisplayHook;
+}; // namespace heat
+
+#endif //HEAT_H
diff --git a/heat/src/wBoundary.cpp b/heat/src/wBoundary.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2ec222185212a1372e162b568bba4ef6a42f79cf
--- /dev/null
+++ b/heat/src/wBoundary.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wBoundary.h"
+#include "wProblem.h"
+#include "wTag.h"
+using namespace heat;
+
+Boundary::Boundary(std::shared_ptr<MshData> _msh, int no, std::shared_ptr<Fct0> _f) : Group(_msh, no), f(_f)
+{
+    //pbl.bnds.push_back(this);
+}
+
+Boundary::Boundary(std::shared_ptr<MshData> _msh, std::string const &name, std::shared_ptr<Fct0> _f) : Group(_msh, name), f(_f)
+{
+    //pbl.bnds.push_back(this);
+}
+
+void Boundary::write(std::ostream &out) const
+{
+    out << "Boundary on " << *tag;
+}
diff --git a/heat/src/wBoundary.h b/heat/src/wBoundary.h
new file mode 100644
index 0000000000000000000000000000000000000000..3c0b8679c64b0b31886691eb04f67853776a356e
--- /dev/null
+++ b/heat/src/wBoundary.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WBOUNDARY_H
+#define WBOUNDARY_H
+
+#include "heat.h"
+#include "wGroup.h"
+#include "wFct0.h"
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief boundaries which requires a special treatment (such as prescribed fluxes)
+ */
+
+class HEAT_API Boundary : public Group
+{
+public:
+#ifndef SWIG
+    std::shared_ptr<Fct0> f;
+#endif
+    Boundary(std::shared_ptr<MshData> _msh, int no, std::shared_ptr<Fct0> _f);
+    Boundary(std::shared_ptr<MshData> _msh, std::string const &name, std::shared_ptr<Fct0> _f);
+    virtual ~Boundary() { std::cout << "~Boundary()\n"; }
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace heat
+
+#endif //WBOUNDARY_H
diff --git a/heat/src/wCompiledFct.cpp b/heat/src/wCompiledFct.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..91310881ce343b218f4e1832709a7586d23be8a4
--- /dev/null
+++ b/heat/src/wCompiledFct.cpp
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wCompiledFct.h"
+using namespace heat;
diff --git a/heat/src/wCompiledFct.h b/heat/src/wCompiledFct.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8d139263c577d36ad5479a9b8bd27ea92e52395
--- /dev/null
+++ b/heat/src/wCompiledFct.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WCOMPILEDFCT_H
+#define WCOMPILEDFCT_H
+
+#include "heat.h"
+#include "wFct0.h"
+#include "wFct1.h"
+#include "wFct2.h"
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief cfr heat_vark.py (version scalaire)
+ */
+
+class HEAT_API CompiledFct1a : public Fct0XYZ
+{
+    double k1, k2;
+
+public:
+    CompiledFct1a(double _k1, double _k2) : k1(_k1), k2(_k2) {}
+
+    virtual double eval(Eigen::Vector3d const &pos) const override
+    {
+        double x = pos(0);
+        double y = pos(1);
+        double L = 1;
+        return (k1 + k2) / 2 + fabs(k2 - k1) / 2 * sin(2 * M_PI / L * 4 * (x + y / 2));
+    }
+};
+
+/**
+ * @brief cfr heat_vark.py (version matricielle)
+ */
+
+class HEAT_API CompiledFct1b : public Fct2XYZ
+{
+    double k1, k2;
+
+public:
+    CompiledFct1b(double _k1, double _k2) : k1(_k1), k2(_k2) {}
+
+    virtual void eval(Eigen::Vector3d const &pos, Eigen::MatrixXd &out, bool fake) const override
+    {
+        double x = pos(0);
+        double y = pos(1);
+        double L = 1;
+        out.resize(2, 2);
+        out(1, 1) = out(0, 0) = (k1 + k2) / 2 + fabs(k2 - k1) / 2 * sin(2 * M_PI / L * 4 * (x + y / 2));
+        out(0, 1) = out(1, 0) = 0.0;
+    }
+};
+
+/**
+ * @brief cfr heat_nl.py (version scalaire)
+ */
+class HEAT_API CompiledFct2a : public Fct0U
+{
+public:
+    CompiledFct2a() {}
+
+    virtual double eval(double u) const override
+    {
+        return 10 + u * u;
+    }
+};
+
+/**
+ * @brief cfr heat_nl.py (version matricielle)
+ */
+class HEAT_API CompiledFct2b : public Fct2U
+{
+public:
+    CompiledFct2b() {}
+
+    virtual void eval(double u, Eigen::MatrixXd &out, bool fake) const override
+    {
+        out.resize(2, 2);
+        out(0, 0) = out(1, 1) = 10 + u * u;
+        out(0, 1) = out(1, 0) = u * u;
+    }
+};
+
+}; // namespace heat
+
+#endif //WCOMPILEDFCT_H
diff --git a/heat/src/wDirichlet.cpp b/heat/src/wDirichlet.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..932ee6f14b4112314256087f50c69c65353c21fe
--- /dev/null
+++ b/heat/src/wDirichlet.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wDirichlet.h"
+#include "wProblem.h"
+#include "wTag.h"
+#include "wElement.h"
+#include "wNode.h"
+#include <algorithm>
+using namespace heat;
+
+Dirichlet::Dirichlet(std::shared_ptr<MshData> _msh, int no, double _val) : Group(_msh, no), val(_val)
+{
+    for (auto e : tag->elems)
+        for (auto n : e->nodes)
+            nodes.push_back(n);
+    std::sort(nodes.begin(), nodes.end());
+    auto it = std::unique(nodes.begin(), nodes.end());
+    nodes.resize(std::distance(nodes.begin(), it));
+
+    //pbl.dBCs.push_back(this);
+}
+
+Dirichlet::Dirichlet(std::shared_ptr<MshData> _msh, std::string const &name, double _val) : Group(_msh, name), val(_val)
+{
+    for (auto e : tag->elems)
+        for (auto n : e->nodes)
+            nodes.push_back(n);
+    std::sort(nodes.begin(), nodes.end());
+    auto it = std::unique(nodes.begin(), nodes.end());
+    nodes.resize(std::distance(nodes.begin(), it));
+
+    //pbl.dBCs.push_back(this);
+}
+
+/**
+ *  @brief default implementation (prescribes "val" to all nodes)
+ */
+
+void Dirichlet::apply(std::vector<double> &rhs)
+{
+    for (auto n : nodes)
+        rhs[n->row] = val;
+}
+
+void Dirichlet::write(std::ostream &out) const
+{
+    out << "heat::Dirichlet on " << *tag << " (val=" << val << ")\n";
+    for (auto n : nodes)
+    {
+        out << '\t' << *n << '\n';
+    }
+}
diff --git a/heat/src/wDirichlet.h b/heat/src/wDirichlet.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ebf97ba5cfcc6f7faaf9e909edc2a8d9284b46c
--- /dev/null
+++ b/heat/src/wDirichlet.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WDIRICHLET_H
+#define WDIRICHLET_H
+
+#include "heat.h"
+#include "wGroup.h"
+#include <vector>
+#include <string>
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief manage Dirichlet BC
+ *
+ * @todo gerer Dirichlet comme Boundary (avec une Fct en argument au lieu d'un scalaire)
+ */
+
+class HEAT_API Dirichlet : public Group
+{
+public:
+    std::vector<Node *> nodes;
+    double val; ///< value for a constant BC
+
+    Dirichlet(std::shared_ptr<MshData> _msh, int no, double _val = 0.0);
+    Dirichlet(std::shared_ptr<MshData> _msh, std::string const &name, double _val = 0.0);
+    virtual ~Dirichlet() { std::cout << "~Dirichlet()\n"; }
+
+    virtual void apply(std::vector<double> &rhs);
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace heat
+
+#endif //WDIRICHLET_H
diff --git a/heat/src/wDisplayHook.cpp b/heat/src/wDisplayHook.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..33264943267f2545be02cc234a9f7c457de66bba
--- /dev/null
+++ b/heat/src/wDisplayHook.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wDisplayHook.h"
+using namespace heat;
+
+DisplayHook::DisplayHook()
+{
+}
+
+void DisplayHook::display(int nt, double t, std::vector<double> &u)
+{
+    std::cout << "DisplayHook::display()\n";
+}
+
+void DisplayHook::refresh()
+{
+    std::cout << "DisplayHook::refresh()\n";
+}
diff --git a/heat/src/wDisplayHook.h b/heat/src/wDisplayHook.h
new file mode 100644
index 0000000000000000000000000000000000000000..58dcbaf4746fbebd88fd29c682769d46a8552dc1
--- /dev/null
+++ b/heat/src/wDisplayHook.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WDISPLAYHOOK_H
+#define WDISPLAYHOOK_H
+
+#include "heat.h"
+#include "wObject.h"
+#include <vector>
+
+namespace heat
+{
+
+/**
+ * @brief quad element
+ */
+
+class HEAT_API DisplayHook : public fwk::wObject
+{
+public:
+    DisplayHook();
+    virtual void display(int nt, double t, std::vector<double> &u);
+    virtual void refresh();
+};
+
+} // namespace heat
+
+#endif //WDISPLAYHOOK_H
diff --git a/heat/src/wExtractor.cpp b/heat/src/wExtractor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f62392d771d333cc09d3d7d0f8c7b0fdb7a0d176
--- /dev/null
+++ b/heat/src/wExtractor.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wExtractor.h"
+#include "wGroup.h"
+#include "wSolver.h"
+#include "wTag.h"
+#include "wNode.h"
+
+using namespace heat;
+
+void Extractor::write(std::ostream &out) const
+{
+    out << "Extractor on " << grp;
+}
+
+Extractor::Extractor(Solver &_solver, Group &_grp) : solver(_solver), grp(_grp)
+{
+    // create a node list
+    for (auto e : grp.tag->elems) /// cfr Dirichlet
+        for (auto n : e->nodes)
+            nodes.push_back(n);
+    std::sort(nodes.begin(), nodes.end());
+    auto it = std::unique(nodes.begin(), nodes.end());
+    nodes.resize(std::distance(nodes.begin(), it));
+}
+
+std::vector<double>
+Extractor::execute()
+{
+    std::vector<double> &vec = solver.T1; // vector of temperatures
+
+    std::vector<double> ret;
+    for (auto n : nodes)
+        ret.push_back(vec[n->row]);
+
+    return ret;
+}
diff --git a/heat/src/wExtractor.h b/heat/src/wExtractor.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb79c3773103b6309e657eb882f215464ed93332
--- /dev/null
+++ b/heat/src/wExtractor.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WEXTRACTOR_H
+#define WEXTRACTOR_H
+
+#include "heat.h"
+#include "wExtract.h"
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief an object able to extract scalar results from the model
+ */
+
+class HEAT_API Extractor : public fwk::Extract
+{
+    Solver &solver;
+    Group &grp;
+
+public:
+    Extractor(Solver &_solver, Group &_grp);
+    virtual ~Extractor() { std::cout << "~Extractor()\n"; }
+    virtual std::vector<double> execute() override;
+    std::vector<Node *> nodes; ///< faire une classe intermediaire group/dirichlet (nodegroup)
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace heat
+
+#endif //WEXTRACTOR_H
diff --git a/heat/src/wHeatTerm.cpp b/heat/src/wHeatTerm.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8cecc32c4f940e62f90703d89be3a26419e0299c
--- /dev/null
+++ b/heat/src/wHeatTerm.cpp
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wHeatTerm.h"
+
+#include "wElement.h"
+#include "wCache.h"
+#include "wGauss.h"
+#include "wFct0.h"
+#include "wFct2.h"
+
+using namespace heat;
+using namespace tbox;
+
+/**
+ * @brief Build volume terms for the heat equation on one element
+ */
+Eigen::MatrixXd HeatTerm::build(Element const &e, std::vector<double> const &u, Fct2 const &f, bool fake)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    Eigen::MatrixXd K = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size());
+    if (fake) // fake run - fill MPI job list
+    {
+        for (size_t k = 0; k < gauss.getN(); ++k)
+        {
+            Eigen::MatrixXd fk;
+            f.eval(e, u, k, fk, fake);
+        }
+    }
+    else // true run - use MPI cached results
+    {
+        // Gauss integration
+        for (size_t k = 0; k < gauss.getN(); ++k)
+        {
+            // Jacobian inverse, shape functions and function evaluation
+            Eigen::MatrixXd const &J = e.getJinv(k);
+            Eigen::MatrixXd const &dff = cache.getDsf(k);
+            Eigen::MatrixXd fk;
+            f.eval(e, u, k, fk, fake);
+
+            // Elementary stiffness matrix
+            K += (fk * J * dff).transpose() * J * dff * gauss.getW(k) * e.getDetJ(k);
+        }
+    }
+    return K;
+}
+
+/**
+ * @brief Build surface/volume flux on one element
+ */
+Eigen::VectorXd HeatTerm::build(Element const &e, std::vector<double> const &u, Fct0 const &f)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    // Gauss integration
+    Eigen::VectorXd s = Eigen::VectorXd::Zero(e.nodes.size());
+    for (size_t k = 0; k < gauss.getN(); ++k)
+        s += cache.getSf(k) * f.eval(e, u, k) * gauss.getW(k) * e.getDetJ(k);
+    return s;
+}
+
+/**
+ * @brief Build volume flux of the heat equation on one element
+ * @todo not used
+ */
+Eigen::VectorXd HeatTerm::build2(Element const &e, std::vector<double> const &u, Fct2 const &f)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    // Gauss integration
+    Eigen::VectorXd qV = Eigen::VectorXd::Zero(e.nodes.size());
+    for (size_t k = 0; k < gauss.getN(); ++k)
+    {
+        // Shape functions, gradient and flux evaluation
+        Eigen::MatrixXd const &dff = cache.getDsf(k);
+        Eigen::MatrixXd fk(2, 2);
+        f.eval(e, u, k, fk, false);
+
+        // Elementary flux vector
+        qV += (fk * e.computeGradient(u, k)).transpose() * e.getJinv(k) * dff * gauss.getW(k) * e.getDetJ(k);
+    }
+    return qV;
+}
+
+/**
+ * @brief Compute (integrate) volume flux
+ */
+Eigen::VectorXd HeatTerm::computeFlux(Element const &e, std::vector<double> const &u, Fct2 const &f)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    // Gauss integration
+    Eigen::VectorXd qV = Eigen::Vector2d::Zero(); // 2 dimensions
+    for (size_t k = 0; k < gauss.getN(); ++k)
+    {
+        // Gradient and matrix function evaluation
+        Eigen::VectorXd gradk = e.computeGradient(u, k);
+        Eigen::MatrixXd fk(2, 2);
+        f.eval(e, u, k, fk, false);
+
+        qV -= fk * gradk * gauss.getW(k) * e.getDetJ(k);
+    }
+    return qV;
+}
+
+/**
+ * @brief Compute (integrate) matrix
+ */
+Eigen::MatrixXd HeatTerm::computeMatrix(Element const &e, std::vector<double> const &u, Fct2 const &f)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    // Gauss integration
+    Eigen::MatrixXd out = Eigen::Matrix2d::Zero(); // 2 dimensions, should match fk size
+    for (size_t k = 0; k < gauss.getN(); ++k)
+    {
+        // Function evaluation
+        Eigen::MatrixXd fk;
+        f.eval(e, u, k, fk, false);
+
+        out += fk * gauss.getW(k) * e.getDetJ(k);
+    }
+    return out;
+}
diff --git a/heat/src/wHeatTerm.h b/heat/src/wHeatTerm.h
new file mode 100644
index 0000000000000000000000000000000000000000..12f9bc514a172d93de5e8f4a357b69681b155ec5
--- /dev/null
+++ b/heat/src/wHeatTerm.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WHEATTERM_H
+#define WHEATTERM_H
+
+#include "heat.h"
+
+#include <vector>
+#include <Eigen/Dense>
+
+namespace heat
+{
+
+/**
+ * @brief Formulation of heat terms
+ */
+class HEAT_API HeatTerm
+{
+public:
+    // Volume
+    static Eigen::MatrixXd build(tbox::Element const &e, std::vector<double> const &u, tbox::Fct2 const &f, bool fake);
+    static Eigen::VectorXd build2(tbox::Element const &e, std::vector<double> const &u, tbox::Fct2 const &f);
+    // Boundary and Source
+    static Eigen::VectorXd build(tbox::Element const &e, std::vector<double> const &u, tbox::Fct0 const &f);
+    // Functionals
+    static Eigen::VectorXd computeFlux(tbox::Element const &e, std::vector<double> const &u, tbox::Fct2 const &f);
+    static Eigen::MatrixXd computeMatrix(tbox::Element const &e, std::vector<double> const &u, tbox::Fct2 const &f);
+};
+
+} // namespace heat
+#endif //WHEATTERM_H
diff --git a/heat/src/wMedium.cpp b/heat/src/wMedium.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ad307a6d1e94383bbb42ddcddd4abd32b040b17f
--- /dev/null
+++ b/heat/src/wMedium.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wMedium.h"
+#include "wProblem.h"
+#include "wTag.h"
+#include "wFct2.h"
+using namespace heat;
+
+Medium::Medium(std::shared_ptr<MshData> _msh, int no,
+               std::shared_ptr<Fct2> _k, double _rhoc) : Group(_msh, no),
+                                                         k(_k), rhoc(_rhoc)
+{
+    //pbl.media.push_back(this);
+}
+
+Medium::Medium(std::shared_ptr<MshData> _msh, std::string const &name,
+               std::shared_ptr<Fct2> _k, double _rhoc) : Group(_msh, name),
+                                                         k(_k), rhoc(_rhoc)
+{
+    std::cout << "tag=" << *tag << std::endl;
+    //pbl.media.push_back(this);
+}
+
+void Medium::write(std::ostream &out) const
+{
+    out << "Medium on " << *tag << " with k=" << this->k << " rhoc=" << this->rhoc;
+}
diff --git a/heat/src/wMedium.h b/heat/src/wMedium.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ba9b425501ddced5a1c4116846aca06a8efd24b
--- /dev/null
+++ b/heat/src/wMedium.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WMEDIUM_H
+#define WMEDIUM_H
+
+#include "heat.h"
+#include "wGroup.h"
+#include "wFct0.h"
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief a thermal medium (with k, rhoc)
+ */
+
+class HEAT_API Medium : public Group
+{
+public:
+#ifndef SWIG
+    std::shared_ptr<Fct2> k;
+    double rhoc;
+#endif
+    Medium(std::shared_ptr<MshData> _msh, int no, std::shared_ptr<Fct2> _k, double _rhoc = 1.0);
+    Medium(std::shared_ptr<MshData> _msh, std::string const &name, std::shared_ptr<Fct2> _k, double _rhoc = 1.0);
+    virtual ~Medium() { std::cout << "~Medium()\n"; }
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace heat
+
+#endif //WMEDIUM_H
diff --git a/heat/src/wPeriodic.cpp b/heat/src/wPeriodic.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..56930814a7ceb1c87d494dae31751c71fb134a2c
--- /dev/null
+++ b/heat/src/wPeriodic.cpp
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wPeriodic.h"
+#include "wProblem.h"
+#include "wMedium.h"
+#include "wTag.h"
+#include "wElement.h"
+#include "wNode.h"
+#include <list>
+#include <algorithm>
+using namespace heat;
+
+HEAT_API std::ostream &
+operator<<(std::ostream &out, NodePair const &obj)
+{
+    out << "node #" << obj.n->no << " <=> node #" << obj.d->no;
+    return out;
+}
+
+NodePair::NodePair(Node *_n, Node *_d, double tol) : n(_n), d(_d)
+{
+    Eigen::Vector3d l = d->pos - n->pos;
+    if (fabs(l(0)) > tol && fabs(l(1)) > tol)
+    {
+        std::stringstream s;
+        s << " node #" << n->no << " and node #" << d->no << " are not facing each other!\n";
+        throw std::runtime_error(s.str());
+    }
+}
+
+Periodic::Periodic(std::shared_ptr<heat::Problem> _pbl,
+                   double _TM, double _dTxM, double _dTyM) : wSharedObject(), pbl(_pbl)
+{
+    //pbl->pdic = this;
+    reset(_TM, _dTxM, _dTyM);
+    verbose = false;
+}
+
+void Periodic::reset(double _TM, double _dTxM, double _dTyM)
+{
+    TM = _TM;
+    dTxM = _dTxM;
+    dTyM = _dTyM;
+    qM = Eigen::Vector3d::Zero();
+}
+
+void Periodic::write(std::ostream &out) const
+{
+    out << "heat::Periodic\n";
+    out << "\tT_M     = " << TM << '\n';
+    out << "\tgradT_M = (" << dTxM << ", " << dTyM << ")\n";
+}
+
+void Periodic::init()
+{
+    if (!LR.empty())
+        return;
+
+    //std::cout << "Periodic::init()\n";
+
+    // build a list of nodes related to all the media
+    if (verbose)
+    {
+        std::cout << "extracting nodes from " << pbl->media.size()
+                  << " medi" << ((pbl->media.size() == 1) ? "um" : "a") << "...\n";
+    }
+    std::list<Node *> nlist;
+    for (auto mat : pbl->media)
+        for (auto e : mat->tag->elems)
+            for (auto n : e->nodes)
+                nlist.push_back(n);
+    nlist.sort();
+    nlist.unique();
+    if (verbose)
+        std::cout << "number of nodes:" << nlist.size() << '\n';
+    if (nlist.empty())
+        throw std::runtime_error("Periodic::init() - no mesh!");
+
+    // compute bbox (p1,p3)
+
+    Eigen::Vector3d p1 = (*nlist.begin())->pos;
+    Eigen::Vector3d p3 = p1;
+    for (auto n : nlist)
+    {
+        Eigen::Vector3d p = n->pos;
+        if (p(0) < p1(0))
+            p1(0) = p(0);
+        if (p(0) > p3(0))
+            p3(0) = p(0);
+        if (p(1) < p1(1))
+            p1(1) = p(1);
+        if (p(1) > p3(1))
+            p3(1) = p(1);
+    }
+    if (verbose)
+    {
+        std::cout << "bounding box:\n";
+        std::cout << "\tp1=" << p1 << '\n';
+        std::cout << "\tp3=" << p3 << '\n';
+    }
+
+    // compute smallest distance between 2 nodes (mesh characteristic length)
+    double lc = std::numeric_limits<double>::max();
+    for (auto mat : pbl->media)
+        for (auto e : mat->tag->elems)
+            for (auto n1 : e->nodes)
+                for (auto n2 : e->nodes)
+                    if (n1 != n2)
+                    {
+                        double l = (n1->pos - n2->pos).norm();
+                        if (l < lc)
+                            lc = l;
+                    }
+    if (verbose)
+        std::cout << "characteristic length = " << lc << '\n';
+
+    // build ordered lists of nodes on boundaries
+    auto nL = nodesOnEdge(nlist, lc, p1, 0, "L");
+    auto nR = nodesOnEdge(nlist, lc, p3, 0, "R");
+    auto nB = nodesOnEdge(nlist, lc, p1, 1, "B");
+    auto nT = nodesOnEdge(nlist, lc, p3, 1, "T");
+
+    // corners detection
+    double eps = lc / 10.;
+
+    corners.resize(4);
+
+    {
+        if (verbose)
+            std::cout << "detecting corners...\n";
+        auto itP1 = nL.begin();
+        auto itP2 = nR.begin();
+        auto itP4 = --nL.end();
+        auto itP3 = --nR.end();
+
+        corners[0] = *itP1;
+        corners[1] = *itP2;
+        corners[2] = *itP3;
+        corners[3] = *itP4;
+
+        NodePair(*itP1, *itP2, eps); // error check
+        NodePair(*itP2, *itP3, eps); // error check
+        NodePair(*itP3, *itP4, eps); // error check
+        NodePair(*itP4, *itP1, eps); // error check
+
+        if (verbose)
+            for (auto n : corners)
+                std::cout << '\t' << *n << '\n';
+
+        // build LR node pairs
+        if (verbose)
+            std::cout << "detecting node pairs : left-right (LR)...\n";
+        for (auto itL = ++itP1, itR = ++itP2; itL != itP4 && itR != itP3; ++itL, ++itR)
+            LR.push_back(NodePair(*itL, *itR, eps));
+        /*
+        for(auto np : LR)
+            std::cout << '\t' << np << '\n';
+        */
+    }
+
+    // build TB node pairs
+    {
+        auto itP1 = nB.begin();
+        auto itP2 = --nB.end();
+        auto itP4 = nT.begin();
+        auto itP3 = --nT.end();
+
+        if (verbose)
+            std::cout << "detecting node pairs : bottom-top (BT)...\n";
+        for (auto itB = ++itP1, itT = ++itP4; itB != itP2 && itT != itP3; ++itB, ++itT)
+            BT.push_back(NodePair(*itB, *itT, eps));
+        /*
+        for(auto np : BT)
+            std::cout << '\t' << np << '\n';
+            */
+    }
+}
+
+std::vector<Node *>
+Periodic::nodesOnEdge(std::list<Node *> const &nlist,
+                      double lc, Eigen::Vector3d const &pt,
+                      int c, std::string const &name) const
+{
+    struct LessThan
+    {
+        int comp;
+        LessThan(int c) : comp(c) {}
+        inline bool operator()(Node *const &o1, Node *const &o2) const
+        {
+            return (o1->pos(comp) < o2->pos(comp));
+        }
+    };
+
+    std::vector<Node *> lnods;
+    double eps = lc / 10.;
+    double xF = pt(c);
+    for (auto n : nlist)
+    {
+        double px = n->pos(c);
+        if (xF - eps < px && px < xF + eps)
+            lnods.push_back(n);
+    }
+    std::sort(lnods.begin(), lnods.end(), LessThan((c == 1) ? 0 : 1));
+
+    if (verbose)
+        std::cout << "nodes on " << name << " boundary: " << lnods.size() << '\n';
+    if (lnods.size() < 2)
+    {
+        std::stringstream str;
+        str << "Periodic::nodesOnEdge - not enough nodes on " << name << " boundary!\n";
+        throw std::runtime_error(str.str());
+    }
+
+    /*
+    for(auto n : lnods)
+        std::cout << '\t' << *n << '\n';
+    */
+    return lnods;
+}
diff --git a/heat/src/wPeriodic.h b/heat/src/wPeriodic.h
new file mode 100644
index 0000000000000000000000000000000000000000..0e1d4c9ab9143233ef6ade2f392e53dd895f9871
--- /dev/null
+++ b/heat/src/wPeriodic.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WPERIODIC_H
+#define WPERIODIC_H
+
+#include "heat.h"
+#include "wObject.h"
+#include <vector>
+#include <string>
+#include <list>
+#include <memory>
+#include <Eigen/Dense>
+
+using namespace tbox;
+
+namespace heat
+{
+
+#ifndef SWIG
+class HEAT_API NodePair
+{
+public:
+    Node *n;
+    Node *d;
+    NodePair(Node *_n, Node *_d, double tol = 1e-12);
+    friend HEAT_API std::ostream &operator<<(std::ostream &out, NodePair const &obj);
+};
+#endif //SWIG
+
+/**
+ * @brief manages periodic BCs
+ */
+
+class HEAT_API Periodic : public fwk::wSharedObject
+{
+    std::shared_ptr<heat::Problem> pbl;
+
+public:
+#ifndef SWIG
+    double TM;
+    double dTxM;
+    double dTyM;
+    std::vector<NodePair> LR;    ///< left-right boundaries
+    std::vector<NodePair> BT;    ///< bottom-top boundaries
+    std::vector<Node *> corners; ///< corner nodes
+#endif
+    Eigen::Vector3d qM; ///< calculated mean flux
+    bool verbose;       ///< print on/off
+
+    Periodic(std::shared_ptr<heat::Problem> _pbl, double _TM, double _dTxM, double _dTyM);
+    virtual ~Periodic() { std::cout << "~Periodic()\n"; }
+
+    void reset(double _TM, double _dTxM, double _dTyM);
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+
+    void init();
+#endif
+
+private:
+    std::vector<Node *>
+    nodesOnEdge(std::list<Node *> const &nlist, double lc, Eigen::Vector3d const &pt, int c, std::string const &name) const;
+};
+
+} // namespace heat
+
+#endif //WPERIODIC_H
diff --git a/heat/src/wProblem.cpp b/heat/src/wProblem.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..90d4fdc35fe816ee1c87100c4813d4068fe93c32
--- /dev/null
+++ b/heat/src/wProblem.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wProblem.h"
+#include "wMedium.h"
+#include "wBoundary.h"
+#include "wSource.h"
+#include "wPeriodic.h" // sinon:  warning C4150: deletion of pointer to incomplete type 'heat::Periodic'; no destructor called
+#include "wElement.h"
+
+#include "wTag.h"
+using namespace heat;
+
+Problem::Problem(std::shared_ptr<MshData> _msh) : msh(_msh), pdic(NULL)
+{
+}
+
+void Problem::write(std::ostream &out) const
+{
+    out << "heat::Problem:\n";
+}
+
+Problem::~Problem()
+{
+    std::cout << "~Problem()\n";
+}
+
+/**
+ * @brief Initialize the elements precomputed values
+ */
+void Problem::initElems()
+{
+    // Update volume Jacobian
+    for (auto vol : media)
+        for (auto e : vol->tag->elems)
+            e->initValues(true);
+    // Update volume Jacobian (volume source)
+    for (auto vol : srcs)
+        for (auto e : vol->tag->elems)
+            e->initValues(true);
+    // Update surface Jacobian (Neumann B.C.)
+    for (auto surf : bnds)
+        for (auto e : surf->tag->elems)
+            e->initValues(false);
+}
\ No newline at end of file
diff --git a/heat/src/wProblem.h b/heat/src/wProblem.h
new file mode 100644
index 0000000000000000000000000000000000000000..875aa6da5a8e227118090700914de00a567bcc49
--- /dev/null
+++ b/heat/src/wProblem.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WPROBLEM_H
+#define WPROBLEM_H
+
+#include "heat.h"
+#include "wObject.h"
+#include <memory>
+#include <iostream>
+#include <vector>
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief a class containing the problem parameters
+ */
+
+class HEAT_API Problem : public fwk::wSharedObject
+{
+public:
+    std::shared_ptr<MshData> msh; ///< Mesh structure
+#ifndef SWIG
+    std::vector<std::shared_ptr<Medium>> media;   ///< Materials
+    std::vector<std::shared_ptr<Dirichlet>> dBCs; ///< Dirichlet boundary conditions
+
+    std::vector<std::shared_ptr<Source>> srcs;   ///< volumic sources
+    std::vector<std::shared_ptr<Boundary>> bnds; ///< prescribed fluxes on the boundary
+
+    std::shared_ptr<Periodic> pdic; ///< periodic BC
+#endif
+
+public:
+    Problem(std::shared_ptr<MshData> _msh);
+    virtual ~Problem();
+
+    void add(std::shared_ptr<Medium> m) { media.push_back(m); }
+    void add(std::shared_ptr<Dirichlet> d) { dBCs.push_back(d); }
+    void add(std::shared_ptr<Source> s) { srcs.push_back(s); }
+    void add(std::shared_ptr<Boundary> b) { bnds.push_back(b); }
+    void add(std::shared_ptr<Periodic> p) { pdic = p; }
+
+#ifndef SWIG
+    void initElems();
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace heat
+
+#endif //WPROBLEM_H
diff --git a/heat/src/wSolver.cpp b/heat/src/wSolver.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0148904fd71dfe456c1cd073ea6145b8cb754880
--- /dev/null
+++ b/heat/src/wSolver.cpp
@@ -0,0 +1,712 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wSolver.h"
+#include "wMshData.h"
+#include "wNode.h"
+#include "wElement.h"
+#include "wTri3.h"
+#include "wTimer.h"
+#include "wTag.h"
+#include "wFct2.h"
+#include "wProblem.h"
+#include "wMedium.h"
+#include "wSource.h"
+#include "wBoundary.h"
+#include "wDirichlet.h"
+#include "wDisplayHook.h"
+#include "wPeriodic.h"
+#include "wHeatTerm.h"
+#include "wResults.h"
+#include "wMshExport.h"
+#include "wLinearSolver.h"
+
+#include <Eigen/Sparse>
+#include <typeinfo>
+#include <algorithm>
+#include <iomanip>
+#include <deque>
+
+#include <tbb/global_control.h>
+#include <tbb/parallel_for_each.h>
+#include <tbb/spin_mutex.h>
+using namespace heat;
+using namespace fwk;
+
+#undef min
+#undef max
+
+Solver::Solver(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol) : pbl(_pbl), linsol(_linsol)
+{
+    dhook = NULL;
+
+    // default values
+    nthreads = 1;
+    verbose = 1;
+    stopit = false;
+    restol = 1e-2;
+    itmax = 100;
+    save = true;
+
+    // update element memory
+    pbl->initElems();
+}
+
+Solver::~Solver()
+{
+    std::cout << "~Solver()\n";
+}
+
+/**
+ * @todo planter clairement si pas de Medium
+ * @todo calculer la taille du systeme en fct du nombre de noeuds des physical groups utilisés
+ */
+void Solver::start(MshExport *mshWriter)
+{
+    tbb::spin_mutex mutex;
+    tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads);
+
+    // start timers
+    tms["total"].start();
+    tms["prepro"].start(); // ----- start preprocessing phase
+
+    if (verbose > 1)
+        std::cout << *this;
+
+    auto msh = pbl->msh;
+
+    // setup results
+    T1.resize(msh->nodes.size(), 0.); // in case of restart
+    Eigen::Map<Eigen::VectorXd> T1_(T1.data(), T1.size());
+
+    Results results;
+    results.scalars_at_nodes["T"] = &T1;
+
+    // initial temperature guess
+    if (!pbl->dBCs.empty())
+    {
+        double tmin = std::numeric_limits<double>::max();
+        double tmax = std::numeric_limits<double>::min();
+        for (auto dBC : pbl->dBCs)
+        {
+            double v = dBC->val;
+            if (v < tmin)
+                tmin = v;
+            if (v > tmax)
+                tmax = v;
+        }
+        /*
+        std::cout << "tmin=" << tmin << "\n";
+        std::cout << "tmax=" << tmax << "\n";
+        */
+        for (auto n : msh->nodes)
+            T1[n->row] = (tmin + tmax) / 2;
+
+        for (auto dBC : pbl->dBCs)
+            dBC->apply(T1);
+    }
+
+    // periodic BCs
+    if (pbl->pdic)
+    {
+        if (!pbl->dBCs.empty())
+            throw std::runtime_error("cannot manage periodic BCs and Dirichlet BCs simultaneously!\n");
+        pbl->pdic->init();
+
+        // initial guess for T
+        for (auto n : msh->nodes)
+            T1[n->row] = pbl->pdic->TM;
+    }
+    tms["prepro"].stop(); // ----- end of preprocessing phase
+
+    // --------------------------------------------------------------------
+    // Iteration LOOP
+    // --------------------------------------------------------------------
+
+    int it = 0;
+    while (it <= itmax)
+    {
+        std::vector<double> rhs(msh->nodes.size());                                             // dummy RHS
+        Eigen::Map<Eigen::VectorXd> rhs_ = Eigen::Map<Eigen::VectorXd>(rhs.data(), rhs.size()); // actual RHS
+
+        tms["Kass"].start();
+        // K matrix assembly
+        Eigen::SparseMatrix<double, Eigen::RowMajor> K(msh->nodes.size(), msh->nodes.size());
+        buildK(K, rhs_);
+        //tomatlab("K.txt", K);
+        //throw std::runtime_error("stop!");
+        tms["Kass"].stop();
+
+        tms["BCs"].start();
+
+        if (!pbl->pdic)
+        {
+            builds(rhs_); // sources
+            buildq(rhs_); // prescribed fluxes (=sources over lines)
+
+            // BCs
+            for (auto dBC : pbl->dBCs) // apply Dirichlet BCs to RHS
+                dBC->apply(rhs);
+        }
+        tms["BCs"].stop();
+        //std::cout << rhs << "\n";
+
+        // residual calculation
+        tms["residual"].start();
+
+        // method #1
+        Eigen::VectorXd qint = K * T1_; // calcul de q_int = K T1:
+
+        // method #2
+        if (0)
+        {
+            Eigen::VectorXd qint2;
+            buildqint(qint2); // calcul de q_int par integration du flux sur l'elem
+            double normdiff = (qint - qint2).norm();
+            //if(verbose>1)
+            std::cout << "norm diff=" << normdiff << '\n';
+        }
+
+        /*
+        for(auto i=0; i<msh->nodes.size(); ++i)
+            std::cout << i << ":" << qint[i] << "," << qint2[i] << "\n";
+        */
+
+        Eigen::VectorXd res = qint - rhs_; // residual
+        double rnorm2 = res.norm();
+        double rnorminf = res.lpNorm<Eigen::Infinity>();
+        tms["residual"].stop();
+
+        if (verbose > 0)
+        {
+            std::cout << std::fixed << std::setprecision(3);
+            std::cout << " * it #" << std::setw(3) << std::left << it
+                      << " |r|2 = " << std::setw(9) << std::scientific << std::right << rnorm2
+                      << "  |r|inf = " << std::setw(9) << std::scientific << std::right << rnorminf << '\n';
+        }
+        // check convergence
+        if (rnorm2 < restol && it != 0)
+            break;
+        it++;
+
+        // solve
+        tms["solve"].start();
+        if (verbose > 1)
+            std::cout << "solving...\n";
+        if (it == 1)
+        {
+            linsol->analyze(K);
+        }
+        linsol->factorize(K);
+        linsol->solve(rhs_, T1_);
+        tms["solve"].stop();
+    }
+    if (it > itmax)
+    {
+        std::cout << "\n**WARNING! iterative process failed to converge\n";
+        std::cout << "           in less than " << itmax << " iterations!\n\n"; // TODO: generer une erreur!
+    }
+
+    // --------------------------------------------------------------------
+    // Postprocessing
+    // --------------------------------------------------------------------
+
+    if (verbose > 1)
+        std::cout << "postpro...\n";
+    tms["post"].start();
+
+    // setup results
+
+    std::vector<double> gradT_x(msh->elems.size());         ///< gradT_x
+    std::vector<double> gradT_y(msh->elems.size());         ///< gradT_y
+    std::vector<Eigen::Vector3d> gradT(msh->elems.size());  ///< gradT
+    std::vector<Eigen::Vector3d> kgradT(msh->elems.size()); ///< gradT
+    std::vector<double> kmoy11(msh->elems.size());          ///< mean k11 / element
+    std::vector<double> kmoy22(msh->elems.size());          ///< mean k22 / element
+    std::vector<double> kmoy12(msh->elems.size());          ///< mean k12 / element
+    std::vector<double> kmoy21(msh->elems.size());          ///< mean k21 / element
+    std::vector<Eigen::MatrixXd> kmoy(msh->elems.size());
+    for (auto &km : kmoy)
+        km = Eigen::Matrix3d::Zero();
+
+    results.scalars_at_elems["gradT_x"] = &gradT_x;
+    results.scalars_at_elems["gradT_y"] = &gradT_y;
+    results.scalars_at_elems["k11"] = &kmoy11;
+    results.scalars_at_elems["k22"] = &kmoy22;
+    results.scalars_at_elems["k12"] = &kmoy12;
+    results.scalars_at_elems["k21"] = &kmoy21;
+    results.vectors_at_elems["gradT"] = &gradT;
+    results.vectors_at_elems["q [heat flux]"] = &kgradT;
+    results.tensors_at_elems["k [tensor]"] = &kmoy;
+
+    double Vtot = 0.0;
+    Eigen::Vector2d qM = Eigen::Vector2d::Zero();
+    for (auto mat : pbl->media)
+    {
+        tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) {
+            if (e->type() != ElType::TRI3)
+                return;
+            //std::cout << "processing element #" << e->no << "\n";
+
+            // (flux moyen . volume) sur l'element
+            Eigen::VectorXd qV = HeatTerm::computeFlux(*e, T1, *mat->k);
+
+            double V = e->getVol();
+
+            if (save)
+            {
+                // gradient of T at GP 0
+                Eigen::VectorXd grad = e->computeGradient(T1, 0);
+                int i = e->no - 1;
+                gradT_x[i] = grad(0);
+                gradT_y[i] = grad(1);
+                gradT[i] = Eigen::Vector3d(grad(0), grad(1), 0);
+
+                // mean q over the element
+                kgradT[i] = Eigen::Vector3d(qV(0) / V, qV(1) / V, 0);
+
+                // mean k over the element
+                Eigen::MatrixXd kmean = HeatTerm::computeMatrix(*e, T1, *mat->k) / V;
+                kmoy11[i] = kmean(0, 0);
+                kmoy22[i] = kmean(1, 1);
+                kmoy12[i] = kmean(0, 1);
+                kmoy21[i] = kmean(1, 0);
+
+                // tensor
+                kmean.conservativeResize(3, 3);
+                kmean.row(2) = Eigen::RowVector3d::Zero();
+                kmean.col(2) = Eigen::Vector3d::Zero();
+                kmoy[i] = kmean;
+                //std::cout << kmean << '\n';
+            }
+
+            tbb::spin_mutex::scoped_lock lock(mutex);
+            Vtot += V;
+            qM += qV; // qM = qM + qV
+        });
+    }
+    qM /= Vtot;
+
+    if (verbose > 1)
+    {
+        std::cout << "Vtot = " << Vtot << '\n';
+        std::cout << "qM = " << qM << '\n';
+    }
+
+    // periodic BCs
+    if (pbl->pdic)
+    {
+        pbl->pdic->qM = Eigen::Vector3d(qM(0), qM(1), 0.);
+        if (verbose > 1)
+        {
+            std::cout << "=> k_x = " << ((pbl->pdic->dTxM == 0.0) ? 0 : qM(0) / pbl->pdic->dTxM) << '\n';
+            std::cout << "=> k_y = " << ((pbl->pdic->dTyM == 0.0) ? 0 : qM(1) / pbl->pdic->dTyM) << '\n';
+        }
+    }
+
+    if (save)
+    {
+        if (verbose > 1)
+            std::cout << "saving results to disk...\n";
+        mshWriter->save(msh->name, results);
+    }
+
+    tms["post"].stop();
+    tms["total"].stop();
+
+    if (verbose > 0)
+    {
+        std::cout << "---CPU statistics ---\n";
+        std::cout << tms;
+        std::cout << "---------------------\n";
+    }
+}
+
+void Solver::buildK(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, Eigen::Map<Eigen::VectorXd> &rhs)
+{
+    tbb::spin_mutex mutex;
+
+    std::shared_ptr<MshData> msh = pbl->msh;
+
+    // List of triplets to build matrix
+    std::deque<Eigen::Triplet<double>> T;
+
+    // periodic BCs
+    // (on va sommer les lignes des noeuds "d" sur celles des noeuds "n")
+
+    std::vector<int> rows(msh->nodes.size());
+    for (size_t i = 0; i < msh->nodes.size(); ++i)
+        rows[i] = msh->nodes[i]->row;
+
+    if (pbl->pdic)
+    {
+        for (auto np : pbl->pdic->BT)
+            rows[np.d->row] = np.n->row;
+        for (auto np : pbl->pdic->LR)
+            rows[np.d->row] = np.n->row;
+    }
+
+    if (verbose > 1)
+        std::cout << "building K (TBB/lambda) using " << nthreads << " threads...\n";
+
+    bool useTBB = false;
+    if (useTBB)
+    {
+        // 1-STEP PROCEDURE
+
+        for (auto mat : pbl->media)
+        {
+            if (verbose > 1)
+                std::cout << "\tprocessing " << *mat << '\n';
+            tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) {
+                if (e->type() != ElType::TRI3)
+                    return;
+                //std::cout << "processing element #" << e->no << "\n";
+
+                Eigen::MatrixXd Ke = HeatTerm::build(*e, T1, *mat->k, false);
+
+                // assembly
+                tbb::spin_mutex::scoped_lock lock(mutex);
+                for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+                {
+                    Node *nodi = e->nodes[ii];
+                    for (size_t jj = 0; jj < e->nodes.size(); ++jj)
+                    {
+                        Node *nodj = e->nodes[jj];
+                        T.push_back(Eigen::Triplet<double>(rows[nodi->row], nodj->row, Ke(ii, jj)));
+                    }
+                }
+            });
+        }
+    }
+    else
+    {
+        // 3-STEP PROCEDURE
+
+        // *** build Job list - "fake run"
+
+        if (verbose > 1)
+            std::cout << "building job list...\n";
+
+        for (auto mat : pbl->media)
+        {
+            if (verbose > 1)
+                std::cout << "\tprocessing " << *mat << '\n';
+            std::for_each(mat->tag->elems.begin(), mat->tag->elems.end(),
+                          [&](Element *e) {
+                              if (e->type() != ElType::TRI3)
+                                  return;
+                              Eigen::MatrixXd Ke = HeatTerm::build(*e, T1, *mat->k, true); // bidon
+                          });
+        }
+
+        // *** execute all jobs generated during the fake run
+
+        if (verbose > 1)
+            std::cout << "executing job list...\n";
+        for (auto mat : pbl->media)
+            mat->k->evalall();
+
+        // ***  perform the assembly with the results ("true run")
+
+        if (verbose > 1)
+            std::cout << "performing assembly...\n";
+
+        for (auto mat : pbl->media)
+        {
+            if (verbose > 1)
+                std::cout << "\tprocessing " << *mat << '\n';
+
+            std::for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { // devrait pouvoir etre fait en TBB...
+                if (e->type() != ElType::TRI3)
+                    return;
+                Eigen::MatrixXd Ke = HeatTerm::build(*e, T1, *mat->k, false);
+
+                // assembly
+                //tbb::spin_mutex::scoped_lock lock(mutex);
+                for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+                {
+                    Node *nodi = e->nodes[ii];
+                    for (size_t jj = 0; jj < e->nodes.size(); ++jj)
+                    {
+                        Node *nodj = e->nodes[jj];
+                        T.push_back(Eigen::Triplet<double>(rows[nodi->row], nodj->row, Ke(ii, jj)));
+                    }
+                }
+            });
+        }
+        if (verbose > 1)
+            std::cout << "assembly done.\n";
+    }
+    // Build matrix without BCs
+    K2.setFromTriplets(T.begin(), T.end());
+
+    // periodic BCs
+    if (pbl->pdic)
+    {
+        // equations \theta_d (R,T) fct (L,B)
+        double lx = pbl->pdic->corners[1]->pos(0) - pbl->pdic->corners[0]->pos(0);
+        double ly = pbl->pdic->corners[3]->pos(1) - pbl->pdic->corners[0]->pos(1);
+        if (verbose > 1)
+            std::cout << "lx = " << lx << '\n';
+        if (verbose > 1)
+            std::cout << "ly = " << ly << '\n';
+        double TM = pbl->pdic->TM;
+        double dTxM = pbl->pdic->dTxM;
+        double dTyM = pbl->pdic->dTyM;
+
+        for (auto np : pbl->pdic->LR)
+        {
+            // clears related row
+            for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(K2, np.d->row); it; ++it)
+                it.valueRef() = 0.;
+
+            K2.coeffRef(np.d->row, np.d->row) = 1.0;
+            K2.coeffRef(np.d->row, np.n->row) = -1.0;
+            rhs(np.d->row) = lx * dTxM;
+        }
+
+        for (auto np : pbl->pdic->BT)
+        {
+            // clears related row
+            for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(K2, np.d->row); it; ++it)
+                it.valueRef() = 0.;
+
+            K2.coeffRef(np.d->row, np.d->row) = 1.0;
+            K2.coeffRef(np.d->row, np.n->row) = -1.0;
+            rhs(np.d->row) = ly * dTyM;
+        }
+
+        // corners \theta_2,3,4 fct \theta_1
+
+        for (auto i = 0; i < 4; ++i)
+        {
+            Node *nod = pbl->pdic->corners[i];
+            // clears related row
+            for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(K2, nod->row); it; ++it)
+                it.valueRef() = 0.;
+        }
+
+        Node *n1 = pbl->pdic->corners[0];
+        for (auto i = 1; i < 4; ++i)
+        {
+            Node *ni = pbl->pdic->corners[i];
+            K2.coeffRef(ni->row, ni->row) = 1.0;
+            K2.coeffRef(ni->row, n1->row) = -1.0;
+        }
+        Node *n2 = pbl->pdic->corners[1];
+        Node *n3 = pbl->pdic->corners[2];
+        Node *n4 = pbl->pdic->corners[3];
+        rhs(n2->row) = lx * dTxM;
+        rhs(n3->row) = lx * dTxM + ly * dTyM;
+        rhs(n4->row) = ly * dTyM;
+
+        // thermal energy consistency condition (n1->row)
+
+        double Vtot = 0.0;
+        double rhocM_Vtot = 0;
+        for (auto mat : pbl->media)
+        {
+            //std::cout << "\tprocessing " << *mat << '\n';
+            tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) {
+                if (e->type() != ElType::TRI3)
+                    return;
+                //std::cout << "processing element #" << e->no << "\n";
+
+                // ** Ce matrix => K matrix
+                Eigen::VectorXd Ce = HeatTerm::build(*e, T1, Fct0C(1.0));
+
+                // assembly
+                tbb::spin_mutex::scoped_lock lock(mutex);
+                for (size_t jj = 0; jj < e->nodes.size(); ++jj)
+                {
+                    Node *nodj = e->nodes[jj];
+                    K2.coeffRef(n1->row, nodj->row) += (mat->rhoc) * Ce(jj);
+
+                    Vtot += Ce(jj);
+                    rhocM_Vtot += (mat->rhoc) * Ce(jj);
+                }
+            });
+        }
+        rhs(n1->row) = rhocM_Vtot * TM;
+        if (verbose > 1)
+            std::cout << "Vtot=" << Vtot << "\n";
+        if (verbose > 1)
+            std::cout << "rhocM_Vtot=" << rhocM_Vtot << "\n";
+    }
+
+    if (!pbl->dBCs.empty())
+    {
+        if (verbose > 1)
+            std::cout << "applying Dirichlet BCs...\n";
+
+        // apply Dirichlet BCs to K
+        for (auto dBC : pbl->dBCs)
+        {
+            for (auto nod : dBC->nodes)
+            {
+                //std::cout << "processing " << *nod << "\n";
+                for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(K2, nod->row); it; ++it)
+                {
+                    if (it.row() == it.col())
+                        it.valueRef() = 1.;
+                    else
+                        it.valueRef() = 0.;
+                }
+            }
+        }
+        if (verbose > 1)
+            std::cout << "done." << std::endl;
+    }
+
+    // Clean matrix and turn to compressed row format
+    K2.prune(0.);
+    K2.makeCompressed();
+
+    if (verbose > 1)
+    {
+        std::cout << "K (" << K2.rows() << "," << K2.cols() << ") nnz=" << K2.nonZeros() << "\n";
+    }
+}
+
+void Solver::buildqint(Eigen::VectorXd &qint)
+{
+    tbb::spin_mutex mutex;
+
+    qint = Eigen::VectorXd::Zero(pbl->msh->nodes.size());
+
+    for (auto mat : pbl->media)
+    {
+        if (verbose > 1)
+            std::cout << "\tprocessing " << *mat << '\n';
+        tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) {
+            if (e->type() != ElType::TRI3)
+                return;
+            //std::cout << "processing element #" << e->no << "\n";
+
+            Eigen::VectorXd qe = HeatTerm::build2(*e, T1, *mat->k);
+
+            // assembly
+            tbb::spin_mutex::scoped_lock lock(mutex);
+            for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+            {
+                Node *nodi = e->nodes[ii];
+                qint(nodi->row) += qe(ii);
+            }
+        });
+    }
+
+    if (!pbl->dBCs.empty())
+    {
+        if (verbose > 1)
+            std::cout << "applying Dirichlet BCs...\n";
+
+        // apply Dirichlet BCs to qint
+        for (auto dBC : pbl->dBCs)
+        {
+            for (auto nod : dBC->nodes)
+            {
+                qint(nod->row) = T1[nod->row]; // pour comparer avec K.T1
+            }
+        }
+        if (verbose > 1)
+            std::cout << "done." << std::endl;
+    }
+}
+
+/**
+ * @brief volume sources
+ */
+
+void Solver::builds(Eigen::Map<Eigen::VectorXd> &s)
+{
+    tbb::spin_mutex mutex;
+
+    if (verbose > 1)
+        std::cout << "building s (TBB/lambda) using " << nthreads << " threads...\n";
+
+    for (auto src : pbl->srcs)
+    {
+        //std::cout << "\tprocessing " << *src << '\n';
+        tbb::parallel_for_each(src->tag->elems.begin(), src->tag->elems.end(), [&](Element *e) {
+            if (e->type() != ElType::TRI3 && e->type() != ElType::LINE2)
+                return;
+            //std::cout << "processing element #" << e->no << "\n";
+
+            // ** se vector => s vector
+            Eigen::VectorXd se = HeatTerm::build(*e, T1, *src->f);
+
+            // assembly
+            tbb::spin_mutex::scoped_lock lock(mutex);
+
+            for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+            {
+                Node *nodi = e->nodes[ii];
+                s(nodi->row) += se(ii);
+            }
+        });
+    }
+
+    if (verbose > 1)
+    {
+        std::cout << "s (" << s.size() << ")\n";
+    }
+}
+
+/**
+ * @brief terme BC Neumann (pourrait etre mergé avec "builds"... c'est idem)
+ * @todo merge this routine with builds
+ */
+void Solver::buildq(Eigen::Map<Eigen::VectorXd> &q)
+{
+    tbb::spin_mutex mutex;
+
+    if (verbose > 1)
+        std::cout << "building q (TBB/lambda) using " << nthreads << " threads...\n";
+
+    for (auto bnd : pbl->bnds)
+    {
+        //std::cout << "\tprocessing " << *src << '\n';
+        tbb::parallel_for_each(bnd->tag->elems.begin(), bnd->tag->elems.end(), [&](Element *e) {
+            if (e->type() != ElType::LINE2)
+                return;
+            //std::cout << "processing element #" << e->no << "\n";
+
+            // ** qe vector => q vector
+            Eigen::VectorXd qe = HeatTerm::build(*e, T1, *bnd->f);
+
+            // assembly
+            tbb::spin_mutex::scoped_lock lock(mutex);
+
+            for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+            {
+                Node *nodi = e->nodes[ii];
+                q(nodi->row) += qe(ii);
+            }
+        });
+    }
+
+    if (verbose > 1)
+    {
+        std::cout << "q (" << q.size() << ")\n";
+    }
+}
+
+void Solver::write(std::ostream &out) const
+{
+    out << "heat::Solver"
+        << "\n";
+}
diff --git a/heat/src/wSolver.h b/heat/src/wSolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..bd83c28c92b110ec40ef87df4fb16fb0c8a4a7e5
--- /dev/null
+++ b/heat/src/wSolver.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WSOLVER_H
+#define WSOLVER_H
+
+#include "heat.h"
+#include "wObject.h"
+#include "wTimer.h"
+#include "wTimers.h"
+#include "wElement.h"
+#include <iostream>
+#include <vector>
+#include <memory>
+#include <Eigen/Sparse>
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief heat solver
+ */
+
+class HEAT_API Solver : public fwk::wSharedObject
+{
+public:
+    int verbose;
+#ifndef SWIG
+    DisplayHook *dhook;
+
+#endif
+    std::shared_ptr<Problem> pbl;
+    std::shared_ptr<tbox::LinearSolver> linsol; ///< linear solver
+
+    bool stopit;            ///< stop the calculation
+    int nthreads;           ///< # of threads for the assembly
+    fwk::Timers tms;        ///< timers
+    std::vector<double> T1; ///< nodal temperatures
+    double restol;          ///< tolerance on the residual
+    int itmax;              ///< max number of iterations
+    bool save;              ///< calculate all results
+public:
+    Solver(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol);
+    virtual ~Solver();
+
+    virtual void start(MshExport *mshWriter);
+
+    void setGUI(DisplayHook &hook) { dhook = &hook; }
+
+    void stop() { stopit = true; }
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+
+private:
+    void buildK(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, Eigen::Map<Eigen::VectorXd> &rhs);
+    void builds(Eigen::Map<Eigen::VectorXd> &s);
+    void buildq(Eigen::Map<Eigen::VectorXd> &s);
+    void buildqint(Eigen::VectorXd &qint);
+};
+
+} // namespace heat
+
+#endif //WSOLVER_H
diff --git a/heat/src/wSource.cpp b/heat/src/wSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..149c18d185dade39387f8e6c8cbf94b4f5f310e0
--- /dev/null
+++ b/heat/src/wSource.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wSource.h"
+#include "wProblem.h"
+#include "wTag.h"
+using namespace heat;
+
+Source::Source(std::shared_ptr<MshData> _msh, int no, std::shared_ptr<Fct0> _f) : Group(_msh, no), f(_f)
+{
+    //pbl.srcs.push_back(this);
+}
+
+Source::Source(std::shared_ptr<MshData> _msh, std::string const &name, std::shared_ptr<Fct0> _f) : Group(_msh, name), f(_f)
+{
+    //pbl.srcs.push_back(this);
+}
+
+void Source::write(std::ostream &out) const
+{
+    out << "heat::Source on " << *tag << '\n';
+}
diff --git a/heat/src/wSource.h b/heat/src/wSource.h
new file mode 100644
index 0000000000000000000000000000000000000000..b83b726390099a0499c9df65d6bbb772e0f2adb1
--- /dev/null
+++ b/heat/src/wSource.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WSOURCE_H
+#define WSOURCE_H
+
+#include "heat.h"
+#include "wGroup.h"
+#include "wFct0.h"
+#include <vector>
+#include <string>
+
+using namespace tbox;
+
+namespace heat
+{
+
+/**
+ * @brief manage (volumic) heat sources
+ */
+
+class HEAT_API Source : public Group
+{
+public:
+#ifndef SWIG
+    std::shared_ptr<Fct0> f;
+#endif
+    Source(std::shared_ptr<MshData> _msh, int no, std::shared_ptr<Fct0> _f);
+    Source(std::shared_ptr<MshData> _msh, std::string const &name, std::shared_ptr<Fct0> _f);
+    virtual ~Source() { std::cout << "~Source()\n"; }
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace heat
+
+#endif //WSOURCE_H
diff --git a/heat/tests/basics/anisotropy.py b/heat/tests/basics/anisotropy.py
new file mode 100644
index 0000000000000000000000000000000000000000..97b0ef251f0ba86e2a7b42e1e82e4b36d95f1a39
--- /dev/null
+++ b/heat/tests/basics/anisotropy.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# simple test on a square : heat source + anisotropy
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+def main():
+
+    # mesh a unit square
+    pars = {'Lx' : 1 , 'Ly' : 1, 'Nx' : 30, 'Ny' : 30}
+    msh = gmsh.MeshLoader("../../models/rect_stru.geo",__file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    # medium/boundary conditions
+    pbl.add(h.Source(msh, "S1", tbox.Fct0C(1.0))) # heat src
+
+    pbl.add(h.Medium(msh, "S1", tbox.Fct2C(2.0,1.0,-1.0))) # anisotropy
+
+    pbl.add(h.Dirichlet(msh,"Left", 0.))
+    pbl.add(h.Dirichlet(msh,"Right", 0.))
+    pbl.add(h.Dirichlet(msh,"Bottom", 0.))
+    pbl.add(h.Dirichlet(msh,"Top", 0.))
+
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+
+    # check results
+    x1,y1,T1 = u.getTemp(solver,"S1")
+    tests = CTests()
+    tests.add(CTest('max(T)', max(T1), 0.053841, 1e-2))
+    tests.run()
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/basics/dirichletx.py b/heat/tests/basics/dirichletx.py
new file mode 100644
index 0000000000000000000000000000000000000000..65a7c5be6f9178c5668728f15616d2693051761a
--- /dev/null
+++ b/heat/tests/basics/dirichletx.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import heat.utils as u
+from fwk.testing import *
+
+if __name__ == "__main__":
+    import heat.models.rect as m
+    solver = m.main(bc='dirichletx')
+
+    x1,y1,T1 = u.getTemp(solver,"Bottom")
+    
+    u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Tbottom)', sum(T1) / len(T1), 4.0, 1e-9))
+    tests.add(CTest('max(Tbottom)', max(T1), 5.0))
+    tests.add(CTest('min(Tbottom)', min(T1), 3.0))
+    tests.run()
+    
diff --git a/heat/tests/basics/dirichletx_stru.py b/heat/tests/basics/dirichletx_stru.py
new file mode 100644
index 0000000000000000000000000000000000000000..cd444f396bb8cc19bca5864c419022de8e7d8fad
--- /dev/null
+++ b/heat/tests/basics/dirichletx_stru.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import heat.utils as u
+from fwk.testing import *
+
+if __name__ == "__main__":
+    import heat.models.rect as m
+    solver = m.main(bc='dirichletx', stru=True)
+    
+    x1,y1,T1 = u.getTemp(solver,"Bottom")
+    
+    u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Tbottom)', sum(T1) / len(T1), 4.0, 1e-9))
+    tests.add(CTest('max(Tbottom)', max(T1), 5.0))
+    tests.add(CTest('min(Tbottom)', min(T1), 3.0))
+    tests.run()
diff --git a/heat/tests/basics/dirichlety.py b/heat/tests/basics/dirichlety.py
new file mode 100644
index 0000000000000000000000000000000000000000..abcedb8b807542965a60ff32d8caa9215a2a1e52
--- /dev/null
+++ b/heat/tests/basics/dirichlety.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import heat.utils as u
+from fwk.testing import *
+
+if __name__ == "__main__":
+    import heat.models.rect as m
+    solver = m.main(bc='dirichlety',Lx=5, lc=0.5)
+    
+    x1,y1,T1 = u.getTemp(solver,"Left", sort='y')
+    
+    u.simpleplot(y1, T1, xlabel='y [mm]', title='Temperature along y')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Tleft)', sum(T1) / len(T1), 4.0, 1e-9))
+    tests.add(CTest('max(Tleft)', max(T1), 5.0))
+    tests.add(CTest('min(Tleft)', min(T1), 3.0))
+    tests.run()
+
diff --git a/heat/tests/basics/mat2hole.geo b/heat/tests/basics/mat2hole.geo
new file mode 100644
index 0000000000000000000000000000000000000000..98f855e65ee2811490c0a41cc817a2f9a1a6859d
--- /dev/null
+++ b/heat/tests/basics/mat2hole.geo
@@ -0,0 +1,79 @@
+// 2 materials and a hole
+
+lc = 0.5;
+Lx = 13;
+Ly = 9;
+
+
+ix = 3;
+iy = 3;
+//iR = 1.5;
+DefineConstant[ iR = { 1.5, Min 0.5, Max 1.5, Step 0.1, Name "Lengths/iR" }  ];
+
+hx = Lx-3;
+hy = Ly-4;
+hR = 2.5;
+
+
+// -- outer boundary
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+
+// -- inclusion
+Point(11) = { ix-iR,  iy, 0, lc/2};
+Point(12) = { ix,     iy, 0, lc/2};
+Point(13) = { ix+iR,  iy, 0, lc/2};
+
+Circle(10) = {11, 12, 13};
+Circle(11) = {13, 12, 11};
+
+Line Loop(11) = {11, 10};
+
+Plane Surface(11) = {11};
+
+// -- hole
+
+Point(21) = { hx-hR,  hy, 0, lc/2};
+Point(22) = { hx,     hy, 0, lc/2};
+Point(23) = { hx+hR,  hy, 0, lc/2};
+
+Circle(20) = {21, 22, 23};
+Circle(21) = {23, 22, 21};
+
+Line Loop(21) = {21, 20};
+
+
+// -- matrix
+Plane Surface(1) = {1, 11, 21};
+
+
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("Matrix") = {1};
+Physical Surface("Inclusion") = {11};
+
+
+
+
+
diff --git a/heat/tests/basics/mat2hole.py b/heat/tests/basics/mat2hole.py
new file mode 100644
index 0000000000000000000000000000000000000000..e0e3153b6d34821308565b8c039c4f9a39590082
--- /dev/null
+++ b/heat/tests/basics/mat2hole.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+def main(**d):
+    # default params
+    p={}
+    p['iR'] = 1.0
+    p.update(d) 
+
+    msh = gmsh.MeshLoader("mat2hole.geo",__file__).execute(**p)
+    gmshWriter = tbox.GmshExport(msh)
+
+    pbl = h.Problem(msh)
+
+    pbl.add(h.Medium(msh, "Matrix", tbox.Fct2C(1e-5,1e-5,0)))
+    pbl.add(h.Medium(msh, "Inclusion", tbox.Fct2C(1e5,1e5,0)))
+    
+    pbl.add(h.Source(msh, "Inclusion", tbox.Fct0C(1e-4)))
+
+    gleft = h.Dirichlet(msh,"Left", 3.)
+    pbl.add(gleft)
+    gright = h.Dirichlet(msh,"Right",5.)
+    pbl.add(gright)
+
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+
+    # extract some results
+    x1,y1,T1 = u.getTemp(solver,"Top", sort='x')
+    
+    u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Ttop)', sum(T1) / len(T1), 6.639428, 1e-3))
+    tests.add(CTest('max(Ttop)', max(T1), 8.3445125, 1e-3))
+    tests.add(CTest('min(Ttop)', min(T1), 3.0))
+    tests.run()
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/basics/source.py b/heat/tests/basics/source.py
new file mode 100644
index 0000000000000000000000000000000000000000..65d0fe84696fbd46ebaad88ee46973c86b73afb1
--- /dev/null
+++ b/heat/tests/basics/source.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import heat.utils as u
+from fwk.testing import *
+
+if __name__ == "__main__":
+    import heat.models.rect as m
+    solver = m.main(bc='dirichletx', src=True)
+
+    x1,y1,T1 = u.getTemp(solver,"Bottom")
+    
+    u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Tbottom)', sum(T1) / len(T1), 4.791563, 1e-4))
+    tests.add(CTest('max(Tbottom)', max(T1), 5.449610, 1e-4))
+    tests.add(CTest('min(Tbottom)', min(T1), 3.0))
+    tests.run()
+    
diff --git a/heat/tests/directors/material.py b/heat/tests/directors/material.py
new file mode 100644
index 0000000000000000000000000000000000000000..a0dc3916daa4b07b031c1c5b25247774d034c75d
--- /dev/null
+++ b/heat/tests/directors/material.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# simple test where 
+# the material anisotropy depends on temperature
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+class MyMaterial(tbox.Fct2U):
+    """
+    Custom material
+    calculates the conductivity tensor
+    as a function of the local temperature
+    """
+    def __init__(self, kx, ky, theta):
+        tbox.Fct2U.__init__(self)
+        self.kx = kx
+        self.ky = ky
+        self.theta = theta
+                            
+    def eval(self, u, k, fake):
+        import numpy as np
+        import math
+        t = (self.theta) *math.pi/180.0 
+        u1 = 0. ; t1=-t
+        u2 = 10. ; t2 = t
+        
+        t = t1+(t2-t1)/(u2-u1)*(u-u1)
+        
+        kx = self.kx
+        ky = self.ky
+        
+        co = math.cos(t)
+        si = math.sin(t)
+        
+        R = np.array([[co, -si],
+                      [si, co]])
+        Kt = np.array([[kx, 0.0],
+                        [0.0, ky]])
+        Tmp = np.dot(R,Kt)
+        Kxy = np.dot(Tmp,R.T)
+         
+        k.resize(2, 2)
+        k[0,0]=Kxy[0,0]
+        k[1,1]=Kxy[1,1]
+        k[1,0]=Kxy[1,0]
+        k[0,1]=Kxy[0,1]
+        #print k
+
+def main():
+    # mesh a unit square
+    pars={ 'Lx' : 1 , 'Ly' : 1, 'Nx' : 20, 'Ny' : 10}
+    msh = gmsh.MeshLoader("../../models/rect_stru.geo",__file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    # medium/boundary conditions
+    myk = MyMaterial(1., 100., 20.)   # version python
+    #myk=h.CompiledFct2b() # compiled version (not the same fct)
+    pbl.add(h.Medium(msh, "S1", myk))
+    pbl.add(h.Dirichlet(msh,"Left", 0.))
+    pbl.add(h.Dirichlet(msh,"Right", 10.))
+
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+
+    # extract some results
+    x1,y1,T1 = u.getTemp(solver,"Top", sort='x')
+    
+    u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Ttop)', sum(T1) / len(T1), 5.0, 5e-2))
+    tests.add(CTest('max(Ttop)', max(T1), 10, 1e-3))
+    tests.add(CTest('min(Ttop)', min(T1), 0, 0.1))
+    tests.run()
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/directors/neumann.py b/heat/tests/directors/neumann.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cdd8e2a7919041cc848dd6530768ad5e2f46feb
--- /dev/null
+++ b/heat/tests/directors/neumann.py
@@ -0,0 +1,73 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# test of Neumann BCs
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+class MyFlux(tbox.Fct0XYZ):
+    def __init__(self, ampl, cx, cy, freq):
+        tbox.Fct0XYZ.__init__(self)
+        self.freq = freq
+        self.ampl = ampl
+        self.cx   = cx
+        self.cy   = cy
+    def eval(self, pt):
+        import math
+        x = pt[0]-self.cx
+        y = pt[1]-self.cy
+        return self.ampl*math.sin(math.pi*self.freq*math.sqrt(x*x+y*y)/1.)
+
+
+def main():
+    # mesh a unit square
+    pars={ 'Lx' : 1 , 'Ly' : 1, 'Nx' : 50, 'Ny' : 50}
+    msh = gmsh.MeshLoader("../../models/rect_stru.geo",__file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    # medium/boundary conditions
+    pbl.add(h.Medium(msh, "S1", tbox.Fct2C(1.0,1.0,0.0)))
+    f1 = MyFlux(100, 0, 0, 2.0)
+    f2 = MyFlux(100, 1, 1, 2.0)
+    pbl.add(h.Boundary(msh, "Left", f1))    # <== Neumann
+    pbl.add(h.Boundary(msh, "Right", f2))   # <== Neumann
+    pbl.add(h.Dirichlet(msh, "Bottom", 0.))
+    pbl.add(h.Dirichlet(msh, "Top", 0.))
+
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+
+    # extract some results
+    x1,y1,T1 = u.getTemp(solver,"Left", sort='y')
+    
+    u.simpleplot(y1, T1, xlabel='y [mm]', title='Temperature along y')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Tleft)', sum(T1) / len(T1), 0.0, 1e-6))
+    tests.add(CTest('max(Tleft)', max(T1), 15.782894, 1e-3))
+    tests.add(CTest('max+min(Tleft)', max(T1)+min(T1), 0.0, 1e-6))
+    tests.run()
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/directors/source.py b/heat/tests/directors/source.py
new file mode 100644
index 0000000000000000000000000000000000000000..83c28a92cd2c858d820485ba1c2e5a02ac95ae91
--- /dev/null
+++ b/heat/tests/directors/source.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# simple test on a square using 'heat'
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+import math
+
+class MySource(tbox.Fct0XYZ):
+    """
+    Custom heat source
+    """
+    def __init__(self, cx, cy, freq):
+        tbox.Fct0XYZ.__init__(self)
+        self.freq = freq
+        self.cx   = cx
+        self.cy   = cy
+    def eval(self, pt):
+        x = pt[0]-self.cx
+        y = pt[1]-self.cy
+        return math.sin(2*math.pi*self.freq*math.sqrt(x*x+y*y)/1.)
+
+def main():
+
+    # mesh a unit square
+    pars={ 'Lx' : 1 , 'Ly' : 1, 'Nx' : 50, 'Ny' : 50}
+    msh = gmsh.MeshLoader("../../models/rect_stru.geo",__file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    # source calculated by python using swig directors
+    pbl.add(h.Source(msh, "S1", MySource(0.2,0.3, 5.0)))
+
+    # medium/boundary conditions
+    pbl.add(h.Medium(msh, "S1", tbox.Fct2C(0.1, 0.1, 0.0)))
+    pbl.add(h.Dirichlet(msh,"Left", 0.))
+    pbl.add(h.Dirichlet(msh,"Right", 0.))
+    pbl.add(h.Dirichlet(msh,"Bottom", 0.))
+    pbl.add(h.Dirichlet(msh,"Top", 0.))
+
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+
+    # extract some results
+    x1,y1,T1 = u.getTemp(solver,"S1", sort='y')
+    
+    u.simpleplot(y1, T1, xlabel='y [mm]', title='Temperature along y')
+       
+    tests = CTests()
+    tests.add(CTest('max(T)', max(T1), 0.014730, 1e-3))
+    tests.run()
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/fe2/Lmacro.geo b/heat/tests/fe2/Lmacro.geo
new file mode 100644
index 0000000000000000000000000000000000000000..2df0b02f1b172e032f32bd26cce0ee8006b11e93
--- /dev/null
+++ b/heat/tests/fe2/Lmacro.geo
@@ -0,0 +1,37 @@
+// L
+
+lc = 3;
+
+Lx1 = 10;
+Lx2 = 20;
+
+Ly1 = 10;
+Ly2 = 20;
+
+Point(1) = { 0,       0, 0, lc};
+Point(2) = { Lx1,     0, 0, lc};
+Point(3) = { Lx1+Lx2, 0, 0, lc};
+
+Point(4) = { 0,       Ly1, 0, lc};
+Point(5) = { Lx1,     Ly1, 0, lc};
+Point(6) = { Lx1+Lx2, Ly1, 0, lc};
+
+Point(7) = { 0,       Ly1+Ly2, 0, lc};
+Point(8) = { Lx1,     Ly1+Ly2, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 6};
+Line(4) = {6, 5};
+Line(5) = {5, 8};
+Line(6) = {8, 7};
+Line(7) = {7, 4};
+Line(8) = {4, 1};
+
+Line Loop(9) = {5, 6, 7, 8, 1, 2, 3, 4};
+
+Plane Surface(10) = {9};
+
+Physical Line("Top") = {6};
+Physical Line("Right") = {3};
+Physical Surface("S1") = {10};
diff --git a/heat/tests/fe2/Lmicro.geo b/heat/tests/fe2/Lmicro.geo
new file mode 100644
index 0000000000000000000000000000000000000000..1e5af699ac1034bb4869db1f6110b4a60aa4f7e2
--- /dev/null
+++ b/heat/tests/fe2/Lmicro.geo
@@ -0,0 +1,33 @@
+// square with 2 materials
+
+lc = 5e-3;
+
+Lx1 = 5e-3;
+Lx2 = 5e-3;
+
+Ly1 = 10e-3;
+
+Point(1) = { 0,       0, 0, lc};
+Point(2) = { Lx1,     0, 0, lc};
+Point(3) = { Lx1+Lx2, 0, 0, lc};
+
+Point(4) = { 0,       Ly1, 0, lc};
+Point(5) = { Lx1,     Ly1, 0, lc};
+Point(6) = { Lx1+Lx2, Ly1, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 6};
+Line(4) = {6, 5};
+Line(5) = {5, 4};
+Line(6) = {4, 1};
+Line(7) = {2, 5};
+
+Line Loop(8) = {5, 6, 1, 7};
+Plane Surface(9) = {8};
+
+Line Loop(10) = {4, -7, 2, 3};
+Plane Surface(11) = {10};
+
+Physical Surface("S1") = {9};
+Physical Surface("S2") = {11};
diff --git a/heat/tests/fe2/Lmpi.py b/heat/tests/fe2/Lmpi.py
new file mode 100644
index 0000000000000000000000000000000000000000..cd8ce77f87d656b244f13f3bff396ce159b58a92
--- /dev/null
+++ b/heat/tests/fe2/Lmpi.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# test multiscale - version "task pull"
+# exc:
+# mpiexec.openmpi --bycore --bind-to-core -n 6 ./run.py heat/tests/fe2/heat_mpi.py
+
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from tbox.solvers import LinearSolver
+import heat.fe2 as fe2
+from fwk.testing import *
+
+class Micro:
+    def __init__(self):
+        self.msh = gmsh.MeshLoader("Lmicro.geo", __file__).execute()
+        self.gmshWriter = tbox.GmshExport(self.msh)
+        self.pbl = h.Problem(self.msh)
+
+        self.pbl.add(h.Medium(self.msh, "S1",    tbox.Fct2C(1.,1.,0), 1.0))
+        self.pbl.add(h.Medium(self.msh, "S2", tbox.Fct2C(5.,5.,0), 1.0))
+        self.p = h.Periodic(self.pbl, 0.0, 0.0, 0.0)
+        self.pbl.add(self.p)
+        
+        self.solver = h.Solver(self.pbl, LinearSolver().pardiso())
+        self.solver.nthreads = 1
+        self.solver.save = False
+        self.solver.verbose = 0
+             
+class Macro:
+    def __init__(self, law):
+        self.msh = gmsh.MeshLoader("Lmacro.geo", __file__).execute()
+        self.gmshWriter = tbox.GmshExport(self.msh)
+        self.pbl = h.Problem(self.msh)
+
+        self.pbl.add(h.Medium(self.msh, "S1", law))
+        self.pbl.add(h.Dirichlet(self.msh,"Top", 0.))
+        self.pbl.add(h.Dirichlet(self.msh,"Right", 10.))
+
+        self.solver = h.Solver(self.pbl, LinearSolver().pardiso())
+        self.solver.nthreads = 1
+        self.solver.restol = 1e-10 
+        self.solver.itmax = 1000 
+
+if __name__ == "__main__":
+
+    # le gmsh ne doit pas etre fait par toutes les machines
+    if fe2.rank==0:
+        micro = Micro()
+    fe2.barrier() # ok uniqut sur 1node
+
+    if fe2.rank==0:
+        law = fe2.FE2(micro)
+        macro = Macro(law)
+        master = fe2.Master(macro)
+        master.start()
+    else:
+        micro = Micro()
+        worker = fe2.Worker(micro)
+        worker.start()
+
+#    if fe2.rank==0:
+#        x1,y1,T1 = u.getTemp(macro.solver,"Bottom", sort='x')
+#        
+#        u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+#           
+#        tests = CTests()
+#        tests.add(CTest('mean(Tleft)', sum(T1)/len(T1), 4.683412, 1e-6))
+#        tests.add(CTest('max(Tleft)', max(T1), 10.0))
+#        tests.add(CTest('min(Tleft)', min(T1), 0.0))
+#        tests.run()
+   
+
+
diff --git a/heat/tests/fe2/heat_mpi.py b/heat/tests/fe2/heat_mpi.py
new file mode 100644
index 0000000000000000000000000000000000000000..7b2dc0371ca4a8becb2349d0d405c36df2904986
--- /dev/null
+++ b/heat/tests/fe2/heat_mpi.py
@@ -0,0 +1,94 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# test multiscale - version "task pull"
+# linux:
+#   mpiexec.openmpi --bycore --bind-to-core -n 6 ./run.py heat/tests/fe2/heat_mpi.py
+# windows (msmpi):
+#   mpiexec -n 6 python run.py heat\tests\fe2\heat_mpi.py
+
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from tbox.solvers import LinearSolver
+import heat.fe2 as fe2
+from fwk.testing import *
+
+class Micro:
+    def __init__(self):
+        self.msh = gmsh.MeshLoader("micro.geo", __file__).execute()
+        self.gmshWriter = tbox.GmshExport(self.msh)
+        self.pbl = h.Problem(self.msh)
+
+        self.pbl.add(h.Medium(self.msh, "Matrix",    tbox.Fct2C(1.,1.,0), 1.0))
+        self.pbl.add(h.Medium(self.msh, "Inclusion", tbox.Fct2C(100.,100.,0), 1.0))
+        self.p = h.Periodic(self.pbl, 0.0, 0.0, 0.0)
+        self.pbl.add(self.p)
+        
+        self.solver = h.Solver(self.pbl, LinearSolver().pardiso())
+        self.solver.nthreads = 1
+        self.solver.save = False
+        self.solver.verbose = 0
+             
+class Macro:
+    def __init__(self, law):
+        self.msh = gmsh.MeshLoader("macro.geo", __file__).execute()
+        self.gmshWriter = tbox.GmshExport(self.msh)
+        self.pbl = h.Problem(self.msh)
+
+        self.pbl.add(h.Medium(self.msh, "S1", law))
+        self.pbl.add(h.Dirichlet(self.msh,"Left", 0.))
+        self.pbl.add(h.Dirichlet(self.msh,"Right", 10.))
+
+        self.solver = h.Solver(self.pbl, LinearSolver().pardiso())
+        self.solver.nthreads = 1
+        self.solver.restol = 1e-6  
+
+if __name__ == "__main__":
+
+    # le gmsh ne doit pas etre fait par toutes les machines
+    if fe2.rank==0:
+        micro = Micro()
+    fe2.barrier() # ok uniqut sur 1node
+
+    if fe2.rank==0:
+        law = fe2.FE2(micro)
+        macro = Macro(law)
+        master = fe2.Master(macro)
+        master.start()
+    else:
+        micro = Micro()
+        worker = fe2.Worker(micro)
+        worker.start()
+
+    if fe2.rank==0:
+        # extract some results
+        x1,y1,T1 = u.getTemp(macro.solver,"Bottom", sort='x')
+        
+        u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+           
+        tests = CTests()
+        tests.add(CTest('mean(Tleft)', sum(T1) / len(T1), 4.683412, 2e-5))
+        tests.add(CTest('max(Tleft)', max(T1), 10.0))
+        tests.add(CTest('min(Tleft)', min(T1), 0.0))
+        tests.run()
+   
+
+
diff --git a/heat/tests/fe2/heat_mpi.sge.sh b/heat/tests/fe2/heat_mpi.sge.sh
new file mode 100644
index 0000000000000000000000000000000000000000..d850c8302ce96ee713705e891c16712571835ddd
--- /dev/null
+++ b/heat/tests/fe2/heat_mpi.sge.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# Your job name
+#$ -N heat_mpi 
+#
+# Use current working directory
+#$ -cwd
+#
+# Join stdout and stderr
+#$ -j y
+#
+# pe (Parallel environment) request. Set your number of processors here.
+#$ -pe openmpi 12 
+#
+# Run job through bash shell
+#$ -S /bin/bash
+#
+# Mail notifications
+#$ -m beas
+#$ -M boman
+#
+# Use this queue
+#$ -q lomem.q
+## If modules are needed, source modules environment:
+#. /etc/profile.d/modules.sh
+# Add any modules you might require:
+#module add shared sge openmpi/gcc abaqus
+
+. ~/.bash_profile $SGE_O_HOST 
+
+echo "Got $NSLOTS processors."
+
+module list
+mpirun python ./run.py --nogui heat/tests/fe2/heat_mpi.py 
+
diff --git a/heat/tests/fe2/heat_mpi.slurm.sh b/heat/tests/fe2/heat_mpi.slurm.sh
new file mode 100644
index 0000000000000000000000000000000000000000..d1a5391eee3e0750b9cd2088252f5d9dc05bee23
--- /dev/null
+++ b/heat/tests/fe2/heat_mpi.slurm.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Submission script for NIC4 
+#SBATCH --job-name=heat_mpi
+#SBATCH --time=00:40:00 # hh:mm:ss
+#
+#SBATCH --ntasks=4 
+#SBATCH --mem-per-cpu=400 # megabytes 
+#SBATCH --partition=defq 
+#
+#SBATCH --mail-user=rboman
+#SBATCH --mail-type=ALL
+#
+#SBATCH --comment=math0471
+#SBATCH --output=heat_mpi.%j.out
+
+. ~/.bash_profile $SLURM_SUBMIT_HOST 
+
+env | egrep ^SLURM
+module list
+mpirun --version
+
+
+mpirun python-mpi heat_mpi.py
+#mpirun -v --bind-to none --tag-output --report-bindings -d --display-allocation  python-mpi heat_mpi.py 
+
diff --git a/heat/tests/fe2/macro.geo b/heat/tests/fe2/macro.geo
new file mode 100644
index 0000000000000000000000000000000000000000..904403fb24edbca9a96fbc64c32c278f8e6b19b2
--- /dev/null
+++ b/heat/tests/fe2/macro.geo
@@ -0,0 +1,50 @@
+// simple regularly-meshed square
+
+lc = 2;
+
+Lx = 10;
+Ly = 10;
+
+Nx=3;
+Ny=3;
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+Plane Surface(1) = {1};
+
+/*
+// regular mesh
+Transfinite Line {1, 3} = Nx Using Progression 1;
+Transfinite Line {4, 2} = Ny Using Progression 1;
+Transfinite Surface {1};
+*/
+
+
+//Recombine Surface {1}; // for quads
+
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("S1") = {1};
+
+Mesh.Algorithm = 5; // gmsh 4.5 change the default algo from Delaunay(5) to FrontalDelaunay (6). Force Delaunay for non regression tests
\ No newline at end of file
diff --git a/heat/tests/fe2/micro.geo b/heat/tests/fe2/micro.geo
new file mode 100644
index 0000000000000000000000000000000000000000..0555c5878c8a385592c5e8373a56d93d10895c96
--- /dev/null
+++ b/heat/tests/fe2/micro.geo
@@ -0,0 +1,63 @@
+// RVE
+
+Lx = 1.0e-3;
+Ly = Lx;
+
+lc = Lx/10;
+
+ix = Lx/2;
+iy = Ly/2;
+iLx = 2*Lx/3;
+iLy = 2*Lx/3;
+
+// -- outer boundary
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+// -- inclusion
+
+Point(11) = { ix-iLx/2,   iy-iLy/2, 0, lc};
+Point(12) = { ix+iLx/2,   iy-iLy/2, 0, lc};
+Point(13) = { ix+iLx/2,   iy+iLy/2, 0, lc};
+Point(14) = { ix-iLx/2,   iy+iLy/2, 0, lc};
+
+Line(11) = {11, 12};
+Line(12) = {12, 13};
+Line(13) = {13, 11};
+//Line(14) = {14, 11};
+
+Line Loop(11) = {11, 12, 13};//, 14};
+
+Plane Surface(11) = {11};
+
+// -- matrix
+
+Plane Surface(1) = {1, 11};
+
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("Matrix") = {1};
+Physical Surface("Inclusion") = {11};
+
+Mesh.Algorithm = 5; // gmsh 4.5 change the default algo from Delaunay(5) to FrontalDelaunay (6). Force Delaunay for non regression tests
+
+
diff --git a/heat/tests/fe2/micro.py b/heat/tests/fe2/micro.py
new file mode 100644
index 0000000000000000000000000000000000000000..7ec064a18161b1998468ff8fcbbf9ee19acf9375
--- /dev/null
+++ b/heat/tests/fe2/micro.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# check the micro problem
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+def main(TM, dTxM, dTyM):
+    msh = gmsh.MeshLoader("micro.geo", __file__).execute()
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    pbl.add(h.Medium(msh, "Matrix",    tbox.Fct2C(1.,1.,0), 1.0))
+    pbl.add(h.Medium(msh, "Inclusion", tbox.Fct2C(100.,100.,0), 1.0))
+    p = h.Periodic(pbl, TM, dTxM, dTyM)
+    pbl.add(p) 
+      
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)   
+      
+    # extract some results            
+    tests = CTests()
+    tests.add(CTest('mean flux X', p.qM[0], -2.278200, 1e-4))
+    tests.add(CTest('mean flux Y', p.qM[1], -2.278258, 1e-4))
+    tests.run()
+
+if __name__ == "__main__":
+    TM   = 1.0
+    dTxM = 1.0
+    dTyM = 1.0
+    main(TM, dTxM, dTyM)
diff --git a/heat/tests/nonlinear/mat2.geo b/heat/tests/nonlinear/mat2.geo
new file mode 100644
index 0000000000000000000000000000000000000000..0c0b3a28c98d706ae7015297ed6fed9ec25018e4
--- /dev/null
+++ b/heat/tests/nonlinear/mat2.geo
@@ -0,0 +1,72 @@
+// 2 materials and a hole
+
+lc = 0.5;
+Lx = 50;
+Ly = 10;
+
+
+ix = 8;
+iy = 6;
+DefineConstant[ iR = { 3.0, Min 0.5, Max 1.5, Step 0.1, Name "Lengths/iR" }  ];
+
+hx = Lx-8;
+hy = Ly-6;
+DefineConstant[ hR = { 3.0, Min 0.5, Max 1.5, Step 0.1, Name "Lengths/hR" }  ];
+
+
+// -- outer boundary
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(1) = {1, 2, 3, 4};
+
+
+// -- inclusion #1
+Point(11) = { ix-iR,  iy, 0, lc};
+Point(12) = { ix,     iy, 0, lc};
+Point(13) = { ix+iR,  iy, 0, lc};
+
+Circle(10) = {11, 12, 13};
+Circle(11) = {13, 12, 11};
+
+Line Loop(11) = {11, 10};
+Plane Surface(11) = {11};
+
+// -- inclusion #2
+
+Point(21) = { hx-hR,  hy, 0, lc};
+Point(22) = { hx,     hy, 0, lc};
+Point(23) = { hx+hR,  hy, 0, lc};
+
+Circle(20) = {21, 22, 23};
+Circle(21) = {23, 22, 21};
+
+Line Loop(21) = {21, 20};
+Plane Surface(21) = {21};
+
+// -- matrix
+Plane Surface(1) = {1, 11, 21};
+
+Physical Point("P1") = {1};
+Physical Point("P2") = {2};
+Physical Point("P3") = {3};
+Physical Point("P4") = {4};
+
+Physical Line("Bottom") = {1};
+Physical Line("Right") = {2};
+Physical Line("Top") = {3};
+Physical Line("Left") = {4};
+
+Physical Surface("Matrix") = {1};
+Physical Surface("Inclusion") = {11, 21};
+
+
diff --git a/heat/tests/nonlinear/mat2vark.py b/heat/tests/nonlinear/mat2vark.py
new file mode 100644
index 0000000000000000000000000000000000000000..396dc9941bf4179243acbf7ea5ba53455d7c802b
--- /dev/null
+++ b/heat/tests/nonlinear/mat2vark.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+def main(**d):
+
+    # default params
+    msh = gmsh.MeshLoader("mat2.geo",__file__).execute()
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    fa=tbox.PwLf()
+    fa.add(0, 100)
+    fa.add(150, 100)
+    fa.add(300, 100)
+
+    fb=tbox.PwLf()
+    fb.add(0,   10)
+    fb.add(130, 10)
+    fb.add(170, 1000)
+    fb.add(300, 1000)
+
+    fz = tbox.PwLf()
+    fz.add(0,0)
+
+    pbl.add(h.Medium(msh, "Matrix", tbox.Fct2PwLf(fa,fa,fz)))
+    pbl.add(h.Medium(msh, "Inclusion", tbox.Fct2PwLf(fb,fb,fz)))
+    
+    pbl.add(h.Dirichlet(msh, "Left", 0.))
+    pbl.add(h.Dirichlet(msh, "Right", 300.))
+    
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+    
+    # extract some results
+    x1,y1,T1 = u.getTemp(solver,"Top", sort='x')
+    
+    u.simpleplot(x1, T1, xlabel='x [mm]', title='Temperature along x')
+       
+    tests = CTests()
+    tests.add(CTest('mean(Ttop)', sum(T1) / len(T1), 169, 1., forceabs=True))
+    tests.add(CTest('max(Ttop)', max(T1), 300))
+    tests.add(CTest('min(Ttop)', min(T1), 0., refval=300))
+    tests.run()
+    
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/periodic/honeycomb.py b/heat/tests/periodic/honeycomb.py
new file mode 100644
index 0000000000000000000000000000000000000000..3a868c1940668f13cf4fc7fbf409a04bfbbdd7b2
--- /dev/null
+++ b/heat/tests/periodic/honeycomb.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# test periodic BCs on a honeycomb structure
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+from fwk.testing import *
+
+class MyMaterial(tbox.Fct2U):
+    def __init__(self):
+        tbox.Fct2U.__init__(self)
+    def eval(self, u, k, fake):
+        t1 = -5.
+        t2 = 45.
+        k1 = 1.
+        k2 = 100.
+        k.resize(2, 2)
+        k[0,0] = k[1,1] = k1+(k2-k1)/(t2-t1)*(u-t1)
+        k[0,1] = k[1,0] = 0.
+        #k[0,0] = k[1,1] = k1 # simple case
+        #print "returning k=%f" %k
+        return k
+
+def main():
+    # mesh a unit square
+    pars={ 'h' : 10. , 'k' : 1., 'lc' : 1. / 3.}
+    msh = gmsh.MeshLoader("../../models/honeycomb.geo",__file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    pbl.add(h.Medium(msh, "Hexagon", tbox.Fct2C(10,10,0), 1.0))
+    f = MyMaterial()
+    pbl.add(h.Medium(msh, "Borders", f, 1.0))
+
+    TM   = 20.
+    dTxM = 1.
+    dTyM = 1.
+    p = h.Periodic(pbl, TM, dTxM, dTyM)
+    pbl.add(p)
+    
+    # solve problem
+    solver = u.solve(pbl, gmshWriter) 
+
+    # extract some results            
+    tests = CTests()
+    tests.add(CTest('mean flux X', p.qM[0], -12.6239, 1e-4))
+    tests.add(CTest('mean flux Y', p.qM[1], -12.4904, 1e-4))
+    tests.run()
+
+
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/periodic/lincomb.py b/heat/tests/periodic/lincomb.py
new file mode 100644
index 0000000000000000000000000000000000000000..d5cbf01d13562932392fdf66c69f633253dd2a23
--- /dev/null
+++ b/heat/tests/periodic/lincomb.py
@@ -0,0 +1,137 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# calculate the conductivity matrix of a particular problem
+# from the linear combination of 2 calculations (2 perpendicular gradients)
+# then, checks if the resulting flux is the same as a direct calculation
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+import fwk
+from fwk.testing import *
+
+class MyMaterial(tbox.Fct2XYZ):
+    """
+    the considered conductivity is a function of the position (x,y)
+    """
+    def __init__(self, k1, k2):
+        tbox.Fct2XYZ.__init__(self)
+        self.k1 = k1
+        self.k2 = k2
+    def eval(self, pt, k, fake):
+        x = pt[0]
+        y = pt[1]
+        L = 1.
+        import math
+        v = (self.k1+self.k2)/2 + abs(self.k2-self.k1)/2*math.sin(2*math.pi/L*4*(x+y/2))
+        k.resize(2, 2)
+        k[0,0] = k[1,1] = v
+        k[0,1] = k[1,0] = 0.
+        #k[0,0] = self.k1  # constant
+        #k[1,1] = self.k2
+
+
+def solve(TM, dTxM, dTyM):
+    """
+    solve one FE problem (for given mean values of T and gradT)
+    """
+    pars={ 'Lx' : 1 , 'Ly' : 1, 'Nx' : 20, 'Ny' : 20}
+    msh = gmsh.MeshLoader("../../models/rect_stru.geo",__file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)    
+
+    myk = MyMaterial(1.,1000.)
+    pbl.add(h.Medium(msh, "S1", myk))
+
+    p = h.Periodic(pbl, TM, dTxM, dTyM)
+    pbl.add(p)
+    
+    # solve problem
+    solver = u.solve(pbl, gmshWriter)
+
+    q1i = p.qM[0]
+    q2i = p.qM[1]
+
+    return (q1i, q2i)
+
+
+def main():
+
+    chrono = fwk.Timer(); chrono.start()
+
+    # ------------- main problem ----------------------
+    # -------------------------------------------------
+
+    TM0   = 0.0
+    dTxM0 = 0.3
+    dTyM0 = 0.2
+ 
+    q1i,q2i = solve(TM0, dTxM0, dTyM0)
+    print("flux along x dir = ", q1i)
+    print("flux along y dir = ", q2i)
+
+        
+    # ------------- linear combination ----------------
+    # -------------------------------------------------
+
+    TM   = TM0
+    dTxM = 1.0   # <= gradX =1
+    dTyM = 0.0
+    
+    K11,K21 = solve(TM, dTxM, dTyM)
+    print("flux along x dir = ", K11)
+    print("flux along y dir = ", K21)    
+    
+    # -------------------------------------------------
+
+    TM   = TM0
+    dTxM = 0.0
+    dTyM = 1.0   # <= gradY =1
+
+    K12,K22 = solve(TM, dTxM, dTyM)
+    print("flux along x dir = ", K12)
+    print("flux along y dir = ", K22)
+
+    # -------------------------------------------------
+    # try to calculate the first flux 
+    # with the computed sensitivity matrix
+    # -------------------------------------------------
+
+    q1 = K11*dTxM0 + K12*dTyM0
+    q2 = K21*dTxM0 + K22*dTyM0
+
+    print()
+    print("K=[[", K11, ",", K12,"]")
+    print("   [", K21, ",", K22,"]]\n")
+    
+    print("q  (linear combination) =",q1,q2)
+    print("qi (direct calculation) =",q1i,q2i)
+    print(chrono)
+    
+    tests = CTests()
+    tests.add(CTest('q-qi (x)', abs(q1-q1i), 0.0, 1e-6))
+    tests.add(CTest('q-qi (y)', abs(q2-q2i), 0.0, 1e-6))
+    tests.run()
+
+
+
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/tests/periodic/lincomb_fast.py b/heat/tests/periodic/lincomb_fast.py
new file mode 100644
index 0000000000000000000000000000000000000000..c1b9677b3c1dfa91f43cce814f2410f68bf85f61
--- /dev/null
+++ b/heat/tests/periodic/lincomb_fast.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A NETTOYER
+
+import heat as h
+import heat.utils as u
+import tbox
+import tbox.gmsh as gmsh
+import fwk
+from fwk.testing import *
+
+class MyF(tbox.Fct2XYZ):
+    def __init__(self, k1, k2):
+        tbox.Fct2XYZ.__init__(self)
+        self.k1 = k1
+        self.k2 = k2
+        
+    def eval(self, pt, k, fake):
+        x = pt[0]
+        y = pt[1]
+        L = 1.
+        import math
+        v = (self.k1+self.k2) / 2 + abs(self.k2-self.k1)/2*math.sin(2*math.pi/L*4*(x+y/2))
+        k.resize(2, 2)
+        k[0,0] = k[1,1] = v;
+        """
+        return (self.k1+self.k2)/2+ abs(self.k2-self.k1)/2*math.sin(2*math.pi/L*4*x)*math.sin(2*math.pi/L*4*y)
+
+        if ((int(x/L*10))%2) ^ ((int(y/L*10))%2) ==1:
+            return self.k1
+        else:
+            return self.k2
+        """
+
+def main():
+
+    chrono = fwk.Timer(); chrono.start()
+    from fwk.wutils import parseargs
+    args=parseargs()
+
+    # main problem
+    msh = gmsh.MeshLoader("../../models/rect.geo", __file__).execute()
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = h.Problem(msh)
+
+    myk = h.CompiledFct1b(1., 1000.)
+    pbl.add(h.Medium(msh, "S1", myk))
+
+    TM   = 0.0
+    dTxM = 0.3
+    dTyM = 0.2
+    p = h.Periodic(pbl, TM, dTxM, dTyM)
+    pbl.add(p)
+    
+    solver = u.solve(pbl, gmshWriter)
+
+    q1i = p.qM[0]
+    q2i = p.qM[1]        
+    
+    # sensitivity
+
+    p.reset(TM, 1.0, 0.0)
+    solver.start(gmshWriter)
+    K11 = p.qM[0]
+    K21 = p.qM[1]
+    if not args.nogui:     
+        from heat.viewer import GUI
+        GUI().open(pbl.msh.name)
+        
+    p.reset(TM, 0.0, 1.0)
+    solver.start(gmshWriter)
+    K12 = p.qM[0]
+    K22 = p.qM[1]
+    if not args.nogui:  
+        from heat.viewer import GUI
+        GUI().open(pbl.msh.name)
+        
+    # try to calculate the first flux with the computed sensitivity matrix
+
+    q1 = K11*dTxM+K12*dTyM
+    q2 = K21*dTxM+K22*dTyM
+    print()
+    print("K=[[", -K11, ",", -K12,"]")
+    print("   [", -K21, ",", -K22,"]]")
+    print("q  =", q1, q2)
+    print("qi =", q1i, q2i)
+    print()
+    chrono.stop()
+    print(chrono)
+
+    tests = CTests()
+    tests.add(CTest('q-qi (x)', abs(q1-q1i), 0.0, 1e-6))
+    tests.add(CTest('q-qi (y)', abs(q2-q2i), 0.0, 1e-6))
+    tests.run()
+    
+
+if __name__ == "__main__":
+    main()
diff --git a/heat/utils.py b/heat/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..29987fe36568022fe7b20dc7b6b30b198d1fa45d
--- /dev/null
+++ b/heat/utils.py
@@ -0,0 +1,77 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import tbox
+import heat as h
+
+def solve(pbl, writer):
+
+    from fwk.wutils import parseargs
+    args = parseargs()
+    
+    from tbox.solvers import LinearSolver
+    solver = h.Solver(pbl, LinearSolver().pardiso())
+    solver.nthreads = args.k
+    solver.restol = 1e-6
+    solver.start(writer)
+
+    if not args.nogui:
+        from heat.viewer import GUI
+        GUI().open( pbl.msh.name ) 
+           
+    return solver
+
+def getTemp(solver, linelabel="Bottom", sort='x'):
+    """
+    extract x,y,T on a line & return 3 numpy arrays
+    """     
+    nodes_bot = tbox.Group(solver.pbl.msh, linelabel)
+    extr = h.Extractor(solver, nodes_bot)
+
+    import numpy as np
+    v = np.array(extr.execute())
+    
+    nos = np.zeros_like(v, dtype=np.int)
+    nxs = np.zeros_like(v)
+    nys = np.zeros_like(v)
+    for i in range(len(v)):
+        n = extr.nodes[i]
+        nos[i] = n.no
+        nxs[i] = n.pos[0]
+        nys[i] = n.pos[1]
+    if sort=='x':  
+        iis = np.argsort(nxs)
+    else:
+        iis = np.argsort(nys)
+    return (nxs[iis], nys[iis], v[iis])
+
+
+def simpleplot(x, y, xlabel='x',title=''):
+
+    # plot results using matplotlib
+    from fwk.wutils import parseargs
+    args = parseargs()
+    if not args.nogui:
+        import matplotlib.pyplot as plt
+        plt.plot(x, y, 'bo-',lw=2)   
+        plt.xlabel(xlabel)
+        #plt.ylim(0,150)
+        plt.title(title)
+        plt.grid(True)
+        plt.show()
+
+    
diff --git a/heat/viewer.py b/heat/viewer.py
new file mode 100644
index 0000000000000000000000000000000000000000..c6b48f4b566b2b0beb0a8a1e68cb9568162b5b6c
--- /dev/null
+++ b/heat/viewer.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import os, os.path
+
+class GUI:
+    def __init__(self):
+        pass
+    def open(self,prefix):
+        mshfile = prefix+".msh"
+        if not os.path.isfile(mshfile):
+            raise Exception("file not found %s" % mshfile)
+        posfile = prefix+".pos"
+        if not os.path.isfile(posfile):
+            raise Exception("file not found %s" % posfile)
+        optfile = prefix+".opt"
+        if not os.path.isfile(optfile):
+            self.defopt(optfile)
+        cmd="gmsh %s %s %s" % (mshfile, posfile, optfile)
+        os.system(cmd)        
+
+    def defopt(self,fname='heat.opt'):
+        f = open(fname,'w')
+        f.write("General.Orthographic = 0;\n")
+        f.write("View[0].Visible = 1;\n")
+        f.write("View[0].IntervalsType = 3;  // filled iso\n")
+        for i in range(1,10):
+            f.write("View[%d].Visible = 0;\n" % i)
+        f.write("View[8].TensorType = 4;\n")
+        f.write("View[8].VectorType = 1;\n")
+        f.write("View[8].ArrowSizeMax = 20;\n")
+        f.write("//View[8].ExternalView = 8;\n")
+        f.close()
+    
diff --git a/run.py b/run.py
new file mode 100644
index 0000000000000000000000000000000000000000..e2ca260b01b589c1efcd3c7b7b233f166cae5f6e
--- /dev/null
+++ b/run.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+# -*- coding: utf8 -*-
+# test encoding: à-é-è-ô-ï-€
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Calls fwk.wutils.run to execute a script as if waves was installed
+
+def main():
+    import os.path, sys
+    # adds fwk/tbox to the python path
+    thisdir = os.path.split(os.path.abspath(__file__))[0]
+    fwkdir = os.path.abspath(os.path.join(thisdir, 'ext', 'amfe'))
+    if not os.path.isdir(fwkdir):
+        raise Exception('waves/ext/amfe not found!\n')
+    sys.path.append(fwkdir)
+    # adds "." to the pythonpath
+    sys.path.append(thisdir)
+
+    import fwk.wutils as wu
+    wu.run()
+
+if __name__ == "__main__":
+    main()
diff --git a/waves/CMakeFiles/CMakeDirectoryInformation.cmake b/waves/CMakeFiles/CMakeDirectoryInformation.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..a5519e03c8316b894b76578cafe5748de586b69d
--- /dev/null
+++ b/waves/CMakeFiles/CMakeDirectoryInformation.cmake
@@ -0,0 +1,16 @@
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 3.6
+
+# Relative path conversion top directories.
+set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/kliegeois/dev/waves")
+set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/kliegeois/dev/waves")
+
+# Force unix paths in dependencies.
+set(CMAKE_FORCE_UNIX_PATHS 1)
+
+
+# The C and CXX include file regular expressions for this directory.
+set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
+set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
+set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
+set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
diff --git a/waves/CMakeFiles/progress.marks b/waves/CMakeFiles/progress.marks
new file mode 100644
index 0000000000000000000000000000000000000000..04f9fe46068b397a6fc24d647b7e3ec4315c15e7
--- /dev/null
+++ b/waves/CMakeFiles/progress.marks
@@ -0,0 +1 @@
+59
diff --git a/waves/CMakeLists.txt b/waves/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3f0452be22f1dc9925ec99de097b0a36e36b7643
--- /dev/null
+++ b/waves/CMakeLists.txt
@@ -0,0 +1,33 @@
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Add source dir
+ADD_SUBDIRECTORY( exe )
+ADD_SUBDIRECTORY( src )
+ADD_SUBDIRECTORY( _src )
+
+# Add test dir
+MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests)
+
+# Add to install
+INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/__init__.py
+        ${CMAKE_CURRENT_LIST_DIR}/srcs.py
+        ${CMAKE_CURRENT_LIST_DIR}/utils.py
+        ${CMAKE_CURRENT_LIST_DIR}/viewer.py
+        DESTINATION waves)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/tests
+                  ${CMAKE_CURRENT_LIST_DIR}/models
+        DESTINATION waves)
+        
\ No newline at end of file
diff --git a/waves/__init__.py b/waves/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed6b0561f32499a905b787ca1626b68100a318ae
--- /dev/null
+++ b/waves/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# waves MODULE initialization file
+
+import fwk
+import tbox
+from wavesw import *
diff --git a/waves/_src/CMakeLists.txt b/waves/_src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0b3b66d98f4598c69e061074568cf48da44e3c2e
--- /dev/null
+++ b/waves/_src/CMakeLists.txt
@@ -0,0 +1,52 @@
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# CMake input file of the SWIG wrapper around "waves.so"
+
+INCLUDE(${SWIG_USE_FILE})
+
+FILE(GLOB SRCS *.h *.cpp *.inl *.swg)
+FILE(GLOB ISRCS *.i)
+
+SET(CMAKE_SWIG_FLAGS "")
+SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON)
+
+SET(SWINCFLAGS 
+-I${PROJECT_SOURCE_DIR}/waves/src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
+-I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src
+)
+SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES SWIG_FLAGS "${SWINCFLAGS}")
+
+if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
+    SWIG_ADD_MODULE(wavesw python ${ISRCS} ${SRCS})
+else()
+    SWIG_ADD_LIBRARY(wavesw LANGUAGE python SOURCES ${ISRCS} ${SRCS})
+endif()
+MACRO_DebugPostfix(_wavesw)
+
+TARGET_INCLUDE_DIRECTORIES(_wavesw PRIVATE ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src
+                                           ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src
+                                           ${PYTHON_INCLUDE_PATH}
+)
+
+SWIG_LINK_LIBRARIES(wavesw 
+                    waves tbox fwk ${PYTHON_LIBRARIES}
+)
+
+INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/wavesw.py DESTINATION ${CMAKE_INSTALL_PREFIX})
+INSTALL(TARGETS _wavesw DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/waves/_src/wavesw.i b/waves/_src/wavesw.i
new file mode 100644
index 0000000000000000000000000000000000000000..1f48fc0b409ca325a65083d72ecd75cc1df5724a
--- /dev/null
+++ b/waves/_src/wavesw.i
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// SWIG input file of the 'waves' module
+
+%feature("autodoc","1");
+
+%module(docstring=
+"'wavesw' module: projet MP 2014
+(c) ULg - A&M",
+directors="1",
+threads="1"
+) wavesw
+%{
+
+#include <string>
+#include <sstream>
+#include "waves.h"
+
+#include "fwkw.h"
+#include "tboxw.h"
+
+#include "wForwardEuler.h"
+#include "wRungeKutta.h"
+#include "wTimeIntegration.h"
+#include "wProblem.h"
+#include "wNewmark.h"
+#include "wSource.h"
+#include "wMedium.h"
+#include "wBoundary.h"
+
+#include "wDisplayHook.h"
+
+%}
+
+%include "fwkw.swg"
+
+// ----------- MODULES UTILISES ------------
+%import "fwkw.i"
+%import "tboxw.i"
+
+// ----------- WAVES CLASSES ---------------
+%include "waves.h"
+
+%shared_ptr(waves::Problem);
+%shared_ptr(waves::Source);
+%shared_ptr(waves::Medium);
+%shared_ptr(waves::Boundary);
+
+
+%feature("director") DisplayHook;
+%include "wDisplayHook.h"
+
+%feature("director:except") {
+    if ($error != NULL) {
+        std::cout << "[in director:except]\n";
+        //throw Swig::DirectorMethodException();
+        throw std::runtime_error("Director problem");
+    }
+}
+
+%feature("director") waves::Source;
+%pythonappend waves::Source::Source "self.__disown__()"    // for directors
+%include "wSource.h"
+
+%include "wMedium.h"
+%include "wBoundary.h"
+
+%immutable waves::Problem::msh; // avoids the creation of the setter method
+%include "wProblem.h"
+
+%include "wTimeIntegration.h"
+%include "wForwardEuler.h"
+%include "wRungeKutta.h"
+%include "wNewmark.h"
+
diff --git a/waves/attic/export_xml.py b/waves/attic/export_xml.py
new file mode 100644
index 0000000000000000000000000000000000000000..afbf596d7cc76869346e40f6f959cb9b98f2fb7a
--- /dev/null
+++ b/waves/attic/export_xml.py
@@ -0,0 +1,6 @@
+# display
+if 0:
+    import viewer
+    ugrid = viewer.toUgrid(mshdata)
+    viewer.writeXML(ugrid, name='mesh.vtu')
+    viewer.viewUgrid(ugrid)
\ No newline at end of file
diff --git a/waves/attic/testSonarQ.cpp b/waves/attic/testSonarQ.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f0322e0fa77e5b6dc546422fd4556b3652dabbd2
--- /dev/null
+++ b/waves/attic/testSonarQ.cpp
@@ -0,0 +1,22 @@
+#include <iostream>
+
+void mem_leak()
+{
+    double *f = new double;
+    *f = 10;
+}
+
+void not_init1()
+{
+    double a;
+    std::cout << a << '\n';
+}
+
+void not_init2()
+{
+    int i = 0;
+    double a;
+    if (i == 1)
+        a = 1;
+    std::cout << a << '\n';
+}
diff --git a/waves/attic/wDof.cpp b/waves/attic/wDof.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ca36db06d14f1bed56ee32e4d14a433ffe364afb
--- /dev/null
+++ b/waves/attic/wDof.cpp
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "wDof.h"
diff --git a/waves/attic/wDof.h b/waves/attic/wDof.h
new file mode 100644
index 0000000000000000000000000000000000000000..11a552d81f373bab672c6dde5a50eabc798d1616
--- /dev/null
+++ b/waves/attic/wDof.h
@@ -0,0 +1,43 @@
+// $Id$
+
+#ifndef WDOF_H
+#define WDOF_H
+
+#include "waves.h"
+#include "wObject.h"
+#include <vector>
+#include <string>
+
+class Node;
+class Field;
+
+/**
+ * @brief definition of an unknown
+ */
+
+class WAVES_API Dof : public wObject
+{
+public:
+    Node &node;
+    Field &f;
+
+    Dof(Node &_node, Field &_f) : wObject(), node(_node), f(_f) {}
+};
+
+/**
+ * @brief list of fields
+ */
+
+class WAVES_API Dofs : public wObject
+{
+public:
+    std::vector<Dof *> dofs;
+
+    Dofs() : wObject(), dofs(0) {}
+    //~Dofs();
+    //void add(Dof &dof);
+    size_t size() const { return dofs.size(); }
+    //virtual void write(std::ostream &out) const;
+};
+
+#endif //WDOF_H
diff --git a/waves/attic/wField.cpp b/waves/attic/wField.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e0264b16864bb47be88aee263eab02a8d4a0eb64
--- /dev/null
+++ b/waves/attic/wField.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "wField.h"
+
+Field::Field(std::string &_name, size_t _id) : wObject(), name(_name), id(_id)
+{
+}
+
+void Field::write(std::ostream &out) const
+{
+    out << "Field #" << id << " \"" << name << "\"";
+}
+
+// ----------------------------------------------------------------------
+
+Fields::~Fields()
+{
+    for (std::vector<Field *>::iterator it = fields.begin(); it != fields.end(); ++it)
+        delete *it;
+}
+
+void Fields::add(std::string &_name)
+{
+    size_t nextid = fields.size();
+    fields.push_back(new Field(_name, nextid));
+}
+
+void Fields::write(std::ostream &out) const
+{
+    for (std::vector<Field *>::const_iterator it = fields.begin(); it != fields.end(); ++it)
+        out << **it << '\n';
+}
diff --git a/waves/attic/wField.h b/waves/attic/wField.h
new file mode 100644
index 0000000000000000000000000000000000000000..35ad5745d68285a0350de5e55f788d69f680c68c
--- /dev/null
+++ b/waves/attic/wField.h
@@ -0,0 +1,41 @@
+// $Id$
+
+#ifndef WFIELD_H
+#define WFIELD_H
+
+#include "waves.h"
+#include "wObject.h"
+#include <vector>
+#include <string>
+
+/**
+ * @brief definition of a scalar field
+ */
+
+class WAVES_API Field : public wObject
+{
+public:
+    std::string name;
+    size_t id; ///< field value is stored at index "id" in nodal vectors
+
+    Field(std::string &_name, size_t _id);
+    virtual void write(std::ostream &out) const;
+};
+
+/**
+ * @brief list of fields
+ */
+
+class WAVES_API Fields : public wObject
+{
+public:
+    std::vector<Field *> fields;
+
+    Fields() : wObject() {}
+    ~Fields();
+    void add(std::string &_name);
+    size_t size() const { return fields.size(); }
+    virtual void write(std::ostream &out) const;
+};
+
+#endif //WFIELD_H
diff --git a/waves/attic/wSolver1.cpp b/waves/attic/wSolver1.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0bca4b799889729964781d3e3976e9e4fb776227
--- /dev/null
+++ b/waves/attic/wSolver1.cpp
@@ -0,0 +1,7 @@
+// $Id$
+
+#include "wSolver1.h"
+
+void Solver1::write(std::ostream &out) const
+{
+}
\ No newline at end of file
diff --git a/waves/attic/wSolver1.h b/waves/attic/wSolver1.h
new file mode 100644
index 0000000000000000000000000000000000000000..9b1afd8075aab6cbadb9afd6d1b6317f48a4cd9e
--- /dev/null
+++ b/waves/attic/wSolver1.h
@@ -0,0 +1,17 @@
+// $Id$
+
+#ifndef WSOLVER1_H
+#define WSOLVER1_H
+
+#include "waves.h"
+#include "wObject.h"
+#include <iostream>
+
+class WAVES_API Solver1
+{
+public:
+    Solver1() {}
+    virtual void write(std::ostream &out) const;
+};
+
+#endif //WSOLVER1_H
diff --git a/waves/broken/cas1.geo b/waves/broken/cas1.geo
new file mode 100644
index 0000000000000000000000000000000000000000..81cb82b738d8d4d339bdd0b1e4a36500ee80c430
--- /dev/null
+++ b/waves/broken/cas1.geo
@@ -0,0 +1,60 @@
+// $Id$
+// fichier de donnees gmsh
+
+
+//X=250m
+//Y=250m
+//Z=250m
+
+Lx = 250;
+Ly = 250;
+Lz = 250;
+
+nl = 30;
+
+lc = Lx/nl;
+
+
+
+Point(1) = {  0,   0, 0, lc};
+Point(2) = { Lx,   0, 0, lc};
+Point(3) = { Lx, -Ly, 0, lc};
+Point(4) = {-Lx, -Ly, 0, lc};
+Point(5) = {-Lx,   0, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 5};
+Line(5) = {5, 1};
+Line Loop(6) = {5, 1, 2, 3, 4};
+Plane Surface(7) = {6};
+Recombine Surface {7};
+
+Extrude {0, 0, Lz} 
+{
+  Surface{7}; Layers{nl}; Recombine;
+}
+
+Extrude {0, 0, -Lz} 
+{
+  Surface{7}; Layers{nl}; Recombine;
+}
+
+// physical entities
+
+Physical Point("Source Point") = {1};
+Physical Line("Measurement line") = {1};
+Physical Surface("Up Side") = {17, 44, 48, 21};
+// Physical Surface("Bottom Side") = {29, 56};
+// Physical Surface("Front Side") = {34};
+// Physical Surface("Rear Side") = {61};
+// Physical Surface("Right Side") = {25, 52};
+// Physical Surface("Left Side") = {33, 60};
+
+Physical Surface("ABC") = {29, 56, 34, 61, 25, 52, 33, 60};
+
+Physical Volume("Volume") = {1, 2};
+
+
+
diff --git a/waves/broken/cas1.py b/waves/broken/cas1.py
new file mode 100644
index 0000000000000000000000000000000000000000..47384a42a9a6b02ea091cfa5491e84101a117f7d
--- /dev/null
+++ b/waves/broken/cas1.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# TODO: il manque une source...
+
+import waves as w
+import tbox.gmsh as gmsh
+import waves.wtools as wt
+
+
+def main():
+    msh = gmsh.MeshLoader("cas1.geo", __file__).execute()
+
+    pbl = w.Problem(msh)
+
+    L=250.0
+    nl=60
+    Le=L/nl
+    c=1500.0
+    dt=Le/c/2
+
+    scheme = w.ForwardEuler(msh, pbl)
+    scheme.ttot = 0.2*100
+    scheme.dt = dt
+    scheme.savefreq=5
+    scheme.nthreads=8
+
+    print("dt=", dt)
+    print("nsteps=", int(scheme.ttot/dt))
+
+    w.Medium(pbl, "Volume", c)
+
+    print(pbl)
+
+    usegui=1
+    if not usegui:
+        scheme.start()
+    else:
+        import waves.viewer as v
+        gui = v.MeshViewer(msh, scheme)
+        gui.start()
+
+if __name__ == "__main__":
+    main()
diff --git a/waves/broken/geuz/geophysique.geo b/waves/broken/geuz/geophysique.geo
new file mode 100644
index 0000000000000000000000000000000000000000..b73326f0ca418b37460a1750d18105d1c0612cfb
--- /dev/null
+++ b/waves/broken/geuz/geophysique.geo
@@ -0,0 +1,72 @@
+Include "geophysique_param.geo";
+
+Mesh.RecombineAll = 1;
+Mesh.Algorithm = 8;
+Mesh.VolumeEdges = 0;
+View.DrawSkinOnly = 1;
+View.IntervalsType = 1;
+View.NbIso = 10;
+
+For i In {1:9}
+  y~{i} = Y * i/10;
+EndFor
+
+lambda = 1500 / Freq;
+lc = lambda / 10;
+N = Z / lc;
+
+Point(1) = {0, 0, 0, lc};
+Point(2) = {-X, 0, 0, lc};
+Point(3) = {X, 0, 0, lc};
+Point(4) = {-X, -Y,0, lc};
+Point(5) = {X, -Y, 0, lc};
+
+Point(10) = {-X, -y_3, 0, lc};
+Point(11) = {0, -y_2, 0, lc};
+Point(12) = {X, -y_4, 0, lc};
+
+Point(20) = {-X, -y_5, 0, lc};
+Point(21) = {0, -y_6, 0, lc};
+Point(22) = {X, -y_6, 0, lc};
+
+Point(30) = {-X, -y_9, 0, lc};
+Point(31) = {0, -y_8, 0, lc};
+Point(32) = {X, -y_7, 0, lc};
+
+Line(1) = {2, 1};
+Line(2) = {1, 3};
+Line(3) = {3, 12};
+Line(4) = {12, 22};
+Line(5) = {22, 32};
+Line(6) = {32, 5};
+Line(7) = {5, 4};
+Line(8) = {4, 30};
+Line(9) = {30, 20};
+Line(10) = {20, 10};
+Line(11) = {10, 2};
+Spline(12) = {10, 11, 12};
+Spline(13) = {20, 21, 22};
+Spline(14) = {30, 31, 32};
+Line Loop(15) = {1, 2, 3, -12, 11};
+Plane Surface(16) = {15};
+Line Loop(17) = {12, 4, -13, 10};
+Plane Surface(18) = {17};
+Line Loop(19) = {13, 5, -14, 9};
+Plane Surface(20) = {19};
+Line Loop(21) = {14, 6, 7, 8};
+Plane Surface(22) = {21};
+
+e1[] = Extrude {0, 0, Z} { Surface{16, 18, 20, 22}; Layers {N}; Recombine; };
+e2[] = Extrude {0, 0, -Z} { Surface{16, 18, 20, 22}; Layers {N}; Recombine; };
+
+Physical Point(GAMMAD) = {1};
+
+Physical Volume(OMEGA_1) = {1,5};
+Physical Volume(OMEGA_2) = {2,6};
+Physical Volume(OMEGA_3) = {3,7};
+Physical Volume(OMEGA_4) = {4,8};
+
+Physical Surface(GAMMAINF_1) = {-49, -48, 141, 142, -40, 133};
+Physical Surface(GAMMAINF_2) = {-71, -70, 163, 164, -62, 155};
+Physical Surface(GAMMAINF_3) = {-93, -92, 185, 186, -84, 177};
+Physical Surface(GAMMAINF_4) = {-115, -110, 203, 208, -106, 199, -114, 207};
diff --git a/waves/broken/geuz/geophysique.pro b/waves/broken/geuz/geophysique.pro
new file mode 100644
index 0000000000000000000000000000000000000000..5f892e4942403de4b9c0f0ec4b367635d97f0657
--- /dev/null
+++ b/waves/broken/geuz/geophysique.pro
@@ -0,0 +1,149 @@
+Include "geophysique_param.geo";
+
+Group {
+  Layer1 = Region[OMEGA_1];
+  Layer2 = Region[OMEGA_2];
+  Layer3 = Region[OMEGA_3];
+  Layer4 = Region[OMEGA_4];
+  Bnd1 = Region[GAMMAINF_1];
+  Bnd2 = Region[GAMMAINF_2];
+  Bnd3 = Region[GAMMAINF_3];
+  Bnd4 = Region[GAMMAINF_4];
+
+  GammaInf = Region[{Bnd1,Bnd2,Bnd3,Bnd4}];
+  Omega = Region[{Layer1,Layer2,Layer3,Layer4}];
+  GammaD = Region[GAMMAD];
+  Sigma = Region[{}];
+}
+
+Function {
+  DefineConstant[
+    c1 = {1500, Name "Input/c1"} ,
+    c2 = {1500, Name "Input/c2"} ,
+    c3 = {1500, Name "Input/c3"} ,
+    c4 = {1500, Name "Input/c4"}
+  ];
+  c[Region[{Layer1,Bnd1}]] = c1;
+  c[Region[{Layer2,Bnd2}]] = c2;
+  c[Region[{Layer3,Bnd3}]] = c3;
+  c[Region[{Layer4,Bnd4}]] = c4;
+  t_min = 0;
+  t_max = 1;
+  dt = 1/100;
+}
+
+Jacobian {
+  { Name JVol ; Case { { Region All ; Jacobian Vol ; } } }
+  { Name JSur ; Case { { Region All ; Jacobian Sur ; } } }
+  { Name JLin ; Case { { Region All ; Jacobian Lin ; } } }
+}
+
+Integration {
+  { Name I1 ;
+    Case { { Type Gauss ; Case {
+          { GeoElement Point ; NumberOfPoints  1 ; }
+          { GeoElement Line ; NumberOfPoints  2 ; }
+          { GeoElement Triangle ; NumberOfPoints  6 ; }
+          { GeoElement Tetrahedron ; NumberOfPoints  4 ; }
+          { GeoElement Quadrangle ; NumberOfPoints  4 ; }
+          { GeoElement Hexahedron ; NumberOfPoints  14 ; }
+        } } }
+  }
+}
+
+Constraint{
+  { Name Dirichlet_uinc ;
+    Case {
+      { Region GammaD ; Value 1;
+        TimeFunction Cos[2*Pi*Freq*$Time];
+      }
+    }
+  }
+}
+
+FunctionSpace {
+  { Name Hgrad_u; Type Form0 ;
+    BasisFunction {
+      { Name sn ; NameOfCoef un ; Function BF_Node ;
+        Support Region[ {Omega, GammaInf, Sigma, GammaD} ] ; Entity NodesOf[ All ] ; } }
+    Constraint {
+      { NameOfCoef un ; EntityType NodesOf ; NameOfConstraint Dirichlet_uinc ; }
+    }
+  }
+}
+
+Formulation {
+  { Name Full ; Type FemEquation ;
+    Quantity {
+      { Name u ; Type Local ; NameOfSpace Hgrad_u; }
+    }
+    Equation {
+      Galerkin { [ - Dof{Grad u} , {Grad u} ] ;
+	In Omega; Jacobian JVol ; Integration I1 ; }
+      Galerkin { DtDtDof [ - 1/c[]^2 * Dof{u} , {u} ] ;
+	In Omega; Jacobian JVol ; Integration I1 ; }
+      Galerkin { DtDof [ - 1/c[] * Dof{u} , {u} ] ;
+	In GammaInf; Jacobian JSur ; Integration I1 ; }
+    }
+  }
+}
+
+Resolution {
+  { Name Full_f;
+    System {
+      { Name Helmholtz ; NameOfFormulation Full ; Type Complex; Frequency Freq; }
+    }
+    Operation {
+      Generate[Helmholtz] ;
+      Solve[Helmholtz] ;
+      SaveSolution[Helmholtz];
+    }
+  }
+  { Name Full_t;
+    System {
+      { Name Helmholtz ; NameOfFormulation Full ; }
+    }
+    Operation {
+      InitSolution[Helmholtz];
+      InitSolution[Helmholtz];
+      // fast:
+      GenerateSeparate[Helmholtz];
+      TimeLoopNewmark[t_min,t_max,dt,0.25,0.5]{
+        Update[Helmholtz] ;
+        SolveAgain[Helmholtz] ;
+        SaveSolution[Helmholtz];
+      }
+      // slow:
+      /*
+      TimeLoopNewmark[t_min,t_max,dt,0.25,0.5]{
+        Generate[Helmholtz] ;
+        SolveAgain[Helmholtz] ;
+        SaveSolution[Helmholtz];
+      }
+      */
+    }
+  }
+}
+
+PostProcessing {
+  { Name Full ; NameOfFormulation Full ;
+    PostQuantity {
+      { Name u ; Value { Term { [ {u} ] ; In Region[ {Omega} ]; Jacobian JVol ; } } }
+    }
+  }
+}
+
+PostOperation {
+  { Name Full ; NameOfPostProcessing Full;
+    Operation {
+      Print[ u, OnElementsOf Omega, File "u.pos"] ;
+    }
+  }
+}
+
+DefineConstant[
+  //R_ = {"Full", Name "GetDP/1ResolutionChoices", Visible 0},
+  C_ = {"-solve -pos -v2 -bin", Name "GetDP/9ComputeCommand", Visible 1}
+  //P_ = {"", Name "GetDP/2PostOperationChoices", Visible 0}
+];
+
diff --git a/waves/broken/geuz/geophysique.py b/waves/broken/geuz/geophysique.py
new file mode 100644
index 0000000000000000000000000000000000000000..ec935081a5ff6231fe21d0e68982b48a50b4ebc2
--- /dev/null
+++ b/waves/broken/geuz/geophysique.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# TODO: marche pas/plus
+
+import waves as w
+import tbox.gmsh as gmsh
+
+def main():
+    msh = gmsh.MeshLoader("geophysique.geo", __file__).execute()
+    print(msh)
+
+    pbl = w.Problem(msh)
+    pbl.c = 1500.0
+
+    c    = 1500.0
+    X    = 250.0;    Y=250.0;    Z=250.0
+    freq = 10.0
+    lam  = c / freq
+    lc   = lam / 10
+    N    = Z / lc
+    Le   = X/N
+    dt   = Le/c/10
+
+    scheme = w.ForwardEuler(pbl)
+
+    import waves.srcs
+    waves.srcs.SinSource(msh, 10, 10.0)  # le no 10 ne passe pas!
+    w.Medium(msh, 1, c)
+    w.Medium(msh, 2, c)
+    w.Medium(msh, 3, c)
+    w.Medium(msh, 4, c)
+
+    from fwk.wutils import parseargs
+    args=parseargs()
+    
+    scheme.ttot = 1.0
+    scheme.dt = dt
+    scheme.savefreq = 5
+    scheme.nthreads = args.k
+
+    if args.nogui:
+        scheme.start()
+    else:
+        import waves.viewer as v
+        gui = v.MeshViewer(scheme)
+        gui.vmin = -0.1
+        gui.vmax =  0.1
+        gui.start()
+
+if __name__ == "__main__":
+    main()
diff --git a/waves/broken/geuz/geophysique_param.geo b/waves/broken/geuz/geophysique_param.geo
new file mode 100644
index 0000000000000000000000000000000000000000..86865c09af9c242a3b3573aa9096770ab8f9e6b0
--- /dev/null
+++ b/waves/broken/geuz/geophysique_param.geo
@@ -0,0 +1,20 @@
+lc = 10;
+X = 250;
+Y = 250;
+Z = 250;
+
+DefineConstant[
+  Freq = {10, Name "Input/Frequency"}
+];
+
+OMEGA_1 = 1;
+OMEGA_2 = 2;
+OMEGA_3 = 3;
+OMEGA_4 = 4;
+
+GAMMAD = 10;
+
+GAMMAINF_1 = 11;
+GAMMAINF_2 = 12;
+GAMMAINF_3 = 13;
+GAMMAINF_4 = 14;
diff --git a/waves/broken/waves01_onelab.py b/waves/broken/waves01_onelab.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbe41711959b9e8c0eaff7fe33fa53a03626636c
--- /dev/null
+++ b/waves/broken/waves01_onelab.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# Simple 2D wave propagation test
+
+import sys
+#sys.path.append("/usr/local/bin")
+#sys.path.append("C:\local\gmsh-2.9.0-Windows")
+
+import wutils
+wutils.findbins()
+import waves as w
+import tbox as tb
+
+import wtools as wt
+
+import onelab
+olab = onelab.client(__file__)
+
+time = olab.defineNumber('Dyna/time [s]', value=0.0)
+wspeed = olab.defineNumber('Param/wave speed', value=10.0,
+                            attributes={'Highlight':'Pink'})
+
+if olab.action == 'check':
+    exit(0)
+
+def exportMshOpt():
+    txt="""
+//n = PostProcessing.NbViews - 1;
+//If(n >= 0)
+n=0;
+Mesh.SurfaceEdges = 0;
+Mesh.VolumeEdges = 0;
+View[n].IntervalsType = 3;
+View[n].CustomMax = 0.1;
+View[n].CustomMin = 0;
+View[n].NbIso = 16;
+View[n].RangeType = 2;
+View[n].SaturateValues = 1;
+//EndIf
+    """
+    optFile = open(olab.getPath("results_merged.msh.opt"),'w')
+    optFile.write(txt)
+    optFile.close()
+
+exportMshOpt()
+
+class OneLabCallback(w.DisplayHook):
+    def __init__(self, msh, scheme):
+        w.DisplayHook.__init__(self)
+        self.msh = msh
+        self.scheme = scheme
+        scheme.setGUI(self)
+        scheme.wgmsh = w.Wgmsh_WG_ONE
+
+    def display(self, nt, t, u):
+        """ C++ => python callback
+        """
+        #print "[GUI] nt=", nt, "t=", t
+        global olab
+
+        ttot=self.scheme.ttot
+        olab.setNumber(olab.name + '/Progress', value=t, min=0, max=ttot, visible=0)
+        olab.setNumber('Dyna/time [s]', value=t)
+        olab.setNumber('Dyna/step', value=nt)
+
+        olab.setNumber('Solu/phi', value=u[0])
+        olab.addNumberChoice('Solu/phi', u[0])
+
+
+
+        # ask Gmsh to refresh
+        olab.setString('Gmsh/Action', value='refresh')
+
+        # stop if we are asked to (by Gmsh)
+        if(olab.getString(olab.name + '/Action') == 'stop'):
+            self.scheme.stopit=True
+
+        filenames = ['waves01.msh', 'res.msh']
+        with open('results_merged.msh', 'w') as outfile:
+            for fname in filenames:
+                with open(fname) as infile:
+                    for line in infile:
+                        outfile.write(line)
+        olab.mergeFile(olab.checkPath('results_merged.msh'))
+        #olab.mergeFile('results_merged.msh')
+
+    def refresh(self):
+        # donne la main au GUI a chaque pas
+        pass
+    def start(self):
+        self.scheme.start()
+
+def main():
+    global olab
+    msh = wutils.MeshLoader("waves01.geo").execute()
+    print(msh)
+
+    pbl = w.Problem(msh)
+    print(pbl)
+
+    Nx=50
+    c = wspeed
+    X=10.0;    Y=10.0;    Z=2.0
+    freq=10.0
+    lam = c / freq
+    lc = lam / 10
+
+    Le=X/Nx
+    dt=Le/c/10
+
+    scheme = w.ForwardEuler(msh, pbl)
+
+    #wt.SinSource(msh, "Line2", 5.0)
+
+    w.Medium(pbl, "Volume", c)
+
+    if 0:
+        wt.SinSource(pbl, "Line1", 10.0)
+        w.Boundary(pbl, "FaceX1", c)
+        w.Boundary(pbl, "FaceY1", c)
+
+    if 0:
+        wt.SinSource(pbl, "FaceX0", 10.0)
+        w.Boundary(pbl, "FaceX1", c)
+
+    if 1:
+        s = wt.MultiSource(pbl, "FaceY0")
+        s.addSource(tb.Vector3d(3,0,0),5)
+        s.addSource(tb.Vector3d(7,0,0),20)
+        w.Boundary(pbl, "FaceX0", c)
+        w.Boundary(pbl, "FaceX1", c)
+        w.Boundary(pbl, "FaceY1", c)
+
+    if 0:
+        wt.PulseSource(pbl, "Line1", 10.0, shift=0.3, width=100.0)
+        w.Boundary(pbl, "FaceX1", c)
+        w.Boundary(pbl, "FaceY1", c)
+
+    # boundaries
+
+
+    scheme.ttot = 10.0
+    scheme.dt = dt
+    scheme.savefreq=5
+    scheme.nthreads=12
+
+
+    usegui=1
+    if not usegui:
+        scheme.start()
+    else:
+        import viewer as v
+        gui = OneLabCallback(msh, scheme)
+        gui.start()
+
+
+    #raw_input("<Press a key>")
+
+if __name__ == "__main__":
+    main()
diff --git a/waves/exe/CMakeLists.txt b/waves/exe/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ec845ea873e6cbe7e01147c2dda321d1bd119f0e
--- /dev/null
+++ b/waves/exe/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Example of compiled problem using "waves"
+
+FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
+ADD_EXECUTABLE(waves1 ${SRCS})
+MACRO_DebugPostfix(waves1)
+TARGET_LINK_LIBRARIES(waves1 waves)
diff --git a/waves/exe/main.cpp b/waves/exe/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2825a71fe3c4565b9b945d025f2638b86d8d3515
--- /dev/null
+++ b/waves/exe/main.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "waves.h"
+#include "wMshData.h"
+#include "wProblem.h"
+#include "wForwardEuler.h"
+#include "wGmshImport.h"
+#include "wGmshExport.h"
+
+// Note that the file strates.msh must be generated from waves/tests/attic/strates.geo using gmsh, and placed in the current directory
+int main()
+{
+    auto msh = std::make_shared<tbox::MshData>();
+    tbox::GmshImport *gmshLoader = new tbox::GmshImport(msh);
+    tbox::GmshExport *gmshWriter = new tbox::GmshExport(msh);
+    gmshLoader->load(std::string("strates.msh"), -1);
+
+    auto pbl = std::make_shared<waves::Problem>(msh);
+
+    waves::ForwardEuler scheme(pbl);
+    scheme.start(gmshWriter);
+
+    delete gmshLoader;
+    delete gmshWriter;
+
+    return 0;
+}
diff --git a/waves/models/__init__.py b/waves/models/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/waves/models/cube.geo b/waves/models/cube.geo
new file mode 100644
index 0000000000000000000000000000000000000000..506ab0fd354f22a181036733f2070352720d2e59
--- /dev/null
+++ b/waves/models/cube.geo
@@ -0,0 +1,50 @@
+// a cube meshed with hex
+
+
+DefineConstant[ Lx = {  1, Min 5, Max 20, Step 1, Name "Lengths/Lx" }  ];
+DefineConstant[ Ly = {  1, Min 5, Max 20, Step 1, Name "Lengths/Ly" }  ];
+DefineConstant[ Lz = {  1, Min 1, Max  2, Step 1, Name "Lengths/Lz" }  ];
+
+DefineConstant[ Nx = {   1, Min 1, Max 200, Step 10, Name "Mesh/Nx" }  ];
+DefineConstant[ Ny = {   1, Min 1, Max 200, Step 10, Name "Mesh/Ny" }  ];
+DefineConstant[ Nz = {   1, Min 1, Max 200, Step 10, Name "Mesh/Nz" }  ];
+
+lc = 1; // useless
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly, 0, lc};
+Point(4) = { 0,  Ly, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 1};
+
+Line Loop(5) = {1, 2, 3, 4};
+
+Plane Surface(6) = {5};
+
+Transfinite Line {1, 3} = Nx+1 Using Progression 1;
+Transfinite Line {4, 2} = Ny+1 Using Progression 1;
+
+Transfinite Surface {6};
+Recombine Surface {6};
+Extrude {0, 0, Lz} {
+  Surface{6}; Layers{Nz}; Recombine;
+}
+Physical Volume("Volume") = {1};
+
+Physical Surface("FaceZ0") = {6};
+Physical Surface("FaceZ1") = {28};
+Physical Surface("FaceY0") = {15};
+Physical Surface("FaceX1") = {19};
+Physical Surface("FaceY1") = {23};
+Physical Surface("FaceX0") = {27};
+
+Physical Line("Line1") = {13};
+Physical Line("Line2") = {14};
+Physical Line("Line3") = {18};
+Physical Line("Line4") = {22};
+
+
+
diff --git a/waves/models/cube2mat.geo b/waves/models/cube2mat.geo
new file mode 100644
index 0000000000000000000000000000000000000000..43d32239d0c606f895af5a5933494c7167c967a2
--- /dev/null
+++ b/waves/models/cube2mat.geo
@@ -0,0 +1,73 @@
+// 2 materiaux
+
+
+DefineConstant[ Lx = {  1, Min 5, Max 20, Step 1, Name "Lengths/Lx" }  ];
+DefineConstant[ Ly1 = {  1, Min 5, Max 20, Step 1, Name "Lengths/Ly1" }  ];
+DefineConstant[ Ly2 = {  1, Min 5, Max 20, Step 1, Name "Lengths/Ly2" }  ];
+DefineConstant[ Lz = {  1, Min 1, Max  2, Step 1, Name "Lengths/Lz" }  ];
+
+DefineConstant[ Nx = {   1, Min 1, Max 200, Step 10, Name "Mesh/Nx" }  ];
+DefineConstant[ Ny1 = {   1, Min 1, Max 200, Step 10, Name "Mesh/Ny1" }  ];
+DefineConstant[ Ny2 = {   1, Min 1, Max 200, Step 10, Name "Mesh/Ny2" }  ];
+DefineConstant[ Nz = {   1, Min 1, Max 200, Step 10, Name "Mesh/Nz" }  ];
+
+lc = Lx/Nx; // useless
+
+Point(1) = { 0,   0, 0, lc};
+Point(2) = { Lx,  0, 0, lc};
+Point(3) = { Lx, Ly1+Ly2, 0, lc};
+Point(4) = { 0,  Ly1+Ly2, 0, lc};
+
+Point(5) = { 0,  Ly1, 0, lc};
+Point(6) = { Lx, Ly2, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 6};
+Line(3) = {6, 5};
+Line(4) = {5, 1};
+Line(5) = {5, 4};
+Line(6) = {4, 3};
+Line(7) = {3, 6};
+
+
+
+Line Loop(8) = {6, 7, 3, 5};
+Plane Surface(9) = {8};
+Line Loop(10) = {1, 2, 3, 4};
+Plane Surface(11) = {10};
+
+// ---
+Transfinite Line {1, 3, 6} = Nx-1 Using Progression 1;
+Transfinite Line {2, 4} = Ny1-1 Using Progression 1;
+Transfinite Line {7, 5} = Ny2-1 Using Progression 1;
+Transfinite Surface {9};
+Transfinite Surface {11};
+// ---
+
+Recombine Surface {9};
+Recombine Surface {11};
+
+Extrude {0, 0, Lz} {
+  Surface{9}; Layers{Nz}; Recombine;
+}
+Extrude {0, 0, Lz} {
+  Surface{11}; Layers{Nz}; Recombine;
+}
+
+
+Physical Volume("Volume1") = {2};
+Physical Volume("Volume2") = {1};
+
+
+Physical Surface("FaceY0") = {42};
+Physical Surface("FaceX1_1") = {46};
+Physical Surface("FaceX1_2") = {24};
+Physical Surface("FaceY1") = {20};
+Physical Surface("FaceX0_1") = {54};
+Physical Surface("FaceX0_2") = {32};
+
+
+
+Physical Line("Line1") = {40};
+
+
diff --git a/waves/models/plane1mat.py b/waves/models/plane1mat.py
new file mode 100644
index 0000000000000000000000000000000000000000..8f1daf1efe8db83635e3c91f77a6e1862e01affb
--- /dev/null
+++ b/waves/models/plane1mat.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# Simple 2D wave-propagation test in 1 material
+
+import waves as w
+import tbox
+import tbox.gmsh as gmsh
+import waves.srcs as srcs
+import waves.utils as u
+
+
+def model(p={}):
+    # configure/build mesh
+    pars = {'Lx': p['Lx'], 'Ly': p['Ly'], 'Nx': p['Nx'], 'Ny': p['Ny']}
+    msh = gmsh.MeshLoader("cube.geo", __file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = w.Problem(msh)
+
+    # compute time-step size
+    Lex = p['Lx'] / p['Nx']
+    Ley = p['Ly'] / p['Ny']
+    dt = min(Lex, Ley) / p['c'] / 10 * 2
+
+    pbl.add(w.Medium(msh, "Volume", p['c']))
+
+    if p['bc'] == 'sinsrc':  # source dans le coin inf gauche
+        pbl.add(srcs.SinSource(msh, "Line1", p['freq']))
+        pbl.add(w.Boundary(msh, "FaceX1", p['c']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c']))
+
+    elif p['bc'] == 'planewave':  # onde plane de bas en haut
+        pbl.add(srcs.SinSource(msh, "FaceX0", p['freq']))
+        pbl.add(w.Boundary(msh, "FaceX1", p['c']))
+
+    elif p['bc'] == 'interf1':  # interférence de 2 srcs sur la frontière basse
+        s = srcs.MultiSource(msh, "FaceY0")
+        s.addSource(tbox.Vector3d(3, 0, 0), p['freq'] / 2)
+        s.addSource(tbox.Vector3d(7, 0, 0), p['freq'])
+        pbl.add(s)
+        pbl.add(w.Boundary(msh, "FaceX0", p['c']))
+        pbl.add(w.Boundary(msh, "FaceX1", p['c']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c']))
+
+    elif p['bc'] == 'pulse':  # un pulse qui part du coin inf gauche
+        pbl.add(
+            srcs.PulseSource(msh, "Line1", p['freq'], shift=0.3, width=100.0))
+        pbl.add(w.Boundary(msh, "FaceX1", p['c']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c']))
+
+    elif p['bc'] == 'interf2':  # 2 sources non synchrones au centre du domaine
+        s = srcs.MultiSource(msh, "Volume")
+        s.addSource(tbox.Vector3d(3 * p['Lx'] / 10, p['Ly'] / 2, 0), p['freq'])
+        s.addSource(
+            tbox.Vector3d(7 * p['Lx'] / 10, p['Ly'] / 2, 0), 1.05 * p['freq'])
+        #pbl.add(s.__disown__())
+        pbl.add(s)
+        pbl.add(w.Boundary(msh, "FaceX0", p['c']))
+        pbl.add(w.Boundary(msh, "FaceX1", p['c']))
+        pbl.add(w.Boundary(msh, "FaceY0", p['c']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c']))
+    else:
+        raise Exception('Unknown BC type (%s)' % p['bc'])
+
+    scheme = w.ForwardEuler(pbl)
+    #scheme.wgmsh = w.Wgmsh_WG_ALL # write .pos files
+    scheme.ttot = p['ttot']
+    scheme.dt = dt
+    scheme.savefreq = 5
+    return scheme, gmshWriter
+
+
+def runmodel(**d):
+    p = {}
+    p['bc'] = 'interf2'
+    p['ttot'] = 1.0
+    p['Lx'] = 10.0
+    p['Ly'] = 10.0
+    p['Nx'] = 50
+    p['Ny'] = 50
+    p['c'] = 10.0
+    p['freq'] = 10.0
+    p.update(d)
+
+    scheme, writer = model(p)
+    u.integrate(scheme, writer)
+
+
+if __name__ == "__main__":
+    runmodel()
diff --git a/waves/models/plane2mat.py b/waves/models/plane2mat.py
new file mode 100644
index 0000000000000000000000000000000000000000..693a9cc4d89c423f6d1e32db7f3433d99e1880ab
--- /dev/null
+++ b/waves/models/plane2mat.py
@@ -0,0 +1,120 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# Simple 2D wave-propagation test in 2 materials
+
+import waves as w
+import tbox
+import tbox.gmsh as gmsh
+import waves.srcs as srcs
+import waves.utils as u
+
+
+def model(p={}):
+    # configure/build mesh
+    pars = {
+        'Lx': p['Lx'],
+        'Ly1': p['Ly1'],
+        'Ly2': p['Ly2'],
+        'Nx': p['Nx'],
+        'Ny1': p['Ny1'],
+        'Ny2': p['Ny2']
+    }
+    msh = gmsh.MeshLoader("cube2mat.geo", __file__).execute(**pars)
+    gmshWriter = tbox.GmshExport(msh)
+    pbl = w.Problem(msh)
+
+    # compute time-step size
+    Lex = float(p['Lx']) / p['Nx']
+    Ley1 = float(p['Ly1']) / p['Ny1']
+    Ley2 = float(p['Ly2']) / p['Ny2']
+    dt1 = min(Lex, Ley1) / p['c1']
+    dt2 = min(Lex, Ley2) / p['c2']
+    dt = min(dt1, dt2) * 0.8
+    #lam = maxc / p['freq']
+
+    pbl.add(w.Medium(msh, "Volume1", p['c1']))
+    pbl.add(w.Medium(msh, "Volume2", p['c2']))
+
+    if p['bc'] == 'sinsrc':  # source de bas en haut
+        pbl.add(srcs.SinSource(msh, "FaceY0", p['freq']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceY0", p['c1']))
+
+    elif p['bc'] == 'interf1':  # interference de 2 sources sur la frontière basse
+        s = srcs.MultiSource(msh, "FaceY0")
+        s.addSource(tbox.Vector3d(3, 0, 0), p['freq'] / 2)
+        s.addSource(tbox.Vector3d(7, 0, 0), 2 * p['freq'])
+        pbl.add(s)
+        pbl.add(w.Boundary(msh, "FaceX0_1", p['c1']))
+        pbl.add(w.Boundary(msh, "FaceX0_2", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceX1_1", p['c1']))
+        pbl.add(w.Boundary(msh, "FaceX1_2", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c2']))
+
+    elif p['bc'] == 'pulse':  # un pulse qui part du coin inf gauche
+        pbl.add(
+            srcs.PulseSource(msh, "FaceY0", p['freq'], shift=0.3, width=200.0))
+        #pbl.add(w.Boundary(msh, "FaceX0_1", p['c1']))
+        #pbl.add(w.Boundary(msh, "FaceX0_2", p['c2']))
+        #pbl.add(w.Boundary(msh, "FaceX1_1", p['c1']))
+        #pbl.add(w.Boundary(msh, "FaceX1_2", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceY0", p['c1']))
+
+    elif p['bc'] == 'reflex':  # réflexion/réfraction (Bulthuis)
+        pbl.add(srcs.SinSource(msh, "Line1", p['freq']))
+        #pbl.add(w.Boundary(msh, "FaceX0_1", p['c1']))
+        #pbl.add(w.Boundary(msh, "FaceX0_2", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceX1_1", p['c1']))
+        pbl.add(w.Boundary(msh, "FaceX1_2", p['c2']))
+        pbl.add(w.Boundary(msh, "FaceY1", p['c2']))
+        #pbl.add(w.Boundary(msh, "FaceY0", p['c1']))
+    else:
+        raise Exception('Unknown BC type (%s)' % p['bc'])
+
+    scheme = w.ForwardEuler(pbl)
+    #scheme.wgmsh = w.Wgmsh_WG_ALL # write .pos files
+    scheme.ttot = p['ttot']
+    scheme.dt = dt
+    scheme.savefreq = 5
+
+    return scheme, gmshWriter
+
+
+def runmodel(**d):
+    p = {}
+    p['bc'] = 'reflex'
+    p['ttot'] = 1.0
+    p['Lx'] = 10.0
+    p['Ly1'] = 5.0
+    p['Ly2'] = 5.0
+    p['Nx'] = 100
+    p['Ny1'] = 50
+    p['Ny2'] = 50
+    p['c1'] = 10.0
+    p['c2'] = 20.0
+    p['freq'] = 10.0
+    p.update(d)
+
+    scheme, writer = model(p)
+    u.integrate(scheme, writer)
+
+
+if __name__ == "__main__":
+    runmodel()
diff --git a/waves/src/CMakeLists.txt b/waves/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e281b8acae0909db78a2b1fc2a478004e21bec21
--- /dev/null
+++ b/waves/src/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# CMake input file of waves.so
+
+FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
+
+ADD_LIBRARY(waves SHARED ${SRCS})
+MACRO_DebugPostfix(waves)
+TARGET_INCLUDE_DIRECTORIES(waves PUBLIC ${PROJECT_SOURCE_DIR}/waves/src)
+
+TARGET_LINK_LIBRARIES(waves tbox fwk)
+
+INSTALL(TARGETS waves DESTINATION ${CMAKE_INSTALL_PREFIX})
+
+SOURCE_GROUP(base       REGULAR_EXPRESSION ".*\\.(cpp|inl|hpp|h)")
+SOURCE_GROUP(schemes    REGULAR_EXPRESSION ".+(TimeIntegration|Runge|Euler|Newmark).+")
diff --git a/waves/src/wBoundary.cpp b/waves/src/wBoundary.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..52238cacbabf51932e072a62e09cc07b302f0c8f
--- /dev/null
+++ b/waves/src/wBoundary.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wBoundary.h"
+#include "wProblem.h"
+#include "wTag.h"
+using namespace waves;
+
+Boundary::Boundary(std::shared_ptr<MshData> _msh, int no, double _c) : Group(_msh, no), c(_c)
+{
+    //pbl.bnds.push_back(this);
+}
+
+Boundary::Boundary(std::shared_ptr<MshData> _msh, std::string const &name, double _c) : Group(_msh, name), c(_c)
+{
+    //pbl.bnds.push_back(this);
+}
+
+void Boundary::write(std::ostream &out) const
+{
+    out << "Boundary on " << *tag;
+}
diff --git a/waves/src/wBoundary.h b/waves/src/wBoundary.h
new file mode 100644
index 0000000000000000000000000000000000000000..98ef337e6ef5d5a00fe916218dd5d1af6d5447f7
--- /dev/null
+++ b/waves/src/wBoundary.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WBOUNDARY_H
+#define WBOUNDARY_H
+
+#include "waves.h"
+#include "wGroup.h"
+
+using namespace tbox;
+
+namespace waves
+{
+
+/**
+ * @brief boundaries which requires a special treatment
+ */
+
+class WAVES_API Boundary : public Group
+{
+public:
+    double c;
+    Boundary(std::shared_ptr<MshData> _msh, int no, double _c);
+    Boundary(std::shared_ptr<MshData> _msh, std::string const &name, double _c);
+    virtual ~Boundary() { std::cout << "~Boundary()\n"; }
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+} // namespace waves
+
+#endif //WBOUNDARY_H
diff --git a/waves/src/wDisplayHook.cpp b/waves/src/wDisplayHook.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..432f096fb4e8cf0d29ada1e6c679e4def86eb266
--- /dev/null
+++ b/waves/src/wDisplayHook.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wDisplayHook.h"
+
+using namespace waves;
+
+DisplayHook::DisplayHook()
+{
+}
+
+void DisplayHook::display(int nt, double t, std::vector<double> &u)
+{
+    std::cout << "DisplayHook::display()\n";
+}
+
+void DisplayHook::refresh()
+{
+    std::cout << "DisplayHook::refresh()\n";
+}
diff --git a/waves/src/wDisplayHook.h b/waves/src/wDisplayHook.h
new file mode 100644
index 0000000000000000000000000000000000000000..859859da5810092b8e671b8028d63afc621d05c2
--- /dev/null
+++ b/waves/src/wDisplayHook.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WDISPLAYHOOK_H
+#define WDISPLAYHOOK_H
+
+#include "waves.h"
+#include "wObject.h"
+#include <vector>
+
+namespace waves
+{
+
+/**
+ * @brief quad element
+ */
+
+class WAVES_API DisplayHook : public fwk::wObject
+{
+public:
+    DisplayHook();
+    virtual void display(int nt, double t, std::vector<double> &u);
+    virtual void refresh();
+};
+
+} // namespace waves
+
+#endif //WDISPLAYHOOK_H
diff --git a/waves/src/wForwardEuler.cpp b/waves/src/wForwardEuler.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9efb91b8cbccba642c3f249b406107f915997ce6
--- /dev/null
+++ b/waves/src/wForwardEuler.cpp
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wForwardEuler.h"
+#include "wMshData.h"
+#include "wNode.h"
+#include "wElement.h"
+#include "wTimer.h"
+#include "wTag.h"
+#include "wProblem.h"
+#include "wDisplayHook.h"
+#include "wSource.h"
+#include "wResults.h"
+#include "wMshExport.h"
+using namespace tbox;
+using namespace waves;
+
+ForwardEuler::ForwardEuler(std::shared_ptr<waves::Problem> _pbl) : TimeIntegration(_pbl)
+{
+}
+
+void ForwardEuler::start(MshExport *mshWriter)
+{
+    std::cout << *this;
+    chrono1.start();
+
+    auto msh = pbl->msh;
+    u1.resize(msh->nodes.size());
+    v1.resize(msh->nodes.size());
+    Eigen::Map<Eigen::VectorXd> u1_(u1.data(), u1.size()), v1_(v1.data(), v1.size());
+
+    // matrix assembly
+    Eigen::SparseMatrix<double, Eigen::RowMajor> K(msh->nodes.size(), msh->nodes.size());
+    std::vector<double> Md(msh->nodes.size());
+    Eigen::Map<Eigen::VectorXd> Md_(Md.data(), Md.size());
+    buildKM(K, Md, u1);
+
+    Eigen::SparseMatrix<double, Eigen::RowMajor> S(msh->nodes.size(), msh->nodes.size());
+    buildS(S);
+
+    // setup results
+    Results results;
+    results.scalars_at_nodes["u"] = &u1;
+    //results.scalars_at_nodes["v"] = &v1;
+
+    // time integration
+
+    std::cout << "\n\nTime integration...\n";
+    std::cout << *this << '\n';
+
+    double t = 0.0;
+    int nt = 1;
+    results.nt = nt;
+    results.time = t;
+
+    while (t < ttot && !stopit)
+    {
+        //if(verbose)    std::cout << "nt " << nt << " t=" << t << "\n";
+        if (verbose)
+            std::cout << "nt " << nt << " t=" << t << " stopit=" << stopit << "\n";
+
+        //std::for_each(msh->srcs.begin(), msh->srcs.end(), [&](Source *s) { s->apply(t, u1); });
+        for (auto s : pbl->srcs)
+            s->apply(t, u1);
+
+        t += dt;
+        nt++;
+
+        // equation #1
+        u1_ += v1_ * dt; // u1 = u0 + dt*v0
+
+        for (auto s : pbl->srcs)
+            s->apply(t, u1);
+
+        // equation #2
+        v1_.array() -= dt * (K * u1_ + S * v1_).array() / Md_.array();
+
+        if (nt % savefreq == 0)
+        {
+            //std::cout << "nt " << nt << " t=" << t << "\n";
+            results.time = t;
+            if (wgmsh == Wgmsh::WG_ONE)
+            {
+                results.nt++;
+                mshWriter->save("res", results);
+            }
+            else if (wgmsh == Wgmsh::WG_ALL)
+            {
+                results.nt++;
+                char filename[256];
+                sprintf(filename, "res_%06d", nt);
+                mshWriter->save(filename, results);
+            }
+            if (dhook)
+                dhook->display(nt, t, u1);
+        }
+        if (dhook)
+            dhook->refresh();
+    }
+
+    chrono1.stop();
+    std::cout << "[cpu] " << chrono1 << '\n';
+}
diff --git a/waves/src/wForwardEuler.h b/waves/src/wForwardEuler.h
new file mode 100644
index 0000000000000000000000000000000000000000..1be5443bccd6832c32f9201a832442799f8cd21d
--- /dev/null
+++ b/waves/src/wForwardEuler.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WFORWARDEULER_H
+#define WFORWARDEULER_H
+
+#include "waves.h"
+#include "wTimeIntegration.h"
+
+namespace waves
+{
+
+/**
+ * @brief simple explicit Forward Euler time integration
+ */
+
+class WAVES_API ForwardEuler : public TimeIntegration
+{
+public:
+    ForwardEuler(std::shared_ptr<Problem> _pbl);
+    virtual ~ForwardEuler() { std::cout << "~ForwardEuler()\n"; }
+
+    virtual void start(tbox::MshExport *mshWriter) override;
+    virtual char const *clsname() const override { return "ForwardEuler"; }
+};
+
+} // namespace waves
+
+#endif //WFORWARDEULER_H
diff --git a/waves/src/wMedium.cpp b/waves/src/wMedium.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..af87497ce489c47ae79574b3c6d6006fcce5dd3b
--- /dev/null
+++ b/waves/src/wMedium.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wMedium.h"
+#include "wProblem.h"
+#include "wTag.h"
+using namespace waves;
+
+Medium::Medium(std::shared_ptr<MshData> _msh, int no, double _c) : Group(_msh, no), c(_c)
+{
+    //pbl.media.push_back(this);
+}
+
+Medium::Medium(std::shared_ptr<MshData> _msh, std::string const &name, double _c) : Group(_msh, name), c(_c)
+{
+    //pbl.media.push_back(this);
+}
+
+void Medium::write(std::ostream &out) const
+{
+    out << "Medium on " << *tag << " with c=" << this->c;
+}
diff --git a/waves/src/wMedium.h b/waves/src/wMedium.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3e370af6f426c82fb3acb39b3f10abe7b4ecdeb
--- /dev/null
+++ b/waves/src/wMedium.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WMEDIUM_H
+#define WMEDIUM_H
+
+#include "waves.h"
+#include "wGroup.h"
+
+using namespace tbox;
+
+namespace waves
+{
+
+/**
+ * @brief a medium (with a speed of wave)
+ * @todo c => Fct  (cfr heat)
+ */
+
+class WAVES_API Medium : public Group
+{
+public:
+    double c;
+    Medium(std::shared_ptr<MshData> _msh, int no, double _c);
+    Medium(std::shared_ptr<MshData> _msh, std::string const &name, double _c);
+    virtual ~Medium() { std::cout << "~Medium()\n"; }
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+} // namespace waves
+
+#endif //WMEDIUM_H
diff --git a/waves/src/wNewmark.cpp b/waves/src/wNewmark.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..919521281d4bb4257ddc7b3ebc0ce0d3b36e5165
--- /dev/null
+++ b/waves/src/wNewmark.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wNewmark.h"
+#include "wMshData.h"
+#include "wNode.h"
+#include "wElement.h"
+#include "wTimer.h"
+#include "wTag.h"
+#include "wProblem.h"
+#include "wDisplayHook.h"
+#include "wSource.h"
+#include "wResults.h"
+#include "wMshExport.h"
+using namespace tbox;
+using namespace waves;
+
+Newmark::Newmark(std::shared_ptr<waves::Problem> _pbl) : TimeIntegration(_pbl)
+{
+    gamma = 0.5;
+    beta = 0.25;
+}
+
+void Newmark::start(MshExport *mshWriter)
+{
+    std::cout << *this;
+    chrono1.start();
+
+    auto msh = pbl->msh;
+    u1.resize(msh->nodes.size());
+    v1.resize(msh->nodes.size());
+    Eigen::Map<Eigen::VectorXd> u1_(u1.data(), u1.size()), v1_(v1.data(), v1.size());
+
+    // matrix assembly
+    Eigen::SparseMatrix<double, Eigen::RowMajor> K(msh->nodes.size(), msh->nodes.size());
+    std::vector<double> Md(msh->nodes.size());
+    Eigen::Map<Eigen::VectorXd> Md_(Md.data(), Md.size());
+    buildKM(K, Md, u1);
+
+    Eigen::SparseMatrix<double, Eigen::RowMajor> S(msh->nodes.size(), msh->nodes.size());
+    buildS(S);
+
+    // setup results
+    Results results;
+    results.scalars_at_nodes["u"] = &u1;
+    //results.scalars_at_nodes["v"] = &v1;
+
+    // time integration
+
+    std::cout << "\n\nTime integration...\n";
+    std::cout << *this << '\n';
+
+    double t = 0.0;
+    int nt = 1;
+    results.nt = nt;
+    results.time = t;
+
+    while (t < ttot && !stopit)
+    {
+        if (verbose)
+            std::cout << "nt " << nt << " t=" << t << "\n";
+
+        for (auto s : pbl->srcs)
+            s->apply(t, u1);
+
+        t += dt;
+        nt++;
+
+        // equation #1
+        u1_ += v1_ * dt; // u1 = u0 + dt*v0
+
+        for (auto s : pbl->srcs)
+            s->apply(t, u1);
+
+        // equation #2
+        v1_.array() -= dt * (K * u1_ + S * v1_).array() / Md_.array();
+
+        if (nt % savefreq == 0)
+        {
+            //std::cout << "nt " << nt << " t=" << t << "\n";
+            results.time = t;
+            results.nt++;
+            //mshWriter->save("res", results);
+
+            if (dhook)
+                dhook->display(nt, t, u1);
+        }
+        if (dhook)
+            dhook->refresh();
+    }
+
+    chrono1.stop();
+    std::cout << "[cpu] " << chrono1 << '\n';
+}
diff --git a/waves/src/wNewmark.h b/waves/src/wNewmark.h
new file mode 100644
index 0000000000000000000000000000000000000000..b03d5808614e328a8c70fa1eafe7ca94219fa56d
--- /dev/null
+++ b/waves/src/wNewmark.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WNEWMARK_H
+#define WNEWMARK_H
+
+#include "waves.h"
+#include "wTimeIntegration.h"
+
+namespace waves
+{
+
+/**
+ * @brief implicit Newmark
+ */
+
+class WAVES_API Newmark : public TimeIntegration
+{
+public:
+    double gamma;
+    double beta;
+
+    Newmark(std::shared_ptr<Problem> _pbl);
+    virtual ~Newmark() { std::cout << "~Newmark()\n"; }
+
+    virtual void start(tbox::MshExport *mshWriter) override;
+    virtual char const *clsname() const override { return "Newmark"; }
+};
+
+} // namespace waves
+
+#endif //WNEWMARK_H
diff --git a/waves/src/wProblem.cpp b/waves/src/wProblem.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f5effcb2221ae49d1bf618ce03f2c7c3443ae4d5
--- /dev/null
+++ b/waves/src/wProblem.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wProblem.h"
+#include "wMshData.h"
+#include "wSource.h"
+#include "wMedium.h"
+#include "wBoundary.h"
+#include "wElement.h"
+
+#include "wTag.h"
+using namespace waves;
+
+Problem::Problem(std::shared_ptr<MshData> _msh) : msh(_msh)
+{
+}
+
+Problem::~Problem()
+{
+    std::cout << "~Problem()\n";
+    std::cout << "\tstill " << srcs.size() << " source(s) remaining.\n";
+    for (auto s : srcs)
+        std::cout << "\t\t" << *s << " (use_count=" << s.use_count() << ")\n";
+}
+
+/**
+ * @brief Initialize the elements precomputed values
+ */
+void Problem::initElems()
+{
+    // Update volume Jacobian
+    for (auto vol : media)
+        for (auto e : vol->tag->elems)
+            e->initValues(true);
+    // Update surface Jacobian (Neumann B.C.)
+    for (auto surf : bnds)
+        for (auto e : surf->tag->elems)
+            e->initValues(false);
+}
+
+void Problem::write(std::ostream &out) const
+{
+    out << "waves::Problem:\n";
+    out << " + mesh:\n";
+    out << *msh;
+    out << " + sources:\n";
+    for (auto s : srcs)
+        out << *s << '\n';
+    out << " + media:\n";
+    for (auto m : media)
+        out << *m << '\n';
+    out << " + boundaries:\n";
+    for (auto b : bnds)
+        out << *b << '\n';
+}
diff --git a/waves/src/wProblem.h b/waves/src/wProblem.h
new file mode 100644
index 0000000000000000000000000000000000000000..adff43b5c3307f70f3490bf017a435177be500fc
--- /dev/null
+++ b/waves/src/wProblem.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WPROBLEM_H
+#define WPROBLEM_H
+
+#include "waves.h"
+#include "wObject.h"
+#include <iostream>
+#include <vector>
+#include <memory>
+
+using namespace tbox;
+
+namespace waves
+{
+
+/**
+ * @brief main wave Problem object
+ */
+
+class WAVES_API Problem : public fwk::wSharedObject
+{
+public:
+    std::shared_ptr<MshData> msh;
+#ifndef SWIG
+    std::vector<std::shared_ptr<Source>> srcs;
+    std::vector<std::shared_ptr<Medium>> media;
+    std::vector<std::shared_ptr<Boundary>> bnds;
+#endif
+    Problem(std::shared_ptr<MshData> _msh);
+    virtual ~Problem();
+
+    void add(std::shared_ptr<Source> s) { srcs.push_back(s); }
+    void add(std::shared_ptr<Medium> m) { media.push_back(m); }
+    void add(std::shared_ptr<Boundary> b) { bnds.push_back(b); }
+
+#ifndef SWIG
+    void initElems();
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+} // namespace waves
+
+#endif //WPROBLEM_H
diff --git a/waves/src/wRungeKutta.cpp b/waves/src/wRungeKutta.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..75e9baf257d5228d88c0eb59446e00984ddd92c7
--- /dev/null
+++ b/waves/src/wRungeKutta.cpp
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wRungeKutta.h"
+#include "wMshData.h"
+#include "wNode.h"
+#include "wElement.h"
+#include "wTimer.h"
+#include "wTag.h"
+#include "wProblem.h"
+#include "wDisplayHook.h"
+#include "wSource.h"
+#include "wResults.h"
+#include "wMshExport.h"
+using namespace tbox;
+using namespace waves;
+
+RungeKutta::RungeKutta(std::shared_ptr<waves::Problem> _pbl) : TimeIntegration(_pbl)
+{
+}
+
+void RungeKutta::start(MshExport *mshWriter)
+{
+    std::cout << *this;
+    chrono1.start();
+
+    auto msh = pbl->msh;
+    u1.resize(msh->nodes.size());
+    v1.resize(msh->nodes.size());
+
+    // matrix assembly
+    Eigen::SparseMatrix<double, Eigen::RowMajor> K(msh->nodes.size(), msh->nodes.size());
+    std::vector<double> Md(msh->nodes.size());
+    buildKM(K, Md, u1);
+
+    Eigen::SparseMatrix<double, Eigen::RowMajor> S(msh->nodes.size(), msh->nodes.size());
+    buildS(S);
+
+    // setup results
+    Results results;
+    results.scalars_at_nodes["u"] = &u1;
+    //results.scalars_at_nodes["v"] = &v1;
+
+    // time integration
+
+    std::cout << "\n\nTime integration...\n";
+    std::cout << *this << '\n';
+
+    std::vector<double> tmp1(msh->nodes.size()), tmp2(msh->nodes.size());
+    double t = 0.0;
+    int nt = 1;
+    results.nt = nt;
+    results.time = t;
+
+    std::vector<double> up1(msh->nodes.size());
+    std::vector<double> vp1(msh->nodes.size());
+    std::vector<double> up2(msh->nodes.size());
+    std::vector<double> vp2(msh->nodes.size());
+    std::vector<double> up3(msh->nodes.size());
+    std::vector<double> vp3(msh->nodes.size());
+
+    std::vector<double> u2(msh->nodes.size());
+    std::vector<double> v2(msh->nodes.size());
+
+    //Node *snod = msh->ntags["Source Point"]->elems[0]->nodes[0];
+
+    while (t < ttot)
+    {
+        std::cout << "nt " << nt << " t=" << t << "\n";
+
+        //u1[snod->row] = sin(2*M_PI*20*t); // BC
+        //if(source) source->apply(t, u1);
+        std::for_each(pbl->srcs.begin(), pbl->srcs.end(), [&](std::shared_ptr<Source> s) { s->apply(t, u1); });
+
+        t += dt;
+        nt++;
+
+        predictor(up1, vp1, u1, v1, u1, v1, dt, Md, K, S, 1.0, t);
+        predictor(up2, vp2, up1, vp1, u1, v1, dt, Md, K, S, 1.0, t);
+        predictor(up3, vp3, up2, vp2, u1, v1, dt, Md, K, S, 1.0, t);
+
+        predictor(u2, v2, u1, v1, u1, v1, dt, Md, K, S, 1. / 2., t);
+        predictor(u1, v1, up1, vp1, u2, v2, dt, Md, K, S, 1. / 3., t);
+        predictor(u2, v2, up2, vp2, u1, v1, dt, Md, K, S, 1. / 8., t);
+        predictor(u1, v1, up3, vp3, u2, v2, dt, Md, K, S, 1. / 24., t);
+
+        //u1[snod->row] = sin(2*M_PI*20*t); //BC bis
+        //if(source) source->apply(t, u1);
+        std::for_each(pbl->srcs.begin(), pbl->srcs.end(), [&](std::shared_ptr<Source> s) { s->apply(t, u1); });
+
+        if (nt % savefreq == 0)
+        {
+            //std::cout << "nt " << nt << " t=" << t << "\n";
+            results.time = t;
+            results.nt++;
+            //mshWriter->save("res", results);
+
+            if (dhook)
+                dhook->display(nt, t, u1);
+        }
+        if (dhook)
+            dhook->refresh();
+    }
+
+    chrono1.stop();
+    std::cout << "[cpu] " << chrono1 << '\n';
+}
+
+void RungeKutta::predictor(std::vector<double> &up2, std::vector<double> &vp2, // premier membre
+                           std::vector<double> &up1, std::vector<double> &vp1, // predicteur
+                           std::vector<double> &u0, std::vector<double> &v0,   // sol au temps precedent
+                           double dt,
+                           std::vector<double> &Md,
+                           Eigen::SparseMatrix<double, Eigen::RowMajor> &K,
+                           Eigen::SparseMatrix<double, Eigen::RowMajor> &S, double ak, double t)
+{
+    // Define maps
+    Eigen::Map<Eigen::VectorXd> u0_(u0.data(), u0.size()), v0_(v0.data(), v0.size()), up1_(up1.data(), up1.size()), vp1_(vp1.data(), vp1.size()), up2_(up2.data(), up2.size()), vp2_(vp2.data(), vp2.size()), Md_(Md.data(), Md.size());
+    // equation #1
+    up2_ = u0_ + vp1_ * ak * dt;
+
+    //up2[snod->row] = sin(2*M_PI*20*t); //BC bis
+    //if(source) source->apply(t, up2);
+
+    std::for_each(pbl->srcs.begin(), pbl->srcs.end(), [&](std::shared_ptr<Source> s) { s->apply(t, up2); });
+
+    // equation #2
+    vp2_.array() = v0_.array() - ak * dt * (K * up1_ + S * vp1_).array() / Md_.array();
+}
diff --git a/waves/src/wRungeKutta.h b/waves/src/wRungeKutta.h
new file mode 100644
index 0000000000000000000000000000000000000000..e79690fda9a1f821768a7f057f733aa409396ed4
--- /dev/null
+++ b/waves/src/wRungeKutta.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WRUNGEKUTTA_H
+#define WRUNGEKUTTA_H
+
+#include "waves.h"
+#include "wTimeIntegration.h"
+#include <Eigen/Sparse>
+#include <vector>
+#include <iostream>
+
+namespace waves
+{
+
+/**
+ * @brief explicit Runge Kutta time integration
+ */
+
+class WAVES_API RungeKutta : public TimeIntegration
+{
+public:
+    RungeKutta(std::shared_ptr<Problem> _pbl);
+    virtual ~RungeKutta() { std::cout << "~RungeKutta()\n"; }
+    virtual char const *clsname() const override { return "RungeKutta"; }
+
+    virtual void start(tbox::MshExport *mshWriter) override;
+
+private:
+    void predictor(std::vector<double> &up2, std::vector<double> &vp2, // premier membre
+                   std::vector<double> &up1, std::vector<double> &vp1, // predicteur
+                   std::vector<double> &u0, std::vector<double> &v0,   // sol au temps precedent
+                   double dt,
+                   std::vector<double> &Md,
+                   Eigen::SparseMatrix<double, Eigen::RowMajor> &K,
+                   Eigen::SparseMatrix<double, Eigen::RowMajor> &S, double ak, double t);
+};
+
+} // namespace waves
+
+#endif //WRUNGEKUTTA_H
diff --git a/waves/src/wSource.cpp b/waves/src/wSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..595eea555dba22dd4882125c679a3af0d646e825
--- /dev/null
+++ b/waves/src/wSource.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wSource.h"
+#include "wProblem.h"
+#include "wTag.h"
+#include "wElement.h"
+#include "wNode.h"
+#include <algorithm>
+using namespace waves;
+
+Source::Source(std::shared_ptr<MshData> _msh, int no) : Group(_msh, no)
+{
+    for (auto e : tag->elems)
+        for (auto n : e->nodes)
+            nodes.push_back(n);
+    /*
+    std::for_each(tag->elems.begin(), tag->elems.end(), [&](Element *e) { 
+        std::for_each(e->nodes.begin(), e->nodes.end(), [&](Node *n) { 
+            nodes.push_back(n); 
+        });
+    });
+*/
+    //pbl.srcs.push_back(this);
+}
+
+Source::Source(std::shared_ptr<MshData> _msh, std::string const &name) : Group(_msh, name)
+{
+    for (auto e : tag->elems)
+        for (auto n : e->nodes)
+            nodes.push_back(n);
+
+    //pbl.srcs.push_back(this);
+}
+
+void Source::write(std::ostream &out) const
+{
+    out << "Source on " << *tag;
+    out << "(" << nodes.size() << " nodes)";
+    //std::for_each(nodes.begin(), nodes.end(), [&](Node *n) { out << '\t' << *n << '\n'; });
+    //for(auto n : nodes) { out << '\t' << *n << '\n'; }
+}
diff --git a/waves/src/wSource.h b/waves/src/wSource.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ed54658d85cab00eb657d68bdd2af444c86416a
--- /dev/null
+++ b/waves/src/wSource.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WSOURCE_H
+#define WSOURCE_H
+
+#include "waves.h"
+#include "wGroup.h"
+#include <vector>
+#include <string>
+
+using namespace tbox;
+
+namespace waves
+{
+
+/**
+ * @brief manage the sources
+ */
+
+class WAVES_API Source : public Group
+{
+public:
+    std::vector<Node *> nodes;
+
+    Source(std::shared_ptr<MshData> _msh, int no);
+    Source(std::shared_ptr<MshData> _msh, std::string const &name);
+    virtual ~Source() { std::cout << "~Source()\n"; }
+    virtual void apply(double t, std::vector<double> &u) {}
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+} // namespace waves
+
+#endif //WSOURCE_H
diff --git a/waves/src/wTimeIntegration.cpp b/waves/src/wTimeIntegration.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7f13762b1c2144315354fc7b19ba79857c8ca9a5
--- /dev/null
+++ b/waves/src/wTimeIntegration.cpp
@@ -0,0 +1,245 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wTimeIntegration.h"
+#include "wMshData.h"
+#include "wNode.h"
+#include "wElement.h"
+#include "wQuad4.h"
+#include "wTimer.h"
+#include "wTag.h"
+#include "wProblem.h"
+#include "wMedium.h"
+#include "wBoundary.h"
+#include "wWaveTerm.h"
+#include "wFct0.h"
+#include "wMshExport.h"
+#include <typeinfo>
+#include <deque>
+
+#include <tbb/global_control.h>
+#include <tbb/parallel_for_each.h>
+#include <tbb/spin_mutex.h>
+using namespace fwk;
+using namespace tbox;
+using namespace waves;
+
+TimeIntegration::TimeIntegration(std::shared_ptr<Problem> _pbl) : pbl(_pbl)
+{
+    dhook = NULL;
+
+    // default values
+    ttot = 10.0;
+    dt = 1.0e-1 / 5;
+    savefreq = 5;
+    nthreads = 1;
+    wgmsh = Wgmsh::WG_NONE;
+
+    verbose = false;
+    stopit = false;
+
+    // Update element memory
+    pbl->initElems();
+}
+
+void TimeIntegration::start(MshExport *mshWriter)
+{
+}
+
+void TimeIntegration::dummyIC()
+{
+    std::cout << "initial condition...\n";
+
+    auto msh = pbl->msh;
+
+    // initial condition
+    for (auto nod : msh->nodes)
+    {
+        double px = nod->pos(0);
+        double py = nod->pos(1);
+        double pz = nod->pos(2);
+        double sx = 0.0;
+        double sy = 0.0;
+        double sz = 0.0;
+        double R = sqrt((px - sx) * (px - sx) + (py - sy) * (py - sy) + (pz - sz) * (pz - sz));
+        if (R < 1.0)
+        {
+            u1[nod->row] = 0.0;
+            v1[nod->row] = 0.0;
+        }
+        else
+        {
+            u1[nod->row] = 0.0;
+            v1[nod->row] = 0.0;
+        }
+    }
+}
+
+void TimeIntegration::buildS(Eigen::SparseMatrix<double, Eigen::RowMajor> &S2)
+{
+    tbb::spin_mutex mutex;
+    tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads);
+
+    auto msh = pbl->msh;
+    std::deque<Eigen::Triplet<double>> T; // list of triplets to build S matrix
+
+    std::cout << "building S (TBB/lambda) using " << nthreads << " threads...\n";
+
+    for (auto bnd : pbl->bnds)
+    {
+        std::cout << "\tprocessing " << *bnd << '\n';
+        std::cout << "normal=" << static_cast<Quad4 *>(bnd->tag->elems[0])->getNormal() << '\n';
+        tbb::parallel_for_each(bnd->tag->elems.begin(), bnd->tag->elems.end(), [&](Element *e) {
+            if (e->type() != ElType::QUAD4)
+                return;
+            //std::cout << "processing element #" << e->no << "\n";
+
+            // ** Se matrix => S vector
+            Eigen::MatrixXd Se = WaveTerm::buildM(*e);
+
+            // assembly
+            tbb::spin_mutex::scoped_lock lock(mutex);
+
+            for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+            {
+                Node *nodi = e->nodes[ii];
+                for (size_t jj = 0; jj < e->nodes.size(); ++jj)
+                {
+                    Node *nodj = e->nodes[jj];
+                    T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, bnd->c * Se(ii, jj)));
+                }
+            }
+        });
+    }
+    // Build, clean and turn to compressed row format
+    S2.setFromTriplets(T.begin(), T.end());
+    S2.prune(0.);
+    S2.makeCompressed();
+
+    std::cout << "S (" << S2.rows() << "," << S2.cols() << ") nnz=" << S2.nonZeros() << "\n";
+    chrono1.read();
+    std::cout << "[cpu] " << chrono1 << '\n';
+}
+
+void TimeIntegration::buildKM(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2,
+                              std::vector<double> &Md, std::vector<double> const &u)
+{
+    Timer chrono;
+    chrono.start();
+    buildKM_tbb_lambda(K2, Md, u);
+    chrono.stop();
+    std::cout << "[cpu:buildKM] " << chrono << '\n';
+}
+
+void TimeIntegration::buildKM_tbb_lambda(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2,
+                                         std::vector<double> &Md, std::vector<double> const &u)
+{
+    tbb::spin_mutex mutex;
+    tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads);
+
+    auto msh = pbl->msh;
+    std::deque<Eigen::Triplet<double>> T; // list of triplets to build K matrix
+
+    std::cout << "building K/M (TBB/lambda) using " << nthreads << " threads...\n";
+
+    for (auto mat : pbl->media)
+    {
+        std::cout << "\tprocessing " << *mat << '\n';
+        tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) {
+            if (e->type() != ElType::HEX8)
+                return;
+            //std::cout << "processing element #" << e->no << "\n";
+
+            // ** Me matrix => Md vector
+            Eigen::MatrixXd Me = WaveTerm::buildM(*e);
+
+            // ** Ke matrix => K matrix
+            Eigen::MatrixXd Ke = WaveTerm::buildK(*e, u);
+
+            // assembly
+            tbb::spin_mutex::scoped_lock lock(mutex);
+
+            for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+            {
+                Node *nodi = e->nodes[ii];
+                for (size_t jj = 0; jj < e->nodes.size(); ++jj)
+                {
+                    Node *nodj = e->nodes[jj];
+                    T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, (mat->c * mat->c) * Ke(ii, jj)));
+                    Md[nodi->row] += Me(ii, jj);
+                }
+            }
+        });
+    }
+    // Build, clean and turn to compressed row format
+    K2.setFromTriplets(T.begin(), T.end());
+    K2.prune(0.);
+    K2.makeCompressed();
+
+    std::cout << "S (" << K2.rows() << "," << K2.cols() << ") nnz=" << K2.nonZeros() << "\n";
+    chrono1.read();
+    std::cout << "[cpu] " << chrono1 << '\n';
+}
+
+/*void TimeIntegration::build(MATTYPE type, Eigen::SparseMatrix<double, Eigen::RowMajor> &A2)
+{
+    tbb::spin_mutex mutex;
+    tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads); // TODO mettre ça ailleurs...
+
+    auto msh = pbl->msh;
+    std::deque<Eigen::Triplet<double>> T; // list of triplets to build K matrix
+
+    std::cout << "building " << type << " using " << nthreads << " threads...\n";
+
+    for (auto mat : pbl->media)
+    {
+        std::cout << "\tprocessing " << *mat << '\n';
+        tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(),
+                         [&](Element *e) {
+                             if (e->type() != ElType::HEX8)
+                                 return;
+                             Eigen::MatrixXd Ae = e->build(type);
+
+                             // assembly
+                             tbb::spin_mutex::scoped_lock lock(mutex);
+                             for (size_t ii = 0; ii < e->nodes.size(); ++ii)
+                             {
+                                 Node *nodi = e->nodes[ii];
+                                 for (size_t jj = 0; jj < e->nodes.size(); ++jj)
+                                 {
+                                     Node *nodj = e->nodes[jj];
+                                     T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, Ae(ii, jj)));
+                                 }
+                             }
+                         });
+    }
+    // Build, clean and turn to compressed row format
+    A2.setFromTriplets(T.begin(), T.end());
+    A2.prune(0.);
+    A2.makeCompressed();
+
+    std::cout << "S (" << A2.rows() << "," << A2.cols() << ") nnz=" << A2.nonZeros() << "\n";
+    chrono1.read();
+    std::cout << "[cpu] " << chrono1 << '\n';
+}*/
+
+void TimeIntegration::write(std::ostream &out) const
+{
+    out << clsname() << "\n";
+    out << "\tttot     = " << ttot << "\n";
+    out << "\tdt       = " << dt << "\n";
+    out << "\tsavefreq = " << savefreq << "\n";
+}
diff --git a/waves/src/wTimeIntegration.h b/waves/src/wTimeIntegration.h
new file mode 100644
index 0000000000000000000000000000000000000000..b47326b970ee6c174b39abb039b28179146ca044
--- /dev/null
+++ b/waves/src/wTimeIntegration.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WTIMEINTEGRATION_H
+#define WTIMEINTEGRATION_H
+
+#include "waves.h"
+#include "wObject.h"
+#include "wTimer.h"
+#include "wElement.h"
+#include <iostream>
+#include <vector>
+#include <memory>
+#include <Eigen/Sparse>
+
+namespace waves
+{
+
+enum class Wgmsh
+{
+    WG_NONE = 0, ///< do not write results on disk
+    WG_ONE = 1,  ///< continuously overwrite the same result file (onelab)
+    WG_ALL = 2   ///< write a separate file for each archived step
+};
+
+/**
+ * @brief Time integration base class
+ */
+
+class WAVES_API TimeIntegration : public fwk::wObject
+{
+public:
+    bool verbose;
+    std::shared_ptr<Problem> pbl;
+#ifndef SWIG
+    DisplayHook *dhook;
+#endif
+
+    bool stopit;
+
+    int nthreads; ///< nb of threads for the assembly
+    Wgmsh wgmsh;  ///< how to write results on disk?
+
+    double ttot;  ///< final time
+    double dt;    ///< time step
+    int savefreq; ///< archive/update_gui frequency
+
+    fwk::Timer chrono1;
+
+    std::vector<double> u1;
+    std::vector<double> v1;
+
+    TimeIntegration(std::shared_ptr<waves::Problem> _pbl);
+
+    virtual char const *clsname() const { return "TimeIntegration"; }
+
+    virtual void start(tbox::MshExport *mshWriter);
+
+    void dummyIC();
+
+    void buildS(Eigen::SparseMatrix<double, Eigen::RowMajor> &S2);
+
+    void buildKM(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, std::vector<double> &Md, std::vector<double> const &u);
+    void buildKM_tbb_lambda(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, std::vector<double> &Md, std::vector<double> const &u);
+
+    void setGUI(DisplayHook &hook) { dhook = &hook; }
+
+    //void build(tbox::MATTYPE type, Eigen::SparseMatrix<double, Eigen::RowMajor> &A2);
+
+    void stop() { stopit = true; }
+
+#ifndef SWIG
+    virtual void write(std::ostream &out) const override;
+#endif
+};
+
+} // namespace waves
+
+#endif //WTIMEINTEGRATION_H
diff --git a/waves/src/wWaveTerm.cpp b/waves/src/wWaveTerm.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6b92dbee164d29ffe1949c846d312d4fe75a77e1
--- /dev/null
+++ b/waves/src/wWaveTerm.cpp
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wWaveTerm.h"
+
+#include "wElement.h"
+#include "wCache.h"
+#include "wGauss.h"
+
+using namespace waves;
+using namespace tbox;
+
+/**
+ * @brief Build volume stiffness matrix for the waves equation on one element
+ */
+Eigen::MatrixXd WaveTerm::buildK(Element const &e, std::vector<double> const &u)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    // Stiffness matrix
+    Eigen::MatrixXd K = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size());
+    for (size_t k = 0; k < gauss.getN(); ++k)
+    {
+        // Jacobian inverse and shape functions
+        Eigen::Matrix3d const &J = e.getJinv(k);
+        Eigen::MatrixXd const &dff = cache.getDsf(k);
+
+        // Elementary stiffness matrix
+        K += (J * dff).transpose() * J * dff * gauss.getW(k) * e.getDetJ(k);
+    }
+    return K;
+}
+
+/**
+ * @brief Build volume/surface mass matrix for the waves equation on one element
+ */
+Eigen::MatrixXd WaveTerm::buildM(Element const &e)
+{
+    // Get precomputed values
+    Cache &cache = e.getVCache();
+    Gauss &gauss = cache.getVGauss();
+
+    // Mass matrix
+    Eigen::MatrixXd M = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size());
+    for (size_t k = 0; k < gauss.getN(); ++k)
+    {
+        // Shape functions
+        Eigen::VectorXd const &ff = cache.getSf(k);
+        M += ff * ff.transpose() * gauss.getW(k) * e.getDetJ(k);
+    }
+    return M;
+}
diff --git a/waves/src/wWaveTerm.h b/waves/src/wWaveTerm.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ad3a384375d2c3c2142294f751f1f0c1da9ddfd
--- /dev/null
+++ b/waves/src/wWaveTerm.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WWAVETERM_H
+#define WWAVETERM_H
+
+#include "waves.h"
+
+#include <vector>
+#include <Eigen/Dense>
+
+namespace waves
+{
+
+/**
+ * @brief Formulation of wave terms
+ */
+class WAVES_API WaveTerm
+{
+public:
+    // Stiffness matrix
+    static Eigen::MatrixXd buildK(tbox::Element const &e, std::vector<double> const &u);
+    // Mass matrix
+    static Eigen::MatrixXd buildM(tbox::Element const &e);
+};
+
+} // namespace waves
+#endif //WWAVETERM_H
diff --git a/waves/src/waves.h b/waves/src/waves.h
new file mode 100644
index 0000000000000000000000000000000000000000..46f05cca61dd4d9114762d381ff181d8c665a971
--- /dev/null
+++ b/waves/src/waves.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2022 University of Liège
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// global header of the waves module
+
+#ifndef WAVES_H
+#define WAVES_H
+
+#if defined(WIN32)
+#ifdef waves_EXPORTS
+#define WAVES_API __declspec(dllexport)
+#else
+#define WAVES_API __declspec(dllimport)
+#endif
+#else
+#define WAVES_API
+#endif
+
+#include "tbox.h"
+
+namespace waves
+{
+class Problem;
+class Source;
+class Medium;
+class Boundary;
+
+class DisplayHook;
+
+class WaveTerm;
+
+class TimeIntegration;
+class ForwardEuler;
+class RungeKutta;
+class Newmark;
+} // namespace waves
+
+#endif //WAVES_H
diff --git a/waves/srcs.py b/waves/srcs.py
new file mode 100644
index 0000000000000000000000000000000000000000..47a9950112b1e8bf505642942958a218441da8a9
--- /dev/null
+++ b/waves/srcs.py
@@ -0,0 +1,86 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# custom sources coded with python
+
+import waves as w
+import tbox
+import math
+
+
+class SinSource(w.Source):
+    def __init__(self, msh, num_or_name, freq):
+        w.Source.__init__(self, msh, num_or_name)
+        self.freq = freq
+
+    def apply(self, t, u):
+        for n in self.nodes:  # necessite %nothread swig::SwigPyIterator::~SwigPyIterator() dans le .i
+            u[n.row] = math.sin(2 * math.pi * self.freq * t)
+
+
+class Src:
+    def __init__(self, nod, freq):
+        self.nod = nod
+        self.freq = freq
+#    def __del__(self):
+#        print "[Src] I'm dying..."
+
+
+class MultiSource(w.Source):
+    def __init__(self, msh, num_or_name):
+        w.Source.__init__(self, msh, num_or_name)
+
+        self.srcs = []
+
+    def apply(self, t, u):
+        for s in self.srcs:  # necessite %nothread swig::SwigPyIterator::~SwigPyIterator() dans le .i
+            u[s.nod.row] = math.sin(2 * math.pi * s.freq * t)
+
+    def addSource(self, p, freq):
+        dist = 1e10
+        for n in self.nodes:
+            v = n.pos - p
+            v[2] = 0
+            d = v.norm()
+            if d < dist:
+                dist = d
+        for n in self.nodes:
+            v = n.pos - p
+            v[2] = 0
+            d = v.norm()
+            if abs(d - dist) < 1.0e-6:
+                print("node source selected at ", n)
+                print("dist", dist)
+                print("nod=", n)
+                self.srcs.append(Src(n, freq))
+
+    def __del__(self):
+        print("[MultiSource] I'm dying...")
+
+
+class PulseSource(w.Source):
+    def __init__(self, msh, num_or_name, freq, shift, width):
+        w.Source.__init__(self, msh, num_or_name)
+        self.freq = freq
+        self.shift = shift
+        self.width = width
+
+    def apply(self, t, u):
+        for n in self.nodes:
+            shift = 0.3
+            u[n.row] = math.sin(2 * math.pi * self.freq * t) * math.exp(
+                -(t - self.shift) * (t - self.shift) * self.width)
diff --git a/waves/tests/attic/bulthuis.geo b/waves/tests/attic/bulthuis.geo
new file mode 100644
index 0000000000000000000000000000000000000000..15180a74609880030731448d0e4a08d78689f694
--- /dev/null
+++ b/waves/tests/attic/bulthuis.geo
@@ -0,0 +1,78 @@
+/* ========================================================================= *
+ *
+ *                        MATH0471-A
+ *            Projet de calcul scientifique multiphysique
+ *            Domaine paramétrable pour résoudre l'équation d'onde.
+ *
+/* ========================================================================= *
+
+/*-----------Parameters-----------------------------------*/
+
+xposition[]={0,10,20};     //Division along x axis       
+strate[]={0,-5,-10,-20,-30};     //Division along y axis 
+Z=1;  
+
+nx[]={30,30};               //Number of subdivisions along each division (x axis)
+ny[]={1,2,3,4};                      //Number of subdivisions along each divison (y axis)
+nz=2;                           //Number of subdivisions along z axis (for z>0)
+
+objects[]={};                    //Number of the block associated with an object
+
+/*---------------------------------------------------------*/
+
+lengthxposition=#xposition[];
+lengthstrate=#strate[];
+nbobjects=#objects[];
+
+For k In {0:lengthstrate-1}                                     //Point definition
+  For  j In {1:lengthxposition}
+    Point(k*lengthxposition+j)={xposition[j-1],strate[k],0,1.0}; 
+EndFor
+EndFor
+
+For k In {0:lengthstrate-1}                                    //Horizontal line definition
+  For  j In {1:lengthxposition-1}
+    Line(k*(lengthxposition-1)+j)={k*lengthxposition+j,k*lengthxposition+j+1};
+    Transfinite Line {k*(lengthxposition-1)+j}=nx[j-1]+1;
+EndFor
+EndFor
+
+nbhorizontal = lengthstrate*(lengthxposition-1);
+
+For k In {0:lengthstrate-2}                                    //Vertical line definition
+  For  j In {1:lengthxposition}
+    Line(nbhorizontal+k*lengthxposition+j)={k*lengthxposition+j,(k+1)*lengthxposition+j};
+    Transfinite Line {nbhorizontal+k*lengthxposition+j}=ny[k]+1;
+EndFor
+EndFor
+
+
+For k In {0:(lengthstrate-2)}                                 //Surface definition  + extrusion           
+    For   j In {1:lengthxposition-1}
+     stop=0;
+
+     For  i In {0:nbobjects-1}
+        If (k*(lengthxposition-1)+j == objects[i])
+        stop=1;
+        EndIf
+     EndFor
+
+     If(stop !=1)
+     Line Loop(k*(lengthxposition-1)+j)={k*(lengthxposition-1)+j,nbhorizontal+k*lengthxposition+j+1,-((k+1)*(lengthxposition-1)+j),
+     -(nbhorizontal+k*lengthxposition+j)};
+     Plane Surface(k*(lengthxposition-1)+j)={k*(lengthxposition-1)+j};
+     Transfinite Surface{k*(lengthxposition-1)+j};
+     Recombine Surface{k*(lengthxposition-1)+j};
+
+     Extrude {0, 0, Z} {
+     Surface{k*(lengthxposition-1)+j}; Layers{nz}; Recombine;
+                        }
+      Extrude {0, 0, -Z} {
+      Surface{k*(lengthxposition-1)+j}; Layers{nz}; Recombine;
+                          }
+     EndIf
+    
+     EndFor
+EndFor
+
+
diff --git a/waves/tests/attic/strates.geo b/waves/tests/attic/strates.geo
new file mode 100644
index 0000000000000000000000000000000000000000..f6e5f0fd8a58d823f547eeae513d36ffaac5ff84
--- /dev/null
+++ b/waves/tests/attic/strates.geo
@@ -0,0 +1,49 @@
+// $Id$
+// fichier de donnees gmsh
+
+lc = 1/2;
+
+
+Lx = 10;
+Ly = 10;
+
+Lz = 10/2;
+
+nl = 20/2;
+
+Point(1) = {  0,   0, 0, lc};
+Point(2) = { Lx,   0, 0, lc};
+Point(3) = { Lx, -Ly, 0, lc};
+Point(4) = {-Lx, -Ly, 0, lc};
+Point(5) = {-Lx,   0, 0, lc};
+
+Line(1) = {1, 2};
+Line(2) = {2, 3};
+Line(3) = {3, 4};
+Line(4) = {4, 5};
+Line(5) = {5, 1};
+Line Loop(6) = {5, 1, 2, 3, 4};
+Plane Surface(7) = {6};
+Recombine Surface {7};
+
+Extrude {0, 0, Lz} 
+{
+  Surface{7}; Layers{nl}; Recombine;
+}
+
+Extrude {0, 0, -Lz} 
+{
+  Surface{7}; Layers{nl}; Recombine;
+}
+
+// physical entities
+
+Physical Point("Source Point") = {1};
+Physical Line("Measurement line") = {1};
+Physical Surface("Up Side") = {17, 44, 48, 21};
+Physical Surface("Bottom Side") = {29, 56};
+Physical Surface("Front Side") = {34};
+Physical Surface("Rear Side") = {61};
+Physical Surface("Right Side") = {25, 52};
+Physical Surface("Left Side") = {33, 60};
+Physical Volume("Volume") = {1, 2};
diff --git a/waves/tests/mat1/interf1.py b/waves/tests/mat1/interf1.py
new file mode 100644
index 0000000000000000000000000000000000000000..ecb9854d70cc65dce3216a7fbdedaf2e93c57997
--- /dev/null
+++ b/waves/tests/mat1/interf1.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane1mat as m
+    m.runmodel(bc='interf1', Ly=5.0, Ny=50)
diff --git a/waves/tests/mat1/interf2.py b/waves/tests/mat1/interf2.py
new file mode 100644
index 0000000000000000000000000000000000000000..b2adf8455ad46ffc42fd76afffe7be91d630654b
--- /dev/null
+++ b/waves/tests/mat1/interf2.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane1mat as m
+    m.runmodel(bc='interf2')
diff --git a/waves/tests/mat1/planewave.py b/waves/tests/mat1/planewave.py
new file mode 100644
index 0000000000000000000000000000000000000000..c3b960817e32cd8b8a69c52c3c922f6dba6da74e
--- /dev/null
+++ b/waves/tests/mat1/planewave.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane1mat as m
+    m.runmodel(bc='planewave', Ly=1., Ny=10, Lx=30., Nx=300, ttot=3.0)
diff --git a/waves/tests/mat1/pulse.py b/waves/tests/mat1/pulse.py
new file mode 100644
index 0000000000000000000000000000000000000000..61bacc5b1bc99c8b20d96855ed2d005c69cc4cd9
--- /dev/null
+++ b/waves/tests/mat1/pulse.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane1mat as m
+    m.runmodel(bc='pulse', Lx=5., Ly=5., Nx=50, Ny=50)
diff --git a/waves/tests/mat1/sinsrc.py b/waves/tests/mat1/sinsrc.py
new file mode 100644
index 0000000000000000000000000000000000000000..571580b03262a7f94936c462692277291713c0e6
--- /dev/null
+++ b/waves/tests/mat1/sinsrc.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane1mat as m
+    m.runmodel(bc='sinsrc')
diff --git a/waves/tests/mat2/interf1.py b/waves/tests/mat2/interf1.py
new file mode 100644
index 0000000000000000000000000000000000000000..8342157a3406f43e26f7fc22aaded2ef44e9b5b5
--- /dev/null
+++ b/waves/tests/mat2/interf1.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane2mat as m
+    m.runmodel(bc='interf1')
diff --git a/waves/tests/mat2/pulse.py b/waves/tests/mat2/pulse.py
new file mode 100644
index 0000000000000000000000000000000000000000..6596d94ec6254aeb51f8b3beae8f000592c1986d
--- /dev/null
+++ b/waves/tests/mat2/pulse.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane2mat as m
+    m.runmodel(bc='pulse', Lx=2.0, Nx=20, Ny1=100)
diff --git a/waves/tests/mat2/reflex.py b/waves/tests/mat2/reflex.py
new file mode 100644
index 0000000000000000000000000000000000000000..8bd0db96b738ddbe5fbd258e7ff7033e23681ae8
--- /dev/null
+++ b/waves/tests/mat2/reflex.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane2mat as m
+    m.runmodel(bc='reflex', Ny2=25)
diff --git a/waves/tests/mat2/sinsrc.py b/waves/tests/mat2/sinsrc.py
new file mode 100644
index 0000000000000000000000000000000000000000..575ea91fe4178898c0914a9b76c3157acbbfb262
--- /dev/null
+++ b/waves/tests/mat2/sinsrc.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+if __name__ == "__main__":
+    import waves.models.plane2mat as m
+    m.runmodel(
+        bc='sinsrc', Ly1=10, Ny1=100, Ly2=10, Ny2=50, Lx=2., Nx=10, ttot=2.)
diff --git a/waves/utils.py b/waves/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..ffab945dada68c5956beb7b19d3bb22a5facaeaf
--- /dev/null
+++ b/waves/utils.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import tbox
+import waves as w
+
+
+def integrate(scheme, writer, vmin=-0.1, vmax=0.1):
+    from fwk.wutils import parseargs
+    args = parseargs()
+
+    scheme.nthreads = args.k
+    print(scheme)
+
+    if args.nogui:
+        scheme.start(writer)
+    else:
+        import waves.viewer as v
+        gui = v.MeshViewer(scheme)
+        gui.vmin = vmin
+        gui.vmax = vmax
+        gui.start()
diff --git a/waves/viewer.py b/waves/viewer.py
new file mode 100644
index 0000000000000000000000000000000000000000..197bf0505f5592b73b39379eed20063df3eda326
--- /dev/null
+++ b/waves/viewer.py
@@ -0,0 +1,456 @@
+# -*- coding: utf-8 -*-
+# test encoding: à-é-è-ô-ï-€
+
+
+# Copyright 2022 University of Liège
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import sys
+import waves as w
+import tbox as tb
+
+# TODO: creer un objet dataset qui gere l'ugrid (comme dans Metafor)
+
+# Qt
+try:
+    from PyQt5.QtCore import *
+    from PyQt5.QtGui import *
+    from PyQt5.QtWidgets import *
+    print("PyQt5 (Qt %s) loaded!" % QT_VERSION_STR)
+except :
+    try:
+        import  PySide2
+        from PySide2.QtCore import *
+        from PySide2.QtGui import *
+        from PySide2.QtWidgets import *
+        #print("PySide2  loaded!")
+        print("PySide2 (Qt %s) loaded!" % PySide2.__version__)
+    except :
+        print("Unable to load PyQt nor PySide2")
+        sys.exit()
+        
+
+# vtk
+import vtk
+try:
+    from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
+    print("using vtk.qt.QVTKRenderWindowInteractor")
+except:
+    from tboxVtk.qt5vtk6.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
+    print("using pki.qt5vtk6.QVTKRenderWindowInteractor")
+
+# -----------------------------------------------------------------------------------------
+
+
+class MeshViewer(QWidget, w.DisplayHook):
+
+    app = QApplication(sys.argv)
+    """
+    Qt GUI for visu. the output
+    """
+
+    def __init__(self, scheme):
+        #super(MeshViewer, self).__init__() # a eclaircir... marche pô
+        w.DisplayHook.__init__(self)
+        QWidget.__init__(self)
+
+        scheme.setGUI(self)
+
+        self.msh = scheme.pbl.msh
+        self.scheme = scheme
+        self.writer = tb.GmshExport(self.msh)
+
+        self.running = 'init'
+        self.vmin = -0.1
+        self.vmax = 0.1
+
+        print("starting MeshViewer init...")
+
+        self.__setupGUI()
+        self.__setupVTK()
+
+        self.app.lastWindowClosed.connect(self.app.quit)
+        self.show()
+        self.vtkwidget.Initialize(
+        )  # [Linux] faire ca le plus tard possible (apres self.show!!)
+        print("MeshViewer ready.")
+
+    def closeEvent(self, event):
+        self.scheme.stopit = True
+        self.running = 'running'  # sort de "while self.running=='pause'"
+        print("GUI killed!")
+        QWidget.closeEvent(self, event)
+
+    def start(self):
+        self.app.exec_()
+
+    def __setupGUI(self):
+
+        self.setWindowTitle("MeshViewer")
+        self.resize(800, 600)
+
+        # vtk window
+
+        self.vtkwidget = QVTKRenderWindowInteractor(
+            self)  # "self" sinon, rien ne s'affiche
+
+        self.vtkwidget.setSizePolicy(
+            QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
+        self.vtkwidget.setMinimumSize(QSize(300, 300))
+        self.vtkwidget.setSizePolicy(QSizePolicy.Expanding,
+                                     QSizePolicy.Expanding)
+
+        #self.vtkwidget.Initialize() # plante sous Linux!!
+
+        self.renderer = vtk.vtkRenderer()
+        self.renderer.SetBackground(1.0, 1.0, 1.0)
+        self.vtkwidget.GetRenderWindow().AddRenderer(self.renderer)
+
+        style = vtk.vtkInteractorStyleTrackballCamera()
+        self.vtkwidget.SetInteractorStyle(style)
+
+        hbox = QHBoxLayout()
+        self.setLayout(hbox)
+        hbox.addWidget(self.vtkwidget)
+
+        pan = QFrame()
+        pan.setMaximumSize(QSize(200, 999999))
+        hbox.addWidget(pan)
+        #hbox.setMargin(0)    # sinon vtkwidget degouline en bas
+        #hbox.setSpacing(0)   # sinon vtkwidget clignote sur le côté
+
+        vbox = QVBoxLayout()
+        pan.setLayout(vbox)
+
+        self.startBut = QPushButton(self.tr("start!"))
+        self.startBut.clicked.connect(self.startSlot)
+        vbox.addWidget(self.startBut)
+
+        groupBox = QGroupBox("Scale")
+        gbox = QGridLayout()
+        label = QLabel("vmin")
+        gbox.addWidget(label, 0, 0)
+        self.vminlinedt = QLineEdit('%f' % self.vmin)
+        self.vminlinedt.editingFinished.connect(self.updateTCoords)
+        gbox.addWidget(self.vminlinedt, 0, 1)
+        label = QLabel("vmax")
+        gbox.addWidget(label, 1, 0)
+        self.vmaxlinedt = QLineEdit('%f' % self.vmax)
+        self.vmaxlinedt.editingFinished.connect(self.updateTCoords)
+        gbox.addWidget(self.vmaxlinedt, 1, 1)
+        groupBox.setLayout(gbox)
+        vbox.addWidget(groupBox)
+
+        verbchk = QCheckBox("verbose")
+        verbchk.setChecked(self.scheme.verbose)
+        verbchk.stateChanged.connect(self.verboseSlot)
+        vbox.addWidget(verbchk)
+
+        groupBox = QGroupBox("Infos")
+        self.steplabel = QLabel("step # 0")
+        self.timelabel = QLabel("time = 0")
+        gbox = QVBoxLayout()
+        groupBox.setLayout(gbox)
+        gbox.addWidget(self.steplabel)
+        gbox.addWidget(self.timelabel)
+        vbox.addWidget(groupBox)
+
+        vbox.addStretch(1)
+
+    def verboseSlot(self, state):
+        self.scheme.verbose = (state != 0)
+        if not state:
+            print("<verbose=OFF>")
+
+    def startSlot(self):
+        if self.running == 'init':
+            self.startBut.setText("Pause")  # on demarre et on affiche "pause"
+            self.running = 'running'
+            self.scheme.start(self.writer)
+            self.startBut.setText("Quit")
+            self.running = 'quit'
+        elif self.running == 'running':  # on stoppe et on affiche 'continue"
+            self.running = 'pause'
+            self.startBut.setText("Continue")
+            while self.running == 'pause':
+                self.app.processEvents(QEventLoop.WaitForMoreEvents)
+        elif self.running == 'pause':
+            self.running = 'running'
+            self.startBut.setText("Pause")
+        elif self.running == 'quit':
+            self.app.quit()
+
+    def disableStart(self):
+        self.startBut.setDisabled(True)
+
+    def __setupVTK(self):
+
+        self.__createUgrid()
+
+        # mesh
+        self.mesh = Mesh(self.ugrid)
+        self.renderer.AddActor(self.mesh.actor)
+
+        # grid
+        self.grid = Grid(self.ugrid)
+        self.renderer.AddViewProp(self.grid.actor)
+
+        #scalarbar
+        self.scalarbar = ScalarBar(self.mesh.lut)
+        self.renderer.AddViewProp(self.scalarbar.actor)
+
+        self.resetCamera()
+
+    def resetCamera(self):
+        self.renderer.ResetCamera()
+        cam1 = self.renderer.GetActiveCamera()
+        # 3D
+        if 0:
+            cam1.Elevation(35)
+            cam1.SetViewUp(0, 1, 0)
+            cam1.Azimuth(30)
+        #2D
+        else:
+            cam1.Elevation(0)
+            cam1.SetViewUp(0, 1, 0)
+            cam1.Azimuth(0)
+        self.renderer.ResetCameraClippingRange()
+
+    def display(self, nt, t, u):
+        """ C++ => python callback
+        """
+        #print "[GUI] nt=", nt, "t=", t
+
+        self.steplabel.setText("step # %d (%d%%)" %
+                               (nt, t / self.scheme.ttot * 100))
+        self.timelabel.setText("time = %f" % t)
+
+        # update data at points
+        for i in range(self.msh.nodes.size()):
+            self.scalars.SetValue(i, u[i])
+        self.scalars.Modified()
+
+        # update texture coords
+        #vmin, vmax = self.scalars.GetValueRange()
+        #vmin=-0.01
+        #vmax=0.01
+
+        self.updateTCoords()
+
+    def updateTCoords(self):
+        try:
+            self.vmin = float(self.vminlinedt.text())
+            self.vmax = float(self.vmaxlinedt.text())
+        except:
+            pass
+
+        self.mesh.updateTcoords(self.vmin, self.vmax)
+        self.render()
+
+    def ragequit(self):
+        print("rage quit!")
+        self.scheme.stopit = True
+        self.app.quit()
+
+        #raise Exception('GUI killed!')
+
+    def render(self):
+        # draw the scene
+        self.vtkwidget.Render()
+        self.app.processEvents()
+
+    def refresh(self):
+        #print "[GUI] refresh"
+        self.app.processEvents()
+
+    def __createUgrid(self):
+        print('creating vtkUnstructuredGrid...')
+        self.ugrid = vtk.vtkUnstructuredGrid()
+        self.points = vtk.vtkPoints()
+        self.ugrid.SetPoints(self.points)
+
+        self.scalars = vtk.vtkFloatArray()
+        self.scalars.SetNumberOfComponents(1)
+        self.ugrid.GetPointData().SetScalars(self.scalars)
+
+        # points / data
+        for i in range(self.msh.nodes.size()):
+            p = self.msh.nodes[i].pos
+            self.points.InsertPoint(i, p[0], p[1], p[2])
+            #val = p.x()*p.x()+p.y()*p.y()+p.z()*p.z()
+            val = 0.0
+            self.scalars.InsertNextValue(val)
+
+        # hexa
+        for i in range(self.msh.elems.size()):
+            e = self.msh.elems[i]
+            n = e.nodes
+            if e.type() == tb.ELTYPE_HEX8:
+                hexa = vtk.vtkHexahedron()
+                ids = hexa.GetPointIds()
+                for j in range(8):
+                    ids.SetId(j, n[j].no - 1)
+                self.ugrid.InsertNextCell(hexa.GetCellType(), ids)
+        print(self.ugrid.GetNumberOfPoints(
+        ), 'points and', self.ugrid.GetNumberOfCells(), 'cells converted')
+
+    def writeXML(self, name='mesh.vtu'):
+        writer = vtk.vtkXMLUnstructuredGridWriter()
+        compressor = vtk.vtkZLibDataCompressor()
+        writer.SetCompressor(compressor)
+        writer.SetDataModeToAscii()
+        writer.SetInputConnection(self.producer.GetOutputPort())
+        writer.SetFileName(name)
+        writer.Write()
+
+    def write(self, name='mesh.vtk'):
+        writer = vtk.vtkUnstructuredGridWriter()
+        writer.SetFileName(name)
+        writer.SetFileTypeToASCII()
+        writer.SetInputConnection(self.producer.GetOutputPort())
+        writer.Write()
+
+
+class Mesh:
+    def __init__(self, ugrid):
+
+        self.ugrid = ugrid
+
+        # compatibility vtk 5/6 => use a trivial producer
+        #self.producer = vtk.vtkTrivialProducer()
+        #self.producer.SetOutput(self.ugrid) # le double producer (dans Mesh/Grid) ne marche pas sous Qt 4 => faire un objet dataset
+
+        self.__createTexture()
+        self.__createTcoords()
+        vmin, vmax = self.ugrid.GetPointData().GetScalars().GetValueRange()
+        self.updateTcoords(vmin, vmax)
+
+        self.mapper = vtk.vtkDataSetMapper()
+        #self.mapper.SetInputConnection(self.producer.GetOutputPort())
+        self.mapper.SetInputData(ugrid)
+        if vtk.VTK_MAJOR_VERSION <= 7:
+            self.mapper.ImmediateModeRenderingOff()
+        self.mapper.SetResolveCoincidentTopologyToPolygonOffset()
+        self.mapper.ScalarVisibilityOff()
+
+        self.actor = vtk.vtkActor()
+        self.actor.SetMapper(self.mapper)
+        self.actor.SetTexture(self.texture)
+
+    def __createTcoords(self):
+        self.tcoords = vtk.vtkFloatArray()
+        self.tcoords.SetNumberOfComponents(2)
+        self.tcoords.Resize(
+            self.ugrid.GetPointData().GetScalars().GetNumberOfTuples())
+        self.ugrid.GetPointData().SetTCoords(self.tcoords)
+
+    def updateTcoords(self, vmin, vmax):
+        #print 'vmin=',vmin,' vmax=',vmax
+        if vmin == vmax:
+            dist = 1.0
+        else:
+            dist = vmax - vmin
+        thr = 1. / 256.
+        scalars = self.ugrid.GetPointData().GetScalars()
+        for i in range(scalars.GetNumberOfTuples()):
+            val = scalars.GetTuple1(i)
+            tc = (val - vmin) / dist
+            if (tc < thr): tc = thr
+            if (tc > 1.0 - thr): tc = 1.0 - thr
+            self.tcoords.InsertTuple2(i, tc, tc)
+
+        self.lut.SetTableRange(vmin, vmax)  # utile pour la scalarbar seulement
+        self.lut.Build()
+
+    def __createTexture(self):
+        # lookup table
+        #(utilisée 1x au demarrage pour la texture)
+        #(puis pour la scalarbar)
+        self.lut = vtk.vtkLookupTable()
+        self.lut.SetNumberOfColors(16)
+        self.lut.SetHueRange(0., 0.667)
+        self.lut.SetTableRange(
+            0.0, 1.0)  # valeurs bidons -> pas d'infl sur la texture
+        self.lut.Build()
+
+        self.texture = vtk.vtkTexture()
+        dim = self.lut.GetNumberOfTableValues()
+        img = vtk.vtkImageData()
+        img.SetDimensions(dim, dim, 1)
+
+        if vtk.VTK_MAJOR_VERSION <= 5:
+            img.SetScalarTypeToUnsignedChar()
+            img.SetNumberOfScalarComponents(3)
+            img.AllocateScalars()
+        else:
+            img.AllocateScalars(vtk.VTK_UNSIGNED_CHAR, 3)
+
+        for i in range(dim):
+            ci = self.lut.GetTableValue(i)
+            for k in range(3):
+                img.SetScalarComponentFromDouble(i, i, 0, k, ci[k] * 255)
+        if vtk.VTK_MAJOR_VERSION <= 5:
+            self.texture.SetInput(img)
+        else:
+            self.texture.SetInputData(img)
+
+        if 0:  # --display texture using vtkImageViewer2 (DEBUG)
+            imageViewer = vtk.vtkImageViewer2()
+            if vtk.VTK_MAJOR_VERSION <= 5:
+                imageViewer.SetInput(img)
+            else:
+                imageViewer.SetInputData(img)
+            renderWindowInteractor = vtk.vtkRenderWindowInteractor()
+            imageViewer.SetupInteractor(renderWindowInteractor)
+            imageViewer.Render()
+            imageViewer.GetRenderer().ResetCamera()
+            imageViewer.Render()
+            renderWindowInteractor.Start()
+
+
+class ScalarBar:
+    def __init__(self, lut):
+        self.actor = vtk.vtkScalarBarActor()
+        self.actor.SetLookupTable(lut)
+        self.actor.GetPositionCoordinate(
+        ).SetCoordinateSystemToNormalizedViewport()
+        self.actor.GetPositionCoordinate().SetValue(0.1, 0.05)
+        self.actor.SetOrientationToHorizontal()
+        self.actor.SetWidth(0.8)
+        self.actor.SetHeight(0.1)
+        self.actor.GetTitleTextProperty().SetFontFamilyToArial()
+        self.actor.GetLabelTextProperty().SetFontFamilyToArial()
+        self.actor.SetLabelFormat("%g")
+        self.actor.GetTitleTextProperty().SetColor(0., 0., 0.)
+        self.actor.GetLabelTextProperty().SetColor(0., 0., 0.)
+        self.actor.SetTitle("pressure")
+
+
+class Grid:
+    def __init__(self, ugrid):
+        self.mapper = vtk.vtkDataSetMapper()
+        if vtk.VTK_MAJOR_VERSION <= 7:
+            self.mapper.ImmediateModeRenderingOff()
+        self.mapper.SetResolveCoincidentTopologyToPolygonOffset()
+        self.mapper.ScalarVisibilityOff()
+        self.mapper.SetInputData(ugrid)
+        self.actor = vtk.vtkActor()
+
+        self.actor.GetProperty().SetRepresentationToWireframe()
+        self.actor.GetProperty().SetColor(0., 0., 0.)
+        self.actor.GetProperty().SetAmbient(1.0)
+        self.actor.GetProperty().SetDiffuse(0.0)
+        self.actor.GetProperty().SetSpecular(0.0)
+        self.actor.SetMapper(self.mapper)