diff --git a/.clang-format b/.clang-format
deleted file mode 100644
index 60cf9d536e56d8675468717814ffb5698298cf1e..0000000000000000000000000000000000000000
--- a/.clang-format
+++ /dev/null
@@ -1,11 +0,0 @@
----
-# 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
deleted file mode 100644
index de6044b96d078e062de7f658aef508ff77461564..0000000000000000000000000000000000000000
--- a/.editorconfig
+++ /dev/null
@@ -1,8 +0,0 @@
-# EditorConfig is awesome: https://EditorConfig.org
-
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 4
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index b241726762fbae1fe47c8f8b7936c5abc8e5b168..0000000000000000000000000000000000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,6 +0,0 @@
-*_lfs.msh filter=lfs diff=lfs merge=lfs -text
-*_lfs.apdl filter=lfs diff=lfs merge=lfs -text
-*_lfs.ansys filter=lfs diff=lfs merge=lfs -text
-*.brep filter=lfs diff=lfs merge=lfs -text
-*.stp filter=lfs diff=lfs merge=lfs -text
-
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index c75d6969122a3061d7857371e186724cef740f0d..0000000000000000000000000000000000000000
--- a/.gitignore
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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 b/.gitlab-ci.yml
deleted file mode 100644
index d905eed8307f4b078806ba9f3aa1f400902aede4..0000000000000000000000000000000000000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,116 +0,0 @@
-# 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/.gitmodules b/.gitmodules
deleted file mode 100644
index e84a099a335811239805e43e471f8ab027d40310..0000000000000000000000000000000000000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "ext/amfe"]
-	path = ext/amfe
-	url = ../amfe.git
diff --git a/CMake/FindMPI4PY.cmake b/CMake/FindMPI4PY.cmake
deleted file mode 100644
index 9d4bb340d58c73fc7c83993c0c269de40e42c53a..0000000000000000000000000000000000000000
--- a/CMake/FindMPI4PY.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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(NOT MPI4PY_INCLUDE_DIR)
-    execute_process(COMMAND
-      "${PYTHON_EXECUTABLE}" "-c" "import mpi4py; print(mpi4py.get_include())"
-      OUTPUT_VARIABLE MPI4PY_INCLUDE_DIR
-      RESULT_VARIABLE MPI4PY_COMMAND_RESULT
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if(MPI4PY_COMMAND_RESULT)
-        message("waves/CMake/FindMPI4PY: mpi4py not found")
-        set(MPI4PY_FOUND FALSE)
-    else(MPI4PY_COMMAND_RESULT)
-        if (MPI4PY_INCLUDE_DIR MATCHES "Traceback")
-            message("waves/CMake/FindMPI4PY: mpi4py matches traceback")
-            ## Did not successfully include MPI4PY
-            set(MPI4PY_FOUND FALSE)
-        else (MPI4PY_INCLUDE_DIR MATCHES "Traceback")
-            ## successful
-            set(MPI4PY_FOUND TRUE)
-            set(MPI4PY_INCLUDE_DIR ${MPI4PY_INCLUDE_DIR} CACHE STRING "mpi4py include path")
-        endif (MPI4PY_INCLUDE_DIR MATCHES "Traceback")
-    endif(MPI4PY_COMMAND_RESULT)
-else(NOT MPI4PY_INCLUDE_DIR)
-    set(MPI4PY_FOUND TRUE)
-endif(NOT MPI4PY_INCLUDE_DIR)
-# ----------------------------------------------------------------------------
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(MPI4PY DEFAULT_MSG
-				MPI4PY_INCLUDE_DIR)
diff --git a/CMake/disable-trilinos.cmake b/CMake/disable-trilinos.cmake
deleted file mode 100644
index e941f2a4f949749b5dd9406f8bbfcb904d9691a8..0000000000000000000000000000000000000000
--- a/CMake/disable-trilinos.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-
-
-SET(WAVES_USE_KATOPTRON OFF CACHE BOOL "" FORCE)
-SET(WAVES_USE_TLNOS    OFF CACHE BOOL "" FORCE)
diff --git a/CMake/fabulous.cmake b/CMake/fabulous.cmake
deleted file mode 100644
index 77b1fbaa430b99642aa9abeaca5d50f8dcd21609..0000000000000000000000000000000000000000
--- a/CMake/fabulous.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES icpc)
-FIND_PROGRAM(CMAKE_C_COMPILER   NAMES icc)
diff --git a/CMake/maclam.cmake b/CMake/maclam.cmake
deleted file mode 100644
index fe5d340a688f63ee1bf7b30a3711d7c7b46b6ee3..0000000000000000000000000000000000000000
--- a/CMake/maclam.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# Disable Trilinos (we should test with Trilinos/clang)
-LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
-INCLUDE(disable-trilinos)
-
-SET(Python3_ROOT_DIR "/Library/Frameworks/Python.framework/Versions/3.7" CACHE PATH "" FORCE)
diff --git a/CMake/mingw32-msys.cmake b/CMake/mingw32-msys.cmake
deleted file mode 100644
index 24e405e5d26c2e745b3eaac37bba504cd0284c6f..0000000000000000000000000000000000000000
--- a/CMake/mingw32-msys.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-# 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.
-
-# MSYS Makefiles (pour MinGW)
-#
-# PATH=c:\MinGW\bin;C:\MinGW\msys\1.0\bin
-
-STRING(REGEX REPLACE "\\\\" "/" MYLOCAL $ENV{MYLOCAL})
-SET(CMAKE_GENERATOR "MSYS Makefiles" CACHE INTERNAL "" FORCE)
-
-SET(MUMPS_LIB_PATH       "${MYLOCAL}/WinMumps-4.10/MUMPS_4.10.0/lib/Release/x64/"  CACHE PATH "" FORCE)
-SET(MUMPS_INCLUDE_PATH   "${MYLOCAL}/WinMumps-4.10/MUMPS_4.10.0/include"           CACHE PATH "" FORCE)
-
-SET(WAVES_USE_MKL    OFF CACHE BOOL "" FORCE)
-SET(BLA_VENDOR    "OpenBlas" CACHE STRING "" FORCE)
diff --git a/CMake/mingw32.cmake b/CMake/mingw32.cmake
deleted file mode 100644
index ba1fd5453968e12d8c0f60622e9d1ebb61a7fb57..0000000000000000000000000000000000000000
--- a/CMake/mingw32.cmake
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-
-# MinGW Makefiles (pour "mingw32-make")
-#
-#  PATH=c:\MinGW\bin;C:\MinGW\msys\1.0\bin (en desactivant "sh.exe" du PATH)
-# ou
-#  PATH=c:\MinGW\bin
-
-STRING(REGEX REPLACE "\\\\" "/" MYLOCAL $ENV{MYLOCAL})
-SET(CMAKE_GENERATOR "MinGW Makefiles" CACHE INTERNAL "" FORCE)
-
-#SET(MUMPS_LIB_PATH       "${MYLOCAL}/WinMumps-4.10/MUMPS_4.10.0/lib/Release/x64/"  CACHE PATH "" FORCE)
-#SET(MUMPS_INCLUDE_PATH   "${MYLOCAL}/WinMumps-4.10/MUMPS_4.10.0/include"           CACHE PATH "" FORCE)
-
-SET(WAVES_USE_MKL    OFF CACHE BOOL "" FORCE)
-SET(BLA_VENDOR    "OpenBlas" CACHE STRING "" FORCE)
diff --git a/CMake/msys2.cmake b/CMake/msys2.cmake
deleted file mode 100644
index 4c5afd035094edb1fa7276db788dc9b6c6aba82e..0000000000000000000000000000000000000000
--- a/CMake/msys2.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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.
-
-# MSYS2 with MinGW (AC)
-
-SET(CMAKE_GENERATOR "MSYS Makefiles" CACHE INTERNAL "" FORCE)
-SET(WAVES_USE_MKL    OFF CACHE BOOL "" FORCE)
-SET(WAVES_USE_MUMPS  OFF CACHE BOOL "" FORCE)
-
-# Prevent CMake to find TBB from oneAPI (so that it can find TBB from MSYS) 
-IF(DEFINED ENV{ONEAPI_ROOT})
-    UNSET(ENV{ONEAPI_ROOT})
-ENDIF()
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index ddf537d5ea204584739f6c192a194f271283356f..0000000000000000000000000000000000000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,181 +0,0 @@
-# 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(Waves)
-# ----------------------------------------------------------------------------
-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")
-
-# -- GENERAL OPTIONS
-
-# (de)activate modules
-OPTION(WAVES_USE_FLOW        "Compile flow module"             ON)
-OPTION(WAVES_USE_HEAT        "Compile heat module"             ON)
-OPTION(WAVES_USE_MIRRORS     "Compile mirrors module"          ON)
-OPTION(WAVES_USE_KATOPTRON   "Compile katoptron module"        ON)
-OPTION(WAVES_USE_PARAMS      "Compile params module"           ON)
-OPTION(WAVES_USE_TLNOS       "Compile tlnos module"            ON)
-OPTION(WAVES_USE_WAVES       "Compile waves module"            ON)
-
-# --- Disable some Options on Windows
-IF(WIN32)
-    # Trilinos is not available on Windows
-    MESSAGE("Disabling TRILINOS on Windows")
-    SET(WAVES_USE_KATOPTRON OFF CACHE BOOL "" FORCE)
-    SET(WAVES_USE_TLNOS OFF CACHE BOOL "" FORCE)
-ENDIF()
-
-# macros/fcts
-# INCLUDE(fwkMacros)
-
-# -- 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)
-    STRING(REGEX REPLACE "\\\\" "/" PY_SITE ${PY_SITE})
-    SET(CMAKE_INSTALL_PREFIX "${PY_SITE}/waves" 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 )
-
-IF(WAVES_USE_HEAT)
-    ADD_SUBDIRECTORY( heat )
-ENDIF()
-
-IF(WAVES_USE_KATOPTRON)
-    ADD_SUBDIRECTORY( katoptron )
-ENDIF()
-
-IF(WAVES_USE_TLNOS)
-    ADD_SUBDIRECTORY( tlnos )
-ENDIF()
-
-IF(WAVES_USE_WAVES)
-    ADD_SUBDIRECTORY( waves )
-ENDIF()
-
-# -- 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/CODEOWNERS b/CODEOWNERS
deleted file mode 100644
index dd7e745b597d6a98257cede2edfb9df026c9b89f..0000000000000000000000000000000000000000
--- a/CODEOWNERS
+++ /dev/null
@@ -1,16 +0,0 @@
-# This is a comment.
-# Each line is a file pattern followed by one or more owners.
-
-# These owners will be the default owners for everything in
-# the repo. Unless a later match takes precedence, they
-# will be requested for review when someone opens a pull request.
-*       @R.Boman
-
-# These owners own a directory and nested subdirectories
-/flow/ @acrovato
-
-# You can also use email addresses if you prefer. They'll be
-# used to look up users just like we do for commit author
-# emails.
-#*.go docs@example.com
-
diff --git a/Doxyfile.in b/Doxyfile.in
deleted file mode 100644
index e3ae7891688a3eae2d32693e6a0c759a0df4d499..0000000000000000000000000000000000000000
--- a/Doxyfile.in
+++ /dev/null
@@ -1,2493 +0,0 @@
-# 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           = waves
-
-# 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          = "Basic FE playground"
-
-# 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
deleted file mode 100644
index 8dada3edaf50dbc082c9a125058f25def75e625a..0000000000000000000000000000000000000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 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 e38d97e1cdde4ca1f761b996fc2653d4b982a648..bb66284e941a661e3ab979cf46b5efef669c1caf 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,7 @@
 # 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
-
-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)
-
-## Build
-
-Detailed build instructions can be found in the [wiki](https://gitlab.uliege.be/am-dept/waves/wikis/home).
-
-## References
-
-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.
-
-Crovato Adrien, [Steady Transonic Aerodynamic and Aeroelastic Modeling for Preliminary Aircraft Design](http://hdl.handle.net/2268/251906), University of Liège, 2020.
-
-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.
-
-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.
-
-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.
+This old repository has been split into several components which now live in their own repositories:
+- fwk & tbox: see [dartflo](https://gitlab.uliege.be/am-dept/amfe)
+- flow: see [dartflo](https://gitlab.uliege.be/am-dept/dartflo)
+- waves & heat: see [amfe-solvers](https://gitlab.uliege.be/am-dept/amfe-solvers)
+- katoptron: see [katoptron](https://gitlab.uliege.be/am-dept/katoptron)
diff --git a/dox/flow.png b/dox/flow.png
deleted file mode 100644
index 36072970be132de15bfcdc2dd3dacd19eeef268e..0000000000000000000000000000000000000000
Binary files a/dox/flow.png and /dev/null differ
diff --git a/dox/img.png b/dox/img.png
deleted file mode 100644
index 95122991d7c42905e5ddd927420db557e6d1f73b..0000000000000000000000000000000000000000
Binary files a/dox/img.png and /dev/null differ
diff --git a/dox/logo.jpg b/dox/logo.jpg
deleted file mode 100644
index 17aeb3377b96b8ec85fed719dd8b3fdc25bd6913..0000000000000000000000000000000000000000
Binary files a/dox/logo.jpg and /dev/null differ
diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt
deleted file mode 100644
index 3c75cd0707ae6ec472aabfbed5bcf7d2af61160b..0000000000000000000000000000000000000000
--- a/ext/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-ADD_SUBDIRECTORY(amfe)
diff --git a/ext/amfe b/ext/amfe
deleted file mode 160000
index 7b5a21b0c5fc3885a11e98ebc2e5acbd19bc55bf..0000000000000000000000000000000000000000
--- a/ext/amfe
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 7b5a21b0c5fc3885a11e98ebc2e5acbd19bc55bf
diff --git a/heat/CMakeLists.txt b/heat/CMakeLists.txt
deleted file mode 100644
index 3fc1d71d25d74fd03c14d0e794807c594316f0c5..0000000000000000000000000000000000000000
--- a/heat/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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
deleted file mode 100644
index 312d11ecf6d795f091f148cd1385acec26d3ab61..0000000000000000000000000000000000000000
--- a/heat/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- 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
deleted file mode 100644
index 3507ecc2e766b1c480874612b9cabec1d43ed158..0000000000000000000000000000000000000000
--- a/heat/_src/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-
-# 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
deleted file mode 100644
index 0e9b0695c57735bfd900e9dd201697f864ede0b9..0000000000000000000000000000000000000000
--- a/heat/_src/heatw.i
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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
deleted file mode 100755
index d8d6cd58712be4784c2efe6eb15b058cd1158bba..0000000000000000000000000000000000000000
--- a/heat/broken/heat_multiscale.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/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
deleted file mode 100644
index 325d850d5789184e4c9ad844e49b3fa223d911f6..0000000000000000000000000000000000000000
--- a/heat/broken/honeycomb_jalil.geo
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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
deleted file mode 100755
index b6d1d7525098a299539db17dc42fba1be8413d90..0000000000000000000000000000000000000000
--- a/heat/broken/honeycomb_jalil.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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
deleted file mode 100755
index 4b546fdd8c21c914803557d24387c01399c74d29..0000000000000000000000000000000000000000
--- a/heat/broken/jalil1.py
+++ /dev/null
@@ -1,247 +0,0 @@
-#!/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
deleted file mode 100644
index d7f276db026b64be27f2706108a7f92f2c614307..0000000000000000000000000000000000000000
--- a/heat/broken/jalil1_corner.geo
+++ /dev/null
@@ -1,23 +0,0 @@
-// 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
deleted file mode 100644
index 73f9a94a731d26b6b4d154c084b098ad9ef9e502..0000000000000000000000000000000000000000
--- a/heat/broken/jalil1_micro.geo
+++ /dev/null
@@ -1,60 +0,0 @@
-// 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
deleted file mode 100755
index 086a8eaf211e5f70078cf0116d3bff32598b8b5f..0000000000000000000000000000000000000000
--- a/heat/broken/jalil1_micro.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/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
deleted file mode 100755
index cecfa9747193ee3a5bc60c31f95b240ef0cae783..0000000000000000000000000000000000000000
--- a/heat/broken/jalil2.py
+++ /dev/null
@@ -1,270 +0,0 @@
-#!/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
deleted file mode 100644
index bb3361527880b43d26fbb4c1d749ca8816529b77..0000000000000000000000000000000000000000
--- a/heat/broken/jalil2_honey.geo
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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
deleted file mode 100755
index 8f352db38a11ff388cd3f8fa105dd43052430f34..0000000000000000000000000000000000000000
--- a/heat/broken/jalil2_honey.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/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
deleted file mode 100755
index 8335695e0ce04573ce70120cf252616bd671ef6d..0000000000000000000000000000000000000000
--- a/heat/broken/jalil2_taskpull.py
+++ /dev/null
@@ -1,82 +0,0 @@
-
-#!/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
deleted file mode 100644
index 2d6ba6b4037cfa1a4054d6688d59ce6f659cc358..0000000000000000000000000000000000000000
--- a/heat/broken/rve.geo
+++ /dev/null
@@ -1,60 +0,0 @@
-// 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
deleted file mode 100755
index c474fddf05de7217d53be80d09d4ea8bb91b891a..0000000000000000000000000000000000000000
--- a/heat/broken/rve.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/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
deleted file mode 100755
index 268d97a0a0b651d815a2bcd8813993d620a25756..0000000000000000000000000000000000000000
--- a/heat/fe2.py
+++ /dev/null
@@ -1,305 +0,0 @@
-#!/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
deleted file mode 100644
index 0f952d70a404e2e8ac5abeeee2cd55cbc1ebedae..0000000000000000000000000000000000000000
--- a/heat/matlab/rotK.m
+++ /dev/null
@@ -1,26 +0,0 @@
-
-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
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/heat/models/honeycomb.geo b/heat/models/honeycomb.geo
deleted file mode 100644
index ba4ec75fa4dca456ad353b1cad32aba6431d83f7..0000000000000000000000000000000000000000
--- a/heat/models/honeycomb.geo
+++ /dev/null
@@ -1,93 +0,0 @@
-// 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
deleted file mode 100644
index 03c11edf69f4ff591e744da8aecb9e2c6b93f8cf..0000000000000000000000000000000000000000
--- a/heat/models/rect.geo
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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
deleted file mode 100755
index a723332782c18bc2d64cbccf1e98960a02130cde..0000000000000000000000000000000000000000
--- a/heat/models/rect.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/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
deleted file mode 100644
index ba5dd5b3dcfaaf4e1a31518f9606eaaa3dfd0d0f..0000000000000000000000000000000000000000
--- a/heat/models/rect_stru.geo
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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
deleted file mode 100644
index 84c672b35a141ca36cd2d29e05580abf75555b66..0000000000000000000000000000000000000000
--- a/heat/src/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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
deleted file mode 100644
index ef7f46174dd741ebcef3f38c191f3b1c296276b3..0000000000000000000000000000000000000000
--- a/heat/src/heat.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 2ec222185212a1372e162b568bba4ef6a42f79cf..0000000000000000000000000000000000000000
--- a/heat/src/wBoundary.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 3c0b8679c64b0b31886691eb04f67853776a356e..0000000000000000000000000000000000000000
--- a/heat/src/wBoundary.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 91310881ce343b218f4e1832709a7586d23be8a4..0000000000000000000000000000000000000000
--- a/heat/src/wCompiledFct.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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
deleted file mode 100644
index f8d139263c577d36ad5479a9b8bd27ea92e52395..0000000000000000000000000000000000000000
--- a/heat/src/wCompiledFct.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 932ee6f14b4112314256087f50c69c65353c21fe..0000000000000000000000000000000000000000
--- a/heat/src/wDirichlet.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 6ebf97ba5cfcc6f7faaf9e909edc2a8d9284b46c..0000000000000000000000000000000000000000
--- a/heat/src/wDirichlet.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 33264943267f2545be02cc234a9f7c457de66bba..0000000000000000000000000000000000000000
--- a/heat/src/wDisplayHook.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 58dcbaf4746fbebd88fd29c682769d46a8552dc1..0000000000000000000000000000000000000000
--- a/heat/src/wDisplayHook.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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
deleted file mode 100644
index f62392d771d333cc09d3d7d0f8c7b0fdb7a0d176..0000000000000000000000000000000000000000
--- a/heat/src/wExtractor.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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
deleted file mode 100644
index fb79c3773103b6309e657eb882f215464ed93332..0000000000000000000000000000000000000000
--- a/heat/src/wExtractor.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 8cecc32c4f940e62f90703d89be3a26419e0299c..0000000000000000000000000000000000000000
--- a/heat/src/wHeatTerm.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 12f9bc514a172d93de5e8f4a357b69681b155ec5..0000000000000000000000000000000000000000
--- a/heat/src/wHeatTerm.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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
deleted file mode 100644
index ad307a6d1e94383bbb42ddcddd4abd32b040b17f..0000000000000000000000000000000000000000
--- a/heat/src/wMedium.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 5ba9b425501ddced5a1c4116846aca06a8efd24b..0000000000000000000000000000000000000000
--- a/heat/src/wMedium.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 56930814a7ceb1c87d494dae31751c71fb134a2c..0000000000000000000000000000000000000000
--- a/heat/src/wPeriodic.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 0e1d4c9ab9143233ef6ade2f392e53dd895f9871..0000000000000000000000000000000000000000
--- a/heat/src/wPeriodic.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 90d4fdc35fe816ee1c87100c4813d4068fe93c32..0000000000000000000000000000000000000000
--- a/heat/src/wProblem.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 875aa6da5a8e227118090700914de00a567bcc49..0000000000000000000000000000000000000000
--- a/heat/src/wProblem.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 0148904fd71dfe456c1cd073ea6145b8cb754880..0000000000000000000000000000000000000000
--- a/heat/src/wSolver.cpp
+++ /dev/null
@@ -1,712 +0,0 @@
-/*
- * 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
deleted file mode 100644
index bd83c28c92b110ec40ef87df4fb16fb0c8a4a7e5..0000000000000000000000000000000000000000
--- a/heat/src/wSolver.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 149c18d185dade39387f8e6c8cbf94b4f5f310e0..0000000000000000000000000000000000000000
--- a/heat/src/wSource.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
deleted file mode 100644
index b83b726390099a0499c9df65d6bbb772e0f2adb1..0000000000000000000000000000000000000000
--- a/heat/src/wSource.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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
deleted file mode 100755
index 97b0ef251f0ba86e2a7b42e1e82e4b36d95f1a39..0000000000000000000000000000000000000000
--- a/heat/tests/basics/anisotropy.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/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
deleted file mode 100755
index 65a7c5be6f9178c5668728f15616d2693051761a..0000000000000000000000000000000000000000
--- a/heat/tests/basics/dirichletx.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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
deleted file mode 100755
index cd444f396bb8cc19bca5864c419022de8e7d8fad..0000000000000000000000000000000000000000
--- a/heat/tests/basics/dirichletx_stru.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/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
deleted file mode 100755
index abcedb8b807542965a60ff32d8caa9215a2a1e52..0000000000000000000000000000000000000000
--- a/heat/tests/basics/dirichlety.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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
deleted file mode 100644
index 98f855e65ee2811490c0a41cc817a2f9a1a6859d..0000000000000000000000000000000000000000
--- a/heat/tests/basics/mat2hole.geo
+++ /dev/null
@@ -1,79 +0,0 @@
-// 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
deleted file mode 100755
index e0e3153b6d34821308565b8c039c4f9a39590082..0000000000000000000000000000000000000000
--- a/heat/tests/basics/mat2hole.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/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
deleted file mode 100755
index 65d0fe84696fbd46ebaad88ee46973c86b73afb1..0000000000000000000000000000000000000000
--- a/heat/tests/basics/source.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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
deleted file mode 100755
index a0dc3916daa4b07b031c1c5b25247774d034c75d..0000000000000000000000000000000000000000
--- a/heat/tests/directors/material.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/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
deleted file mode 100755
index 8cdd8e2a7919041cc848dd6530768ad5e2f46feb..0000000000000000000000000000000000000000
--- a/heat/tests/directors/neumann.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/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
deleted file mode 100755
index 83c28a92cd2c858d820485ba1c2e5a02ac95ae91..0000000000000000000000000000000000000000
--- a/heat/tests/directors/source.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/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
deleted file mode 100644
index 2df0b02f1b172e032f32bd26cce0ee8006b11e93..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/Lmacro.geo
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
deleted file mode 100644
index 1e5af699ac1034bb4869db1f6110b4a60aa4f7e2..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/Lmicro.geo
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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
deleted file mode 100644
index cd8ce77f87d656b244f13f3bff396ce159b58a92..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/Lmpi.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/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
deleted file mode 100755
index 7b2dc0371ca4a8becb2349d0d405c36df2904986..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/heat_mpi.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/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
deleted file mode 100755
index d850c8302ce96ee713705e891c16712571835ddd..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/heat_mpi.sge.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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
deleted file mode 100755
index d1a5391eee3e0750b9cd2088252f5d9dc05bee23..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/heat_mpi.slurm.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/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
deleted file mode 100644
index 904403fb24edbca9a96fbc64c32c278f8e6b19b2..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/macro.geo
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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
deleted file mode 100644
index 0555c5878c8a385592c5e8373a56d93d10895c96..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/micro.geo
+++ /dev/null
@@ -1,63 +0,0 @@
-// 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
deleted file mode 100755
index 7ec064a18161b1998468ff8fcbbf9ee19acf9375..0000000000000000000000000000000000000000
--- a/heat/tests/fe2/micro.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/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
deleted file mode 100644
index 0c0b3a28c98d706ae7015297ed6fed9ec25018e4..0000000000000000000000000000000000000000
--- a/heat/tests/nonlinear/mat2.geo
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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
deleted file mode 100644
index 396dc9941bf4179243acbf7ea5ba53455d7c802b..0000000000000000000000000000000000000000
--- a/heat/tests/nonlinear/mat2vark.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/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
deleted file mode 100755
index 3a868c1940668f13cf4fc7fbf409a04bfbbdd7b2..0000000000000000000000000000000000000000
--- a/heat/tests/periodic/honeycomb.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/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
deleted file mode 100755
index d5cbf01d13562932392fdf66c69f633253dd2a23..0000000000000000000000000000000000000000
--- a/heat/tests/periodic/lincomb.py
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/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
deleted file mode 100755
index c1b9677b3c1dfa91f43cce814f2410f68bf85f61..0000000000000000000000000000000000000000
--- a/heat/tests/periodic/lincomb_fast.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/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
deleted file mode 100644
index 29987fe36568022fe7b20dc7b6b30b198d1fa45d..0000000000000000000000000000000000000000
--- a/heat/utils.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/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
deleted file mode 100644
index c6b48f4b566b2b0beb0a8a1e68cb9568162b5b6c..0000000000000000000000000000000000000000
--- a/heat/viewer.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/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/katoptron/CMAME/MG/beam.geo b/katoptron/CMAME/MG/beam.geo
deleted file mode 100644
index df548c673ab4448e1e1f407c69487267e7c0e279..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/MG/beam.geo
+++ /dev/null
@@ -1,81 +0,0 @@
-SetFactory("OpenCASCADE");
-If(GMSH_MAJOR_VERSION!=3 || GMSH_MINOR_VERSION!=0 || GMSH_PATCH_VERSION!=6)
-  Printf("gmsh %g.%g.%g is not supported by this .geo",GMSH_MAJOR_VERSION,GMSH_MINOR_VERSION,GMSH_PATCH_VERSION);
-Else
-  LX = 10;
-  LY = 10;
-  lx2 = 2;
-  ly1 = 2;
-  ly2 = 7;
-  LZ = 1;
-
-  lc = 0.1;
-
-  nX1 = 5;
-  nY1 = 3;
-  nX2 = 3;
-  nX3 = 4;
-  nY2 = 6;  
-  nZ = 1;
-
-  Point(1)  = { 0.,  LY-ly1, 0.,     lc};
-  Point(2)  = { 0.,  LY, 0.,     lc};
-  Point(3)  = { LX-lx2,  LY, 0.,     lc};
-  Point(4)  = { LX-lx2,  LY-ly1, 0.,     lc};
-  Point(5)  = { LX,  LY, 0.,     lc};
-  Point(6)  = { LX,  LY-ly1, 0.,     lc};  
-
-  Point(7)  = { LX-lx2,  0., 0.,     lc};
-  Point(8)  = { LX-lx2,  ly2, 0.,     lc};
-  Point(9)  = { LX,  ly2, 0.,     lc};
-  Point(10)  = { LX,  0., 0.,     lc};
-
-  Line(1) = {1, 2};
-  Line(2) = {2, 3};
-  Line(3) = {3, 4};
-  Line(4) = {4, 1};
-  Line(5) = {3, 5};
-  Line(6) = {5, 6};
-  Line(7) = {6, 4};
-
-  Line(8) = {7, 8};
-  Line(9) = {8, 9};
-  Line(10) = {9, 10};
-  Line(11) = {10, 7};  
-
-  Transfinite Line {1, 3, 6} = nY1 Using Progression 1;
-  Transfinite Line {2, 4} = nX1 Using Progression 1;
-  Transfinite Line {5, 7} = nX3 Using Progression 1;
-
-  Transfinite Line {8, 10} = nY2 Using Progression 1;
-  Transfinite Line {9, 11} = nX2 Using Progression 1;
-
-  Line Loop(9) = {1, 2, 3, 4};
-  Plane Surface(9) = {9};
-  Transfinite Surface {9};
-  Recombine Surface {9};
-
-  Line Loop(10) = {-3, 5, 6, 7};
-  Plane Surface(10) = {10};
-  Transfinite Surface {10};
-  Recombine Surface {10};  
-
-  Line Loop(12) = {8, 9, 10, 11};
-  Plane Surface(12) = {12};
-  Transfinite Surface {12};
-  Recombine Surface {12};  
-
-  Extrude {0, 0, LZ}
-  {
-    Surface{9,10,12}; Layers{nZ}; Recombine;
-  }
-
-  Physical Volume("body") = {1,2,3};
-
-  Physical Surface("load 1") = {14};
-  Physical Surface("load 2") = {20};
-  Physical Surface("clamped 1") = {13};
-  Physical Surface("clamped 2") = {25};
-  Physical Surface("conctact 1") = {18};
-  Physical Surface("conctact 2") = {23};
-EndIf
diff --git a/katoptron/CMAME/MG/beam.py b/katoptron/CMAME/MG/beam.py
deleted file mode 100644
index 3dc43478b270e76b9d05c167918efeff76d3a502..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/MG/beam.py
+++ /dev/null
@@ -1,240 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_beam_test(msh, comm, test_case):
-
-    directory = str(test_case)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    pbl = m.Problem(msh, comm)
-
-    ensemble_size = 1
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped 1", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "clamped 2", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-
-    f = 70 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1, -f, 0, zero, 0, one,
-              ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -f, 0, zero, 0, one,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-8
-    solverList['Maximum Iterations'] = 200
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    if test_case == 1:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 1
-        mueluParams['coarse: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "Gauss-Seidel"
-        mueluParamsSub2['relaxation: sweeps'] = 3
-        mueluParamsSub2['relaxation: damping factor'] = 0.75
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['coarse: params'] = mueluParamsSub2
-
-        solverList['mueluParams'] = mueluParams
-
-    elif test_case == 2:
-        file_dir = os.path.dirname(__file__)
-        muelu_xml_in = file_dir + '/../../preconditioners/gs_lvl.xml.in'
-
-        old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                       '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                       '$SCHUR_omega', '$SimpleSmoother_damping', "$N_LVLS", "$N_SIZES", "$EXPORT_DATA"]
-        new_strings = [
-            '3',
-            '3',
-            '3',
-            '0.75',
-            '1',
-            '1',
-            '2',
-            '18',
-            "true"
-        ]
-        u.replace_strings(muelu_xml_in, work_dir + '/gs.xml',
-                          old_strings, new_strings)
-        solverList['use xml file'] = True
-        solverList['MueLu xml file name'] = work_dir + '/gs.xml'
-
-    elif test_case == 2.5:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 2
-        mueluParams['smoother: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-        mueluParamsSub2['relaxation: type'] = "Gauss-Seidel"
-        mueluParamsSub2['relaxation: sweeps'] = 3
-        mueluParamsSub2['relaxation: damping factor'] = 0.75
-
-        mueluParams['verbosity'] = "high"
-        mueluParams['smoother: params'] = mueluParamsSub2
-        mueluParams['coarse: type'] = "Klu"
-        mueluParams['coarse: max size'] = 18
-        #mueluParams['aggregation: min agg size'] = 5
-        #mueluParams['aggregation: max selected neighbors'] = 1
-        mueluParams['aggregation: export visualization data'] = True
-        exportdata = Teuchos.ParameterList()
-        exportdata['A'] = '{0,1}'
-        exportdata['P'] = '{0}'
-        exportdata['R'] = '{0}'
-        exportdata['Aggregates'] = '{0}'
-        mueluParams['export data'] = exportdata
-        solverList['mueluParams'] = mueluParams
-
-    else:
-        norm = tbox.Vector3d(0, 1, 0)
-        cont = m.Contact(pbl, "conctact 1", "contact", norm)
-        cont.setInitialyOpen()
-        cont.setNoUpdate()
-        if test_case == 4 or test_case == 6:
-            cont.setSticking()
-        cont.setMaster(pbl, "conctact 2", norm)
-
-        file_dir = os.path.dirname(__file__)
-
-        if test_case == 3 or test_case == 4:
-            muelu_xml_in = file_dir + '/../../preconditioners/SIMPLE_gs_direct.xml.in'
-
-            old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                           '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                           '$SCHUR_omega', '$SimpleSmoother_damping']
-            if test_case == 4:
-                new_strings = [
-                    '3',
-                    '3',
-                    '3',
-                    '0.75',
-                    '1',
-                    '1'
-                ]
-            else:
-                new_strings = [
-                    '3',
-                    '1',
-                    '3',
-                    '0.75',
-                    '1',
-                    '1'
-                ]
-        else:
-            muelu_xml_in = file_dir + '/../../preconditioners/SIMPLE_gs_direct_lvl.xml.in'
-
-            old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                           '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                           '$SCHUR_omega', '$SimpleSmoother_damping', "$N_LVLS", "$N_SIZES", "$EXPORT_DATA"]
-            if test_case == 6:
-                new_strings = [
-                    '3',
-                    '3',
-                    '3',
-                    '0.75',
-                    '1',
-                    '1',
-                    '2',
-                    '18',
-                    "true"
-                ]
-            else:
-                new_strings = [
-                    '3',
-                    '1',
-                    '3',
-                    '0.75',
-                    '1',
-                    '1',
-                    '2',
-                    '18',
-                    "true"
-                ]
-        u.replace_strings(muelu_xml_in, work_dir + '/SIMPLE_gs_direct.xml',
-                          old_strings, new_strings)
-        solverList['MueLu xml file name'] = work_dir + '/SIMPLE_gs_direct.xml'
-
-    solverList['convert MueLu xml file'] = True
-    solverList['Create Preconditioned Matrix'] = True
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-    os.chdir('..')
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('beam.geo', file_dir).execute()
-
-    for i in range(1, 7):
-        evaluate_beam_test(msh, comm, i)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/MG/post.py b/katoptron/CMAME/MG/post.py
deleted file mode 100644
index 405eab92ab1e85f38415afa4af55b2e32b6cb553..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/MG/post.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-import fwk
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    input_file_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_MG_beam_12/'
-
-    filename_A_1 = input_file_dir + '1/Applied_Matrix_mm.txt'
-    filename_A_2 = input_file_dir + '2/Applied_Matrix_mm.txt'
-    filename_A_3 = input_file_dir + '3/Applied_Matrix_mm.txt'
-    filename_A_4 = input_file_dir + '4/Applied_Matrix_mm.txt'
-    filename_A_5 = input_file_dir + '5/Applied_Matrix_mm.txt'
-    filename_A_6 = input_file_dir + '6/Applied_Matrix_mm.txt'
-
-    filename_AQ_1 = input_file_dir + '1/Applied_Preconditioned_Matrix_mm.txt'
-    filename_AQ_2 = input_file_dir + '2/Applied_Preconditioned_Matrix_mm.txt'
-    filename_AQ_3 = input_file_dir + '3/Applied_Preconditioned_Matrix_mm.txt'
-    filename_AQ_4 = input_file_dir + '4/Applied_Preconditioned_Matrix_mm.txt'
-    filename_AQ_5 = input_file_dir + '5/Applied_Preconditioned_Matrix_mm.txt'
-    filename_AQ_6 = input_file_dir + '6/Applied_Preconditioned_Matrix_mm.txt'
-
-    filename_Q_1 = input_file_dir + '1/Applied_Preconditioner_mm.txt'
-    filename_Q_2 = input_file_dir + '2/Applied_Preconditioner_mm.txt'
-    filename_Q_3 = input_file_dir + '3/Applied_Preconditioner_mm.txt'
-    filename_Q_4 = input_file_dir + '4/Applied_Preconditioner_mm.txt'
-    filename_Q_5 = input_file_dir + '5/Applied_Preconditioner_mm.txt'
-    filename_Q_6 = input_file_dir + '6/Applied_Preconditioner_mm.txt'
-
-    filename_b = input_file_dir + '1/b_mm_after_bc.txt'
-
-    b = read_mm(filename_b, is_sparse=False)
-
-    Q_1 = read_mm(filename_Q_1, is_sparse=False)
-    Q_2 = read_mm(filename_Q_2, is_sparse=False)
-    Q_3 = read_mm(filename_Q_3, is_sparse=False)
-    Q_4 = read_mm(filename_Q_4, is_sparse=False)
-    Q_5 = read_mm(filename_Q_5, is_sparse=False)
-    Q_6 = read_mm(filename_Q_6, is_sparse=False)
-
-    b_1 = np.zeros((Q_1.shape[0],))
-    b_2 = np.zeros((Q_2.shape[0],))
-    b_3 = np.zeros((Q_3.shape[0],))
-    b_4 = np.zeros((Q_4.shape[0],))
-    b_5 = np.zeros((Q_5.shape[0],))
-    b_6 = np.zeros((Q_6.shape[0],))
-
-    b_1[0:len(b)] = b
-    b_2[0:len(b)] = b
-    b_3[0:len(b)] = b
-    b_4[0:len(b)] = b
-    b_5[0:len(b)] = b
-    b_6[0:len(b)] = b
-
-    x_1 = np.zeros((len(b_1),))
-    x_2 = np.zeros((len(b_2),))
-    x_3 = np.zeros((len(b_3),))
-    x_4 = np.zeros((len(b_4),))
-    x_5 = np.zeros((len(b_5),))
-    x_6 = np.zeros((len(b_6),))
-
-    A_1 = read_mm(filename_A_1, is_sparse=False)
-    A_2 = read_mm(filename_A_2, is_sparse=False)
-    A_3 = read_mm(filename_A_3, is_sparse=False)
-    A_4 = read_mm(filename_A_4, is_sparse=False)
-    A_5 = read_mm(filename_A_5, is_sparse=False)
-    A_6 = read_mm(filename_A_6, is_sparse=False)
-
-    r_1 = A_1.dot(x_1) - b_1
-    r_2 = A_2.dot(x_2) - b_2
-    r_3 = A_3.dot(x_3) - b_3
-    r_4 = A_4.dot(x_4) - b_4
-    r_5 = A_5.dot(x_5) - b_5
-    r_6 = A_6.dot(x_6) - b_6
-
-    AQ_1 = read_mm(filename_AQ_1, is_sparse=False)
-    AQ_2 = read_mm(filename_AQ_2, is_sparse=False)
-    AQ_3 = read_mm(filename_AQ_3, is_sparse=False)
-    AQ_4 = read_mm(filename_AQ_4, is_sparse=False)
-    AQ_5 = read_mm(filename_AQ_5, is_sparse=False)
-    AQ_6 = read_mm(filename_AQ_6, is_sparse=False)
-
-    plt.figure()
-    plt.plot(Q_2.dot(r_2))
-    plt.plot(Q_5.dot(r_5))
-    plt.figure()
-    tmp = Q_5.dot(r_5)
-    tmp[0:len(r_2)] = tmp[0:len(r_2)] - Q_2.dot(r_2)
-    plt.plot(tmp)
-    # plt.plot(Q_2.dot(r_2))
-
-    # plt.plot(Q_4.dot(r_4))
-    # plt.figure()
-    # plt.spy(A_1)
-    # plt.figure()
-    # plt.spy(A_3)
-    plt.figure()
-    plt.spy(Q_2, precision=1e-8)
-    plt.figure()
-    plt.spy(Q_5, precision=1e-8)
-    plt.figure()
-    tmp = Q_5
-    tmp[0:252, 0:252] = tmp[0:252, 0:252] - Q_2
-    plt.spy(tmp, precision=1e-8)
-
-    plt.figure()
-    tmp = A_5
-    tmp[0:252, 0:252] = tmp[0:252, 0:252] - A_2
-    plt.spy(tmp, precision=1e-8)
-
-    tmp = np.abs(A_1.flatten())
-    print(np.min(tmp[tmp != 0.]))
-    tmp = np.abs(A_3.flatten())
-    print(np.min(tmp[tmp != 0.]))
-
-    plt.figure()
-    tmp = AQ_5
-    tmp[0:252, 0:252] = tmp[0:252, 0:252] - AQ_2
-    plt.spy(tmp, precision=1e-8)
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/__init__.py b/katoptron/CMAME/__init__.py
deleted file mode 100644
index 0129f3671930ba00414020c8f5609e6f07b7162c..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# -*- coding: utf-8; -*-
diff --git a/katoptron/CMAME/mesh/plate.geo b/katoptron/CMAME/mesh/plate.geo
deleted file mode 100644
index d157a23f3f167a14eb15578a16486d9d0c747ca9..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/mesh/plate.geo
+++ /dev/null
@@ -1,86 +0,0 @@
-SetFactory("OpenCASCADE");
-If(GMSH_MAJOR_VERSION<=3 && GMSH_MINOR_VERSION<=0 && GMSH_PATCH_VERSION<=6)
-  Printf("gmsh %g.%g.%g is not supported by this .geo",GMSH_MAJOR_VERSION,GMSH_MINOR_VERSION,GMSH_PATCH_VERSION);
-Else
-  LX = 10;
-  LY = 10;
-  LZ = 1;
-
-  CX = LX/2;
-  CY = LY/2;
-
-  R = 2;
-  dR = 0;
-
-  nT = 40;
-  nZ = 3;
-  ndR = 20;
-
-  PI = Acos (-1.);
-
-  lc = 1;
-
-  Point(201)  = { CX,    CY,  0.,     lc};
-
-  Point(202)  = { CX+(R+dR)*Cos(1*PI/4),  CY+(R+dR)*Sin(1*PI/4), 0.,     lc};
-  Point(203)  = { CX+(R+dR)*Cos(3*PI/4),  CY+(R+dR)*Sin(3*PI/4), 0.,     lc};
-  Point(204)  = { CX+(R+dR)*Cos(5*PI/4),  CY+(R+dR)*Sin(5*PI/4), 0.,     lc};
-  Point(205)  = { CX+(R+dR)*Cos(7*PI/4),  CY+(R+dR)*Sin(7*PI/4), 0.,     lc};
-
-  Point(206)  = { LX,  LY, 0.,     lc};
-  Point(207)  = { 0.,  LY, 0.,     lc};
-  Point(208)  = { 0.,  0., 0.,     lc};
-  Point(209)  = { LX,  0., 0.,     lc};
-
-  Circle(2101) = {202, 201, 203};
-  Circle(2102) = {203, 201, 204};
-  Circle(2103) = {204, 201, 205};
-  Circle(2104) = {205, 201, 202};
-
-  Line(2105) = {206, 207};
-  Line(2106) = {207, 208};
-  Line(2107) = {208, 209};
-  Line(2108) = {209, 206};
-
-  Line(2201) = {202, 206};
-  Line(2202) = {203, 207};
-  Line(2203) = {204, 208};
-  Line(2204) = {205, 209};
-
-  Transfinite Line {2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108} = nT Using Progression 1;
-  Transfinite Line {2201, 2202, 2203, 2204} = ndR Using Progression 1;
-
-  Line Loop(201) = {2101, 2202, -2105, -2201};
-  Plane Surface(201) = {201};
-  Transfinite Surface {201};
-  Recombine Surface {201};
-
-  Line Loop(202) = {2202, 2106, -2203, -2102};
-  Plane Surface(202) = {202};
-  Transfinite Surface {202};
-  Recombine Surface {202};
-
-  Line Loop(203) = {2103, 2204, -2107, -2203};
-  Plane Surface(203) = {203};
-  Transfinite Surface {203};
-  Recombine Surface {203};
-
-  Line Loop(204) = {2104, 2201, -2108, -2204};
-  Plane Surface(204) = {204};
-  Transfinite Surface {204};
-  Recombine Surface {204};
-
-  Extrude {0, 0, LZ}
-  {
-    Surface{201,202,203,204}; Layers{nZ}; Recombine;
-  }
-
-  Physical Volume("body") = {1,2,3,4};
-  //+
-  Physical Surface("outer part boundary") = {205,212,214,218};
-  Physical Surface("load 1") = {207};
-  Physical Surface("load 2") = {216};
-  Physical Point("clamped xyz") = {214};
-  Physical Point("clamped xy") = {208};
-  Physical Point("clamped y") = {217};
-EndIf
diff --git a/katoptron/CMAME/mesh/plate_1.geo b/katoptron/CMAME/mesh/plate_1.geo
deleted file mode 100644
index 719e836d804c00f8dc09fca51fa2fa006fe51fbe..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/mesh/plate_1.geo
+++ /dev/null
@@ -1,81 +0,0 @@
-SetFactory("OpenCASCADE");
-If(GMSH_MAJOR_VERSION<=3 && GMSH_MINOR_VERSION<=0 && GMSH_PATCH_VERSION<6)
-  Printf("gmsh %g.%g.%g is not supported by this .geo",GMSH_MAJOR_VERSION,GMSH_MINOR_VERSION,GMSH_PATCH_VERSION);
-Else
-  LX = 10;
-  LY = 10;
-  LZ = 1;
-
-  CX = LX/2;
-  CY = LY/2;
-
-  R = 2;
-  dR = 1;
-
-  nT = 30;
-  nZ = 5;
-  ndR = 10;
-
-  PI = Acos (-1.);
-
-  lc = 1;
-
-  Point(1)  = { CX,    CY,  0.,     lc};
-  Point(2)  = { CX+R*Cos(1*PI/4),  CY+R*Sin(1*PI/4), 0.,     lc};
-  Point(3)  = { CX+R*Cos(3*PI/4),  CY+R*Sin(3*PI/4), 0.,     lc};
-  Point(4)  = { CX+R*Cos(5*PI/4),  CY+R*Sin(5*PI/4), 0.,     lc};
-  Point(5)  = { CX+R*Cos(7*PI/4),  CY+R*Sin(7*PI/4), 0.,     lc};
-
-  Point(6)  = { CX+(R+dR)*Cos(1*PI/4),  CY+(R+dR)*Sin(1*PI/4), 0.,     lc};
-  Point(7)  = { CX+(R+dR)*Cos(3*PI/4),  CY+(R+dR)*Sin(3*PI/4), 0.,     lc};
-  Point(8)  = { CX+(R+dR)*Cos(5*PI/4),  CY+(R+dR)*Sin(5*PI/4), 0.,     lc};
-  Point(9)  = { CX+(R+dR)*Cos(7*PI/4),  CY+(R+dR)*Sin(7*PI/4), 0.,     lc};
-
-  Circle(101) = {2, 1, 3};
-  Circle(102) = {3, 1, 4};
-  Circle(103) = {4, 1, 5};
-  Circle(104) = {5, 1, 2};
-
-  Circle(105) = {6, 1, 7};
-  Circle(106) = {7, 1, 8};
-  Circle(107) = {8, 1, 9};
-  Circle(108) = {9, 1, 6};
-
-  Line(201) = {2, 6};
-  Line(202) = {3, 7};
-  Line(203) = {4, 8};
-  Line(204) = {5, 9};
-
-  Transfinite Line {101, 102, 103, 104, 105, 106, 107, 108} = nT Using Progression 1;
-  Transfinite Line {201, 202, 203, 204} = ndR Using Progression 1;
-
-  Line Loop(1) = {101, 202, -105, -201};
-  Plane Surface(1) = {1};
-  Transfinite Surface {1};
-  Recombine Surface {1};
-
-  Line Loop(2) = {202, 106, -203, -102};
-  Plane Surface(2) = {2};
-  Transfinite Surface {2};
-  Recombine Surface {2};
-
-  Line Loop(3) = {103, 204, -107, -203};
-  Plane Surface(3) = {3};
-  Transfinite Surface {3};
-  Recombine Surface {3};
-
-  Line Loop(4) = {104, 201, -108, -204};
-  Plane Surface(4) = {4};
-  Transfinite Surface {4};
-  Recombine Surface {4};
-
-  Extrude {0, 0, LZ}
-  {
-    Surface{1,2,3,4}; Layers{nZ}; Recombine;
-  }
-  Physical Volume("body") = {1,2,3,4};
-  //+
-  Physical Surface("inner part boundary") = {7,10,16,19};
-  //+
-  Physical Surface("inner boundary") = {12, 5, 18, 14};
-EndIf
diff --git a/katoptron/CMAME/mesh/plate_2.geo b/katoptron/CMAME/mesh/plate_2.geo
deleted file mode 100644
index 9b35b6d8eaf4b8d07904146748d07d427aaa6763..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/mesh/plate_2.geo
+++ /dev/null
@@ -1,86 +0,0 @@
-SetFactory("OpenCASCADE");
-If(GMSH_MAJOR_VERSION<=3 && GMSH_MINOR_VERSION<=0 && GMSH_PATCH_VERSION<6)
-  Printf("gmsh %g.%g.%g is not supported by this .geo",GMSH_MAJOR_VERSION,GMSH_MINOR_VERSION,GMSH_PATCH_VERSION);
-Else
-  LX = 10;
-  LY = 10;
-  LZ = 1;
-
-  CX = LX/2;
-  CY = LY/2;
-
-  R = 2;
-  dR = 1;
-
-  nT = 20;
-  nZ = 3;
-  ndR = 10;
-
-  PI = Acos (-1.);
-
-  lc = 1;
-
-  Point(201)  = { CX,    CY,  0.,     lc};
-
-  Point(202)  = { CX+(R+dR)*Cos(1*PI/4),  CY+(R+dR)*Sin(1*PI/4), 0.,     lc};
-  Point(203)  = { CX+(R+dR)*Cos(3*PI/4),  CY+(R+dR)*Sin(3*PI/4), 0.,     lc};
-  Point(204)  = { CX+(R+dR)*Cos(5*PI/4),  CY+(R+dR)*Sin(5*PI/4), 0.,     lc};
-  Point(205)  = { CX+(R+dR)*Cos(7*PI/4),  CY+(R+dR)*Sin(7*PI/4), 0.,     lc};
-
-  Point(206)  = { LX,  LY, 0.,     lc};
-  Point(207)  = { 0.,  LY, 0.,     lc};
-  Point(208)  = { 0.,  0., 0.,     lc};
-  Point(209)  = { LX,  0., 0.,     lc};
-
-  Circle(2101) = {202, 201, 203};
-  Circle(2102) = {203, 201, 204};
-  Circle(2103) = {204, 201, 205};
-  Circle(2104) = {205, 201, 202};
-
-  Line(2105) = {206, 207};
-  Line(2106) = {207, 208};
-  Line(2107) = {208, 209};
-  Line(2108) = {209, 206};
-
-  Line(2201) = {202, 206};
-  Line(2202) = {203, 207};
-  Line(2203) = {204, 208};
-  Line(2204) = {205, 209};
-
-  Transfinite Line {2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108} = nT Using Progression 1;
-  Transfinite Line {2201, 2202, 2203, 2204} = ndR Using Progression 1;
-
-  Line Loop(201) = {2101, 2202, -2105, -2201};
-  Plane Surface(201) = {201};
-  Transfinite Surface {201};
-  Recombine Surface {201};
-
-  Line Loop(202) = {2202, 2106, -2203, -2102};
-  Plane Surface(202) = {202};
-  Transfinite Surface {202};
-  Recombine Surface {202};
-
-  Line Loop(203) = {2103, 2204, -2107, -2203};
-  Plane Surface(203) = {203};
-  Transfinite Surface {203};
-  Recombine Surface {203};
-
-  Line Loop(204) = {2104, 2201, -2108, -2204};
-  Plane Surface(204) = {204};
-  Transfinite Surface {204};
-  Recombine Surface {204};
-
-  Extrude {0, 0, LZ}
-  {
-    Surface{201,202,203,204}; Layers{nZ}; Recombine;
-  }
-
-  Physical Volume("body") = {1,2,3,4};
-  //+
-  Physical Surface("outer part boundary") = {205,212,214,218};
-  Physical Surface("load 1") = {207};
-  Physical Surface("load 2") = {216};
-  Physical Point("clamped xyz") = {214};
-  Physical Point("clamped xy") = {208};
-  Physical Point("clamped y") = {217};
-EndIf
diff --git a/katoptron/CMAME/mesh/plate_2_extended.geo b/katoptron/CMAME/mesh/plate_2_extended.geo
deleted file mode 100644
index 130383a3e1f03c82b7fe2e9ea45868f7ada1ff15..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/mesh/plate_2_extended.geo
+++ /dev/null
@@ -1,174 +0,0 @@
-SetFactory("OpenCASCADE");
-If(GMSH_MAJOR_VERSION<=3 && GMSH_MINOR_VERSION<=0 && GMSH_PATCH_VERSION<6)
-  Printf("gmsh %g.%g.%g is not supported by this .geo",GMSH_MAJOR_VERSION,GMSH_MINOR_VERSION,GMSH_PATCH_VERSION);
-Else
-  LX = 10;
-  LY = 10;
-  LZ = 1;
-
-  NX = 4;
-  NY = 4;
-
-  CX = LX/2;
-  CY = LY/2;
-
-  R = 2;
-  dR = 1;
-
-  nT = 20;
-  nZ = 3;
-  ndR = 10;
-
-  PI = Acos (-1.);
-
-  lc = 1;
-
-  Point(201)  = { CX,    CY,  0.,     lc};
-
-  Point(202)  = { CX+(R+dR)*Cos(1*PI/4),  CY+(R+dR)*Sin(1*PI/4), 0.,     lc};
-  Point(203)  = { CX+(R+dR)*Cos(3*PI/4),  CY+(R+dR)*Sin(3*PI/4), 0.,     lc};
-  Point(204)  = { CX+(R+dR)*Cos(5*PI/4),  CY+(R+dR)*Sin(5*PI/4), 0.,     lc};
-  Point(205)  = { CX+(R+dR)*Cos(7*PI/4),  CY+(R+dR)*Sin(7*PI/4), 0.,     lc};
-
-  Point(206)  = { LX,  LY, 0.,     lc};
-  Point(207)  = { 0.,  LY, 0.,     lc};
-  Point(208)  = { 0.,  0., 0.,     lc};
-  Point(209)  = { LX,  0., 0.,     lc};
-
-  Circle(2101) = {202, 201, 203};
-  Circle(2102) = {203, 201, 204};
-  Circle(2103) = {204, 201, 205};
-  Circle(2104) = {205, 201, 202};
-
-  Line(2105) = {206, 207};
-  Line(2106) = {207, 208};
-  Line(2107) = {208, 209};
-  Line(2108) = {209, 206};
-
-  Line(2201) = {202, 206};
-  Line(2202) = {203, 207};
-  Line(2203) = {204, 208};
-  Line(2204) = {205, 209};
-
-  Point(301)  = { -NX*LX,  NY*LY+LY, 0.,     lc};
-  Point(302)  = { 0,  NY*LY+LY, 0.,     lc};
-  Point(303)  = { -NX*LX,  LY, 0.,     lc};
-
-  Line(311) = {301, 302};
-  Line(312) = {302, 207};
-  Line(313) = {207, 303};
-  Line(314) = {303, 301};
-
-  Point(501)  = { LX,  NY*LY+LY, 0.,     lc};
-  Point(502)  = { LX+NX*LX,  NY*LY+LY, 0.,     lc};
-  Point(503)  = { LX+NX*LX,  LY, 0.,     lc};
-
-  Line(511) = {501, 502};
-  Line(512) = {502, 503};
-  Line(513) = {503, 206};
-  Line(514) = {206, 501};
-
-  Point(801)  = { -NX*LX,  0, 0.,     lc};
-  Point(802)  = { 0,  -NY*LY, 0.,     lc};
-  Point(803)  = { -NX*LX,  -NY*LY, 0.,     lc};
-
-  Line(811) = {801, 208};
-  Line(812) = {208, 802};
-  Line(813) = {802, 803};
-  Line(814) = {803, 801};
-
-  Point(1001)  = { LX+NX*LX,  0, 0.,     lc};
-  Point(1002)  = { LX+NX*LX,  -NY*LY, 0.,     lc};
-  Point(1003)  = { LX,  -NY*LY, 0.,     lc};
-
-  Line(1011) = {209, 1001};
-  Line(1012) = {1001, 1002};
-  Line(1013) = {1002, 1003};
-  Line(1014) = {1003, 209};
-
-  Line(411) = {302, 501};
-  Line(611) = {801, 303};
-  Line(711) = {503, 1001};
-  Line(911) = {1003, 802};
-
-  Transfinite Line {2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 411, 611, 711, 911} = nT Using Progression 1;
-  Transfinite Line {2201, 2202, 2203, 2204} = ndR Using Progression 1;
-  Transfinite Line {311,511,313,513,811,1011,813,1013} = NX*nT Using Progression 1;
-  Transfinite Line {314,814,312,812,514,1014,512,1012} = NY*nT Using Progression 1;
-
-  Line Loop(201) = {2101, 2202, -2105, -2201};
-  Plane Surface(201) = {201};
-  Transfinite Surface {201};
-  Recombine Surface {201};
-
-  Line Loop(202) = {2202, 2106, -2203, -2102};
-  Plane Surface(202) = {202};
-  Transfinite Surface {202};
-  Recombine Surface {202};
-
-  Line Loop(203) = {2103, 2204, -2107, -2203};
-  Plane Surface(203) = {203};
-  Transfinite Surface {203};
-  Recombine Surface {203};
-
-  Line Loop(204) = {2104, 2201, -2108, -2204};
-  Plane Surface(204) = {204};
-  Transfinite Surface {204};
-  Recombine Surface {204};
-
-  Line Loop(205) = {311, 312, 313, 314};
-  Plane Surface(205) = {205};
-  Transfinite Surface {205};
-  Recombine Surface {205};
-
-  Line Loop(206) = {511, 512, 513, 514};
-  Plane Surface(206) = {206};
-  Transfinite Surface {206};
-  Recombine Surface {206};
-
-  Line Loop(207) = {811, 812, 813, 814};
-  Plane Surface(207) = {207};
-  Transfinite Surface {207};
-  Recombine Surface {207};
-
-  Line Loop(208) = {1011, 1012, 1013, 1014};
-  Plane Surface(208) = {208};
-  Transfinite Surface {208};
-  Recombine Surface {208};
-
-  Line Loop(209) = {411, -514, 2105, -312};
-  Plane Surface(209) = {209};
-  Transfinite Surface {209};
-  Recombine Surface {209};
-
-  Line Loop(210) = {-313, 2106, -811, 611};
-  Plane Surface(210) = {210};
-  Transfinite Surface {210};
-  Recombine Surface {210};
-
-  Line Loop(1211) = {-513, 711, -1011, 2108};
-  Plane Surface(1211) = {1211};
-  Transfinite Surface {1211};
-  Recombine Surface {1211};
-
-  Line Loop(2212) = {2107, -1014, 911, -812};
-  Plane Surface(2212) = {2212};
-  Transfinite Surface {2212};
-  Recombine Surface {2212};
-
-  allSurfaces[] = Surface "*";
-  Extrude {0, 0, LZ}
-  {
-    Surface{allSurfaces[]}; Layers{nZ}; Recombine;
-  }
-
-  Physical Volume("body") = {1,2,3,4,5,6,7,8,9,10,11,12};
-  //+
-  Physical Surface("outer part boundary") = {2226,2213,2220,2222};
-  Physical Surface("load 1") = {2229,2234,2249};
-  Physical Surface("load 2") = {2241,2246,2255};
-  Physical Point("clamped xyz") = {1020};
-  Physical Point("clamped xy") = {803};
-  Physical Point("clamped y") = {1022};
-
-EndIf
diff --git a/katoptron/CMAME/model.py b/katoptron/CMAME/model.py
deleted file mode 100644
index e6d85a72c1e4b8c16322c7b2ef9261058bd95c4f..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/model.py
+++ /dev/null
@@ -1,369 +0,0 @@
-#!/usr/bin/env python3
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-defaut_params = {
-    'Is exp':
-    True,
-    'Is random':
-    True,
-    'Correlation length X':
-    20.,
-    'Correlation length Y':
-    20.,
-    'Correlation length Z':
-    0.,
-    'Number of KL Terms X':
-    5,
-    'Number of KL Terms Y':
-    5,
-    'Number of KL Terms Z':
-    3,
-    'Dispersion level':
-    0.1,
-    'gamma':
-    4368992.,
-    'MueLu xml from current_dir':
-    True,
-    'MueLu xml use template':
-    True,
-    'MueLu xml file name':
-    '/SIMPLE_gs.xml',
-    'MueLu xml template file name':
-    '/../preconditioners/SIMPLE_gs.xml.in',
-    'MueLu xml params name': [
-        '$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-        '$BLOCK_00_GS_sweeps', '$BLOCK_11_GS_sweeps', '$BLOCK_00_GS_damping',
-        '$BLOCK_11_GS_damping', '$SCHUR_omega', '$SimpleSmoother_damping'
-    ],
-    'MueLu xml params': ['3', '3', '10', '10', '1.6', '1.6', '0.5', '1.'],
-    'Write matrix and vectors':
-    False,
-    'Write txt files':
-    False,
-    'inner clamped':
-    False
-}
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = defaut_params
-
-    if case_id == 0:
-        p['Is random'] = False
-    elif case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-    elif case_id == 7:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.01
-    elif case_id == 8:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.01
-    elif case_id == 9:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.01
-
-    if p['Is random'] == True:
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-        p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-
-    p['MueLu xml file name'] = '/SIMPLE_MG.xml'
-    p['MueLu xml template file name'] = '/../preconditioners/SIMPLE_gs_direct_lvl.xml.in'
-    p['MueLu xml params name'] = [
-        '$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-        '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping', '$SCHUR_omega',
-        '$SimpleSmoother_damping', "$N_LVLS", "$N_SIZES", "$EXPORT_DATA",
-        "$SimpleSmoother_sweeps"
-    ]
-    p['MueLu xml params'] = [
-        '3', '3', '3', '0.8', '0.8', '1', '2', '18', "true", '1'
-    ]
-
-    p['Is exp'] = False
-    p['gamma'] = 0.
-    p['Write vtk files'] = False
-    return p
-
-
-def Compute_QoIs(filename):
-    import tboxVtk.reader as vtkR
-    import tboxVtk.lineExtractor as vtkC
-
-    QoI = np.zeros((4, ))
-    reader = vtkR.Reader()
-    reader.open(filename)
-    cutter = vtkC.LineExtractor(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, [
-        5.,
-        5.,
-        0.5,
-    ], [
-        10.,
-        5.,
-        0.5,
-    ],
-                          tag_name='volume_id')
-    pts, tri, vals = cutter.extract(c_output, ['von Mises'], atPoint=False)
-    QoI[0] = vals['von Mises'][0]
-
-    c_output = cutter.cut(1, [
-        5.,
-        5.,
-        0.5,
-    ], [
-        5.,
-        10.,
-        0.5,
-    ],
-                          tag_name='volume_id')
-    pts, tri, vals = cutter.extract(c_output, ['von Mises'], atPoint=False)
-    QoI[1] = vals['von Mises'][0]
-
-    c_output = cutter.cut(1, [
-        5.,
-        5.,
-        0.5,
-    ], [
-        0.,
-        5.,
-        0.5,
-    ],
-                          tag_name='volume_id')
-    pts, tri, vals = cutter.extract(c_output, ['von Mises'], atPoint=False)
-    QoI[2] = vals['von Mises'][0]
-
-    c_output = cutter.cut(1, [
-        5.,
-        5.,
-        0.5,
-    ], [
-        5.,
-        0.,
-        0.5,
-    ],
-                          tag_name='volume_id')
-    pts, tri, vals = cutter.extract(c_output, ['von Mises'], atPoint=False)
-    QoI[3] = vals['von Mises'][0]
-    return QoI
-
-
-class plate_model:
-    def __init__(self,
-                 ensemble_size,
-                 randomVariable,
-                 msh,
-                 comm,
-                 file_dir,
-                 current_dir,
-                 p=defaut_params):
-
-        if p['MueLu xml use template']:
-            old_strings = p['MueLu xml params name']
-            new_strings = p['MueLu xml params']
-
-            muelu_xml_in = file_dir + p['MueLu xml template file name']
-            u.replace_strings(muelu_xml_in,
-                              current_dir + p['MueLu xml file name'],
-                              old_strings, new_strings)
-
-        pbl = m.Problem(msh, comm)
-
-        # Units are in mm
-        E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-        nu = 0.35 * np.ones(ensemble_size)
-        k = 0.
-        d = 0.
-        m.Medium(pbl, "body", "test", E, nu, k, d)
-
-        m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                    ensemble_size)
-        m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0., 1, 0., 0, 0., 0, 0.,
-                    ensemble_size)
-        m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0., 1, 0., 0, 0., 0, 0.,
-                    ensemble_size)
-
-        if p['inner clamped']:
-            m.Dirichlet(pbl, "inner boundary", "Clamped", 1, 0., 1, 0., 1, 0.,
-                        0, 0., ensemble_size)
-
-        norm = tbox.Vector3d(0, 0, -1)
-        cont = m.Contact(pbl, 'inner part boundary', 'contact', norm)
-        cont.setMeshTying()
-        cont.setMaster(pbl, 'outer part boundary', norm)
-        f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-        zero = np.zeros(ensemble_size)
-        one = np.ones(ensemble_size)
-
-        m.Neumann(pbl, 'load 1', 'load', 0, zero, 1, f, 0, zero, 0, one,
-                  ensemble_size)
-        m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -f, 0, zero, 0, one,
-                  ensemble_size)
-
-        solverList = Teuchos.ParameterList()
-        solverList['Ensemble Convergence Tolerance'] = 1e-7
-        solverList['Maximum Iterations'] = 500
-        solverList['Verbosity'] = 33
-        solverList['Flexible Gmres'] = False
-        solverList['Output Style'] = 1
-        solverList['Output Frequency'] = 1
-
-        if p['MueLu xml from current_dir']:
-            solverList['MueLu xml file name'] = current_dir + \
-                p['MueLu xml file name']
-        else:
-            solverList['MueLu xml file name'] = file_dir + \
-                p['MueLu xml file name']
-        solverList['convert MueLu xml file'] = True
-        solverList['Print Teuchos timers'] = True
-
-        solverList['gamma'] = p['gamma']
-        solverList['Use preconditioner'] = True
-
-        solverList['type'] = 'BlockGmres'
-        solverList['Maximum active set iteration'] = 1
-
-        solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-        solverList['Write txt files'] = p['Write txt files']
-        solverList['Write vtk files'] = p['Write vtk files']
-
-        if p["Is exp"]:
-            num_random_variables = randomVariable.shape[1]
-        else:
-            num_random_variables = 0
-
-        for i in range(0, num_random_variables):
-            rand = randomVariable[:, i]
-            pbl.add(m.RandomVariable(rand))
-
-        randomParams = Teuchos.ParameterList()
-
-        randomParams['Is random'] = p['Is random']
-        if randomParams['Is random']:
-            randomParams['Is exp'] = p['Is exp']
-            if p["Is exp"]:
-                randomParams['Begin X'] = 0.
-                randomParams['Begin Y'] = 0.
-                randomParams['Begin Z'] = 0.
-                randomParams['End X'] = 10.
-                randomParams['End Y'] = 10.
-                randomParams['End Z'] = 1.
-                randomParams['Number random variables'] = num_random_variables
-                randomParams['Correlation length X'] = p[
-                    'Correlation length X']
-                randomParams['Correlation length Y'] = p[
-                    'Correlation length Y']
-                randomParams['Correlation length Z'] = p[
-                    'Correlation length Z']
-                randomParams['Number of KL Terms X'] = p[
-                    'Number of KL Terms X']
-                randomParams['Number of KL Terms Y'] = p[
-                    'Number of KL Terms Y']
-                randomParams['Number of KL Terms Z'] = p[
-                    'Number of KL Terms Z']
-                randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-                randomParams['Bound Perturbation Size'] = 1E-10
-            else:
-                randomParams['Correlation length'] = p['Correlation length']
-                randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-                randomParams['Wavenumber discretization points'] = p[
-                    'Wavenumber discretization points']
-                randomParams['Number Z of previously drawn samples'] = p[
-                    'Number Z of previously drawn samples']
-                randomParams['Number Phi of previously drawn samples'] = p[
-                    'Number Phi of previously drawn samples']
-
-            randomParams['Mean'] = E[0] / (2. * (1. + nu[0]))
-            randomParams['Dispersion level'] = p['Dispersion level']
-
-            solverList['randomParams'] = randomParams
-
-        self.pbl = pbl
-        self.solverList = solverList
-        self.ensemble_size = ensemble_size
-
-    def run(self):
-        self.slv = m.IterativeSolver(self.pbl, self.solverList, 3,
-                                     self.ensemble_size)
-        self.slv.start()
-        f = open('timers.txt', 'w')
-        print(self.slv.getTimers(), file=f)
-        f.closed
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir + '/mesh',
-                        work_dir, comm, rank, size)
-
-    np.random.seed(42)
-    N = 1
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-
-    p = get_parameters(0, 0)
-    p['Write txt files'] = True
-    p['Write vtk files'] = True
-
-    ensemble_size = 1
-
-    pm = plate_model(ensemble_size, randomVariable, msh, comm, file_dir,
-                     work_dir, p)
-
-    nThreads = u.Initialize_Kokkos()
-    pm.run()
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_slurm/blake_GS_omega.slurm.sh b/katoptron/CMAME/old_slurm/blake_GS_omega.slurm.sh
deleted file mode 100644
index 1f044eaa36fdedc073a248d3fff1f5fa08a3a76a..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_GS_omega.slurm.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=omega_GS
-#SBATCH --time=41:59:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/omega_GS.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-python run.py katoptron/CMAME/post_process/plate_mean_GS.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_GS.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_GS.slurm.sh
deleted file mode 100644
index 48a666834853d34b4bfb7480d8a14040752a6224..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_GS.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=MC_G
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_GS.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_GS_all_cases.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_GS_direct.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_GS_direct.slurm.sh
deleted file mode 100644
index f30104798978b5cc1733c6416b9fdc3e5801c134..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_GS_direct.slurm.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=GS_direct
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_GS_direct.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=48
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_GS_direct_all_cases.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_GS_fused.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_GS_fused.slurm.sh
deleted file mode 100644
index 1014b6e9efd5a73833c7dd8505b528265f1b5954..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_GS_fused.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=MC_G
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_GS.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/fused_plate_MC_GS_all_cases.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_GS_fused_prec.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_GS_fused_prec.slurm.sh
deleted file mode 100644
index c001d63b881ef57d3951cb8c451c7610b18b2457..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_GS_fused_prec.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=MC_G
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_GS.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/fused_plate_mean_prec_GS.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_MG.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_MG.slurm.sh
deleted file mode 100644
index 4fa094a91e6caf25ffca2d6ef0c498516921fd02..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_MG.slurm.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=MC_MG
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_MG.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=48
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_MG_all_cases.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_MG_2.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_MG_2.slurm.sh
deleted file mode 100644
index a20dca603fdf917fcc9b9d3f0e2ad7fd2ef6b71b..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_MG_2.slurm.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=MC_MG
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_MG.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=48
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_MG_all_cases_2.py
diff --git a/katoptron/CMAME/old_slurm/blake_MC_direct.slurm.sh b/katoptron/CMAME/old_slurm/blake_MC_direct.slurm.sh
deleted file mode 100644
index dd624883b53a710ce025f36bc1768ce2b759c2a2..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_MC_direct.slurm.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_UQ
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_direct.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_direct_case_1.py
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_direct_case_2.py
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_direct_case_3.py
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_direct_case_4.py
diff --git a/katoptron/CMAME/old_slurm/blake_NO_EP.slurm.sh b/katoptron/CMAME/old_slurm/blake_NO_EP.slurm.sh
deleted file mode 100644
index 844b9c3cbf8e6f77b40e994dac121d5bfe0e8a34..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_NO_EP.slurm.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_UQ
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_UQ.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-python run.py -k 24 katoptron/CMAME/tests/plate_MC_NO_EP_case_1.py
-python run.py -k 24 katoptron/CMAME/tests/plate_MC_NO_EP_case_2.py
-python run.py -k 24 katoptron/CMAME/tests/plate_MC_NO_EP_case_3.py
-python run.py -k 24 katoptron/CMAME/tests/plate_MC_NO_EP_case_4.py
diff --git a/katoptron/CMAME/old_slurm/blake_convergence_direct.slurm.sh b/katoptron/CMAME/old_slurm/blake_convergence_direct.slurm.sh
deleted file mode 100644
index e9d6c2c28c5edaadc94d7e97cabb378a34c31ed1..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_convergence_direct.slurm.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=conv_KLU
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_convergence_direct.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-python run.py katoptron/CMAME/tests/plate_convergence_direct.py
diff --git a/katoptron/CMAME/old_slurm/blake_correlation.slurm.sh b/katoptron/CMAME/old_slurm/blake_correlation.slurm.sh
deleted file mode 100644
index 436291f1c8c2ee3d0a4203bb3ec0f6d399328f18..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_correlation.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_corr
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_corr.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_correlation.py
diff --git a/katoptron/CMAME/old_slurm/blake_eigenvalues_direct.slurm.sh b/katoptron/CMAME/old_slurm/blake_eigenvalues_direct.slurm.sh
deleted file mode 100644
index 5695e45bfa466311f4d5ab48affaec938ec35c5d..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_eigenvalues_direct.slurm.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=omegas_KLU
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_deltas_omegas_direct.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-mpirun -np 8 python run.py katoptron/CMAME/tests/plate_deltas_omegas_direct.py
diff --git a/katoptron/CMAME/old_slurm/blake_eigenvalues_gs.slurm.sh b/katoptron/CMAME/old_slurm/blake_eigenvalues_gs.slurm.sh
deleted file mode 100644
index fb90109d96a3f84f119f249e8a26f24f85255253..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_eigenvalues_gs.slurm.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=omegas_GS
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 2
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_deltas_omegas_GS.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-mpirun -np 16 python run.py katoptron/CMAME/tests/plate_deltas_omegas_GS.py
diff --git a/katoptron/CMAME/old_slurm/blake_gamma.slurm.sh b/katoptron/CMAME/old_slurm/blake_gamma.slurm.sh
deleted file mode 100644
index 5f70c54daf42dfaf5e1b7b8751bef10b7790319a..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_gamma.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_gamma
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_gamma.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_mean_gamma.py
diff --git a/katoptron/CMAME/old_slurm/blake_prec.slurm.sh b/katoptron/CMAME/old_slurm/blake_prec.slurm.sh
deleted file mode 100644
index 79eba568e43f34a937460d13710795097a18adb1..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_prec.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_prec
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_prec.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_mean_prec.py
diff --git a/katoptron/CMAME/old_slurm/blake_prec_GS_direct.slurm.sh b/katoptron/CMAME/old_slurm/blake_prec_GS_direct.slurm.sh
deleted file mode 100644
index 10a5cadbf20a969ce310c256bd942453c80b7cc4..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_prec_GS_direct.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_prec
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_prec.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_mean_prec_GS_direct.py
diff --git a/katoptron/CMAME/old_slurm/blake_prec_GS_direct_lvl.slurm.sh b/katoptron/CMAME/old_slurm/blake_prec_GS_direct_lvl.slurm.sh
deleted file mode 100644
index 5644e3fad8b0adff01f208dbfb905ab0a8e010f2..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/blake_prec_GS_direct_lvl.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate_prec
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_prec.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_mean_prec_GS_direct_lvl.py
diff --git a/katoptron/CMAME/old_slurm/bowman.slurm.sh b/katoptron/CMAME/old_slurm/bowman.slurm.sh
deleted file mode 100644
index 27b82e587a646bb00665a842ea714d7c6eb1d71f..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_slurm/bowman.slurm.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# Submission script for Bowman
-#SBATCH --job-name=plate_UQ
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p knl-delta
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate_UQ.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=256
-
-export KMP_HW_SUBSET=64c,4t
-export KMP_AFFINITY=balanced
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC.py
diff --git a/katoptron/CMAME/old_tests/2_cubes_patch_GS.py b/katoptron/CMAME/old_tests/2_cubes_patch_GS.py
deleted file mode 100644
index c589f5103d43a67d8d3f6d98c12643d0448828fe..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/2_cubes_patch_GS.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-#import matplotlib.pyplot as plt
-
-from katoptron.eigenvalues import *
-from katoptron.convergence import *
-
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from PyTrilinos import Teuchos
-
-
-def evaluate_cubes(args, msh, comm, ensemble_size, _E, file_dir):
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0.,
-                 1, 0., 1, 0., 0, 0., ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0,
-              zero, 1, p, 0, zero, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['gamma'] = 29.58164477018121
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/SIMPLE_gs.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-    if ensemble_size == 1:
-        solverList['Create Preconditioned Matrix'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, args.k, solverList,
-                                3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, args.k, solverList,
-                                3, ensemble_size)
-
-    slv.start()
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    geo_name = '../tests/2_cubes_patch.geo'
-    mesh_name = '2_cubes_patch.msh'
-    partitioned_mesh_name = '2_cubes_patch.msh'
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    gmsh.MeshLoader(geo_name, __file__).execute()
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + work_dir + '/' + mesh_name + ' -o ' + \
-            work_dir + '/' + partitioned_mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    N = 32
-
-    E = np.linspace(5., 15.0, num=N)
-
-    ensemble_sizes = [1, 8, 16, 32]
-
-    for e in range(0, len(ensemble_sizes)):
-        directory = str(ensemble_sizes[e])
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        for i in range(0, (N // ensemble_sizes[e])):
-            directory = str(i)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_cubes(
-                args, msh, comm, ensemble_sizes[e], E[i*ensemble_sizes[e]:(i+1)*ensemble_sizes[e]], file_dir)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/2_cubes_patch_GS_klu.py b/katoptron/CMAME/old_tests/2_cubes_patch_GS_klu.py
deleted file mode 100644
index 324f09890ef83114e4310f5b2d454ffb35bbe7c4..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/2_cubes_patch_GS_klu.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-#import matplotlib.pyplot as plt
-
-from katoptron.eigenvalues import *
-from katoptron.convergence import *
-
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from PyTrilinos import Teuchos
-
-
-def evaluate_cubes(args, msh, comm, ensemble_size, _E, file_dir):
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0.,
-                 1, 0., 1, 0., 0, 0., ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0,
-              zero, 1, p, 0, zero, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['gamma'] = 29.58164477018121
-
-    old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                   '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                   '$SCHUR_omega', '$SimpleSmoother_damping']
-    new_strings = ['3', '3', '100', '1.75', '0.05', '1.']
-
-    muelu_xml_in = file_dir + p['MueLu xml template file name']
-    u.replace_strings(muelu_xml_in, current_dir +
-                      p['MueLu xml file name'], old_strings, new_strings)
-
-    p['MueLu xml template file name'] = '/../preconditioners/SIMPLE_gs.xml.in'
-    p['MueLu xml params name'] = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                                  '$BLOCK_00_GS_sweeps', '$BLOCK_11_GS_sweeps',
-                                  '$BLOCK_00_GS_damping', '$BLOCK_11_GS_damping',
-                                  '$SCHUR_omega', '$SimpleSmoother_damping']
-    p['MueLu xml params'] = ['3', '3', '100', '1.75', '0.05', '1.']
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/SIMPLE_gs.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-    if ensemble_size == 1:
-        solverList['Create Preconditioned Matrix'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, args.k, solverList,
-                                3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, args.k, solverList,
-                                3, ensemble_size)
-
-    slv.start()
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    geo_name = '../tests/2_cubes_patch.geo'
-    mesh_name = '2_cubes_patch.msh'
-    partitioned_mesh_name = '2_cubes_patch.msh'
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    gmsh.MeshLoader(geo_name, __file__).execute()
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + work_dir + '/' + mesh_name + ' -o ' + \
-            work_dir + '/' + partitioned_mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    N = 32
-
-    E = np.linspace(5., 15.0, num=N)
-
-    ensemble_sizes = [1, 8, 16, 32]
-
-    for e in range(0, len(ensemble_sizes)):
-        directory = str(ensemble_sizes[e])
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        for i in range(0, (N // ensemble_sizes[e])):
-            directory = str(i)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_cubes(
-                args, msh, comm, ensemble_sizes[e], E[i*ensemble_sizes[e]:(i+1)*ensemble_sizes[e]], file_dir)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/2_cubes_patch_direct.py b/katoptron/CMAME/old_tests/2_cubes_patch_direct.py
deleted file mode 100644
index b3b8224215a58ed920217e28c801568471284615..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/2_cubes_patch_direct.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-#import matplotlib.pyplot as plt
-
-from katoptron.eigenvalues import *
-from katoptron.convergence import *
-
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from PyTrilinos import Teuchos
-
-
-def evaluate_cubes(args, msh, comm, ensemble_size, _E, file_dir):
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0.,
-                 1, 0., 1, 0., 0, 0., ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0,
-              zero, 1, p, 0, zero, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['gamma'] = 29.58164477018121
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/SIMPLE_direct.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-    if ensemble_size == 1:
-        solverList['Create Preconditioned Matrix'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, args.k, solverList,
-                                3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, args.k, solverList,
-                                3, ensemble_size)
-
-    slv.start()
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    geo_name = '../tests/2_cubes_patch.geo'
-    mesh_name = '2_cubes_patch.msh'
-    partitioned_mesh_name = '2_cubes_patch.msh'
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    gmsh.MeshLoader(geo_name, __file__).execute()
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + work_dir + '/' + mesh_name + ' -o ' + \
-            work_dir + '/' + partitioned_mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    N = 32
-
-    E = np.linspace(5., 15.0, num=N)
-
-    ensemble_sizes = [1, 8, 16, 32]
-
-    for e in range(0, len(ensemble_sizes)):
-        directory = str(ensemble_sizes[e])
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        for i in range(0, (N // ensemble_sizes[e])):
-            directory = str(i)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_cubes(
-                args, msh, comm, ensemble_sizes[e], E[i*ensemble_sizes[e]:(i+1)*ensemble_sizes[e]], file_dir)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/clean_A_B.py b/katoptron/CMAME/old_tests/clean_A_B.py
deleted file mode 100644
index 98b2e7b30a76ecd1daee1d9ee212751a0c25aaaf..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/clean_A_B.py
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-from scipy import sparse
-
-
-def write_mm(filename, matrix, drow=0, dcol=0):
-    f = open(filename, 'w')
-    print('%%MatrixMarket matrix', file=f)
-    print(str(int(matrix.shape[0])) + ' ' + str(int(matrix.shape[1])) + ' ' + str(int(matrix.count_nonzero())), file=f)
-
-    row, col = matrix.nonzero()
-    for i in range(0, matrix.count_nonzero()):
-        print(str(int(row[i]+1+drow)) + ' ' + str(int(col[i]+1+dcol)) + ' ' + '{0:1.17e}'.format(matrix[row[i], col[i]]), file=f)
-
-    f.closed
-
-
-def write_vector_mm(filename, vec, n):
-    f = open(filename, 'w')
-    print('%%MatrixMarket matrix', file=f)
-    print(str(int(n)), file=f)
-    for i in range(0, n):
-        if i < vec.size:
-            print('{0:1.17e}'.format(vec[i]), file=f)
-        else:
-            print('{0:1.17e}'.format(0.), file=f)
-
-    f.closed
-
-
-def main():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    input_file_dir = '/Users/kimliegeois/Desktop/workspace 5/katoptron_tests_beam'
-
-    filename_Q = input_file_dir + '/ApCTC_mm.txt'
-    filename_GT = input_file_dir + '/B_mm.txt'
-    filename_f = input_file_dir + '/b_mm_after_bc.txt'
-
-    Q = read_mm(filename_Q)
-    Q = get_symmetrical_part(Q)
-    GT = read_mm(filename_GT)
-    G = GT.transpose()
-    f = read_mm(filename_f, is_sparse=False)
-
-    print(Q.shape)
-    print(Q.count_nonzero())
-
-    write_vector_mm('f_mm.txt', f, G.shape[0]+G.shape[1])
-
-    write_mm('Q_mm.txt', Q)
-    write_mm('G_mm.txt', G, dcol=Q.shape[0])
-    write_mm('GT_mm.txt', GT, drow=Q.shape[0])
-
-    Afull = read_mm(
-        "/Users/kimliegeois/Desktop/workspace 7/katoptron_tests_beam/Applied_Matrix_mm.txt", is_sparse=False)
-    A = sparse.csr_matrix(Afull)
-
-    print(A.count_nonzero())
-
-    write_mm('A_full_mm.txt', A)
-    write_mm('C_mm.txt', A[Q.shape[0]:A.shape[0], Q.shape[1]:A.shape[1]])
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/compare_GB.py b/katoptron/CMAME/old_tests/compare_GB.py
deleted file mode 100644
index 640c83fa7fa2dda5d12577393249009d8d2f6441..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/compare_GB.py
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-from scipy import sparse
-import matplotlib.pyplot as plt
-
-def test1():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    input_file_dir = '/Users/kimliegeois/Desktop/gaston'
-
-    filename_GT = input_file_dir + '/B_mm.txt'
-
-    GT_gaston = read_mm(filename_GT)
-
-    X = np.loadtxt(filename_GT, skiprows=2)
-
-    row_gaston = X[:, 0].astype(int)-1
-    col_gaston = X[:, 1].astype(int)-1
-    data_gaston = X[:, 2]    
-
-    input_file_dir = '/Users/kimliegeois/Desktop/blake'
-
-    filename_GT = input_file_dir + '/B_mm.txt'
-
-    GT_blake = read_mm(filename_GT)
-
-    X = np.loadtxt(filename_GT, skiprows=2)
-
-    row_blake = X[:, 0].astype(int)-1
-    col_blake = X[:, 1].astype(int)-1
-    data_blake = X[:, 2]   
-
-    nNode = 341
-
-    plot_indices = np.arange(80,120,1,dtype=int)
-
-    print(col_gaston[plot_indices])
-    print(col_blake[plot_indices])
-
-    indT = np.argwhere(col_gaston <= nNode)
-    indMech = np.argwhere(col_gaston > nNode)
-
-
-    col_gaston_2 = np.copy(col_gaston)
-
-    col_gaston_2[indT] = (col_gaston[indT]+1)*4-1
-
-    indexNodes =  np.floor((col_gaston_2[indMech] - nNode)/3.)
-    rest = (col_gaston_2[indMech] - nNode) - 3*indexNodes
-
-    plt.figure()
-    plt.plot(indexNodes[plot_indices],'*')
-
-    plt.figure()
-    plt.plot(rest[plot_indices],'*')
-
-    col_gaston_2[indMech] = indexNodes*4+rest
-
-    #print(col_gaston[0:30])
-    print(col_gaston_2[plot_indices])
-    print(col_blake[plot_indices])
-
-    print(np.amax(np.abs(data_gaston-data_blake)))
-    print(np.amax(np.abs(col_gaston_2-col_blake)))
-    print(np.amax(np.abs(row_gaston-row_blake)))
-
-    plt.figure()
-    plt.plot(col_gaston_2[plot_indices]-col_blake[plot_indices],'*')
-    #plt.show()
-
-def test2():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    input_file_dir = '/Users/kimliegeois/Desktop/gaston'
-
-    filename_GT = input_file_dir + '/B_T_mm.txt'
-
-    GT_gaston = read_mm(filename_GT)
-
-    X = np.loadtxt(filename_GT, skiprows=2)
-
-    row_gaston = X[:, 0].astype(int)-1
-    col_gaston = X[:, 1].astype(int)-1
-    data_gaston = X[:, 2]    
-
-    input_file_dir = '/Users/kimliegeois/Desktop/blake'
-
-    filename_GT = input_file_dir + '/B_T_mm.txt'
-
-    GT_blake = read_mm(filename_GT)
-
-    X = np.loadtxt(filename_GT, skiprows=2)
-
-    row_blake = X[:, 0].astype(int)-1
-    col_blake = X[:, 1].astype(int)-1
-    data_blake = X[:, 2]   
-
-    nNode = 341
-
-    indT = np.argwhere(row_gaston <= nNode)
-    indMech = np.argwhere(row_gaston > nNode)
-
-    plot_indices = np.arange(80,120,1,dtype=int)
-
-    row_gaston_2 = np.copy(row_gaston)
-
-    row_gaston_2[indT] = (row_gaston[indT]+1)*4-1
-
-    indexNodes =  np.floor((row_gaston_2[indMech] - nNode)/3.)
-    rest = (row_gaston_2[indMech] - nNode) - 3*indexNodes
-
-    plt.figure()
-    plt.plot(indexNodes[plot_indices],'*')
-
-    plt.figure()
-    plt.plot(rest[plot_indices],'*')
-
-    row_gaston_2[indMech] = indexNodes*4+rest
-
-
-
-    row_gaston_order = row_gaston_2*100+col_gaston
-    row_blake_order = row_blake*100+col_blake
-
-    order_gaston = np.argsort(row_gaston_order)
-    order_blake = np.argsort(row_blake_order)
-
-    print(row_gaston_2[plot_indices])
-    print(row_blake[plot_indices])
-
-    print(np.amax(np.abs(data_gaston[order_gaston]-data_blake[order_blake])))
-    print(np.amax(np.abs(row_gaston_2[order_gaston]-row_blake[order_blake])))
-    print(np.amax(np.abs(col_gaston[order_gaston]-col_blake[order_blake])))
-
-
-    #print(np.sum(row_gaston_2-row_blake))
-
-    plt.figure()
-    plt.plot(row_gaston_2[order_gaston]-row_blake[order_blake],'*')
-    #plt.show()
-
-def main():
-    test2()
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/cube_deltas_omegas_GS.py b/katoptron/CMAME/old_tests/cube_deltas_omegas_GS.py
deleted file mode 100644
index 23505af4b1907f11feef21cb7bba95742265f2df..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/cube_deltas_omegas_GS.py
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def main():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    n_sweeps_Q = 10
-    damp_Q = 1.6
-
-    n_sweeps_R = 10
-    damp_R = 1.6
-
-    omega = 0.5
-
-    N = 32
-
-    input_file_dir = file_dir + \
-        '/../../workspace/katoptron_CMAME_tests_2_cubes_patch_convergence/1/'
-
-    sample_per_rank = np.ceil((N / siz))
-    i_min = rank*sample_per_rank
-    i_max = i_min+sample_per_rank
-
-    if i_min > N:
-        i_min = N
-    if i_max > N:
-        i_max = N
-
-    i_min = int(i_min)
-    i_max = int(i_max)
-
-    print('Rank ' + str(rank) + ' from sample ' + str(i_min) + ':' + str(i_max))
-
-    for i in range(i_min, i_max):
-        timers = fwk.Timers()
-
-        filename_Q = input_file_dir + str(i) + '/ApCTC_mm.txt'
-        filename_GT = input_file_dir + str(i) + '/B_mm.txt'
-        filename_f = input_file_dir + str(i) + '/b_mm_after_bc.txt'
-
-        timers['Read files'].start()
-        Q = read_mm(filename_Q)
-        Q = get_symmetrical_part(Q)
-        GT = read_mm(filename_GT)
-        G = GT.transpose()
-        f = read_mm(filename_f, is_sparse=False)
-        timers['Read files'].stop()
-
-        timers['Compute R'].start()
-        R = approx_Schur_complement(Q, G, GT)
-        timers['Compute R'].stop()
-
-        timers['Compute invR'].start()
-        invR = Gauss_Seidel(R, n=n_sweeps_R, damping=damp_R)
-        timers['Compute invR'].stop()
-
-        print(timers)
-
-        timers['Compute the inverse of Q'].start()
-        invQ = Gauss_Seidel(Q, n=n_sweeps_Q, damping=damp_Q)
-        timers['Compute the inverse of Q'].stop()
-
-        print(timers)
-
-        timers['Compute the preconditioned matrix'].start()
-        AinvP = SIMPLE_preconditioned_matrix(
-            Q, invQ, G, GT, R, invR, omega=omega)
-        timers['Compute the preconditioned matrix'].stop()
-
-        print(timers)
-
-        tmp = np.zeros(AinvP.shape)
-        for i in range(0, AinvP.shape[0]):
-            tmp[i, i] = 1
-            tmp[:, i] = AinvP.dot(tmp[:, i])
-
-        print(AinvP.shape)
-
-        w, v, cond = compute_eig_and_departure_from_orthogonality(tmp)
-        print(cond)
-
-        return
-        timers['Compute the basis'].start()
-
-        n = Q.shape[0]+R.shape[0]
-        b = np.zeros((n,))
-        b[0:len(f)] = f
-
-        N = 2
-        m_max = 6000
-        V, W = compute_VW(AinvP, b, m=m_max, N=N)
-        timers['Compute the basis'].stop()
-
-        print(timers)
-
-        timers['Compute the eigenvalues'].start()
-        deltas, omegas = compute_deltas_omegas(V, W, b)
-        timers['Compute the eigenvalues'].stop()
-
-        print(timers)
-
-        timers['Write the eigenvalues'].start()
-        write_eigenvalues(deltas, work_dir+'/deltas_GS_GS_' + str(i) + '.txt')
-        np.savetxt(work_dir+'/omegas_GS_GS_' + str(i) + '.txt', omegas)
-        timers['Write the eigenvalues'].stop()
-
-        f = open('timers_' + str(i) + '.txt', 'w')
-        print(timers, file=f)
-        f.closed
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/fused_plate_MC_GS_all_cases.py b/katoptron/CMAME/old_tests/fused_plate_MC_GS_all_cases.py
deleted file mode 100644
index 858bfe315088bf522bb34403d133e96840fa7f30..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/fused_plate_MC_GS_all_cases.py
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = model.defaut_params
-
-    if case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-
-    p['Wavenumber cutoff'] = 8.
-    p['Wavenumber discretization points'] = nuw
-    p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-    p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-
-    p['Is exp'] = False
-    return p
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = get_parameters(case_id, first_sample_id)
-
-    pbl = m.Problem(msh, comm)
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0., 1, 0., 0, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0., 1, 0., 0, 0., 0, 0.,
-                ensemble_size)
-
-    f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1, f, 0, zero, 0, one,
-              ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -f, 0, zero, 0, one,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-6
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    prec = 3
-
-    if prec == 1:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 1
-        mueluParams['coarse: type'] = "CHEBYSHEV"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['chebyshev: degree'] = 20
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['coarse: params'] = mueluParamsSub2
-    elif prec == 2:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 1
-        mueluParams['coarse: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-        mueluParamsSub2['relaxation: sweeps'] = 10
-        mueluParamsSub2['relaxation: damping factor'] = 1.75
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['coarse: params'] = mueluParamsSub2
-    elif prec == 3:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 2
-        mueluParams['smoother: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-        mueluParamsSub2['relaxation: sweeps'] = 10
-        mueluParamsSub2['relaxation: damping factor'] = 1.75
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['smoother: params'] = mueluParamsSub2
-
-        mueluParams['coarse: type'] = "Klu"
-        mueluParams['coarse: max size'] = 18
-
-    solverList['convert MueLu xml file'] = True
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['gamma'] = p['gamma']
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-    solverList['Write txt files'] = p['Write txt files']
-
-    if p["Is exp"]:
-        num_random_variables = randomVariable.shape[1]
-    else:
-        num_random_variables = 0
-
-    for i in range(0, num_random_variables):
-        rand = randomVariable[:, i]
-        pbl.add(m.RandomVariable(rand))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Is exp'] = p['Is exp']
-    if p["Is exp"]:
-        randomParams['Begin X'] = 0.
-        randomParams['Begin Y'] = 0.
-        randomParams['Begin Z'] = 0.
-        randomParams['End X'] = 10.
-        randomParams['End Y'] = 10.
-        randomParams['End Z'] = 1.
-        randomParams['Number random variables'] = num_random_variables
-        randomParams['Correlation length X'] = p['Correlation length X']
-        randomParams['Correlation length Y'] = p['Correlation length Y']
-        randomParams['Correlation length Z'] = p['Correlation length Z']
-        randomParams['Number of KL Terms X'] = p['Number of KL Terms X']
-        randomParams['Number of KL Terms Y'] = p['Number of KL Terms Y']
-        randomParams['Number of KL Terms Z'] = p['Number of KL Terms Z']
-        randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-        randomParams['Bound Perturbation Size'] = 1E-10
-    else:
-        randomParams['Correlation length'] = p['Correlation length']
-        randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-        randomParams['Wavenumber discretization points'] = p[
-            'Wavenumber discretization points']
-        randomParams['Number Z of previously drawn samples'] = p[
-            'Number Z of previously drawn samples']
-        randomParams['Number Phi of previously drawn samples'] = p[
-            'Number Phi of previously drawn samples']
-
-    randomParams['Mean'] = E[0] / (2. * (1. + nu[0]))
-    randomParams['Dispersion level'] = p['Dispersion level']
-
-    solverList['randomParams'] = randomParams
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = N // ensemble_size
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                      msh, comm, file_dir)
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('plate.geo', file_dir).execute()
-
-    N = 32
-    ensemble_sizes = [1, 8, 16, 32]
-    case_ids = [1, 2, 3, 4, 5, 6]
-
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS.py b/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS.py
deleted file mode 100644
index 262ff4e3df65b4a25957c38de0f6fd763f348c7b..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS.py
+++ /dev/null
@@ -1,248 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, Ngs, omegags, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pbl = m.Problem(msh, comm)
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0.,
-                1, 0., 1, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-
-    f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1,
-              f, 0, zero, 0, one, ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -
-              f, 0, zero, 0, one, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-6
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 3
-    mueluParams['max levels'] = 1
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = Ngs
-    mueluParamsSub2['relaxation: damping factor'] = omegags
-
-    mueluParams['verbosity'] = "high"
-
-    mueluParams['coarse: params'] = mueluParamsSub2
-
-    solverList['convert MueLu xml file'] = True
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['gamma'] = p['gamma']
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-    solverList['Write txt files'] = p['Write txt files']
-
-    if p["Is exp"]:
-        num_random_variables = randomVariable.shape[1]
-    else:
-        num_random_variables = 0
-
-    for i in range(0, num_random_variables):
-        rand = randomVariable[:, i]
-        pbl.add(m.RandomVariable(rand))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Is exp'] = p['Is exp']
-    if p["Is exp"]:
-        randomParams['Begin X'] = 0.
-        randomParams['Begin Y'] = 0.
-        randomParams['Begin Z'] = 0.
-        randomParams['End X'] = 10.
-        randomParams['End Y'] = 10.
-        randomParams['End Z'] = 1.
-        randomParams['Number random variables'] = num_random_variables
-        randomParams['Correlation length X'] = p['Correlation length X']
-        randomParams['Correlation length Y'] = p['Correlation length Y']
-        randomParams['Correlation length Z'] = p['Correlation length Z']
-        randomParams['Number of KL Terms X'] = p['Number of KL Terms X']
-        randomParams['Number of KL Terms Y'] = p['Number of KL Terms Y']
-        randomParams['Number of KL Terms Z'] = p['Number of KL Terms Z']
-        randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-        randomParams['Bound Perturbation Size'] = 1E-10
-    else:
-        randomParams['Correlation length'] = p['Correlation length']
-        randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-        randomParams['Wavenumber discretization points'] = p['Wavenumber discretization points']
-        randomParams['Number Z of previously drawn samples'] = p['Number Z of previously drawn samples']
-        randomParams['Number Phi of previously drawn samples'] = p['Number Phi of previously drawn samples']
-
-    randomParams['Mean'] = E[0] / (2.*(1.+nu[0]))
-    randomParams['Dispersion level'] = p['Dispersion level']
-
-    solverList['randomParams'] = randomParams
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_prec(msh, comm, file_dir, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(0, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        Ngs = int(prec_params[i, 0])
-        omegags = prec_params[i, 1]
-
-        directory = 'mean_case'
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        evaluate_prec(msh, comm, file_dir, Ngs, omegags)
-        os.chdir('..')
-
-        for ensemble_size in [8]:
-            directory = 'ensemble_reduction_' + str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_prec(msh,
-                          comm,
-                          file_dir,
-                          Ngs, omegags,
-                          ensemble_size=ensemble_size)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('plate.geo', file_dir).execute()
-
-    GS_sweeps_00_min = 1
-    GS_sweeps_00_max = 41
-    delta_GS_sweeps_00 = 1
-
-    N_GS_sweeps_00 = int(
-        np.ceil(
-            ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-    # Damping has to be between 0 and 2
-    GS_damping_00_min = 0.001
-    GS_damping_00_max = 1.999
-    N_GS_damping_00 = 50
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max,
-                          delta_GS_sweeps_00)
-    damping_00 = np.linspace(GS_damping_00_min, GS_damping_00_max,
-                             N_GS_damping_00)
-
-    N = N_GS_sweeps_00 * N_GS_damping_00
-
-    prec_params = np.zeros((N, 2))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_damping_00):
-            prec_params[i, :] = [
-                sweeps_00[i_0], damping_00[i_1]
-            ]
-            i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_2.py b/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_2.py
deleted file mode 100644
index a0ec61755b5f0f29edcddff3ccedbc45de7975e4..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_2.py
+++ /dev/null
@@ -1,248 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, Ngs, omegags, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pbl = m.Problem(msh, comm)
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0.,
-                1, 0., 1, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-
-    f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1,
-              f, 0, zero, 0, one, ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -
-              f, 0, zero, 0, one, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-6
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 3
-    mueluParams['max levels'] = 1
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = Ngs
-    mueluParamsSub2['relaxation: damping factor'] = omegags
-
-    mueluParams['verbosity'] = "high"
-
-    mueluParams['coarse: params'] = mueluParamsSub2
-
-    solverList['convert MueLu xml file'] = True
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['gamma'] = p['gamma']
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-    solverList['Write txt files'] = p['Write txt files']
-
-    if p["Is exp"]:
-        num_random_variables = randomVariable.shape[1]
-    else:
-        num_random_variables = 0
-
-    for i in range(0, num_random_variables):
-        rand = randomVariable[:, i]
-        pbl.add(m.RandomVariable(rand))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Is exp'] = p['Is exp']
-    if p["Is exp"]:
-        randomParams['Begin X'] = 0.
-        randomParams['Begin Y'] = 0.
-        randomParams['Begin Z'] = 0.
-        randomParams['End X'] = 10.
-        randomParams['End Y'] = 10.
-        randomParams['End Z'] = 1.
-        randomParams['Number random variables'] = num_random_variables
-        randomParams['Correlation length X'] = p['Correlation length X']
-        randomParams['Correlation length Y'] = p['Correlation length Y']
-        randomParams['Correlation length Z'] = p['Correlation length Z']
-        randomParams['Number of KL Terms X'] = p['Number of KL Terms X']
-        randomParams['Number of KL Terms Y'] = p['Number of KL Terms Y']
-        randomParams['Number of KL Terms Z'] = p['Number of KL Terms Z']
-        randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-        randomParams['Bound Perturbation Size'] = 1E-10
-    else:
-        randomParams['Correlation length'] = p['Correlation length']
-        randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-        randomParams['Wavenumber discretization points'] = p['Wavenumber discretization points']
-        randomParams['Number Z of previously drawn samples'] = p['Number Z of previously drawn samples']
-        randomParams['Number Phi of previously drawn samples'] = p['Number Phi of previously drawn samples']
-
-    randomParams['Mean'] = E[0] / (2.*(1.+nu[0]))
-    randomParams['Dispersion level'] = p['Dispersion level']
-
-    solverList['randomParams'] = randomParams
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_prec(msh, comm, file_dir, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(500, 1000):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        Ngs = int(prec_params[i, 0])
-        omegags = prec_params[i, 1]
-
-        directory = 'mean_case'
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        evaluate_prec(msh, comm, file_dir, Ngs, omegags)
-        os.chdir('..')
-
-        for ensemble_size in [8]:
-            directory = 'ensemble_reduction_' + str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_prec(msh,
-                          comm,
-                          file_dir,
-                          Ngs, omegags,
-                          ensemble_size=ensemble_size)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('plate.geo', file_dir).execute()
-
-    GS_sweeps_00_min = 1
-    GS_sweeps_00_max = 41
-    delta_GS_sweeps_00 = 1
-
-    N_GS_sweeps_00 = int(
-        np.ceil(
-            ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-    # Damping has to be between 0 and 2
-    GS_damping_00_min = 0.001
-    GS_damping_00_max = 1.999
-    N_GS_damping_00 = 50
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max,
-                          delta_GS_sweeps_00)
-    damping_00 = np.linspace(GS_damping_00_min, GS_damping_00_max,
-                             N_GS_damping_00)
-
-    N = N_GS_sweeps_00 * N_GS_damping_00
-
-    prec_params = np.zeros((N, 2))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_damping_00):
-            prec_params[i, :] = [
-                sweeps_00[i_0], damping_00[i_1]
-            ]
-            i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_3.py b/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_3.py
deleted file mode 100644
index db9723d0711e5cfdf0f0d932bc61230896b144ea..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_3.py
+++ /dev/null
@@ -1,248 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, Ngs, omegags, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pbl = m.Problem(msh, comm)
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0.,
-                1, 0., 1, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-
-    f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1,
-              f, 0, zero, 0, one, ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -
-              f, 0, zero, 0, one, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-6
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 3
-    mueluParams['max levels'] = 1
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = Ngs
-    mueluParamsSub2['relaxation: damping factor'] = omegags
-
-    mueluParams['verbosity'] = "high"
-
-    mueluParams['coarse: params'] = mueluParamsSub2
-
-    solverList['convert MueLu xml file'] = True
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['gamma'] = p['gamma']
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-    solverList['Write txt files'] = p['Write txt files']
-
-    if p["Is exp"]:
-        num_random_variables = randomVariable.shape[1]
-    else:
-        num_random_variables = 0
-
-    for i in range(0, num_random_variables):
-        rand = randomVariable[:, i]
-        pbl.add(m.RandomVariable(rand))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Is exp'] = p['Is exp']
-    if p["Is exp"]:
-        randomParams['Begin X'] = 0.
-        randomParams['Begin Y'] = 0.
-        randomParams['Begin Z'] = 0.
-        randomParams['End X'] = 10.
-        randomParams['End Y'] = 10.
-        randomParams['End Z'] = 1.
-        randomParams['Number random variables'] = num_random_variables
-        randomParams['Correlation length X'] = p['Correlation length X']
-        randomParams['Correlation length Y'] = p['Correlation length Y']
-        randomParams['Correlation length Z'] = p['Correlation length Z']
-        randomParams['Number of KL Terms X'] = p['Number of KL Terms X']
-        randomParams['Number of KL Terms Y'] = p['Number of KL Terms Y']
-        randomParams['Number of KL Terms Z'] = p['Number of KL Terms Z']
-        randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-        randomParams['Bound Perturbation Size'] = 1E-10
-    else:
-        randomParams['Correlation length'] = p['Correlation length']
-        randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-        randomParams['Wavenumber discretization points'] = p['Wavenumber discretization points']
-        randomParams['Number Z of previously drawn samples'] = p['Number Z of previously drawn samples']
-        randomParams['Number Phi of previously drawn samples'] = p['Number Phi of previously drawn samples']
-
-    randomParams['Mean'] = E[0] / (2.*(1.+nu[0]))
-    randomParams['Dispersion level'] = p['Dispersion level']
-
-    solverList['randomParams'] = randomParams
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_prec(msh, comm, file_dir, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(1000, 1500):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        Ngs = int(prec_params[i, 0])
-        omegags = prec_params[i, 1]
-
-        directory = 'mean_case'
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        evaluate_prec(msh, comm, file_dir, Ngs, omegags)
-        os.chdir('..')
-
-        for ensemble_size in [8]:
-            directory = 'ensemble_reduction_' + str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_prec(msh,
-                          comm,
-                          file_dir,
-                          Ngs, omegags,
-                          ensemble_size=ensemble_size)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('plate.geo', file_dir).execute()
-
-    GS_sweeps_00_min = 1
-    GS_sweeps_00_max = 41
-    delta_GS_sweeps_00 = 1
-
-    N_GS_sweeps_00 = int(
-        np.ceil(
-            ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-    # Damping has to be between 0 and 2
-    GS_damping_00_min = 0.001
-    GS_damping_00_max = 1.999
-    N_GS_damping_00 = 50
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max,
-                          delta_GS_sweeps_00)
-    damping_00 = np.linspace(GS_damping_00_min, GS_damping_00_max,
-                             N_GS_damping_00)
-
-    N = N_GS_sweeps_00 * N_GS_damping_00
-
-    prec_params = np.zeros((N, 2))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_damping_00):
-            prec_params[i, :] = [
-                sweeps_00[i_0], damping_00[i_1]
-            ]
-            i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_4.py b/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_4.py
deleted file mode 100644
index 714a034ba706d98176b7a3cee36a0a43411ea7d2..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/fused_plate_mean_prec_GS_4.py
+++ /dev/null
@@ -1,248 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, Ngs, omegags, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pbl = m.Problem(msh, comm)
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0.,
-                1, 0., 1, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0.,
-                1, 0., 0, 0., 0, 0., ensemble_size)
-
-    f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1,
-              f, 0, zero, 0, one, ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -
-              f, 0, zero, 0, one, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-6
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 3
-    mueluParams['max levels'] = 1
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = Ngs
-    mueluParamsSub2['relaxation: damping factor'] = omegags
-
-    mueluParams['verbosity'] = "high"
-
-    mueluParams['coarse: params'] = mueluParamsSub2
-
-    solverList['convert MueLu xml file'] = True
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['gamma'] = p['gamma']
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-    solverList['Write txt files'] = p['Write txt files']
-
-    if p["Is exp"]:
-        num_random_variables = randomVariable.shape[1]
-    else:
-        num_random_variables = 0
-
-    for i in range(0, num_random_variables):
-        rand = randomVariable[:, i]
-        pbl.add(m.RandomVariable(rand))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Is exp'] = p['Is exp']
-    if p["Is exp"]:
-        randomParams['Begin X'] = 0.
-        randomParams['Begin Y'] = 0.
-        randomParams['Begin Z'] = 0.
-        randomParams['End X'] = 10.
-        randomParams['End Y'] = 10.
-        randomParams['End Z'] = 1.
-        randomParams['Number random variables'] = num_random_variables
-        randomParams['Correlation length X'] = p['Correlation length X']
-        randomParams['Correlation length Y'] = p['Correlation length Y']
-        randomParams['Correlation length Z'] = p['Correlation length Z']
-        randomParams['Number of KL Terms X'] = p['Number of KL Terms X']
-        randomParams['Number of KL Terms Y'] = p['Number of KL Terms Y']
-        randomParams['Number of KL Terms Z'] = p['Number of KL Terms Z']
-        randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-        randomParams['Bound Perturbation Size'] = 1E-10
-    else:
-        randomParams['Correlation length'] = p['Correlation length']
-        randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-        randomParams['Wavenumber discretization points'] = p['Wavenumber discretization points']
-        randomParams['Number Z of previously drawn samples'] = p['Number Z of previously drawn samples']
-        randomParams['Number Phi of previously drawn samples'] = p['Number Phi of previously drawn samples']
-
-    randomParams['Mean'] = E[0] / (2.*(1.+nu[0]))
-    randomParams['Dispersion level'] = p['Dispersion level']
-
-    solverList['randomParams'] = randomParams
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_prec(msh, comm, file_dir, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(1500, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        Ngs = int(prec_params[i, 0])
-        omegags = prec_params[i, 1]
-
-        directory = 'mean_case'
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        evaluate_prec(msh, comm, file_dir, Ngs, omegags)
-        os.chdir('..')
-
-        for ensemble_size in [8]:
-            directory = 'ensemble_reduction_' + str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_prec(msh,
-                          comm,
-                          file_dir,
-                          Ngs, omegags,
-                          ensemble_size=ensemble_size)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('plate.geo', file_dir).execute()
-
-    GS_sweeps_00_min = 1
-    GS_sweeps_00_max = 41
-    delta_GS_sweeps_00 = 1
-
-    N_GS_sweeps_00 = int(
-        np.ceil(
-            ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-    # Damping has to be between 0 and 2
-    GS_damping_00_min = 0.001
-    GS_damping_00_max = 1.999
-    N_GS_damping_00 = 50
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max,
-                          delta_GS_sweeps_00)
-    damping_00 = np.linspace(GS_damping_00_min, GS_damping_00_max,
-                             N_GS_damping_00)
-
-    N = N_GS_sweeps_00 * N_GS_damping_00
-
-    prec_params = np.zeros((N, 2))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_damping_00):
-            prec_params[i, :] = [
-                sweeps_00[i_0], damping_00[i_1]
-            ]
-            i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate.py b/katoptron/CMAME/old_tests/plate.py
deleted file mode 100644
index 01b9e96d1d7de425bf68cee0af702590b3da72c7..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def main():
-
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 1
-    num_random_variables = 20
-    #randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    #randomVariable = np.resize(randomVariable,(N,num_random_variables))
-    randomVariable = np.zeros((N, num_random_variables))
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../tests/direct_solver.xml'
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-
-    ensemble_size = 1
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_GS_all_cases.py b/katoptron/CMAME/old_tests/plate_MC_GS_all_cases.py
deleted file mode 100644
index e54831daca88d57f95f38baa39a0ea01b2a8aa83..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_GS_all_cases.py
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = model.defaut_params
-
-    if case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-
-    p['Wavenumber cutoff'] = 8.
-    p['Wavenumber discretization points'] = nuw
-    p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-    p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-
-    p['Is exp'] = False
-    return p
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = get_parameters(case_id, first_sample_id)
-
-    pm = model.plate_model(ensemble_size, np.array([0]), msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = N // ensemble_size
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                      msh, comm, file_dir)
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    N = 960
-    ensemble_sizes = [1, 8, 16, 32]
-    case_ids = [1, 2, 3, 4, 5, 6]
-
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_GS_case_1.py b/katoptron/CMAME/old_tests/plate_MC_GS_case_1.py
deleted file mode 100644
index 872bc1f46a08ca476cb27bd73d3477e29b88a0ec..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_GS_case_1.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 20
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_GS_case_2.py b/katoptron/CMAME/old_tests/plate_MC_GS_case_2.py
deleted file mode 100644
index b0ae7acfb4698a304ad80f181b481345b0ab12e9..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_GS_case_2.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Dispersion level'] = 0.3
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 20
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_GS_case_3.py b/katoptron/CMAME/old_tests/plate_MC_GS_case_3.py
deleted file mode 100644
index 5a370e812d645c16487f4dc60d5c62c1d893e836..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_GS_case_3.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Correlation length X'] = 10.
-    p['Correlation length Y'] = 10.
-    p['Number of KL Terms X'] = 15
-    p['Number of KL Terms Y'] = 15
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 70
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_GS_case_4.py b/katoptron/CMAME/old_tests/plate_MC_GS_case_4.py
deleted file mode 100644
index 9dd999aa86d728fc936e3bbe1ff974c24ec11609..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_GS_case_4.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Correlation length X'] = 10.
-    p['Correlation length Y'] = 10.
-    p['Number of KL Terms X'] = 15
-    p['Number of KL Terms Y'] = 15
-    p['Dispersion level'] = 0.3
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 70
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_GS_direct_all_cases.py b/katoptron/CMAME/old_tests/plate_MC_GS_direct_all_cases.py
deleted file mode 100644
index 7019bce94e8a132f14b98fed594605458677c0e5..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_GS_direct_all_cases.py
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = model.defaut_params
-
-    if case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-
-    p['Wavenumber cutoff'] = 8.
-    p['Wavenumber discretization points'] = nuw
-    p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-    p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-
-    p['MueLu xml file name'] = '/SIMPLE_GS_direct.xml'
-    p['MueLu xml template file name'] = '/../preconditioners/SIMPLE_gs_direct.xml.in'
-    p['MueLu xml params name'] = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                                  '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                                  '$SCHUR_omega', '$SimpleSmoother_damping']
-    p['MueLu xml params'] = [
-        '3', '3', '16', '1.8', '1', '1'
-    ]
-
-    p['Is exp'] = False
-    p['gamma'] = 0.
-    return p
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = get_parameters(case_id, first_sample_id)
-
-    pm = model.plate_model(ensemble_size, np.array([0]), msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = (N // ensemble_size)
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                      msh, comm, file_dir)
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    N = 96
-    ensemble_sizes = [1, 8, 16, 32]
-    case_ids = [1, 2, 3, 4, 5, 6]
-
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_MG_all_cases.py b/katoptron/CMAME/old_tests/plate_MC_MG_all_cases.py
deleted file mode 100644
index b31f9c5dca56f17403df33823b6a67eec7f222d6..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_MG_all_cases.py
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = model.defaut_params
-
-    if case_id == 0:
-        p['Is random'] = False
-    elif case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-
-    if p['Is random'] == True:
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-        p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-
-    p['MueLu xml file name'] = '/SIMPLE_MG.xml'
-    p['MueLu xml template file name'] = '/../preconditioners/SIMPLE_gs_direct_lvl.xml.in'
-    p['MueLu xml params name'] = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                                  '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                                  '$SCHUR_omega', '$SimpleSmoother_damping', "$N_LVLS", "$N_SIZES", "$EXPORT_DATA", "$SimpleSmoother_sweeps"]
-    p['MueLu xml params'] = [
-        '3', '3', '3', '0.8', '0.8', '1', '2', '18', "true", '1'
-    ]
-
-    p['Is exp'] = False
-    p['gamma'] = 0.
-    return p
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = get_parameters(case_id, first_sample_id)
-
-    pm = model.plate_model(ensemble_size, np.array([0]), msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = (N // ensemble_size)
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                      msh, comm, file_dir)
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    deterministic = True
-
-    if deterministic:
-        N = 1
-        ensemble_sizes = [1]
-        case_ids = [0]
-    else:
-        N = 64
-        ensemble_sizes = [1, 8, 16, 32]
-        case_ids = [1, 2, 3, 4, 5, 6]
-
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_MG_all_cases_2.py b/katoptron/CMAME/old_tests/plate_MC_MG_all_cases_2.py
deleted file mode 100644
index 7c90bac1a9d4e1c9986af47bea1a60697e9eeef4..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_MG_all_cases_2.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = model.defaut_params
-
-    if case_id == 0:
-        p['Is random'] = False
-    elif case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-
-    if p['Is random'] == True:
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-        p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-
-    p['MueLu xml file name'] = '/SIMPLE_MG.xml'
-    p['MueLu xml template file name'] = '/../../preconditioners/SIMPLE_gs_direct_lvl_MT.xml.in'
-    p['MueLu xml params name'] = [
-        '$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-        '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping', '$SCHUR_omega',
-        '$SimpleSmoother_damping', "$N_LVLS", "$N_SIZES", "$EXPORT_DATA",
-        "$SimpleSmoother_sweeps"
-    ]
-    p['MueLu xml params'] = [
-        '3', '3', '3', '0.8', '0.8', '1', '2', '18', "true", '1'
-    ]
-
-    p['Is exp'] = False
-    #p['gamma'] = 0.
-    return p
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = get_parameters(case_id, first_sample_id)
-
-    pm = model.plate_model(ensemble_size, np.array([0]), msh, comm, file_dir,
-                           work_dir, p)
-    pm.run()
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = (N // ensemble_size)
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                      msh, comm, file_dir)
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir + '/../mesh',
-                        work_dir, comm, rank, size)
-
-    deterministic = False
-
-    if deterministic:
-        N = 1
-        ensemble_sizes = [1]
-        case_ids = [0]
-    else:
-        N = 64
-        ensemble_sizes = [1, 8, 16, 32]
-        case_ids = [1, 2, 3, 4, 5, 6]
-
-    nThreads = u.Initialize_Kokkos()
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_1.py b/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_1.py
deleted file mode 100644
index b6cbaf524a89270bc961791b974a5dcc4cfaf544..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_1.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = (N // ensemble_size)
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 32
-    num_random_variables = 20
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_1_sp.py b/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_1_sp.py
deleted file mode 100644
index 17fbd571975da088033fa4c70ed1e613694bb810..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_1_sp.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, index, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    nuw = 128
-
-    p = model.defaut_params
-    p["Correlation length"] = 5.
-    p["Wavenumber cutoff"] = 8.
-    p["Wavenumber discretization points"] = nuw
-
-    p["Number Z of previously drawn samples"] = index*nuw**2
-    p["Number Phi of previously drawn samples"] = index*nuw**2
-
-    p["Is exp"] = False
-
-    pm = model.plate_model(
-        ensemble_size, [0.], msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, N, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N_ensemble = (N // ensemble_size)
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(
-            ensemble_size, ensemble_index, msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    N = 2
-
-    evaluate_all_ensembles(1, N, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_2.py b/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_2.py
deleted file mode 100644
index d1b1b4a2141b4b2378fd7a6ef588a297e19fe23e..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_2.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Dispersion level'] = 0.3
-
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = (N // ensemble_size)
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 32
-    num_random_variables = 20
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_3.py b/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_3.py
deleted file mode 100644
index 901fc84f1649892c674b8c6f599fc3f3e73cd7fe..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_3.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Correlation length X'] = 5.
-    p['Correlation length Y'] = 5.
-    p['Number of KL Terms X'] = 15
-    p['Number of KL Terms Y'] = 15
-
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = (N // ensemble_size)
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 32
-    num_random_variables = 105
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_4.py b/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_4.py
deleted file mode 100644
index e35f3a2ab75e7ffd99781d2fcc2e649c45ccc7d0..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_NO_EP_case_4.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Correlation length X'] = 5.
-    p['Correlation length Y'] = 5.
-    p['Number of KL Terms X'] = 15
-    p['Number of KL Terms Y'] = 15
-    p['Dispersion level'] = 0.3
-
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = (N // ensemble_size)
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 32
-    num_random_variables = 105
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_direct_case_1.py b/katoptron/CMAME/old_tests/plate_MC_direct_case_1.py
deleted file mode 100644
index dc5cebe5267b6b5b8ffc35c510c3cb3611dfb734..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_direct_case_1.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 20
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_direct_case_2.py b/katoptron/CMAME/old_tests/plate_MC_direct_case_2.py
deleted file mode 100644
index e8f8366c416d86496694231a2d746a9d3488815d..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_direct_case_2.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Dispersion level'] = 0.3
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 20
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_direct_case_3.py b/katoptron/CMAME/old_tests/plate_MC_direct_case_3.py
deleted file mode 100644
index 72d3dfd3095ae156baaf7e0e22e7d03b35709332..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_direct_case_3.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Correlation length X'] = 10.
-    p['Correlation length Y'] = 10.
-    p['Number of KL Terms X'] = 15
-    p['Number of KL Terms Y'] = 15
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 70
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_MC_direct_case_4.py b/katoptron/CMAME/old_tests/plate_MC_direct_case_4.py
deleted file mode 100644
index b3c8cb6ca1b424d82a53c16c64dc810931ddccf0..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_MC_direct_case_4.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    p['Correlation length X'] = 10.
-    p['Correlation length Y'] = 10.
-    p['Number of KL Terms X'] = 15
-    p['Number of KL Terms Y'] = 15
-    p['Dispersion level'] = 0.3
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 96
-    num_random_variables = 70
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(16, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(32, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_convergence_direct.py b/katoptron/CMAME/old_tests/plate_convergence_direct.py
deleted file mode 100644
index e133243e9c203d0a399c723cef617fb1aef144fa..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_convergence_direct.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.eigenvalues import *
-from katoptron.convergence import *
-import os
-import fwk
-
-
-def main():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    N = 32
-
-    k_max = 20
-
-    matrix_input_file_dir = file_dir + \
-        '/../../workspace/katoptron_CMAME_tests_plate_MC_NO_EP/1/'
-    deltas_input_file_dir = file_dir + \
-        '/../../workspace/katoptron_CMAME_tests_plate_deltas_omegas_direct/'
-
-    for i in range(0, N):
-        timers = fwk.Timers()
-
-        filename_Q = matrix_input_file_dir + str(i) + '/ApCTC_mm.txt'
-        filename_GT = matrix_input_file_dir + str(i) + '/B_mm.txt'
-        filename_f = matrix_input_file_dir + str(i) + '/b_mm_after_bc.txt'
-
-        timers['Read files'].start()
-        Q = read_mm(filename_Q)
-        Q = get_symmetrical_part(Q)
-        GT = read_mm(filename_GT)
-        G = GT.transpose()
-        f = read_mm(filename_f, is_sparse=False)
-        A = create_block(Q, G, GT, None)
-        n = A.shape[0]
-        x0 = np.zeros((n,))
-        b = np.zeros((n,))
-        b[0:len(f)] = f
-        omegas = np.loadtxt(deltas_input_file_dir +
-                            '/omegas_direct_direct_' + str(i) + '.txt')
-        n_omegas = len(omegas)
-
-        tmp = np.loadtxt(deltas_input_file_dir +
-                         '/deltas_direct_direct_' + str(i) + '.txt')
-
-        deltas = np.zeros((n_omegas,), dtype=np.complex128)
-        deltas.real = tmp[:, 0]
-        deltas.imag = tmp[:, 1]
-
-        timers['Read files'].stop()
-        print(timers)
-
-        timers['Compute the convergence'].start()
-        convergence = compute_convergence(
-            k_max, n_omegas, omegas, deltas, A, b, x0, verbose=True)
-        timers['Compute the basconvergenceis'].stop()
-        print(timers)
-
-        np.savetxt(work_dir+'/convergence_' + str(i) + '.txt', convergence)
-
-        f = open('timers_' + str(i) + '.txt', 'w')
-        print(timers, file=f)
-        f.closed
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_correlation.py b/katoptron/CMAME/old_tests/plate_correlation.py
deleted file mode 100644
index 8ddb22f99a7cbd6342509ae99a77043ab3c7bc56..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_correlation.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_correlation(correlation, msh, comm, file_dir, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-
-    nuw = 128
-    p['Correlation length'] = correlation
-    p['Dispersion level'] = 0.1
-
-    p['Wavenumber cutoff'] = 8.
-    p['Wavenumber discretization points'] = nuw
-    p['Number Z of previously drawn samples'] = 0
-    p['Number Phi of previously drawn samples'] = 0
-    p['Is exp'] = False
-
-    pm = model.plate_model(ensemble_size, randomVariable, msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_correlation(correlations, msh, comm, file_dir):
-
-    N = correlations.shape[0]
-    for i in range(0, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        for ensemble_size in [1, 8]:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_correlation(
-                correlations[i], msh, comm, file_dir, ensemble_size)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    N = 200
-    correlation_min_exp = -1
-    correlation_max_exp = np.log10(2)
-
-    correlations = np.logspace(
-        correlation_min_exp, correlation_max_exp, N, endpoint=True)
-
-    np.savetxt('correlations.txt', correlations)
-
-    evaluate_all_correlation(correlations, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_deltas_omegas_GS.py b/katoptron/CMAME/old_tests/plate_deltas_omegas_GS.py
deleted file mode 100644
index 8ac06ecd6245230d32f0db90ae89faafa7141ffe..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_deltas_omegas_GS.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def main():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    n_sweeps_Q = 10
-    damp_Q = 1.6
-
-    n_sweeps_R = 10
-    damp_R = 1.6
-
-    omega = 0.5
-
-    N = 32
-
-    input_file_dir = file_dir + '/../../workspace/katoptron_CMAME_tests_plate_MC_NO_EP/1/'
-
-    sample_per_rank = np.ceil((N / siz))
-    i_min = rank*sample_per_rank
-    i_max = i_min+sample_per_rank
-
-    if i_min > N:
-        i_min = N
-    if i_max > N:
-        i_max = N
-
-    i_min = int(i_min)
-    i_max = int(i_max)
-
-    print('Rank ' + str(rank) + ' from sample ' + str(i_min) + ':' + str(i_max))
-
-    for i in range(i_min, i_max):
-        timers = fwk.Timers()
-
-        filename_Q = input_file_dir + str(i) + '/ApCTC_mm.txt'
-        filename_GT = input_file_dir + str(i) + '/B_mm.txt'
-        filename_f = input_file_dir + str(i) + '/b_mm_after_bc.txt'
-
-        timers['Read files'].start()
-        Q = read_mm(filename_Q)
-        Q = get_symmetrical_part(Q)
-        GT = read_mm(filename_GT)
-        G = GT.transpose()
-        f = read_mm(filename_f, is_sparse=False)
-        timers['Read files'].stop()
-
-        timers['Compute R'].start()
-        R = approx_Schur_complement(Q, G, GT)
-        timers['Compute R'].stop()
-
-        timers['Compute invR'].start()
-        invR = Gauss_Seidel(R, n=n_sweeps_R, damping=damp_R)
-        timers['Compute invR'].stop()
-
-        print(timers)
-
-        timers['Compute the inverse of Q'].start()
-        invQ = Gauss_Seidel(Q, n=n_sweeps_Q, damping=damp_Q)
-        timers['Compute the inverse of Q'].stop()
-
-        print(timers)
-
-        timers['Compute the preconditioned matrix'].start()
-        AinvP = SIMPLE_preconditioned_matrix(
-            Q, invQ, G, GT, R, invR, omega=omega)
-        timers['Compute the preconditioned matrix'].stop()
-
-        print(timers)
-
-        timers['Compute the basis'].start()
-
-        n = Q.shape[0]+R.shape[0]
-        b = np.zeros((n,))
-        b[0:len(f)] = f
-
-        N = 2
-        m_max = 6000
-        V, W = compute_VW(AinvP, b, m=m_max, N=N)
-        timers['Compute the basis'].stop()
-
-        print(timers)
-
-        timers['Compute the eigenvalues'].start()
-        deltas, omegas = compute_deltas_omegas(V, W, b)
-        timers['Compute the eigenvalues'].stop()
-
-        print(timers)
-
-        timers['Write the eigenvalues'].start()
-        write_eigenvalues(deltas, work_dir+'/deltas_GS_GS_' + str(i) + '.txt')
-        np.savetxt(work_dir+'/omegas_GS_GS_' + str(i) + '.txt', omegas)
-        timers['Write the eigenvalues'].stop()
-
-        f = open('timers_' + str(i) + '.txt', 'w')
-        print(timers, file=f)
-        f.closed
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_deltas_omegas_direct.py b/katoptron/CMAME/old_tests/plate_deltas_omegas_direct.py
deleted file mode 100644
index 1172faeeebefa0511fbb20357e3100cb69216a96..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_deltas_omegas_direct.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def main():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    N = 32
-
-    input_file_dir = file_dir + '/../../workspace/katoptron_CMAME_tests_plate_MC_NO_EP/1/'
-
-    sample_per_rank = np.ceil((N / siz))
-    i_min = rank*sample_per_rank
-    i_max = (rank+1)*sample_per_rank
-
-    if i_min > N:
-        i_min = N
-    if i_max > N:
-        i_max = N
-
-    i_min = int(i_min)
-    i_max = int(i_max)
-
-    for i in range(i_min, i_max):
-        timers = fwk.Timers()
-
-        filename_Q = input_file_dir + str(i) + '/ApCTC_mm.txt'
-        filename_GT = input_file_dir + str(i) + '/B_mm.txt'
-        filename_f = input_file_dir + str(i) + '/b_mm_after_bc.txt'
-
-        timers['Read files'].start()
-        Q = read_mm(filename_Q)
-        Q = get_symmetrical_part(Q)
-        GT = read_mm(filename_GT)
-        G = GT.transpose()
-        f = read_mm(filename_f, is_sparse=False)
-        timers['Read files'].stop()
-
-        timers['Compute R'].start()
-        R = approx_Schur_complement(Q, G, GT)
-        timers['Compute R'].stop()
-
-        timers['Compute invR'].start()
-        invR = compute_inv(R)
-        timers['Compute invR'].stop()
-
-        print(timers)
-
-        timers['Compute the inverse of Q'].start()
-        invQG = compute_inv_on_image(Q, G)
-        timers['Compute the inverse of Q'].stop()
-
-        print(timers)
-
-        timers['Compute the preconditioned matrix'].start()
-        AinvP = SIMPLE_prec(Q, invQG, G, GT, R, invR, True)
-        timers['Compute the preconditioned matrix'].stop()
-
-        print(timers)
-
-        timers['Compute the basis'].start()
-
-        n = Q.shape[0]+R.shape[0]
-        b = np.zeros((n,))
-        b[0:len(f)] = f
-
-        N = 1
-        V = compute_V(AinvP, b, m=0, N=N)
-        W = compute_W(AinvP, b, V, N=N)
-
-        timers['Compute the basis'].stop()
-
-        print(timers)
-
-        timers['Compute the eigenvalues'].start()
-        deltas, omegas = compute_deltas_omegas(V, W, b)
-        timers['Compute the eigenvalues'].stop()
-
-        print(timers)
-
-        timers['Write the eigenvalues'].start()
-        write_eigenvalues(deltas, work_dir +
-                          '/deltas_direct_direct_' + str(i) + '.txt')
-        np.savetxt(work_dir+'/omegas_direct_direct_' + str(i) + '.txt', omegas)
-        timers['Write the eigenvalues'].stop()
-
-        f = open('timers_' + str(i) + '.txt', 'w')
-        print(timers, file=f)
-        f.closed
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_eigenvalues.py b/katoptron/CMAME/old_tests/plate_eigenvalues.py
deleted file mode 100644
index 7a05cca60a0b7eaf9998c8b242b92135b21c5831..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_eigenvalues.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    N = 32
-
-    input_file_dir = file_dir + '/../../workspace/katoptron_CMAME_tests_plate_MC_NO_EP/1/'
-
-    i_min = 0
-    i_max = N
-
-    for i in range(i_min, i_max):
-        timers = fwk.Timers()
-
-        filename_Q = input_file_dir + str(i) + '/ApCTC_mm.txt'
-        filename_GT = input_file_dir + str(i) + '/B_mm.txt'
-
-        timers['Read files'].start()
-        Q = read_mm(filename_Q)
-        GT = read_mm(filename_GT)
-        G = GT.transpose()
-        timers['Read files'].stop()
-
-        timers['Compute R'].start()
-        R = approx_Schur_complement(Q, G, GT)
-        timers['Compute R'].stop()
-
-        print(timers)
-
-        timers['Compute the inverse of Q'].start()
-        invQG = compute_inv_on_image(Q, G)
-        timers['Compute the inverse of Q'].stop()
-
-        print(timers)
-
-        timers['Compute the eigenvalues'].start()
-        v = eigenvalues_SR(invQG, G, GT, R, True)
-        timers['Compute the eigenvalues'].stop()
-
-        print(timers)
-
-        timers['Write the eigenvalues'].start()
-        write_eigenvalues(
-            v, work_dir+'/eigenvalues_direct_direct_' + str(i) + '.txt')
-        timers['Write the eigenvalues'].stop()
-
-        f = open('timers_' + str(i) + '.txt', 'w')
-        print(timers, file=f)
-        f.closed
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_eigenvalues_gamma.py b/katoptron/CMAME/old_tests/plate_eigenvalues_gamma.py
deleted file mode 100644
index ff8a16ee70b62bb3f79a967709561ee03db6cc9d..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_eigenvalues_gamma.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-from scipy.sparse import eye
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    N = 200
-    gamma_min_exp = -2
-    gamma_max_exp = 10
-
-    gammas = np.logspace(gamma_min_exp, gamma_max_exp, N, endpoint=True)
-
-    input_file_dir = file_dir + '/../../workspace/katoptron_CMAME_tests_plate_MC_NO_EP/1/'
-
-    filename_K = input_file_dir + '0/A_mm_after_bc.txt'
-    filename_GT = input_file_dir + '0/B_mm.txt'
-
-    K = read_mm(filename_K)
-    GT = read_mm(filename_GT)
-    G = GT.transpose()
-
-    for i in range(0, N):
-        timers = fwk.Timers()
-
-        Q = K + gammas[i] * G * GT
-
-        timers['Compute R'].start()
-        R = approx_Schur_complement(Q, G, GT)
-        timers['Compute R'].stop()
-
-        print(timers)
-
-        timers['Compute the inverse of Q'].start()
-        invQG = compute_inv_on_image(Q, G)
-        timers['Compute the inverse of Q'].stop()
-
-        print(timers)
-
-        timers['Compute the eigenvalues'].start()
-        v = eigenvalues_SR(invQG, G, GT, R, True)
-        timers['Compute the eigenvalues'].stop()
-
-        print(timers)
-
-        timers['Write the eigenvalues'].start()
-        write_eigenvalues(
-            v, work_dir+'/eigenvalues_direct_direct_' + str(i) + '.txt')
-        timers['Write the eigenvalues'].stop()
-
-        f = open('timers_' + str(i) + '.txt', 'w')
-        print(timers, file=f)
-        f.closed
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_extended.py b/katoptron/CMAME/old_tests/plate_extended.py
deleted file mode 100644
index 1330383146f5d00d3a89862c52727feed2e4163c..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_extended.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def main():
-
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2_extended.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 1
-    num_random_variables = 20
-    #randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    #randomVariable = np.resize(randomVariable,(N,num_random_variables))
-    randomVariable = np.zeros((N, num_random_variables))
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-
-    ensemble_size = 1
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_mean_gamma.py b/katoptron/CMAME/old_tests/plate_mean_gamma.py
deleted file mode 100644
index 5b4324bcbbb04f74325b954ffef137f121f6bccc..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_mean_gamma.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_gamma(gamma, msh, comm, file_dir, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['gamma'] = gamma
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pm = model.plate_model(ensemble_size, randomVariable, msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_gamma(gammas, msh, comm, file_dir):
-
-    N = gammas.shape[0]
-    for i in range(0, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        for ensemble_size in [1, 8]:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_gamma(gammas[i], msh, comm, file_dir, ensemble_size)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    N = 200
-    gamma_min_exp = -2
-    gamma_max_exp = 10
-
-    gammas = np.logspace(gamma_min_exp, gamma_max_exp, N, endpoint=True)
-
-    np.savetxt('gammas.txt', gammas)
-
-    evaluate_all_gamma(gammas, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_mean_prec.py b/katoptron/CMAME/old_tests/plate_mean_prec.py
deleted file mode 100644
index 69e0663ecdda95b050249c4b1a9d76974fffceaa..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_mean_prec.py
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, muelu_xml):
-
-    work_dir = os.getcwd()
-
-    p = model.defaut_params
-    p['MueLu xml use template'] = False
-
-    N = 1
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_prec(msh, comm, file_dir, muelu_xml_in, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(0, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                       '$BLOCK_00_GS_sweeps', '$BLOCK_11_GS_sweeps',
-                       '$BLOCK_00_GS_damping', '$BLOCK_11_GS_damping',
-                       '$SCHUR_omega', '$SimpleSmoother_damping']
-        new_strings = ['3', '3', str(int(prec_params[i, 0])), str(int(prec_params[i, 1])), str(
-            prec_params[i, 2]), str(prec_params[i, 3]), str(prec_params[i, 4]), str(prec_params[i, 5])]
-
-        u.replace_strings(muelu_xml_in, current_dir +
-                          '/SIMPLE_gs.xml', old_strings, new_strings)
-
-        evaluate_prec(msh, comm, file_dir, current_dir+'/SIMPLE_gs.xml')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    muelu_xml_in = file_dir + '/../preconditioners/SIMPLE_gs.xml.in'
-
-    N_GS_sweeps_00 = 1
-    N_GS_sweeps_11 = 1
-    N_GS_damping_00 = 6
-    N_GS_damping_11 = 6
-    N_SS_omega = 6
-    N_SS_damping = 6
-
-    GS_sweeps_00_min = 10
-    GS_sweeps_00_max = 11
-
-    GS_sweeps_11_min = 10
-    GS_sweeps_11_max = 11
-
-    GS_damping_00_min = 0.9
-    GS_damping_00_max = 1.5
-
-    GS_damping_11_min = 0.9
-    GS_damping_11_max = 1.5
-
-    SS_omega_min = 0.7
-    SS_omega_max = 1.1
-
-    SS_damping_min = 0.8
-    SS_damping_max = 1.2
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max, N_GS_sweeps_00)
-    sweeps_11 = np.arange(GS_sweeps_11_min, GS_sweeps_11_max, N_GS_sweeps_11)
-    damping_00_min = np.linspace(
-        GS_damping_00_min, GS_damping_00_max, N_GS_damping_00)
-    damping_11_min = np.linspace(
-        GS_damping_11_min, GS_damping_11_max, N_GS_damping_11)
-    SS_omega = np.linspace(SS_omega_min, SS_omega_max, N_SS_omega)
-    SS_damping = np.linspace(SS_damping_min, SS_damping_max, N_SS_damping)
-
-    N = N_GS_sweeps_00 * N_GS_sweeps_11 * N_GS_damping_00 * \
-        N_GS_damping_11 * N_SS_omega * N_SS_damping
-
-    prec_params = np.zeros((N, 6))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_sweeps_11):
-            for i_2 in range(0, N_GS_damping_00):
-                for i_3 in range(0, N_GS_damping_11):
-                    for i_4 in range(0, N_SS_omega):
-                        for i_5 in range(0, N_SS_damping):
-                            prec_params[i, :] = [sweeps_00[i_0], sweeps_11[i_1], damping_00_min[i_2],
-                                                 damping_11_min[i_3], SS_omega[i_4], SS_damping[i_5]]
-                            i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, muelu_xml_in, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct.py b/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct.py
deleted file mode 100644
index 0e35fc87bae80870d35ef46dacc225d16ad3f182..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, muelu_xml, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml use template'] = False
-    p['MueLu xml from current_dir'] = True
-    p['MueLu xml file name'] = '/../SIMPLE_gs_direct.xml'
-    p['gamma'] = 0.
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pm = model.plate_model(ensemble_size, randomVariable, msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_prec(msh, comm, file_dir, muelu_xml_in, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(0, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                       '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                       '$SCHUR_omega', '$SimpleSmoother_damping']
-        new_strings = [
-            '3', '3',
-            str(int(prec_params[i, 0])),
-            str(prec_params[i, 1]),
-            str(prec_params[i, 2]),
-            str(prec_params[i, 3])
-        ]
-
-        print(muelu_xml_in)
-        u.replace_strings(muelu_xml_in, current_dir + '/SIMPLE_gs_direct.xml',
-                          old_strings, new_strings)
-        print(current_dir + '/SIMPLE_gs_direct.xml')
-
-        directory = 'mean_case'
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        evaluate_prec(msh, comm, file_dir,
-                      current_dir + '/SIMPLE_gs_direct.xml')
-        os.chdir('..')
-
-        for ensemble_size in [8]:
-            directory = 'ensemble_reduction_' + str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_prec(msh,
-                          comm,
-                          file_dir,
-                          current_dir + '/SIMPLE_gs_direct.xml',
-                          ensemble_size=ensemble_size)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    muelu_xml_in = file_dir + '/../preconditioners/SIMPLE_gs_direct.xml.in'
-
-    GS_sweeps_00_min = 16
-    GS_sweeps_00_max = 41
-    delta_GS_sweeps_00 = 2
-
-    N_GS_sweeps_00 = int(
-        np.ceil(
-            ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-    # Damping has to be between 0 and 2
-    GS_damping_00_min = 0.001
-    GS_damping_00_max = 1.999
-    N_GS_damping_00 = 20
-
-    # Omega has to be between 0 and 1
-    SS_omega_min = 1.
-    SS_omega_max = 1.2
-    N_SS_omega = 1
-
-    SS_damping_min = 1.
-    SS_damping_max = 1.2
-    N_SS_damping = 1
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max,
-                          delta_GS_sweeps_00)
-    damping_00 = np.linspace(GS_damping_00_min, GS_damping_00_max,
-                             N_GS_damping_00)
-    SS_omega = np.linspace(SS_omega_min, SS_omega_max, N_SS_omega)
-    SS_damping = np.linspace(SS_damping_min, SS_damping_max, N_SS_damping)
-
-    N = N_GS_sweeps_00 * N_GS_damping_00 * N_SS_omega * N_SS_damping
-    '''
-    N = 12
-    
-    prec_params = np.array([[8, 1.75, 0.46363636363636374, 1.],
-                   [10, 1.75, 0.3545454545454546, 1.],
-                   [12, 1.75, 0.390909090909091, 1.],
-                   [14, 1.8045454545454545, 0.42727272727272736, 1.],
-                   [16, 1.8227272727272728, 0.42727272727272736, 1.],
-                   [18, 1.8045454545454545, 0.3545454545454546, 1.],
-                   [20, 1.8227272727272728, 0.390909090909091, 1.],
-                   [22, 1.8227272727272728, 0.390909090909091, 1.],
-                   [24, 1.8590909090909091, 0.390909090909091, 1.],
-                   [26, 1.8590909090909091, 0.3545454545454546, 1.],
-                   [28, 1.8590909090909091, 0.3545454545454546, 1.],
-                   [30, 1.8772727272727272, 0.390909090909091, 1.]])
-
-    '''
-    prec_params = np.zeros((N, 4))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_damping_00):
-            for i_2 in range(0, N_SS_omega):
-                for i_3 in range(0, N_SS_damping):
-                    prec_params[i, :] = [
-                        sweeps_00[i_0], damping_00[i_1], SS_omega[i_2],
-                        SS_damping[i_3]
-                    ]
-                    i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, muelu_xml_in, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct_lvl.py b/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct_lvl.py
deleted file mode 100644
index 4b4b46e3653857f8a376983c7fd2328c72525e26..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct_lvl.py
+++ /dev/null
@@ -1,197 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_prec(msh, comm, file_dir, muelu_xml, ensemble_size=1):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml use template'] = False
-    p['MueLu xml from current_dir'] = True
-    p['MueLu xml file name'] = '/../SIMPLE_gs_direct.xml'
-    #p['gamma'] = 0.
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pm = model.plate_model(ensemble_size, randomVariable, msh, comm, file_dir,
-                           work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_prec(msh, comm, file_dir, muelu_xml_in, prec_params):
-
-    N = prec_params.shape[0]
-
-    for i in range(0, N):
-        directory = str(i)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        current_dir = os.getcwd()
-
-        old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                       '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                       '$SCHUR_omega', '$SimpleSmoother_damping', "$N_LVLS"]
-        new_strings = [
-            '3', '3',
-            str(int(prec_params[i, 0])),
-            str(prec_params[i, 1]),
-            str(prec_params[i, 2]),
-            str(prec_params[i, 3]),
-            '2'
-        ]
-
-        print(muelu_xml_in)
-        u.replace_strings(muelu_xml_in, current_dir + '/SIMPLE_gs_direct.xml',
-                          old_strings, new_strings)
-        print(current_dir + '/SIMPLE_gs_direct.xml')
-
-        directory = 'mean_case'
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        evaluate_prec(msh, comm, file_dir,
-                      current_dir + '/SIMPLE_gs_direct.xml')
-        os.chdir('..')
-
-        for ensemble_size in [8]:
-            directory = 'ensemble_reduction_' + str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-            evaluate_prec(msh,
-                          comm,
-                          file_dir,
-                          current_dir + '/SIMPLE_gs_direct.xml',
-                          ensemble_size=ensemble_size)
-            os.chdir('..')
-
-        os.chdir('..')
-
-
-def main():
-    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")
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    muelu_xml_in = file_dir + '/../preconditioners/SIMPLE_gs_direct_lvl.xml.in'
-
-    GS_sweeps_00_min = 6
-    GS_sweeps_00_max = 7
-    delta_GS_sweeps_00 = 1
-
-    N_GS_sweeps_00 = int(
-        np.ceil(
-            ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-    # Damping has to be between 0 and 2
-    GS_damping_00_min = 0.01
-    GS_damping_00_max = 1.99
-    N_GS_damping_00 = 8
-
-    # Omega has to be between 0 and 1
-    SS_omega_min = 0.5
-    SS_omega_max = 1.
-    N_SS_omega = 8
-
-    SS_damping_min = 1.
-    SS_damping_max = 1.
-    N_SS_damping = 1
-
-    sweeps_00 = np.arange(GS_sweeps_00_min, GS_sweeps_00_max,
-                          delta_GS_sweeps_00)
-    damping_00 = np.linspace(GS_damping_00_min, GS_damping_00_max,
-                             N_GS_damping_00)
-    SS_omega = np.linspace(SS_omega_min, SS_omega_max, N_SS_omega)
-    SS_damping = np.linspace(SS_damping_min, SS_damping_max, N_SS_damping)
-
-    N = N_GS_sweeps_00 * N_GS_damping_00 * N_SS_omega * N_SS_damping
-    '''
-    N = 12
-    
-    prec_params = np.array([[8, 1.75, 0.46363636363636374, 1.],
-                   [10, 1.75, 0.3545454545454546, 1.],
-                   [12, 1.75, 0.390909090909091, 1.],
-                   [14, 1.8045454545454545, 0.42727272727272736, 1.],
-                   [16, 1.8227272727272728, 0.42727272727272736, 1.],
-                   [18, 1.8045454545454545, 0.3545454545454546, 1.],
-                   [20, 1.8227272727272728, 0.390909090909091, 1.],
-                   [22, 1.8227272727272728, 0.390909090909091, 1.],
-                   [24, 1.8590909090909091, 0.390909090909091, 1.],
-                   [26, 1.8590909090909091, 0.3545454545454546, 1.],
-                   [28, 1.8590909090909091, 0.3545454545454546, 1.],
-                   [30, 1.8772727272727272, 0.390909090909091, 1.]])
-
-    '''
-    prec_params = np.zeros((N, 4))
-
-    i = 0
-
-    for i_0 in range(0, N_GS_sweeps_00):
-        for i_1 in range(0, N_GS_damping_00):
-            for i_2 in range(0, N_SS_omega):
-                for i_3 in range(0, N_SS_damping):
-                    prec_params[i, :] = [
-                        sweeps_00[i_0], damping_00[i_1], SS_omega[i_2],
-                        SS_damping[i_3]
-                    ]
-                    i = i + 1
-
-    np.savetxt('prec_params.txt', prec_params)
-
-    evaluate_all_prec(msh, comm, file_dir, muelu_xml_in, prec_params)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct_opti.py b/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct_opti.py
deleted file mode 100644
index b48d802ef3254ace083d5c21ef7526c7f9e96661..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_mean_prec_GS_direct_opti.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-from katoptron.readers import *
-
-
-def f(x):
-    import sys
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        siz = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-    except:
-        comm = None
-        rank = 0
-        siz = 1
-        name = "noname"
-    orig_stdout = sys.stdout
-    sys.stdout = open('file', 'w')
-    file_dir = os.path.dirname(__file__)
-    muelu_xml_in = file_dir + '/../preconditioners/SIMPLE_gs_direct.xml.in'
-
-    directory = 'tmp'
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-    N = 8
-
-    current_dir = os.getcwd()
-
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, current_dir)
-
-    old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                   '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                   '$SCHUR_omega', '$SimpleSmoother_damping']
-    new_strings = ['3', '3', str(N), str(x[0]), str(x[1]), '0']
-
-    u.replace_strings(muelu_xml_in, current_dir +
-                      '/SIMPLE_gs_direct.xml', old_strings, new_strings)
-
-    evaluate_prec(msh, comm, file_dir, current_dir+'/SIMPLE_gs_direct.xml')
-
-    iter_indices, residuals = read_Belos(current_dir+'/belos_out.txt', 1)
-    os.chdir('..')
-    sys.stdout.close()
-    sys.stdout = orig_stdout
-    return iter_indices[-1]
-
-
-def fp(x):
-    epsi = 1e-5
-    jaco = np.zeros((2, 1))
-    jaco[0] = ((f(x+epsi*np.array([1, 0])) -
-                       f(x-epsi*np.array([1, 0]))) / (2*epsi))
-    jaco[1] = ((f(x+epsi*np.array([0, 1])) -
-                       f(x-epsi*np.array([0, 1]))) / (2*epsi))
-    return jaco
-
-
-def evaluate_prec(msh, comm, file_dir, muelu_xml, ensemble_size=1):
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/SIMPLE_gs_direct.xml'
-
-    N = ensemble_size
-    num_random_variables = 20
-    randomVariable = np.zeros((N, num_random_variables))
-    if ensemble_size is not 1:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-
-        p['Wavenumber cutoff'] = 8.
-        p['Wavenumber discretization points'] = nuw
-        p['Number Z of previously drawn samples'] = 0
-        p['Number Phi of previously drawn samples'] = 0
-        p['Is exp'] = False
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def main():
-    from scipy import optimize
-    import numpy as np
-
-    x0 = np.array([1.7, 0.5])
-    bnds = ((1., 2.), (0., 1.))
-    xopt = optimize.minimize(f, x0, jac=fp, bounds=bnds, options={
-                             'maxiter': 200, 'disp': 1})
-
-    print(xopt)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_Direct_200.py b/katoptron/CMAME/old_tests/plate_vd_Direct_200.py
deleted file mode 100644
index 5af82db3eddf093fa8e6c90de1c182bd4247817d..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_Direct_200.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-    p['Dispersion level'] = 0.1
-    p['gamma'] = 0.
-    p['inner clamped'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 8
-    num_random_variables = 200
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_Direct_3.py b/katoptron/CMAME/old_tests/plate_vd_Direct_3.py
deleted file mode 100644
index 27ca8e1e8307ea136bad616bdcdec5af02bcf59b..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_Direct_3.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-    p['Dispersion level'] = 0.1
-    p['gamma'] = 0.
-    p['inner clamped'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 8
-    num_random_variables = 3
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_GS_200.py b/katoptron/CMAME/old_tests/plate_vd_GS_200.py
deleted file mode 100644
index eee345c867c99ade9aac6def6e64bbd8c3d2ac41..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_GS_200.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Dispersion level'] = 0.1
-    p['gamma'] = 0.
-    p['inner clamped'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 8
-    num_random_variables = 200
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    pert = 1e-2
-    randomVariable = np.zeros((N, num_random_variables))
-    randomVariable[0, :] = np.random.normal(0, 1, num_random_variables)
-    for i in range(1, N):
-        randomVariable[i, :] = randomVariable[0, :] + pert * \
-            np.random.uniform(-1, 1, num_random_variables)
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_GS_200_with_gamma.py b/katoptron/CMAME/old_tests/plate_vd_GS_200_with_gamma.py
deleted file mode 100644
index d38b5905ac24b656f1ff58d4b50b9082e9be382d..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_GS_200_with_gamma.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Dispersion level'] = 0.1
-    p['inner clamped'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 8
-    num_random_variables = 200
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    pert = 1e-2
-    randomVariable = np.zeros((N, num_random_variables))
-    randomVariable[0, :] = np.random.normal(0, 1, num_random_variables)
-    for i in range(1, N):
-        randomVariable[i, :] = randomVariable[0, :] + pert * \
-            np.random.uniform(-1, 1, num_random_variables)
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_GS_3.py b/katoptron/CMAME/old_tests/plate_vd_GS_3.py
deleted file mode 100644
index a52659a9f4bf5845666566d0d49d643386faa4ba..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_GS_3.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Dispersion level'] = 0.1
-    #p['gamma'] = '{4663653.515942637,5000307.969231523,5125491.581727843,4650754.5340228975,4802461.555172057,4330669.2615991,4289095.323914186,4521634.142120181}'
-    p['MueLu xml template file name'] = '/../preconditioners/SIMPLE_gs_direct.xml.in'
-    p['MueLu xml params name'] = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                                  '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                                  '$SCHUR_omega', '$SimpleSmoother_damping']
-    p['MueLu xml params'] = ['3', '3', '100', '1.75', '0.05', '1.']
-
-    #p['inner clamped'] = True
-
-    #p['Write txt files'] = True
-    #p['Write matrix and vectors'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 8
-    num_random_variables = 3
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_GS_3_with_gamma.py b/katoptron/CMAME/old_tests/plate_vd_GS_3_with_gamma.py
deleted file mode 100644
index ed1538f676c24c7b5a3c454aae99324275e718b6..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_GS_3_with_gamma.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.defaut_params
-    p['Dispersion level'] = 0.1
-    p['inner clamped'] = True
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-
-def evaluate_all_ensembles(ensemble_size, randomVariable, msh, comm, file_dir):
-
-    directory = str(ensemble_size)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = randomVariable.shape[0]
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        directory = str(ensemble_index)
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-
-        evaluate_one_ensemble(ensemble_size, randomVariable[ensemble_index:(
-            ensemble_index+ensemble_size), :], msh, comm, file_dir)
-
-        os.chdir('..')
-
-    os.chdir('..')
-
-
-def main():
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    np.random.seed(42)
-    N = 8
-    num_random_variables = 3
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    randomVariable = np.resize(randomVariable, (N, num_random_variables))
-
-    np.savetxt('randomVariable.txt', randomVariable)
-
-    evaluate_all_ensembles(1, randomVariable, msh, comm, file_dir)
-    evaluate_all_ensembles(8, randomVariable, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/old_tests/plate_vd_conf.py b/katoptron/CMAME/old_tests/plate_vd_conf.py
deleted file mode 100644
index 90d65d7a12e87375f2e4d0e4436bb3d6bfc36e76..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/old_tests/plate_vd_conf.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def main():
-
-    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")
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.msh', 'plate_1_tmp', 'plate_2.msh',
-                        'plate_2_tmp', 'plate_fused', file_dir, work_dir)
-
-    directory = str(1)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    np.random.seed(42)
-    N = 1
-    num_random_variables = 20
-    #randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    #randomVariable = np.resize(randomVariable,(N,num_random_variables))
-    randomVariable = np.zeros((N, num_random_variables))
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-    p['gamma'] = 100.
-
-    ensemble_size = 1
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-    os.chdir('..')
-
-    directory = str(2)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    np.random.seed(42)
-    N = 1
-    num_random_variables = 20
-    #randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    #randomVariable = np.resize(randomVariable,(N,num_random_variables))
-    randomVariable = np.zeros((N, num_random_variables))
-
-    p = model.defaut_params
-    p['MueLu xml from current_dir'] = False
-    p['MueLu xml use template'] = False
-    p['MueLu xml file name'] = '/../preconditioners/SIMPLE_direct.xml'
-    p['Write txt files'] = True
-    p['Write matrix and vectors'] = True
-    p['gamma'] = 4368992.
-
-    ensemble_size = 1
-
-    pm = model.plate_model(ensemble_size, randomVariable,
-                           msh, comm, file_dir, work_dir, p)
-    pm.run(args.k)
-
-    os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/plate_SPD/blake.slurm.sh b/katoptron/CMAME/plate_SPD/blake.slurm.sh
deleted file mode 100644
index 122ec86a3e7dfd973ab8df41dc0a12d61a4521b8..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/plate_SPD/blake.slurm.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=plate
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/plate.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_SPD/plate.py
diff --git a/katoptron/CMAME/plate_SPD/plate.geo b/katoptron/CMAME/plate_SPD/plate.geo
deleted file mode 100644
index 4e9dedd0fcc7201f4d2f43b60f32b4edcece3731..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/plate_SPD/plate.geo
+++ /dev/null
@@ -1,43 +0,0 @@
-SetFactory("OpenCASCADE");
-If(GMSH_MAJOR_VERSION!=3 || GMSH_MINOR_VERSION!=0 || GMSH_PATCH_VERSION!=6)
-  Printf("gmsh %g.%g.%g is not supported by this .geo",GMSH_MAJOR_VERSION,GMSH_MINOR_VERSION,GMSH_PATCH_VERSION);
-Else
-  LX = 10;
-  LY = 10;
-  LZ = 1;
-
-  nX = 15;
-  nY = 15;
-  nZ = 1;
-
-  Point(1)  = { 0.,  0., 0.,     lc};
-  Point(2)  = { 0.,  LY, 0.,     lc};
-  Point(3)  = { LX,  LY, 0.,     lc};
-  Point(4)  = { LX,  0., 0.,     lc};
-
-  Line(1) = {1, 2};
-  Line(2) = {2, 3};
-  Line(3) = {3, 4};
-  Line(4) = {4, 1};
-
-  Transfinite Line {1, 3} = nY Using Progression 1;
-  Transfinite Line {2, 4} = nX Using Progression 1;
-
-  Line Loop(5) = {1, 2, 3, 4};
-  Plane Surface(5) = {5};
-  Transfinite Surface {5};
-  Recombine Surface {5};
-
-  Extrude {0, 0, LZ}
-  {
-    Surface{5}; Layers{nZ}; Recombine;
-  }
-
-  Physical Volume("body") = {1};
-
-  Physical Surface("load 1") = {7};
-  Physical Surface("load 2") = {9};
-  Physical Point("clamped xyz") = {1};
-  Physical Point("clamped xy") = {5};
-  Physical Point("clamped y") = {4};
-EndIf
diff --git a/katoptron/CMAME/plate_SPD/plate.py b/katoptron/CMAME/plate_SPD/plate.py
deleted file mode 100644
index 24508e884e7d2036eb6c04e74832a364e1c20376..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/plate_SPD/plate.py
+++ /dev/null
@@ -1,288 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def get_parameters(case_id, first_sample_id):
-    """
-    This function returns the python dictionary that includes 
-    the parameters for a given test case
-    """
-    p = model.defaut_params
-
-    if case_id == 1:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.1
-    elif case_id == 2:
-        nuw = 128
-        p['Correlation length'] = 20.
-        p['Dispersion level'] = 0.3
-    elif case_id == 3:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.1
-    elif case_id == 4:
-        nuw = 128
-        p['Correlation length'] = 5.
-        p['Dispersion level'] = 0.3
-    elif case_id == 5:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.1
-    elif case_id == 6:
-        nuw = 128
-        p['Correlation length'] = 2.
-        p['Dispersion level'] = 0.3
-
-    p['Wavenumber cutoff'] = 8.
-    p['Wavenumber discretization points'] = nuw
-    p['Number Z of previously drawn samples'] = first_sample_id * nuw**2
-    p['Number Phi of previously drawn samples'] = first_sample_id * nuw**2
-    p['Write matrix and vectors'] = False
-    p['Write txt files'] = False
-
-    p['Is exp'] = False
-    return p
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir, max_iter):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = get_parameters(case_id, first_sample_id)
-
-    pbl = m.Problem(msh, comm)
-
-    # Units are in mm
-    E = 70000 * np.ones(ensemble_size)  # 70e9 Pa = 70000 MPa
-    nu = 0.35 * np.ones(ensemble_size)
-    k = 0.
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamped xyz", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "clamped xy", "Clamped", 1, 0., 1, 0., 0, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "clamped y", "Clamped", 0, 0., 1, 0., 0, 0., 0, 0.,
-                ensemble_size)
-
-    f = 700 * np.ones(ensemble_size)  # 700e6 Pa = 700 MPa
-    zero = np.zeros(ensemble_size)
-    one = np.ones(ensemble_size)
-    m.Neumann(pbl, 'load 1', 'load', 0, zero, 1, f, 0, zero, 0, one,
-              ensemble_size)
-    m.Neumann(pbl, 'load 2', 'load', 0, zero, 1, -f, 0, zero, 0, one,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 1e-8
-    solverList['Maximum Iterations'] = max_iter
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    prec = 2
-
-    if prec == 1:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 1
-        mueluParams['coarse: type'] = "CHEBYSHEV"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['chebyshev: degree'] = 20
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['coarse: params'] = mueluParamsSub2
-    elif prec == 2:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 1
-        mueluParams['coarse: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-        mueluParamsSub2['relaxation: sweeps'] = 3
-        mueluParamsSub2['relaxation: damping factor'] = 1.75
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['coarse: params'] = mueluParamsSub2
-    elif prec == 3:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 2
-        mueluParams['smoother: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "MT Gauss-Seidel"
-        mueluParamsSub2['relaxation: sweeps'] = 10
-        mueluParamsSub2['relaxation: damping factor'] = 1.75
-
-        mueluParams['verbosity'] = "high"
-
-        mueluParams['smoother: params'] = mueluParamsSub2
-
-        mueluParams['coarse: type'] = "Klu"
-        mueluParams['coarse: max size'] = 18
-
-    solverList['convert MueLu xml file'] = True
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Print Teuchos timers'] = True
-
-    solverList['gamma'] = p['gamma']
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = 'BlockGmres'
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Write matrix and vectors'] = p['Write matrix and vectors']
-    solverList['Write txt files'] = p['Write txt files']
-
-    if p["Is exp"]:
-        num_random_variables = randomVariable.shape[1]
-    else:
-        num_random_variables = 0
-
-    for i in range(0, num_random_variables):
-        rand = randomVariable[:, i]
-        pbl.add(m.RandomVariable(rand))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Is exp'] = p['Is exp']
-    if p["Is exp"]:
-        randomParams['Begin X'] = 0.
-        randomParams['Begin Y'] = 0.
-        randomParams['Begin Z'] = 0.
-        randomParams['End X'] = 10.
-        randomParams['End Y'] = 10.
-        randomParams['End Z'] = 1.
-        randomParams['Number random variables'] = num_random_variables
-        randomParams['Correlation length X'] = p['Correlation length X']
-        randomParams['Correlation length Y'] = p['Correlation length Y']
-        randomParams['Correlation length Z'] = p['Correlation length Z']
-        randomParams['Number of KL Terms X'] = p['Number of KL Terms X']
-        randomParams['Number of KL Terms Y'] = p['Number of KL Terms Y']
-        randomParams['Number of KL Terms Z'] = p['Number of KL Terms Z']
-        randomParams['Maximum Nonlinear Solver Iterations'] = 5000
-        randomParams['Bound Perturbation Size'] = 1E-10
-    else:
-        randomParams['Correlation length'] = p['Correlation length']
-        randomParams['Wavenumber cutoff'] = p['Wavenumber cutoff']
-        randomParams['Wavenumber discretization points'] = p[
-            'Wavenumber discretization points']
-        randomParams['Number Z of previously drawn samples'] = p[
-            'Number Z of previously drawn samples']
-        randomParams['Number Phi of previously drawn samples'] = p[
-            'Number Phi of previously drawn samples']
-
-    randomParams['Mean'] = (E[0] / (2. * (1. + nu[0])))
-    randomParams['Dispersion level'] = p['Dispersion level']
-
-    solverList['randomParams'] = randomParams
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 3, ensemble_size)
-    slv.start()
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = N // ensemble_size
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                n_iter = np.arange(1, 105)
-                n_it = len(n_iter)
-                #n_it = 6
-                # np.linspace(10,200,n_it,dtype=int)
-
-                for i_it in range(0, n_it):
-                    max_iter = n_iter[i_it]
-                    directory = str(max_iter)
-                    if not os.path.exists(directory):
-                        os.makedirs(directory)
-                    os.chdir(directory)
-                    evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                          msh, comm, file_dir, max_iter)
-                    os.chdir('..')
-
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = gmsh.MeshLoader('plate.geo', file_dir).execute()
-
-    N = 8
-    ensemble_sizes = [1, 8]
-    case_ids = [1]
-
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/plate_SPD/plate_convergence.py b/katoptron/CMAME/plate_SPD/plate_convergence.py
deleted file mode 100644
index d05f89e9836a89722ac71a63d39e9af5aeb0c8a1..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/plate_SPD/plate_convergence.py
+++ /dev/null
@@ -1,345 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-"""@package docstring
-This file is used to loop over cases and samples and plot their mechanical properties and solution fields.
-"""
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-from katoptron.CMAME.model import Compute_QoIs
-
-
-def plot_2D_mesh(pts, quad, ax):
-    """
-    This function plots a 2D quad mesh on a given matplotlib axis
-    """
-    import matplotlib.pyplot as plt
-    for i in range(0, quad.shape[0]):
-        x = np.zeros((quad.shape[1] + 1, ))
-        y = np.zeros((quad.shape[1] + 1, ))
-        for j in range(0, quad.shape[1]):
-            x[j] = pts[quad[i, j], 0]
-            y[j] = pts[quad[i, j], 1]
-        x[-1] = pts[quad[i, 0], 0]
-        y[-1] = pts[quad[i, 0], 1]
-        ax.plot(x, y, '--k', linewidth=0.5)
-
-
-def cut_of_one_case(case_id,
-                    ensemble_size,
-                    n_samples,
-                    iters,
-                    file_MC_base_dir):
-    """
-    This function loops over the samples of a given test case and plot them
-    """
-    import matplotlib.pyplot as plt
-
-    base_directory = 'case_' + str(case_id)
-    if not os.path.exists(base_directory):
-        os.makedirs(base_directory)
-        os.makedirs(base_directory + '/sample')
-        os.makedirs(base_directory + '/sample_ER_dif')
-    base_directory_sample = base_directory + '/sample'
-    base_directory_sample_ER_dif = base_directory + '/sample_ER_dif'
-    for i in range(0, n_samples):
-
-        input_MC_file_dir = file_MC_base_dir + \
-            str(case_id) + '/1/' + str(i) + '/104/'
-        mshName_sample_no_EP = input_MC_file_dir + 'plate_ast1_s0_0'
-        pts, tri, vals = cut_plate(mshName_sample_no_EP, False)
-        pts_2, quad = extract_quad_msh(mshName_sample_no_EP)
-
-        x = pts[:, 0]
-        y = pts[:, 1]
-
-        plot_one_sampel(x, y, tri, vals, pts_2, quad, False)
-        plt.savefig(base_directory_sample + '/' + str(i) + '.png', dpi=400)
-
-        for i_it in range(0, len(iters)):
-
-            i_ensemble = (i // ensemble_size)
-            i_sample = np.mod(i, ensemble_size)
-
-            #input_MC_file_dir = file_MC_base_dir + str(case_id) + '/1/' + str(i) + '/' + str(iters[i_it]) + '/'
-
-            input_MC_file_dir = file_MC_base_dir + str(case_id) + '/' + str(
-                ensemble_size) + '/' + str(i_ensemble) + '/' + str(iters[i_it]) + '/'
-            mshName_sample_EP = input_MC_file_dir + 'plate_ast1_s' + str(
-                i_sample) + '_0'
-
-            pts_EP, tri_EP, vals_EP = cut_plate(mshName_sample_EP,  False)
-
-            plot_one_sampel(x, y, tri, vals_EP, pts_2, quad, False)
-            plt.savefig(base_directory_sample + '/' + str(i) + '_' +
-                        str(iters[i_it]) + '_e_' + str(ensemble_size) + '.png', dpi=400)
-
-            plot_diff_abs(x, y, tri, vals, vals_EP, pts_2, quad, False)
-            plt.savefig(base_directory_sample_ER_dif + '/' + str(i) + '_' +
-                        str(iters[i_it]) + '_e_' + str(ensemble_size) + '.png', dpi=400)
-
-            input_MC_file_dir = file_MC_base_dir + \
-                str(case_id) + '/1/' + str(i) + '/' + str(iters[i_it]) + '/'
-            mshName_sample_EP = input_MC_file_dir + 'plate_ast1_s0_0'
-
-            pts_EP, tri_EP, vals_EP = cut_plate(mshName_sample_EP,  False)
-
-            plot_one_sampel(x, y, tri, vals_EP, pts_2, quad, False)
-            plt.savefig(base_directory_sample + '/' + str(i) +
-                        '_' + str(iters[i_it]) + '_e_1.png', dpi=400)
-
-            plot_diff_abs(x, y, tri, vals, vals_EP, pts_2, quad, False)
-            plt.savefig(base_directory_sample_ER_dif + '/' +
-                        str(i) + '_' + str(iters[i_it]) + '_e_1.png', dpi=400)
-
-            plt.close('all')
-
-
-def extract_quad_msh(mshName):
-    """
-    This function extracts the 2D quad mesh out of a hexahedron mesh
-    """
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    rdata = reader.reader.GetOutput()
-
-    _pts = rdata.GetPoints()
-    pts = np.zeros((_pts.GetNumberOfPoints(), 2))
-    pts_indices = np.zeros((_pts.GetNumberOfPoints(), ), dtype=int)
-    for i in range(0, pts.shape[0]):
-        if _pts.GetPoint(i)[2] <= 0.01:
-            for j in range(0, 2):
-                pts[i][j] = _pts.GetPoint(i)[j]
-            pts_indices[i] = 1
-    n_elems = rdata.GetNumberOfCells()
-    quad = []
-    for i in range(0, n_elems):
-        elem = rdata.GetCell(i)
-        for j in range(0, 6):
-            face = elem.GetFace(j)
-            points_id = np.zeros((4, ), dtype=int)
-            good_face = True
-            for k in range(0, 4):
-                points_id[k] = face.GetPointId(k)
-                if pts_indices[points_id[k]] != 1:
-                    good_face = False
-                    break
-            if good_face:
-                if len(quad) == 0:
-                    quad = points_id.reshape((1, 4))
-                else:
-                    quad = np.append(quad, points_id.reshape((1, 4)), axis=0)
-    return pts, quad
-
-
-def cut_plate(mshName, at_point=False):
-    """
-    This function cuts the vtk files in the middle and extracts both point
-    and element data.
-    """
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    cutter = vtkC.Cutter(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, [0., 0., 0.5], [0., 0., 1.], tag_name='volume_id')
-    if at_point:
-        pts, tri, vals = cutter.extract(c_output,
-                                        3,
-                                        ['u', 'x', 'y', 'z', 'G', 'von Mises'],
-                                        atPoint=True)
-    else:
-        pts, tri, vals = cutter.extract(c_output,
-                                        3, ['u', 'x', 'y', 'z'],
-                                        atPoint=True)
-        pts_2, tri_2, vals_2 = cutter.extract(c_output,
-                                              3, ['G', 'von Mises'],
-                                              atPoint=False)
-        vals.update(vals_2)
-
-    return pts, tri, vals
-
-
-def plot_2D_cut_values_at_node(x, y, tri, value, n_levels=16):
-    """
-    This function plots data at node.
-    """
-    import matplotlib.pyplot as plt
-    value = value.reshape((len(x), ))
-    if max(value) - min(value) > 0:
-        levels = np.linspace(min(value), max(value), n_levels)
-        plt.set_cmap('coolwarm')
-        plt.tricontour(x,
-                       y,
-                       tri,
-                       value,
-                       levels,
-                       linestyles='-',
-                       colors='black',
-                       linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, value, levels)
-    else:
-        axtri = plt.tricontourf(x, y, tri, value)
-    plt.gca().set_aspect('equal')
-    return axtri
-
-
-def plot_2D_cut_values_at_elem(x,
-                               y,
-                               tri_1,
-                               value,
-                               v_min=0,
-                               v_max=0,
-                               n_levels=16,
-                               shading=False):
-    """
-    This function plots data at element.
-    """
-    import matplotlib.pyplot as plt
-
-    value = value.reshape((tri_1.shape[0], ))
-    if v_min == v_max:
-        v_min = min(value)
-        v_max = max(value)
-
-    levels = np.linspace(v_min, v_max, n_levels)
-    plt.set_cmap('coolwarm')
-    if shading:
-        axtri = plt.tripcolor(x, y, tri_1, value, shading='gouraud')
-    else:
-        axtri = plt.tripcolor(x, y, tri_1, value, levels)
-    plt.gca().set_aspect('equal')
-    return axtri
-
-
-def plot_one_sampel(x, y, tri, vals_s, pts_2, quad, at_point=False):
-    """
-    This function plots data of a given sample.
-    """
-    import matplotlib.pyplot as plt
-
-    fig = plt.figure(figsize=(15, 4))
-
-    ax = plt.subplot(131)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x, y, tri, vals_s['G'])
-        plot_2D_mesh(pts_2, quad, ax)
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['G'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.title('G')
-
-    plt.subplot(132)
-    tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['y'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal', format='%.0e')
-    plt.title('y')
-
-    ax = plt.subplot(133)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x, y, tri, vals_s['von Mises'])
-        plot_2D_mesh(pts_2, quad, ax)
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['von Mises'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.title('von Mises')
-
-
-def plot_diff_abs(x, y, tri, vals, vals_s, pts_2, quad, at_point=False):
-    """
-    This function plots the difference between data of a given sample and the mean sample.
-    """
-    import matplotlib.pyplot as plt
-
-    fig = plt.figure(figsize=(15, 4))
-
-    plt.subplot(131)
-    tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['x'] - vals['x'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal', format='%.0e')
-    plt.title('delta x')
-
-    plt.subplot(132)
-    tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['y'] - vals['y'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal', format='%.0e')
-    plt.title('delta y')
-
-    plt.subplot(133)
-    tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['z'] - vals['z'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal', format='%.0e')
-    plt.title('delta z')
-
-
-def plot_diff_rel(x,
-                  y,
-                  tri,
-                  vals,
-                  vals_s,
-                  pts_2,
-                  quad,
-                  v_min=-10,
-                  v_max=10,
-                  at_point=False):
-    """
-    This function plots the relative difference between data of a given sample and the mean sample.
-    """
-    import matplotlib.pyplot as plt
-
-    fig = plt.figure(figsize=(15, 4))
-
-    diff_G = vals_s['G'] - vals['G']
-    diff_G_rel = (100 * diff_G / vals['G'])
-
-    plt.subplot(121)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x,
-                                         y,
-                                         tri,
-                                         diff_G_rel,
-                                         v_min=v_min,
-                                         v_max=v_max)
-        plot_2D_mesh(pts_2, quad, plt.gca())
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, diff_G_rel)
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.clim(v_min, v_max)
-    plt.title('delta G relative')
-
-    diff_vM = vals_s['von Mises'] - vals['von Mises']
-    diff_vM_rel = (100 * diff_vM / vals['von Mises'])
-
-    plt.subplot(122)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x,
-                                         y,
-                                         tri,
-                                         diff_vM_rel,
-                                         v_min=v_min,
-                                         v_max=v_max)
-        plot_2D_mesh(pts_2, quad, plt.gca())
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, diff_vM_rel)
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.clim(v_min, v_max)
-    plt.title('delta von Mises relative')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_plate_SPD_plate_MG/case_'
-
-    n_it = 6
-    iters = np.arange(1, 60)  # np.linspace(10,200,n_it,dtype=int)
-
-    n_samples = 8
-    cut_of_one_case(1, 8, n_samples, iters, file_MC_base_dir)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/2_cube.py b/katoptron/CMAME/post_process/2_cube.py
deleted file mode 100644
index 2fc5d4403ddc8797f9377409a3c0cc76d5d3b0c1..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/2_cube.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-import fwk
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    input_file_dir = '/Users/kimliegeois/Desktop/katoptron/katoptron_tests_2_cubes_patch/'
-
-    filename_Q = input_file_dir + 'A_mm_after_bc.txt'
-    filename_GT = input_file_dir + 'B_mm.txt'
-
-    Q = read_mm(filename_Q)
-    Q = get_symmetrical_part(Q)
-    GT = read_mm(filename_GT)
-
-    norm_Q = sparse_matrix_2_norm(Q)
-    norm_GT = sparse_matrix_2_norm(GT)
-
-    print(norm_Q)
-    print(norm_GT)
-    print((norm_Q / norm_GT))
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/grouping.py b/katoptron/CMAME/post_process/grouping.py
deleted file mode 100644
index bb53ff5ba961550fd29605578b08c88d07b9127c..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/grouping.py
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-# require a git clone https://github.com/kliegeois/Same-Size-K-Means.git
-
-
-
-
-from clustering.equal_groups import EqualGroupsKMeans
-import numpy as np
-import matplotlib.pyplot as plt
-from sklearn.decomposition import PCA
-from mpl_toolkits.mplot3d import Axes3D
-
-
-def compute_the_groups(N, ensemble_size, num_random_variables):
-
-    np.random.seed(42)
-
-    n_clusters = int(N // ensemble_size)
-
-    randomVariable = np.random.normal(0, 1, num_random_variables*N)
-    X = np.resize(randomVariable, (N, num_random_variables))
-
-    clf = EqualGroupsKMeans(n_clusters=n_clusters)
-
-    clf.fit(X)
-
-    Z = clf.predict(X)
-    Z = Z.astype(int)
-
-    for i in range(0, n_clusters):
-        l_s = len(np.argwhere(Z == i))
-        if l_s != ensemble_size:
-            print('Ensemble ' + str(i) + ' has ' + str(l_s) +
-                  ' samples instead of ' + str(ensemble_size))
-
-    np.savetxt('Groupe_id_s_'+str(ensemble_size) +
-               '_'+str(N)+'.txt', Z, fmt='%i')
-
-    indices = np.argsort(Z)
-
-    np.savetxt('Reordering_s_'+str(ensemble_size) +
-               '_'+str(N)+'.txt', indices, fmt='%i')
-
-    '''
-    reduced_data = PCA(n_components=3).fit_transform(X)
-
-    fig = plt.figure()
-    ax = fig.add_subplot(111, projection='3d')
-
-    x_min, x_max = reduced_data[:, 0].min() - 1, reduced_data[:, 0].max() + 1
-    y_min, y_max = reduced_data[:, 1].min() - 1, reduced_data[:, 1].max() + 1
-    z_min, z_max = reduced_data[:, 2].min() - 1, reduced_data[:, 2].max() + 1
-    ax.scatter(reduced_data[:, 0], reduced_data[:, 1],reduced_data[:, 2], s = 20, c=Z)
-    ax.set_xlim(x_min, x_max)
-    ax.set_ylim(y_min, y_max)
-    ax.set_zlim(z_min, z_max)
-    plt.show()
-    '''
-
-
-def main():
-
-    N = 960
-    num_random_variables = 20
-
-    compute_the_groups(N, 8, num_random_variables)
-    compute_the_groups(N, 16, num_random_variables)
-    compute_the_groups(N, 32, num_random_variables)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/juelich_speedup.py b/katoptron/CMAME/post_process/juelich_speedup.py
deleted file mode 100644
index f09084b76346f7eeed3d139100dfb68acab1c87e..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/juelich_speedup.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.speedup import *
-
-
-def speedup_of_one_case(n_samples, ensemble_sizes, quantiles,
-                        querylines, use_waves_timers, use_teuchos_timers,
-                        per_iteration):
-    import matplotlib.pyplot as plt
-
-    file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_Juelich_tests_M1_assembly_fused_MC_ER_2/'
-    # try:
-    speedup = compute_speedup(n_samples, ensemble_sizes, file_MC_base_dir,
-                              querylines, per_iteration, quantiles,
-                              use_waves_timers, use_teuchos_timers, True)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)),
-                 'case_', querylines, per_iteration)
-    plt.savefig('case_.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, 'case_')
-
-    R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir, quantiles,
-                  True)
-    save_R(R, 'case_')
-    # except:
-    #    print '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_case_' + case_id + '  has not all the files'
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 64
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SimpleSmoother: Apply: total (total)',
-        'MueLu: SimpleSmoother: Correction step: Compute rhs (total)',
-        'MueLu: SimpleSmoother: Correction step: Solve block 11 (total)',
-        'MueLu: SimpleSmoother: Prediction step: Compute rhs (total)',
-        'MueLu: SimpleSmoother: Prediction step: Solve block 00 (total)'
-    ]
-    use_waves_timers = np.array([0, 7, 8], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True
-    ]
-
-    speedup_of_one_case(n_samples, ensemble_sizes, quantiles,
-                        querylines, use_waves_timers, use_teuchos_timers,
-                        per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_G.py b/katoptron/CMAME/post_process/plate_G.py
deleted file mode 100644
index f250efcd4cd4ded953eca7804825c242c2d7610d..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_G.py
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-import fwk
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-
-def Kirsch_equations(x, y, center_x, center_y, a, sigma_inf):
-
-    centered_x = x-center_x
-    centered_y = y-center_y
-
-    r = np.abs(centered_x+centered_y*1.0j)
-    theta = np.angle(centered_x+centered_y*1.0j) - (np.pi / 2)
-
-    half_sigma_inf = ((sigma_inf / 2))
-
-    ar = (a / r)
-    ar_p_2 = np.power(ar, 2)
-    ar_p_4 = np.power(ar, 4)
-
-    cos2theta = np.cos(2*theta)
-    sin2theta = np.sin(2*theta)
-
-    sigma_rr = half_sigma_inf*(1-ar_p_2)+half_sigma_inf * \
-        (1-4*ar_p_2+3*ar_p_4)*cos2theta
-    sigma_thetatheta = half_sigma_inf * \
-        (1+ar_p_2)-half_sigma_inf*(1+3*ar_p_4)*cos2theta
-    tau_rtheta = -half_sigma_inf*(1+2*ar_p_2-3*ar_p_4)*sin2theta
-
-    VM = np.sqrt(np.square(sigma_rr)+np.square(sigma_thetatheta) -
-                 sigma_rr*sigma_thetatheta+3*np.square(tau_rtheta))
-
-    return VM
-
-
-def cut_plate(mshName):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    cutter = vtkC.Cutter(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, [0., 0., 0.5], [0., 0., 1.], tag_name='volume_id')
-    pts, tri, vals = cutter.extract(
-        c_output, 3, ['u', 'x', 'y', 'z', 'G_point'], atPoint=True)
-    pts_2, tri_2, vals_2 = cutter.extract(
-        c_output, 3, ['G', 'von Mises'], atPoint=False)
-    vals.update(vals_2)
-
-    return pts, tri, vals
-
-
-def extract_quad_msh(mshName):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    rdata = reader.reader.GetOutput()
-
-    _pts = rdata.GetPoints()
-    pts = np.zeros((_pts.GetNumberOfPoints(), 2))
-    pts_indices = np.zeros((_pts.GetNumberOfPoints(),), dtype=int)
-    for i in range(0, pts.shape[0]):
-        if _pts.GetPoint(i)[2] <= 0.01:
-            for j in range(0, 2):
-                pts[i][j] = _pts.GetPoint(i)[j]
-            pts_indices[i] = 1
-    n_elems = rdata.GetNumberOfCells()
-    quad = []
-    for i in range(0, n_elems):
-        elem = rdata.GetCell(i)
-        for j in range(0, 6):
-            face = elem.GetFace(j)
-            points_id = np.zeros((4,), dtype=int)
-            good_face = True
-            for k in range(0, 4):
-                points_id[k] = face.GetPointId(k)
-                if pts_indices[points_id[k]] != 1:
-                    good_face = False
-                    break
-            if good_face:
-                if len(quad) == 0:
-                    quad = points_id.reshape((1, 4))
-                else:
-                    quad = np.append(quad, points_id.reshape((1, 4)), axis=0)
-    return pts, quad
-
-
-def plot_2D_cut_values_at_node(x, y, tri, value, v_min, v_max, n_levels=16):
-    import matplotlib.pyplot as plt
-    value = value.reshape((len(x),))
-    levels = np.linspace(v_min, v_max, n_levels)
-    #print levels
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(x, y, tri, value, levels, linestyles='-',
-                   colors='black', linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, value, levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0,
-                        hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-
-def plot_2D_cut_values_at_elem(x, y, tri_1, value, v_min, v_max, n_levels=16, shading=False):
-    import matplotlib.pyplot as plt
-
-    value = value.reshape((tri_1.shape[0],))
-
-    levels = np.linspace(v_min, v_max, n_levels)
-    #print levels
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    if shading:
-        plt.tripcolor(x, y, tri_1, value, shading='gouraud')
-    else:
-        plt.tripcolor(x, y, tri_1, value, levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0,
-                        hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-
-def plot_2D_mesh(pts, quad):
-    import matplotlib.pyplot as plt
-    fig = plt.figure(figsize=(8, 8))
-    f = open('mesh_2.tex', 'w')
-    print('\begin{tikzpicture}', file=f)
-    for i in range(0, quad.shape[0]):
-        x = np.zeros((quad.shape[1]+1,))
-        y = np.zeros((quad.shape[1]+1,))
-        for j in range(0, quad.shape[1]):
-            x[j] = pts[quad[i, j], 0]
-            y[j] = pts[quad[i, j], 1]
-        x[-1] = pts[quad[i, 0], 0]
-        y[-1] = pts[quad[i, 0], 1]
-        string_1 = '\draw[thick] '
-        for j in range(0, quad.shape[1]+1):
-            string_1 = string_1 + '(' + str(x[j]) + ',' + str(y[j]) + ')'
-            if j == quad.shape[1]:
-                string_1 = string_1 + ';'
-            else:
-                string_1 = string_1 + '--'
-
-        print(string_1, file=f)
-        plt.plot(x, y, 'black')
-    plt.gca().set_aspect('equal')
-
-    print('\end{tikzpicture}', file=f)
-    f.closed
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    n_samples = 8
-    n_cases = 6
-
-    for i in range(0, n_cases):
-        min_G = 1e9
-        max_G = 0
-        for j in range(0, n_samples):
-            input_file_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_2/case_' + \
-                str(i+1)+'/8/0/'
-
-            mshName = input_file_dir+'plate_fused_ast1_s'+str(j)+'_0'
-
-            pts, tri, vals = cut_plate(mshName)
-
-            if max_G <= np.amax(vals['G_point']):
-                max_G = np.amax(vals['G_point'])
-            if min_G >= np.amin(vals['G_point']):
-                min_G = np.amin(vals['G_point'])
-
-        print('Case ' + str(i))
-        print(min_G)
-        print(max_G)
-
-        for j in range(0, n_samples):
-            input_file_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_2/case_' + \
-                str(i+1)+'/8/0/'
-
-            mshName = input_file_dir+'plate_fused_ast1_s'+str(j)+'_0'
-
-            pts, tri, vals = cut_plate(mshName)
-
-            x = pts[:, 0]
-            y = pts[:, 1]
-
-            plot_2D_cut_values_at_node(
-                x, y, tri, vals['G_point'], min_G, max_G)
-            plt.savefig("G_"+str(i)+"_"+str(j)+".pdf",
-                        transparent=True, bbox_inches='tight', pad_inches=-0.05)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_GS_direct.py b/katoptron/CMAME/post_process/plate_GS_direct.py
deleted file mode 100644
index bde36488700304d2ba85e1e18b6662793695863a..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_GS_direct.py
+++ /dev/null
@@ -1,318 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-from katoptron.readers import *
-import os
-import fwk
-"""@package docstring
-This file is used to investigate the choice of prec parameters.
-"""
-
-
-def read_timer_all(n_cases, sub_cases, file_MC_base_dir):
-    querylines = ['Belos: Operation Op*x',
-                  'Belos: Operation Prec*x',
-                  'Belos: DGKS[2]: Orthogonalization',
-                  'Belos: DGKS[2]: Ortho (Inner Product)',
-                  'Belos: DGKS[2]: Ortho (Norm)',
-                  'Belos: DGKS[2]: Ortho (Update)',
-                  'Belos: PseudoBlockGmresSolMgr total solve time']
-    timer = np.zeros((n_cases, len(sub_cases), len(querylines)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            timer[i, j, :] = read_teuchos_timers(
-                input_MC_file_dir+'teuchos_timers.txt', querylines)
-    return timer
-
-
-def read_iter_all(n_cases, sub_cases, file_MC_base_dir):
-    iter = np.zeros((n_cases, len(sub_cases)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', 1)
-            iter[i][j] = iter_indices[-1]
-    return iter
-
-
-def read_timer_tensor(n_cases, sub_cases, file_MC_base_dir, sizes):
-    import numpy as np
-    timer = read_timer_all(n_cases, sub_cases, file_MC_base_dir)
-
-    n_0 = sizes[0]
-    n_1 = sizes[1]
-    n_2 = sizes[2]
-    n_3 = sizes[3]
-
-    timer_tensor = np.zeros(
-        (n_0, n_1, n_2, n_3, len(sub_cases), timer.shape[2]))
-
-    i = 0
-
-    for i_0 in range(0, n_0):
-        for i_1 in range(0, n_1):
-            for i_2 in range(0, n_2):
-                for i_3 in range(0, n_3):
-                    if i < timer.shape[0]:
-                        timer_tensor[i_0, i_1, i_2, i_3, :, :] = timer[i, :, :]
-                        i = i + 1
-                    else:
-                        return timer_tensor
-
-    return timer_tensor
-
-
-def read_iter_tensor(n_cases, sub_cases, file_MC_base_dir, sizes):
-    import numpy as np
-    iter = read_iter_all(n_cases, sub_cases, file_MC_base_dir)
-
-    n_0 = sizes[0]
-    n_1 = sizes[1]
-    n_2 = sizes[2]
-    n_3 = sizes[3]
-
-    iter_tensor = np.zeros((n_0, n_1, n_2, n_3, len(sub_cases)))
-
-    i = 0
-
-    for i_0 in range(0, n_0):
-        for i_1 in range(0, n_1):
-            for i_2 in range(0, n_2):
-                for i_3 in range(0, n_3):
-                    if i < iter.shape[0]:
-                        iter_tensor[i_0, i_1, i_2, i_3, :] = iter[i, :]
-                        i = i + 1
-                    else:
-                        return iter_tensor
-
-    return iter_tensor
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    test = 1
-    EP = True
-    if test == 1:
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/gaussian/katoptron_CMAME_tests_plate_mean_prec_GS_direct/'
-        #file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_mean_prec_GS_direct/'
-        sub_cases = ['mean_case', 'ensemble_reduction_8']
-
-        GS_sweeps_00_min = 16
-        GS_sweeps_00_max = 41
-        delta_GS_sweeps_00 = 2
-
-        N_GS_sweeps_00 = int(
-            np.ceil(
-                ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-        # Damping has to be between 0 and 2
-        GS_damping_00_min = 1.75
-        GS_damping_00_max = 1.9
-        N_GS_damping_00 = 8
-
-        # Omega has to be between 0 and 1
-        SS_omega_min = 0.001
-        SS_omega_max = 0.5
-        N_SS_omega = 12
-
-        SS_damping_min = 1.
-        SS_damping_max = 1.2
-        N_SS_damping = 1
-
-        n_cases = 1248
-    elif test == 2:
-        file_MC_base_dir = file_dir + \
-            '/../../../workspace/katoptron_CMAME_tests_plate_mean_prec_GS_direct_alphabeta_1/'
-        sub_cases = ['mean_case', 'ensemble_reduction_8']
-
-        GS_sweeps_00_min = 16
-        GS_sweeps_00_max = 41
-        delta_GS_sweeps_00 = 2
-
-        N_GS_sweeps_00 = int(
-            np.ceil(
-                ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-        # Damping has to be between 0 and 2
-        GS_damping_00_min = 0.001
-        GS_damping_00_max = 1.999
-        N_GS_damping_00 = 20
-
-        # Omega has to be between 0 and 1
-        SS_omega_min = 1.
-        SS_omega_max = 1.2
-        N_SS_omega = 1
-
-        SS_damping_min = 1.
-        SS_damping_max = 1.2
-        N_SS_damping = 1
-
-        n_cases = 260
-
-    elif test == 3:
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_mean_prec_GS_direct_lvl/'
-        sub_cases = ['mean_case']
-
-        GS_sweeps_00_min = 16
-        GS_sweeps_00_max = 17
-        delta_GS_sweeps_00 = 1
-
-        N_GS_sweeps_00 = int(
-            np.ceil(
-                ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-        # Damping has to be between 0 and 2
-        GS_damping_00_min = 0.001
-        GS_damping_00_max = 0.8
-        N_GS_damping_00 = 50
-
-        # Omega has to be between 0 and 1
-        SS_omega_min = 0.75
-        SS_omega_max = 1.1
-        N_SS_omega = 5
-
-        SS_damping_min = 1.
-        SS_damping_max = 1.
-        N_SS_damping = 1
-
-        n_cases = 181
-        EP = False
-
-    iter = read_iter_tensor(n_cases, sub_cases, file_MC_base_dir, [
-                            N_GS_sweeps_00, N_GS_damping_00, N_SS_omega, N_SS_damping])
-    timer = read_timer_tensor(n_cases, sub_cases, file_MC_base_dir, [
-                              N_GS_sweeps_00, N_GS_damping_00, N_SS_omega, N_SS_damping])
-
-    sweeps_00 = np.arange(
-        GS_sweeps_00_min, GS_sweeps_00_max, delta_GS_sweeps_00)
-    damping_00 = np.linspace(
-        GS_damping_00_min, GS_damping_00_max, N_GS_damping_00)
-    SS_omega = np.linspace(SS_omega_min, SS_omega_max, N_SS_omega)
-    SS_damping = np.linspace(SS_damping_min, SS_damping_max, N_SS_damping)
-
-    from mpl_toolkits.mplot3d import Axes3D
-    import matplotlib.pyplot as plt
-    from matplotlib import cm
-
-    opti = np.zeros((N_GS_sweeps_00, 3), dtype=int)
-    opti_2 = np.zeros((N_GS_sweeps_00, 3), dtype=int)
-    opti_iter = np.zeros((N_GS_sweeps_00, 1), dtype=int)
-    opti_iter_2 = np.zeros((N_GS_sweeps_00, 1), dtype=int)
-    opti_iter_2_one = np.zeros((N_GS_sweeps_00, 1), dtype=int)
-    R = np.zeros((N_GS_sweeps_00, 1))
-    opti_time = np.zeros((N_GS_sweeps_00, 7))
-    opti_time_2 = np.zeros((N_GS_sweeps_00, 7))
-    opti_time_per_iter = np.zeros((N_GS_sweeps_00, 7))
-
-    #opti_iter_8 = np.array([500,469,382,338,280,255,254,239,218,213,204,197],dtype=int)
-
-    for i in range(0, N_GS_sweeps_00):
-        tmp = iter[i, :, :, :, 0]
-        tmp[tmp == 0] = 1000
-        opti[i, :] = np.unravel_index(np.argmin(tmp, axis=None), tmp.shape)
-        print(str(sweeps_00[i]) + ' ' + str(damping_00[opti[i, 0]]
-                                            ) + ' ' + str(SS_omega[opti[i, 1]]))
-        opti_iter[i] = iter[i, opti[i, 0], opti[i, 1], 0, 0]
-        opti_time[i, :] = timer[i, opti[i, 0], opti[i, 1], 0, 0, :]
-        if EP:
-            tmp2 = iter[i, :, :, :, 1]
-            opti_2[i, :] = np.unravel_index(
-                np.argmin(tmp2, axis=None), tmp.shape)
-            print(str(sweeps_00[i]) + ' ' + str(damping_00[opti_2[i, 0]]
-                                                ) + ' ' + str(SS_omega[opti_2[i, 1]]))
-            opti_iter_2[i] = iter[i, opti_2[i, 0], opti_2[i, 1], 0, 1]
-            opti_iter_2_one[i] = iter[i, opti_2[i, 0], opti_2[i, 1], 0, 0]
-            opti_time_2[i, :] = timer[i, opti_2[i, 0], opti_2[i, 1], 0, 1, :]
-            if opti_iter_2[i] == 1000:
-                R[i] = 10.
-            else:
-                R[i] = opti_iter_2[i]*1. / opti_iter[i]
-            for j in range(0, 7):
-                opti_time_per_iter[i, j] = (
-                    opti_time[i, j] / opti_iter[i])
-            #R[i] = opti_iter_8[i]*1. / opti_iter[i]
-
-    tmp = np.zeros((N_GS_sweeps_00, 2))
-    tmp[:, 0] = sweeps_00[:]
-    tmp[:, 1] = np.reshape(opti_iter, (N_GS_sweeps_00,))
-    np.savetxt('opti_iter.txt', tmp)
-    if EP:
-        tmp[:, 1] = np.reshape(opti_iter_2, (N_GS_sweeps_00,))
-        np.savetxt('opti_iter_2.txt', tmp)
-        tmp[:, 1] = np.reshape(opti_iter_2_one, (N_GS_sweeps_00,))
-        np.savetxt('opti_iter_2_one.txt', tmp)
-
-    plt.subplot(511)
-    plt.plot(sweeps_00, opti_iter)
-    plt.grid()
-    plt.subplot(512)
-    plt.plot(sweeps_00, opti_iter)
-    if EP:
-        plt.plot(sweeps_00, opti_iter_2)
-        plt.plot(sweeps_00, opti_iter_2_one)
-    plt.grid()
-    plt.subplot(513)
-    if EP:
-        plt.plot(sweeps_00, R)
-    plt.grid()
-    plt.subplot(514)
-    plt.plot(sweeps_00, damping_00[opti[:, 0]])
-    if EP:
-        plt.plot(sweeps_00, damping_00[opti_2[:, 0]])
-    plt.grid()
-    plt.subplot(515)
-    plt.plot(sweeps_00, SS_omega[opti[:, 1]])
-    if EP:
-        plt.plot(sweeps_00, SS_omega[opti_2[:, 1]])
-    plt.grid()
-    print(np.argmin(opti_time[:, 6]))
-    print(opti)
-    plt.figure()
-    for i in range(0, N_GS_sweeps_00):
-        plt.subplot(2, N_GS_sweeps_00, 1+i)
-        plt.plot(damping_00, iter[i, :, opti[i, 1], 0, 0])
-        plt.scatter(damping_00[opti[i, 0]], opti_iter[i], c='red')
-        plt.subplot(2, N_GS_sweeps_00, 1+i+N_GS_sweeps_00)
-        plt.plot(SS_omega, iter[i, opti[i, 0], :, 0, 0])
-        plt.scatter(SS_omega[opti[i, 1]], opti_iter[i], c='red')
-    '''
-    plt.figure()
-    plt.plot(sweeps_00,damping_00[opti[:,0]])
-    
-    plt.figure()
-    plt.plot(sweeps_00,SS_omega[opti[:,1]])
-
-    plt.figure()
-    for i in range(0,8):
-        plt.plot(damping_00,iter[0,:,i,0,0])
-    
-    plt.figure()
-    for i in range(0,8):
-        plt.plot(SS_omega,iter[0,i,:,0,0])
-
-    plt.figure()
-    for i in range(0,6):
-        plt.plot(SS_omega,iter[i,5,:,0,0])
-
-    for i in range(0,N_GS_sweeps_00):
-        fig = plt.figure()
-        ax = fig.add_subplot(111, projection='3d')
-        X, Y = np.meshgrid(SS_omega,damping_00)
-        ax.plot_surface(X, Y, iter[i,:,:,0,0], cmap=cm.coolwarm,
-                           linewidth=0, alpha=0.8)
-        ax.set_zlim(0, 400)
-        ax.scatter(SS_omega[opti[i,1]],damping_00[opti[i,0]],opti_iter[i], c='red')
-    '''
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_GS_direct_fused.py b/katoptron/CMAME/post_process/plate_GS_direct_fused.py
deleted file mode 100644
index ea15b89935bf1c7260d7b5b59a6115fb149ec9b8..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_GS_direct_fused.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-from katoptron.readers import *
-import os
-import fwk
-"""@package docstring
-This file is used to investigate the choice of prec parameters.
-"""
-
-
-def read_timer_all(n_cases, sub_cases, file_MC_base_dir):
-    querylines = ['Belos: Operation Op*x',
-                  'Belos: Operation Prec*x',
-                  'Belos: DGKS[2]: Orthogonalization',
-                  'Belos: DGKS[2]: Ortho (Inner Product)',
-                  'Belos: DGKS[2]: Ortho (Norm)',
-                  'Belos: DGKS[2]: Ortho (Update)',
-                  'Belos: PseudoBlockGmresSolMgr total solve time']
-    timer = np.zeros((n_cases, len(sub_cases), len(querylines)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            timer[i, j, :] = read_teuchos_timers(
-                input_MC_file_dir+'teuchos_timers.txt', querylines)
-    return timer
-
-
-def read_iter_all(n_cases, sub_cases, file_MC_base_dir):
-    iter = np.zeros((n_cases, len(sub_cases)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', 1)
-            iter[i][j] = iter_indices[-1]
-    return iter
-
-
-def read_timer_tensor(n_cases, sub_cases, file_MC_base_dir, sizes):
-    import numpy as np
-    timer = read_timer_all(n_cases, sub_cases, file_MC_base_dir)
-
-    n_0 = sizes[0]
-    n_1 = sizes[1]
-    n_2 = sizes[2]
-    n_3 = sizes[3]
-
-    timer_tensor = np.zeros(
-        (n_0, n_1, n_2, n_3, len(sub_cases), timer.shape[2]))
-
-    i = 0
-
-    for i_0 in range(0, n_0):
-        for i_1 in range(0, n_1):
-            for i_2 in range(0, n_2):
-                for i_3 in range(0, n_3):
-                    if i < timer.shape[0]:
-                        timer_tensor[i_0, i_1, i_2, i_3, :, :] = timer[i, :, :]
-                        i = i + 1
-                    else:
-                        return timer_tensor
-
-    return timer_tensor
-
-
-def read_iter_tensor(n_cases, sub_cases, file_MC_base_dir, sizes):
-    import numpy as np
-    iter = read_iter_all(n_cases, sub_cases, file_MC_base_dir)
-
-    n_0 = sizes[0]
-    n_1 = sizes[1]
-    n_2 = sizes[2]
-    n_3 = sizes[3]
-
-    iter_tensor = np.zeros((n_0, n_1, n_2, n_3, len(sub_cases)))
-
-    i = 0
-
-    for i_0 in range(0, n_0):
-        for i_1 in range(0, n_1):
-            for i_2 in range(0, n_2):
-                for i_3 in range(0, n_3):
-                    if i < iter.shape[0]:
-                        iter_tensor[i_0, i_1, i_2, i_3, :] = iter[i, :]
-                        i = i + 1
-                    else:
-                        return iter_tensor
-
-    return iter_tensor
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    test = 2
-    if test == 1:
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/gaussian/katoptron_CMAME_tests_plate_mean_prec_GS_direct/'
-        #file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_mean_prec_GS_direct/'
-        sub_cases = ['mean_case', 'ensemble_reduction_8']
-
-        GS_sweeps_00_min = 16
-        GS_sweeps_00_max = 41
-        delta_GS_sweeps_00 = 2
-
-        N_GS_sweeps_00 = int(
-            np.ceil(
-                ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-        # Damping has to be between 0 and 2
-        GS_damping_00_min = 1.75
-        GS_damping_00_max = 1.9
-        N_GS_damping_00 = 8
-
-        # Omega has to be between 0 and 1
-        SS_omega_min = 0.001
-        SS_omega_max = 0.5
-        N_SS_omega = 12
-
-        SS_damping_min = 1.
-        SS_damping_max = 1.2
-        N_SS_damping = 1
-
-        n_cases = 1248
-    elif test == 2:
-        file_MC_base_dir = file_dir + \
-            '/../../../workspace/katoptron_CMAME_tests_fused_plate_mean_prec_GS/'
-        sub_cases = ['mean_case', 'ensemble_reduction_8']
-
-        GS_sweeps_00_min = 1
-        GS_sweeps_00_max = 41
-        delta_GS_sweeps_00 = 1
-
-        N_GS_sweeps_00 = int(
-            np.ceil(
-                ((GS_sweeps_00_max - GS_sweeps_00_min * 1.) / delta_GS_sweeps_00)))
-
-        # Damping has to be between 0 and 2
-        GS_damping_00_min = 0.001
-        GS_damping_00_max = 1.999
-        N_GS_damping_00 = 50
-
-        # Omega has to be between 0 and 1
-        SS_omega_min = 1.
-        SS_omega_max = 1.2
-        N_SS_omega = 1
-
-        SS_damping_min = 1.
-        SS_damping_max = 1.2
-        N_SS_damping = 1
-
-        n_cases = 2000
-
-    iter = read_iter_tensor(n_cases, sub_cases, file_MC_base_dir, [
-                            N_GS_sweeps_00, N_GS_damping_00, N_SS_omega, N_SS_damping])
-    timer = read_timer_tensor(n_cases, sub_cases, file_MC_base_dir, [
-                              N_GS_sweeps_00, N_GS_damping_00, N_SS_omega, N_SS_damping])
-
-    sweeps_00 = np.arange(
-        GS_sweeps_00_min, GS_sweeps_00_max, delta_GS_sweeps_00)
-    damping_00 = np.linspace(
-        GS_damping_00_min, GS_damping_00_max, N_GS_damping_00)
-    SS_omega = np.linspace(SS_omega_min, SS_omega_max, N_SS_omega)
-    SS_damping = np.linspace(SS_damping_min, SS_damping_max, N_SS_damping)
-
-    from mpl_toolkits.mplot3d import Axes3D
-    import matplotlib.pyplot as plt
-    from matplotlib import cm
-
-    opti = np.zeros((N_GS_sweeps_00, 3), dtype=int)
-    opti_2 = np.zeros((N_GS_sweeps_00, 3), dtype=int)
-    opti_iter = np.zeros((N_GS_sweeps_00, 1), dtype=int)
-    opti_iter_2 = np.zeros((N_GS_sweeps_00, 1), dtype=int)
-    opti_iter_2_one = np.zeros((N_GS_sweeps_00, 1), dtype=int)
-    R = np.zeros((N_GS_sweeps_00, 1))
-    opti_time = np.zeros((N_GS_sweeps_00, 7))
-    opti_time_2 = np.zeros((N_GS_sweeps_00, 7))
-    opti_time_per_iter = np.zeros((N_GS_sweeps_00, 7))
-
-    #opti_iter_8 = np.array([500,469,382,338,280,255,254,239,218,213,204,197],dtype=int)
-
-    for i in range(0, N_GS_sweeps_00):
-        tmp = iter[i, :, :, :, 0]
-        tmp2 = iter[i, :, :, :, 1]
-        tmp3 = np.copy(tmp)
-        tmp3[tmp3 >= 1000] = 1
-        opti[i, :] = np.unravel_index(np.argmin(tmp, axis=None), tmp.shape)
-        opti_2[i, :] = np.unravel_index(np.argmin(tmp2, axis=None), tmp.shape)
-        print(str(sweeps_00[i]) + ' ' + str(damping_00[opti[i, 0]]
-                                            ) + ' ' + str(SS_omega[opti[i, 1]]))
-        print(str(sweeps_00[i]) + ' ' + str(damping_00[opti_2[i, 0]]
-                                            ) + ' ' + str(SS_omega[opti_2[i, 1]]))
-        opti_iter[i] = iter[i, opti[i, 0], opti[i, 1], 0, 0]
-        opti_iter_2[i] = iter[i, opti_2[i, 0], opti_2[i, 1], 0, 1]
-        opti_iter_2_one[i] = iter[i, opti_2[i, 0], opti_2[i, 1], 0, 0]
-        opti_time[i, :] = timer[i, opti[i, 0], opti[i, 1], 0, 0, :]
-        opti_time_2[i, :] = timer[i, opti_2[i, 0], opti_2[i, 1], 0, 1, :]
-        if opti_iter_2[i] == 1000:
-            R[i] = 10.
-        else:
-            R[i] = opti_iter_2[i]*1. / opti_iter[i]
-        for j in range(0, 7):
-            opti_time_per_iter[i, j] = (opti_time[i, j] / opti_iter[i])
-        #R[i] = opti_iter_8[i]*1. / opti_iter[i]
-
-    plt.subplot(411)
-    plt.plot(sweeps_00, opti_iter)
-    plt.grid()
-    plt.subplot(412)
-    plt.plot(sweeps_00, opti_iter)
-    plt.plot(sweeps_00, opti_iter_2)
-    plt.plot(sweeps_00, opti_iter_2_one)
-    plt.grid()
-    plt.subplot(413)
-    plt.plot(sweeps_00, R)
-    plt.grid()
-    plt.subplot(414)
-    plt.plot(sweeps_00, damping_00[opti[:, 0]])
-    plt.plot(sweeps_00, damping_00[opti_2[:, 0]])
-    plt.grid()
-    #print np.argmin(opti_time[:,6])
-    #print opti
-
-    tmp = np.zeros((N_GS_sweeps_00, 2))
-    tmp[:, 0] = sweeps_00[:]
-    tmp[:, 1] = np.reshape(opti_iter, (N_GS_sweeps_00,))
-    np.savetxt('opti_iter.txt', tmp)
-    tmp[:, 1] = np.reshape(opti_iter_2, (N_GS_sweeps_00,))
-    np.savetxt('opti_iter_2.txt', tmp)
-    tmp[:, 1] = np.reshape(opti_iter_2_one, (N_GS_sweeps_00,))
-    np.savetxt('opti_iter_2_one.txt', tmp)
-    '''
-    plt.figure()
-    for i in range(0,N_GS_sweeps_00):
-        plt.subplot(2,N_GS_sweeps_00,1+i)
-        plt.plot(damping_00,iter[i,:,opti[i,1],0,0])
-        plt.scatter(damping_00[opti[i,0]],opti_iter[i], c='red')
-        plt.subplot(2,N_GS_sweeps_00,1+i+N_GS_sweeps_00)
-        plt.plot(SS_omega,iter[i,opti[i,0],:,0,0])
-        plt.scatter(SS_omega[opti[i,1]],opti_iter[i], c='red')
-    
-    plt.figure()
-    plt.plot(sweeps_00,damping_00[opti[:,0]])
-    
-    plt.figure()
-    plt.plot(sweeps_00,SS_omega[opti[:,1]])
-
-    plt.figure()
-    for i in range(0,8):
-        plt.plot(damping_00,iter[0,:,i,0,0])
-    
-    plt.figure()
-    for i in range(0,8):
-        plt.plot(SS_omega,iter[0,i,:,0,0])
-
-    plt.figure()
-    for i in range(0,6):
-        plt.plot(SS_omega,iter[i,5,:,0,0])
-
-    for i in range(0,N_GS_sweeps_00):
-        fig = plt.figure()
-        ax = fig.add_subplot(111, projection='3d')
-        X, Y = np.meshgrid(SS_omega,damping_00)
-        ax.plot_surface(X, Y, iter[i,:,:,0,0], cmap=cm.coolwarm,
-                           linewidth=0, alpha=0.8)
-        ax.set_zlim(0, 400)
-        ax.scatter(SS_omega[opti[i,1]],damping_00[opti[i,0]],opti_iter[i], c='red')
-    '''
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC.py b/katoptron/CMAME/post_process/plate_MC.py
deleted file mode 100644
index e30d13413bd3d5c76d42c100e23c37a4f6faf2e9..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC.py
+++ /dev/null
@@ -1,357 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-"""@package docstring
-This file is used to loop over cases and samples and plot their mechanical properties and solution fields.
-"""
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-from katoptron.CMAME.model import Compute_QoIs
-
-
-def plot_2D_mesh(pts, quad, ax):
-    """
-    This function plots a 2D quad mesh on a given matplotlib axis
-    """
-    import matplotlib.pyplot as plt
-    for i in range(0, quad.shape[0]):
-        x = np.zeros((quad.shape[1] + 1, ))
-        y = np.zeros((quad.shape[1] + 1, ))
-        for j in range(0, quad.shape[1]):
-            x[j] = pts[quad[i, j], 0]
-            y[j] = pts[quad[i, j], 1]
-        x[-1] = pts[quad[i, 0], 0]
-        y[-1] = pts[quad[i, 0], 1]
-        ax.plot(x, y, '--k', linewidth=0.5)
-
-
-def cut_of_one_case(case_id,
-                    ensemble_size,
-                    n_samples,
-                    v_min,
-                    v_max,
-                    file_MC_mean,
-                    file_MC_base_dir,
-                    at_point=False):
-    """
-    This function loops over the samples of a given test case and plot them
-    """
-    import matplotlib.pyplot as plt
-
-    pts, tri, vals = cut_plate(file_MC_mean, at_point)
-    pts_2, quad = extract_quad_msh(file_MC_mean)
-
-    x = pts[:, 0]
-    y = pts[:, 1]
-
-    QoIs = np.zeros((4, n_samples))
-
-    plot_one_sampel(x, y, tri, vals, pts_2, quad, at_point)
-    plt.savefig('mean_case.png', dpi=400)
-
-    file_MC_base_dir_tmp = file_MC_base_dir + str(case_id) + '/' + str(
-        ensemble_size) + '/'
-
-    directory = 'case_' + str(case_id)
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-        os.makedirs(directory + '/sample')
-        os.makedirs(directory + '/abs')
-        os.makedirs(directory + '/rel')
-
-    for i in range(0, n_samples):
-        i_ensemble = (i // ensemble_size)
-        i_sample = np.mod(i, ensemble_size)
-        input_MC_file_dir = file_MC_base_dir_tmp + str(i_ensemble) + '/'
-        mshName_sample = input_MC_file_dir + 'plate_fused_ast1_s' + str(
-            i_sample) + '_0'
-
-        QoIs[:, i] = Compute_QoIs(mshName_sample)
-
-        pts_s, tri_s, vals_s = cut_plate(mshName_sample, at_point)
-
-        plot_one_sampel(x, y, tri, vals_s, pts_2, quad, at_point)
-        plt.savefig(directory + '/sample/' + str(i) + '.png', dpi=400)
-        plot_diff_rel(x,
-                      y,
-                      tri,
-                      vals,
-                      vals_s,
-                      pts_2,
-                      quad,
-                      v_min=v_min,
-                      v_max=v_max,
-                      at_point=at_point)
-        plt.savefig(directory + '/rel/' + str(i) + '.png', dpi=400)
-        plot_diff_abs(x, y, tri, vals, vals_s, pts_2, quad, at_point)
-        plt.savefig(directory + '/abs/' + str(i) + '.png', dpi=400)
-        plt.close('all')
-    for i in range(0, 4):
-        plt.figure()
-        plt.hist(QoIs[i, :], bins=80, density=True)
-        plt.xlabel('[MPa]')
-        plt.savefig('QoI_' + str(i) + '_case_' + str(case_id) + '.png',
-                    dpi=400)
-
-        plt.close('all')
-
-
-def extract_quad_msh(mshName):
-    """
-    This function extracts the 2D quad mesh out of a hexahedron mesh
-    """
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    rdata = reader.reader.GetOutput()
-
-    _pts = rdata.GetPoints()
-    pts = np.zeros((_pts.GetNumberOfPoints(), 2))
-    pts_indices = np.zeros((_pts.GetNumberOfPoints(), ), dtype=int)
-    for i in range(0, pts.shape[0]):
-        if _pts.GetPoint(i)[2] <= 0.01:
-            for j in range(0, 2):
-                pts[i][j] = _pts.GetPoint(i)[j]
-            pts_indices[i] = 1
-    n_elems = rdata.GetNumberOfCells()
-    quad = []
-    for i in range(0, n_elems):
-        elem = rdata.GetCell(i)
-        for j in range(0, 6):
-            face = elem.GetFace(j)
-            points_id = np.zeros((4, ), dtype=int)
-            good_face = True
-            for k in range(0, 4):
-                points_id[k] = face.GetPointId(k)
-                if pts_indices[points_id[k]] != 1:
-                    good_face = False
-                    break
-            if good_face:
-                if len(quad) == 0:
-                    quad = points_id.reshape((1, 4))
-                else:
-                    quad = np.append(quad, points_id.reshape((1, 4)), axis=0)
-    return pts, quad
-
-
-def cut_plate(mshName, at_point=False):
-    """
-    This function cuts the vtk files in the middle and extracts both point
-    and element data.
-    """
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    cutter = vtkC.Cutter(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, [0., 0., 0.5], [0., 0., 1.], tag_name='volume_id')
-    if at_point:
-        pts, tri, vals = cutter.extract(c_output,
-                                        3,
-                                        ['u', 'x', 'y', 'z', 'G', 'von Mises'],
-                                        atPoint=True)
-    else:
-        pts, tri, vals = cutter.extract(c_output,
-                                        3, ['u', 'x', 'y', 'z'],
-                                        atPoint=True)
-        pts_2, tri_2, vals_2 = cutter.extract(c_output,
-                                              3, ['G', 'von Mises'],
-                                              atPoint=False)
-        vals.update(vals_2)
-
-    return pts, tri, vals
-
-
-def plot_2D_cut_values_at_node(x, y, tri, value, n_levels=16):
-    """
-    This function plots data at node.
-    """
-    import matplotlib.pyplot as plt
-    value = value.reshape((len(x), ))
-    if max(value) - min(value) > 0:
-        levels = np.linspace(min(value), max(value), n_levels)
-        plt.set_cmap('coolwarm')
-        plt.tricontour(x,
-                       y,
-                       tri,
-                       value,
-                       levels,
-                       linestyles='-',
-                       colors='black',
-                       linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, value, levels)
-    else:
-        axtri = plt.tricontourf(x, y, tri, value)
-    plt.gca().set_aspect('equal')
-    return axtri
-
-
-def plot_2D_cut_values_at_elem(x,
-                               y,
-                               tri_1,
-                               value,
-                               v_min=0,
-                               v_max=0,
-                               n_levels=16,
-                               shading=False):
-    """
-    This function plots data at element.
-    """
-    import matplotlib.pyplot as plt
-
-    value = value.reshape((tri_1.shape[0], ))
-    if v_min == v_max:
-        v_min = min(value)
-        v_max = max(value)
-
-    levels = np.linspace(v_min, v_max, n_levels)
-    plt.set_cmap('coolwarm')
-    if shading:
-        axtri = plt.tripcolor(x, y, tri_1, value, shading='gouraud')
-    else:
-        axtri = plt.tripcolor(x, y, tri_1, value, levels)
-    plt.gca().set_aspect('equal')
-    return axtri
-
-
-def plot_one_sampel(x, y, tri, vals_s, pts_2, quad, at_point=False):
-    """
-    This function plots data of a given sample.
-    """
-    import matplotlib.pyplot as plt
-
-    fig = plt.figure(figsize=(15, 4))
-
-    ax = plt.subplot(131)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x, y, tri, vals_s['G'])
-        plot_2D_mesh(pts_2, quad, ax)
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['G'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.title('G')
-
-    plt.subplot(132)
-    tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['y'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal', format='%.0e')
-    plt.title('y')
-
-    ax = plt.subplot(133)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x, y, tri, vals_s['von Mises'])
-        plot_2D_mesh(pts_2, quad, ax)
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['von Mises'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.title('von Mises')
-
-
-def plot_diff_abs(x, y, tri, vals, vals_s, pts_2, quad, at_point=False):
-    """
-    This function plots the difference between data of a given sample and the mean sample.
-    """
-    import matplotlib.pyplot as plt
-
-    fig = plt.figure(figsize=(15, 4))
-
-    plt.subplot(131)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x, y, tri, vals_s['G'] - vals['G'])
-        plot_2D_mesh(pts_2, quad, plt.gca())
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['G'] - vals['G'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.title('delta G')
-
-    plt.subplot(132)
-    tmp = plot_2D_cut_values_at_node(x, y, tri, vals_s['y'] - vals['y'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal', format='%.0e')
-    plt.title('delta y')
-
-    plt.subplot(133)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(
-            x, y, tri, vals_s['von Mises'] - vals['von Mises'])
-        plot_2D_mesh(pts_2, quad, plt.gca())
-    else:
-        tmp = plot_2D_cut_values_at_node(
-            x, y, tri, vals_s['von Mises'] - vals['von Mises'])
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.title('delta von Mises')
-
-
-def plot_diff_rel(x,
-                  y,
-                  tri,
-                  vals,
-                  vals_s,
-                  pts_2,
-                  quad,
-                  v_min=-10,
-                  v_max=10,
-                  at_point=False):
-    """
-    This function plots the relative difference between data of a given sample and the mean sample.
-    """
-    import matplotlib.pyplot as plt
-
-    fig = plt.figure(figsize=(15, 4))
-
-    diff_G = vals_s['G'] - vals['G']
-    diff_G_rel = (100 * diff_G / vals['G'])
-
-    plt.subplot(121)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x,
-                                         y,
-                                         tri,
-                                         diff_G_rel,
-                                         v_min=v_min,
-                                         v_max=v_max)
-        plot_2D_mesh(pts_2, quad, plt.gca())
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, diff_G_rel)
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.clim(v_min, v_max)
-    plt.title('delta G relative')
-
-    diff_vM = vals_s['von Mises'] - vals['von Mises']
-    diff_vM_rel = (100 * diff_vM / vals['von Mises'])
-
-    plt.subplot(122)
-    if not at_point:
-        tmp = plot_2D_cut_values_at_elem(x,
-                                         y,
-                                         tri,
-                                         diff_vM_rel,
-                                         v_min=v_min,
-                                         v_max=v_max)
-        plot_2D_mesh(pts_2, quad, plt.gca())
-    else:
-        tmp = plot_2D_cut_values_at_node(x, y, tri, diff_vM_rel)
-    fig.colorbar(tmp, ax=plt.gca(), orientation='horizontal')
-    plt.clim(v_min, v_max)
-    plt.title('delta von Mises relative')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-
-    file_MC_mean = file_dir + \
-        '/../../../workspace/katoptron_CMAME_tests_plate/plate_fused_ast1_s0_0'
-
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/gaussian/katoptron_CMAME_tests_plate_MC_GS_all_cases/case_'
-    n_samples = 96
-    for i in range(1, 7):
-        cut_of_one_case(i, 32, n_samples, -10, 10, file_MC_mean,
-                        file_MC_base_dir, False)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_speedup.py b/katoptron/CMAME/post_process/plate_MC_MG_speedup.py
deleted file mode 100644
index f7a178a3ca80379d8df101a0d60eddcb409a2c44..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_speedup.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-from katoptron.speedup import *
-
-
-def speedup_of_one_case(case_id, n_samples, ensemble_sizes, quantiles,
-                        querylines, use_waves_timers, use_teuchos_timers,
-                        per_iteration):
-    import matplotlib.pyplot as plt
-
-    case_id = str(case_id)
-    file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_' + case_id
-    #'/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases 2/case_' + case_id
-    # try:
-    speedup = compute_speedup(n_samples, ensemble_sizes, file_MC_base_dir,
-                              querylines, per_iteration, quantiles,
-                              use_waves_timers, use_teuchos_timers, False)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)),
-                 'case_' + case_id, querylines, per_iteration)
-    plt.savefig('case_' + case_id + '.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, 'case_' + case_id)
-
-    R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir, quantiles,
-                  False)
-    save_R(R, 'case_' + case_id)
-    # except:
-    #    print '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_case_' + case_id + '  has not all the files'
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 64
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0'
-    ]
-    use_waves_timers = np.array([0, 7, 8], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True
-    ]
-
-    for i in range(1, 7):
-        speedup_of_one_case(i, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers,
-                            per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_speedup_200_ER.py b/katoptron/CMAME/post_process/plate_MC_MG_speedup_200_ER.py
deleted file mode 100644
index fd58d82a05546b81e5f52759aefb28f4f9198497..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_speedup_200_ER.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-from katoptron.speedup import *
-
-
-def speedup_of_one_case(case_id, n_samples, ensemble_sizes, quantiles,
-                        querylines, use_waves_timers, use_teuchos_timers,
-                        per_iteration):
-    import matplotlib.pyplot as plt
-
-    case_id = str(case_id)
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_200/case_' + case_id
-    #'/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases 2/case_' + case_id
-    # try:
-    speedup = compute_speedup(n_samples, ensemble_sizes, file_MC_base_dir,
-                              querylines, per_iteration, quantiles,
-                              use_waves_timers, use_teuchos_timers, True)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)),
-                 'case_' + case_id, querylines, per_iteration)
-    plt.savefig('case_' + case_id + '.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, 'case_' + case_id)
-
-    R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir, quantiles, True)
-    save_R(R, 'case_' + case_id)
-    # except:
-    #    print '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_case_' + case_id + '  has not all the files'
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 32
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0'
-    ]
-    use_waves_timers = np.array([0, 7, 8], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True
-    ]
-
-    for i in range(1, 2):
-        speedup_of_one_case(i, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers,
-                            per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_speedup_ER.py b/katoptron/CMAME/post_process/plate_MC_MG_speedup_ER.py
deleted file mode 100644
index 5356e91aeb3a6e880f3c47bd11e47b10814b89a0..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_speedup_ER.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-from katoptron.speedup import *
-
-
-def speedup_of_one_case(case_id, n_samples, ensemble_sizes, quantiles,
-                        querylines, use_waves_timers, use_teuchos_timers,
-                        per_iteration):
-    import matplotlib.pyplot as plt
-
-    case_id = str(case_id)
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_ER_2/case_' + case_id
-    #'/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases 2/case_' + case_id
-    # try:
-    speedup = compute_speedup(n_samples, ensemble_sizes, file_MC_base_dir,
-                              querylines, per_iteration, quantiles,
-                              use_waves_timers, use_teuchos_timers, True)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)),
-                 'case_' + case_id, querylines, per_iteration)
-    plt.savefig('case_' + case_id + '.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, 'case_' + case_id)
-
-    R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir, quantiles, True)
-    save_R(R, 'case_' + case_id)
-    # except:
-    #    print '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_case_' + case_id + '  has not all the files'
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 64
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0'
-    ]
-    use_waves_timers = np.array([0, 7, 8], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True
-    ]
-
-    for i in range(1, 7):
-        speedup_of_one_case(i, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers,
-                            per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_speedup_NER.py b/katoptron/CMAME/post_process/plate_MC_MG_speedup_NER.py
deleted file mode 100644
index b96fb608ace8440ffd5c4d65b97f62725f52f19f..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_speedup_NER.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-from katoptron.speedup import *
-
-
-def speedup_of_one_case(case_id, n_samples, ensemble_sizes, quantiles,
-                        querylines, use_waves_timers, use_teuchos_timers,
-                        per_iteration):
-    import matplotlib.pyplot as plt
-
-    case_id = str(case_id)
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_NER_2/case_' + case_id
-    #'/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases 2/case_' + case_id
-    # try:
-    speedup = compute_speedup(n_samples, ensemble_sizes, file_MC_base_dir,
-                              querylines, per_iteration, quantiles,
-                              use_waves_timers, use_teuchos_timers, False)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)),
-                 'case_' + case_id, querylines, per_iteration)
-    plt.savefig('case_' + case_id + '.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, 'case_' + case_id)
-
-    R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir, quantiles,
-                  False)
-    save_R(R, 'case_' + case_id)
-    # except:
-    #    print '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_case_' + case_id + '  has not all the files'
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 64
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0'
-    ]
-    use_waves_timers = np.array([0, 7, 8], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True
-    ]
-
-    for i in range(1, 7):
-        speedup_of_one_case(i, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers,
-                            per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_total.py b/katoptron/CMAME/post_process/plate_MC_MG_total.py
deleted file mode 100644
index 213eaf0c7cb49f1c7a5200820be257aa2befe376..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_total.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.speedup import *
-
-
-def CPU_time_per_one_case(case_id, n_samples, ensemble_sizes, quantiles,
-                          querylines, use_waves_timers, use_teuchos_timers,
-                          per_iteration):
-    import matplotlib.pyplot as plt
-
-    case_id = str(case_id)
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_NER_2/case_' + case_id
-    timers = read_timers_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                            file_MC_base_dir, querylines,
-                                            use_waves_timers,
-                                            use_teuchos_timers)
-
-    print(timers.shape)
-
-    for i in range(0, timers.shape[2]):
-        print(querylines[i])
-        string = ''
-        for e in range(0, timers.shape[0]):
-            string = string + str(
-                round(np.sum(((timers[e, :, i] / ensemble_sizes[e]) / n_samples)),
-                      3)) + ' & '
-        print(string)
-        print(' ')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 64
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: PseudoBlockGmresSolMgr total solve time',
-        'MueLu: Hierarchy: Setup (total)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0',
-        'compute contact matrices', 'compute block 00 matrix', 'graph'
-    ]
-    use_waves_timers = np.array([0, 7, 8, 20, 21, 22], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True
-    ]
-
-    for i in range(6, 7):
-        CPU_time_per_one_case(i, n_samples, ensemble_sizes, quantiles,
-                              querylines, use_waves_timers, use_teuchos_timers,
-                              per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_total_2.py b/katoptron/CMAME/post_process/plate_MC_MG_total_2.py
deleted file mode 100644
index 3d62c68ed5340414912f7343b9a8fa635e688280..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_total_2.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.speedup import *
-
-
-def CPU_time_per_one_case(case_id, n_samples, ensemble_sizes, quantiles,
-                          querylines, use_waves_timers, use_teuchos_timers,
-                          per_iteration):
-    import matplotlib.pyplot as plt
-
-    case_id = str(case_id)
-    file_MC_base_dir = '/Volumes/HD_SEAGATE/CMAME/Plate/MC/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_' + case_id
-    timers = read_timers_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                            file_MC_base_dir, querylines,
-                                            use_waves_timers,
-                                            use_teuchos_timers)
-
-    print(timers.shape)
-
-    for i in range(0, timers.shape[2]):
-        print(querylines[i])
-        string = ''
-        for e in range(0, timers.shape[0]):
-            string = string + str(
-                round(np.sum((timers[e, :, i] / ensemble_sizes[e])), 3)) + ' & '
-        print(string)
-        print(' ')
-
-        for e in range(0, timers.shape[0]):
-            tmp = timers[0, :, 7] - timers[0, :, 8] - timers[0, :, 0]
-            np.savez('total_s' + str(ensemble_sizes[e]), time=tmp)
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 6400
-    ensemble_sizes = [1]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'domain', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: PseudoBlockGmresSolMgr total solve time',
-        'MueLu: Hierarchy: Setup (total)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0',
-        'compute contact matrices', 'compute block 00 matrix', 'dp'
-    ]
-    use_waves_timers = np.array([0, 7, 8, 20, 21, 22], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True
-    ]
-
-    for i in range(6, 7):
-        CPU_time_per_one_case(i, n_samples, ensemble_sizes, quantiles,
-                              querylines, use_waves_timers, use_teuchos_timers,
-                              per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_MG_total_2_analysis.py b/katoptron/CMAME/post_process/plate_MC_MG_total_2_analysis.py
deleted file mode 100644
index af77082d2b24c494bc814fb1b9aaf9109d81e7fc..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_MG_total_2_analysis.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.speedup import *
-import os
-import matplotlib2tikz
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-
-    current_dir = os.getcwd()
-
-    npzfile = np.load(
-        current_dir +
-        '/../katoptron_CMAME_tests_post_process_plate_MC_MG_total_2/total_s1.npz'
-    )
-    time_s1 = npzfile['time']
-    npzfile = np.load(
-        current_dir +
-        '/../katoptron_CMAME_tests_post_process_plate_MC_MG_total_2/total_s32.npz'
-    )
-    time_s32 = npzfile['time']
-
-    ensemble_size = 32
-
-    cum_sp = np.zeros((200, ))
-    each_sp = np.zeros((200, ))
-
-    time_s1_s32 = np.zeros((200, ))
-    time_s32_s32 = np.zeros((200, ))
-
-    cum_time_s1 = 0.
-    cum_time_s32 = 0.
-
-    for i in range(0, 200):
-        current_s1 = np.sum(time_s1[i * ensemble_size:(i + 1) * ensemble_size])
-        current_s32 = time_s32[i * ensemble_size]
-
-        time_s1_s32[i] = current_s1
-        time_s32_s32[i] = current_s32
-
-        cum_time_s1 = cum_time_s1 + current_s1
-        cum_time_s32 = cum_time_s32 + current_s32
-
-        each_sp[i] = (current_s1 / current_s32)
-        cum_sp[i] = (cum_time_s1 / cum_time_s32)
-
-    plt.figure()
-    plt.plot(time_s1)
-
-    plt.figure()
-    plt.plot(time_s32)
-
-    print(np.sum(time_s1_s32))
-    print(np.sum(time_s32_s32))
-
-    plt.figure()
-    plt.plot(time_s1_s32)
-    plt.plot(time_s32_s32)
-    plt.figure()
-    plt.plot(each_sp)
-    plt.figure()
-    plt.plot(cum_sp)
-    matplotlib2tikz.save("speedup.tex")
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_QoI.py b/katoptron/CMAME/post_process/plate_MC_QoI.py
deleted file mode 100644
index 6cb7730046505c7eeb5bdeb69a7314a9ee7ad7e0..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_QoI.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-"""@package docstring
-This file is used to loop over cases and samples and plot their mechanical properties and solution fields.
-"""
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-from katoptron.CMAME.model import Compute_QoIs
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-
-    file_MC_base_dir = '/Volumes/HD_SEAGATE/CMAME/Plate/MC/katoptron_CMAME_tests_plate_MC_MG_all_cases_2/case_6/'
-    n_samples = 6400
-
-    QoIs = np.zeros((4, n_samples))
-
-    ensemble_size = 32
-
-    for i in range(0, n_samples):
-        i_ensemble = (i // ensemble_size)
-        i_sample = np.mod(i, ensemble_size)
-        input_MC_file_dir = file_MC_base_dir + str(ensemble_size) + '/' + str(
-            i_ensemble) + '/'
-        mshName_sample = input_MC_file_dir + 'plate_fused_ast1_s' + str(
-            i_sample) + '_0'
-
-        QoIs[:, i] = Compute_QoIs(mshName_sample)
-
-    print(QoIs)
-
-    np.savez('qois_s' + str(ensemble_size), QoIs=QoIs)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_QoI_analysis.py b/katoptron/CMAME/post_process/plate_MC_QoI_analysis.py
deleted file mode 100644
index 275aa2b31ec702be0e4c02eb0bdf7dba0c4c70c5..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_QoI_analysis.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-
-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-"""@package docstring
-This file is used to loop over cases and samples and plot their mechanical properties and solution fields.
-"""
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-from katoptron.CMAME.model import Compute_QoIs
-import matplotlib2tikz
-from scipy import stats
-
-
-def write_tikz_hist(filename, bins, n):
-    f = open(filename, 'w')
-    print('\\path [fill=c2, fill opacity=0.5] (axis cs:' + str(
-        bins[0]) + ', 0)', file=f)
-    for i in range(0, len(n)):
-        print('--(axis cs:' + str(bins[i]) + ', ' + str(n[i]) + ')', file=f)
-        print('--(axis cs:' + str(bins[i + 1]) + ', ' + str(n[i]) + ')', file=f)
-    print('--(axis cs:' + str(bins[-1]) + ', 0)', file=f)
-    print('--cycle;', file=f)
-    f.closed
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-
-    current_dir = os.getcwd()
-
-    npzfile = np.load(
-        current_dir +
-        '/../katoptron_CMAME_tests_post_process_plate_MC_QoI/qois_s1.npz')
-    QoIs = npzfile['QoIs']
-
-    n, bins, patches = plt.hist(QoIs[0, :],
-                                100,
-                                density=True,
-                                facecolor='g',
-                                alpha=0.75)
-    write_tikz_hist('QoI_s1.tex', bins, n)
-
-    kde = stats.gaussian_kde(QoIs[0, :])
-
-    x = np.linspace(1500., 5000., 100)
-
-    p = kde(x)
-
-    plt.figure()
-    plt.plot(x, p)
-    matplotlib2tikz.save("kde_s1.tex")
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_convergence.py b/katoptron/CMAME/post_process/plate_MC_convergence.py
deleted file mode 100644
index 08d16027f4635ad625040a517028349923cba442..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_convergence.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.readers import *
-
-
-def read_iter_all_ensemble_sizes(n_samples, ensemble_sizes, file_MC_base_dir, reduction=False):
-    iter = np.zeros((len(ensemble_sizes), n_samples))
-    for i in range(0, len(ensemble_sizes)):
-        file_MC_base_dir_2 = file_MC_base_dir + \
-            '/' + str(ensemble_sizes[i])+'/'
-        for j in range(0, int((n_samples // ensemble_sizes[i]))):
-            input_MC_file_dir = file_MC_base_dir_2 + str(j)+'/'
-            es = ensemble_sizes[i]
-            if reduction:
-                es = 1
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', es)
-            for k in range(0, ensemble_sizes[i]):
-                iter[i][j*ensemble_sizes[i]+k] = iter_indices[-1]
-    return iter
-
-
-def plot_iter_all_ensemble_sizes(n_samples, iter):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    plt.plot(list(range(0, n_samples)),
-             iter[0][:], 'bo', markersize=8, zorder=1)
-    plt.plot(list(range(0, n_samples)),
-             iter[1][:], 'ro', markersize=6, zorder=2)
-    plt.plot(list(range(0, n_samples)),
-             iter[2][:], 'go', markersize=4, zorder=2)
-    plt.plot(list(range(0, n_samples)),
-             iter[3][:], 'ko', markersize=2, zorder=3)
-    plt.xlabel('sample')
-    plt.ylabel('Number of iterations to converge')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 960
-    ensemble_sizes = [1, 8, 16, 32]
-    for case_id in range(1, 5):
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_GS_case_' + \
-            str(case_id)+'_ER'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.savefig('GS_case_'+str(case_id)+'_ER.png', dpi=400)
-            np.savetxt('GS_case_'+str(case_id)+'_ER.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_direct_case_' + \
-            str(case_id)+'_ER'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.savefig('direct_case_'+str(case_id)+'_ER.png', dpi=400)
-            np.savetxt('direct_case_'+str(case_id) +
-                       '_ER.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_GS_case_' + \
-            str(case_id)+'_NER'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.savefig('GS_case_'+str(case_id)+'_NER.png', dpi=400)
-            np.savetxt('GS_case_'+str(case_id)+'_NER.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_direct_case_' + \
-            str(case_id)+'_NER'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.savefig('direct_case_'+str(case_id)+'_NER.png', dpi=400)
-            np.savetxt('direct_case_'+str(case_id) +
-                       '_NER.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_convergence_2.py b/katoptron/CMAME/post_process/plate_MC_convergence_2.py
deleted file mode 100644
index b0eba9e452b219b6928f50d2c18d122fbffaa3a6..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_convergence_2.py
+++ /dev/null
@@ -1,573 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.readers import *
-
-
-def read_iter_all_ensemble_sizes(n_samples, ensemble_sizes, file_MC_base_dir, reduction=False):
-    iter = np.zeros((len(ensemble_sizes), n_samples))
-    for i in range(0, len(ensemble_sizes)):
-        file_MC_base_dir_2 = file_MC_base_dir + \
-            '/' + str(ensemble_sizes[i])+'/'
-        for j in range(0, int((n_samples // ensemble_sizes[i]))):
-            input_MC_file_dir = file_MC_base_dir_2 + str(j)+'/'
-            es = ensemble_sizes[i]
-            if reduction:
-                es = 1
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', es)
-            for k in range(0, ensemble_sizes[i]):
-                iter[i][j*ensemble_sizes[i]+k] = iter_indices[-1]
-    return iter
-
-
-def plot_iter_all_ensemble_sizes(n_samples, iter, print_all=False):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    plt.plot(list(range(0, n_samples)),
-             iter[0][:], 'bo', markersize=8, zorder=1)
-    ensemble_size = 8
-    for i in range(0, int(np.ceil(n_samples*1./ensemble_size))):
-        plt.plot(list(range(ensemble_size*i, ensemble_size*(i+1))),
-                 iter[1][ensemble_size*i:ensemble_size*(i+1)], '-ro', linewidth=3, markersize=6, zorder=2)
-    if print_all:
-        ensemble_size = 16
-        for i in range(0, int(np.ceil(n_samples*1./ensemble_size))):
-            plt.plot(list(range(ensemble_size*i, ensemble_size*(i+1))),
-                     iter[2][ensemble_size*i:ensemble_size*(i+1)], '-go', linewidth=2, markersize=4, zorder=2)
-        ensemble_size = 32
-        for i in range(0, int(np.ceil(n_samples*1./ensemble_size))):
-            plt.plot(list(range(ensemble_size*i, ensemble_size*(i+1))),
-                     iter[3][ensemble_size*i:ensemble_size*(i+1)], '-ko', linewidth=1, markersize=2, zorder=3)
-    plt.xlabel('sample')
-    plt.ylabel('Number of iterations to converge')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 8
-    ensemble_sizes = [1, 8]
-    for case_id in range(1, 2):
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/tests_plate_vd/katoptron_CMAME_tests_plate_vd_Direct_3'
-        iter = read_iter_all_ensemble_sizes(
-            n_samples, ensemble_sizes, file_MC_base_dir, True)
-        plot_iter_all_ensemble_sizes(n_samples, iter)
-        plt.savefig('Direct_3.png', dpi=400)
-        np.savetxt('Direct_3.txt', iter, delimiter=' ')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/tests_plate_vd/katoptron_CMAME_tests_plate_vd_Direct_200'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.savefig('Direct_200.png', dpi=400)
-            np.savetxt('Direct_200.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/tests_plate_vd/katoptron_CMAME_tests_plate_vd_GS_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_3.png', dpi=400)
-            np.savetxt('GS_3.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/tests_plate_vd/katoptron_CMAME_tests_plate_vd_GS_200'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_200.png', dpi=400)
-            np.savetxt('GS_200.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS/katoptron_CMAME_tests_plate_vd_GS_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_3_005.png', dpi=400)
-            np.savetxt('GS_3_005.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS/katoptron_CMAME_tests_plate_vd_GS_200'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_200_005.png', dpi=400)
-            np.savetxt('GS_200_005.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS_2/katoptron_CMAME_tests_plate_vd_GS_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_3_0005.png', dpi=400)
-            np.savetxt('GS_3_0005.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS_2/katoptron_CMAME_tests_plate_vd_GS_200'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_200_0005.png', dpi=400)
-            np.savetxt('GS_200_0005.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS_3/katoptron_CMAME_tests_plate_vd_GS_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_3_0005_group.png', dpi=400)
-            np.savetxt('GS_3_0005_group.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS_3/katoptron_CMAME_tests_plate_vd_GS_200'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_200_0005_group.png', dpi=400)
-            np.savetxt('GS_200_0005_group.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS_3_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter)
-            plt.grid()
-            plt.ylim([0, 850])
-            plt.savefig('GS_3_no_gamma.png', dpi=400)
-            np.savetxt('GS_3_no_gamma.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        n_samples = 32
-        ensemble_sizes = [1, 8, 16, 32]
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_fused_plate_MC_GS_all_cases/case_1'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([40, 100])
-            plt.savefig('SPD_case_1_MG.png', dpi=400)
-            np.savetxt('SPD_case_1_MG.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_fused_plate_MC_GS_all_cases/case_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([40, 100])
-            plt.savefig('SPD_case_2_MG.png', dpi=400)
-            np.savetxt('SPD_case_2_MG.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_fused_plate_MC_GS_all_cases/case_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([0, 150])
-            plt.savefig('SPD_case_3_MG.png', dpi=400)
-            np.savetxt('SPD_case_3_MG.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_fused_plate_MC_GS_all_cases/case_4'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([0, 150])
-            plt.savefig('SPD_case_4_MG.png', dpi=400)
-            np.savetxt('SPD_case_4_MG.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_fused_plate_MC_GS_all_cases/case_5'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([0, 150])
-            plt.savefig('SPD_case_5_MG.png', dpi=400)
-            np.savetxt('SPD_case_5_MG.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/fused/katoptron_CMAME_tests_fused_plate_MC_GS_all_cases/case_6'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([0, 150])
-            plt.savefig('SPD_case_6_MG.png', dpi=400)
-            np.savetxt('SPD_case_6_MG.txt', iter, delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-        n_samples = 896
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_1'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([75, 150])
-            plt.savefig('MC_MG_case_1.png', dpi=400)
-            np.savetxt('MC_MG_case_1.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([75, 150])
-            plt.savefig('MC_MG_case_2.png', dpi=400)
-            np.savetxt('MC_MG_case_2.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([75, 150])
-            plt.savefig('MC_MG_case_3.png', dpi=400)
-            np.savetxt('MC_MG_case_3.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_4'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([75, 150])
-            plt.savefig('MC_MG_case_4.png', dpi=400)
-            np.savetxt('MC_MG_case_4.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_5'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([75, 150])
-            plt.savefig('MC_MG_case_5.png', dpi=400)
-            np.savetxt('MC_MG_case_5.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/MG/all/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_6'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([75, 150])
-            plt.savefig('MC_MG_case_6.png', dpi=400)
-            np.savetxt('MC_MG_case_6.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        n_samples = 96
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_Juelich_tests_M1_assembly_fused_MC_NER_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([190, 210])
-            plt.savefig('Juelich_NER.png', dpi=400)
-            np.savetxt('Juelich_NER.txt', np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_Juelich_tests_M1_assembly_fused_MC_ER_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([190, 310])
-            plt.savefig('Juelich_ER.png', dpi=400)
-            np.savetxt('Juelich_ER.txt', np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-        n_samples = 64
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_1'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 150])
-            plt.savefig('MC_MG_case_1_2.png', dpi=400)
-            np.savetxt('MC_MG_case_1_2.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases/case_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 150])
-            plt.savefig('MC_MG_case_2_2.png', dpi=400)
-            np.savetxt('MC_MG_case_2_2.txt', np.transpose(iter), delimiter=' ')
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_ER/case_1'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 400])
-            plt.savefig('MC_MG_case_1_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_1_ER.txt',
-                       np.transpose(iter), delimiter=' ')
-            print('MC_MG_case_1_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_ER/case_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 400])
-            plt.savefig('MC_MG_case_2_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_2_ER.txt',
-                       np.transpose(iter), delimiter=' ')
-            print('MC_MG_case_2_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_ER/case_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 400])
-            plt.savefig('MC_MG_case_3_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_3_ER.txt',
-                       np.transpose(iter), delimiter=' ')
-            print('MC_MG_case_3_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_ER/case_4'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 400])
-            plt.savefig('MC_MG_case_4_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_4_ER.txt',
-                       np.transpose(iter), delimiter=' ')
-            print('MC_MG_case_4_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_ER/case_5'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 400])
-            plt.savefig('MC_MG_case_5_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_5_ER.txt',
-                       np.transpose(iter), delimiter=' ')
-            print('MC_MG_case_5_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_ER/case_6'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([50, 400])
-            plt.savefig('MC_MG_case_6_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_6_ER.txt',
-                       np.transpose(iter), delimiter=' ')
-            print('MC_MG_case_6_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_1'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([100, 150])
-            plt.savefig('MC_MG_case_1_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_1_NER.txt',
-                       np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_2'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([100, 150])
-            plt.savefig('MC_MG_case_2_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_2_NER.txt',
-                       np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_3'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([100, 150])
-            plt.savefig('MC_MG_case_3_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_3_NER.txt',
-                       np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_4'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([100, 150])
-            plt.savefig('MC_MG_case_4_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_4_NER.txt',
-                       np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_5'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([100, 150])
-            plt.savefig('MC_MG_case_5_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_5_NER.txt',
-                       np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-        file_MC_base_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_4_NER/case_6'
-        try:
-            iter = read_iter_all_ensemble_sizes(
-                n_samples, ensemble_sizes, file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            plt.grid()
-            plt.ylim([100, 150])
-            plt.savefig('MC_MG_case_6_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_6_NER.txt',
-                       np.transpose(iter), delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_convergence_3.py b/katoptron/CMAME/post_process/plate_MC_convergence_3.py
deleted file mode 100644
index 94b16298b71658dd1ca725188e5035ff801959fd..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_convergence_3.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.readers import *
-
-
-def read_iter_all_ensemble_sizes(n_samples,
-                                 ensemble_sizes,
-                                 file_MC_base_dir,
-                                 reduction=False):
-    iter = np.zeros((len(ensemble_sizes), n_samples))
-    for i in range(0, len(ensemble_sizes)):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(
-            ensemble_sizes[i]) + '/'
-        for j in range(0, int((n_samples // ensemble_sizes[i]))):
-            input_MC_file_dir = file_MC_base_dir_2 + str(j) + '/'
-            es = ensemble_sizes[i]
-            if reduction:
-                es = 1
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', es)
-            for k in range(0, ensemble_sizes[i]):
-                iter[i][j * ensemble_sizes[i] + k] = iter_indices[-1]
-    return iter
-
-
-def plot_iter_all_ensemble_sizes(n_samples, iter, print_all=False):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    plt.plot(list(range(0, n_samples)),
-             iter[0][:], 'bo', markersize=8, zorder=1)
-    ensemble_size = 8
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        plt.plot(list(range(ensemble_size * i, ensemble_size * (i + 1))),
-                 iter[1][ensemble_size * i:ensemble_size * (i + 1)],
-                 '-ro',
-                 linewidth=3,
-                 markersize=6,
-                 zorder=2)
-    if print_all:
-        ensemble_size = 16
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            plt.plot(list(range(ensemble_size * i, ensemble_size * (i + 1))),
-                     iter[2][ensemble_size * i:ensemble_size * (i + 1)],
-                     '-go',
-                     linewidth=2,
-                     markersize=4,
-                     zorder=2)
-        ensemble_size = 32
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            plt.plot(list(range(ensemble_size * i, ensemble_size * (i + 1))),
-                     iter[3][ensemble_size * i:ensemble_size * (i + 1)],
-                     '-ko',
-                     linewidth=1,
-                     markersize=2,
-                     zorder=3)
-    plt.xlabel('sample')
-    plt.ylabel('Number of iterations to converge')
-
-
-def write_tex(n_samples, iter, filename):
-    f = open(filename, 'w')
-    print('\\addplot [c1, mark=*, mark size=2pt, mark options={solid}, only marks]', file=f)
-    print('table [row sep=crcr] {%', file=f)
-    for i in range(0, n_samples):
-        print(str(i) + ' ' + str(iter[0][i]) + '\\\\', file=f)
-    print('};', file=f)
-    print('\\label{pgfplots:noEP}', file=f)
-    ensemble_size = 8
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        print('\\addplot [line width=2pt, c2]', file=f)
-        print('table [row sep=crcr] {%', file=f)
-        print(str(ensemble_size * i) + ' ' + str(
-            iter[1][ensemble_size * i]) + '\\\\', file=f)
-        print(str(ensemble_size *
-                  (i + 1)) + ' ' + str(iter[1][ensemble_size *
-                                               (i + 1) - 1]) + '\\\\', file=f)
-        print('};', file=f)
-    print('\\label{pgfplots:s8}', file=f)
-    ensemble_size = 16
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        print('\\addplot [line width=1.5pt, c3]', file=f)
-        print('table [row sep=crcr] {%', file=f)
-        print(str(ensemble_size * i) + ' ' + str(
-            iter[2][ensemble_size * i]) + '\\\\', file=f)
-        print(str(ensemble_size *
-                  (i + 1)) + ' ' + str(iter[2][ensemble_size *
-                                               (i + 1) - 1]) + '\\\\', file=f)
-        print('};', file=f)
-    print('\\label{pgfplots:s16}', file=f)
-    ensemble_size = 32
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        print('\\addplot [line width=1.pt, c4]', file=f)
-        print('table [row sep=crcr] {%', file=f)
-        print(str(ensemble_size * i) + ' ' + str(
-            iter[3][ensemble_size * i]) + '\\\\', file=f)
-        print(str(ensemble_size *
-                  (i + 1)) + ' ' + str(iter[3][ensemble_size *
-                                               (i + 1) - 1]) + '\\\\', file=f)
-        print('};', file=f)
-    print('\\label{pgfplots:s32}', file=f)
-    f.closed
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 64
-    ensemble_sizes = [1, 8, 16, 32]
-
-    for case_id in [1, 2, 3, 4, 5, 6]:
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_ER_2/case_' + str(
-            case_id)
-        try:
-            iter = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                                file_MC_base_dir, True)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            write_tex(n_samples, iter,
-                      'MC_MG_case_' + str(case_id) + '_ER.tex')
-            plt.grid()
-            plt.ylim([100, 400])
-            plt.savefig('MC_MG_case_' + str(case_id) + '_ER.png', dpi=400)
-            np.savetxt('MC_MG_case_' + str(case_id) + '_ER.txt',
-                       np.transpose(iter),
-                       delimiter=' ')
-            print('MC_MG_case_' + str(case_id) + '_ER')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-        file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_NER_2/case_' + str(
-            case_id)
-        try:
-            iter = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                                file_MC_base_dir, False)
-            plot_iter_all_ensemble_sizes(n_samples, iter, True)
-            write_tex(n_samples, iter,
-                      'MC_MG_case_' + str(case_id) + '_NER.tex')
-            plt.grid()
-            plt.ylim([100, 400])
-            plt.savefig('MC_MG_case_' + str(case_id) + '_NER.png', dpi=400)
-            np.savetxt('MC_MG_case_' + str(case_id) + '_NER.txt',
-                       np.transpose(iter),
-                       delimiter=' ')
-            iter2 = np.transpose(iter)
-            sum_iter = np.zeros((4, 1))
-            for i in range(0, 4):
-                sum_iter[i] = np.sum(iter2[:, i])
-            print(sum_iter / sum_iter[0])
-        except:
-            print(file_MC_base_dir + ' has not all the files')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_MC_speedup.py b/katoptron/CMAME/post_process/plate_MC_speedup.py
deleted file mode 100644
index f60e31c2d4a7f26281169ea86c4a07aa5f0266c7..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_MC_speedup.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.speedup import *
-
-
-def speedup_of_one_case(case_id, GS, ensemble_reduction, n_samples, ensemble_sizes, quantiles, querylines, use_waves_timers, use_teuchos_timers, per_iteration):
-    import matplotlib.pyplot as plt
-    if GS:
-        prec = 'GS_'
-    else:
-        prec = 'direct_'
-
-    if ensemble_reduction:
-        case_id = str(case_id)+'_ER'
-    else:
-        case_id = str(case_id)+'_NER'
-
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_' + \
-        prec+'case_' + case_id
-    try:
-        speedup = compute_speedup(n_samples, ensemble_sizes, file_MC_base_dir, querylines,
-                                  per_iteration, quantiles, use_waves_timers, use_teuchos_timers, ensemble_reduction)
-
-        plot_speedup(speedup, ensemble_sizes, np.arange(
-            0, len(querylines)), prec+'case_' + case_id, querylines, per_iteration)
-        plt.savefig(prec+'case_' + case_id + '.png', dpi=400)
-
-        save_speedup(speedup, ensemble_sizes,
-                     querylines, prec+'case_' + case_id)
-
-        R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir,
-                      quantiles, ensemble_reduction)
-        save_R(R, 'R_'+prec+'case_' + case_id)
-    except:
-        print('/Volumes/HD_SONY/CMAME/Plate/katoptron_CMAME_tests_plate_MC_' +
-              prec+'case_' + case_id + '  has not all the files')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    n_samples = 32
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = ['computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x', 'Belos: DGKS[2]: Orthogonalization',
-                  'Belos: DGKS[2]: Ortho (Inner Product)', 'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)', 'total']
-    use_waves_timers = np.array([0, 7], dtype=int)
-    use_teuchos_timers = np.array([1, 2, 3, 4, 5, 6], dtype=int)
-    per_iteration = [False, True, True, False, False, False, False, False]
-
-    for i in range(1, 5):
-        speedup_of_one_case(i, False, True, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers, per_iteration)
-        speedup_of_one_case(i, True, True, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers, per_iteration)
-        speedup_of_one_case(i, False, False, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers, per_iteration)
-        speedup_of_one_case(i, True, False, n_samples, ensemble_sizes, quantiles,
-                            querylines, use_waves_timers, use_teuchos_timers, per_iteration)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_convergence.py b/katoptron/CMAME/post_process/plate_convergence.py
deleted file mode 100644
index 5e76dd278c8c0c85b742e13f037cbde52a2d46bc..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_convergence.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-from katoptron.readers import *
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_NER/case_2/1/2/'
-    iter_indices_1, residuals_1 = read_Belos(
-        file_base_dir + 'belos_out.txt', 1)
-
-    file_base_dir = '/Volumes/HD_SONY/CMAME/Final_MT/katoptron_CMAME_tests_plate_MC_MG_all_cases_2_NER/case_2/32/0/'
-    iter_indices_2, residuals_2 = read_Belos(
-        file_base_dir + 'belos_out.txt', 3)
-
-    print(residuals_2.shape)
-
-    plt.figure()
-    plt.plot(iter_indices_1, residuals_1)
-    plt.plot(iter_indices_2, residuals_2[:, 2])
-    plt.yscale('log')
-    plt.grid(True)
-
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_cor_R.py b/katoptron/CMAME/post_process/plate_cor_R.py
deleted file mode 100644
index e2ad9dcc73f881cf50a85aad0d8f7ebdd23a83fe..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_cor_R.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-from katoptron.readers import *
-import os
-import fwk
-"""@package docstring
-This file is used to investigate the choice of prec parameters.
-"""
-
-
-def read_timer_all(n_cases, sub_cases, file_MC_base_dir):
-    querylines = ['Belos: Operation Op*x',
-                  'Belos: Operation Prec*x',
-                  'Belos: DGKS[2]: Orthogonalization',
-                  'Belos: DGKS[2]: Ortho (Inner Product)',
-                  'Belos: DGKS[2]: Ortho (Norm)',
-                  'Belos: DGKS[2]: Ortho (Update)',
-                  'Belos: PseudoBlockGmresSolMgr total solve time']
-    timer = np.zeros((n_cases, len(sub_cases), len(querylines)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            timer[i, j, :] = read_teuchos_timers(
-                input_MC_file_dir+'teuchos_timers.txt', querylines)
-    return timer
-
-
-def read_iter_all(n_cases, sub_cases, file_MC_base_dir):
-    iter = np.zeros((n_cases, len(sub_cases)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', 1)
-            iter[i][j] = iter_indices[-1]
-    return iter
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/gaussian/katoptron_CMAME_tests_plate_correlation/'
-    #file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_mean_prec_GS_direct/'
-    sub_cases = ['1', '8']
-
-    N = 200
-    correlation_min_exp = -1
-    correlation_max_exp = np.log10(2)
-
-    correlations = np.logspace(
-        correlation_min_exp, correlation_max_exp, N, endpoint=True)
-
-    iter = read_iter_all(N, sub_cases, file_MC_base_dir)
-    timer = read_timer_all(N, sub_cases, file_MC_base_dir)
-
-    from mpl_toolkits.mplot3d import Axes3D
-    import matplotlib.pyplot as plt
-    from matplotlib import cm
-
-    plt.subplot(211)
-    plt.semilogx(correlations, iter[:, 0])
-    plt.semilogx(correlations, iter[:, 1])
-    plt.xlabel('correlation length')
-    plt.ylabel('iter')
-    plt.subplot(212)
-    plt.semilogx(correlations, np.divide(iter[:, 1], iter[:, 0]))
-    plt.xlabel('correlation length')
-    plt.ylabel('R')
-
-    plt.figure()
-    plt.subplot(211)
-    plt.plot(1./correlations, iter[:, 0])
-    plt.plot(1./correlations, iter[:, 1])
-    plt.xlabel('1./correlation length')
-    plt.ylabel('iter')
-    plt.subplot(212)
-    plt.plot(1./correlations, np.divide(iter[:, 1], iter[:, 0]))
-    plt.xlabel('1./correlation length')
-    plt.ylabel('R')
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_deltas_omegas.py b/katoptron/CMAME/post_process/plate_deltas_omegas.py
deleted file mode 100644
index fb834496840884216c793de5dfba1dd085d372dc..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_deltas_omegas.py
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def plot_as_bar_plot(x, y, semilog=False):
-    import matplotlib.pyplot as plt
-    plt.figure()
-
-    for i in range(0, len(x)):
-        if i == 0:
-            x_bar = np.array([x[0], 0.5*x[0]+0.5*x[1]])
-            y_bar = np.array([y[0], y[0]])
-        elif i != len(x)-1:
-            x_bar = np.append(x_bar, [x_bar[-1], 0.5*x[i]+0.5*x[i+1]])
-            y_bar = np.append(y_bar, [y[i], y[i]])
-        else:
-            x_bar = np.append(x_bar, [x_bar[-1], x[i]])
-            y_bar = np.append(y_bar, [y[i], y[i]])
-            break
-    if semilog:
-        plt.semilogy(x_bar, y_bar)
-    else:
-        plt.plot(x_bar, y_bar)
-
-
-def analysis_deltas_omegas(n_samples, base_dir, GS, write):
-    import matplotlib.pyplot as plt
-    current_n = 1
-
-    theta = np.zeros((current_n, n_samples))
-    omegas = np.zeros((current_n, n_samples))
-    deltas = np.zeros((current_n, n_samples), dtype=np.complex128)
-
-    if GS:
-        base_dir_omega = base_dir + 'GS/omegas_GS_GS_'
-        base_dir_delta = base_dir + 'GS/deltas_GS_GS_'
-    else:
-        base_dir_omega = base_dir + 'direct/omegas_direct_direct_'
-        base_dir_delta = base_dir + 'direct/deltas_direct_direct_'
-    for i in range(0, n_samples):
-        tmp_delta = np.loadtxt(base_dir_delta+str(i)+'.txt')
-        omegas_c = np.loadtxt(base_dir_omega+str(i)+'.txt')
-
-        n = tmp_delta.shape[0]
-
-        if current_n < n:
-
-            theta_tmp = np.zeros((n, n_samples))
-            omegas_tmp = np.zeros((n, n_samples))
-            deltas_tmp = np.zeros((n, n_samples), dtype=np.complex128)
-
-            theta_tmp[0:current_n, :] = theta
-            omegas_tmp[0:current_n, :] = omegas
-            deltas_tmp[0:current_n, :] = deltas
-
-            theta = theta_tmp
-            omegas = omegas_tmp
-            deltas = deltas_tmp
-
-            current_n = n
-
-        deltas_c = np.zeros((n,), dtype=np.complex128)
-
-        deltas_c.real = tmp_delta[:, 0]
-        deltas_c.imag = tmp_delta[:, 1]
-
-        deltas[0:n, i] = deltas_c
-
-        omegas[0:n, i] = omegas_c
-
-        theta_c = compute_theta(deltas_c)
-
-        theta[0:n, i] = theta_c
-
-        sort_indices = np.argsort(theta_c)
-        theta_c = theta_c[sort_indices]
-        deltas_c = deltas_c[sort_indices]
-        omegas_c = omegas_c[sort_indices]
-
-        N = 720
-        theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(
-            theta_c, deltas_c, omegas_c, N)
-
-        indices = np.zeros((n,))
-        sort_indices = np.argsort(-omegas_c)
-        indices[sort_indices[0:30]] = 1
-        plot_eigenvalues_on_unit_circle_highlight(deltas_c, indices)
-        plot_polar_function(theta_discrete, deriv_delta, 1.5, 2.5)
-        plot_polar_function(theta_discrete, deriv_delta_omega, 3, 4)
-        plt.title('Sample ' + str(i))
-        if GS:
-            plt.savefig('fig_GS_'+str(i)+'.png')
-        else:
-            plt.savefig('fig_direct_'+str(i)+'.png')
-
-        plot_as_bar_plot(theta_discrete, deriv_delta_omega)
-        plt.title('Sample ' + str(i))
-        if GS:
-            plt.savefig('fig_GS_omegas_'+str(i)+'.png')
-        else:
-            plt.savefig('fig_direct_omegas_'+str(i)+'.png')
-
-        tmp = np.ones((len(theta[0:n, i]), 2))
-        tmp[:, 0] = theta[0:n, i]
-        if write:
-            if GS:
-                np.savetxt('theta_GS_'+str(i)+'.txt', tmp)
-            else:
-                np.savetxt('theta_direct_'+str(i)+'.txt', tmp)
-
-        tmp = np.ones((len(theta_discrete), 2))
-        tmp[:, 0] = theta_discrete
-
-        if write:
-            if GS:
-                np.savetxt('theta_GS_discrete_'+str(i)+'.txt', tmp)
-                np.savetxt('deriv_GS_delta_'+str(i)+'.tex', deriv_delta)
-                np.savetxt('deriv_GS_delta_omega_' +
-                           str(i)+'.tex', deriv_delta_omega)
-            else:
-                np.savetxt('theta_direct_discrete_'+str(i)+'.txt', tmp)
-                np.savetxt('deriv_direct_delta_'+str(i)+'.tex', deriv_delta)
-                np.savetxt('deriv_direct_delta_omega_' +
-                           str(i)+'.tex', deriv_delta_omega)
-
-    if write:
-        if GS:
-            np.savetxt('omegas_GS_all.txt', omegas)
-        else:
-            np.savetxt('omegas_direct_all.txt', omegas)
-
-    ensemble_sizes = np.array([8, 16, 32])
-
-    for i_s in range(0, len(ensemble_sizes)):
-        s = ensemble_sizes[i_s]
-        for i in range(0, n_samples, s):
-            i_sample_min = i
-            i_sample_max = i_sample_min + s
-
-            omegas_s = omegas[:, i_sample_min:i_sample_max].flatten('F')
-            deltas_s = deltas[:, i_sample_min:i_sample_max].flatten('F')
-            theta_s = theta[:, i_sample_min:i_sample_max].flatten('F')
-            index = np.argwhere(np.absolute(deltas_s) >= 0.9)
-
-            omegas_s = omegas_s[index]
-            deltas_s = deltas_s[index]
-            theta_s = theta_s[index]
-
-            sort_indices = np.argsort(theta_s)
-            theta_s = theta_s[sort_indices]
-            deltas_s = deltas_s[sort_indices]
-            omegas_s = omegas_s[sort_indices]
-
-            N = 720
-            theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(
-                theta_s, deltas_s, omegas_s, N)
-
-            n = len(omegas_s)
-            indices = np.zeros((n,))
-            sort_indices = np.argsort(-omegas_s)
-            indices[sort_indices[0:30]] = 1
-            plot_eigenvalues_on_unit_circle_highlight(deltas_s, indices)
-            plot_polar_function(theta_discrete, deriv_delta, 1.5, 2.5)
-            plot_polar_function(theta_discrete, deriv_delta_omega, 3, 4)
-            plt.title('Ensemble ' + str(int((i // s))) +
-                      ' of ensemble size ' + str(s))
-            if GS:
-                plt.savefig('fig_s_GS_' + str(s) + '_' +
-                            str(int((i // s))) + '.png')
-            else:
-                plt.savefig('fig_s_direct_' + str(s) + '_' +
-                            str(int((i // s))) + '.png')
-            plt.clf()
-            plt.close()
-            plot_as_bar_plot(theta_discrete, deriv_delta_omega)
-            plt.title('Ensemble ' + str(int((i // s))) +
-                      ' of ensemble size ' + str(s))
-            if GS:
-                plt.savefig('fig_s_GS_omegas_' + str(s) + '_' +
-                            str(int((i // s))) + '.png')
-            else:
-                plt.savefig('fig_s_direct_omegas_' + str(s) +
-                            '_' + str(int((i // s))) + '.png')
-            plt.clf()
-            plt.close()
-
-
-def main():
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    n_samples = 32
-
-    base_dir = file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_deltas_omegas_'
-    write = False
-
-    analysis_deltas_omegas(n_samples, base_dir, True, write)
-    analysis_deltas_omegas(n_samples, base_dir, False, write)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_deltas_omegas_direct_analysis.py b/katoptron/CMAME/post_process/plate_deltas_omegas_direct_analysis.py
deleted file mode 100644
index 9bd4fea0a32e11a14257cc570ba4bc565115e9d7..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_deltas_omegas_direct_analysis.py
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def plot_as_bar_plot(x, y, semilog=False):
-    import matplotlib.pyplot as plt
-    plt.figure(figsize=(15, 4))
-
-    for i in range(0, len(x)):
-        if i == 0:
-            x_bar = np.array([x[0], 0.5*x[0]+0.5*x[1]])
-            y_bar = np.array([y[0], y[0]])
-        elif i != len(x)-1:
-            x_bar = np.append(x_bar, [x_bar[-1], 0.5*x[i]+0.5*x[i+1]])
-            y_bar = np.append(y_bar, [y[i], y[i]])
-        else:
-            x_bar = np.append(x_bar, [x_bar[-1], x[i]])
-            y_bar = np.append(y_bar, [y[i], y[i]])
-            break
-    if semilog:
-        plt.semilogy(x_bar, y_bar)
-    else:
-        plt.plot(x_bar, y_bar)
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    current_n = 1
-    n_samples = 32
-
-    theta = np.zeros((current_n, n_samples))
-    omegas = np.zeros((current_n, n_samples))
-    deltas = np.zeros((current_n, n_samples), dtype=np.complex128)
-
-    for i in range(0, n_samples):
-        tmp_delta = np.loadtxt(
-            file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_deltas_omegas_direct/deltas_direct_direct_'+str(i)+'.txt')
-        omegas_c = np.loadtxt(
-            file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_deltas_omegas_direct/omegas_direct_direct_'+str(i)+'.txt')
-
-        n = tmp_delta.shape[0]
-
-        if current_n < n:
-
-            theta_tmp = np.zeros((n, n_samples))
-            omegas_tmp = np.zeros((n, n_samples))
-            deltas_tmp = np.zeros((n, n_samples), dtype=np.complex128)
-
-            theta_tmp[0:current_n, :] = theta
-            omegas_tmp[0:current_n, :] = omegas
-            deltas_tmp[0:current_n, :] = deltas
-
-            theta = theta_tmp
-            omegas = omegas_tmp
-            deltas = deltas_tmp
-
-            current_n = n
-
-        deltas_c = np.zeros((n,), dtype=np.complex128)
-
-        deltas_c.real = tmp_delta[:, 0]
-        deltas_c.imag = tmp_delta[:, 1]
-
-        deltas[0:n, i] = deltas_c
-
-        omegas[0:n, i] = omegas_c
-
-        theta_c = compute_theta(deltas_c)
-
-        theta[0:n, i] = theta_c
-
-        sort_indices = np.argsort(theta_c)
-        theta_c = theta_c[sort_indices]
-        deltas_c = deltas_c[sort_indices]
-        omegas_c = omegas_c[sort_indices]
-
-        N = 720
-        theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(
-            theta_c, deltas_c, omegas_c, N)
-
-        indices = np.zeros((n,))
-        sort_indices = np.argsort(-omegas_c)
-        indices[sort_indices[0:30]] = 1
-        plot_eigenvalues_on_unit_circle_highlight(deltas_c, indices)
-        plot_polar_function(theta_discrete, deriv_delta, 1.5, 2.5)
-        plot_polar_function(theta_discrete, deriv_delta_omega, 3, 4)
-        plt.title('Sample ' + str(i))
-        plt.savefig('fig_'+str(i)+'.png')
-
-        plot_as_bar_plot(theta_discrete, deriv_delta_omega)
-        plt.title('Sample ' + str(i))
-        plt.savefig('fig_omegas_'+str(i)+'.png')
-
-        tmp = np.ones((len(theta[0:n, i]), 2))
-        tmp[:, 0] = theta[0:n, i]
-        np.savetxt('theta_'+str(i)+'.txt', tmp)
-
-        tmp = np.ones((len(theta_discrete), 2))
-        tmp[:, 0] = theta_discrete
-        np.savetxt('theta_discrete_'+str(i)+'.txt', tmp)
-        np.savetxt('deriv_delta_'+str(i)+'.tex', deriv_delta)
-        np.savetxt('deriv_delta_omega_'+str(i)+'.tex', deriv_delta_omega)
-
-    np.savetxt('omegas_all.txt', omegas)
-
-    ensemble_sizes = np.array([8, 16, 32])
-
-    for i_s in range(0, len(ensemble_sizes)):
-        s = ensemble_sizes[i_s]
-        for i in range(0, n_samples, s):
-            i_sample_min = i
-            i_sample_max = i_sample_min + s
-
-            omegas_s = omegas[:, i_sample_min:i_sample_max].flatten('F')
-            deltas_s = deltas[:, i_sample_min:i_sample_max].flatten('F')
-            theta_s = theta[:, i_sample_min:i_sample_max].flatten('F')
-            index = np.argwhere(np.absolute(deltas_s) >= 0.9)
-
-            omegas_s = omegas_s[index]
-            deltas_s = deltas_s[index]
-            theta_s = theta_s[index]
-
-            sort_indices = np.argsort(theta_s)
-            theta_s = theta_s[sort_indices]
-            deltas_s = deltas_s[sort_indices]
-            omegas_s = omegas_s[sort_indices]
-
-            N = 720
-            theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(
-                theta_s, deltas_s, omegas_s, N)
-
-            n = len(omegas_s)
-            indices = np.zeros((n,))
-            sort_indices = np.argsort(-omegas_s)
-            indices[sort_indices[0:30]] = 1
-            plot_eigenvalues_on_unit_circle_highlight(deltas_s, indices)
-            plot_polar_function(theta_discrete, deriv_delta, 1.5, 2.5)
-            plot_polar_function(theta_discrete, deriv_delta_omega, 3, 4)
-            plt.title('Ensemble ' + str(int((i // s))) +
-                      ' of ensemble size ' + str(s))
-
-            plt.savefig('fig_s_' + str(s) + '_' +
-                        str(int((i // s))) + '.png')
-            plt.clf()
-            plt.close()
-            plot_as_bar_plot(theta_discrete, deriv_delta_omega)
-            plt.title('Ensemble ' + str(int((i // s))) +
-                      ' of ensemble size ' + str(s))
-            plt.savefig('fig_s_omegas_' + str(s) + '_' +
-                        str(int((i // s))) + '.png')
-            plt.clf()
-            plt.close()
-    if display:
-        plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_deltas_omegas_gs_analysis.py b/katoptron/CMAME/post_process/plate_deltas_omegas_gs_analysis.py
deleted file mode 100644
index 1a9609a27d3faba4671c8f3422bc3151cb8f0009..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_deltas_omegas_gs_analysis.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-
-def plot_as_bar_plot(x, y, semilog=False):
-    import matplotlib.pyplot as plt
-    plt.figure()
-
-    for i in range(0, len(x)):
-        if i == 0:
-            x_bar = np.array([x[0], 0.5*x[0]+0.5*x[1]])
-            y_bar = np.array([y[0], y[0]])
-        elif i != len(x)-1:
-            x_bar = np.append(x_bar, [x_bar[-1], 0.5*x[i]+0.5*x[i+1]])
-            y_bar = np.append(y_bar, [y[i], y[i]])
-        else:
-            x_bar = np.append(x_bar, [x_bar[-1], x[i]])
-            y_bar = np.append(y_bar, [y[i], y[i]])
-            break
-    if semilog:
-        plt.semilogy(x_bar, y_bar)
-    else:
-        plt.plot(x_bar, y_bar)
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = True
-
-    current_n = 1
-    n_samples = 32
-
-    theta = np.zeros((current_n, n_samples))
-    omegas = np.zeros((current_n, n_samples))
-    deltas = np.zeros((current_n, n_samples), dtype=np.complex128)
-
-    for i in range(0, n_samples):
-        tmp_delta = np.loadtxt(
-            file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_deltas_omegas_GS/deltas_GS_GS_'+str(i)+'.txt')
-        omegas_c = np.loadtxt(
-            file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_deltas_omegas_GS/omegas_GS_GS_'+str(i)+'.txt')
-
-        n = tmp_delta.shape[0]
-
-        deltas_c = np.zeros((n,), dtype=np.complex128)
-
-        deltas_c.real = tmp_delta[:, 0]
-        deltas_c.imag = tmp_delta[:, 1]
-
-        index = np.argwhere(np.absolute(deltas_c) >= 0.95)
-        n = len(index)
-
-        deltas_c = deltas_c[index].reshape((n,))
-        omegas_c = omegas_c[index].reshape((n,))
-
-        if current_n < n:
-
-            theta_tmp = np.zeros((n, n_samples))
-            omegas_tmp = np.zeros((n, n_samples))
-            deltas_tmp = np.zeros((n, n_samples), dtype=np.complex128)
-
-            theta_tmp[0:current_n, :] = theta
-            omegas_tmp[0:current_n, :] = omegas
-            deltas_tmp[0:current_n, :] = deltas
-
-            theta = theta_tmp
-            omegas = omegas_tmp
-            deltas = deltas_tmp
-
-            current_n = n
-
-        deltas[0:n, i] = deltas_c
-        omegas[0:n, i] = omegas_c
-
-        theta_c = compute_theta(deltas_c)
-
-        theta[0:n, i] = theta_c
-
-        N = 720
-        theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(
-            theta_c, deltas_c, omegas_c, N)
-
-        # plot_as_bar_plot(theta_discrete,deriv_delta_omega)
-
-        indices = np.zeros((n,))
-        sort_indices = np.argsort(-omegas_c)
-        indices[sort_indices[0:30]] = 1
-        # plot_eigenvalues_on_unit_circle_highlight(deltas_c,indices)
-        # plot_polar_function(theta_discrete,deriv_delta,1.5,2.5)
-        # plot_polar_function(theta_discrete,deriv_delta_omega,3,4)
-        #plt.title('Sample ' + str(i))
-        # plt.savefig('fig_'+str(i)+'.png')
-
-        #sort_indices = np.argsort(theta_c)
-        # plt.figure()
-        #plt.bar(theta_c[sort_indices],omegas_c[sort_indices], width=0.1, alpha=0.6, align="center")
-        # plt.plot(theta_c[sort_indices],omegas_c[sort_indices])
-
-        #tmp = np.ones((len(theta[0:n,i]),2))
-        #tmp[:,0] = theta[0:n,i]
-        # np.savetxt('theta_'+str(i)+'.txt',tmp)
-
-        #tmp = np.ones((len(theta_discrete),2))
-        #tmp[:,0] = theta_discrete
-        # np.savetxt('theta_discrete_'+str(i)+'.txt',tmp)
-        # np.savetxt('deriv_delta_'+str(i)+'.tex',deriv_delta)
-        # np.savetxt('deriv_delta_omega_'+str(i)+'.tex',deriv_delta_omega)
-
-    # np.savetxt('omegas_all.txt',omegas)
-
-    theta = theta.flatten('F')
-    deltas = deltas.flatten('F')
-    omegas = omegas.flatten('F')
-
-    N = 720
-    theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(
-        theta, deltas, omegas, N)
-    plot_as_bar_plot(theta_discrete, deriv_delta_omega)
-    #sort_indices = np.argsort(theta)
-    # plt.figure()
-    #plt.bar(theta[sort_indices],omegas[sort_indices], width=0.1, alpha=0.6, align="center")
-
-    '''
-    ensemble_sizes = np.array([8,16,32])
-
-    for i_s in range(0,len(ensemble_sizes)):
-      s = ensemble_sizes[i_s]
-      for i in range(0,n_samples,s):
-        i_sample_min = i
-        i_sample_max = i_sample_min + s
-        
-        omegas_s = omegas[:,i_sample_min:i_sample_max].flatten('F')
-        deltas_s = deltas[:,i_sample_min:i_sample_max].flatten('F')
-        theta_s = theta[:,i_sample_min:i_sample_max].flatten('F')
-        index = np.argwhere(np.absolute(deltas_s)>=0.9)
-        
-        omegas_s = omegas_s[index]
-        deltas_s = deltas_s[index]
-        theta_s = theta_s[index]
-        
-        N = 1000
-        theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta(theta_s,deltas_s,omegas_s,N)
-
-        n = len(omegas_s)
-        indices = np.zeros((n,))
-        sort_indices = np.argsort(-omegas_s)
-        indices[sort_indices[0:30]] = 1
-        plot_eigenvalues_on_unit_circle_highlight(deltas_s,indices)
-        plot_polar_function(theta_discrete,deriv_delta,1.5,2.5)
-        plot_polar_function(theta_discrete,deriv_delta_omega,3,4)
-        plt.title('Ensemble ' + str(int(i/s)) + ' of ensemble size ' + str(s))
-        
-        plt.savefig('fig_s_'+ str(s) +'_' + str(int(i/s)) + '.png')
-    '''
-    if display:
-        plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_gamma.py b/katoptron/CMAME/post_process/plate_gamma.py
deleted file mode 100644
index eaaa22a8424d1949a123c16a0f7e60d10122720c..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_gamma.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-import fwk
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    input_file_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_vd_GS_3_3/1/'
-
-    for i in range(0, 8):
-        filename_Q = input_file_dir + str(i) + '/A_mm_after_bc.txt'
-        filename_GT = input_file_dir + str(i) + '/B_mm.txt'
-
-        Q = read_mm(filename_Q)
-        #Q = get_symmetrical_part(Q)
-        GT = read_mm(filename_GT)
-
-        norm_Q = sparse_matrix_2_norm(Q)
-        norm_GT = sparse_matrix_2_norm(GT)
-
-        print((norm_Q / norm_GT))
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_gamma_R.py b/katoptron/CMAME/post_process/plate_gamma_R.py
deleted file mode 100644
index 3902d82d4f24460b5d14207263b338d3753ac60b..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_gamma_R.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-from katoptron.readers import *
-import os
-import fwk
-"""@package docstring
-This file is used to investigate the choice of prec parameters.
-"""
-
-
-def read_timer_all(n_cases, sub_cases, file_MC_base_dir):
-    querylines = ['Belos: Operation Op*x',
-                  'Belos: Operation Prec*x',
-                  'Belos: DGKS[2]: Orthogonalization',
-                  'Belos: DGKS[2]: Ortho (Inner Product)',
-                  'Belos: DGKS[2]: Ortho (Norm)',
-                  'Belos: DGKS[2]: Ortho (Update)',
-                  'Belos: PseudoBlockGmresSolMgr total solve time']
-    timer = np.zeros((n_cases, len(sub_cases), len(querylines)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            timer[i, j, :] = read_teuchos_timers(
-                input_MC_file_dir+'teuchos_timers.txt', querylines)
-    return timer
-
-
-def read_iter_all(n_cases, sub_cases, file_MC_base_dir):
-    iter = np.zeros((n_cases, len(sub_cases)))
-    for i in range(0, n_cases):
-        file_MC_base_dir_2 = file_MC_base_dir + '/' + str(i)+'/'
-        for j in range(0, len(sub_cases)):
-            input_MC_file_dir = file_MC_base_dir_2 + str(sub_cases[j])+'/'
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', 1)
-            iter[i][j] = iter_indices[-1]
-    return iter
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    file_MC_base_dir = '/Volumes/HD_SONY/CMAME/Plate/gaussian/katoptron_CMAME_tests_plate_mean_gamma/'
-    #file_dir + '/../../../workspace/katoptron_CMAME_tests_plate_mean_prec_GS_direct/'
-    sub_cases = ['1', '8']
-
-    N = 200
-    gamma_min_exp = -2
-    gamma_max_exp = 10
-
-    gammas = np.logspace(gamma_min_exp, gamma_max_exp, N, endpoint=True)
-
-    iter = read_iter_all(N, sub_cases, file_MC_base_dir)
-    timer = read_timer_all(N, sub_cases, file_MC_base_dir)
-
-    from mpl_toolkits.mplot3d import Axes3D
-    import matplotlib.pyplot as plt
-    from matplotlib import cm
-
-    plt.subplot(211)
-    plt.semilogx(gammas, iter[:, 0])
-    plt.semilogx(gammas, iter[:, 1])
-    plt.semilogx([4368992., 4368992.], [200, 1000], '--k')
-    plt.xlabel('gamma')
-    plt.ylabel('iter')
-    plt.subplot(212)
-    plt.semilogx(gammas, np.divide(iter[:, 1], iter[:, 0]))
-    plt.xlabel('gamma')
-    plt.ylabel('R')
-    plt.semilogx([4368992., 4368992.], [1, 5], '--k')
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_mean.py b/katoptron/CMAME/post_process/plate_mean.py
deleted file mode 100644
index 545e96f8659d48d3d59e9e5e0ed48c66087b2773..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_mean.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.cutter as vtkC
-
-
-def Kirsch_equations(x, y, center_x, center_y, a, sigma_inf):
-
-    centered_x = x-center_x
-    centered_y = y-center_y
-
-    r = np.abs(centered_x+centered_y*1.0j)
-    theta = np.angle(centered_x+centered_y*1.0j) - (np.pi / 2)
-
-    half_sigma_inf = ((sigma_inf / 2))
-
-    ar = (a / r)
-    ar_p_2 = np.power(ar, 2)
-    ar_p_4 = np.power(ar, 4)
-
-    cos2theta = np.cos(2*theta)
-    sin2theta = np.sin(2*theta)
-
-    sigma_rr = half_sigma_inf*(1-ar_p_2)+half_sigma_inf * \
-        (1-4*ar_p_2+3*ar_p_4)*cos2theta
-    sigma_thetatheta = half_sigma_inf * \
-        (1+ar_p_2)-half_sigma_inf*(1+3*ar_p_4)*cos2theta
-    tau_rtheta = -half_sigma_inf*(1+2*ar_p_2-3*ar_p_4)*sin2theta
-
-    VM = np.sqrt(np.square(sigma_rr)+np.square(sigma_thetatheta) -
-                 sigma_rr*sigma_thetatheta+3*np.square(tau_rtheta))
-
-    return VM
-
-
-def cut_plate(mshName):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    cutter = vtkC.Cutter(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, [0., 0., 0.5], [0., 0., 1.], tag_name='volume_id')
-    pts, tri, vals = cutter.extract(
-        c_output, 3, ['u', 'x', 'y', 'z'], atPoint=True)
-    pts_2, tri_2, vals_2 = cutter.extract(
-        c_output, 3, ['G', 'von Mises'], atPoint=False)
-    vals.update(vals_2)
-
-    return pts, tri, vals
-
-
-def extract_quad_msh(mshName):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    rdata = reader.reader.GetOutput()
-
-    _pts = rdata.GetPoints()
-    pts = np.zeros((_pts.GetNumberOfPoints(), 2))
-    pts_indices = np.zeros((_pts.GetNumberOfPoints(),), dtype=int)
-    for i in range(0, pts.shape[0]):
-        if _pts.GetPoint(i)[2] <= 0.01:
-            for j in range(0, 2):
-                pts[i][j] = _pts.GetPoint(i)[j]
-            pts_indices[i] = 1
-    n_elems = rdata.GetNumberOfCells()
-    quad = []
-    for i in range(0, n_elems):
-        elem = rdata.GetCell(i)
-        for j in range(0, 6):
-            face = elem.GetFace(j)
-            points_id = np.zeros((4,), dtype=int)
-            good_face = True
-            for k in range(0, 4):
-                points_id[k] = face.GetPointId(k)
-                if pts_indices[points_id[k]] != 1:
-                    good_face = False
-                    break
-            if good_face:
-                if len(quad) == 0:
-                    quad = points_id.reshape((1, 4))
-                else:
-                    quad = np.append(quad, points_id.reshape((1, 4)), axis=0)
-    return pts, quad
-
-
-def plot_2D_cut_values_at_node(x, y, tri, value, v_min, v_max, n_levels=16):
-    import matplotlib.pyplot as plt
-    value = value.reshape((len(x),))
-    levels = np.linspace(v_min, v_max, n_levels)
-    print(levels)
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(x, y, tri, value, levels, linestyles='-',
-                   colors='black', linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, value, levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0,
-                        hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-
-def plot_2D_cut_values_at_elem(x, y, tri_1, value, v_min, v_max, n_levels=16, shading=False):
-    import matplotlib.pyplot as plt
-
-    value = value.reshape((tri_1.shape[0],))
-
-    levels = np.linspace(v_min, v_max, n_levels)
-    print(levels)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    if shading:
-        plt.tripcolor(x, y, tri_1, value, shading='gouraud')
-    else:
-        plt.tripcolor(x, y, tri_1, value, levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0,
-                        hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-
-def plot_2D_mesh(pts, quad):
-    import matplotlib.pyplot as plt
-    fig = plt.figure(figsize=(8, 8))
-    f = open('mesh_2.tex', 'w')
-    print('\begin{tikzpicture}', file=f)
-    for i in range(0, quad.shape[0]):
-        x = np.zeros((quad.shape[1]+1,))
-        y = np.zeros((quad.shape[1]+1,))
-        for j in range(0, quad.shape[1]):
-            x[j] = pts[quad[i, j], 0]
-            y[j] = pts[quad[i, j], 1]
-        x[-1] = pts[quad[i, 0], 0]
-        y[-1] = pts[quad[i, 0], 1]
-        string_1 = '\draw[thick] '
-        for j in range(0, quad.shape[1]+1):
-            string_1 = string_1 + '(' + str(x[j]) + ',' + str(y[j]) + ')'
-            if j == quad.shape[1]:
-                string_1 = string_1 + ';'
-            else:
-                string_1 = string_1 + '--'
-
-        print(string_1, file=f)
-        plt.plot(x, y, 'black')
-    plt.gca().set_aspect('equal')
-
-    print('\end{tikzpicture}', file=f)
-    f.closed
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    input_file_dir = '/Users/kimliegeois/Desktop/katoptron_CMAME_tests_plate_MC_MG_all_cases_2/case_1/8/0/'
-
-    mshName = input_file_dir+'plate_fused_ast1_s0_0'
-
-    pts, tri, vals = cut_plate(mshName)
-    pts_2, quad = extract_quad_msh(mshName)
-
-    plot_2D_mesh(pts_2, quad)
-
-    x = pts[:, 0]
-    y = pts[:, 1]
-
-    VM_theory = Kirsch_equations(x, y, 5, 5, 2, 700)
-    plot_2D_cut_values_at_node(x, y, tri, VM_theory, 0, 3100)
-    plt.savefig("mean_VM_theory.pdf", transparent=True,
-                bbox_inches='tight', pad_inches=-0.05)
-
-    # plot_2D_cut_values_at_node(x,y,tri,vals['u'])
-    plot_2D_cut_values_at_node(x, y, tri, vals['G'], -0.07967112, 0.15190813)
-    plt.savefig("G_0.pdf", transparent=True,
-                bbox_inches='tight', pad_inches=-0.05)
-
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_mean_GS.py b/katoptron/CMAME/post_process/plate_mean_GS.py
deleted file mode 100644
index 0fefac3ea2396c7c05646ad7e20b5e54cc86fff9..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_mean_GS.py
+++ /dev/null
@@ -1,292 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-import fwk
-"""@package docstring
-This file is used to investigate the convergence of the SOR (Gauss-Seidel with damping factor in [0,2]).
-"""
-
-Verbose = False
-
-algo_inverse = 4
-
-
-def save_data(name, omegas, rhos):
-    tmp = np.zeros((len(omegas), 2))
-    tmp[:, 0] = omegas
-    tmp[:, 1] = rhos
-    np.savetxt(name, tmp)
-
-
-def Inv_triangular_matrix_1(A):
-    """
-    This function computes the inverse of a triangular matrix based on
-    https://math.stackexchange.com/questions/1003801/inverse-of-an-invertible-upper-triangular-matrix-of-order-3
-
-    This one is slow but precise!
-    """
-    from scipy.sparse import eye
-    n = A.shape[0]
-    invA = eye(n)
-    tmp = A
-    for i in range(1, n - 1):
-        invA = invA + tmp
-        tmp = tmp * A
-    return invA
-
-
-def Inv_triangular_matrix_2(A):
-    """
-    This function computes the inverse of a triangular matrix based on
-    forward substitution
-
-    This one is fast but not precise!
-    """
-    from scipy.sparse import eye
-    from scipy.sparse import csr_matrix
-    n = A.shape[0]
-    invA = np.zeros((n, n))
-    tmpA = A.todense()
-    for i in range(0, n):
-        invA[i, :] = invA[i, :] - A[i, 0:(i - 1)].dot(invA[0:(i - 1), :])
-        invA[i, i] = 1.
-    return csr_matrix(invA)
-
-
-def Inv_triangular_matrix_3(A, B):
-    from scipy.sparse.linalg import spsolve_triangular
-    n = A.shape[0]
-    X = np.zeros((n, n))
-
-    for i in range(1, n):
-        #X[:,[i]] = spsolve_triangular(A, B[:,i])
-        tmp = A.tocsr()[0:i, :].tocsc()[:, 0:i]
-        X[0:i, [i]] = spsolve_triangular(tmp, B[0:i, i])
-    return X
-
-
-def Inv_triangular_matrix_4(A):
-    """
-    This function computes the inverse of a triangular matrix based on
-    a recursive approach
-
-    This one is fast and precise!
-    """
-    from scipy.sparse import csr_matrix
-    from scipy.sparse import eye
-    n = A.shape[0]
-
-    n_max = 100
-
-    if n < n_max:
-        return Inv_triangular_matrix_1(eye(n) - A).todense()
-    else:
-        n1 = n // 2
-        invA = np.zeros((n, n))
-        invA[0:n1, 0:n1] = Inv_triangular_matrix_4(A[0:n1, 0:n1])
-        invA[n1:n, n1:n] = Inv_triangular_matrix_4(A[n1:n, n1:n])
-        tmp = invA[n1:n, n1:n] * A[n1:n, 0:n1]
-        invA[n1:n, 0:n1] = -tmp.dot(invA[0:n1, 0:n1])
-        return invA
-
-
-def M_Jac(A):
-    """
-    This function returns the iterative matrix of the Jacobi approach applied on A
-    If this matrix has a spectral radius strictly smaller than 1, the optimal 
-    damping parameters of the SOR applied on A can be deduced analytically.
-    """
-    from scipy.sparse import diags
-    from scipy.sparse import eye
-    invD = diags(1. / A.diagonal(), 0)
-    n = A.shape[0]
-    return eye(n) - invD * A
-
-
-def M_SOR(A, omega):
-    """
-    This function returns the iterative matrix of the SOR approach applied on A.
-    """
-    from scipy.sparse import tril
-    from scipy.sparse import triu
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    from scipy.sparse.linalg import inv
-    from scipy.sparse.linalg import spsolve_triangular
-
-    E = -tril(A, -1)
-    F = -triu(A, 1)
-    invD = diags(1. / A.diagonal(), 0)
-
-    L = invD * E
-    U = invD * F
-    I = eye(A.shape[0])
-
-    if algo_inverse == 1:
-        x = Inv_triangular_matrix_1(omega * L) * ((1. - omega) * I + omega * U)
-    elif algo_inverse == 2:
-        x = Inv_triangular_matrix_2(I - omega * L) * (
-            (1. - omega) * I + omega * U)
-    elif algo_inverse == 3:
-        x = Inv_triangular_matrix_3(I - omega * L,
-                                    ((1. - omega) * I + omega * U).todense())
-    elif algo_inverse == 4:
-        x = Inv_triangular_matrix_4(I - omega * L) * (
-            (1. - omega) * I + omega * U)
-    return x
-
-
-def spectral_radius_analysis(A,
-                             N,
-                             timers,
-                             tmp_name,
-                             omega_min=0.,
-                             omega_max=2.):
-    """
-    This function computes the spectral radii.
-    """
-    timers['Compute M_Jac'].start()
-    m_Jac = M_Jac(A)
-    timers['Compute M_Jac'].stop()
-    timers['Compute rho_Jac'].start()
-    rho_Jac = spectral_radius(m_Jac)
-    timers['Compute rho_Jac'].stop()
-
-    if Verbose:
-        if rho_Jac >= 1.:
-            print('The Jacobi approach does not converge on this matrix as rho(M_Jac) = ' + str(
-                rho_Jac))
-        else:
-            print('The Jacobi approach does converge on this matrix as rho(M_Jac) = ' + str(
-                rho_Jac))
-
-    omegas = np.linspace(omega_min, omega_max, N)
-    rho_SOR = np.ones(omegas.shape)
-
-    for i in range(0, N):
-        if 0. < omegas[i] and omegas[i] < 2.:
-            timers['Compute M_SOR'].start()
-            m_SOR = M_SOR(A, omegas[i])
-            timers['Compute M_SOR'].stop()
-            timers['Compute rho_SOR'].start()
-            try:
-                rho_SOR[i] = spectral_radius(m_SOR)
-            except:
-                rho_SOR[i:(N + 1)] = 1.
-                timers['Compute M_SOR'].stop()
-                break
-            timers['Compute M_SOR'].stop()
-
-            if Verbose:
-                if rho_SOR[i] >= 1.:
-                    print('The SOR approach does not converge on this matrix as rho(M_SOR) = ' + str(
-                        rho_SOR[i]) + ' with omega = ' + str(omegas[i]))
-                else:
-                    print('The SOR approach does converge on this matrix as rho(M_SOR) = ' + str(
-                        rho_SOR[i]) + ' with omega = ' + str(omegas[i]))
-            print(str(((100. * i) // N)) +
-                  ' % of the omegas are evaluated ')
-            save_data(tmp_name, omegas, rho_SOR)
-            if Verbose:
-                print(timers)
-
-    return rho_Jac, omegas, rho_SOR
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    timers = fwk.Timers()
-
-    timers['Read data'].start()
-    input_file_dir = file_dir + '/../../../workspace/katoptron_CMAME_tests_plate/'
-    filename_K = input_file_dir + 'A_mm_after_bc.txt'
-    filename_GT = input_file_dir + 'B_mm.txt'
-    filename_rhs = input_file_dir + 'b_mm_after_bc.txt'
-
-    K = read_mm(filename_K)
-    K = get_symmetrical_part(K)
-    GT = read_mm(filename_GT)
-    G = GT.transpose()
-    timers['Read data'].stop()
-    timers['Compute and apply gamma'].start()
-    norm_K = sparse_matrix_2_norm(K)
-    norm_GT = sparse_matrix_2_norm(GT)
-
-    b = read_mm(filename_rhs, is_sparse=False)
-    b0 = b[0:K.shape[0]]
-
-    gamma = (norm_K / norm_GT)
-
-    Q = K + gamma * G * GT
-    timers['Compute and apply gamma'].stop()
-
-    from numpy import linalg as LA
-
-    n = 20
-    gs = Gauss_Seidel(K, n=n, damping=1.)
-    xn, norm_res_K = gs.dot_with_norm(b0)
-    gs = Gauss_Seidel(K, n=n, damping=0.8)
-    xn, norm_res_Q = gs.dot_with_norm(b0)
-
-    n_omegas = 50
-    omegas = np.linspace(0., 2., n_omegas)
-    res_omegas = np.zeros((n_omegas, n+2))
-    res_omegas[:, 0] = omegas
-    import matplotlib.pyplot as plt
-    plt.figure()
-    for i in range(0, n_omegas):
-        gs = Gauss_Seidel(K, n=n, damping=omegas[i])
-        xn, norm_res = gs.dot_with_norm(b0)
-        tmp = (norm_res / norm_res[0])
-        res_omegas[i, 1:n+2] = np.reshape(tmp[:], (n+1,))
-        plt.plot(tmp)
-    plt.grid()
-
-    plt.figure()
-    plt.plot(omegas, res_omegas[:, 1])
-    plt.plot(omegas, res_omegas[:, 2])
-    plt.plot(omegas, res_omegas[:, 3])
-    print(res_omegas)
-    for i in range(1, n+1):
-        j = np.argmin(res_omegas[:, i+1])
-        print(omegas[j])
-    np.savetxt('res_omegas.txt', res_omegas)
-
-    plt.show()
-
-    print(timers)
-
-    '''
-    R = approx_Schur_complement(Q, G, GT)
-
-    N = 5
-
-    timers_R = fwk.Timers()
-    timers_Q = fwk.Timers()
-    rho_Jac_R, omegas_R, rho_SOR_R = spectral_radius_analysis(R,
-                                                              N,
-                                                              timers_R,
-                                                              'tmp_SOR_R.out',
-                                                              omega_min=0.,
-                                                              omega_max=1.)
-    save_data('SOR_R.out', omegas_R, rho_SOR_R)
-    print timers_R
-    rho_Jac_Q, omegas_Q, rho_SOR_Q = spectral_radius_analysis(Q,
-                                                              N,
-                                                              timers_Q,
-                                                              'tmp_SOR_Q.out',
-                                                              omega_min=0.8,
-                                                              omega_max=2.)
-    save_data('SOR_Q.out', omegas_Q, rho_SOR_Q)
-    np.savetxt('Jac.out', (rho_Jac_R, rho_Jac_Q))
-    print timers_Q
-    '''
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_mean_GS_omega.py b/katoptron/CMAME/post_process/plate_mean_GS_omega.py
deleted file mode 100644
index b4df656e35a4710d32086df0a960db855990d9f3..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_mean_GS_omega.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-from katoptron.eigenvalues import *
-from katoptron.readers import *
-import os
-import fwk
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    input_file_dir = file_dir + '/../../../workspace/katoptron_CMAME_tests_plate/'
-
-    mshName = input_file_dir+'plate_fused_ast1_s0_0'
-
-    filename_Q = input_file_dir + 'ApCTC_mm.txt'  # 'A_mm_after_bc.txt' #
-    filename_GT = input_file_dir + 'B_mm.txt'
-
-    Q = read_mm(filename_Q)
-    Q = get_symmetrical_part(Q)
-    GT = read_mm(filename_GT)
-    G = GT.transpose()
-
-    R = approx_Schur_complement(Q, G, GT)
-
-    if diagonal_dominance(R):
-        print('R is diagonally dominant')
-    else:
-        print('R is not diagonally dominant')
-    if diagonal_dominance(Q):
-        print('Q is diagonally dominant')
-    else:
-        print('Q is not diagonally dominant')
-
-    if is_SPD(R):
-        print('R is SPD')
-    else:
-        print('R is not SPD')
-
-    if is_SPD(Q):
-        print('Q is SPD')
-    else:
-        print('Q is not SPD')
-    #Qjac = jacobi_iteration_matrix(Q)
-    #Rjac = jacobi_iteration_matrix(R)
-
-    #mu_Q = np.absolute(spectral_radius(Qjac))
-    #mu_R = np.absolute(spectral_radius(Rjac))
-
-    #print mu_Q
-    #print mu_R
-
-    #print 2/(1+np.sqrt(1-mu_Q**2))
-    #print 2/(1+np.sqrt(1-mu_R**2))
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/post_process/plate_mean_convergence.py b/katoptron/CMAME/post_process/plate_mean_convergence.py
deleted file mode 100644
index 7ba726c6d4d0adff77cdd448cd8e8607007ad9e5..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/post_process/plate_mean_convergence.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.eigenvalues import *
-import os
-import fwk
-
-import vtk
-import tboxVtk
-import tboxVtk.reader as vtkR
-import tboxVtk.lineExtractor as vtkC
-
-
-def Kirsch_equations(x, y, center_x, center_y, a, sigma_inf):
-
-    centered_x = x-center_x
-    centered_y = y-center_y
-
-    r = np.abs(centered_x+centered_y*1.0j)
-    theta = np.angle(centered_x+centered_y*1.0j) - (np.pi / 2)
-
-    half_sigma_inf = ((sigma_inf / 2))
-
-    ar = (a / r)
-    ar_p_2 = np.power(ar, 2)
-    ar_p_4 = np.power(ar, 4)
-
-    cos2theta = np.cos(2*theta)
-    sin2theta = np.sin(2*theta)
-
-    sigma_rr = half_sigma_inf*(1-ar_p_2)+half_sigma_inf * \
-        (1-4*ar_p_2+3*ar_p_4)*cos2theta
-    sigma_thetatheta = half_sigma_inf * \
-        (1+ar_p_2)-half_sigma_inf*(1+3*ar_p_4)*cos2theta
-    tau_rtheta = -half_sigma_inf*(1+2*ar_p_2-3*ar_p_4)*sin2theta
-
-    VM = np.sqrt(np.square(sigma_rr)+np.square(sigma_thetatheta) -
-                 sigma_rr*sigma_thetatheta+3*np.square(tau_rtheta))
-
-    return VM
-
-
-def cut_plate(mshName):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    cutter = vtkC.Cutter(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, [0., 0., 0.5], [0., 0., 1.], tag_name='volume_id')
-    pts, tri, vals = cutter.extract(
-        c_output, 3, ['u', 'x', 'y', 'z'], atPoint=True)
-    pts_2, tri_2, vals_2 = cutter.extract(
-        c_output, 3, ['G', 'von Mises'], atPoint=False)
-    vals.update(vals_2)
-
-    return pts, tri, vals
-
-
-def cut_line(mshName, P1, P2):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    cutter = vtkC.LineExtractor(reader.reader.GetOutputPort())
-    c_output = cutter.cut(1, P1, P2, tag_name='volume_id')
-    pts, tri, vals = cutter.extract(
-        c_output, ['u', 'x', 'y', 'z'], atPoint=True)
-    pts_2, tri_2, vals_2 = cutter.extract(
-        c_output, ['G', 'von Mises'], atPoint=False)
-    vals.update(vals_2)
-
-    return pts, tri, vals
-
-
-def extract_quad_msh(mshName):
-    reader = vtkR.Reader()
-    reader.open(mshName)
-    rdata = reader.reader.GetOutput()
-
-    _pts = rdata.GetPoints()
-    pts = np.zeros((_pts.GetNumberOfPoints(), 2))
-    pts_indices = np.zeros((_pts.GetNumberOfPoints(),), dtype=int)
-    for i in range(0, pts.shape[0]):
-        if _pts.GetPoint(i)[2] <= 0.01:
-            for j in range(0, 2):
-                pts[i][j] = _pts.GetPoint(i)[j]
-            pts_indices[i] = 1
-    n_elems = rdata.GetNumberOfCells()
-    quad = []
-    for i in range(0, n_elems):
-        elem = rdata.GetCell(i)
-        for j in range(0, 6):
-            face = elem.GetFace(j)
-            points_id = np.zeros((4,), dtype=int)
-            good_face = True
-            for k in range(0, 4):
-                points_id[k] = face.GetPointId(k)
-                if pts_indices[points_id[k]] != 1:
-                    good_face = False
-                    break
-            if good_face:
-                if len(quad) == 0:
-                    quad = points_id.reshape((1, 4))
-                else:
-                    quad = np.append(quad, points_id.reshape((1, 4)), axis=0)
-    return pts, quad
-
-
-def plot_2D_cut_values_at_node(x, y, tri, value, v_min, v_max, n_levels=16):
-    import matplotlib.pyplot as plt
-    value = value.reshape((len(x),))
-    levels = np.linspace(v_min, v_max, n_levels)
-    print(levels)
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(x, y, tri, value, levels, linestyles='-',
-                   colors='black', linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, value, levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0,
-                        hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-
-def plot_2D_cut_values_at_elem(x, y, tri_1, value, v_min, v_max, n_levels=16, shading=False):
-    import matplotlib.pyplot as plt
-
-    value = value.reshape((tri_1.shape[0],))
-
-    levels = np.linspace(v_min, v_max, n_levels)
-    print(levels)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    if shading:
-        plt.tripcolor(x, y, tri_1, value, shading='gouraud')
-    else:
-        plt.tripcolor(x, y, tri_1, value, levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0,
-                        hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-
-def plot_2D_mesh(pts, quad):
-    import matplotlib.pyplot as plt
-    fig = plt.figure(figsize=(8, 8))
-    f = open('mesh_2.tex', 'w')
-    print('\begin{tikzpicture}', file=f)
-    for i in range(0, quad.shape[0]):
-        x = np.zeros((quad.shape[1]+1,))
-        y = np.zeros((quad.shape[1]+1,))
-        for j in range(0, quad.shape[1]):
-            x[j] = pts[quad[i, j], 0]
-            y[j] = pts[quad[i, j], 1]
-        x[-1] = pts[quad[i, 0], 0]
-        y[-1] = pts[quad[i, 0], 1]
-        string_1 = '\draw[thick] '
-        for j in range(0, quad.shape[1]+1):
-            string_1 = string_1 + '(' + str(x[j]) + ',' + str(y[j]) + ')'
-            if j == quad.shape[1]:
-                string_1 = string_1 + ';'
-            else:
-                string_1 = string_1 + '--'
-
-        print(string_1, file=f)
-        plt.plot(x, y, 'black')
-    plt.gca().set_aspect('equal')
-
-    print('\end{tikzpicture}', file=f)
-    f.closed
-
-
-def plot_1D_data_per_elem(pts, elems, vals):
-    import matplotlib.pyplot as plt
-
-    plt.figure()
-    for i in range(0, elems.shape[0]):
-        if i == 0:
-            x = np.array([pts[elems[i][0]], pts[elems[i][1]]])
-            y = np.array([vals[i], vals[i]])
-        else:
-            x = np.append(x, [pts[elems[i][0]], pts[elems[i][1]]])
-            y = np.append(y, [vals[i], vals[i]])
-
-    plt.plot(x, y, 'r')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    display = False
-
-    mshName_extended_1 = file_dir + \
-        '/../../../workspace/katoptron_CMAME_tests_plate_extended/plate_fused_ast1_s0_0'
-    mshName_extended_2 = file_dir + \
-        '/../../../workspace/katoptron_CMAME_tests_plate_extended_1/plate_fused_ast1_s0_0'
-    mshName_mean = file_dir + \
-        '/../../../workspace/katoptron_CMAME_tests_plate/plate_fused_ast1_s0_0'
-
-    i = 0
-    for mshName in [mshName_extended_1, mshName_extended_2, mshName_mean]:
-        if i == 2:
-            pts, tri, vals = cut_line(mshName, [5., 5., 0.5], [10, 5., 0.5])
-        else:
-            pts, tri, vals = cut_line(mshName, [5., 5., 0.5], [50, 5., 0.5])
-        VM_theory = Kirsch_equations(pts+5, np.zeros(pts.shape), 5, 0, 2, 700)
-        plot_1D_data_per_elem(pts, tri, vals['von Mises'])
-        plt.plot(pts, VM_theory)
-        plt.ylabel('[MPa]')
-        plt.xlabel('Pos')
-        plt.savefig('fig_'+str(i)+'.png')
-        i = i + 1
-    # plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMAME/slurm/blake_MC_MG.slurm.sh b/katoptron/CMAME/slurm/blake_MC_MG.slurm.sh
deleted file mode 100644
index a1025926185c079e1e975f6e5644fc338556ce85..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/slurm/blake_MC_MG.slurm.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=MC_MG
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/MC_MG.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=48
-export KMP_PLACE_THREADS=24c,2t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-function setEnsembleReduction(){
-  remove2env INCLUDE "${Trilinos_DIR}/include"
-  remove2env LIB "${Trilinos_DIR}/lib"
-  remove2env PYTHONPATH "${Trilinos_DIR}/lib/python2.7/site-packages"
-  remove2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages/PyTrilinos"
-  remove2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages"
-  remove2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib"
-  if [ “$1” == “false” ]; then
-    export Trilinos_DIR=$Trilinos_DIR_NO_ER
-    export Waves_DIR=$Waves_DIR_NO_ER
-    export ensemble_reduction="false"
-  else
-    export Trilinos_DIR=$Trilinos_DIR_ER
-    export Waves_DIR=$Waves_DIR_ER
-    export ensemble_reduction="true"
-  fi
-  add2env INCLUDE "${Trilinos_DIR}/include" end
-  add2env LIB "${Trilinos_DIR}/lib" end
-  add2env PYTHONPATH "${Trilinos_DIR}/lib/python2.7/site-packages" front
-  add2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages/PyTrilinos" end
-  add2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages" end
-  add2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib" end
-  cd $Waves_DIR
-}
-
-setEnsembleReduction false
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_MG_all_cases.py
-
-setEnsembleReduction true
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/CMAME/tests/plate_MC_MG_all_cases.py
diff --git a/katoptron/CMAME/tests/plate_MC_MG_all_cases.py b/katoptron/CMAME/tests/plate_MC_MG_all_cases.py
deleted file mode 100644
index fa7ce38900da4bdd8c47c37498590af122e0b0ae..0000000000000000000000000000000000000000
--- a/katoptron/CMAME/tests/plate_MC_MG_all_cases.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""@package docstring
-This test runs the four different cases as defined in table 2 of the paper
-with a SIMPLE-GS-GS preconditioner.
-"""
-
-
-
-
-
-import katoptron.CMAME.model as model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-
-def evaluate_one_ensemble(ensemble_size, case_id, first_sample_id, msh, comm,
-                          file_dir):
-    """
-    This function evaluates one ensemble for a given test case
-    """
-    work_dir = os.getcwd()
-    args = parseargs()
-
-    p = model.get_parameters(case_id, first_sample_id)
-    p['MueLu xml template file name'] = '/../../preconditioners/SIMPLE_gs_direct_lvl_MT.xml.in'
-
-    pm = model.plate_model(ensemble_size, np.array([0]), msh, comm, file_dir,
-                           work_dir, p)
-    pm.run()
-
-
-def evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir):
-    """
-    This function loop over the test cases, the ensemble sizes,
-    and the ensembles
-    """
-    for case_id in case_ids:
-        directory_case_id = 'case_' + str(case_id)
-        if not os.path.exists(directory_case_id):
-            os.makedirs(directory_case_id)
-        os.chdir(directory_case_id)
-        for ensemble_size in ensemble_sizes:
-            directory = str(ensemble_size)
-            if not os.path.exists(directory):
-                os.makedirs(directory)
-            os.chdir(directory)
-
-            N_ensemble = N // ensemble_size
-            for ensemble_index in range(0, N_ensemble):
-                directory = str(ensemble_index)
-                if not os.path.exists(directory):
-                    os.makedirs(directory)
-                os.chdir(directory)
-
-                first_sample_id = ensemble_index * ensemble_size
-
-                evaluate_one_ensemble(ensemble_size, case_id, first_sample_id,
-                                      msh, comm, file_dir)
-                os.chdir('..')
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    # Units in the meshes are in mm
-    msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                        'plate_2_tmp', 'plate_fused', file_dir + '/../mesh',
-                        work_dir, comm, rank, size)
-
-    deterministic = False
-
-    if deterministic:
-        N = 1
-        ensemble_sizes = [1]
-        case_ids = [0]
-    else:
-        N = 96
-        ensemble_sizes = [1, 8, 16, 24, 32]
-        case_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9]
-
-    nThreads = u.Initialize_Kokkos()
-    evaluate_all_ensembles(ensemble_sizes, case_ids, N, msh, comm, file_dir)
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/CMakeLists.txt b/katoptron/CMakeLists.txt
deleted file mode 100644
index 3b458a4307803b318d9b063163bec505e0e357bf..0000000000000000000000000000000000000000
--- a/katoptron/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# Kim, you need to set your dependencies here!
-
-# Add source and exe dir
-ADD_SUBDIRECTORY( src )
-ADD_SUBDIRECTORY( _src )
-
-ADD_SUBDIRECTORY( exe )
-
-# Add test dir
-MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests)
-MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests 2)
-
diff --git a/katoptron/Juelich/UQ/GS.py b/katoptron/Juelich/UQ/GS.py
deleted file mode 100644
index 34ad8a5f57fe01f22726ccd9374fb36421e916aa..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/GS.py
+++ /dev/null
@@ -1,290 +0,0 @@
-import numpy
-
-from katoptron.eigenvalues import *
-from scipy.sparse import eye
-import matplotlib.pyplot as plt
-import scipy
-
-import katoptron.utilities as u
-
-
-def spectral_radii_bound(A, omega_min=0., omega_max=2., n_omega=100):
-    from scipy.sparse import tril
-    from scipy.sparse import triu
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    from scipy.sparse import issparse
-
-    omegas = np.linspace(omega_min, omega_max, n_omega)
-    rhos = np.ones((n_omega, ))
-
-    Adiag = A.diagonal()
-
-    invD = diags(1. / Adiag, 0)
-
-    scaled_A = invD * A
-
-    L = -tril(scaled_A, -1)
-    U = -triu(scaled_A, 1)
-
-    n = A.shape[0]
-
-    #n = 100
-
-    l_n = np.zeros((n, ))
-    u_n = np.zeros((n, ))
-
-    l_2n = np.zeros((n, n - 1))
-    u_2n = np.zeros((n, n - 1))
-
-    T_l_n = np.zeros((n, ))
-    T_u_n = np.zeros((n, ))
-    L_abs = np.abs(L)
-    U_abs = np.abs(U)
-
-    l_n = L_abs.sum(axis=1)
-    u_n = U_abs.sum(axis=1)
-
-    T_l_n = L_abs.max(axis=1)
-    T_u_n = U_abs.max(axis=1)
-
-    if np.max(l_n) > 1:
-        print('error')
-        return omegas, rhos
-    if np.max(T_l_n) > 1:
-        print('error')
-        return omegas, rhos
-    '''
-    for i in range(0,n):
-        print i
-        print n
-        tmp = L.getrow(i)
-        T_l_n[i] = np.max(np.abs(tmp))
-        tmp = U.getrow(i)
-        T_l_n[i] = np.max(np.abs(tmp))
-    '''
-
-    for i in range(0, n):
-        for j in range(0, i):
-            u_2n[i, j] = u_n[i] + u_n[j]
-            l_2n[i, j] = l_n[i] + l_n[j]
-        for j in range(i + 1, n):
-            u_2n[i, j - 1] = u_n[i] + u_n[j]
-            l_2n[i, j - 1] = l_n[i] + l_n[j]
-
-    for omega_i in range(0, n_omega):
-        omega = omegas[omega_i]
-
-        tmp_1 = np.divide(2 * np.abs(1 - omega) + omega * u_2n,
-                          2. - omega * l_2n)
-
-        max_1 = np.amax(tmp_1)
-
-        tmp_2 = np.zeros((n, ))
-        for i in range(0, n):
-            scalar_1 = ((np.abs(1 - omega) + omega * u_n[i]) / (1 -
-                                                                      omega * l_n[i]))
-            scalar_2 = ((np.abs(1 - omega)) / (1 - omega * T_u_n[i]))
-            scalar_3 = np.abs(1 - omega) + omega * u_n[i]
-            scalar_4 = np.max([scalar_2, scalar_3])
-            tmp_2[i] = np.min([scalar_1, scalar_4])
-
-        max_2 = np.max(tmp_2)
-
-        rhos[i] = np.max([max_1, max_2])
-
-    return omegas, rhos
-
-
-def is_Z_matrix(A):
-    from scipy.sparse import diags
-    Adiag = A.diagonal()
-
-    D = diags(Adiag, 0)
-
-    Aoff = A - D
-
-    max_row = Aoff.max(axis=1)
-
-    if np.max(max_row) <= 0:
-        return True
-    else:
-        return False
-
-
-def is_M_matrix(A):
-    is_Z = is_Z_matrix(A)
-    if not is_Z:
-        return False
-    is_spd = is_SPD(A)
-
-    return is_spd
-
-
-def spectral_radii(A, omegas, n_power=10):
-    from scipy.sparse import tril
-    from scipy.sparse import triu
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    from scipy.sparse import issparse
-
-    n_omega = len(omegas)
-    rhos = np.ones((n_omega, ))
-
-    E = -tril(A, -1)
-    F = -triu(A, 1)
-    invD = diags(1. / A.diagonal(), 0)
-    n = A.shape[0]
-    I = eye(n)
-
-    for omega_i in range(0, n_omega):
-        #print omega_i
-        omega = omegas[omega_i]
-        if omega == 0. or omega == 2.:
-            rhos[omega_i] = 1.
-        else:
-            N = I - omega * invD * E
-            M = (1. - omega) * I + omega * invD * F
-            rhos[omega_i] = np.min([gen_power_method(M, N, n=n_power), 1.])
-
-        #print rhos
-
-    return rhos
-
-
-def main():
-    comm, rank, siz = u.import_MPI()
-
-    post_process = True
-
-    #base_dir = '/Volumes/HD_SONY/Thesis/Juelich/GS/order_44/1/0/'
-
-    #A_u = read_mm(base_dir+'A_00_mm.txt', -1, True, True, False)
-    #A_T = read_mm(base_dir+'A_11_mm.txt', -1, True, True, True)
-
-    # scipy.sparse.save_npz('A_T.npz',A_T)
-    # scipy.sparse.save_npz('A_u.npz',A_u)
-
-    if post_process:
-        omegas = np.loadtxt('omegas.txt')
-        rho_T = np.loadtxt('rho_T.txt')
-        rho_u = np.loadtxt('rho_u.txt')
-
-        omegas = np.loadtxt('results_3/omegas.txt')
-        rho_T = np.loadtxt('results_3/rho_T.txt')
-        rho_u_A = np.loadtxt('results_3/rho_u_A.txt')
-        rho_u_B = np.loadtxt('results_3/rho_u_B.txt')
-
-        rho_T[omegas >= 1.75] = 1.
-        i_T = np.argmin(rho_T)
-        i_u_A = np.argmin(rho_u_A)
-        i_u_B = np.argmin(rho_u_B)
-
-        print(omegas[i_T])
-        print(omegas[i_u_A])
-        print(omegas[i_u_B])
-
-        plt.figure()
-        plt.plot(omegas, rho_T)
-        plt.plot(omegas, rho_u_A)
-        plt.plot(omegas, rho_u_B)
-        plt.show()
-
-    else:
-        print('Read data: start')
-
-        A_T = scipy.sparse.load_npz('A_T.npz')
-        A_u_A = scipy.sparse.load_npz('A_u.npz')
-        A_u_B = scipy.sparse.load_npz('A_u_B.npz')
-
-        print('Read data: end ' + str(siz))
-
-        print('Spectral radius computation')
-
-        n_omega = 201
-        n_power = 100
-        omegas = np.linspace(0., 2., n_omega)
-
-        n_omega_per_MPI = int(np.floor(float(n_omega) / siz))
-        my_first_i = n_omega_per_MPI * rank
-        my_last_i = my_first_i + n_omega_per_MPI
-        n_my_data = my_last_i-my_first_i
-
-        omegas_tmp = omegas[my_first_i:my_last_i]
-
-        rho_u_A = np.ones((n_omega, 1))
-        rho_u_B = np.ones((n_omega, 1))
-        rho_T = np.zeros((n_omega, 1))
-
-        rho_u_A_tmp = spectral_radii(A_u_A, omegas_tmp, n_power=n_power)
-        rho_u_B_tmp = spectral_radii(A_u_B, omegas_tmp, n_power=n_power)
-        rho_T_tmp = spectral_radii(A_T, omegas_tmp, n_power=n_power)
-
-        if rank == 0:
-            np.savetxt('omegas_'+str(rank)+'.txt', omegas_tmp)
-            np.savetxt('rho_T_'+str(rank)+'.txt', rho_T_tmp)
-            np.savetxt('rho_u_'+str(rank)+'_A.txt', rho_u_A_tmp)
-            np.savetxt('rho_u_'+str(rank)+'_B.txt', rho_u_B_tmp)
-
-            if n_my_data > 1:
-                for j in range(0, n_my_data):
-                    rho_u_A[my_first_i+j] = rho_u_A_tmp[j]
-                    rho_u_B[my_first_i+j] = rho_u_B_tmp[j]
-                    rho_T[my_first_i+j] = rho_T_tmp[j]
-            else:
-                rho_u_A[my_first_i] = rho_u_A_tmp
-                rho_u_B[my_first_i] = rho_u_B_tmp
-                rho_T[my_first_i] = rho_T_tmp
-
-            for i in range(1, siz):
-                first_i = n_omega_per_MPI * i
-                last_i = first_i + n_omega_per_MPI
-
-                n_data = last_i-first_i
-
-                data = comm.recv(source=i, tag=11)
-
-                if n_data > 1:
-                    for j in range(0, n_data):
-                        rho_u_A[first_i+j] = data[j]
-                else:
-                    rho_u_A[first_i] = data
-
-                data = comm.recv(source=i, tag=11)
-
-                if n_data > 1:
-                    for j in range(0, n_data):
-                        rho_u_B[first_i+j] = data[j]
-                else:
-                    rho_u_B[first_i] = data
-
-                data = comm.recv(source=i, tag=11)
-
-                if n_data > 1:
-                    for j in range(0, n_data):
-                        rho_T[first_i+j] = data[j]
-                else:
-                    rho_T[first_i] = data
-        else:
-            np.savetxt('omegas_'+str(rank)+'.txt', omegas_tmp)
-            np.savetxt('rho_T_'+str(rank)+'.txt', rho_T_tmp)
-            np.savetxt('rho_u_'+str(rank)+'_A.txt', rho_u_A_tmp)
-            np.savetxt('rho_u_'+str(rank)+'_B.txt', rho_u_B_tmp)
-            comm.send(rho_u_A_tmp, dest=0, tag=11)
-            comm.send(rho_u_B_tmp, dest=0, tag=11)
-            comm.send(rho_T_tmp, dest=0, tag=11)
-
-        if rank == 0:
-            print(omegas)
-            print(rho_T)
-            print(rho_u_A)
-            print(rho_u_B)
-
-            np.savetxt('omegas.txt', omegas)
-            np.savetxt('rho_T.txt', rho_T)
-            np.savetxt('rho_u_A.txt', rho_u_A)
-            np.savetxt('rho_u_B.txt', rho_u_B)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/GS_2.py b/katoptron/Juelich/UQ/GS_2.py
deleted file mode 100644
index ca05f67529eab9ed0812d4f5bccff866aed7a016..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/GS_2.py
+++ /dev/null
@@ -1,198 +0,0 @@
-import numpy
-
-from katoptron.eigenvalues import *
-from scipy.sparse import eye
-import matplotlib.pyplot as plt
-import scipy
-
-import katoptron.utilities as u
-
-
-def spectral_radii_bound(A, omega_min=0., omega_max=2., n_omega=100):
-    from scipy.sparse import tril
-    from scipy.sparse import triu
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    from scipy.sparse import issparse
-
-    omegas = np.linspace(omega_min, omega_max, n_omega)
-    rhos = np.ones((n_omega, ))
-
-    Adiag = A.diagonal()
-
-    invD = diags(1. / Adiag, 0)
-
-    scaled_A = invD * A
-
-    L = -tril(scaled_A, -1)
-    U = -triu(scaled_A, 1)
-
-    n = A.shape[0]
-
-    #n = 100
-
-    l_n = np.zeros((n, ))
-    u_n = np.zeros((n, ))
-
-    l_2n = np.zeros((n, n - 1))
-    u_2n = np.zeros((n, n - 1))
-
-    T_l_n = np.zeros((n, ))
-    T_u_n = np.zeros((n, ))
-    L_abs = np.abs(L)
-    U_abs = np.abs(U)
-
-    l_n = L_abs.sum(axis=1)
-    u_n = U_abs.sum(axis=1)
-
-    T_l_n = L_abs.max(axis=1)
-    T_u_n = U_abs.max(axis=1)
-
-    if np.max(l_n) > 1:
-        print('error')
-        return omegas, rhos
-    if np.max(T_l_n) > 1:
-        print('error')
-        return omegas, rhos
-    '''
-    for i in range(0,n):
-        print i
-        print n
-        tmp = L.getrow(i)
-        T_l_n[i] = np.max(np.abs(tmp))
-        tmp = U.getrow(i)
-        T_l_n[i] = np.max(np.abs(tmp))
-    '''
-
-    for i in range(0, n):
-        for j in range(0, i):
-            u_2n[i, j] = u_n[i] + u_n[j]
-            l_2n[i, j] = l_n[i] + l_n[j]
-        for j in range(i + 1, n):
-            u_2n[i, j - 1] = u_n[i] + u_n[j]
-            l_2n[i, j - 1] = l_n[i] + l_n[j]
-
-    for omega_i in range(0, n_omega):
-        omega = omegas[omega_i]
-
-        tmp_1 = np.divide(2 * np.abs(1 - omega) + omega * u_2n,
-                          2. - omega * l_2n)
-
-        max_1 = np.amax(tmp_1)
-
-        tmp_2 = np.zeros((n, ))
-        for i in range(0, n):
-            scalar_1 = ((np.abs(1 - omega) + omega * u_n[i]) / (1 -
-                                                                      omega * l_n[i]))
-            scalar_2 = ((np.abs(1 - omega)) / (1 - omega * T_u_n[i]))
-            scalar_3 = np.abs(1 - omega) + omega * u_n[i]
-            scalar_4 = np.max([scalar_2, scalar_3])
-            tmp_2[i] = np.min([scalar_1, scalar_4])
-
-        max_2 = np.max(tmp_2)
-
-        rhos[i] = np.max([max_1, max_2])
-
-    return omegas, rhos
-
-
-def is_Z_matrix(A):
-    from scipy.sparse import diags
-    Adiag = A.diagonal()
-
-    D = diags(Adiag, 0)
-
-    Aoff = A - D
-
-    max_row = Aoff.max(axis=1)
-
-    if np.max(max_row) <= 0:
-        return True
-    else:
-        return False
-
-
-def is_M_matrix(A):
-    is_Z = is_Z_matrix(A)
-    if not is_Z:
-        return False
-    is_spd = is_SPD(A)
-
-    return is_spd
-
-
-def spectral_radii(A, omegas, n_power=10):
-    from scipy.sparse import tril
-    from scipy.sparse import triu
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    from scipy.sparse import issparse
-
-    n_omega = len(omegas)
-    rhos = np.ones((n_omega, ))
-
-    E = -tril(A, -1)
-    F = -triu(A, 1)
-    invD = diags(1. / A.diagonal(), 0)
-    n = A.shape[0]
-    I = eye(n)
-
-    for omega_i in range(0, n_omega):
-        #print omega_i
-        omega = omegas[omega_i]
-        if omega == 0. or omega == 2.:
-            rhos[omega_i] = 1.
-        else:
-            N = I - omega * invD * E
-            M = (1. - omega) * I + omega * invD * F
-            rhos[omega_i] = np.min([gen_power_method(M, N, n=n_power), 1.])
-
-        #print rhos
-
-    return rhos
-
-
-def main():
-    comm, rank, siz = u.import_MPI()
-
-    post_process = True
-
-    base_dir = '/Users/kimliegeois/Desktop/preload/katoptron_tests_1_cube_tet_block_5/1/'
-
-    A = read_mm(base_dir+'A_mm_after_bc.txt', -1)
-    A_u = read_mm(base_dir+'A_00_mm.txt', -1, True, True, False)
-    A_T = read_mm(base_dir+'A_11_mm.txt', -1, True, True, True)
-
-    B = jacobi_iteration_matrix(A)
-    B_u = jacobi_iteration_matrix(get_symmetrical_part(A_u))
-    B_T = jacobi_iteration_matrix(A_T)
-
-    sp = spectral_radius(B)
-    sp_u = spectral_radius(B_u)
-    sp_T = spectral_radius(B_T)
-
-    A_u_f = A_u.todense()
-    index = np.array([3, 4, 5, 15, 16, 17, 18, 19, 20, 21, 22, 23])
-    # => rho = 0.875 (sum off diag = 1.8904321, diag = 2.16049383) nu = 0.2
-    index = np.array([3, 15, 18, 21])
-    index = np.array([4, 16, 19, 22])  # => rho = 0.875
-    # index = np.array([5,17,20,23]) #=> rho = 0.4285714285714285 nu = 0.2
-    # => rho = .3035714285714295 (sum off diag = 3.2793209800000005, diag = 2.16049383) nu = 0.2
-    index = np.array([3, 4, 15, 16, 18, 19, 21, 22])
-    # if nu = 0 OK! rho(B_u) = 0.8125
-    A_u_f_1 = A_u_f[index, :]
-    A_u_f_2 = A_u_f_1[:, index]
-    print(A_u_f_2)
-    print(sp)
-    print(sp_u)
-    print(sp_T)
-
-    B_u = jacobi_iteration_matrix(scipy.sparse.csr_matrix(A_u_f_2))
-
-    print(B_u.todense())
-    sp_u = spectral_radius(B_u)
-    print(sp_u)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/__init__.py b/katoptron/Juelich/UQ/__init__.py
deleted file mode 100644
index e8aed8a0e2f77220f1adb944a0e00d317b1934bc..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# -*- coding: utf-8 -*-
-# katoptron.Juelich.post_process MODULE initialization file
diff --git a/katoptron/Juelich/UQ/copulas.py b/katoptron/Juelich/UQ/copulas.py
deleted file mode 100644
index 118c368de56f2a0c05ddace73064aeaa7644403f..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/copulas.py
+++ /dev/null
@@ -1,12 +0,0 @@
-
-from scipy.stats import lognorm
-import numpy as np
-
-
-def lognormal(points, means, sigmas):
-    randomVariable = np.zeros(points.shape)
-    for i in range(0, points.shape[0]):
-        randomVariable[i, :] = lognorm.ppf(points[i, :],
-                                           sigmas[i],
-                                           scale=np.exp(means[i]))
-    return randomVariable
diff --git a/katoptron/Juelich/UQ/halton.py b/katoptron/Juelich/UQ/halton.py
deleted file mode 100644
index 0fc60976907f756741fc1ea70b9bb9512eec8248..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/halton.py
+++ /dev/null
@@ -1,392 +0,0 @@
-def halton ( i, m ):
-
-#*****************************************************************************80
-#
-## HALTON computes an element of a Halton sequence.
-#
-#  Licensing:
-#
-#    This code is distributed under the GNU LGPL license.
-#
-#  Modified:
-#
-#    10 August 2016
-#
-#  Author:
-#
-#    John Burkardt
-#
-#  Reference:
-#
-#    John Halton,
-#    On the efficiency of certain quasi-random sequences of points
-#    in evaluating multi-dimensional integrals,
-#    Numerische Mathematik,
-#    Volume 2, pages 84-90, 1960.
-#
-#  Parameters:
-#
-#    Input, integer I, the index of the element of the sequence.
-#    0 <= I.
-#
-#    Input, integer M, the spatial dimension.
-#    1 <= M <= 1600.
-#
-#    Output, real R(M), the element of the sequence with index I.
-#
-  import numpy as np
-
-  i = int ( i )
-
-  t = np.ones ( m )
-
-  t = i * t
-#
-#  Carry out the computation.
-#
-  prime_inv = np.zeros ( m )
-  for j in range ( 0, m ):
-    prime_inv[j] = 1.0 / float ( prime ( j ) )
-
-  r = np.zeros ( m )
-
-  while ( 0 < np.sum ( t ) ):
-    for j in range ( 0, m ):
-      d = ( t[j] % prime ( j ) )
-      r[j] = r[j] + float ( d ) * prime_inv[j]
-      prime_inv[j] = (prime_inv[j] / prime ( j ))
-      t[j] = ( t[j] // prime ( j ) )
-
-  return r
-
-def halton_base ( i, m, b ):
-
-#*****************************************************************************80
-#
-## HALTON_BASE computes an element of a Halton sequence with user bases.
-#
-#  Licensing:
-#
-#    This code is distributed under the GNU LGPL license.
-#
-#  Modified:
-#
-#    11 August 2016
-#
-#  Author:
-#
-#    John Burkardt
-#
-#  Reference:
-#
-#    John Halton,
-#    On the efficiency of certain quasi-random sequences of points
-#    in evaluating multi-dimensional integrals,
-#    Numerische Mathematik,
-#    Volume 2, pages 84-90, 1960.
-#
-#  Parameters:
-#
-#    Input, integer I, the index of the element of the sequence.
-#    0 <= I.
-#
-#    Input, integer M, the spatial dimension.
-#
-#    Input, integer B(M), the bases to use for each dimension.
-#
-#    Output, real R(M), the element of the sequence with index I.
-#
-  import numpy as np
-
-  i = int ( i )
-
-  t = np.ones ( m )
-
-  t = i * t
-#
-#  Carry out the computation.
-#
-  b_inv = np.zeros ( m )
-  for j in range ( 0, m ):
-    b_inv[j] = 1.0 / b[j]
-
-  r = np.zeros ( m )
-
-  while ( 0 < np.sum ( t ) ):
-    for j in range ( 0, m ):
-      d = ( t[j] % b[j] )
-      r[j] = r[j] + float ( d ) * b_inv[j]
-      b_inv[j] = (b_inv[j] / b[j])
-      t[j] = ( t[j] // b[j] )
-
-  return r
-
-def halton_inverse ( r, m ):
-
-#*****************************************************************************80
-#
-## HALTON_INVERSE inverts an element of the Halton sequence.
-#
-#  Licensing:
-#
-#    This code is distributed under the GNU LGPL license.
-#
-#  Modified:
-#
-#    10 August 2016
-#
-#  Author:
-#
-#    John Burkardt
-#
-#  Parameters:
-#
-#    Input, real R(M), the I-th element of the Halton sequence.
-#    0 <= R < 1.0
-#
-#    Input, integer M, the spatial dimension.
-#
-#    Output, integer I, the index of the element of the sequence.
-#
-  import numpy as np
-  from sys import exit
-
-  for j in range ( 0, m ):
-    if ( r[j] < 0.0 or 1.0 <= r[j] ):
-      print ( '' )
-      print ( 'HALTON_INVERSE - Fatal error!' )
-      print ( '  0 <= R < 1.0 is required.' )
-      exit ( 'HALTON_INVERSE - Fatal error!' )
-#
-#  Compute the index based on the first component,
-#  because base 2 is reliable.
-#
-  t = r[0]
-  i = 0
-  p = 1
-
-  while ( t != 0 ):
-    t = t * 2.0
-    d = np.floor ( t )
-    i = i + d * p
-    p = p * 2
-    t = t - d
-
-  return i
-
-def prime ( n ):
-
-#*****************************************************************************80
-#
-##  PRIME returns returns any of the first PRIME_MAX prime numbers.
-#
-#  Discussion:
-#
-#    PRIME_MAX is 1600, and the largest prime stored is 13499.
-#
-#    Thanks to Bart Vandewoestyne for pointing out a typo, 18 February 2005.
-#
-#  Licensing:
-#
-#    This code is distributed under the GNU LGPL license. 
-#
-#  Modified:
-#
-#    05 December 2014
-#
-#  Author:
-#
-#    John Burkardt
-#
-#  Reference:
-#
-#    Milton Abramowitz and Irene Stegun,
-#    Handbook of Mathematical Functions,
-#    US Department of Commerce, 1964, pages 870-873.
-#
-#    Daniel Zwillinger,
-#    CRC Standard Mathematical Tables and Formulae,
-#    30th Edition,
-#    CRC Press, 1996, pages 95-98.
-#
-#  Parameters:
-#
-#    Input, integer N, the index of the desired prime number.
-#    In general, is should be true that 0 <= N < PRIME_MAX.
-#
-#    Output, integer P, the N-th prime. 
-#
-  import numpy as np
-  from sys import exit
-
-  prime_max = 1600
-
-  prime_vector = np.array ( [
-        2,    3,    5,    7,   11,   13,   17,   19,   23,   29, \
-       31,   37,   41,   43,   47,   53,   59,   61,   67,   71, \
-       73,   79,   83,   89,   97,  101,  103,  107,  109,  113, \
-      127,  131,  137,  139,  149,  151,  157,  163,  167,  173, \
-      179,  181,  191,  193,  197,  199,  211,  223,  227,  229, \
-      233,  239,  241,  251,  257,  263,  269,  271,  277,  281, \
-      283,  293,  307,  311,  313,  317,  331,  337,  347,  349, \
-      353,  359,  367,  373,  379,  383,  389,  397,  401,  409, \
-      419,  421,  431,  433,  439,  443,  449,  457,  461,  463, \
-      467,  479,  487,  491,  499,  503,  509,  521,  523,  541, \
-      547,  557,  563,  569,  571,  577,  587,  593,  599,  601, \
-      607,  613,  617,  619,  631,  641,  643,  647,  653,  659, \
-      661,  673,  677,  683,  691,  701,  709,  719,  727,  733, \
-      739,  743,  751,  757,  761,  769,  773,  787,  797,  809, \
-      811,  821,  823,  827,  829,  839,  853,  857,  859,  863, \
-      877,  881,  883,  887,  907,  911,  919,  929,  937,  941, \
-      947,  953,  967,  971,  977,  983,  991,  997, 1009, 1013, \
-     1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, \
-     1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, \
-     1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, \
-     1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, \
-     1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, \
-     1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, \
-     1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, \
-     1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, \
-     1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, \
-     1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, \
-     1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, \
-     1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, \
-     1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, \
-     1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, \
-     2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, \
-     2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, \
-     2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, \
-     2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, \
-     2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, \
-     2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, \
-     2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, \
-     2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, \
-     2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, \
-     2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, \
-     2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, \
-     2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, \
-     3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, \
-     3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, \
-     3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, \
-     3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, \
-     3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, \
-     3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, \
-     3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, \
-     3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, \
-     3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, \
-     3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, \
-     3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, \
-     3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, \
-     4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, \
-     4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, \
-     4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, \
-     4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, \
-     4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, \
-     4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, \
-     4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, \
-     4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, \
-     4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, \
-     4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, \
-     4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, \
-     4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, \
-     5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, \
-     5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, \
-     5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, \
-     5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, \
-     5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, \
-     5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, \
-     5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, \
-     5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, \
-     5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, \
-     5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, \
-     5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, \
-     5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, \
-     6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, \
-     6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, \
-     6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, \
-     6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, \
-     6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, \
-     6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, \
-     6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, \
-     6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, \
-     6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, \
-     6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, \
-     6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, \
-     7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, \
-     7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, \
-     7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, \
-     7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, \
-     7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, \
-     7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, \
-     7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, \
-     7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, \
-     7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, \
-     7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, \
-     7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, \
-     8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, \
-     8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, \
-     8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, \
-     8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, \
-     8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, \
-     8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, \
-     8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, \
-     8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, \
-     8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, \
-     8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, \
-     8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, \
-     9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, \
-     9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, \
-     9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, \
-     9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, \
-     9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, \
-     9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, \
-     9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, \
-     9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, \
-     9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, \
-     9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, \
-     9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973,10007, \
-    10009,10037,10039,10061,10067,10069,10079,10091,10093,10099, \
-    10103,10111,10133,10139,10141,10151,10159,10163,10169,10177, \
-    10181,10193,10211,10223,10243,10247,10253,10259,10267,10271, \
-    10273,10289,10301,10303,10313,10321,10331,10333,10337,10343, \
-    10357,10369,10391,10399,10427,10429,10433,10453,10457,10459, \
-    10463,10477,10487,10499,10501,10513,10529,10531,10559,10567, \
-    10589,10597,10601,10607,10613,10627,10631,10639,10651,10657, \
-    10663,10667,10687,10691,10709,10711,10723,10729,10733,10739, \
-    10753,10771,10781,10789,10799,10831,10837,10847,10853,10859, \
-    10861,10867,10883,10889,10891,10903,10909,10937,10939,10949, \
-    10957,10973,10979,10987,10993,11003,11027,11047,11057,11059, \
-    11069,11071,11083,11087,11093,11113,11117,11119,11131,11149, \
-    11159,11161,11171,11173,11177,11197,11213,11239,11243,11251, \
-    11257,11261,11273,11279,11287,11299,11311,11317,11321,11329, \
-    11351,11353,11369,11383,11393,11399,11411,11423,11437,11443, \
-    11447,11467,11471,11483,11489,11491,11497,11503,11519,11527, \
-    11549,11551,11579,11587,11593,11597,11617,11621,11633,11657, \
-    11677,11681,11689,11699,11701,11717,11719,11731,11743,11777, \
-    11779,11783,11789,11801,11807,11813,11821,11827,11831,11833, \
-    11839,11863,11867,11887,11897,11903,11909,11923,11927,11933, \
-    11939,11941,11953,11959,11969,11971,11981,11987,12007,12011, \
-    12037,12041,12043,12049,12071,12073,12097,12101,12107,12109, \
-    12113,12119,12143,12149,12157,12161,12163,12197,12203,12211, \
-    12227,12239,12241,12251,12253,12263,12269,12277,12281,12289, \
-    12301,12323,12329,12343,12347,12373,12377,12379,12391,12401, \
-    12409,12413,12421,12433,12437,12451,12457,12473,12479,12487, \
-    12491,12497,12503,12511,12517,12527,12539,12541,12547,12553, \
-    12569,12577,12583,12589,12601,12611,12613,12619,12637,12641, \
-    12647,12653,12659,12671,12689,12697,12703,12713,12721,12739, \
-    12743,12757,12763,12781,12791,12799,12809,12821,12823,12829, \
-    12841,12853,12889,12893,12899,12907,12911,12917,12919,12923, \
-    12941,12953,12959,12967,12973,12979,12983,13001,13003,13007, \
-    13009,13033,13037,13043,13049,13063,13093,13099,13103,13109, \
-    13121,13127,13147,13151,13159,13163,13171,13177,13183,13187, \
-    13217,13219,13229,13241,13249,13259,13267,13291,13297,13309, \
-    13313,13327,13331,13337,13339,13367,13381,13397,13399,13411, \
-    13417,13421,13441,13451,13457,13463,13469,13477,13487,13499 ] )
-
-  if ( n < 0 or prime_max <= n ):
-    print ( '' )
-    print ( 'PRIME - Fatal error!' )
-    print ( '  0 <= N < %d' % ( prime_max ) )
-    exit ( 'PRIME - Fatal error!' )
-
-  return prime_vector[n]
\ No newline at end of file
diff --git a/katoptron/Juelich/UQ/kde.py b/katoptron/Juelich/UQ/kde.py
deleted file mode 100644
index bec1e921e19a1e1f26381fdfa924bd02a4c9ddc0..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/kde.py
+++ /dev/null
@@ -1,70 +0,0 @@
-
-import numpy as np
-import matplotlib.pyplot as plt
-import scipy.stats as st
-
-
-def compute_kde(A):
-    # Take a 2D array of m x n entries where n is the number of samples
-    # and m the number of QoI
-
-    kernel = st.gaussian_kde(A)
-    return kernel
-
-
-def resample_kde(kernel, n_samples):
-    # Sample the QoI based on the estimated pdf
-
-    samples = kernel.resample(size=n_samples)
-    return samples
-
-
-def box_prob_MC(kernel, min_bounds, max_bounds, n_samples):
-    # Evaluate the probability to be in a box
-
-    samples = resample_kde(kernel, n_samples)
-
-    insamples = np.ones((n_samples,))
-    for j in range(0, n_samples):
-        for i in range(0, len(min_bounds)):
-            insamples[j] = bool(insamples[j]) & (
-                samples[i, j] >= min_bounds[i]) & (samples[i, j] <= max_bounds[i])
-
-    prob = np.sum(insamples)/float(n_samples)
-
-    return prob
-
-
-def plot_kde(kernel, xbounds, ybounds, fixed_values, random_index):
-
-    xx, yy = np.mgrid[xbounds[0]:xbounds[1]:100j, ybounds[0]:ybounds[1]:100j]
-
-    positions_x = xx.ravel()
-    positions_y = yy.ravel()
-
-    positions = np.zeros((len(fixed_values)+2, len(positions_x)))
-
-    fixed_i = 0
-
-    for i in range(0, positions.shape[0]):
-        if i == random_index[0]:
-            positions[i, :] = positions_x
-        elif i == random_index[1]:
-            positions[i, :] = positions_y
-        else:
-            positions[i, :] = fixed_values[fixed_i] * \
-                np.ones(positions[i, :].shape)
-            fixed_i = fixed_i + 1
-
-    f = np.reshape(kernel(positions).T, xx.shape)
-
-    fig = plt.figure(figsize=(8, 8))
-    ax = fig.gca()
-    ax.set_xlim(xbounds[0], xbounds[1])
-    ax.set_ylim(ybounds[0], ybounds[1])
-    cfset = ax.contourf(xx, yy, f, cmap='coolwarm')
-    ax.imshow(np.rot90(f), cmap='coolwarm', extent=[
-              xbounds[0], xbounds[1], ybounds[0], ybounds[1]])
-    cset = ax.contour(xx, yy, f, colors='k')
-    ax.clabel(cset, inline=1, fontsize=10)
-    return fig, ax
diff --git a/katoptron/Juelich/UQ/mirror.py b/katoptron/Juelich/UQ/mirror.py
deleted file mode 100644
index 5a79cdafbea109a8678e9de9e71707946ff24600..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/mirror.py
+++ /dev/null
@@ -1,605 +0,0 @@
-
-
-
-
-
-import numpy as np
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-import matplotlib.tri as mtri
-
-from katoptron.Juelich.UQ.kde import *
-import katoptron.utilities as u
-
-
-def convergence_qoi(qoi):
-    mean_qoi = np.zeros((len(qoi), ))
-    for i in range(0, len(qoi)):
-        mean_qoi[i] = np.mean(qoi[0:i])
-    return mean_qoi
-
-
-def compute_qoi(base_dir, ensemble_size, ensemble_index, l):
-    OAX, OAY = 0.0595, 0.017
-    npzfile = np.load(base_dir + str(ensemble_size) + '/' +
-                      str(ensemble_index) + '/mirror_data_all.npz')
-    x = npzfile['x']
-    y = npzfile['y']
-    z = 0. * x
-    dz = npzfile['dz']
-    T = npzfile['T']
-    tri = npzfile['tri']
-    optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz[:, l], "m", np.array([OAX, OAY]))
-    print(optical_coefficients)
-    return [
-        np.max(T[:, l]),
-        np.min(T[:, l]),
-        np.mean(T[:, l]), 1000 * np.mean(dz[:, l]), optical_coefficients[0],
-        optical_coefficients[1], optical_coefficients[2],
-        optical_coefficients[3], optical_coefficients[4]
-    ]  # optical_coefficients[0]]
-
-
-def irregularly_plot(x,
-                     y,
-                     z,
-                     x_min,
-                     x_max,
-                     y_min,
-                     y_max,
-                     ngridx=400,
-                     ngridy=400,
-                     scale=1):
-
-    xi = np.linspace(x_min, x_max, ngridx)
-    yi = np.linspace(y_min, y_max, ngridy)
-
-    triang = mtri.Triangulation(x, y)
-    interpolator = mtri.LinearTriInterpolator(triang, z)
-    Xi, Yi = np.meshgrid(xi, yi)
-    zi = interpolator(Xi, Yi)
-
-    #fig = plt.figure()
-    #ax = fig.gca(projection='3d')
-    #ax.plot_surface(Xi, Yi, zi, cmap='jet',vmin=np.amin(z),vmax=np.amax(z))
-    #ax.scatter(x,y,z)
-
-    fig = plt.figure()
-    ax = fig.gca()
-    levels = np.linspace(np.amin(z * scale),
-                         np.amax(z * scale),
-                         16,
-                         endpoint=True)
-
-    cf = ax.contourf(Xi, Yi, zi * scale, levels, cmap="jet")
-    ax.contour(xi, yi, zi * scale, levels, linewidths=0.5, colors='k')
-    ax.set_aspect('equal')
-
-    cbar = fig.colorbar(cf, ticks=levels)
-
-    return fig, cbar
-
-
-def irregularly_tol_plot(x,
-                         y,
-                         QoI,
-                         x_min,
-                         x_max,
-                         y_min,
-                         y_max,
-                         ngridx=200,
-                         ngridy=200,
-                         scale=1.):
-
-    xi = np.linspace(x_min, x_max, ngridx)
-    yi = np.linspace(y_min, y_max, ngridy)
-
-    triang = mtri.Triangulation(x, y)
-    interpolator_0 = mtri.LinearTriInterpolator(triang, QoI[0, :])
-    interpolator_1 = mtri.LinearTriInterpolator(triang, QoI[1, :])
-    interpolator_2 = mtri.LinearTriInterpolator(triang, QoI[2, :])
-    interpolator_3 = mtri.LinearTriInterpolator(triang, QoI[3, :])
-    interpolator_4 = mtri.LinearTriInterpolator(triang, QoI[4, :])
-
-    Xi, Yi = np.meshgrid(xi, yi)
-
-    z_0 = interpolator_0(Xi, Yi)
-    z_1 = interpolator_1(Xi, Yi)
-    z_2 = interpolator_2(Xi, Yi)
-    z_3 = interpolator_3(Xi, Yi)
-    z_4 = interpolator_4(Xi, Yi)
-
-    z_5 = np.copy(z_0)
-
-    for i in range(0, z_0.shape[0]):
-        for j in range(0, z_0.shape[1]):
-            if np.isfinite(z_0[i, j]):
-                z_5[i, j] = u.check_optical_tolerance(
-                    [z_0[i, j], z_1[i, j], z_2[i, j], z_3[i, j], z_4[i, j]],
-                    "mm",
-                    scale=scale)
-            else:
-                z_5[i, j] = z_0[i, j]
-
-    #fig = plt.figure()
-    #ax = fig.gca(projection='3d')
-    #ax.plot_surface(Xi, Yi, zi, cmap='jet',vmin=np.amin(z),vmax=np.amax(z))
-    #ax.scatter(x,y,z)
-
-    fig = plt.figure()
-    ax = fig.gca()
-    levels = np.linspace(0., 1., 3, endpoint=True)
-
-    cf = ax.contourf(Xi, Yi, z_5, levels, cmap="jet")
-    ax.contour(xi, yi, z_5, levels, linewidths=0.5, colors='k')
-    ax.set_aspect('equal')
-
-    cbar = fig.colorbar(cf, ticks=levels)
-
-
-def clip_scater(x, y, z, x_lim, y_lim, z_lim):
-    x_new = np.array([])
-    y_new = np.array([])
-    z_new = np.array([])
-    for i in np.arange(len(x)):
-        if x[i] >= x_lim[0] and x[i] <= x_lim[1] and y[i] >= y_lim[0] and y[
-                i] <= y_lim[1] and z[i] >= z_lim[0] and z[i] <= z_lim[1]:
-            x_new = np.append(x_new, x[i])
-            y_new = np.append(y_new, y[i])
-            z_new = np.append(z_new, z[i])
-    return x_new, y_new, z_new
-
-
-def plot_kde_2D(x, y, x_min, x_max, y_min, y_max, ngridx=200, ngridy=200):
-
-    xi = np.linspace(x_min, x_max, ngridx)
-    yi = np.linspace(y_min, y_max, ngridy)
-
-    xx, yy = np.meshgrid(xi, yi)
-    positions = np.vstack([xx.ravel(), yy.ravel()])
-    values = np.vstack([x, y])
-    kernel = st.gaussian_kde(values)
-    f = np.reshape(kernel(positions).T, xx.shape)
-
-    fig = plt.figure()
-    ax = fig.gca()
-    ax.set_xlim(x_min, x_max)
-    ax.set_ylim(y_min, y_max)
-
-    levels = np.linspace(np.amin(f), np.amax(f), 16, endpoint=True)
-
-    # Contourf plot
-    cfset = ax.contourf(xx, yy, f, levels, cmap='Blues')
-    ## Or kernel density estimate plot instead of the contourf plot
-    #ax.imshow(np.rot90(f), cmap='Blues', extent=[xmin, xmax, ymin, ymax])
-    # Contour plot
-    cset = ax.contour(xx, yy, f, levels, linewidths=0.5, colors='k')
-    # Label plot
-    # ax.clabel(cset, inline=1, fontsize=10)
-    plt.xlabel('Heat conductivity spacer 1 $[$W/mK$]$')
-    plt.ylabel('Heat conductivity spacer 2 $[$W/mK$]$')
-    #plt.plot(345,345,'+')
-    ax.set_aspect('equal')
-    cbar = fig.colorbar(cfset, ticks=levels)
-    cbar.set_label('pdf $[m^2K^2/W^2]$')
-    plt.savefig("kde.pdf", dpi=100)
-
-
-def plot_kde_1D(qoi, id, xlabel, ylabel, x_min, x_max, nx=200):
-
-    min_qoi = x_min
-    max_qoi = x_max
-
-    kernel = compute_kde(qoi)
-
-    qoi_lin = np.linspace(min_qoi, max_qoi, nx)
-    plt.figure()
-    plt.plot(qoi_lin, kernel(qoi_lin))
-    plt.xlabel(xlabel)
-    plt.ylabel(ylabel)
-    plt.savefig('kde_' + id + '.pdf', dpi=100)
-
-
-def main():
-
-    N = 640
-    base_dir = '/Users/kimliegeois/Desktop/QoI_results_27/'
-    ensemble_size = 1
-
-    N = 640
-    base_dir = '/Users/kimliegeois/Desktop/QoI_results_2_AlN/'
-    ensemble_size = 16
-
-    N = 453
-    base_dir = '/Users/kimliegeois/Desktop/QoI_results_3/'
-    ensemble_size = 1
-
-    N = 453
-    base_dir = '/Volumes/HD_SONY/Thesis/Juelich/all_results_NER/'
-    ensemble_size = 1
-    data_name = 'qois_xiao_2.data'
-
-    N = 79
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/order_2_30/order_20/'
-    ensemble_size = 1
-    data_name = 'A2_xiao_20.data'
-
-    N = 79
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/ER/MPI_2/'
-    ensemble_size = 1
-    data_name = 'B2_xiao_20.data'
-
-    #N = 3200
-    #base_dir = '/Volumes/HD_SONY/juelich/k_conductivity/QoI_results_8/'
-    #ensemble_size = 32
-
-    n_qoi = 10
-    n_rand = 3
-
-    optical_coefficients_all = np.zeros((n_qoi, N))
-    random_variables = np.zeros((n_rand, N))
-
-    x = random_variables[0, :]
-    y = random_variables[2, :]
-
-    for i in range(0, n_rand):
-        filename = base_dir + 'randomVariable_' + str(i + 1) + '.txt'
-        tmp = np.loadtxt(filename)
-        #print tmp[2741]
-        random_variables[i, :] = tmp[0:N]
-    
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        for l in range(0,ensemble_size):
-            filename = base_dir+str(ensemble_size)+'/'+str(ensemble_index)+'/mirror_optical_results_'+str(l)+'.npz'
-            npzfile = np.load(filename)
-            optical_coefficients = npzfile['optical_coefficients']
-            optical_coefficients_all[0:9,ensemble_index*ensemble_size+l] = compute_qoi(base_dir,ensemble_size,ensemble_index,l) #optical_coefficients     
-            #optical_coefficients_all[4:9,ensemble_index*ensemble_size+l] = optical_coefficients
-            optical_coefficients_all[9,ensemble_index*ensemble_size+l] = u.check_optical_tolerance(optical_coefficients_all[4:9,ensemble_index*ensemble_size+l], "mm", max_fringe = 0.0056)    
-    np.save(data_name,optical_coefficients_all)
-    
-    optical_coefficients_all = np.load(data_name + '.npy')
-    optical_coefficients_all_1 = np.copy(optical_coefficients_all)
-    print(optical_coefficients_all_1)
-    print(optical_coefficients_all_1.shape)
-    '''
-    ensemble_size = 8
-
-    N_ensemble = N / ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        print ensemble_index
-        for l in range(0,ensemble_size):
-            filename = base_dir+str(ensemble_size)+'/'+str(ensemble_index)+'/mirror_optical_results_'+str(l)+'.npz'
-            npzfile = np.load(filename)
-            optical_coefficients = npzfile['optical_coefficients']
-            optical_coefficients_all[:,ensemble_index*ensemble_size+l] = compute_qoi(base_dir,ensemble_size,ensemble_index,l) #optical_coefficients     
-
-    optical_coefficients_all_8 = np.copy(optical_coefficients_all)
-
-
-    print optical_coefficients_all_1
-    print optical_coefficients_all_8
-
-    print optical_coefficients_all_8-optical_coefficients_all_1
-    print (optical_coefficients_all_8-optical_coefficients_all_1)/optical_coefficients_all_1
-    '''
-
-    qoi = optical_coefficients_all_1[0, :]
-
-    kernel = compute_kde(qoi)
-
-    T = np.linspace(100, 170, 200)
-    plt.figure()
-    plt.plot(T, kernel(T))
-    #plt.show()
-
-    print('-----')
-    print(np.mean(qoi))
-    #print np.mean(qoi[random_variables[0,:]<=random_variables[1,:]])
-    #print np.mean(qoi[random_variables[0,:]>random_variables[1,:]])
-    print('-----')
-
-    mean_qoi = convergence_qoi(qoi)
-    plt.figure()
-    plt.plot(mean_qoi - mean_qoi[-1])
-
-    qoi = optical_coefficients_all_1[3, :]
-
-    print(np.min(qoi))
-    print(np.max(qoi))
-
-    kernel = compute_kde(qoi)
-
-    max_dz = np.linspace(0.000135, 0.00015, 200)
-    plt.figure()
-    plt.plot(max_dz, kernel(max_dz))
-    max_dz = np.linspace(0.000145, 0.00015, 100)
-    ax = plt.gca()
-    ax.fill_between(max_dz,
-                    0,
-                    kernel(max_dz),
-                    facecolor='red',
-                    interpolate=True)
-
-    print('-----')
-    print(np.mean(qoi))
-    #print np.mean(qoi[random_variables[0,:]<=random_variables[1,:]])
-    #print np.mean(qoi[random_variables[0,:]>random_variables[1,:]])
-    print('-----')
-
-    mean_qoi = convergence_qoi(qoi)
-    plt.figure()
-    plt.plot(mean_qoi - mean_qoi[-1])
-
-    print(np.sum(kernel(max_dz)) * (max_dz[1] - max_dz[0]))
-    #plot_kde(kernel,[370,380],[330,340],[],[0,1])
-    ''' 
-    ensemble_size = 1
-    ensemble_index = 3
-    for i in range(0, 8):
-        npzfile = np.load(base_dir+str(ensemble_size)+'/'+str(ensemble_index)+'/mirror_data_' + str(i) + '.npz')
-        x_i = npzfile['x']
-        y_i = npzfile['y']
-        z_i = 0. * x_i
-        dz_i = npzfile['dz']
-        tri_i = npzfile['tri']
-        if i == 0:
-            x = x_i
-            y = y_i
-            z = z_i
-            dz = dz_i
-            tri = tri_i
-            nNodes = len(x)
-        else:
-            x = np.append(x, x_i, axis=0)
-            y = np.append(y, y_i, axis=0)
-            z = np.append(z, z_i, axis=0)
-            dz = np.append(dz, dz_i, axis=0)
-            tri = np.append(tri, tri_i + nNodes, axis=0)
-            nNodes = len(x)             
-    x_1_0 = dz[:,0]
-    ensemble_size = 8
-    ensemble_index = 0
-    for i in range(0, 8):
-        npzfile = np.load(base_dir+str(ensemble_size)+'/'+str(ensemble_index)+'/mirror_data_' + str(i) + '.npz')
-        x_i = npzfile['x']
-        y_i = npzfile['y']
-        z_i = 0. * x_i
-        dz_i = npzfile['dz']
-        tri_i = npzfile['tri']
-        if i == 0:
-            x = x_i
-            y = y_i
-            z = z_i
-            dz = dz_i
-            tri = tri_i
-            nNodes = len(x)
-        else:
-            x = np.append(x, x_i, axis=0)
-            y = np.append(y, y_i, axis=0)
-            z = np.append(z, z_i, axis=0)
-            dz = np.append(dz, dz_i, axis=0)
-            tri = np.append(tri, tri_i + nNodes, axis=0)
-            nNodes = len(x)                        
-    x_8_0 = dz[:,3] 
-
-    plt.figure()
-    plt.plot(x_1_0)
-    plt.plot(x_8_0) 
-
-    plt.figure()
-    plt.plot(x_1_0-x_8_0)     
-    '''
-
-    #triang = mtri.Triangulation(x, y)
-
-    plot_kde_2D(x, y, 50, 230, 50, 230, ngridx=200, ngridy=200)
-
-    scales = np.linspace(0.2, 0.3, 20)
-
-    for scale in scales:
-        #150,800,150,800
-        print(x.shape)
-        print(y.shape)
-        print(optical_coefficients_all_1.shape)
-        irregularly_tol_plot(x,
-                             y,
-                             optical_coefficients_all_1[4:9, :],
-                             50,
-                             230,
-                             50,
-                             230,
-                             ngridx=200,
-                             ngridy=200,
-                             scale=scale)
-
-        plt.xlabel('Heat conductivity spacer 1 $[$W/mK$]$')
-        plt.ylabel('Heat conductivity spacer 2 $[$W/mK$]$')
-
-        #plt.plot(345,345,'+')
-
-        scale_name = str(scale).replace(".", "_")
-        plt.savefig('qoi_scale_' + scale_name + '.pdf', dpi=100)
-
-    for i in range(0, n_qoi - 1):
-        #fig = plt.figure()
-        #ax = fig.gca(projection='3d')
-        #ax.plot_trisurf(triang, optical_coefficients_all_1[i,:], cmap='jet')
-        #irregularly_plot(x,y,optical_coefficients_all_1[i,:],150,1000,150,1000)
-        #irregularly_plot(x,y,optical_coefficients_all_1[i,:],100,800,100,800)
-        scale = 1
-        if i == 5 or i == 6:
-            scale = 1000
-
-        fig, cbar = irregularly_plot(x,
-                                     y,
-                                     optical_coefficients_all_1[i, :],
-                                     50,
-                                     230,
-                                     50,
-                                     230,
-                                     ngridx=2000,
-                                     ngridy=2000,
-                                     scale=scale)
-
-        plt.xlabel('Heat conductivity spacer 1 $[$W/mK$]$')
-        plt.ylabel('Heat conductivity spacer 2 $[$W/mK$]$')
-
-        #plt.plot(345,345,'+')
-
-        if i == 0:
-            plt.title('Maximal temperature on the mirror surface')
-            cbar.set_label('Temperature $[^\circ$C$]$')
-            id_name = 'max_temp'
-            xlabel = 'Temperature $[^\circ$C$]$'
-            ylabel = 'pdf $[1/ \,^\circ$C$]$'
-            x_min = 100
-            x_max = 150
-        if i == 1:
-            plt.title('Minimal temperature on the mirror surface')
-            cbar.set_label('Temperature $[^\circ$C$]$')
-            id_name = 'min_temp'
-            xlabel = 'Temperature $[^\circ$C$]$'
-            ylabel = 'pdf $[1/ \,^\circ$C$]$'
-            x_min = 100
-            x_max = 150
-        if i == 2:
-            plt.title('Mean temperature on the mirror surface')
-            cbar.set_label('Temperature $[^\circ$C$]$')
-            id_name = 'mean_temp'
-            xlabel = 'Temperature $[^\circ$C$]$'
-            ylabel = 'pdf $[1/ \,^\circ$C$]$'
-            x_min = 100
-            x_max = 150
-        if i == 3:
-            plt.title('Mean z displacement of the mirror surface')
-            cbar.set_label('Displacement $[$mm$]$')
-            id_name = 'mean_z'
-            xlabel = 'Displacement $[$mm$]$'
-            ylabel = 'pdf $[1/ mm]$'
-            x_min = 0.008
-            x_max = 0.016
-        if i == 4:
-            plt.title('Translation')
-            cbar.set_label('Displacement $[$mm$]$')
-            id_name = 'translation'
-            xlabel = 'Displacement $[$mm$]$'
-            ylabel = 'pdf $[1/ mm]$'
-            x_min = 0.024
-            x_max = 0.03
-        if i == 5:
-            plt.title('Rotation y')
-            cbar.set_label('$[$mrads$]$')
-            id_name = 'rotation_y'
-            xlabel = '$[$mrads$]$'
-            ylabel = 'pdf $[1/ mrads]$'
-            x_min = 0.
-            x_max = 0.1
-        if i == 6:
-            plt.title('Rotation x')
-            cbar.set_label('$[$mrads$]$')
-            id_name = 'rotation_x'
-            xlabel = '$[$mrads$]$'
-            ylabel = 'pdf $[1/ mrads]$'
-            x_min = -0.1
-            x_max = 0.01
-        if i == 7:
-            plt.title('Curvature')
-            cbar.set_label('$[$mm$]$')
-            id_name = 'curvature'
-            xlabel = '$[$mm$]$'
-            ylabel = 'pdf $[1/ mm]$'
-            x_min = -0.02
-            x_max = 0.01
-        if i == 8:
-            plt.title('Irregularity')
-            cbar.set_label('$[$mm$]$')
-            id_name = 'irregularity'
-            xlabel = '$[$mm$]$'
-            ylabel = 'pdf $[1/ mm]$'
-            x_min = 0.004
-            x_max = 0.007
-
-        plt.savefig("qoi_" + str(i) + ".pdf", dpi=100)
-
-        plot_kde_1D(optical_coefficients_all_1[i, :] * scale,
-                    id_name,
-                    xlabel,
-                    ylabel,
-                    x_min,
-                    x_max,
-                    nx=1000)
-
-        tmp = np.zeros((len(x), 3))
-        tmp[:, 0] = x
-        tmp[:, 1] = y
-        tmp[:, 2] = optical_coefficients_all_1[i, :]
-
-        np.savetxt("qoi_" + str(i) + ".txt", tmp)
-
-        if i == n_qoi - 1:
-            radius = 578.8807505281204
-            x_circle = np.linspace(130, 560, 1000)
-            #plt.plot(x_circle,np.sqrt(radius**2-x_circle**2))
-        #ax.scatter(x, y, optical_coefficients_all_1[i,:])
-
-    for i in range(0, n_qoi):
-        fig = plt.figure()
-        ax = fig.gca(projection='3d')
-
-        print('-------')
-        print(np.amax(optical_coefficients_all_1[i, :]))
-        print(np.amin(optical_coefficients_all_1[i, :]))
-
-        #if i == n_qoi-1:
-        #    z_max = 0.000133
-        #    z_min = 0.000131
-
-        #    x_new,y_new,z_new = clip_scater(x, y, optical_coefficients_all_1[i,:],[300, 400],[300, 400],[z_min, z_max])
-        #else:
-        x_new, y_new, z_new = x, y, optical_coefficients_all_1[i, :]
-
-        ax.scatter(x_new, y_new, z_new)
-
-        #if i == n_qoi-1:
-        #    ax.set_xlim(300, 400)
-        #    ax.set_ylim(300, 400)
-        #    ax.set_zlim(z_min, z_max)
-
-    #fig = plt.figure()
-    #ax = fig.gca(projection='3d')
-    #for i in range(0, 3):
-    #    ax.plot_trisurf(triang, optical_coefficients_all_1[i,:], cmap='jet')
-    '''   
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')
-    ax.scatter(optical_coefficients_all[0,:], optical_coefficients_all[1,:], optical_coefficients_all[2,:])
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')
-    ax.scatter(optical_coefficients_all[0,:], optical_coefficients_all[1,:], optical_coefficients_all[3,:])
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')    
-    ax.scatter(optical_coefficients_all[0,:], optical_coefficients_all[1,:], optical_coefficients_all[4,:])
-    '''
-
-    #kernel = compute_kde(optical_coefficients_all)
-
-    #plot_kde(kernel,[0.0915,0.94],[1.78638639e-04,2.01983639e-04],[-5.16471018e-05,-6.05417325e-02,4.14012494e-02],[0,1])
-
-    qoi = optical_coefficients_all_1[-1, :]
-
-    not_blurred = np.sum(qoi) / float(len(qoi))
-    blurred = 1. - not_blurred
-
-    print('not blurred')
-    print(not_blurred)
-    print('blurred')
-    print(blurred)
-
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/mirror_2.py b/katoptron/Juelich/UQ/mirror_2.py
deleted file mode 100644
index ac1edaee3c213c3f1f65aca575e273e2d4a55a7a..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/mirror_2.py
+++ /dev/null
@@ -1,73 +0,0 @@
-import numpy as np
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-import matplotlib.tri as mtri
-
-from katoptron.Juelich.UQ.kde import *
-import katoptron.utilities as u
-from numpy import linalg as LA
-
-
-def compute_qoi(base_dir, ensemble_size, ensemble_index, l):
-    OAX, OAY = 0.0595, 0.017
-    npzfile = np.load(base_dir + str(ensemble_size) + '/' +
-                      str(ensemble_index) + '/mirror_data_all.npz')
-    x = npzfile['x']
-    y = npzfile['y']
-    z = 0. * x
-    dz = npzfile['dz']
-    T = npzfile['T']
-    tri = npzfile['tri']
-
-    fig = plt.figure()
-    axtri = plt.tricontourf(x, y, tri, T[:, l], vmin=330., vmax=375.)
-    cb = fig.colorbar(axtri, orientation="horizontal")
-    return x, y, tri, T[:, l]
-
-
-def main():
-
-    N = 8
-    # '/Volumes/HD_SONY/juelich/k_conductivity/QoI_results_7/'
-    base_dir = '/Users/kimliegeois/Desktop/QoI_results_7/'
-    n_qoi = 5
-    n_rand = 3
-    ensemble_size = 1
-
-    optical_coefficients_all = np.zeros((n_qoi, N))
-    random_variables = np.zeros((n_rand, N))
-
-    ensemble_size = 1
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        for l in range(0, ensemble_size):
-            x, y, tri, dz = compute_qoi(base_dir, ensemble_size,
-                                        ensemble_index, l)
-            if l == 0 and ensemble_index == 0:
-                dz_1 = dz.reshape((len(dz), 1))
-            else:
-                dz_1 = np.append(dz_1, dz.reshape((len(dz), 1)), axis=1)
-    ensemble_size = 8
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        for l in range(0, ensemble_size):
-            x, y, tri, dz = compute_qoi(base_dir, ensemble_size,
-                                        ensemble_index, l)
-            if l == 0 and ensemble_index == 0:
-                dz_8 = dz.reshape((len(dz), 1))
-            else:
-                dz_8 = np.append(dz_8, dz.reshape((len(dz), 1)), axis=1)
-
-    for i in range(0, N):
-        #fig = plt.figure()
-        #axtri = plt.tricontourf(x, y, tri, np.abs(dz_1[:,i]-dz_8[:,i])/dz_1[:,i] )
-        #cb = fig.colorbar(axtri, orientation="horizontal")
-        print(LA.norm(dz_1[:, i] - dz_8[:, i]))
-        print(LA.norm(dz_1[:, i]))
-        print((LA.norm(dz_1[:, i] - dz_8[:, i]) / LA.norm(dz_1[:, i])))
-        print('-----')
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/mirror_PCE.py b/katoptron/Juelich/UQ/mirror_PCE.py
deleted file mode 100644
index 1e01230b35d8f865f3ddec6dbe8ff8c48a93a90b..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/mirror_PCE.py
+++ /dev/null
@@ -1,235 +0,0 @@
-import numpy as np
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-import matplotlib.tri as mtri
-from matplotlib import cm
-
-import os
-
-from katoptron.Juelich.UQ.kde import *
-import katoptron.utilities as u
-
-import scipy as sc
-
-
-def build_exponents_L2(order):
-    exponents = np.zeros(((order + 1)**2, 2), dtype=int)
-    exponents[:, 0], exponents[:, 1] = np.divmod(np.arange((order + 1)**2),
-                                                 order + 1)
-    return exponents
-
-
-def build_exponents_L1(order):
-    exponents = build_exponents_L2(order)
-    tmp = exponents[np.where((exponents.T[0] + exponents.T[1]) <= order), :]
-    return tmp[0, :, :]
-
-
-def build_PCE_system(x,
-                     y,
-                     weights,
-                     exponents,
-                     p0=np.array([0, 0]),
-                     scale=np.array([1, 1]),
-                     monomial=True):
-    n = len(x)
-    m = exponents.shape[0]
-    Z = np.zeros((n, m))
-    W = np.zeros((n, n))
-
-    if not monomial:
-        u = 1. - (x - 30.) / 76.
-        v = -1. + (y - 30.) / 76.
-
-    for i in range(0, m):
-        if monomial:
-            Z[:, i] = (((x - p0[0]) / scale[0]))**exponents[i, 0] * (
-                ((y - p0[1]) / scale[1]))**exponents[i, 1]
-        else:
-            p_m_x = np.ones(u.shape)
-            index = np.argwhere(v < 1)
-            p_m_x[index] = (
-                (2 * u[index] + v[index] + 1) / (1 - v[index]))
-            p_m = sc.special.eval_legendre(exponents[i, 0], p_m_x)
-            p_n = sc.special.eval_jacobi(exponents[i, 1],
-                                         2 * exponents[i, 0] + 1, 0, v)
-            Z[:, i] = p_m * (((1 - v) / 2))**exponents[i, 0] * p_n
-    for i in range(0, n):
-        W[i, i] = weights[i]
-
-    ZTW = Z.T.dot(W)
-    ZTWZ = ZTW.dot(Z)
-
-    ZTWZinv = np.linalg.pinv(ZTWZ)
-    Ainv = ZTWZinv.dot(ZTW)
-    return Ainv
-
-
-def evaluate_PCE(x,
-                 y,
-                 coefficients,
-                 exponents,
-                 p0=np.array([0, 0]),
-                 scale=np.array([1, 1]),
-                 monomial=True):
-    n = len(x)
-    m = exponents.shape[0]
-    z = np.zeros((n, ))
-
-    if not monomial:
-        u = 1. - (x - 30.) / 76.
-        v = -1. + (y - 30.) / 76.
-
-    for i in range(0, m):
-        if monomial:
-            z = z + coefficients[i] * (
-                ((x - p0[0]) / scale[0]))**exponents[i, 0] * (
-                    ((y - p0[1]) / scale[1]))**exponents[i, 1]
-        else:
-            p_m_x = np.ones(u.shape)
-            index = np.argwhere(v < 1)
-            p_m_x[index] = (
-                (2 * u[index] + v[index] + 1) / (1 - v[index]))
-            p_m = sc.special.eval_legendre(exponents[i, 0], p_m_x)
-            p_n = sc.special.eval_jacobi(exponents[i, 1],
-                                         2 * exponents[i, 0] + 1, 0, v)
-            z = z + coefficients[i] * p_m * (
-                ((1 - v) / 2))**exponents[i, 0] * p_n
-    return z
-
-
-def triangular_mesh(n_x, n_y, x_min=30, x_max=180, y_min=30, y_max=180):
-    x = np.linspace(x_min, x_max, n_x, endpoint=True)
-    y = np.linspace(y_min, y_max, n_y, endpoint=True)
-    x, y = np.meshgrid(x, y)
-    x = x.flatten()
-    y = y.flatten()
-
-    x_TRI = x[np.where(x >= y)]
-    y_TRI = y[np.where(x >= y)]
-
-    tri = mtri.Triangulation(x_TRI, y_TRI)
-
-    return x_TRI, y_TRI, tri
-
-
-def compute_coeff(Ainv, z):
-    coefficients = Ainv.dot(z)
-    return coefficients
-
-
-def write_patch(tri, z, filename):
-    f = open(filename + "_data.txt", "w+")
-    print("x y c", file=f)
-    for i in range(0, tri.triangles.shape[0]):
-        for j in range(0, 3):
-            index = tri.triangles[i, j]
-            print(str(tri.x[index]) + " " + str(
-                tri.y[index]) + " " + str(z[index]), file=f)
-        print(" ", file=f)
-
-    f.close()
-    f = open(filename + "_range.txt", "w+")
-    print(np.amin(z), file=f)
-    print(np.amax(z), file=f)
-    f.close()
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-
-    N = 20
-    loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) + '.npz')
-    samples = loaded['samples']
-    N = samples.shape[0]
-
-    x = samples[0:N, 0]
-    y = samples[0:N, 1]
-    weights = loaded['weights']
-
-    #qois = np.load('../katoptron_Juelich_UQ_mirror/qois_xiao.data.npy')
-    qois = np.load('../katoptron_Juelich_UQ_mirror/qois_xiao_2.data.npy')
-    qois = np.load('../katoptron_Juelich_UQ_mirror/A2_xiao_20.data.npy')
-    qois = np.load('../katoptron_Juelich_UQ_mirror/B2_xiao_20.data.npy')
-
-    preloads_A2_N = np.loadtxt(
-        '../katoptron_Juelich_UQ_preload/preloads_A2_N.txt')
-    preloads_B2_N = np.loadtxt(
-        '../katoptron_Juelich_UQ_preload/preloads_B2_N.txt')
-
-    x_0 = [30, 30]
-    scale = [150, 150]
-
-    n_x = 30
-    n_y = 30
-
-    monomial = False
-
-    order = 10
-    exponents = build_exponents_L1(order)
-    Ainv = build_PCE_system(x,
-                            y,
-                            weights,
-                            exponents,
-                            x_0,
-                            scale,
-                            monomial=monomial)
-
-    for z_index in range(0, 9):
-        z = qois[z_index, :]
-        filename = 'qoi_' + str(z_index)
-
-        coefficients = compute_coeff(Ainv, z)
-        print(len(coefficients))
-
-        x_PCE, y_PCE, tri = triangular_mesh(n_x, n_y)
-
-        z_PCE = evaluate_PCE(x_PCE,
-                             y_PCE,
-                             coefficients,
-                             exponents,
-                             x_0,
-                             scale,
-                             monomial=monomial)
-
-        write_patch(tri, z_PCE, filename)
-
-    for z_index in range(0, 3):
-        z = preloads_A2_N[:, z_index]
-        filename = 'qoi_preload_A_' + str(z_index)
-
-        coefficients = compute_coeff(Ainv, z)
-        print(len(coefficients))
-
-        x_PCE, y_PCE, tri = triangular_mesh(n_x, n_y)
-
-        z_PCE = evaluate_PCE(x_PCE,
-                             y_PCE,
-                             coefficients,
-                             exponents,
-                             x_0,
-                             scale,
-                             monomial=monomial)
-
-        write_patch(tri, -0.001 * z_PCE, filename)
-        z = preloads_B2_N[:, z_index]
-        filename = 'qoi_preload_B_' + str(z_index)
-
-        coefficients = compute_coeff(Ainv, z)
-        print(len(coefficients))
-
-        x_PCE, y_PCE, tri = triangular_mesh(n_x, n_y)
-
-        z_PCE = evaluate_PCE(x_PCE,
-                             y_PCE,
-                             coefficients,
-                             exponents,
-                             x_0,
-                             scale,
-                             monomial=monomial)
-
-        write_patch(tri, -0.001 * z_PCE, filename)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/mirror_PCE_convergence.py b/katoptron/Juelich/UQ/mirror_PCE_convergence.py
deleted file mode 100644
index 2072879413aa8528191ed4f196cb477d2af9866b..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/mirror_PCE_convergence.py
+++ /dev/null
@@ -1,353 +0,0 @@
-import numpy as np
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-import matplotlib.tri as mtri
-from matplotlib import cm
-
-import os
-
-from katoptron.Juelich.UQ.kde import *
-import katoptron.utilities as u
-
-import scipy as sc
-
-
-def build_exponents_L2(order):
-    exponents = np.zeros(((order + 1)**2, 2), dtype=int)
-    exponents[:, 0], exponents[:, 1] = np.divmod(np.arange((order + 1)**2),
-                                                 order + 1)
-    return exponents
-
-
-def build_exponents_L1(order):
-    exponents = build_exponents_L2(order)
-    tmp = exponents[np.where((exponents.T[0] + exponents.T[1]) <= order), :]
-    return tmp[0, :, :]
-
-
-def build_PCE_system(x,
-                     y,
-                     weights,
-                     exponents,
-                     p0=np.array([0, 0]),
-                     scale=np.array([1, 1]),
-                     monomial=True):
-    n = len(x)
-    m = exponents.shape[0]
-    Z = np.zeros((n, m))
-    W = np.zeros((n, n))
-
-    if not monomial:
-        u = 1. - (x - 30.) / 76.
-        v = -1. + (y - 30.) / 76.
-
-    for i in range(0, m):
-        if monomial:
-            Z[:, i] = (((x - p0[0]) / scale[0]))**exponents[i, 0] * (
-                ((y - p0[1]) / scale[1]))**exponents[i, 1]
-        else:
-            p_m_x = np.ones(u.shape)
-            index = np.argwhere(v < 1)
-            p_m_x[index] = (
-                (2 * u[index] + v[index] + 1) / (1 - v[index]))
-            p_m = sc.special.eval_legendre(exponents[i, 0], p_m_x)
-            p_n = sc.special.eval_jacobi(exponents[i, 1],
-                                         2 * exponents[i, 0] + 1, 0, v)
-            Z[:, i] = p_m * (((1 - v) / 2))**exponents[i, 0] * p_n
-    for i in range(0, n):
-        W[i, i] = weights[i]
-
-    ZTW = Z.T.dot(W)
-    ZTWZ = ZTW.dot(Z)
-
-    ZTWZinv = np.linalg.pinv(ZTWZ)
-    Ainv = ZTWZinv.dot(ZTW)
-    return Ainv
-
-
-def evaluate_PCE(x,
-                 y,
-                 coefficients,
-                 exponents,
-                 p0=np.array([0, 0]),
-                 scale=np.array([1, 1]),
-                 monomial=True):
-    n = len(x)
-    m = exponents.shape[0]
-    z = np.zeros((n, ))
-
-    if not monomial:
-        u = 1. - (x - 30.) / 76.
-        v = -1. + (y - 30.) / 76.
-
-    for i in range(0, m):
-        if monomial:
-            z = z + coefficients[i] * (
-                ((x - p0[0]) / scale[0]))**exponents[i, 0] * (
-                    ((y - p0[1]) / scale[1]))**exponents[i, 1]
-        else:
-            p_m_x = np.ones(u.shape)
-            index = np.argwhere(v < 1)
-            p_m_x[index] = (
-                (2 * u[index] + v[index] + 1) / (1 - v[index]))
-            p_m = sc.special.eval_legendre(exponents[i, 0], p_m_x)
-            p_n = sc.special.eval_jacobi(exponents[i, 1],
-                                         2 * exponents[i, 0] + 1, 0, v)
-            z = z + coefficients[i] * p_m * (
-                ((1 - v) / 2))**exponents[i, 0] * p_n
-    return z
-
-
-def triangular_mesh(n_x, n_y, x_min=30, x_max=180, y_min=30, y_max=180):
-    x = np.linspace(x_min, x_max, n_x, endpoint=True)
-    y = np.linspace(y_min, y_max, n_y, endpoint=True)
-    x, y = np.meshgrid(x, y)
-    x = x.flatten()
-    y = y.flatten()
-
-    x_TRI = x[np.where(x >= y)]
-    y_TRI = y[np.where(x >= y)]
-
-    tri = mtri.Triangulation(x_TRI, y_TRI)
-
-    return x_TRI, y_TRI, tri
-
-
-def compute_coeff(Ainv, z):
-    coefficients = Ainv.dot(z)
-    return coefficients
-
-
-def write_patch(tri, z, filename):
-    f = open(filename + "_data.txt", "w+")
-    print("x y c", file=f)
-    for i in range(0, tri.triangles.shape[0]):
-        for j in range(0, 3):
-            index = tri.triangles[i, j]
-            print(str(tri.x[index]) + " " + str(
-                tri.y[index]) + " " + str(z[index]), file=f)
-        print(" ", file=f)
-
-    f.close()
-    f = open(filename + "_range.txt", "w+")
-    print(np.amin(z), file=f)
-    print(np.amax(z), file=f)
-    f.close()
-
-
-def compute_qoi(base_dir, ensemble_size, ensemble_index, l):
-    OAX, OAY = 0.0595, 0.017
-    npzfile = np.load(base_dir + str(ensemble_size) + '/' +
-                      str(ensemble_index) + '/mirror_data_all.npz')
-    x = npzfile['x']
-    y = npzfile['y']
-    z = 0. * x
-    dz = npzfile['dz']
-    T = npzfile['T']
-    tri = npzfile['tri']
-    optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz[:, l], "m", np.array([OAX, OAY]))
-    print(optical_coefficients)
-    return [
-        np.max(T[:, l]),
-        np.min(T[:, l]),
-        np.mean(T[:, l]), 1000 * np.mean(dz[:, l]), optical_coefficients[0],
-        optical_coefficients[1], optical_coefficients[2],
-        optical_coefficients[3], optical_coefficients[4]
-    ]
-
-
-def read_data(order, base_dir, ax, display=False):
-
-    result_file = 'qois_' + str(order) + '.npz'
-    if os.path.isfile(result_file):
-        loaded = np.load(result_file)
-        qois = loaded['qois']
-        samples = loaded['samples']
-        weights = loaded['weights']
-        if display:
-            #fig = plt.figure()
-            #ax = fig.gca(projection='3d')
-            ax.scatter(samples[:, 0], samples[:, 1], qois[:, -2])
-
-    else:
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(order) +
-                         '.npz')
-        samples = loaded['samples']
-        weights = loaded['weights']
-        N = samples.shape[0]
-
-        order_base_dir = base_dir + str(order) + '/1/'
-
-        n_qois = 9
-
-        qois = np.zeros((N, n_qois))
-
-        for i in range(0, N):
-
-            loaded = np.load(order_base_dir + str(i) + '/mirror_data_all.npz')
-            T = loaded['T']
-            loaded = np.load(order_base_dir + str(i) +
-                             '/mirror_optical_results_0.npz')
-            optical_coefficients = loaded['optical_coefficients']
-
-            #qois[i, 0] = np.min(T)
-            #qois[i, 1] = np.mean(T)
-            #qois[i, 2] = np.max(T)
-            #qois[i, 3:8] = optical_coefficients
-
-            qois[i, :] = compute_qoi(base_dir + str(order) + '/', 1, i, 0)
-
-        np.savez('qois_' + str(order),
-                 qois=qois,
-                 samples=samples,
-                 weights=weights)
-
-    return qois, samples, weights
-
-
-def generate_random_samples(N):
-    tmp = np.random.rand(3*N, 2)
-    index = np.argwhere(tmp[:, 0] >= tmp[:, 1])
-
-    tmp_2 = tmp[index[0:N], :]
-
-    samples = 30. + 150*tmp_2
-
-    samples = np.reshape(samples, (N, 2))
-
-    return samples
-
-
-def main():
-    base_dir = "/Users/kimliegeois/Desktop/Juelich/order_2_30/order_"
-
-    orders = np.arange(2, 32, 2)
-    n_orders = len(orders)
-
-    x_0 = [30, 30]
-    scale = [150, 150]
-
-    monomial = False
-
-    x_PCE = np.array([180., 30.])
-    y_PCE = np.array([180., 30.])
-
-    #value = np.array([0.0109, -0.04723])
-    #which_qoi = -2
-
-    value = np.array([0.00688, 0.00742])
-    which_qoi = -1
-
-    #value = np.array([105.13469634968574, 172.45597099271995])
-    #which_qoi = 1
-
-    #value = np.array([120.26643788294894, 189.0950734335578])
-    #which_qoi = 0
-
-    error = np.zeros((n_orders, 2))
-
-    cauchy_error = np.zeros((n_orders-1, ))
-
-    N_vec = np.zeros((n_orders, 1))
-    N_vec_2 = np.zeros((n_orders, 1))
-
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')
-
-    n_real = 100000
-
-    rand_samples = generate_random_samples(n_real)
-
-    rand_z = np.zeros((n_real, len(orders)))
-
-    for i in range(0, n_orders):
-        order = orders[i]
-        qois, samples, weights = read_data(order, base_dir, ax, True)
-
-        N = len(samples[:, 0])
-
-        N_vec[i] = N
-
-        d = (order / 2)
-
-        x = samples[0:N, 0]
-        y = samples[0:N, 1]
-
-        exponents = build_exponents_L1(d)
-        Ainv = build_PCE_system(x,
-                                y,
-                                weights,
-                                exponents,
-                                x_0,
-                                scale,
-                                monomial=monomial)
-
-        coefficients = compute_coeff(Ainv, qois[:, which_qoi])
-
-        N_vec_2[i] = len(coefficients)
-
-        z_PCE = evaluate_PCE(x_PCE,
-                             y_PCE,
-                             coefficients,
-                             exponents,
-                             x_0,
-                             scale,
-                             monomial=monomial)
-
-        rand_z[:, i] = evaluate_PCE(rand_samples[:, 0],
-                                    rand_samples[:, 1],
-                                    coefficients,
-                                    exponents,
-                                    x_0,
-                                    scale,
-                                    monomial=monomial)
-
-        error[i, 0] = np.abs(z_PCE[0] - value[0])
-        error[i, 1] = np.abs(z_PCE[1] - value[1])
-
-        if i != 0:
-            cauchy_error[i -
-                         1] = np.mean(np.power(rand_z[:, i]-rand_z[:, i-1], 2))
-
-    print((error[:, 0] / value[0]))
-    print((error[:, 1] / value[1]))
-
-    tmp = np.zeros((len(orders), 2))
-    tmp[:, 0] = (orders / 2)
-
-    tmp[:, 1] = np.abs((error[:, 0] / value[0]))
-    np.savetxt('birr.txt', tmp)
-
-    tmp[:, 1] = np.abs((error[:, 1] / value[1]))
-    np.savetxt('airr.txt', tmp)
-
-    plt.figure()
-    plt.plot((orders / 2), np.abs((error[:, 0] / value[0])))
-    plt.plot((orders / 2), np.abs((error[:, 1] / value[1])))
-
-    plt.figure()
-    plt.plot((orders / 2), N_vec)
-    plt.plot((orders / 2), N_vec_2)
-
-    print(cauchy_error)
-    plt.figure()
-    plt.plot(cauchy_error)
-
-    plt.figure()
-    plt.semilogy(cauchy_error)
-
-    tmp = np.zeros((len(orders)-1, 2))
-    tmp[:, 0] = np.arange(2, 16, 1)
-    tmp[:, 1] = cauchy_error
-    np.savetxt('cauchy_error.txt', tmp)
-
-    plt.figure()
-    plt.semilogy((orders / 2), np.abs((error[:, 0] / value[0])))
-    plt.semilogy((orders / 2), np.abs((error[:, 1] / value[1])))
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/preload.py b/katoptron/Juelich/UQ/preload.py
deleted file mode 100644
index a4006b93657229fd792d9ed8278eb1d634a1bea5..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/preload.py
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
-import numpy
-import vtk
-
-from katoptron.Juelich.post_process.vtk_post_process import *
-import os
-
-
-def compute_qoi(filename, mm=True, scale_x=1.):
-    reader = vtk.vtkXMLPUnstructuredGridReader()
-    reader.SetFileName(filename)
-    reader.Update()
-
-    scale = 1.
-    if mm:
-        scale = 1000.
-
-    OX = 0.0529999991413206 * scale * scale_x  # *10
-    OY = 0.0440000002272427 * scale * scale_x  # *10
-    OZ = -0.038604540600378885 * scale * scale_x  # *10
-    # Previously: -0.0413666241463175
-
-    F1 = compute_integrated_F(6, 8, OX, OY, OZ, 0, 0, 1, reader)
-    F2 = compute_integrated_F(7, 8, OX, OY, OZ, 0, 0, 1, reader)
-    F3 = compute_integrated_F(8, 8, OX, OY, OZ, 0, 0, 1, reader)
-    return F1, F2, F3
-
-
-def compute_and_write_preloads(base_dir, filename_out, N, ensemble_size,
-                               n_qoi):
-    preloads = np.zeros((N, n_qoi))
-
-    N_ensemble = N // ensemble_size
-    for ensemble_index in range(0, N_ensemble):
-        for l in range(0, ensemble_size):
-            filename = base_dir + str(ensemble_size) + '/' + str(
-                ensemble_index
-            ) + '/fused_mirror_assembly_mm_part_2_ast1_s' + str(l) + '.pvtu'
-            F1, F2, F3 = compute_qoi(filename)
-            preloads[ensemble_index * ensemble_size + l, 0] = F1
-            preloads[ensemble_index * ensemble_size + l, 1] = F2
-            preloads[ensemble_index * ensemble_size + l, 2] = F3
-
-    np.savetxt(filename_out, preloads)
-    return preloads
-
-
-def main():
-
-    file_dir = os.path.dirname(__file__)
-
-    compute = False
-    if compute:
-        N = 2
-        ensemble_size = 1
-        n_qoi = 3
-
-        base_dir = file_dir + \
-            '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused/MPI_2/A2/'
-        preloads_A2 = compute_and_write_preloads(base_dir, 'preloads_A2.txt',
-                                                 N, ensemble_size, n_qoi)
-        print(preloads_A2)
-
-        base_dir = file_dir + \
-            '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused/MPI_2/A2_baking/'
-        preloads_A2_baking = compute_and_write_preloads(
-            base_dir, 'preloads_A2_baking.txt', N, ensemble_size, n_qoi)
-        print(preloads_A2_baking)
-
-        base_dir = file_dir + \
-            '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused/MPI_2/B2/'
-        preloads_B2 = compute_and_write_preloads(base_dir, 'preloads_B2.txt',
-                                                 N, ensemble_size, n_qoi)
-        print(preloads_B2)
-
-        base_dir = file_dir + \
-            '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused/MPI_2/B2_baking/'
-        preloads_B2_baking = compute_and_write_preloads(
-            base_dir, 'preloads_B2_baking.txt', N, ensemble_size, n_qoi)
-        print(preloads_B2_baking)
-
-        np.savetxt('preloads_A2_dif.txt', preloads_A2 - preloads_A2_baking)
-        np.savetxt('preloads_B2_dif.txt', preloads_B2 - preloads_B2_baking)
-
-        N = 79
-
-        base_dir = file_dir + \
-            '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused_preload/MPI_2/A2/'
-        preloads_A2_N = compute_and_write_preloads(base_dir,
-                                                   'preloads_A2_N.txt', N,
-                                                   ensemble_size, n_qoi)
-
-        print(preloads_A2_N)
-
-        np.savetxt('preloads_A2_N_dif.txt',
-                   preloads_A2_N - preloads_A2_baking[0])
-
-        base_dir = file_dir + \
-            '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused_preload/MPI_2/B2/'
-        preloads_B2_N = compute_and_write_preloads(base_dir,
-                                                   'preloads_B2_N.txt', N,
-                                                   ensemble_size, n_qoi)
-
-        print(preloads_B2_N)
-
-        np.savetxt('preloads_B2_N_dif.txt',
-                   preloads_B2_N - preloads_B2_baking[0])
-    else:
-        N = 20
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-
-        preloads_A2_N = np.loadtxt('preloads_A2_N.txt')
-        preloads_B2_N = np.loadtxt('preloads_B2_N.txt')
-
-        tmp = np.zeros((N, 3))
-        tmp[:, 0] = samples[:, 0]
-        tmp[:, 1] = samples[:, 1]
-        tmp[:, 2] = preloads_A2_N[:, 0]
-        np.savetxt('qoi_A_P1.txt', tmp, fmt='%f')
-        tmp[:, 2] = preloads_A2_N[:, 1]
-        np.savetxt('qoi_A_P2.txt', tmp, fmt='%f')
-        tmp[:, 2] = preloads_A2_N[:, 2]
-        np.savetxt('qoi_A_P3.txt', tmp, fmt='%f')
-
-        tmp[:, 2] = preloads_B2_N[:, 0]
-        np.savetxt('qoi_B_P1.txt', tmp, fmt='%f')
-        tmp[:, 2] = preloads_B2_N[:, 1]
-        np.savetxt('qoi_B_P2.txt', tmp, fmt='%f')
-        tmp[:, 2] = preloads_B2_N[:, 2]
-        np.savetxt('qoi_B_P3.txt', tmp, fmt='%f')
-
-        print(np.amin(preloads_A2_N[:, 0]))
-        print(np.amax(preloads_A2_N[:, 0]))
-
-        print(np.amin(preloads_A2_N[:, 1]))
-        print(np.amax(preloads_A2_N[:, 1]))
-
-        print(np.amin(preloads_A2_N[:, 2]))
-        print(np.amax(preloads_A2_N[:, 2]))
-
-        print(np.amin(preloads_B2_N[:, 0]))
-        print(np.amax(preloads_B2_N[:, 0]))
-
-        print(np.amin(preloads_B2_N[:, 1]))
-        print(np.amax(preloads_B2_N[:, 1]))
-
-        print(np.amin(preloads_B2_N[:, 2]))
-        print(np.amax(preloads_B2_N[:, 2]))
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/speedup.py b/katoptron/Juelich/UQ/speedup.py
deleted file mode 100644
index de8d588c19ebf686ec85bc9a2462e0ca584bbea0..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/speedup.py
+++ /dev/null
@@ -1,409 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from katoptron.speedup import *
-import matplotlib.pyplot as plt
-import os
-
-
-def plot_iter_all_ensemble_sizes(n_samples, iter):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    plt.plot(list(range(0, n_samples)),
-             iter[0][:], 'bo', markersize=8, zorder=1)
-    if iter.shape[0] >= 2:
-        plt.plot(list(range(0, n_samples)),
-                 iter[1][:], 'ro', markersize=6, zorder=2)
-    if iter.shape[0] >= 3:
-        plt.plot(list(range(0, n_samples)),
-                 iter[2][:], 'go', markersize=4, zorder=2)
-    if iter.shape[0] >= 4:
-        plt.plot(list(range(0, n_samples)),
-                 iter[3][:], 'ko', markersize=2, zorder=3)
-    plt.xlabel('sample')
-    plt.ylabel('Number of iterations to converge')
-
-
-def speedup_of_one_case(file_MC_base_dir,
-                        n_samples,
-                        ensemble_sizes,
-                        quantiles,
-                        querylines,
-                        use_waves_timers,
-                        use_teuchos_timers,
-                        per_iteration,
-                        iter_2,
-                        reduction=False):
-    import matplotlib.pyplot as plt
-
-    if reduction:
-        name = 'case_ER'
-    else:
-        name = 'case'
-
-    speedup = compute_speedup(n_samples,
-                              ensemble_sizes,
-                              file_MC_base_dir,
-                              querylines,
-                              per_iteration,
-                              quantiles,
-                              use_waves_timers,
-                              use_teuchos_timers,
-                              reduction,
-                              remove_write=True,
-                              remove_block=True)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)), name,
-                 querylines, per_iteration)
-    plt.savefig(name + '.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, name)
-
-    R = compute_R(n_samples, ensemble_sizes, file_MC_base_dir, quantiles,
-                  reduction)
-
-    save_R(R, name)
-
-    iter = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                        file_MC_base_dir, reduction)
-
-    # if not reduction:
-    #    iter[0][:] = iter_2[0][:]
-    if len(ensemble_sizes) == 4:
-        plot_iter_all_ensemble_sizes(n_samples, iter)
-        plt.savefig(name + '_convergence.png', dpi=400)
-        np.savetxt(name + '_convergence.txt', iter, delimiter=' ')
-
-    return iter
-
-
-def write_tex(n_samples, iter, filename):
-    f = open(filename, 'w')
-    print('\\addplot [c1, mark=*, mark size=2pt, mark options={solid}, only marks]', file=f)
-    print('table [row sep=crcr] {%', file=f)
-    for i in range(0, n_samples):
-        print(str(i) + ' ' + str(iter[0][i]) + '\\\\', file=f)
-    print('};', file=f)
-    print('\\label{pgfplots:noEP}', file=f)
-    if iter.shape[0] >= 2:
-        ensemble_size = 8
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            print('\\addplot [line width=2pt, c2]', file=f)
-            print('table [row sep=crcr] {%', file=f)
-            print(str(ensemble_size * i) + ' ' + str(
-                iter[1][ensemble_size * i]) + '\\\\', file=f)
-            print(str(ensemble_size *
-                      (i + 1)) + ' ' + str(iter[1][ensemble_size *
-                                                   (i + 1) - 1]) + '\\\\', file=f)
-            print('};', file=f)
-        print('\\label{pgfplots:s8}', file=f)
-    if iter.shape[0] >= 3:
-        ensemble_size = 16
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            print('\\addplot [line width=1.5pt, c3]', file=f)
-            print('table [row sep=crcr] {%', file=f)
-            print(str(ensemble_size * i) + ' ' + str(
-                iter[2][ensemble_size * i]) + '\\\\', file=f)
-            print(str(ensemble_size *
-                      (i + 1)) + ' ' + str(iter[2][ensemble_size *
-                                                   (i + 1) - 1]) + '\\\\', file=f)
-            print('};', file=f)
-        print('\\label{pgfplots:s16}', file=f)
-    if iter.shape[0] >= 4:
-        ensemble_size = 32
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            print('\\addplot [line width=1.pt, c4]', file=f)
-            print('table [row sep=crcr] {%', file=f)
-            print(str(ensemble_size * i) + ' ' + str(
-                iter[3][ensemble_size * i]) + '\\\\', file=f)
-            print(str(ensemble_size *
-                      (i + 1)) + ' ' + str(iter[3][ensemble_size *
-                                                   (i + 1) - 1]) + '\\\\', file=f)
-            print('};', file=f)
-        print('\\label{pgfplots:s32}', file=f)
-    f.closed
-
-
-def plot_iter_all(base_dir_ER, base_dir_NER, ensemble_sizes, n_samples):
-
-    iter_NER = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                            base_dir_NER, False)
-    iter_ER = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                           base_dir_ER, True)
-    plot_iter_all_ensemble_sizes(n_samples, iter_NER)
-    write_tex(n_samples, iter_NER, 'NER_conv.tex')
-    np.savetxt('NER_conv.txt', iter_NER)
-    np.savetxt('ordering_1.txt',
-               np.argsort(iter_NER[0, :]).astype(int),
-               fmt='%i')
-    np.savetxt('ordering_2.txt',
-               np.argsort(iter_NER[0][:]).astype(int),
-               fmt='%i')
-    plot_iter_all_ensemble_sizes(n_samples, iter_ER)
-    write_tex(n_samples, iter_ER, 'ER_conv.tex')
-    np.savetxt('ER_conv.txt', iter_ER)
-
-    order = np.argsort(iter_NER[0, :])
-
-    tmp = iter_NER[0][order]
-
-    plt.figure()
-    plt.plot(iter_NER[0][:])
-    plt.savefig('no_order_1.png', dpi=400)
-
-    iter_NER[0][:] = tmp
-
-    plt.figure()
-    plt.plot(tmp)
-    plt.savefig('order_1.png', dpi=400)
-
-    tmp = iter_ER[0][order]
-
-    plt.figure()
-    plt.plot(iter_ER[0][:])
-    plt.savefig('no_order_2.png', dpi=400)
-
-    iter_ER[0][:] = tmp
-
-    write_tex(n_samples, iter_NER, 'NER_conv_2.tex')
-    write_tex(n_samples, iter_ER, 'ER_conv_2.tex')
-
-    plt.figure()
-    plt.plot(tmp)
-    plt.savefig('order_2.png', dpi=400)
-
-
-def CPU_time_per_one_case(base_dir,
-                          n_samples,
-                          ensemble_sizes,
-                          quantiles,
-                          querylines,
-                          use_waves_timers,
-                          use_teuchos_timers,
-                          per_iteration,
-                          filename_CPU,
-                          filename_speed_up,
-                          total_id,
-                          write_id,
-                          block_id,
-                          per_ensemble=True):
-
-    timers = read_timers_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                            base_dir, querylines,
-                                            use_waves_timers,
-                                            use_teuchos_timers)
-
-    f = open(filename_CPU, 'w')
-    print(timers.shape, file=f)
-
-    for i in range(0, timers.shape[2]):
-        print(querylines[i], file=f)
-        string = ''
-        for e in range(0, timers.shape[0]):
-            if per_ensemble:
-                current_timer = (np.sum(timers[e, :, i]) / n_samples)
-                if i == total_id:
-                    current_timer -= (
-                        np.sum(timers[e, :, write_id]) / n_samples)
-                    current_timer -= (
-                        np.sum(timers[e, :, block_id]) / n_samples)
-
-            else:
-                current_timer = (np.sum(
-                    timers[e, :, i]) / (n_samples * ensemble_sizes[e]))
-                if i == total_id:
-                    current_timer -= (np.sum(timers[e, :, write_id]) / (
-                        n_samples * ensemble_sizes[e]))
-                    current_timer -= (np.sum(timers[e, :, block_id]) / (
-                        n_samples * ensemble_sizes[e]))
-
-            string = string + str(round(current_timer, 3)) + ' & '
-        print(string, file=f)
-        print(' ', file=f)
-    f.closed
-
-    f = open(filename_speed_up, 'w')
-    print(timers.shape, file=f)
-
-    for i in range(0, timers.shape[2]):
-        print(querylines[i], file=f)
-        string = ''
-        for e in range(0, timers.shape[0]):
-            if e == 0:
-                current_timer_s1 = np.sum(timers[0, :, i])
-                if i == total_id:
-                    current_timer_s1 -= np.sum(timers[0, :, write_id])
-                    current_timer_s1 -= np.sum(timers[0, :, block_id])
-
-            current_timer = (np.sum(timers[e, :, i]) / ensemble_sizes[e])
-            if i == total_id:
-                current_timer -= (np.sum(
-                    timers[e, :, write_id]) / ensemble_sizes[e])
-                current_timer -= (np.sum(
-                    timers[e, :, block_id]) / ensemble_sizes[e])
-
-            string = string + str(round((current_timer_s1 / current_timer),
-                                        3)) + ' & '
-        print(string, file=f)
-        print(' ', file=f)
-    f.closed
-
-
-def analysis_one_case(directory,
-                      base_dir,
-                      n_samples,
-                      ensemble_sizes,
-                      quantiles,
-                      querylines,
-                      use_waves_timers,
-                      use_teuchos_timers,
-                      per_iteration,
-                      ensemble_reduction=False):
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    iter = speedup_of_one_case(base_dir, n_samples, ensemble_sizes, quantiles,
-                               querylines, use_waves_timers,
-                               use_teuchos_timers, per_iteration, np.array([]),
-                               ensemble_reduction)
-
-    CPU_time_per_one_case(base_dir, n_samples, ensemble_sizes, quantiles,
-                          querylines, use_waves_timers, use_teuchos_timers,
-                          per_iteration, 'average_CPU.txt',
-                          'average_speed_up.txt', 7, 8, 21)
-
-    #plot_iter_all(base_dir_ER, base_dir_NER, ensemble_sizes, n_samples)
-    iters = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes, base_dir,
-                                         ensemble_reduction)
-    plot_iter_all_ensemble_sizes(n_samples, iters)
-    write_tex(n_samples, iters, 'conv.tex')
-
-    os.chdir('..')
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve (level=2)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : smoothing (level=1)',
-        'MueLu: Hierarchy: Solve : coarse (level=2)',
-        'Belos: PseudoBlockGmresSolMgr total solve time',
-        'MueLu: Hierarchy: Setup (total)', 'create the block matrix'
-    ]
-    use_waves_timers = np.array([0, 7, 8, 21], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, False, False,
-        False
-    ]
-
-    n_samples = 64
-
-    ensemble_sizes = [1, 8, 16]
-
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/ER/mpi_ER/MPI_2'
-
-    directory = 'option_A_mpi_2_ER'
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, True)
-
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/NER/mpi_NER/MPI_2'
-
-    directory = 'option_A_mpi_2_NER'
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-    ensemble_sizes = [1, 8, 16, 32]
-
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/ER/mpi_ER/MPI_4'
-
-    directory = 'option_A_mpi_4_ER'
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, True)
-
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/NER/mpi_NER/MPI_4'
-
-    directory = 'option_A_mpi_4_NER'
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/ER/mpi_ER/MPI_8'
-
-    directory = 'option_A_mpi_8_ER'
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, True)
-
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/NER/mpi_NER/MPI_8'
-
-    directory = 'option_A_mpi_8_NER'
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-    n_samples = 32
-    ensemble_sizes = [1, 8, 16]
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/mpi_4/MPI_16'
-
-    directory = 'option_A_mpi_16_all'
-    print(directory)
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-    n_samples = 32
-    ensemble_sizes = [1, 8, 16, 32]
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/mpi_4/MPI_32'
-
-    directory = 'option_A_mpi_32_all'
-    print(directory)
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-    n_samples = 16
-    ensemble_sizes = [1, 8, 16]
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/mpi_5/MPI_32'
-
-    directory = 'option_A_mpi_32_all_2'
-    print(directory)
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-    n_samples = 32
-    ensemble_sizes = [1, 8, 16, 32]
-    base_dir = '/Users/kimliegeois/Desktop/Juelich/mpi_6/MPI_32'
-
-    directory = 'option_A_mpi_32_all_3'
-    print(directory)
-    analysis_one_case(directory, base_dir, n_samples, ensemble_sizes,
-                      quantiles, querylines, use_waves_timers,
-                      use_teuchos_timers, per_iteration, False)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/test_halton.py b/katoptron/Juelich/UQ/test_halton.py
deleted file mode 100644
index 64864a76cd78895b4bd91c4345374b0364535b2d..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/test_halton.py
+++ /dev/null
@@ -1,67 +0,0 @@
-
-import numpy as np
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-import matplotlib.tri as mtri
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-import katoptron.utilities as u
-from scipy.stats import lognorm
-
-
-def main():
-
-    N = 640
-    n_rand = 2
-
-    halton_points = np.zeros((n_rand, N))
-
-    for i in range(0, N):
-        halton_points[:, i] = halton(i + 1, n_rand)
-
-    #fig = plt.figure()
-    # plt.scatter(halton_points[0,:],halton_points[1,:])
-    #ax = fig.gca()
-    # ax.set_aspect('equal')
-
-    np.random.seed(42)
-
-    sigma = 0.15
-    mu = np.log(345) + sigma**2  # mode = 345
-
-    randomVariable_1 = np.random.lognormal(mu, sigma, N)
-    randomVariable_2 = np.random.lognormal(mu, sigma, N)
-
-    randomVariable_1_halton = lognorm.ppf(halton_points[0, :],
-                                          sigma,
-                                          scale=np.exp(mu))
-    randomVariable_2_halton = lognorm.ppf(halton_points[1, :],
-                                          sigma,
-                                          scale=np.exp(mu))
-
-    randomVariable_halton = lognormal(halton_points, [mu, mu], [sigma, sigma])
-
-    #randomVariable_1_halton = lognorm.rvs(sigma,scale=np.exp(mu), size=N, random_state=42)
-    #randomVariable_2_halton = lognorm.rvs(sigma,scale=np.exp(mu), size=N)
-
-    #fig = plt.figure()
-    # plt.scatter(randomVariable_1,randomVariable_2)
-    #ax = fig.gca()
-    # ax.set_aspect('equal')
-
-    #fig = plt.figure()
-    # plt.scatter(randomVariable_1_halton,randomVariable_2_halton)
-    #ax = fig.gca()
-    # ax.set_aspect('equal')
-
-    fig = plt.figure()
-    plt.scatter(randomVariable_1, randomVariable_2)
-    plt.scatter(randomVariable_halton[0, :], randomVariable_halton[1, :])
-    ax = fig.gca()
-    ax.set_aspect('equal')
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/UQ/test_kde.py b/katoptron/Juelich/UQ/test_kde.py
deleted file mode 100644
index 569dd1d3dfc0cfd6f081c4a5f77081cbb302add0..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/UQ/test_kde.py
+++ /dev/null
@@ -1,49 +0,0 @@
-
-import numpy as np
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-
-from katoptron.Juelich.UQ.kde import *
-
-
-def main():
-
-    N = 1000
-    g1 = np.array([0.6 + 0.6 * np.random.rand(N),
-                   np.random.rand(N), 0.4+0.1*np.random.rand(N)])
-    g2 = np.array([0.4+0.3 * np.random.rand(N), 0.5 *
-                   np.random.rand(N), 0.1*np.random.rand(N)])
-    g3 = np.array([0.3*np.random.rand(N), 0.3 *
-                   np.random.rand(N), 0.3*np.random.rand(N)])
-
-    g_total = np.concatenate((g1, g2, g3), axis=1)
-    x, y, z = g_total
-
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')
-    ax.scatter(x, y, z)
-
-    kernel = compute_kde(g_total)
-    plot_kde(kernel, [-0.5, 1.5], [-0.5, 1.5], [0.05], [0, 1])
-    plot_kde(kernel, [-0.5, 1.5], [-0.5, 1.5], [0.15], [0, 1])
-    plot_kde(kernel, [-0.5, 1.5], [-0.5, 1.5], [0.25], [0, 1])
-    plot_kde(kernel, [-0.5, 1.5], [-0.5, 1.5], [0.35], [0, 1])
-    plot_kde(kernel, [-0.5, 1.5], [-0.5, 1.5], [0.45], [0, 1])
-    plot_kde(kernel, [-0.5, 1.5], [-0.5, 1.5], [0.55], [0, 1])
-
-    np.random.seed(42)
-    p1 = box_prob_MC(kernel, [0, -0.5, 0.3], [1.5, 1.5, 0.6], 100000)
-    np.random.seed(42)
-    p2 = box_prob_MC(kernel, [0, -0.5, 0.3], [0.6, 1.5, 0.6], 100000)
-    np.random.seed(42)
-    p3 = box_prob_MC(kernel, [0.6, -0.5, 0.3], [1.5, 1.5, 0.6], 100000)
-
-    print(p1)
-    print(p3)
-    print(p1-(p2+p3))
-
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/__init__.py b/katoptron/Juelich/__init__.py
deleted file mode 100644
index 14a7f2a30c059200731e5ce5986eeb93683a0329..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# -*- coding: utf-8 -*-
-# katoptron.Juelich MODULE initialization file
diff --git a/katoptron/Juelich/broken/M1.py b/katoptron/Juelich/broken/M1.py
deleted file mode 100644
index c3a57826a97e5df99a310ea3c59aa74243486464..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1.py
+++ /dev/null
@@ -1,315 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    precondList = Teuchos.ParameterList()
-    precondList = Teuchos.ParameterList()
-    precondSubList = Teuchos.ParameterList()
-    precondSubSubList = Teuchos.ParameterList()
-    precondSubSubList['fact: iluk level-of-fill'] = 2
-    precondSubList['Prec Type'] = "RILUK"
-    precondSubList['Overlap'] = 1
-    precondSubList['Ifpack2 Settings'] = precondSubSubList
-    precondList['Ifpack2'] = precondSubList
-
-    mueluParams = Teuchos.ParameterList()
-    #mueluParamsSub1 = Teuchos.ParameterList()
-    #mueluParamsSub1['PDE equations'] = 4
-    #mueluParams['Matrix'] = mueluParamsSub1
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 2
-    mueluParams['multigrid algorithm'] = "unsmoothed"
-    mueluParams['smoother: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 4
-    mueluParamsSub2['relaxation: damping factor'] = 1.25
-
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub3 = Teuchos.ParameterList()
-
-    mueluParamsSub3['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub3['relaxation: sweeps'] = 4
-    mueluParamsSub3['relaxation: damping factor'] = 1.25
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-    mueluParams['coarse: params'] = mueluParamsSub3
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 100
-    solverList['ifpackParams'] = precondList
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Maximum active set iteration'] = 10
-
-    solverList['Print Teuchos timers'] = False
-    #solverList['Write matrix and vectors'] = True
-    #solverList['Write txt files'] = True
-
-    geo_name = 'M1_FEM_7.msh'
-    mesh_name = 'M1_FEM_7.msh'
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    #solverList["MueLu xml file name"] = file_dir + '/finest_level_prec_2.xml'
-    solverList["MueLu xml file name"] = file_dir + \
-        '/finest_level_prec_simple_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev.xml'
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + file_dir + '/mesh/' + geo_name + \
-            ' -o ' + work_dir + '/' + mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    pbl = m.Problem(msh, comm)
-
-    ensemble_size = 1
-
-    E = 330000 * np.ones(ensemble_size)
-    nu = 0.36 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.5E-05
-
-    E_rhodium = 379000 * np.ones(ensemble_size)
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    k_rhodium = 0.150
-    d_rhodium = 0.781E-05
-
-    E_WCu = 280000 * np.ones(ensemble_size)
-    nu_WCu = 0.26 * np.ones(ensemble_size)
-    k_WCu = 0.180
-    d_WCu = 0.88E-05
-
-    E_SS = 180000 * np.ones(ensemble_size)
-    nu_SS = 0.26 * np.ones(ensemble_size)
-    k_SS = 0.020
-    d_SS = 1.6E-05
-
-    E_CuCrZr = 130000 * np.ones(ensemble_size)
-    nu_CuCrZr = 0.26 * np.ones(ensemble_size)
-    k_CuCrZr = 0.280
-    d_CuCrZr = 1.6E-05
-
-    E_I718 = 180000 * np.ones(ensemble_size)
-    nu_I718 = 0.26 * np.ones(ensemble_size)
-    k_I718 = 0.020
-    d_I718 = 1.4E-05
-
-    m.Medium(pbl, "Mirror", "Rhodium", E_rhodium,
-             nu_rhodium, k_rhodium, d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Spacer 1-2", "CuCrZr", E_CuCrZr,
-             nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3", "CuCrZr", E_CuCrZr,
-             nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Spacer 1-2 part 2", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3 part 2", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Dirichlet(pbl, "Holder Clamping", "Clamped", 1,
-                 0., 1, 0., 1, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling top", "Clamped", 0, 0.,
-                 0, 0., 0, 0., 1, 70., ensemble_size)
-    m.Dirichlet(pbl, "Cooling bot", "Clamped", 0, 0.,
-                 0, 0., 0, 0., 1, 70., ensemble_size)
-
-    norm1 = tbox.Vector3d(0, 0, -1)
-    norm2 = tbox.Vector3d(0, 0, 1)
-
-    cont1 = m.Contact(pbl, "Nut 1 to Holder", "contact", norm1, -0.3)
-    cont1.setMaster(pbl, "Holder to Nut 1", norm1)
-
-    cont2 = m.Contact(pbl, "Nut 2 to Holder", "contact", norm1, -0.3)
-    cont2.setMaster(pbl, "Holder to Nut 2", norm1)
-
-    cont3 = m.Contact(pbl, "Nut 3 to Holder", "contact", norm1, -0.3)
-    cont3.setMaster(pbl, "Holder to Nut 3", norm1)
-
-    cont4 = m.Contact(pbl, "Spacer 1-2 to Substrate", "contact", norm1, 0.)
-    cont4.setMaster(pbl, "Substrate to Spacer 1-2", norm1)
-
-    cont5 = m.Contact(pbl, "Spacer 3 to Substrate", "contact", norm1, 0.)
-    cont5.setMaster(pbl, "Substrate to Spacer 3", norm1)
-
-    cont6 = m.Contact(pbl, "Spacer 1-2 part 2 to Holder", "contact", norm1, 0.)
-    cont6.setMaster(pbl, "Holder to Spacer 1-2 part 2", norm1)
-
-    cont7 = m.Contact(pbl, "Spacer 3 part 2 to Holder", "contact", norm1, 0.)
-    cont7.setMaster(pbl, "Holder to Spacer 3 part 2", norm1)
-
-    cont8 = m.Contact(pbl, "Spacer 1-2 to Spacer 1-2 part 2",
-                      "contact", norm1, 0.)
-    cont8.setMaster(pbl, "Spacer 1-2 part 2 to Spacer 1-2", norm1)
-
-    cont9 = m.Contact(pbl, "Spacer 3 to Spacer 3 part 2", "contact", norm1, 0.)
-    cont9.setMaster(pbl, "Spacer 3 part 2 to Spacer 3", norm1)
-
-    cont10 = m.Contact(pbl, "Spacer 1-2 to Washer 1", "contact", norm1, 0.)
-    cont10.setMaster(pbl, "Washer 1 to Spacer 1-2", norm1)
-    # cont10.setInitialyOpen()
-
-    cont11 = m.Contact(pbl, "Washer 1 to Spacer 1-2 part 2",
-                       "contact", norm1, 0.)
-    cont11.setMaster(pbl, "Spacer 1-2 part 2 to Washer 1", norm1)
-    # cont11.setInitialyOpen()
-
-    cont12 = m.Contact(pbl, "Washer 1 to Shaft 1", "contact", norm1, 0.)
-    cont12.setMaster(pbl, "Shaft 1 to Washer 1", norm1)
-    # cont12.setInitialyOpen()
-
-    cont13 = m.Contact(pbl, "Spacer 1-2 to Washer 2", "contact", norm1, 0.)
-    cont13.setMaster(pbl, "Washer 2 to Spacer 1-2", norm1)
-    # cont13.setInitialyOpen()
-
-    cont14 = m.Contact(pbl, "Washer 2 to Spacer 1-2 part 2",
-                       "contact", norm1, 0.)
-    cont14.setMaster(pbl, "Spacer 1-2 part 2 to Washer 2", norm1)
-    # cont14.setInitialyOpen()
-
-    cont15 = m.Contact(pbl, "Shaft 2 to Washer 2", "contact", norm1, 0.)
-    cont15.setMaster(pbl, "Washer 2 to Shaft 2", norm1)
-    # cont15.setInitialyOpen()
-
-    cont16 = m.Contact(pbl, "Spacer 3 to Washer 3", "contact", norm1, 0.)
-    cont16.setMaster(pbl, "Washer 3 to Spacer 3", norm1)
-    # cont16.setInitialyOpen()
-
-    cont17 = m.Contact(pbl, "Washer 3 to Spacer 3 part 2",
-                       "contact", norm1, 0.)
-    cont17.setMaster(pbl, "Spacer 3 part 2 to Washer 3", norm1)
-    # cont17.setInitialyOpen()
-
-    cont18 = m.Contact(pbl, "Washer 3 to Shaft 3", "contact", norm1, 0.)
-    cont18.setMaster(pbl, "Shaft 3 to Washer 3", norm1)
-    # cont18.setInitialyOpen()
-
-    #m.Dirichlet(pbl, "Nut 1 to Holder", "Clamped",1,0.,1,0.,1,0.,1,100.,ensemble_size)
-    #m.Dirichlet(pbl, "Nut 2 to Holder", "Clamped",1,0.,1,0.,1,0.,1,100.,ensemble_size)
-    #m.Dirichlet(pbl, "Nut 3 to Holder", "Clamped",1,0.,1,0.,1,0.,1,100.,ensemble_size)
-
-    #m.Dirichlet(pbl, "Holder to Nut 1", "Clamped",1,0.,1,0.,1,0.,1,100.,ensemble_size)
-    #m.Dirichlet(pbl, "Holder to Nut 2", "Clamped",1,0.,1,0.,1,0.,1,100.,ensemble_size)
-    #m.Dirichlet(pbl, "Holder to Nut 3", "Clamped",1,0.,1,0.,1,0.,1,100.,ensemble_size)
-
-    #m.Dirichlet(pbl, "Washer 1 to Spacer 1-2", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-    #m.Dirichlet(pbl, "Washer 2 to Spacer 1-2", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-    #m.Dirichlet(pbl, "Washer 3 to Spacer 3", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-
-    #m.Dirichlet(pbl, "Spacer 1-2 to Substrate", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-    #m.Dirichlet(pbl, "Spacer 3 to Substrate", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-
-    #m.Dirichlet(pbl, "Spacer 1-2 part 2 to Holder", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-    #m.Dirichlet(pbl, "Spacer 3 part 2 to Holder", "Clamped",1,0.,1,0.,1,0.,1,70.,ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = (70/0.0121)*0.001 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Mirror surface", "moved", 0, zero,
-              0, zero, 0, zero, 1, hf, ensemble_size)
-    m.Source(pbl, "Mirror", "ihg", 2.45*1000)
-    m.Source(pbl, "Substrate", "ihg", 2.45*1000)
-    m.Source(pbl, "Holder", "ihg", 0.7*1000)
-
-    m.Dirichlet(pbl, "XY Clamping", "Clamped", 1, 0.,
-                 1, 0., 0, 0., 0, 0., ensemble_size)
-    #m.Dirichlet(pbl, "Mirror surface", "Clamped",0,0.,0,0.,1,-0.1,1,300.,ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    if not args.nogui:
-        if rank == 0:
-            all_msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-            import katoptron.viewer as v
-            gui = v.MeshViewer(pbl, slv, all_msh)
-            gui.vmin = 0
-            gui.vmax = 1
-            gui.start()
-        else:
-            slv.start()
-    else:
-        slv.start()
-
-    from fwk.testing import *
-    tests = CTests()
-    tests.add(CTest('mean(Tbottom)', 0, 0))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_assembly.py b/katoptron/Juelich/broken/M1_assembly.py
deleted file mode 100644
index de619728029c696da755c5c045232b698839679c..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_assembly.py
+++ /dev/null
@@ -1,236 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    precondList = Teuchos.ParameterList()
-    precondList = Teuchos.ParameterList()
-    precondSubList = Teuchos.ParameterList()
-    precondSubSubList = Teuchos.ParameterList()
-    precondSubSubList['fact: iluk level-of-fill'] = 2
-    precondSubList['Prec Type'] = "RILUK"
-    precondSubList['Overlap'] = 1
-    precondSubList['Ifpack2 Settings'] = precondSubSubList
-    precondList['Ifpack2'] = precondSubList
-
-    mueluParams = Teuchos.ParameterList()
-    #mueluParamsSub1 = Teuchos.ParameterList()
-    #mueluParamsSub1['PDE equations'] = 4
-    #mueluParams['Matrix'] = mueluParamsSub1
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['multigrid algorithm'] = "unsmoothed"
-    mueluParams['smoother: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 4
-    mueluParamsSub2['relaxation: damping factor'] = 1.25
-
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub3 = Teuchos.ParameterList()
-
-    mueluParamsSub3['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub3['relaxation: sweeps'] = 4
-    mueluParamsSub3['relaxation: damping factor'] = 1.25
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-    mueluParams['coarse: params'] = mueluParamsSub3
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 100
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 100
-    solverList['ifpackParams'] = precondList
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Maximum active set iteration'] = 10
-
-    solverList['Print Teuchos timers'] = True
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    geo_name = 'MIRROR_1_ASSEMBLY_5.msh'
-    mesh_name = 'MIRROR_1_ASSEMBLY_5.msh'
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    #solverList["MueLu xml file name"] = file_dir + '/finest_level_prec_2.xml'
-    solverList["MueLu xml file name"] = file_dir + \
-        '/nested_multigrid_2_lvls_old.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev.xml'
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + file_dir + '/mesh/' + geo_name + \
-            ' -o ' + work_dir + '/' + mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    pbl = m.Problem(msh, comm)
-
-    ensemble_size = 1
-
-    E = 330000 * np.ones(ensemble_size)
-    nu = 0.36 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.5E-05
-
-    E_rhodium = 379000 * np.ones(ensemble_size)
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    k_rhodium = 0.150
-    d_rhodium = 0.781E-05
-
-    E_WCu = 280000 * np.ones(ensemble_size)
-    nu_WCu = 0.26 * np.ones(ensemble_size)
-    k_WCu = 0.180
-    d_WCu = 0.88E-05
-
-    E_SS = 180000 * np.ones(ensemble_size)
-    nu_SS = 0.26 * np.ones(ensemble_size)
-    k_SS = 0.020
-    d_SS = 1.6E-05
-
-    E_CuCrZr = 130000 * np.ones(ensemble_size)
-    nu_CuCrZr = 0.26 * np.ones(ensemble_size)
-    k_CuCrZr = 0.280
-    d_CuCrZr = 1.6E-05
-
-    E_I718 = 180000 * np.ones(ensemble_size)
-    nu_I718 = 0.26 * np.ones(ensemble_size)
-    k_I718 = 0.020
-    d_I718 = 1.4E-05
-
-    m.Medium(pbl, "Mirror", "SS", E_rhodium, nu_rhodium, k_rhodium, d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-    m.Medium(pbl, "Holder 2", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Pipe 1", "SS", E_SS, nu_SS, k_SS, d_SS)
-    m.Medium(pbl, "Pipe 2", "SS", E_SS, nu_SS, k_SS, d_SS)
-    m.Medium(pbl, "Pipe 3", "SS", E_SS, nu_SS, k_SS, d_SS)
-    m.Medium(pbl, "Pipe 4", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Bolt 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Bolt 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Bolt 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Pin 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Pin 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Pin 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1", "CuCrZr", E_CuCrZr,
-             nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 2", "CuCrZr", E_I718, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3", "CuCrZr", E_I718, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Dirichlet(pbl, "Holder 2 Clamping", "Clamped", 1,
-                 0., 1, 0., 1, 0., 1, 70., ensemble_size)
-
-    m.Dirichlet(pbl, "Holder to bolt 1", "Clamped", 0,
-                 0., 0, 0., 0, 0., 1, 140., ensemble_size)
-    m.Dirichlet(pbl, "Holder to bolt 2", "Clamped", 0,
-                 0., 0, 0., 0, 0., 1, 140., ensemble_size)
-    m.Dirichlet(pbl, "Holder to bolt 3", "Clamped", 0,
-                 0., 0, 0., 0, 0., 1, 140., ensemble_size)
-
-    m.Dirichlet(pbl, "Bolt 1 to holder", "Clamped", 1,
-                 0., 1, 0., 1, 0., 1, 140., ensemble_size)
-    m.Dirichlet(pbl, "Bolt 2 to holder", "Clamped", 0,
-                 0., 0, 0., 0, 0., 1, 140., ensemble_size)
-    m.Dirichlet(pbl, "Bolt 3 to holder", "Clamped", 0,
-                 0., 0, 0., 0, 0., 1, 140., ensemble_size)
-
-    m.Dirichlet(pbl, "Mirror surface", "Clamped", 0, 0.,
-                 0, 0., 0, 0., 1, 210., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    if not args.nogui:
-        if rank == 0:
-            all_msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-            import katoptron.viewer as v
-            gui = v.MeshViewer(pbl, slv, all_msh)
-            gui.vmin = 0
-            gui.vmax = 1
-            gui.start()
-        else:
-            slv.start()
-    else:
-        slv.start()
-
-    from fwk.testing import *
-    tests = CTests()
-    tests.add(CTest('mean(Tbottom)', 0, 0))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_assembly_fused_all.py b/katoptron/Juelich/broken/M1_assembly_fused_all.py
deleted file mode 100644
index 2fad06b14a9b264b8ad1e13bc8d22706adb429f6..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_assembly_fused_all.py
+++ /dev/null
@@ -1,354 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    mueluParams = Teuchos.ParameterList()
-    #mueluParamsSub1 = Teuchos.ParameterList()
-    #mueluParamsSub1['PDE equations'] = 4
-    #mueluParams['Matrix'] = mueluParamsSub1
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 5
-    mueluParams['multigrid algorithm'] = "unsmoothed"
-    mueluParams['smoother: type'] = "RELAXATION"
-    mueluParams['coarse: max size'] = 3000
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 5
-    mueluParamsSub2['relaxation: damping factor'] = 1.25
-
-    mueluParams['coarse: type'] = "Klu"
-    mueluParams['verbosity'] = "low"
-
-    mueluParamsSub3 = Teuchos.ParameterList()
-
-    mueluParamsSub3['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub3['relaxation: sweeps'] = 4
-    mueluParamsSub3['relaxation: damping factor'] = 1.25
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-    #mueluParams['coarse: params'] = mueluParamsSub3
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-    solverList['Convergence Tolerance'] = 10**(-7)
-    solverList['Maximum Iterations'] = 2000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 100
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Maximum active set iteration'] = 10
-
-    solverList['Print Teuchos timers'] = True
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    geo_name = 'MIRROR_1_ASSEMBLY_fused_all.msh'
-    mesh_name = 'MIRROR_1_ASSEMBLY_fused_all.msh'
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    #solverList["MueLu xml file name"] = file_dir + '/finest_level_prec_2.xml'
-    solverList["MueLu xml file name"] = file_dir + \
-        '/nested_multigrid_2_lvls_old.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev.xml'
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + file_dir + '/mesh/' + geo_name + \
-            ' -o ' + work_dir + '/' + mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    ensemble_size = 1
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size)
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150
-    d_rhodium = 0.781E-05
-
-    E_WCu = 280E9 * np.ones(ensemble_size)
-    nu_WCu = 0.26 * np.ones(ensemble_size)
-    k_WCu = 180
-    d_WCu = 0.88E-05
-
-    E_SS = 180E9 * np.ones(ensemble_size)
-    nu_SS = 0.26 * np.ones(ensemble_size)
-    k_SS = 20
-    d_SS = 1.6E-05
-
-    E_CuCrZr = 130E9 * np.ones(ensemble_size)
-    nu_CuCrZr = 0.26 * np.ones(ensemble_size)
-    k_CuCrZr = 280
-    d_CuCrZr = 1.6E-05
-
-    E_I718 = 180E9 * np.ones(ensemble_size)
-    nu_I718 = 0.26 * np.ones(ensemble_size)
-    k_I718 = 20
-    d_I718 = 1.4E-05
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium,
-             nu_rhodium, k_rhodium, d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Holder 2", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Pipe 1", "SS", E_SS, nu_SS, k_SS, d_SS)
-    m.Medium(pbl, "Pipe 2", "SS", E_SS, nu_SS, k_SS, d_SS)
-    m.Medium(pbl, "Pipe 3", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Bolt 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Bolt 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Bolt 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 2 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Dirichlet(pbl, "Holder x clamping", "Clamped", 1,
-                 0., 0, 0., 0, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "Holder y-z clamping", "Clamped", 0,
-                 0., 1, 0., 1, 0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0,
-                 0., 0, 0., 0, 0., 1, 70., ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = (70/0.0121) * np.ones(ensemble_size)  # 70 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0,
-              zero, 0, zero, 0, zero, 1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 70E6)
-    m.Source(pbl, "Substrate", "ihg", 2.45E6)
-    m.Source(pbl, "Holder", "ihg", 0.7E6)
-    m.Source(pbl, "Holder 2", "ihg", 0.7E6)
-    m.Source(pbl, "Pipe 1", "ihg", 0.7E6)
-    m.Source(pbl, "Pipe 2", "ihg", 0.7E6)
-    m.Source(pbl, "Pipe 3", "ihg", 0.7E6)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.7E6)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.7E6)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.7E6)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.7E6)
-    m.Source(pbl, "Shaft 2", "ihg", 0.7E6)
-    m.Source(pbl, "Shaft 3", "ihg", 0.7E6)
-
-    m.Source(pbl, "Bolt 1", "ihg", 0.7E6)
-    m.Source(pbl, "Bolt 2", "ihg", 0.7E6)
-    m.Source(pbl, "Bolt 3", "ihg", 0.7E6)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.7E6)
-    m.Source(pbl, "Nut 2", "ihg", 0.7E6)
-    m.Source(pbl, "Nut 3", "ihg", 0.7E6)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.7E6)
-    m.Source(pbl, "Washer 2", "ihg", 0.7E6)
-    m.Source(pbl, "Washer 3", "ihg", 0.7E6)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    if not args.nogui:
-        if rank == 0:
-            all_msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-            import katoptron.viewer as v
-            gui = v.MeshViewer(pbl, slv, all_msh)
-            gui.vmin = 0
-            gui.vmax = 1
-            gui.start()
-        else:
-            slv.start()
-    else:
-        slv.start()
-    '''
-    
-    ## Extract results
-    if rank == 0:
-        import katoptron.utilities as u
-        
-        tag_name = "Mirror surface"
-        name_sol = "x_mm.txt"
-
-        DOFperNode = 4
-        
-        if siz > 1:
-            x,y,z,tri,sol = u.extract_2D_all_rotated(msh2, tag_name, DOFperNode, ensemble_size, name_sol,[0,1])
-        else:
-            x,y,z,tri,sol = u.extract_2D_all_rotated(msh, tag_name, DOFperNode, ensemble_size, name_sol,[0,1])
-        
-        Zernike_coeff, Zernike_functions, theta, rho = u.compute_Zernike(x,y,z,tri,sol[:,2],10,np.array([-0.015,0.005]))
-
-        colors = {0:(0,0.4470,0.7410), 1:(0.8500,0.3250,0.0980), 2:(0.9290,0.6940,0.1250), 3:(0.4940,0.1840,0.5560), 4:(0.4660,0.6740,0.1880), 5:(0.3010,0.7450,0.9330), 6:(0.6350,0.0780,0.1840), 7:(0,0.4470,0.7410)}
-        
-        import matplotlib.pyplot as plt
-        #plt.style.use('ggplot')
-
-        plt_linewidth = 4.0
-        
-        print max(z)
-        print min(z)
-
-        print max(sol[:,2])
-        print min(sol[:,2])
-        
-        print Zernike_coeff
-        
-        print u.check_optical_tolerance(Zernike_coeff, Zernike_functions, sol[:,2],"m")
-
-
-        for which_dof in range(0,DOFperNode):
-            levels = np.linspace(min(sol[:,which_dof]), max(sol[:,which_dof]), 15)
-            # Velocity x-component
-            fig = plt.figure(figsize=(8, 8))
-            plt.set_cmap('jet')
-            plt.tricontour(x, y, tri, sol[:,which_dof], levels, linestyles='-',
-                        colors='black', linewidths=0.5)
-            axtri = plt.tricontourf(x, y, tri, sol[:,which_dof], levels)
-            #plt.triplot(x, y, tri)
-            plt.gca().set_aspect('equal')
-            plt.gca().set_axis_off()
-            
-            cb = fig.colorbar(axtri, orientation="horizontal")
-            if which_dof == 0:
-                cb.set_label('displacement along x [m]', rotation=0)
-                plt.savefig("ux.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-            elif which_dof == 1:
-                cb.set_label('displacement along y [m]', rotation=0)
-                plt.savefig("uy.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-            elif which_dof == 2:
-                cb.set_label('displacement along z [m]', rotation=0)
-                plt.savefig("uz.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-            elif which_dof == 3:
-                cb.set_label('Temperature [C]', rotation=0)
-                plt.savefig("T.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                
-        #plt.minorticks_on()
-        #plt.gca().set_xticklabels([])
-        #plt.gca().set_yticklabels([])
-        #plt.gca().set_axis_off()
-        #plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
-        #plt.margins(0,0)
-        #plt.gca().xaxis.set_major_locator(plt.NullLocator())
-        #plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-        zernike_fit = np.dot(Zernike_functions,Zernike_coeff)
-
-        levels = np.linspace(min(zernike_fit), max(zernike_fit), 16)
-        # Velocity x-component
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('jet')
-        plt.tricontour(x, y, tri, zernike_fit, levels, linestyles='-',
-                    colors='black', linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, zernike_fit, levels)
-        #plt.triplot(x, y, tri)
-        plt.gca().set_aspect('equal')
-        
-        cb = fig.colorbar(axtri)
-        
-        levels = np.linspace(min(sol[:,2]-zernike_fit), max(sol[:,2]-zernike_fit), 16)
-        # Velocity x-component
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('jet')
-        plt.tricontour(x, y, tri, sol[:,2]-zernike_fit, levels, linestyles='-',
-                    colors='black', linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, sol[:,2]-zernike_fit, levels)
-        #plt.triplot(x, y, tri)
-        plt.gca().set_aspect('equal')
-        
-        cb = fig.colorbar(axtri)
-
-
-
-        plt.show()
-    '''
-    from fwk.testing import *
-    tests = CTests()
-    tests.add(CTest('mean(Tbottom)', 0, 0))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_assembly_fused_mm.py b/katoptron/Juelich/broken/M1_assembly_fused_mm.py
deleted file mode 100644
index e0d0f5f2dfd52dbf528608935a0ec13060350764..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_assembly_fused_mm.py
+++ /dev/null
@@ -1,355 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    mueluParams = Teuchos.ParameterList()
-    #mueluParamsSub1 = Teuchos.ParameterList()
-    #mueluParamsSub1['PDE equations'] = 4
-    #mueluParams['Matrix'] = mueluParamsSub1
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['multigrid algorithm'] = "unsmoothed"
-    mueluParams['smoother: type'] = "RELAXATION"
-    mueluParams['coarse: max size'] = 3000
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 5
-    mueluParamsSub2['relaxation: damping factor'] = 1.25
-
-    mueluParams['coarse: type'] = "Klu"
-    mueluParams['verbosity'] = "low"
-
-    mueluParamsSub3 = Teuchos.ParameterList()
-
-    mueluParamsSub3['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub3['relaxation: sweeps'] = 4
-    mueluParamsSub3['relaxation: damping factor'] = 1.25
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-    #mueluParams['coarse: params'] = mueluParamsSub3
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-    solverList['Convergence Tolerance'] = 10**(-7)
-    solverList['Maximum Iterations'] = 2000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Maximum active set iteration'] = 10
-
-    solverList['Print Teuchos timers'] = True
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    geo_name = 'MIRROR_1_ASSEMBLY_fused_mm.msh'
-    mesh_name = 'MIRROR_1_ASSEMBLY_fused_mm.msh'
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    #solverList["MueLu xml file name"] = file_dir + '/finest_level_prec_2.xml'
-    solverList["MueLu xml file name"] = file_dir + \
-        '/nested_multigrid_2_lvls_old.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev.xml'
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + file_dir + '/mesh/' + geo_name + \
-            ' -o ' + work_dir + '/' + mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in minimeters
-
-    ensemble_size = 1
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379000 * np.ones(ensemble_size)
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K) = 0.150 W/(mm K)
-    k_rhodium = 0.150
-    d_rhodium = 0.781E-05
-
-    E_WCu = 280000 * np.ones(ensemble_size)
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 0.180
-    d_WCu = 0.88E-05
-
-    E_SS = 200000 * np.ones(ensemble_size)
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 0.0153
-    d_SS = 1.57E-05
-
-    E_CuCrZr = 118000 * np.ones(ensemble_size)
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 0.345
-    d_CuCrZr = 1.8E-05
-
-    E_I718 = 183000 * np.ones(ensemble_size)
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 0.0158
-    d_I718 = 1.38E-05
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium,
-             nu_rhodium, k_rhodium, d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 2 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if 0:
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0,
-                     0., 0, 0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1,
-                     0., 1, 0., 0, 0., 0, 0., ensemble_size)
-    else:
-        m.Dirichlet(pbl, "Holder z clamping points", "Clamped",
-                     0, 0., 0, 0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder y clamping points", "Clamped",
-                     0, 0., 1, 0., 0, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x clamping points", "Clamped",
-                     1, 0., 0, 0., 0, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0.,
-                 0, 0., 0, 0., 1, 70.-T_ref, ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = ((70 / (0.0121*1000**2))) * \
-        np.ones(ensemble_size)  # 70 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0,
-              zero, 0, zero, 0, zero, 1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 70E-03)
-    m.Source(pbl, "Substrate", "ihg", 2.45E-03)
-    m.Source(pbl, "Holder", "ihg", 0.7E-03)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.6E-03)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.6E-03)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.6E-03)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E-03)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E-03)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E-03)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.8E-03)
-    m.Source(pbl, "Shaft 2", "ihg", 0.8E-03)
-    m.Source(pbl, "Shaft 3", "ihg", 0.8E-03)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.8E-03)
-    m.Source(pbl, "Nut 2", "ihg", 0.8E-03)
-    m.Source(pbl, "Nut 3", "ihg", 0.8E-03)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.8E-03)
-    m.Source(pbl, "Washer 2", "ihg", 0.8E-03)
-    m.Source(pbl, "Washer 3", "ihg", 0.8E-03)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    '''
-    ## Extract results
-    if rank == 0:
-        import katoptron.utilities as u
-        
-        tag_name = "Mirror surface"
-        name_sol = "x_mm.txt"
-
-        DOFperNode = 4
-        
-        if siz > 1:
-            x,y,z,tri,sol = u.extract_2D_all(msh2, tag_name, DOFperNode, ensemble_size, name_sol)
-        else:
-            x,y,z,tri,sol = u.extract_2D_all(msh, tag_name, DOFperNode, ensemble_size, name_sol)
-        
-        Zernike_coeff, Zernike_functions, theta, rho = u.compute_Zernike(x,y,z,tri,sol[:,2],10,np.array([-0.015,0.005]))
-
-        colors = {0:(0,0.4470,0.7410), 1:(0.8500,0.3250,0.0980), 2:(0.9290,0.6940,0.1250), 3:(0.4940,0.1840,0.5560), 4:(0.4660,0.6740,0.1880), 5:(0.3010,0.7450,0.9330), 6:(0.6350,0.0780,0.1840), 7:(0,0.4470,0.7410)}
-        
-        import matplotlib.pyplot as plt
-        from matplotlib import cm
-        #plt.style.use('ggplot')
-
-        plt_linewidth = 4.0
-        
-        print max(z)
-        print min(z)
-
-        print max(sol[:,2])
-        print min(sol[:,2])
-        
-        print Zernike_coeff
-        
-        print u.check_optical_tolerance(Zernike_coeff, Zernike_functions, sol[:,2],"m")
-
-
-        for which_dof in range(0,DOFperNode):
-            levels = np.linspace(min(sol[:,which_dof]), max(sol[:,which_dof]), 15)
-            # Velocity x-component
-            fig = plt.figure(figsize=(8, 8))
-            plt.set_cmap('jet')
-            plt.tricontour(x, y, tri, sol[:,which_dof], levels, linestyles='-',
-                        colors='black', linewidths=0.5)
-            axtri = plt.tricontourf(x, y, tri, sol[:,which_dof], levels, cmap='coolwarm')
-            #plt.triplot(x, y, tri)
-            plt.gca().set_aspect('equal')
-            plt.gca().set_axis_off()
-            
-
-            
-            #coolwarm
-            
-            #cb = fig.colorbar(axtri, orientation="horizontal")
-            #x = np.linspace(0.0, 1.0, 15)
-            #rgb = cm.get_cmap('coolwarm')(x)[np.newaxis, :, :3]
-            #print rgb
-            
-            if which_dof == 0:
-                #cb.set_label('displacement along x [m]', rotation=0)
-                plt.savefig("ux.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "ux"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-            elif which_dof == 1:
-                #cb.set_label('displacement along y [m]', rotation=0)
-                plt.savefig("uy.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "uy"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-            elif which_dof == 2:
-                #cb.set_label('displacement along z [m]', rotation=0)
-                plt.savefig("uz.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "uz"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-            elif which_dof == 3:
-                #cb.set_label('Temperature [C]', rotation=0)
-                plt.savefig("T.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "T"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-    
-        #plt.minorticks_on()
-        #plt.gca().set_xticklabels([])
-        #plt.gca().set_yticklabels([])
-        #plt.gca().set_axis_off()
-        #plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
-        #plt.margins(0,0)
-        #plt.gca().xaxis.set_major_locator(plt.NullLocator())
-        #plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-        zernike_fit = np.dot(Zernike_functions,Zernike_coeff)
-
-        levels = np.linspace(min(zernike_fit), max(zernike_fit), 16)
-        # Velocity x-component
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('jet')
-        plt.tricontour(x, y, tri, zernike_fit, levels, linestyles='-',
-                    colors='black', linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, zernike_fit, levels)
-        #plt.triplot(x, y, tri)
-        plt.gca().set_aspect('equal')
-        
-        cb = fig.colorbar(axtri)
-        
-        levels = np.linspace(min(sol[:,2]-zernike_fit), max(sol[:,2]-zernike_fit), 16)
-        # Velocity x-component
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('jet')
-        plt.tricontour(x, y, tri, sol[:,2]-zernike_fit, levels, linestyles='-',
-                    colors='black', linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, sol[:,2]-zernike_fit, levels)
-        #plt.triplot(x, y, tri)
-        plt.gca().set_aspect('equal')
-        
-        cb = fig.colorbar(axtri)
-
-
-
-        plt.show()
-    '''
-    from fwk.testing import *
-    tests = CTests()
-    tests.add(CTest('mean(Tbottom)', 0, 0))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_assembly_mm.py b/katoptron/Juelich/broken/M1_assembly_mm.py
deleted file mode 100644
index a73619acd8510624b4e1feb1408e205d991a61d4..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_assembly_mm.py
+++ /dev/null
@@ -1,454 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-
-
-def main():
-    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")
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    mueluParams = Teuchos.ParameterList()
-    #mueluParamsSub1 = Teuchos.ParameterList()
-    #mueluParamsSub1['PDE equations'] = 4
-    #mueluParams['Matrix'] = mueluParamsSub1
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 5
-    mueluParams['multigrid algorithm'] = "unsmoothed"
-    mueluParams['smoother: type'] = "RELAXATION"
-    mueluParams['coarse: max size'] = 3000
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 5
-    mueluParamsSub2['relaxation: damping factor'] = 1.25
-
-    mueluParams['coarse: type'] = "Klu"
-    mueluParams['verbosity'] = "low"
-
-    mueluParamsSub3 = Teuchos.ParameterList()
-
-    mueluParamsSub3['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub3['relaxation: sweeps'] = 4
-    mueluParamsSub3['relaxation: damping factor'] = 1.25
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-    #mueluParams['coarse: params'] = mueluParamsSub3
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-    solverList['Convergence Tolerance'] = 10**(-7)
-    solverList['Maximum Iterations'] = 2000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 100
-    solverList['mueluParams'] = mueluParams
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Maximum active set iteration'] = 10
-
-    solverList['Print Teuchos timers'] = True
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    geo_name = 'MIRROR_1_ASSEMBLY_mm.msh'
-    mesh_name = 'MIRROR_1_ASSEMBLY_mm.msh'
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    #solverList["MueLu xml file name"] = file_dir + '/finest_level_prec_2.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/finest_level_prec_simple_heat.xml'
-    solverList["MueLu xml file name"] = file_dir + \
-        '/nested_multigrid_2_lvls_chebyshev_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_old.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev_heat.xml'
-    #solverList["MueLu xml file name"] = file_dir + '/nested_multigrid_2_lvls_chebyshev.xml'
-
-    if rank == 0:
-        command_line = 'gmsh -3 ' + file_dir + '/mesh/' + geo_name + \
-            ' -o ' + work_dir + '/' + mesh_name + ' -part ' + str(siz)
-        print(command_line)
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp, stdin=subprocess.PIPE, stdout=fileout,
-                             stderr=fileout, env=os.environ, shell=False, close_fds=True)
-        retcode = p.wait()
-        for i in range(1, siz):
-            comm.send(1, dest=i, tag=11)
-    else:
-        data = comm.recv(source=0, tag=11)
-
-    if siz == 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).myrank_execute(rank)
-
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in minimeters
-
-    ensemble_size = 1
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379000 * np.ones(ensemble_size)
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K) = 0.150 W/(mm K)
-    k_rhodium = 0.150
-    d_rhodium = 0.781E-05
-
-    E_WCu = 280000 * np.ones(ensemble_size)
-    nu_WCu = 0.26 * np.ones(ensemble_size)
-    k_WCu = 0.180
-    d_WCu = 0.88E-05
-
-    E_SS = 180000 * np.ones(ensemble_size)
-    nu_SS = 0.26 * np.ones(ensemble_size)
-    k_SS = 0.020
-    d_SS = 1.6E-05
-
-    E_CuCrZr = 130000 * np.ones(ensemble_size)
-    nu_CuCrZr = 0.26 * np.ones(ensemble_size)
-    k_CuCrZr = 0.280
-    d_CuCrZr = 1.6E-05
-
-    E_I718 = 180000 * np.ones(ensemble_size)
-    nu_I718 = 0.26 * np.ones(ensemble_size)
-    k_I718 = 0.020
-    d_I718 = 1.4E-05
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium,
-             nu_rhodium, k_rhodium, d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 2 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3 part 1", "CuCrZr",
-             E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if 1:
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0,
-                     0., 0, 0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1,
-                     0., 1, 0., 0, 0., 0, 0., ensemble_size)
-    else:
-        m.Dirichlet(pbl, "Holder z clamping points", "Clamped",
-                     0, 0., 0, 0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder y clamping points", "Clamped",
-                     0, 0., 1, 0., 0, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x clamping points", "Clamped",
-                     1, 0., 0, 0., 0, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0.,
-                 0, 0., 0, 0., 1, 70.-T_ref, ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = ((70 / (0.0121*1000**2))) * \
-        np.ones(ensemble_size)  # 70 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0,
-              zero, 0, zero, 0, zero, 1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 70E-03)
-    m.Source(pbl, "Substrate", "ihg", 2.45E-03)
-    m.Source(pbl, "Holder", "ihg", 0.7E-03)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.7E-03)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.7E-03)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.7E-03)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E-03)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E-03)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E-03)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.7E-03)
-    m.Source(pbl, "Shaft 2", "ihg", 0.7E-03)
-    m.Source(pbl, "Shaft 3", "ihg", 0.7E-03)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.7E-03)
-    m.Source(pbl, "Nut 2", "ihg", 0.7E-03)
-    m.Source(pbl, "Nut 3", "ihg", 0.7E-03)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.7E-03)
-    m.Source(pbl, "Washer 2", "ihg", 0.7E-03)
-    m.Source(pbl, "Washer 3", "ihg", 0.7E-03)
-
-    norm1 = tbox.Vector3d(0, 0, -1)
-    norm2 = tbox.Vector3d(0, 0, 1)
-
-    # Bolt 1
-    cont = m.Contact(pbl, "Bolt 1 to holder", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    # cont.setInitialyOpen()
-    cont.setMaster(pbl, "Holder to bolt 1", norm1)
-
-    cont = m.Contact(pbl, "Spacer 1 to holder", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Holder to spacer 1", norm1)
-
-    cont = m.Contact(pbl, "Bolt 1 to washer 1", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 1 to bolt 1", norm1)
-
-    cont = m.Contact(pbl, "Spacer 1 to washer 1 part 1", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 1 to spacer 1 part 1", norm1)
-
-    cont = m.Contact(pbl, "Spacer 1 to washer 1 part 2", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 1 to spacer 1 part 2", norm1)
-
-    cont = m.Contact(pbl, "Spacer 1 to substrate", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Substrate to spacer 1", norm1)
-
-    # Bolt 2
-    cont = m.Contact(pbl, "Bolt 2 to holder", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Holder to bolt 2", norm1)
-
-    cont = m.Contact(pbl, "Spacer 2 to holder", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Holder to spacer 2", norm1)
-
-    cont = m.Contact(pbl, "Bolt 2 to washer 2", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 2 to bolt 2", norm1)
-
-    cont = m.Contact(pbl, "Spacer 2 to washer 2 part 1", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 2 to spacer 2 part 1", norm1)
-
-    cont = m.Contact(pbl, "Spacer 2 to washer 2 part 2", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 2 to spacer 2 part 2", norm1)
-
-    cont = m.Contact(pbl, "Spacer 2 to substrate", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Substrate to spacer 2", norm1)
-
-    # Bolt 3
-    cont = m.Contact(pbl, "Bolt 3 to holder", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Holder to bolt 3", norm1)
-
-    cont = m.Contact(pbl, "Spacer 3 to holder", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Holder to spacer 3", norm1)
-
-    cont = m.Contact(pbl, "Bolt 3 to washer 3", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 3 to bolt 3", norm1)
-
-    cont = m.Contact(pbl, "Spacer 3 to washer 3 part 1", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 3 to spacer 3 part 1", norm1)
-
-    cont = m.Contact(pbl, "Spacer 3 to washer 3 part 2", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Washer 3 to spacer 3 part 2", norm1)
-
-    cont = m.Contact(pbl, "Spacer 3 to substrate", "contact", norm1, 0.)
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Substrate to spacer 3", norm1)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    '''
-    ## Extract results
-    if rank == 0:
-        import katoptron.utilities as u
-        
-        tag_name = "Mirror surface"
-        name_sol = "x_mm.txt"
-
-        DOFperNode = 4
-        
-        if siz > 1:
-            x,y,z,tri,sol = u.extract_2D_all(msh2, tag_name, DOFperNode, ensemble_size, name_sol)
-        else:
-            x,y,z,tri,sol = u.extract_2D_all(msh, tag_name, DOFperNode, ensemble_size, name_sol)
-        
-        Zernike_coeff, Zernike_functions, theta, rho = u.compute_Zernike(x,y,z,tri,sol[:,2],10,np.array([-0.015,0.005]))
-
-        colors = {0:(0,0.4470,0.7410), 1:(0.8500,0.3250,0.0980), 2:(0.9290,0.6940,0.1250), 3:(0.4940,0.1840,0.5560), 4:(0.4660,0.6740,0.1880), 5:(0.3010,0.7450,0.9330), 6:(0.6350,0.0780,0.1840), 7:(0,0.4470,0.7410)}
-        
-        import matplotlib.pyplot as plt
-        from matplotlib import cm
-        #plt.style.use('ggplot')
-
-        plt_linewidth = 4.0
-        
-        print max(z)
-        print min(z)
-
-        print max(sol[:,2])
-        print min(sol[:,2])
-        
-        print Zernike_coeff
-        
-        print u.check_optical_tolerance(Zernike_coeff, Zernike_functions, sol[:,2],"m")
-
-
-        for which_dof in range(0,DOFperNode):
-            levels = np.linspace(min(sol[:,which_dof]), max(sol[:,which_dof]), 15)
-            # Velocity x-component
-            fig = plt.figure(figsize=(8, 8))
-            plt.set_cmap('jet')
-            plt.tricontour(x, y, tri, sol[:,which_dof], levels, linestyles='-',
-                        colors='black', linewidths=0.5)
-            axtri = plt.tricontourf(x, y, tri, sol[:,which_dof], levels, cmap='coolwarm')
-            #plt.triplot(x, y, tri)
-            plt.gca().set_aspect('equal')
-            plt.gca().set_axis_off()
-            
-
-            
-            #coolwarm
-            
-            #cb = fig.colorbar(axtri, orientation="horizontal")
-            #x = np.linspace(0.0, 1.0, 15)
-            #rgb = cm.get_cmap('coolwarm')(x)[np.newaxis, :, :3]
-            #print rgb
-            
-            if which_dof == 0:
-                #cb.set_label('displacement along x [m]', rotation=0)
-                plt.savefig("ux.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "ux"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-            elif which_dof == 1:
-                #cb.set_label('displacement along y [m]', rotation=0)
-                plt.savefig("uy.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "uy"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-            elif which_dof == 2:
-                #cb.set_label('displacement along z [m]', rotation=0)
-                plt.savefig("uz.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "uz"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-            elif which_dof == 3:
-                #cb.set_label('Temperature [C]', rotation=0)
-                plt.savefig("T.pdf", transparent=True, bbox_inches='tight', pad_inches=0.05)
-                print "T"
-                print max(sol[:,which_dof])
-                print min(sol[:,which_dof])
-    
-        #plt.minorticks_on()
-        #plt.gca().set_xticklabels([])
-        #plt.gca().set_yticklabels([])
-        #plt.gca().set_axis_off()
-        #plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
-        #plt.margins(0,0)
-        #plt.gca().xaxis.set_major_locator(plt.NullLocator())
-        #plt.gca().yaxis.set_major_locator(plt.NullLocator())
-
-        zernike_fit = np.dot(Zernike_functions,Zernike_coeff)
-
-        levels = np.linspace(min(zernike_fit), max(zernike_fit), 16)
-        # Velocity x-component
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('jet')
-        plt.tricontour(x, y, tri, zernike_fit, levels, linestyles='-',
-                    colors='black', linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, zernike_fit, levels)
-        #plt.triplot(x, y, tri)
-        plt.gca().set_aspect('equal')
-        
-        cb = fig.colorbar(axtri)
-        
-        levels = np.linspace(min(sol[:,2]-zernike_fit), max(sol[:,2]-zernike_fit), 16)
-        # Velocity x-component
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('jet')
-        plt.tricontour(x, y, tri, sol[:,2]-zernike_fit, levels, linestyles='-',
-                    colors='black', linewidths=0.5)
-        axtri = plt.tricontourf(x, y, tri, sol[:,2]-zernike_fit, levels)
-        #plt.triplot(x, y, tri)
-        plt.gca().set_aspect('equal')
-        
-        cb = fig.colorbar(axtri)
-
-
-
-        plt.show()
-    '''
-    from fwk.testing import *
-    tests = CTests()
-    tests.add(CTest('mean(Tbottom)', 0, 0))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_mirror_optic.py b/katoptron/Juelich/broken/M1_mirror_optic.py
deleted file mode 100644
index 7647f64d659cf96cc8169faf81029da46ca022d7..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_mirror_optic.py
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-from fwk.testing import *
-import matplotlib.tri as tri
-from mpl_toolkits.mplot3d import Axes3D
-from matplotlib import cm
-import matplotlib.pyplot as plt
-import katoptron.utilities as u
-import numpy as np
-import os
-import matplotlib
-matplotlib.use('TkAgg')  # <-- THIS MAKES IT FAST!
-
-
-def main():
-
-    file_dir = os.path.dirname(__file__)
-
-    npzfile = np.load(file_dir+'/mirror_data_1A.npz')
-    x_1A = npzfile['x']
-    y_1A = npzfile['y']
-    z_1A = npzfile['z']
-    sol_1A = npzfile['sol']
-    tri_1A = npzfile['tri']
-    dz_1A = npzfile['dz']
-
-    npzfile = np.load(file_dir+'/mirror_data_1B.npz')
-    x_1B = npzfile['x']
-    y_1B = npzfile['y']
-    z_1B = npzfile['z']
-    sol_1B = npzfile['sol']
-    tri_1B = npzfile['tri']
-    dz_1B = npzfile['dz']
-
-    npzfile = np.load(file_dir+'/mirror_data_2A.npz')
-    x_2A = npzfile['x']
-    y_2A = npzfile['y']
-    z_2A = npzfile['z']
-    sol_2A = npzfile['sol']
-    tri_2A = npzfile['tri']
-    dz_2A = npzfile['dz']
-
-    npzfile = np.load(file_dir+'/mirror_data_2B.npz')
-    x_2B = npzfile['x']
-    y_2B = npzfile['y']
-    z_2B = npzfile['z']
-    sol_2B = npzfile['sol']
-    tri_2B = npzfile['tri']
-    dz_2B = npzfile['dz']
-
-    x = x_1A
-    y = y_1A
-    tri = tri_1A
-    dz = dz_1A
-    levels = np.linspace(min(dz), max(dz), 15)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('jet')
-    plt.tricontour(x, y, tri, dz, levels, linestyles='-',
-                   colors='black', linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, dz, levels, cmap='coolwarm')
-    plt.plot(0.0365, 0.017, 'ko')
-    plt.gca().set_aspect('equal')
-
-    fig = plt.figure(figsize=(16, 9))
-    ax = fig.gca(projection='3d', proj_type='ortho')
-    ax.plot_trisurf(x, y, dz, triangles=tri, cmap='coolwarm')
-    plt.show()
-
-    optical_coefficients_1A, dz_residual_1A = u.compute_RBM_Curvature_Irreg(
-        x_1A, y_1A, z_1A, tri_1A, dz_1A, "m", np.array([0.0365, 0.017]))
-
-    optical_coefficients_1B, dz_residual_1B = u.compute_RBM_Curvature_Irreg(
-        x_1B, y_1B, z_1B, tri_1B, dz_1B, "m", np.array([0.0365, 0.017]))
-
-    optical_coefficients_2A, dz_residual_2A = u.compute_RBM_Curvature_Irreg(
-        x_2A, y_2A, z_2A, tri_2A, dz_2A, "m", np.array([0.0365, 0.017]))
-
-    optical_coefficients_2B, dz_residual_2B = u.compute_RBM_Curvature_Irreg(
-        x_2B, y_2B, z_2B, tri_2B, dz_2B, "m", np.array([0.0365, 0.017]))
-
-    print(optical_coefficients_1A)
-    print(optical_coefficients_1B)
-    print(optical_coefficients_2A)
-    print(optical_coefficients_2B)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_optic_test.py b/katoptron/Juelich/broken/M1_optic_test.py
deleted file mode 100644
index c48f6945c915e2931d4b8da270995df681f31476..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_optic_test.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from fwk.testing import *
-import matplotlib.tri as tri
-from mpl_toolkits.mplot3d import Axes3D
-from matplotlib import cm
-import matplotlib.pyplot as plt
-import katoptron.utilities as u
-import numpy as np
-import os
-import matplotlib
-matplotlib.use('TkAgg')  # <-- THIS MAKES IT FAST!
-
-
-def rigid_body_mode(dz, theta_x, theta_y, x, y, x_c, y_c):
-    dz_test = np.zeros(x.shape)
-    dz_test = -np.sin(theta_x)*(y-y_c)+np.cos(theta_x)*dz_test
-    dz_test = -np.sin(theta_y)*(x-x_c)+np.cos(theta_y)*dz_test
-    dz_test = dz_test + dz
-    return dz_test
-
-
-def main():
-
-    file_dir = os.path.dirname(__file__)
-
-    npzfile = np.load(file_dir+'/mirror_data.npz')
-    x = npzfile['x']
-    y = npzfile['y']
-    z = np.zeros(x.shape)
-    tri = npzfile['tri']
-    dz = npzfile['dz']
-
-    dz_1 = 0
-    dz_2 = 0.5/1000
-    dz_3 = 0.87/1000
-    dz_4 = (-2. / 1000)
-
-    theta_x_1 = 0
-    theta_x_2 = 0.0015
-    theta_x_3 = -0.0005
-    theta_x_4 = -0.0002
-
-    theta_y_1 = -0.2
-    theta_y_2 = -0.0005
-    theta_y_3 = 0.0015
-    theta_y_4 = 0.0008
-
-    passed_1 = 0
-    passed_2 = 1
-    passed_3 = 1
-    passed_4 = 0
-
-    dz_test_1 = rigid_body_mode(dz_1, theta_x_1, theta_y_1, x, y, 0.069, 0.04)
-    dz_test_2 = rigid_body_mode(dz_2, theta_x_2, theta_y_2, x, y, 0.069, 0.04)
-    dz_test_3 = rigid_body_mode(dz_3, theta_x_3, theta_y_3, x, y, 0.069, 0.04)
-    dz_test_4 = rigid_body_mode(dz_4, theta_x_4, theta_y_4, x, y, 0.069, 0.04)
-
-    '''
-    levels = np.linspace(min(dz), max(dz), 15)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('jet')
-    plt.tricontour(x, y, tri, dz, levels, linestyles='-',
-                colors='black', linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, dz, levels, cmap='coolwarm')
-    plt.plot(0.069,0.04,'ko')
-    plt.gca().set_aspect('equal')
-    
-    fig = plt.figure(figsize=(16,9))
-    ax = fig.gca(projection='3d', proj_type = 'ortho')
-    ax.plot_trisurf(x,y,dz_test_1,triangles=tri, cmap='coolwarm')
-    '''
-    # plt.show()
-
-    optical_coefficients_1, dz_residual_1 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_1, "m", np.array([0.069, 0.04]))
-
-    optical_coefficients_2, dz_residual_2 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_2, "m", np.array([0.069, 0.04]))
-
-    optical_coefficients_3, dz_residual_3 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_3, "m", np.array([0.069, 0.04]))
-
-    optical_coefficients_4, dz_residual_4 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_4, "m", np.array([0.069, 0.04]))
-
-    tests = CTests()
-    measured_dz_1 = optical_coefficients_1[0]
-    tests.add(CTest('piston mode test 1', measured_dz_1, dz_1*1000, 0.05))
-    measured_dz_2 = optical_coefficients_2[0]
-    tests.add(CTest('piston mode test 2', measured_dz_2, dz_2*1000, 0.05))
-    measured_dz_3 = optical_coefficients_3[0]
-    tests.add(CTest('piston mode test 3', measured_dz_3, dz_3*1000, 0.05))
-    measured_dz_4 = optical_coefficients_4[0]
-    tests.add(CTest('piston mode test 4', measured_dz_4, dz_4*1000, 0.05))
-
-    measured_ry_1 = optical_coefficients_1[1]
-    tests.add(CTest('y rotation test 1', measured_ry_1, theta_y_1, 0.05))
-    measured_ry_2 = optical_coefficients_2[1]
-    tests.add(CTest('y rotation test 2', measured_ry_2, theta_y_2, 0.05))
-    measured_ry_3 = optical_coefficients_3[1]
-    tests.add(CTest('y rotation test 3', measured_ry_3, theta_y_3, 0.05))
-    measured_ry_4 = optical_coefficients_4[1]
-    tests.add(CTest('y rotation test 4', measured_ry_4, theta_y_4, 0.05))
-
-    measured_rx_1 = optical_coefficients_1[2]
-    tests.add(CTest('x rotation test 1', measured_rx_1, theta_x_1, 0.05))
-    measured_rx_2 = optical_coefficients_2[2]
-    tests.add(CTest('x rotation test 2', measured_rx_2, theta_x_2, 0.05))
-    measured_rx_3 = optical_coefficients_3[2]
-    tests.add(CTest('x rotation test 3', measured_rx_3, theta_x_3, 0.05))
-    measured_rx_4 = optical_coefficients_4[2]
-    tests.add(CTest('x rotation test 4', measured_rx_4, theta_x_4, 0.05))
-
-    measured_cur_1 = optical_coefficients_1[3]
-    tests.add(CTest('curvature change test 1', measured_cur_1, 0., 1e-10))
-    measured_cur_2 = optical_coefficients_2[3]
-    tests.add(CTest('curvature change test 2', measured_cur_2, 0., 1e-10))
-    measured_cur_3 = optical_coefficients_3[3]
-    tests.add(CTest('curvature change test 3', measured_cur_3, 0., 1e-10))
-    measured_cur_4 = optical_coefficients_4[3]
-    tests.add(CTest('curvature change test 4', measured_cur_4, 0., 1e-10))
-
-    measured_irr_1 = optical_coefficients_1[4]
-    tests.add(CTest('irregularity change test 1', measured_irr_1, 0., 1e-10))
-    measured_irr_2 = optical_coefficients_2[4]
-    tests.add(CTest('irregularity change test 2', measured_irr_2, 0., 1e-10))
-    measured_irr_3 = optical_coefficients_3[4]
-    tests.add(CTest('irregularity change test 3', measured_irr_3, 0., 1e-10))
-    measured_irr_4 = optical_coefficients_4[4]
-    tests.add(CTest('irregularity change test 4', measured_irr_4, 0., 1e-10))
-
-    blurred_1 = u.check_optical_tolerance(optical_coefficients_1, 'mm')
-    blurred_2 = u.check_optical_tolerance(optical_coefficients_2, 'mm')
-    blurred_3 = u.check_optical_tolerance(optical_coefficients_3, 'mm')
-    blurred_4 = u.check_optical_tolerance(optical_coefficients_4, 'mm')
-    tests.add(CTest('checl optical tolerance test 1', blurred_1, passed_1))
-    tests.add(CTest('checl optical tolerance test 2', blurred_2, passed_2))
-    tests.add(CTest('checl optical tolerance test 3', blurred_3, passed_3))
-    tests.add(CTest('checl optical tolerance test 4', blurred_4, passed_4))
-
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/broken/M1_run.sh b/katoptron/Juelich/broken/M1_run.sh
deleted file mode 100755
index 89d651196102a6590ace719bceb8b4f523aa13dd..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/broken/M1_run.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-cd ~/dev/waves
-python run.py -k 4 katoptron/tests/M1_assembly_fused_2.py
-cd ~/dev/waves
-python run.py -k 4 katoptron/tests/M1_assembly_fused_CuCrZr_holder_2.py
diff --git a/katoptron/Juelich/mesh/contact_mirror_assembly_mm.brep b/katoptron/Juelich/mesh/contact_mirror_assembly_mm.brep
deleted file mode 100644
index ca7538ed0da953b313ebb338d44887b1fbfd9edd..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/mesh/contact_mirror_assembly_mm.brep
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fc50b0325e534597e5c9910a18cbd71e5d5e515ebc09dae745057113e4c055f5
-size 797874
diff --git a/katoptron/Juelich/mesh/contact_mirror_assembly_mm.geo b/katoptron/Juelich/mesh/contact_mirror_assembly_mm.geo
deleted file mode 100644
index bac97b4d17319f055f1776fa2dd205b425025b66..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/mesh/contact_mirror_assembly_mm.geo
+++ /dev/null
@@ -1,367 +0,0 @@
-// This .geo has been tested with gmsh 3.0.6 and 4.4.1 binaries for Mac and Linux
-
-Macro Clear_all
-  allVolumes[] = Volume "*";
-  Recursive Delete { Volume{allVolumes[] } ; }
-  allSurfaces[] = Surface "*";
-  Recursive Delete { Surface{allSurfaces[] } ; }  
-  allPoints[] = Point "*";
-  Recursive Delete { Point{allPoints[] } ; }    
-Return
-
-Macro Compute_next_avaible_point_id
-  allPoints[] = Point "*" ;
-  NallPoints = #allPoints[] ;
-  Printf("NallPoints %f",NallPoints);
-  next_avaible_point_id = 0;
-  compute_next_avaible_point_id_verbose = 0;
-  For i In {0:NallPoints-1}
-    If(compute_next_avaible_point_id_verbose)
-      Printf("Compute_next_avaible_point_id %g, %g",i,allPoints[i]);
-    EndIf
-    If(allPoints[i]>= next_avaible_point_id)
-      next_avaible_point_id = allPoints[i] + 1;
-    EndIf
-  EndFor
-  Printf("Compute_next_avaible_point_id newp %g",newp);
-  Printf("Compute_next_avaible_point_id next_avaible_point_id %g",next_avaible_point_id);
-Return
-
-Macro Scale_axis_mm_to_m
-  allPoints[] = Point "*" ;
-  allLines[] = Line "*" ;
-  allSurfaces[] = Surface "*";
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OO};
-  EndIf
-  Dilate {{-c1[0],-c1[1],-c1[2]},0.001} { Volume{allVolumes[] } ; }
-
-  allPoints[] = Point "*" ;
-  allLines[] = Line "*" ;
-  allSurfaces[] = Surface "*";
-  allVolumes[] = Volume "*";
-Return
-
-Macro Weld_bolt
-  new_weld_line_loop = newreg;
-  Curve Loop(new_weld_line_loop) = curves_id_1[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.026} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_1 = num[1];
-  num[] = Extrude {0, 0, -0.012} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];
-  new_weld_line_loop = newreg;
-  Curve Loop(new_weld_line_loop) = curves_id_2[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.002} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];
-  new_weld_line_loop = newreg;
-  Curve Loop(new_weld_line_loop) = curves_id_3[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, -0.006} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];
-  num[] = BooleanUnion{ Volume{volume_id_1}; Delete; }{ Volume{volume_id_2}; Volume{volume_id_3}; Volume{volume_id_4}; Volume{volume_id_5}; Volume{volume_id_6}; Volume{volume_id_7}; Volume{volume_id_8}; Volume{volume_id_9}; Volume{new_volume_1}; Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Delete; };
-  new_volume_1 = num[0];
-Return
-
-Macro Weld_tube
-  c1[] = Point{pipe_p1};
-  c2[] = Point{pipe_p2};
-  center1[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-  pipe_radius = Sqrt((c1[0]-center1[0])^2+(c1[1]-center1[1])^2+(c1[2]-center1[2])^2);
-
-  c1[] = Point{weld_p1};
-  c2[] = Point{weld_p5};
-  center1[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-  weld_radius = Sqrt((c1[0]-center1[0])^2+(c1[1]-center1[1])^2+(c1[2]-center1[2])^2);
-
-  new_weld_p1 = newp;
-  Point(new_weld_p1) = {(pipe_radius/weld_radius)*(c1[0]-center1[0])+center1[0],(pipe_radius/weld_radius)*(c1[1]-center1[1])+center1[1],(pipe_radius/weld_radius)*(c1[2]-center1[2])+center1[2]};
-  new_weld_line1 = newreg; Line(new_weld_line1) = {new_weld_p1, weld_p2};
-  new_weld_line2 = newreg; Line(new_weld_line2) = {weld_p2, weld_p3};
-  new_weld_line3 = newreg; Line(new_weld_line3) = {weld_p3, weld_p4};
-  new_weld_line4 = newreg; Line(new_weld_line4) = {weld_p4, new_weld_p1};
-
-  new_weld_line_loop = newreg;  Line Loop(new_weld_line_loop) = {new_weld_line1,new_weld_line2,new_weld_line3,new_weld_line4};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-
-  c1[]=Point{weld_p3};
-  c2[]=Point{weld_p4};
-
-  Extrude {{c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]}, {center1[0], center1[1], center1[2]}, Pi} {
-    Surface{new_weld_line_loop};
-  }
-  Extrude {{c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]}, {center1[0], center1[1], center1[2]}, -Pi} {
-    Surface{new_weld_line_loop};
-  }
-Return
-
-Macro Compute_cross_and_theta
-  norm_1 = Sqrt(vec_1[0]^2+vec_1[1]^2+vec_1[2]^2);
-  norm_2 = Sqrt(vec_2[0]^2+vec_2[1]^2+vec_2[2]^2);
-
-  cross[] = {vec_1[1]*vec_2[2]-vec_1[2]*vec_2[1],vec_1[2]*vec_2[0]-vec_1[0]*vec_2[2],vec_1[0]*vec_2[1]-vec_1[1]*vec_2[0]};
-  norm_cross = Sqrt(cross[0]^2+cross[1]^2+cross[2]^2);
-
-  dot = vec_1[0]*vec_2[0] + vec_1[1]*vec_2[1] + vec_1[2]*vec_2[2];
-
-  theta = Acos(dot/(norm_1*norm_2));
-Return
-
-Macro Rotate_Axis
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OX_1};
-    c2[] = Point{point_OX_2};
-    Printf("Rotate_Axis point_OX_1 c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-    Printf("Rotate_Axis point_OX_2 c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  EndIf
-
-  OX[] = {c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]};
-  vec_1[] = OX[];
-  vec_2[] = {1,0,0};
-
-  Call Compute_cross_and_theta;
-
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c3[] = Point{point_OY_1};
-    c4[] = Point{point_OY_2};
-    Printf("Rotate_Axis point_OY_1 c3 (%g,%g,%g)",c3[0],c3[1],c3[2]);
-    Printf("Rotate_Axis point_OY_2 c4 (%g,%g,%g)",c4[0],c4[1],c4[2]);
-  EndIf
-
-  OY[] = {c4[0]-c3[0],c4[1]-c3[1],c4[2]-c3[2]};
-  vec_1[] = OY[];
-  vec_2[] = {0,1,0};
-
-  Call Compute_cross_and_theta;
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-Return
-
-Macro Translate_Axis
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OO};
-    Printf("Translate_Axis point_OO c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-  EndIf
-  Translate {-c1[0],-c1[1],-c1[2]} { Volume{allVolumes[] } ; }
-  allVolumes[] = Volume "*";
-Return
-
-Macro Contact_disk
-  c1[] = Point{point_disk_R_1};
-  c2[] = Point{point_disk_R_2};
-
-  center[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-
-  R = mR * Sqrt((c1[0]-center[0])^2+(c1[1]-center[1])^2+(c1[2]-center[2])^2);
-
-  c1[] = Point{point_surface_disk_1};
-  c2[] = Point{point_surface_disk_2};
-
-  new_disk = newreg;
-  Disk(new_disk) = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2, R, R};
-
-  Printf("c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-  Printf("c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  Printf("Center (%g,%g,%g) radius %g",(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2, R) ;
-
-  BooleanFragments{ Surface{new_disk}; Delete; }{ Volume{volume_id}; Delete; }
-Return
-
-Macro Add_Optical_Axis
-  If(usePointID)
-    p1[] = Point{point_mirror_x};
-    p2[] = Point{point_mirror_y};
-    Printf("Add_Optical_Axis p1 (%g,%g,%g)",p1[0],p1[1],p1[2]);
-    Printf("Add_Optical_Axis p2 (%g,%g,%g)",p2[0],p2[1],p2[2]);
-  EndIf
-
-  Printf("Add_Optical_Axis OA (%g,%g,%g)",p1[0]+Delta_x,p2[1]+Delta_y,p1[2]);
-
-  Call Compute_next_avaible_point_id;
-  OA = next_avaible_point_id;
-  Point(OA) = {p1[0]+Delta_x, p2[1]+Delta_y, p1[2], 1};
-  new_disk = newreg;
-  Disk(new_disk) = {p1[0]+Delta_x, p2[1]+Delta_y, p1[2], R, R};
-
-  BooleanFragments{  Point{OA}; Surface{new_disk}; Delete; }{ Volume{Mirror_id}; Delete; }
-  BooleanFragments{  Point{OA}; Delete; }{ Volume{Mirror_id}; Delete; }
-Return
-
-SetFactory("OpenCASCADE");
-
-rerun = 0;
-
-If(!FileExists("contact_mirror_assembly_mm.brep") || rerun)
-  v() = ShapeFromFile("mirror_assembly.stp");
-
-  For k In {20:23:1}
-    Recursive Delete { Volume{k}; }
-  EndFor
-
-  For k In {27:62:1}
-    Recursive Delete { Volume{k}; }
-  EndFor
-
-  volumes1[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,24,25,26};
-  BooleanFragments{ Volume{volumes1[] }; Delete; }{}
-
-  volumes2[] = {16,19};
-  BooleanFragments{ Volume{volumes2[] }; Delete; }{}
-
-  usePointID = 0;
-
-  // Realign the axis
-
-  If(usePointID)
-    point_OX_1 = 835;
-    point_OX_2 = 834;
-
-    point_OY_1 = 938;
-    point_OY_2 = 940;
-  Else
-    c1[] = {6492.32979087,-145.832273844,4445.62173365};
-    c2[] = {6411.66078991,-103.544497493,4385.74472425};
-
-    c3[] = {-7270.05243185,1092.57096931,2726.17090744};
-    c4[] = {-7270.05243185,1128.49789026,2747.92536333};    
-  EndIf
-
-  Call Rotate_Axis;
-
-  If(usePointID)
-    point_OO = 938;
-  Else
-    c1[] = {-7294.05,2346.64,1780.06};
-  EndIf
-
-  Call Translate_Axis;
-
-  Recursive Delete { Volume{3,17,18}; }
-
-  mR = 1.25;
-  point_disk_R_1 = 4848;
-  point_disk_R_2 = 4849;
-  point_surface_disk_1 = 4760;
-  point_surface_disk_2 = 4758;
-  volume_id = 19; 
-  Call Contact_disk;
-
-  mR = 1.25;
-  point_disk_R_1 = 4815;
-  point_disk_R_2 = 4814;
-  point_surface_disk_1 = 4916;
-  point_surface_disk_2 = 4914;
-  volume_id = 19; 
-  Call Contact_disk;
-
-  mR = 1.25;
-  point_disk_R_1 = 4780;
-  point_disk_R_2 = 4781;
-  point_surface_disk_1 = 4924;
-  point_surface_disk_2 = 4925;  
-  volume_id = 19; 
-  Call Contact_disk;
-
-  mR = 1.;
-  point_disk_R_1 = 4848;
-  point_disk_R_2 = 4849;
-  point_surface_disk_1 = 4332;
-  point_surface_disk_2 = 4330;
-  volume_id = 16; 
-  Call Contact_disk;
-
-  mR = 1.;
-  point_disk_R_1 = 4848;
-  point_disk_R_2 = 4849;
-  point_surface_disk_1 = 4975;
-  point_surface_disk_2 = 4974;
-  volume_id = 16; 
-  Call Contact_disk;
-
-  mR = 1.;
-  point_disk_R_1 = 4246;
-  point_disk_R_2 = 4245;
-  point_surface_disk_1 = 4968;
-  point_surface_disk_2 = 4967;
-  volume_id = 16;
-  Call Contact_disk;
-
-  Save "contact_mirror_assembly_mm.brep";
-  Call Clear_all;
-EndIf
-
-Merge "contact_mirror_assembly_mm.brep"; 
-
-Physical Volume("Mirror") = {2};
-Physical Volume("Substrate") = {1};
-Physical Volume("Washer 1") = {5};
-Physical Volume("Washer 2") = {4};
-Physical Volume("Washer 3") = {3};
-
-Physical Volume("Shaft 1") = {8};
-Physical Volume("Shaft 2") = {7};
-Physical Volume("Shaft 3") = {6};  
-
-Physical Volume("Spacer 1 part 1") = {12};
-Physical Volume("Spacer 2 part 1") = {11};
-Physical Volume("Spacer 3 part 1") = {9};
-
-Physical Volume("Spacer 1 part 2") = {14};
-Physical Volume("Spacer 2 part 2") = {13};
-Physical Volume("Spacer 3 part 2") = {10};
-
-Physical Volume("Holder") = {15,16};
-
-Physical Volume("Nut 1") = {18};
-Physical Volume("Nut 2") = {19};
-Physical Volume("Nut 3") = {17};
-
-Physical Surface("Mirror surface") = {113};
-
-Physical Surface("Cooling channels") = {508, 509, 525, 527, 523, 522, 498, 499, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 521, 520, 500, 501, 502, 503, 504, 505, 506, 507, 526, 600, 620, 621, 598, 599};
-
-Physical Surface("Holder z clamping") = {563, 564, 574, 573, 546, 545};
-Physical Surface("Holder x-y clamping") = {548, 547, 570, 569, 555, 554};
-
-Physical Surface("Holder to nut 1") = {644};
-Physical Surface("Holder to nut 2") = {645};
-Physical Surface("Holder to nut 3") = {643};
-
-Physical Surface("Holder to spacer 1") = {372};
-Physical Surface("Holder to spacer 2") = {371};
-Physical Surface("Holder to spacer 3") = {363};
-
-Physical Surface("Nut 1 to holder") = {680};
-Physical Surface("Nut 2 to holder") = {711};
-Physical Surface("Nut 3 to holder") = {649};
-
-Physical Surface("Spacer 1 to holder") = {352};
-Physical Surface("Spacer 2 to holder") = {342};
-Physical Surface("Spacer 3 to holder") = {302};
-
-Physical Point("Holder x-y-z clamping point") = {765};
-Physical Point("Holder z clamping point") = {743};
-Physical Point("Holder z-y clamping point") = {736};
-
-Physical Point("Optical Axis") = {958};
-
-Mesh.Algorithm = 6;
-//Mesh.Algorithm3D = 4;
-Mesh.CharacteristicLengthMin = 1.;
-Mesh.CharacteristicLengthMax = 1.;
-Mesh.MshFileVersion = 2.2;
diff --git a/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.brep b/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.brep
deleted file mode 100644
index 67f36e959f04f4c1aa332824b60ee842cca51204..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.brep
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6d0b2b76c0039cded13762bb53863c4415445213edaccec9464e2b45bea3d680
-size 2572367
diff --git a/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.geo b/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.geo
deleted file mode 100644
index b6ec611027d0480d7085acb0d088e8c284435f56..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.geo
+++ /dev/null
@@ -1,694 +0,0 @@
-// This .geo has been tested with gmsh 3.0.6 and 4.4.1 binaries for Mac and Linux
-
-Macro Clear_all
-  allVolumes[] = Volume "*";
-  Recursive Delete { Volume{allVolumes[] } ; }
-  allSurfaces[] = Surface "*";
-  Recursive Delete { Surface{allSurfaces[] } ; }  
-  allPoints[] = Point "*";
-  Recursive Delete { Point{allPoints[] } ; }    
-Return
-
-Macro Compute_next_avaible_point_id
-  allPoints[] = Point "*" ;
-  NallPoints = #allPoints[] ;
-  Printf("NallPoints %f",NallPoints);
-  next_avaible_point_id = 0;
-  compute_next_avaible_point_id_verbose = 0;
-  For i In {0:NallPoints-1}
-    If(compute_next_avaible_point_id_verbose)
-      Printf("Compute_next_avaible_point_id %g, %g",i,allPoints[i]);
-    EndIf
-    If(allPoints[i]>= next_avaible_point_id)
-      next_avaible_point_id = allPoints[i] + 1;
-    EndIf
-  EndFor
-  Printf("Compute_next_avaible_point_id newp %g",newp);
-  Printf("Compute_next_avaible_point_id next_avaible_point_id %g",next_avaible_point_id);
-Return
-
-Macro Scale_axis_mm_to_m
-  allPoints[] = Point "*" ;
-  allLines[] = Line "*" ;
-  allSurfaces[] = Surface "*";
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OO};
-  EndIf
-  Dilate {{-c1[0],-c1[1],-c1[2]},0.001} { Volume{allVolumes[] } ; }
-
-  allPoints[] = Point "*" ;
-  allLines[] = Line "*" ;
-  allSurfaces[] = Surface "*";
-  allVolumes[] = Volume "*";
-Return
-
-Macro Weld_bolt
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_1[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.026} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_1 = num[1];
-  num[] = Extrude {0, 0, -0.012} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_2[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.002} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_3[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, -0.006} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];
-  num[] = BooleanUnion{ Volume{volume_id_1}; Delete; }{ Volume{volume_id_2}; Volume{volume_id_3}; Volume{volume_id_4}; Volume{volume_id_5}; Volume{volume_id_6}; Volume{volume_id_7}; Volume{volume_id_8}; Volume{volume_id_9}; Volume{new_volume_1}; Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Delete; };
-  new_volume_1 = num[0];
-Return
-
-Macro Weld_bolt_2
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_1[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.026} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_1 = num[1];
-  num[] = Extrude {0, 0, -0.012} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_2[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.002} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_3[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, -0.006} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = curves_id_4[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, -6.25} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_5 = num[1];  
-
-  Recursive Delete { Volume{volume_id_4, volume_id_5}; } 
-
-  num[] = BooleanUnion{ Volume{volume_id_1}; Delete; }{ Volume{volume_id_2}; Volume{volume_id_3}; Volume{volume_id_6}; Volume{volume_id_7}; Volume{volume_id_8}; Volume{volume_id_9}; Volume{new_volume_1}; Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Volume{new_volume_5}; Delete; };
-  new_volume_1 = num[0];
-Return
-
-Macro Weld_tube
-  c1[] = Point{pipe_p1};
-  c2[] = Point{pipe_p2};
-  center1[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-  pipe_radius = Sqrt((c1[0]-center1[0])^2+(c1[1]-center1[1])^2+(c1[2]-center1[2])^2);
-
-  c1[] = Point{weld_p1};
-  c2[] = Point{weld_p5};
-  center1[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-  weld_radius = Sqrt((c1[0]-center1[0])^2+(c1[1]-center1[1])^2+(c1[2]-center1[2])^2);
-
-  new_weld_p1 = newp;
-  Point(new_weld_p1) = {(pipe_radius/weld_radius)*(c1[0]-center1[0])+center1[0],(pipe_radius/weld_radius)*(c1[1]-center1[1])+center1[1],(pipe_radius/weld_radius)*(c1[2]-center1[2])+center1[2]};
-  new_weld_line1 = newreg; Line(new_weld_line1) = {new_weld_p1, weld_p2};
-  new_weld_line2 = newreg; Line(new_weld_line2) = {weld_p2, weld_p3};
-  new_weld_line3 = newreg; Line(new_weld_line3) = {weld_p3, weld_p4};
-  new_weld_line4 = newreg; Line(new_weld_line4) = {weld_p4, new_weld_p1};
-
-  new_weld_line_loop = newreg;  Line Loop(new_weld_line_loop) = {new_weld_line1,new_weld_line2,new_weld_line3,new_weld_line4};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-
-  c1[]=Point{weld_p3};
-  c2[]=Point{weld_p4};
-
-  Extrude {{c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]}, {center1[0], center1[1], center1[2]}, Pi} {
-    Surface{new_weld_line_loop};
-  }
-  Extrude {{c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]}, {center1[0], center1[1], center1[2]}, -Pi} {
-    Surface{new_weld_line_loop};
-  }
-Return
-
-Macro Compute_cross_and_theta
-  norm_1 = Sqrt(vec_1[0]^2+vec_1[1]^2+vec_1[2]^2);
-  norm_2 = Sqrt(vec_2[0]^2+vec_2[1]^2+vec_2[2]^2);
-
-  cross[] = {vec_1[1]*vec_2[2]-vec_1[2]*vec_2[1],vec_1[2]*vec_2[0]-vec_1[0]*vec_2[2],vec_1[0]*vec_2[1]-vec_1[1]*vec_2[0]};
-  norm_cross = Sqrt(cross[0]^2+cross[1]^2+cross[2]^2);
-
-  dot = vec_1[0]*vec_2[0] + vec_1[1]*vec_2[1] + vec_1[2]*vec_2[2];
-
-  theta = Acos(dot/(norm_1*norm_2));
-Return
-
-Macro Rotate_Axis
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OX_1};
-    c2[] = Point{point_OX_2};
-    Printf("Rotate_Axis point_OX_1 c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-    Printf("Rotate_Axis point_OX_2 c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  EndIf
-
-  OX[] = {c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]};
-  vec_1[] = OX[];
-  vec_2[] = {1,0,0};
-
-  Call Compute_cross_and_theta;
-
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c3[] = Point{point_OY_1};
-    c4[] = Point{point_OY_2};
-    Printf("Rotate_Axis point_OY_1 c3 (%g,%g,%g)",c3[0],c3[1],c3[2]);
-    Printf("Rotate_Axis point_OY_2 c4 (%g,%g,%g)",c4[0],c4[1],c4[2]);
-  EndIf
-
-  OY[] = {c4[0]-c3[0],c4[1]-c3[1],c4[2]-c3[2]};
-  vec_1[] = OY[];
-  vec_2[] = {0,1,0};
-
-  Call Compute_cross_and_theta;
-  
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-Return
-
-Macro Rotate_Axis_x
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OX_1};
-    c2[] = Point{point_OX_2};
-    Printf("Rotate_Axis point_OX_1 c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-    Printf("Rotate_Axis point_OX_2 c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  EndIf
-
-  OX[] = {c2[0]-c1[0],c2[1]-c1[1],0.};
-  vec_1[] = OX[];
-  vec_2[] = {1,0,0};
-
-  Call Compute_cross_and_theta;
-
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-Return
-
-Macro Rotate_Axis_1
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OX_1};
-    c2[] = Point{point_OX_2};
-    Printf("Rotate_Axis point_OX_1 c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-    Printf("Rotate_Axis point_OX_2 c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  EndIf
-
-  OX[] = {c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]};
-  vec_1[] = OX[];
-  vec_2[] = {1,0,0};
-
-  Call Compute_cross_and_theta;
-
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c3[] = Point{point_OY_1};
-    c4[] = Point{point_OY_2};
-    Printf("Rotate_Axis point_OY_1 c3 (%g,%g,%g)",c3[0],c3[1],c3[2]);
-    Printf("Rotate_Axis point_OY_2 c4 (%g,%g,%g)",c4[0],c4[1],c4[2]);
-  EndIf
-
-  OY[] = {c4[0]-c3[0],c4[1]-c3[1],c4[2]-c3[2]};
-  vec_1[] = OY[];
-  vec_2[] = {0,1,0};
-
-  Call Compute_cross_and_theta;
-  
-  //Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-Return
-
-Macro Translate_Axis
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OO};
-    Printf("Translate_Axis point_OO c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-  EndIf
-  Translate {-c1[0],-c1[1],-c1[2]} { Volume{allVolumes[] } ; }
-  allVolumes[] = Volume "*";
-Return
-
-Macro Contact_disk
-  c1[] = Point{point_disk_R_1};
-  c2[] = Point{point_disk_R_2};
-
-  center[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-
-  R = Sqrt((c1[0]-center[0])^2+(c1[1]-center[1])^2+(c1[2]-center[2])^2);
-
-  c1[] = Point{point_surface_disk_1};
-  c2[] = Point{point_surface_disk_2};
-
-  new_disk = newreg;
-  Disk(new_disk) = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2, R, R};
-
-  Printf("c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-  Printf("c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  Printf("Center (%g,%g,%g) radius %g",(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2, R) ;
-
-  BooleanFragments{ Surface{new_disk}; Delete; }{ Volume{volume_id}; Delete; }
-Return
-
-Macro Add_Optical_Axis
-  If(usePointID)
-    p1[] = Point{point_mirror_x};
-    p2[] = Point{point_mirror_y};
-    Printf("Add_Optical_Axis p1 (%g,%g,%g)",p1[0],p1[1],p1[2]);
-    Printf("Add_Optical_Axis p2 (%g,%g,%g)",p2[0],p2[1],p2[2]);
-  EndIf
-
-  Printf("Add_Optical_Axis OA (%g,%g,%g)",p1[0]+Delta_x,p2[1]+Delta_y,p1[2]);
-
-  Call Compute_next_avaible_point_id;
-  OA = next_avaible_point_id;
-  Point(OA) = {p1[0]+Delta_x, p2[1]+Delta_y, p1[2], 1};
-  new_disk = newreg;
-  Disk(new_disk) = {p1[0]+Delta_x, p2[1]+Delta_y, p1[2], R, R};
-
-  BooleanFragments{  Point{OA}; Surface{new_disk}; Delete; }{ Volume{Mirror_id}; Delete; }
-  //BooleanFragments{  Point{OA}; Delete; }{ Volume{Mirror_id}; Delete; }
-Return
-
-SetFactory("OpenCASCADE");
-
-rerun = 0;
-
-If(!FileExists("fused_mirror_assembly_all_mm.brep") || rerun)
-  v() = ShapeFromFile("mirror_assembly.stp");
-
-  BooleanFragments{ Volume{1,2,3,7,8,9,17,18,24,25,26,27}; Delete; }{}
-
-  BooleanFragments{ Volume{13,15}; Delete; }{}
-  BooleanFragments{ Volume{12,14}; Delete; }{}
-  BooleanFragments{ Volume{10,11}; Delete; }{}
-
-  // Fuse pipe 1
-  weld_p1 = 1477;
-  weld_p2 = 1478;
-  weld_p3 = 1473;
-  weld_p4 = 1471;
-  weld_p5 = 1475;
-
-  pipe_p1 = 898;
-  pipe_p2 = 900;
-
-  Call Weld_tube ;
-
-  weld_p1 = 885;
-  weld_p2 = 886;
-  weld_p3 = 884;
-  weld_p4 = 882;
-  weld_p5 = 887;
-
-  pipe_p1 = 907;
-  pipe_p2 = 908;
-
-  Call Weld_tube ;
-
-  Recursive Delete { Volume{20,32}; }
-
-  // Fuse pipe 2
-  weld_p1 = 893;
-  weld_p2 = 894;
-  weld_p3 = 892;
-  weld_p4 = 890;
-  weld_p5 = 895;
-
-  pipe_p1 = 932;
-  pipe_p2 = 931;
-
-  Call Weld_tube ;
-
-  weld_p1 = 1483;
-  weld_p2 = 1484;
-  weld_p3 = 1482;
-  weld_p4 = 1480;
-  weld_p5 = 1485;
-
-  pipe_p1 = 922;
-  pipe_p2 = 924;
-
-  Call Weld_tube ;
-  Recursive Delete { Volume{21,33}; }
-
-  // Fuse pipe 3
-  weld_p1 = 1501;
-  weld_p2 = 1502;
-  weld_p3 = 1497;
-  weld_p4 = 1495;
-  weld_p5 = 1499;
-
-  pipe_p1 = 1440;
-  pipe_p2 = 1439;
-
-  Call Weld_tube ;
-
-  Recursive Delete { Volume{35}; }
-
-  // Fuse pipe 4
-  weld_p1 = 1493;
-  weld_p2 = 1494;
-  weld_p3 = 1489;
-  weld_p4 = 1487;
-  weld_p5 = 1491;
-
-  pipe_p1 = 1456;
-  pipe_p2 = 1455;
-
-  Call Weld_tube ;
-
-  Recursive Delete { Volume{34}; }
-
-  usePointID = 0;
-
-  // Realign the axis
-  If(usePointID)
-    point_OX_1 = 1928;
-    point_OX_2 = 1929;
-
-    point_OY_1 = 1925;
-    point_OY_2 = 1927;
-  Else
-    c1[] = {6450.86,-90.1101,4467.16};
-    c2[] = {6425.67,-76.908,4448.46};
-
-    c3[] = {-7294.05,1085.32,2738.15};
-    c4[] = {-7294.05,1121.25,2759.9};
-  EndIf
-
-  Call Rotate_Axis;
-
-  If(usePointID)
-    point_OO = 2008;
-  Else
-    c1[] = {-7294.05,2346.64,1780.06};
-  EndIf
-
-  Call Translate_Axis;
-
-  c1[] = Point{7521};
-  c2[] = Point{7519};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {0.98, 0.98, 0.98}} { Volume{37} ; }  
-
-  c1[] = Point{7538};
-  c2[] = Point{7545};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {0.98, 0.98, 1.}} { Volume{38} ; }  
-
-  /*
-  c1[] = Point{7713};
-  c2[] = Point{7715};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {1.1, 1.1, 1.1}} { Volume{51} ; }  
-
-  c1[] = Point{7777};
-  c2[] = Point{7779};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {1.1, 1.1, 1.1}} { Volume{56} ; }  
-
-  c1[] = Point{7501};
-  c2[] = Point{7506};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {1.1, 1.1, 1.1}} { Volume{36} ; }  
-
-  c1[] = Point{7736};
-  c2[] = Point{7737};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {1.2, 1.2, 1.}} { Volume{53} ; }  
-
-  c1[] = Point{7855};
-  c2[] = Point{7855};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {1.2, 1.2, 1.}} { Volume{62} ; }  
-
-  c1[] = Point{7620};
-  c2[] = Point{7619};
-  Dilate {{(c1[0]+c2[0])/2.,(c1[1]+c2[1])/2.,(c1[2]+c2[2])/2.}, {1.2, 1.2, 1.}} { Volume{44} ; }  
-*/
-  curves_id_1[] = {12528, 12529, 12519, 12525};
-  curves_id_2[] = {12475, 12482, 12470, 12469};
-  curves_id_3[] = {12399, 12396};
-  curves_id_4[] = {12484, 12485};
-  volume_id_1 = 45;
-  volume_id_2 = 50;
-  volume_id_3 = 51;
-  volume_id_4 = 48;
-  volume_id_5 = 49;
-  volume_id_6 = 52;
-  volume_id_7 = 53;
-  volume_id_8 = 46;
-  volume_id_9 = 47;
-  Call Weld_bolt_2;
-
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = { 13117, 13118, 13119, 13120, 13121, 13122, 13123, 13124};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 5} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];  
-  num[] = Extrude {0, 0, -11} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];  
-
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = {13089, 13080, 13079, 13078};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 2} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];  
-
-  BooleanUnion{ Volume{new_volume_1}; Delete; }{ Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Delete; }
-
-  curves_id_1[] = {13014, 13027, 13028, 13017};
-  curves_id_2[] = {12349, 12355, 12362, 12350};
-  curves_id_3[] = {12978, 12975};
-  curves_id_4[] = {12364, 12365};
-  volume_id_1 = 36;
-  volume_id_2 = 37;
-  volume_id_3 = 38;
-  volume_id_4 = 42;
-  volume_id_5 = 43;
-  volume_id_6 = 39;
-  volume_id_7 = 44;
-  volume_id_8 = 40;
-  volume_id_9 = 41;
-  Call Weld_bolt_2;
-
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = {13235, 13236, 13237, 13240, 13241, 13242};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 20} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];  
-  num[] = Extrude {0, 0, -5} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];  
-
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = {13218, 13220, 13223, 13224};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 2} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];  
-  num[] = Extrude {0, 0, -0.07} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_5 = num[1];    
-
-  BooleanUnion{ Volume{79}; Delete; }{ Volume{80}; Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Volume{new_volume_5}; Delete; }
-  BooleanUnion{ Volume{79}; Delete; }{ Volume{80}; Delete; }
-
-  curves_id_1[] = {12619, 12622, 12628, 12629};
-  curves_id_2[] = {12652, 12658, 12665, 12653};
-  curves_id_3[] = {12583, 12580};
-  curves_id_4[] = {12668, 12667};
-  volume_id_1 = 54;
-  volume_id_2 = 55;
-  volume_id_3 = 56;
-  volume_id_4 = 57;
-  volume_id_5 = 58;
-  volume_id_6 = 61;
-  volume_id_7 = 62;
-  volume_id_8 = 59;
-  volume_id_9 = 60;
-  //Call Weld_bolt_2;
-
-  c1[] = Point{7855};
-  c2[] = Point{7853};
-
-  c3[] = Point{7761};
-
-  c4[] = Point{7776};
-  c5[] = Point{7778};
-
-  dz = c3[2]-c1[2];
-  
-  center[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-
-  D = Sqrt((c4[0]-c5[0])^2+(c4[1]-c5[1])^2+(c4[2]-c5[2])^2);
-  R = D/2.;
-
-  Recursive Delete { Volume{56}; }
-
-  Cylinder(56) = {center[0],center[1],center[2], 0, 0, dz, R, 2*Pi};
-
-  Call Weld_bolt_2;
-
-  //+
-  //BooleanUnion{ Volume{24}; Delete; }{ Volume{25}; Delete; }
-
-  /*
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = {13449, 13448, 13447, 13446, 13445, 13444, 13443, 13442};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 20} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];  
-  num[] = Extrude {0, 0, -7} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];  
-
-  new_weld_line_loop = newreg;
-  Line Loop(new_weld_line_loop) = {13418, 13423, 13408, 13434, 13417, 13399};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 5} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];     
-  BooleanUnion{ Volume{81}; Delete; }{ Volume{82}; Volume{83}; Delete; }
-  BooleanUnion{ Volume{80}; Delete; }{ Volume{81}; Delete; }
-  //BooleanUnion{ Volume{82}; Delete; }{ Volume{83}; Delete; }
-  */
-
-
-  //BooleanUnion{ Volume{new_volume_1}; Delete; }{ Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Delete; }
-  
-  Recursive Delete { Volume{3,17,18}; }
-  Recursive Delete { Volume{64, 65}; }  
-
-  BooleanUnion{ Volume{31}; Delete; }{ Volume{77}; Volume{76}; Delete; }
-  BooleanUnion{ Volume{30}; Delete; }{ Volume{75}; Volume{74}; Delete; }
-  BooleanUnion{ Volume{23}; Delete; }{ Volume{73}; Volume{72}; Volume{71}; Volume{70}; Delete; }
-  BooleanUnion{ Volume{22}; Delete; }{ Volume{69}; Volume{68}; Volume{67}; Volume{66}; Delete; }
-  
-  allVolumes[] = Volume "*";
-  BooleanFragments{ Volume{allVolumes[] }; Delete; }{}
-  
-  Recursive Delete { Volume{81}; } 
-
-  If(usePointID)
-    point_mirror_x = 945;
-    point_mirror_y = 943;
-  Else
-    p1[] = {129.5,10,5.5};
-    p2[] = {99.5,-20,5.5};
-  EndIf
-
-  Delta_x = -70;
-  Delta_y = 37;
-
-  Mirror_id = 2;
-  R = 1.;
-
-  //Call Add_Optical_Axis;  
-
-  // Realign the axis
-  If(usePointID)
-    point_OX_1 = 9207;
-    point_OX_2 = 9239;
-
-    point_OY_1 = 10843;
-    point_OY_2 = 10845;
-  Else
-    c1[] = {-135.485,130.067,53.5926};
-    c2[] = {-119.545,121.737,54.3284};
-
-    c3[] = {-177.978,53.1314,60.3884};
-    c4[] = {-177.978,-46.8634,61.4069};
-  EndIf
-
-  Call Rotate_Axis_x;
-
-  Save "fused_mirror_assembly_all_mm.brep";
-  Call Clear_all;
-EndIf
-
-Merge "fused_mirror_assembly_all_mm.brep";  
-
-Physical Volume("Mirror") = {2};
-Physical Volume("Substrate") = {1};
-Physical Volume("Washer 1") = {5};
-Physical Volume("Washer 2") = {4};
-Physical Volume("Washer 3") = {3};
-
-Physical Volume("Shaft 1") = {8};
-Physical Volume("Shaft 2") = {7};
-Physical Volume("Shaft 3") = {6};  
-
-Physical Volume("Spacer 1 part 1") = {12};
-Physical Volume("Spacer 2 part 1") = {11};
-Physical Volume("Spacer 3 part 1") = {9};
-
-Physical Volume("Spacer 1 part 2") = {14};
-Physical Volume("Spacer 2 part 2") = {13};
-Physical Volume("Spacer 3 part 2") = {10};
-
-Physical Volume("Holder") = {15,16};
-
-Physical Volume("Nut 1") = {17};
-Physical Volume("Nut 2") = {18};
-Physical Volume("Nut 3") = {21};
-
-Physical Volume("Holder 2") = {19,20};
-
-Physical Volume("Pipes") = {24, 25, 26, 27};
-
-Physical Volume("Bolts") = {22, 23, 28};
-
-Physical Surface("Mirror surface") = {113};
-
-Physical Surface("Cooling channels") = {521, 497, 522, 526, 525, 520, 518, 517, 516, 499, 500, 501, 509, 510, 511, 498, 502, 519, 503, 512, 524, 508, 507, 506, 515, 514, 505, 513, 504};
-Physical Surface("Cooling channels") += {621, 620, 642, 619, 641};
-Physical Surface("Cooling channels") += {878, 850, 803, 793, 845, 800, 795, 796, 799, 879, 876, 851, 849, 864, 865, 848, 863, 842, 784, 812, 785, 786, 811, 859, 875, 858, 841, 873, 874, 840, 787, 789, 808, 810, 788, 790, 807, 791, 839, 806, 805, 860, 870, 838, 866, 868, 869, 846, 797, 802, 801, 794, 855, 809, 877, 854, 872, 871, 852, 862, 844, 853, 847, 861, 856, 857, 867, 843, 804, 792};
-Physical Surface("Cooling channels") += {970, 900, 965, 902, 904, 880, 901, 881, 903, 899, 974, 973, 967, 966, 969, 968, 971, 972};
-Physical Surface("Cooling channels") += {1184, 1185, 1188, 1189, 1198, 1197, 1202, 1201, 1200, 1199, 1226, 1225, 1229, 1227, 1213, 1212, 1217, 1157, 1156, 1152, 1153, 1148, 1149, 1174, 1173, 1170, 1169, 1165, 1166, 1162, 1161, 1144, 1145, 1216, 1228, 1223, 1224, 1221, 1222, 1230, 1196, 1195, 1194, 1193};
-
-Physical Surface("Holder x") = {736, 915, 954};
-Physical Point("Holder yz") = {978};
-Physical Point("Holder z") = {988};
-
-Mesh.Algorithm = 6;
-//Mesh.Algorithm3D = 4;
-Mesh.CharacteristicLengthMin = 1.;
-Mesh.CharacteristicLengthMax = 1.;
-Mesh.MshFileVersion = 2.2;
diff --git a/katoptron/Juelich/mesh/fused_mirror_assembly_mm.brep b/katoptron/Juelich/mesh/fused_mirror_assembly_mm.brep
deleted file mode 100644
index 04fea149a8f371fd94b20c04a07e10c6e2994ead..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/mesh/fused_mirror_assembly_mm.brep
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2747b151adb714224c128182267ce0437c3b776f0d00eb1770036fd270934e56
-size 808561
diff --git a/katoptron/Juelich/mesh/fused_mirror_assembly_mm.geo b/katoptron/Juelich/mesh/fused_mirror_assembly_mm.geo
deleted file mode 100644
index e042e679b3e81be965c36f291289709cd15fce70..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/mesh/fused_mirror_assembly_mm.geo
+++ /dev/null
@@ -1,324 +0,0 @@
-// This .geo has been tested with gmsh 3.0.6 and 4.4.1 binaries for Mac and Linux
-
-Macro Clear_all
-  allVolumes[] = Volume "*";
-  Recursive Delete { Volume{allVolumes[] } ; }
-  allSurfaces[] = Surface "*";
-  Recursive Delete { Surface{allSurfaces[] } ; }  
-  allPoints[] = Point "*";
-  Recursive Delete { Point{allPoints[] } ; }    
-Return
-
-Macro Compute_next_avaible_point_id
-  allPoints[] = Point "*" ;
-  NallPoints = #allPoints[] ;
-  Printf("NallPoints %f",NallPoints);
-  next_avaible_point_id = 0;
-  compute_next_avaible_point_id_verbose = 0;
-  For i In {0:NallPoints-1}
-    If(compute_next_avaible_point_id_verbose)
-      Printf("Compute_next_avaible_point_id %g, %g",i,allPoints[i]);
-    EndIf
-    If(allPoints[i]>= next_avaible_point_id)
-      next_avaible_point_id = allPoints[i] + 1;
-    EndIf
-  EndFor
-  Printf("Compute_next_avaible_point_id newp %g",newp);
-  Printf("Compute_next_avaible_point_id next_avaible_point_id %g",next_avaible_point_id);
-Return
-
-Macro Scale_axis_mm_to_m
-  allPoints[] = Point "*" ;
-  allLines[] = Line "*" ;
-  allSurfaces[] = Surface "*";
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OO};
-  EndIf
-  Dilate {{-c1[0],-c1[1],-c1[2]},0.001} { Volume{allVolumes[] } ; }
-
-  allPoints[] = Point "*" ;
-  allLines[] = Line "*" ;
-  allSurfaces[] = Surface "*";
-  allVolumes[] = Volume "*";
-Return
-
-Macro Weld_bolt
-  new_weld_line_loop = newreg;
-  Curve Loop(new_weld_line_loop) = curves_id_1[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.026} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_1 = num[1];
-  num[] = Extrude {0, 0, -0.012} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_2 = num[1];
-  new_weld_line_loop = newreg;
-  Curve Loop(new_weld_line_loop) = curves_id_2[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, 0.002} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_3 = num[1];
-  new_weld_line_loop = newreg;
-  Curve Loop(new_weld_line_loop) = curves_id_3[];
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-  num[] = Extrude {0, 0, -0.006} {
-    Surface{new_weld_line_loop};
-  };
-  new_volume_4 = num[1];
-  num[] = BooleanUnion{ Volume{volume_id_1}; Delete; }{ Volume{volume_id_2}; Volume{volume_id_3}; Volume{volume_id_4}; Volume{volume_id_5}; Volume{volume_id_6}; Volume{volume_id_7}; Volume{volume_id_8}; Volume{volume_id_9}; Volume{new_volume_1}; Volume{new_volume_2}; Volume{new_volume_3}; Volume{new_volume_4}; Delete; };
-  new_volume_1 = num[0];
-Return
-
-Macro Weld_tube
-  c1[] = Point{pipe_p1};
-  c2[] = Point{pipe_p2};
-  center1[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-  pipe_radius = Sqrt((c1[0]-center1[0])^2+(c1[1]-center1[1])^2+(c1[2]-center1[2])^2);
-
-  c1[] = Point{weld_p1};
-  c2[] = Point{weld_p5};
-  center1[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-  weld_radius = Sqrt((c1[0]-center1[0])^2+(c1[1]-center1[1])^2+(c1[2]-center1[2])^2);
-
-  new_weld_p1 = newp;
-  Point(new_weld_p1) = {(pipe_radius/weld_radius)*(c1[0]-center1[0])+center1[0],(pipe_radius/weld_radius)*(c1[1]-center1[1])+center1[1],(pipe_radius/weld_radius)*(c1[2]-center1[2])+center1[2]};
-  new_weld_line1 = newreg; Line(new_weld_line1) = {new_weld_p1, weld_p2};
-  new_weld_line2 = newreg; Line(new_weld_line2) = {weld_p2, weld_p3};
-  new_weld_line3 = newreg; Line(new_weld_line3) = {weld_p3, weld_p4};
-  new_weld_line4 = newreg; Line(new_weld_line4) = {weld_p4, new_weld_p1};
-
-  new_weld_line_loop = newreg;  Line Loop(new_weld_line_loop) = {new_weld_line1,new_weld_line2,new_weld_line3,new_weld_line4};
-  Plane Surface(new_weld_line_loop) = {new_weld_line_loop};
-
-  c1[]=Point{weld_p3};
-  c2[]=Point{weld_p4};
-
-  Extrude {{c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]}, {center1[0], center1[1], center1[2]}, Pi} {
-    Surface{new_weld_line_loop};
-  }
-  Extrude {{c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]}, {center1[0], center1[1], center1[2]}, -Pi} {
-    Surface{new_weld_line_loop};
-  }
-Return
-
-Macro Compute_cross_and_theta
-  norm_1 = Sqrt(vec_1[0]^2+vec_1[1]^2+vec_1[2]^2);
-  norm_2 = Sqrt(vec_2[0]^2+vec_2[1]^2+vec_2[2]^2);
-
-  cross[] = {vec_1[1]*vec_2[2]-vec_1[2]*vec_2[1],vec_1[2]*vec_2[0]-vec_1[0]*vec_2[2],vec_1[0]*vec_2[1]-vec_1[1]*vec_2[0]};
-  norm_cross = Sqrt(cross[0]^2+cross[1]^2+cross[2]^2);
-
-  dot = vec_1[0]*vec_2[0] + vec_1[1]*vec_2[1] + vec_1[2]*vec_2[2];
-
-  theta = Acos(dot/(norm_1*norm_2));
-Return
-
-Macro Rotate_Axis
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OX_1};
-    c2[] = Point{point_OX_2};
-    Printf("Rotate_Axis point_OX_1 c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-    Printf("Rotate_Axis point_OX_2 c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  EndIf
-
-  OX[] = {c2[0]-c1[0],c2[1]-c1[1],c2[2]-c1[2]};
-  vec_1[] = OX[];
-  vec_2[] = {1,0,0};
-
-  Call Compute_cross_and_theta;
-
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c3[] = Point{point_OY_1};
-    c4[] = Point{point_OY_2};
-    Printf("Rotate_Axis point_OY_1 c3 (%g,%g,%g)",c3[0],c3[1],c3[2]);
-    Printf("Rotate_Axis point_OY_2 c4 (%g,%g,%g)",c4[0],c4[1],c4[2]);
-  EndIf
-
-  OY[] = {c4[0]-c3[0],c4[1]-c3[1],c4[2]-c3[2]};
-  vec_1[] = OY[];
-  vec_2[] = {0,1,0};
-
-  Call Compute_cross_and_theta;
-  Rotate {{cross[0],cross[1],cross[2]}, {0, 0, 0}, theta} { Volume{allVolumes[] } ; }
-
-Return
-
-Macro Translate_Axis
-  allVolumes[] = Volume "*";
-  If(usePointID)
-    c1[] = Point{point_OO};
-    Printf("Translate_Axis point_OO c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-  EndIf
-  Translate {-c1[0],-c1[1],-c1[2]} { Volume{allVolumes[] } ; }
-  allVolumes[] = Volume "*";
-Return
-
-Macro Contact_disk
-  c1[] = Point{point_disk_R_1};
-  c2[] = Point{point_disk_R_2};
-
-  center[] = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2};
-
-  R = Sqrt((c1[0]-center[0])^2+(c1[1]-center[1])^2+(c1[2]-center[2])^2);
-
-  c1[] = Point{point_surface_disk_1};
-  c2[] = Point{point_surface_disk_2};
-
-  new_disk = newreg;
-  Disk(new_disk) = {(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2, R, R};
-
-  Printf("c1 (%g,%g,%g)",c1[0],c1[1],c1[2]);
-  Printf("c2 (%g,%g,%g)",c2[0],c2[1],c2[2]);
-  Printf("Center (%g,%g,%g) radius %g",(c1[0]+c2[0])/2, (c1[1]+c2[1])/2, (c1[2]+c2[2])/2, R) ;
-
-  BooleanFragments{ Surface{new_disk}; Delete; }{ Volume{volume_id}; Delete; }
-Return
-
-Macro Add_Optical_Axis
-  If(usePointID)
-    p1[] = Point{point_mirror_x};
-    p2[] = Point{point_mirror_y};
-    Printf("Add_Optical_Axis p1 (%g,%g,%g)",p1[0],p1[1],p1[2]);
-    Printf("Add_Optical_Axis p2 (%g,%g,%g)",p2[0],p2[1],p2[2]);
-  EndIf
-
-  Printf("Add_Optical_Axis OA (%g,%g,%g)",p1[0]+Delta_x,p2[1]+Delta_y,p1[2]);
-
-  Call Compute_next_avaible_point_id;
-  OA = next_avaible_point_id;
-  Point(OA) = {p1[0]+Delta_x, p2[1]+Delta_y, p1[2], 1};
-  new_disk = newreg;
-  Disk(new_disk) = {p1[0]+Delta_x, p2[1]+Delta_y, p1[2], R, R};
-
-  BooleanFragments{  Point{OA}; Surface{new_disk}; Delete; }{ Volume{Mirror_id}; Delete; }
-  //BooleanFragments{  Point{OA}; Delete; }{ Volume{Mirror_id}; Delete; }
-Return
-
-SetFactory("OpenCASCADE");
-
-rerun = 0;
-
-If(!FileExists("fused_mirror_assembly_mm.brep") || rerun)
-  v() = ShapeFromFile("mirror_assembly.stp");
-
-  For k In {20:23:1}
-    Recursive Delete { Volume{k}; }
-  EndFor
-
-  For k In {27:62:1}
-    Recursive Delete { Volume{k}; }
-  EndFor
-
-  allVolumes[] = Volume "*";
-  BooleanFragments{ Volume{allVolumes[] }; Delete; }{}
-
-  usePointID = 0;
-
-  // Realign the axis
-
-  If(usePointID)
-    point_OX_1 = 835;
-    point_OX_2 = 834;
-
-    point_OY_1 = 938;
-    point_OY_2 = 940;
-  Else
-    c1[] = {6450.86,-90.1101,4467.16};
-    c2[] = {6425.67,-76.908,4448.46};
-
-    c3[] = {-7294.05,1085.32,2738.15};
-    c4[] = {-7294.05,1121.25,2759.9};
-  EndIf
-
-  Call Rotate_Axis;
-
-  If(usePointID)
-    point_OO = 938;
-  Else
-    c1[] = {-7294.05,2346.64,1780.06};
-  EndIf
-
-  Call Translate_Axis;
-
-  usePointID = 1;
-
-  If(usePointID)
-    point_mirror_x = 4046;
-    point_mirror_y = 4045;
-  Else
-    p1[] = {129.5,10,5.1462499};
-    p2[] = {99.5,-20,5.1462499};
-  EndIf
-
-  Delta_x = -70;
-  Delta_y = 37;
-
-  Mirror_id = 2;
-  R = 1.;
-
-  //Call Add_Optical_Axis;
-
-  Recursive Delete { Volume{3,17,18}; }
-
-  Save "fused_mirror_assembly_mm.brep";
-  Call Clear_all;
-EndIf
-
-Merge "fused_mirror_assembly_mm.brep";  
-
-Physical Volume("Mirror") = {2};
-Physical Volume("Substrate") = {1};
-Physical Volume("Washer 1") = {5};
-Physical Volume("Washer 2") = {4};
-Physical Volume("Washer 3") = {3};
-
-Physical Volume("Shaft 1") = {8};
-Physical Volume("Shaft 2") = {7};
-Physical Volume("Shaft 3") = {6};  
-
-Physical Volume("Spacer 1 part 1") = {12};
-Physical Volume("Spacer 2 part 1") = {11};
-Physical Volume("Spacer 3 part 1") = {9};
-
-Physical Volume("Spacer 1 part 2") = {14};
-Physical Volume("Spacer 2 part 2") = {13};
-Physical Volume("Spacer 3 part 2") = {10};
-
-Physical Volume("Holder") = {15,16};
-
-Physical Volume("Nut 1") = {18};
-Physical Volume("Nut 2") = {19};
-Physical Volume("Nut 3") = {17};
-
-Physical Surface("Mirror surface") = {113};
-//Physical Surface("Disk around optical axis") = {738};
-
-Physical Surface("Cooling channels") = {524, 525, 526, 597, 598, 599, 619, 620};
-
-For k In {497:522}
-  Physical Surface("Cooling channels") += {k};
-EndFor
-
-Physical Surface("Holder z clamping") = {544, 545, 562, 563, 572, 573};
-Physical Surface("Holder x-y clamping") = {553, 554, 546, 547, 568, 569};
-
-Physical Point("Holder x-y-z clamping point") = {762};
-Physical Point("Holder z clamping point") = {740};
-Physical Point("Holder z-y clamping point") = {733};
-
-Physical Point("Optical Axis") = {958};
-
-
-Mesh.Algorithm = 6;
-//Mesh.Algorithm3D = 4;
-Mesh.CharacteristicLengthMin = 1.5;
-Mesh.CharacteristicLengthMax = 1.5;
-Mesh.MshFileVersion = 2.2;
diff --git a/katoptron/Juelich/post_process/AB.py b/katoptron/Juelich/post_process/AB.py
deleted file mode 100755
index f988bc6466b6e8816bf9dd66759da800303fad2f..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/post_process/AB.py
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-import numpy as np
-import os
-from katoptron.Juelich.post_process.vtk_post_process_2 import post_process
-from katoptron.Juelich.post_process.vtk_post_process_2 import post_process_mirror
-
-
-def cuts(filename, filename_ref, dz1, T1, dz2, T2, remove_ref=False):
-    p_cut = np.array([5.971051450397588, 20.29345703125, -26.85714554786682])
-    n_cut = np.array([1., 0., 0.])
-
-    directory = 'cut_1'
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    post_process(filename=filename,
-                 filename_ref=filename_ref,
-                 remove_ref=remove_ref,
-                 p_cut=p_cut,
-                 scale_u=1. / 1000.,
-                 scale_T=1.,
-                 n_cut=n_cut,
-                 T_range=T1,
-                 dz_range=dz1)
-
-    os.chdir('..')
-
-    directory = 'cut_2'
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    p_cut = np.array(
-        [24.91341173426381, 4.525806024554082, -26.975820456076352])
-    n_cut = np.array([0.20170202470821563, -0.9790050766051117, 0.])
-
-    post_process(filename=filename,
-                 filename_ref=filename_ref,
-                 remove_ref=remove_ref,
-                 p_cut=p_cut,
-                 scale_u=1. / 1000.,
-                 scale_T=1.,
-                 n_cut=n_cut,
-                 T_range=T2,
-                 dz_range=dz2)
-
-    os.chdir('..')
-
-
-def cuts_all_N(N, case_id, ref_case_id, case_name, remove_ref, T1, Z1, T2, Z2):
-    file_dir = os.path.dirname(__file__)
-    for i in range(0, N):
-        directory = 'point_' + str(i) + '_' + case_name
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-        os.chdir(directory)
-        base_dir = file_dir + '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused/MPI_2/' + case_id + '/1/' + str(
-            i)
-        base_dir_ref = file_dir + '/../../../workspace/katoptron_Juelich_tests_M1_assembly_fused/MPI_2/' + ref_case_id + '/1/' + str(
-            i)
-        cuts(base_dir + '/fused_mirror_assembly_mm_part_2_ast1_s0.pvtu',
-             base_dir_ref + '/fused_mirror_assembly_mm_part_2_ast1_s0.pvtu',
-             dz1[i, :], T1[i, :], dz2[i, :], T2[i, :], remove_ref=remove_ref)
-        post_process_mirror(filename=base_dir + '/mirror_data_all.npz',
-                            filename_ref=base_dir_ref + '/mirror_data_all.npz',
-                            remove_ref=remove_ref)
-        os.chdir('..')
-
-
-if __name__ == "__main__":
-
-    N = 2
-
-    T1 = np.zeros((N, 2))
-    dz1 = np.zeros((N, 2))
-
-    T2 = np.zeros((N, 2))
-    dz2 = np.zeros((N, 2))
-
-    T1[0, :] = [70, 120.00236433]
-    T1[1, :] = [70, 160.19321603]
-
-    T2[0, :] = [70, 120.00236433]
-    T2[1, :] = [70, 160.19321603]
-
-    #cuts_all_N(N, 'A2', 'A2_baking', 'A', False, T, Z)
-    #cuts_all_N(N, 'B2', 'B2_baking', 'B', False, T, Z)
-
-    dz1[0, :] = [5e-07, 2e-05]
-    dz1[1, :] = [-1.5e-06, 4e-05]
-
-    dz2[0, :] = [-2.5e-05, 2.1e-05]
-    dz2[1, :] = [-5e-05, 5e-05]
-    '''
-    dz1[0, :] = [5e-07, 1.5e-05]
-    dz1[1, :] = [-1.5e-06, 4e-05]
-
-    dz2[0, :] = [-2.5e-05, 1.6e-05]
-    dz2[1, :] = [-5e-05, 5e-05]    
-    '''
-    cuts_all_N(N, 'A2', 'A2_baking', 'A_diff', True, T1, dz1, T2, dz2)
-    '''
-    dz1[0, :] = [1.9e-06, 2e-05]
-    dz1[1, :] = [1e-06, 4e-05]
-
-    dz2[0, :] = [-2.1e-05, 2.1e-05]
-    dz2[1, :] = [-5e-05, 5e-05]    
-    '''
-    cuts_all_N(N, 'B2', 'B2_baking', 'B_diff', True, T1, dz1, T2, dz2)
diff --git a/katoptron/Juelich/post_process/__init__.py b/katoptron/Juelich/post_process/__init__.py
deleted file mode 100644
index e8aed8a0e2f77220f1adb944a0e00d317b1934bc..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/post_process/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# -*- coding: utf-8 -*-
-# katoptron.Juelich.post_process MODULE initialization file
diff --git a/katoptron/Juelich/post_process/vtk_post_process.py b/katoptron/Juelich/post_process/vtk_post_process.py
deleted file mode 100644
index 33b7bb9211266f5f3cbda182f07bad407f1f8213..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/post_process/vtk_post_process.py
+++ /dev/null
@@ -1,328 +0,0 @@
-import vtk
-import numpy as np
-from numpy import zeros
-import matplotlib.pyplot as plt
-#from mpl_toolkits.mplot3d import Axes3D
-#import matplotlib2tikz
-from numpy import linalg as LA
-
-
-def SaveFigureAsImage(fileName, fig=None, **kwargs):
-    ''' Save a Matplotlib figure as an image without borders or frames.
-       Args:
-            fileName (str): String that ends in .png etc.
-
-            fig (Matplotlib figure instance): figure you want to save as the image
-        Keyword Args:
-            orig_size (tuple): width, height of the original image used to maintain 
-            aspect ratio.
-    '''
-    fig_size = fig.get_size_inches()
-    w, h = fig_size[0], fig_size[1]
-    fig.patch.set_alpha(0)
-    if 'orig_size' in kwargs:  # Aspect ratio scaling if required
-        w, h = kwargs['orig_size']
-        w2, h2 = fig_size[0], fig_size[1]
-        fig.set_size_inches([((w2 / w)) * w, ((w2 / w)) * h])
-        fig.set_dpi(((w2 / w)) * fig.get_dpi())
-    a = fig.gca()
-    a.set_frame_on(False)
-    a.set_xticks([])
-    a.set_yticks([])
-    plt.axis('off')
-    plt.xlim(0, h)
-    plt.ylim(w, 0)
-    fig.savefig(fileName, transparent=True, bbox_inches='tight',
-                pad_inches=0)
-
-
-def compute_integrated_F(volume_id,
-                         component_id,
-                         cut_origin_x,
-                         cut_origin_y,
-                         cut_origin_z,
-                         cut_normal_x,
-                         cut_normal_y,
-                         cut_normal_z,
-                         reader,
-                         plot_results=False):
-
-    thresh = vtk.vtkThreshold()
-    thresh.ThresholdBetween(volume_id - 0.5, volume_id + 0.5)
-    thresh.SetInputConnection(reader.GetOutputPort())
-    thresh.SetInputArrayToProcess(0, 0, 0,
-                                  vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS,
-                                  "volume_id")
-    thresh.Update()
-
-    plane = vtk.vtkPlane()
-    plane.SetOrigin(cut_origin_x, cut_origin_y, cut_origin_z)
-    plane.SetNormal(cut_normal_x, cut_normal_y, cut_normal_z)
-
-    cutter = vtk.vtkCutter()
-    cutter.SetCutFunction(plane)
-    cutter.SetInputConnection(thresh.GetOutputPort())
-    cutter.Update()
-
-    data = cutter.GetOutput()
-
-    triangles = data.GetPolys().GetData()
-    points = data.GetPoints()
-
-    stress = data.GetCellData().GetArray('sigma')
-
-    ntri = (triangles.GetNumberOfTuples() // 4)
-    npts = points.GetNumberOfPoints()
-    nstress = stress.GetNumberOfTuples()
-
-    tri = zeros((ntri, 3), dtype=int)
-    x = zeros(npts)
-    y = zeros(npts)
-    z = zeros(npts)
-
-    sigma_vector = zeros(nstress)
-
-    sigma_vector_node = zeros(npts)
-    area_node = zeros(npts)
-
-    for i in range(0, ntri):
-        tri[i, 0] = triangles.GetTuple(4 * i + 1)[0]
-        tri[i, 1] = triangles.GetTuple(4 * i + 2)[0]
-        tri[i, 2] = triangles.GetTuple(4 * i + 3)[0]
-
-    for i in range(npts):
-        pt = points.GetPoint(i)
-        x[i] = pt[0]
-        y[i] = pt[1]
-        z[i] = pt[2]
-
-    for i in range(0, nstress):
-        sigma = stress.GetTuple(i)
-        sigma_vector[i] = sigma[component_id]
-
-    if plot_results:
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('coolwarm')
-        #plt.triplot(x, y, tri)
-        axtri = plt.tripcolor(x, y, tri, sigma_vector)
-        #plt.scatter(x, y)
-        plt.gca().set_aspect('equal')
-        cb = fig.colorbar(axtri, orientation="horizontal")
-
-    F = 0.
-    total_area = 0.
-    for i in range(0, ntri):
-        cross = np.cross(
-            np.array([
-                x[tri[i, 1]] - x[tri[i, 0]], y[tri[i, 1]] - y[tri[i, 0]],
-                z[tri[i, 1]] - z[tri[i, 0]]
-            ]),
-            np.array([
-                x[tri[i, 2]] - x[tri[i, 0]], y[tri[i, 2]] - y[tri[i, 0]],
-                z[tri[i, 2]] - z[tri[i, 0]]
-            ]))
-        area = (LA.norm(cross) / 2)
-        F = F + area * sigma_vector[i]
-        total_area = total_area + area
-        for j in range(0, 3):
-            sigma_vector_node[tri[i, j]] = sigma_vector_node[
-                tri[i, j]] + area * sigma_vector[i]
-            area_node[tri[i, j]] = area_node[tri[i, j]] + area
-
-    for i in range(npts):
-        sigma_vector_node[i] = (sigma_vector_node[i] / area_node[i])
-
-    if plot_results:
-        fig = plt.figure(figsize=(8, 8))
-        plt.set_cmap('coolwarm')
-        #plt.triplot(x, y, tri)
-        axtri = plt.tricontourf(x, y, tri, sigma_vector_node)
-        #plt.scatter(x, y)
-        plt.gca().set_aspect('equal')
-        cb = fig.colorbar(axtri, orientation="horizontal")
-
-    return F
-
-
-def post_process():
-    filename = 'MIRROR_1_ASSEMBLY_fused_2_ast1_s0_0.vtu'
-
-    reader = vtk.vtkXMLUnstructuredGridReader()
-    reader.SetFileName(filename)
-    reader.Update()
-
-    #data1 = reader.GetOutput()
-
-    thresh = vtk.vtkThreshold()
-    thresh.ThresholdBetween(8.5, 11.5)
-    thresh.SetInputConnection(reader.GetOutputPort())
-    thresh.SetInputArrayToProcess(0, 0, 0,
-                                  vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS,
-                                  "volume_id")
-    thresh.Update()
-
-    plane = vtk.vtkPlane()
-    plane.SetOrigin(-0.0156128890812397, 0.020816631615161896,
-                    -0.009049303388172896)
-    plane.SetNormal(0, 0, 1)
-
-    cutter = vtk.vtkFiltersCorePython.vtkCutter()
-    cutter.SetCutFunction(plane)
-    cutter.SetInputConnection(thresh.GetOutputPort())
-    cutter.Update()
-
-    data = cutter.GetOutput()
-
-    triangles = data.GetPolys().GetData()
-    points = data.GetPoints()
-
-    mapper = vtk.vtkCellDataToPointData()
-    mapper.AddInputData(data)
-    mapper.Update()
-
-    vels = mapper.GetOutput().GetPointData().GetArray('z')  # .GetArray(1)
-
-    stress = data.GetCellData().GetArray('sigma')
-    stress_VM = data.GetCellData().GetArray('von Mises')
-
-    ntri = (triangles.GetNumberOfTuples() // 4)
-    npts = points.GetNumberOfPoints()
-    nvls = points.GetNumberOfPoints()  # vels.GetNumberOfTuples()
-
-    nstress = stress.GetNumberOfTuples()
-
-    tri = zeros((ntri, 3), dtype=int)
-    x = zeros(npts)
-    y = zeros(npts)
-    z = zeros(npts)
-    ux = zeros(nvls)
-
-    sigma_vector_node = zeros(npts)
-    area_node = zeros(npts)
-
-    sigma_zz = zeros(nstress)
-
-    for i in range(0, ntri):
-        tri[i, 0] = triangles.GetTuple(4 * i + 1)[0]
-        tri[i, 1] = triangles.GetTuple(4 * i + 2)[0]
-        tri[i, 2] = triangles.GetTuple(4 * i + 3)[0]
-
-    for i in range(npts):
-        pt = points.GetPoint(i)
-        x[i] = pt[0]
-        y[i] = pt[1]
-        z[i] = pt[2]
-
-    for i in range(0, nvls):
-        U = vels.GetTuple(i)
-        ux[i] = U[0]
-
-    for i in range(0, nstress):
-        sigma = stress.GetTuple(i)
-        sigma_zz[i] = sigma[8]
-
-    for i in range(0, ntri):
-        cross = np.cross(
-            np.array([
-                x[tri[i, 1]] - x[tri[i, 0]], y[tri[i, 1]] - y[tri[i, 0]],
-                z[tri[i, 1]] - z[tri[i, 0]]
-            ]),
-            np.array([
-                x[tri[i, 2]] - x[tri[i, 0]], y[tri[i, 2]] - y[tri[i, 0]],
-                z[tri[i, 2]] - z[tri[i, 0]]
-            ]))
-        area = (LA.norm(cross) / 2)
-        for j in range(0, 3):
-            sigma_vector_node[
-                tri[i, j]] = sigma_vector_node[tri[i, j]] + area * sigma_zz[i]
-            area_node[tri[i, j]] = area_node[tri[i, j]] + area
-
-    for i in range(npts):
-        sigma_vector_node[i] = (sigma_vector_node[i] / area_node[i])
-
-    #tmp = stress.GetTuple(0)
-
-    levels = np.linspace(min(ux), max(ux), 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(x,
-                   y,
-                   tri,
-                   ux,
-                   levels,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, ux, levels)
-    plt.gca().set_aspect('equal')
-
-    # plt.minorticks_on()
-    # plt.gca().set_xticklabels([])
-    # plt.gca().set_yticklabels([])
-    # plt.gca().set_axis_off()
-    #plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
-    # plt.margins(0,0)
-    # plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    # plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    # plt.axis('off')
-    #plt.tricontour(x, y, tri, ux, 16)
-    # plt.show
-    #plt.savefig("Ux.pdf", transparent=True, bbox_inches='tight', pad_inches=-0.05)
-
-    # matplotlib2tikz.save('test.tex')
-
-    cb = fig.colorbar(axtri, orientation="horizontal")
-
-    levels = np.linspace(min(sigma_zz), max(sigma_zz), 16)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tripcolor(x, y, tri, sigma_zz, levels)
-    print("sigma_zz_unsmooth.pdf")
-    print(levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("sigma_zz_unsmooth.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    #cb = fig.colorbar(axtri, orientation="horizontal")
-
-    levels = np.linspace(min(sigma_vector_node), max(sigma_vector_node), 16)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tricontourf(x, y, tri, sigma_vector_node, levels)
-    print("sigma_zz_smooth.pdf")
-    print(levels)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("sigma_zz_smooth.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    #cb = fig.colorbar(axtri, orientation="horizontal")
-
-    F_zz_1 = compute_integrated_F(9, 8, 0.0529999991413206, 0.0440000002272427,
-                                  -0.0413666241463175, 0, 0, 1, reader)
-    F_zz_2 = compute_integrated_F(10, 8, 0.0529999991413206,
-                                  0.0440000002272427, -0.0413666241463175, 0,
-                                  0, 1, reader)
-    F_zz_3 = compute_integrated_F(11, 8, 0.0529999991413206,
-                                  0.0440000002272427, -0.0413666241463175, 0,
-                                  0, 1, reader)
-
-    print(F_zz_1)
-    print(F_zz_2)
-    print(F_zz_3)
-
-    # plt.show()
diff --git a/katoptron/Juelich/post_process/vtk_post_process_2.py b/katoptron/Juelich/post_process/vtk_post_process_2.py
deleted file mode 100644
index 0a77c7d364ff5cf19de097d32b977ffe231703bb..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/post_process/vtk_post_process_2.py
+++ /dev/null
@@ -1,961 +0,0 @@
-import vtk
-import numpy as np
-from numpy import zeros
-import matplotlib.pyplot as plt
-#from mpl_toolkits.mplot3d import Axes3D
-#import matplotlib2tikz
-from numpy import linalg as LA
-import matplotlib.tri as mtri
-import katoptron.utilities as u
-
-
-def SaveFigureAsImage(fileName, fig=None, **kwargs):
-    ''' Save a Matplotlib figure as an image without borders or frames.
-       Args:
-            fileName (str): String that ends in .png etc.
-
-            fig (Matplotlib figure instance): figure you want to save as the image
-        Keyword Args:
-            orig_size (tuple): width, height of the original image used to maintain 
-            aspect ratio.
-    '''
-    fig_size = fig.get_size_inches()
-    w, h = fig_size[0], fig_size[1]
-    fig.patch.set_alpha(0)
-    if 'orig_size' in kwargs:  # Aspect ratio scaling if required
-        w, h = kwargs['orig_size']
-        w2, h2 = fig_size[0], fig_size[1]
-        fig.set_size_inches([((w2 / w)) * w, ((w2 / w)) * h])
-        fig.set_dpi(((w2 / w)) * fig.get_dpi())
-    a = fig.gca()
-    a.set_frame_on(False)
-    a.set_xticks([])
-    a.set_yticks([])
-    plt.axis('off')
-    plt.xlim(0, h)
-    plt.ylim(w, 0)
-    fig.savefig(fileName, transparent=True, bbox_inches='tight',
-                pad_inches=0)
-
-
-def compute_integrated_F(volume_id, component_id, cut_origin_x, cut_origin_y,
-                         cut_origin_z, cut_normal_x, cut_normal_y,
-                         cut_normal_z, reader):
-
-    thresh = vtk.vtkThreshold()
-    thresh.ThresholdBetween(volume_id - 0.5, volume_id + 0.5)
-    thresh.SetInputConnection(reader.GetOutputPort())
-    thresh.SetInputArrayToProcess(0, 0, 0,
-                                  vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS,
-                                  "volume_id")
-    thresh.Update()
-
-    plane = vtk.vtkPlane()
-    plane.SetOrigin(cut_origin_x, cut_origin_y, cut_origin_z)
-    plane.SetNormal(cut_normal_x, cut_normal_y, cut_normal_z)
-
-    cutter = vtk.vtkFiltersCorePython.vtkCutter()
-    cutter.SetCutFunction(plane)
-    cutter.SetInputConnection(thresh.GetOutputPort())
-    cutter.Update()
-
-    data = cutter.GetOutput()
-
-    triangles = data.GetPolys().GetData()
-    points = data.GetPoints()
-
-    stress = data.GetCellData().GetArray('sigma')
-
-    ntri = (triangles.GetNumberOfTuples() // 4)
-    npts = points.GetNumberOfPoints()
-    nstress = stress.GetNumberOfTuples()
-
-    tri = zeros((ntri, 3), dtype=int)
-    x = zeros(npts)
-    y = zeros(npts)
-    z = zeros(npts)
-
-    sigma_vector = zeros(nstress)
-
-    sigma_vector_node = zeros(npts)
-    area_node = zeros(npts)
-
-    for i in range(0, ntri):
-        tri[i, 0] = triangles.GetTuple(4 * i + 1)[0]
-        tri[i, 1] = triangles.GetTuple(4 * i + 2)[0]
-        tri[i, 2] = triangles.GetTuple(4 * i + 3)[0]
-
-    for i in range(npts):
-        pt = points.GetPoint(i)
-        x[i] = pt[0]
-        y[i] = pt[1]
-        z[i] = pt[2]
-
-    for i in range(0, nstress):
-        sigma = stress.GetTuple(i)
-        sigma_vector[i] = sigma[component_id]
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    #plt.triplot(x, y, tri)
-    axtri = plt.tripcolor(x, y, tri, sigma_vector)
-    #plt.scatter(x, y)
-    plt.gca().set_aspect('equal')
-    cb = fig.colorbar(axtri, orientation="horizontal")
-
-    F = 0.
-
-    for i in range(0, ntri):
-        cross = np.cross(
-            np.array([
-                x[tri[i, 1]] - x[tri[i, 0]], y[tri[i, 1]] - y[tri[i, 0]],
-                z[tri[i, 1]] - z[tri[i, 0]]
-            ]),
-            np.array([
-                x[tri[i, 2]] - x[tri[i, 0]], y[tri[i, 2]] - y[tri[i, 0]],
-                z[tri[i, 2]] - z[tri[i, 0]]
-            ]))
-        area = (LA.norm(cross) / 2)
-        F = F + area * sigma_vector[i]
-        for j in range(0, 3):
-            sigma_vector_node[tri[i, j]] = sigma_vector_node[
-                tri[i, j]] + area * sigma_vector[i]
-            area_node[tri[i, j]] = area_node[tri[i, j]] + area
-
-    for i in range(npts):
-        sigma_vector_node[i] = (sigma_vector_node[i] / area_node[i])
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    #plt.triplot(x, y, tri)
-    axtri = plt.tricontourf(x, y, tri, sigma_vector_node)
-    #plt.scatter(x, y)
-    plt.gca().set_aspect('equal')
-    cb = fig.colorbar(axtri, orientation="horizontal")
-
-    return F
-
-
-def post_process(
-        filename='MIRROR_1_ASSEMBLY_fused_2_ast1_s0_0.vtu',
-        filename_ref='MIRROR_1_ASSEMBLY_fused_2_ast1_s0_0.vtu',
-        remove_ref=False,
-        scale_u=1.,
-        scale_T=1.,
-        T_0=22.,
-        p_cut=np.array(
-            [-0.0156128890812397, 0.020816631615161896,
-             0.0006999988108873367]),
-        n_cut=np.array([1, 0, 0]),
-        T_range=np.array([0., 0.]),
-        dz_range=np.array([0., 0.]),
-):
-    if remove_ref:
-        if filename_ref[-4:] == ".vtu":
-            reader = vtk.vtkXMLUnstructuredGridReader()
-        elif filename_ref[-5:] == ".pvtu":
-            reader = vtk.vtkXMLPUnstructuredGridReader()
-
-        reader.SetFileName(filename_ref)
-        reader.Update()
-
-        plane = vtk.vtkPlane()
-        plane.SetOrigin(p_cut[0], p_cut[1], p_cut[2])
-        plane.SetNormal(n_cut[0], n_cut[1], n_cut[2])
-
-        theta = np.arctan(n_cut[1] * 1. / n_cut[0])
-
-        cutter = vtk.vtkFiltersCorePython.vtkCutter()
-        cutter.SetCutFunction(plane)
-        cutter.SetInputConnection(reader.GetOutputPort())
-        cutter.Update()
-
-        data = cutter.GetOutput()
-
-        triangles = data.GetPolys().GetData()
-        points = data.GetPoints()
-
-        mapper = vtk.vtkCellDataToPointData()
-        mapper.AddInputData(data)
-        mapper.Update()
-
-        u = mapper.GetOutput().GetPointData().GetArray('displacement')
-
-        ntri = (triangles.GetNumberOfTuples() // 4)
-        npts = points.GetNumberOfPoints()
-
-        dx_ref = zeros(npts)
-        dy_ref = zeros(npts)
-        dz_ref = zeros(npts)
-
-        for i in range(0, npts):
-            dx_ref[i] = scale_u * u.GetTuple(i)[0]
-            dy_ref[i] = scale_u * u.GetTuple(i)[1]
-            dz_ref[i] = scale_u * u.GetTuple(i)[2]
-
-    if filename[-4:] == ".vtu":
-        reader = vtk.vtkXMLUnstructuredGridReader()
-    elif filename[-5:] == ".pvtu":
-        reader = vtk.vtkXMLPUnstructuredGridReader()
-
-    reader.SetFileName(filename)
-    reader.Update()
-
-    #data1 = reader.GetOutput()
-    '''
-    thresh = vtk.vtkThreshold()
-    thresh.ThresholdBetween(8.5,11.5)
-    thresh.SetInputConnection(reader.GetOutputPort())
-    thresh.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, "volume_id")
-    thresh.Update()
-    '''
-    plane = vtk.vtkPlane()
-    plane.SetOrigin(p_cut[0], p_cut[1], p_cut[2])
-    plane.SetNormal(n_cut[0], n_cut[1], n_cut[2])
-
-    theta = np.arctan(n_cut[1] * 1. / n_cut[0])
-
-    cutter = vtk.vtkFiltersCorePython.vtkCutter()
-    cutter.SetCutFunction(plane)
-    cutter.SetInputConnection(reader.GetOutputPort())
-    cutter.Update()
-
-    data = cutter.GetOutput()
-
-    triangles = data.GetPolys().GetData()
-    points = data.GetPoints()
-
-    mapper = vtk.vtkCellDataToPointData()
-    mapper.AddInputData(data)
-    mapper.Update()
-
-    T = mapper.GetOutput().GetPointData().GetArray('T')
-    u = mapper.GetOutput().GetPointData().GetArray('displacement')
-    stress_VM_pt = mapper.GetOutput().GetPointData().GetArray('von Mises')
-
-    stress = data.GetCellData().GetArray('sigma')
-    stress_VM = data.GetCellData().GetArray('von Mises')
-    volume_id = data.GetCellData().GetArray('volume_id')
-
-    ntri = (triangles.GetNumberOfTuples() // 4)
-    npts = points.GetNumberOfPoints()
-    nvls = points.GetNumberOfPoints()  # T.GetNumberOfTuples()
-
-    nstress = stress.GetNumberOfTuples()
-
-    tri = zeros((ntri, 3), dtype=int)
-    x = zeros(npts)
-    y = zeros(npts)
-    z = zeros(npts)
-    dx = zeros(npts)
-    dy = zeros(npts)
-    dz = zeros(npts)
-    T_vec = zeros(nvls)
-
-    sigma_vector_node = zeros(npts)
-    sigma_vector_node_filtered = zeros(npts)
-    area_node = zeros(npts)
-
-    sigma_zz = zeros(nstress)
-    sigma_zz_filtered = zeros(nstress)
-    volume_id_vec = zeros(nstress)
-    volume_id_vec_2 = zeros(nstress)
-
-    level_zz = np.linspace(-1e8, 1e8, 16)
-
-    for i in range(0, ntri):
-        tri[i, 0] = triangles.GetTuple(4 * i + 1)[0]
-        tri[i, 1] = triangles.GetTuple(4 * i + 2)[0]
-        tri[i, 2] = triangles.GetTuple(4 * i + 3)[0]
-
-    for i in range(npts):
-        pt = points.GetPoint(i)
-        x[i] = scale_u * pt[0]
-        y[i] = scale_u * pt[1]
-        z[i] = scale_u * pt[2]
-
-    for i in range(0, nvls):
-        T_tmp = T.GetTuple(i)
-        T_vec[i] = scale_T * T_tmp[0] + T_0
-
-        dx[i] = scale_u * u.GetTuple(i)[0]
-        dy[i] = scale_u * u.GetTuple(i)[1]
-        dz[i] = scale_u * u.GetTuple(i)[2]
-
-        sigma_vector_node_filtered[i] = scale_u**2 * stress_VM_pt.GetTuple(
-            i)[0]
-
-    if remove_ref:
-        dx -= dx_ref
-        dy -= dy_ref
-        dz -= dz_ref
-
-    print('T')
-    print(np.amin(T_vec))
-    print(np.amax(T_vec))
-
-    print('u')
-    print(np.amin(dx))
-    print(np.amax(dx))
-    print(np.amin(dy))
-    print(np.amax(dy))
-    print(np.amin(dz))
-    print(np.amax(dz))
-
-    for i in range(0, nstress):
-        sigma = stress.GetTuple(i)
-        sigma_zz[i] = scale_u**2 * sigma[8]
-
-        volume_id_vec[i] = volume_id.GetTuple(i)[0]
-
-        if sigma_zz[i] <= level_zz[0]:
-            sigma_zz_filtered[i] = level_zz[0]
-        elif sigma_zz[i] >= level_zz[15]:
-            sigma_zz_filtered[i] = level_zz[15]
-        else:
-            sigma_zz_filtered[i] = sigma_zz[i]
-
-    volume_id_vec_tmp = volume_id_vec
-
-    volume_id_vec_tmp[np.where(volume_id_vec == 4)] = 3
-    volume_id_vec_tmp[np.where(volume_id_vec == 5)] = 3
-
-    volume_id_vec_tmp[np.where(volume_id_vec == 7)] = 6
-    volume_id_vec_tmp[np.where(volume_id_vec == 8)] = 6
-
-    volume_id_vec_tmp[np.where(volume_id_vec == 10)] = 9
-    volume_id_vec_tmp[np.where(volume_id_vec == 11)] = 9
-
-    volume_id_vec_tmp[np.where(volume_id_vec == 13)] = 12
-    volume_id_vec_tmp[np.where(volume_id_vec == 14)] = 12
-
-    volume_id_vec_tmp[np.where(volume_id_vec == 16)] = 15
-    volume_id_vec_tmp[np.where(volume_id_vec == 17)] = 15
-
-    volume_id_vec_tmp[np.where(volume_id_vec >= 19)] = 19
-    #volume_id_vec_tmp[np.where( volume_id_vec ==17 )] = 15
-
-    indices_volume_id = np.argsort(volume_id_vec_tmp)
-
-    current_i = 0
-    volume_id_vec_2[indices_volume_id[0]] = current_i
-    for i in range(1, len(volume_id_vec)):
-        if volume_id_vec_tmp[indices_volume_id[i - 1]] != volume_id_vec_tmp[
-                indices_volume_id[i]]:
-            current_i = current_i + 1
-        volume_id_vec_2[indices_volume_id[i]] = current_i
-
-    for i in range(0, ntri):
-        cross = np.cross(
-            np.array([
-                x[tri[i, 1]] - x[tri[i, 0]], y[tri[i, 1]] - y[tri[i, 0]],
-                z[tri[i, 1]] - z[tri[i, 0]]
-            ]),
-            np.array([
-                x[tri[i, 2]] - x[tri[i, 0]], y[tri[i, 2]] - y[tri[i, 0]],
-                z[tri[i, 2]] - z[tri[i, 0]]
-            ]))
-        area = (LA.norm(cross) / 2)
-        for j in range(0, 3):
-            sigma_vector_node[
-                tri[i, j]] = sigma_vector_node[tri[i, j]] + area * sigma_zz[i]
-            area_node[tri[i, j]] = area_node[tri[i, j]] + area
-
-    for i in range(npts):
-        sigma_vector_node[i] = (sigma_vector_node[i] / area_node[i])
-        '''
-        if sigma_vector_node[i] <= level_zz[0]:
-            sigma_vector_node_filtered[i] = level_zz[0]
-        elif sigma_vector_node[i] >= level_zz[15]:
-            sigma_vector_node_filtered[i] = level_zz[15]
-        else:
-            sigma_vector_node_filtered[i] = sigma_vector_node[i]
-        '''
-    #tmp = stress.GetTuple(0)
-
-    if T_range[0] == T_range[1]:
-        T_range[0] = min(T_vec)
-        T_range[1] = max(T_vec)
-    level = np.linspace(T_range[0], T_range[1], 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(np.cos(theta) * y - np.sin(theta) * x,
-                   -z,
-                   tri,
-                   T_vec,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(
-        np.cos(theta) * y - np.sin(theta) * x, -z, tri, T_vec, level)
-    f = open("T.txt", "w+")
-    print(str(level[0]) + ', ' + str(level[3]) + ', ' + str(
-        level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(
-            level[15]), file=f)
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("T.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    level = np.linspace(min(dx), max(dx), 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(np.cos(theta) * y - np.sin(theta) * x,
-                   -z,
-                   tri,
-                   dx,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(
-        np.cos(theta) * y - np.sin(theta) * x, -z, tri, dx, level)
-    f = open("dx.txt", "w+")
-    print(str(level[0]) + ', ' + str(level[3]) + ', ' + str(
-        level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(
-            level[15]), file=f)
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("dx.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    level = np.linspace(min(dy), max(dy), 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(np.cos(theta) * y - np.sin(theta) * x,
-                   -z,
-                   tri,
-                   dy,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(
-        np.cos(theta) * y - np.sin(theta) * x, -z, tri, dy, level)
-    f = open("dy.txt", "w+")
-    print(str(level[0]) + ', ' + str(level[3]) + ', ' + str(
-        level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(
-            level[15]), file=f)
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("dy.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    if dz_range[0] == dz_range[1]:
-        dz_range[0] = min(dz)
-        dz_range[1] = max(dz)
-    level = np.linspace(dz_range[0], dz_range[1], 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(np.cos(theta) * y - np.sin(theta) * x,
-                   -z,
-                   tri,
-                   dz,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(
-        np.cos(theta) * y - np.sin(theta) * x, -z, tri, dz, level)
-    f = open("dz.txt", "w+")
-    print(str(level[0]) + ', ' + str(level[3]) + ', ' + str(
-        level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(
-            level[15]), file=f)
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("dz.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-    plt.close()
-    '''
-    #plt.minorticks_on()
-    #plt.gca().set_xticklabels([])
-    #plt.gca().set_yticklabels([])
-    #plt.gca().set_axis_off()
-    #plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
-    #plt.margins(0,0)
-    #plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    #plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    #plt.axis('off')
-    #plt.tricontour(x, y, tri, T_vec, 16)
-    #plt.show
-    #plt.savefig("T_vec.pdf", transparent=True, bbox_inches='tight', pad_inches=-0.05)
-
-    #matplotlib2tikz.save('test.tex')
-
-    cb = fig.colorbar(axtri, orientation="horizontal")
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tripcolor(np.cos(theta)*y-np.sin(theta)*x, -z, tri, volume_id_vec_2)
-    f = open("volume_id.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("volume_id.png",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=0.,
-                dpi=2000)
-    plt.savefig("volume_id.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    linewidth = 2
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tripcolor(np.cos(theta)*y-np.sin(theta)*x, -z, tri, volume_id_vec_2)
-    plt.plot([0.00606, 0.01513], [0.018, 0.018], 'g-', lw=linewidth)
-    plt.plot([0.03085, 0.03993], [0.018, 0.018], 'g-', lw=linewidth)
-    plt.plot([0.04805, 0.05714], [0.018, 0.018], 'g-', lw=linewidth)
-    plt.plot([0.07285, 0.08194], [0.018, 0.018], 'g-', lw=linewidth)
-
-    plt.plot([0.00301297, 0.0862297], [-2.60656e-05, -2.60656e-05],
-             'r-',
-             lw=linewidth)
-
-    plt.plot([0.01513, 0.01718, 0.01718], [0.018, 0.018, 0.007833],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.02881, 0.02881, 0.03085], [0.007833, 0.018, 0.018],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.05714, 0.0591934, 0.0591934], [0.018, 0.018, 0.007833],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0708286, 0.0708286, 0.07285], [0.007833, 0.018, 0.018],
-             'r-',
-             lw=linewidth)
-
-    plt.plot([0.00768668, 0.00768668, 0.0136152],
-             [0.0299629, 0.028372, 0.028372],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.00768668, 0.0157517], [0.0314519, 0.0314519],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0139112, 0.0163621], [0.0283628, 0.0283628],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0139204, 0.0151413], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0153632, 0.0170188], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0118091, 0.0138181], [0.0519943, 0.0519943],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0383327, 0.0383327, 0.0323929],
-             [0.0299629, 0.028372, 0.028372],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0302762, 0.0383327], [0.0314519, 0.0314519],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0297374, 0.032108], [0.0283628, 0.0283628], 'g-', lw=linewidth)
-    plt.plot([0.0289832, 0.0306937], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0308688, 0.0321214], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0322022, 0.0342226], [0.0519943, 0.0519943],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0496977, 0.0496977, 0.0556013],
-             [0.0299629, 0.028372, 0.028372],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0496977, 0.0577345], [0.0314519, 0.0314519],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0559981, 0.0583794], [0.0283628, 0.0283628],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0559237, 0.0571888], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0573872, 0.0590244], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0538401, 0.0558245], [0.0519943, 0.0519943],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0803319, 0.0803319, 0.0743539],
-             [0.0299629, 0.028372, 0.028372],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0722703, 0.0803815], [0.0314519, 0.0314519],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.0717246, 0.0741058], [0.0283628, 0.0283628],
-             'g-',
-             lw=linewidth)
-    plt.plot([0.07103, 0.0726536], [0.0253754, 0.0253754], 'g-', lw=linewidth)
-    plt.plot([0.0728542, 0.0741013], [0.0253754, 0.0253754],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0742012, 0.0762138], [0.0519943, 0.0519943],
-             'g-',
-             lw=linewidth)
-
-    plt.plot([0.0171631, 0.0171631], [0.0474981, 0.0542711],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0288311, 0.0288311], [0.0474981, 0.0542711],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0591792, 0.0591792], [0.0474981, 0.0542711],
-             'r-',
-             lw=linewidth)
-    plt.plot([0.0708312, 0.0708312], [0.0474981, 0.0542711],
-             'r-',
-             lw=linewidth)
-
-    f = open("volume_id_with_contact.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("volume_id_with_contact.png",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=0.,
-                dpi=2000)
-    plt.savefig("volume_id_with_contact.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    #plt.show()
-
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tripcolor(np.cos(theta)*(y+ 100 * dy)-np.sin(theta)*(x+ 100 * dx), -z - 100 * dz, tri, volume_id_vec_2)    
-    f = open("volume_id_def.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("volume_id_def.png",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=0.,
-                dpi=2000)
-    plt.savefig("volume_id_def.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    level = np.linspace(-1e8, 1e8, 16)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tripcolor(np.cos(theta)*y-np.sin(theta)*x, -z, tri, sigma_zz, level)    
-    f = open("sigma_zz_unsmooth_2.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("sigma_zz_unsmooth_2.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    level = np.linspace(-1e8, 1e8, 16)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tripcolor(np.cos(theta)*y-np.sin(theta)*x, -z, tri, sigma_zz_filtered, level)    
-    f = open("sigma_zz_filtered.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("sigma_zz_filtered.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    #cb = fig.colorbar(axtri, orientation="horizontal")
-
-    level = np.linspace(-2e8, 2e8, 16)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tricontourf(np.cos(theta)*y-np.sin(theta)*x, -z, tri, sigma_vector_node, level)    
-    f = open("sigma_zz_smooth_2.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("sigma_zz_smooth_2.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    level = np.linspace(min(sigma_vector_node_filtered),
-                        max(sigma_vector_node_filtered), 16)
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    axtri = plt.tricontourf(np.cos(theta)*y-np.sin(theta)*x, -z, tri, sigma_vector_node_filtered, level)
-
-    f = open("sigma_vector_node_filtered.txt", "w+")
-    print >> f, str(level[0]) + ', ' + str(level[3]) + ', ' + str(level[6]) + ', ' + str(level[9]) + ', ' + str(level[12]) + ', ' + str(level[15])
-    f.close()
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("sigma_vector_node_filtered.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    #cb = fig.colorbar(axtri, orientation="horizontal")
-
-
-    #plt.show()
-    '''
-
-
-def post_process_mirror(filename='mirror_data.npz',
-                        filename_ref='mirror_data.npz',
-                        remove_ref=False,
-                        round_lim=True):
-    if remove_ref:
-        npzfile = np.load(filename_ref)
-        dz_ref = npzfile['dz'].flatten()
-
-    npzfile = np.load(filename)
-
-    x = npzfile['x']
-    y = npzfile['y']
-    z = npzfile['z']
-    T = npzfile['T'].flatten()
-    tri = npzfile['tri']
-    dz = npzfile['dz'].flatten()
-
-    if remove_ref:
-        dz -= dz_ref
-
-    tri2 = mtri.Triangulation(x, y, triangles=tri)
-
-    f = open("mirror_surface_levels.txt", "w+")
-
-    OAX, OAY = 0.0595, 0.017
-
-    optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz, "m", np.array([OAX, OAY]))
-    np.savez('mirror_optical_results',
-             optical_coefficients=optical_coefficients,
-             dz_residual=dz_residual)
-    np.savetxt('mirror_optical_results.out', optical_coefficients)
-    '''
-    level = np.linspace(min(dx), max(dx), 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(x,
-                   y,
-                   tri,
-                   dx,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, dx, level)    
-    print >> f, "dx"
-    print >> f, level * 1000
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("dx_m.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    level = np.linspace(min(dy), max(dy), 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(x,
-                   y,
-                   tri,
-                   dy,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(x, y, tri, dy, level)
-    print >> f, "dy"
-    print >> f, level * 1000
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("dy_m.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-    '''
-    if round_lim:
-        min_T = min(T)
-        max_T = max(T)
-    else:
-        min_T = min(T)
-        max_T = max(T)
-    level = np.linspace(min_T, max_T, 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(tri2,
-                   T,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(tri2, T, level)
-    print("T", file=f)
-    print(level, file=f)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("T.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    round_dz = 0.000005
-    if round_lim:
-        min_dz = np.floor((min(dz) / round_dz)) * round_dz
-        max_dz = np.ceil((max(dz) / round_dz)) * round_dz
-    else:
-        min_dz = min(dz)
-        max_dz = max(dz)
-
-    level = np.linspace(min_dz, max_dz, 17)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(tri2,
-                   dz,
-                   level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(tri2, dz, level)
-    print("dz", file=f)
-    print(level * 1000, file=f)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    plt.savefig("dz_m.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=-0.05)
-
-    dz = 1000. * dz
-    #level = np.linspace(1000*min_dz, 1000*max_dz, 16)
-    # Velocity x-component
-    fig = plt.figure(figsize=(8, 8))
-    plt.set_cmap('coolwarm')
-    plt.tricontour(tri2,
-                   dz,
-                   1000. * level,
-                   linestyles='-',
-                   colors='black',
-                   linewidths=0.5)
-    axtri = plt.tricontourf(tri2, dz, 1000. * level)
-    print("dz", file=f)
-    print(level * 1000, file=f)
-    plt.gca().set_aspect('equal')
-    plt.gca().set_axis_off()
-    plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
-    plt.margins(0, 0)
-    plt.gca().xaxis.set_major_locator(plt.NullLocator())
-    plt.gca().yaxis.set_major_locator(plt.NullLocator())
-    cb = fig.colorbar(axtri, orientation="horizontal")
-    cb.set_label('Normal displacement [mm]', rotation=0)
-    plt.savefig("dz_m_2.pdf",
-                transparent=True,
-                bbox_inches='tight',
-                pad_inches=0.05)
-    f.close()
diff --git a/katoptron/Juelich/samples_files/Xiao_1.npz b/katoptron/Juelich/samples_files/Xiao_1.npz
deleted file mode 100644
index 7b03e3d7fc50ec5955a2e13fc9936bac99945492..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_1.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_10.npz b/katoptron/Juelich/samples_files/Xiao_10.npz
deleted file mode 100644
index 8f8dbe9b26245343bddee73a2d3650a677336337..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_10.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_11.npz b/katoptron/Juelich/samples_files/Xiao_11.npz
deleted file mode 100644
index 917ecdec9eb627f14875285285a7a5f14c202a28..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_11.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_12.npz b/katoptron/Juelich/samples_files/Xiao_12.npz
deleted file mode 100644
index 2ba898b0938e915cc3f3aa3488b233fc8099776c..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_12.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_13.npz b/katoptron/Juelich/samples_files/Xiao_13.npz
deleted file mode 100644
index a6df523a8a0cbde295076a661e3f23612888368b..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_13.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_14.npz b/katoptron/Juelich/samples_files/Xiao_14.npz
deleted file mode 100644
index 66e523668233914181e04d2add4bfb80d30a1548..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_14.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_15.npz b/katoptron/Juelich/samples_files/Xiao_15.npz
deleted file mode 100644
index 34b569ca9f9493bc33f044becfde2b93142ad342..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_15.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_16.npz b/katoptron/Juelich/samples_files/Xiao_16.npz
deleted file mode 100644
index 938f63549dbea270f5ab541256661b920f975f36..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_16.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_17.npz b/katoptron/Juelich/samples_files/Xiao_17.npz
deleted file mode 100644
index 4baa4cb0c56a5a441030c460ab19c70739bad042..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_17.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_18.npz b/katoptron/Juelich/samples_files/Xiao_18.npz
deleted file mode 100644
index 6c432ffb115272d435a9601fa6b91188f3880501..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_18.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_19.npz b/katoptron/Juelich/samples_files/Xiao_19.npz
deleted file mode 100644
index 3b65de7dec83b286a38c982e2a6a6df514a3e9e0..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_19.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_2.npz b/katoptron/Juelich/samples_files/Xiao_2.npz
deleted file mode 100644
index 71a2c4e6810a2df289a299ad7de8b83a334fa2d8..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_2.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_20.npz b/katoptron/Juelich/samples_files/Xiao_20.npz
deleted file mode 100644
index 2924847b69b9688d103fc30e54614c80599c0121..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_20.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_21.npz b/katoptron/Juelich/samples_files/Xiao_21.npz
deleted file mode 100644
index 0238893367ebd5c935e2b2dbbab1b0ddb1262813..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_21.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_22.npz b/katoptron/Juelich/samples_files/Xiao_22.npz
deleted file mode 100644
index 16cc46634ba04629f0ebe6b3e1c720612b222df0..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_22.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_23.npz b/katoptron/Juelich/samples_files/Xiao_23.npz
deleted file mode 100644
index 249b9cd470086282aa46000226f1baf584d456d7..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_23.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_24.npz b/katoptron/Juelich/samples_files/Xiao_24.npz
deleted file mode 100644
index 79c69ba38d476c8594ec72d1424eb2a4283de651..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_24.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_25.npz b/katoptron/Juelich/samples_files/Xiao_25.npz
deleted file mode 100644
index de6c0a9bf8011de5ccc85148617a0428497f3b96..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_25.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_26.npz b/katoptron/Juelich/samples_files/Xiao_26.npz
deleted file mode 100644
index 457c26c08fb5030d726dac36cf60729f9396fcb5..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_26.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_27.npz b/katoptron/Juelich/samples_files/Xiao_27.npz
deleted file mode 100644
index ac3720888e33467c4e33b3148fb85b240f66b1a5..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_27.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_28.npz b/katoptron/Juelich/samples_files/Xiao_28.npz
deleted file mode 100644
index 8cd28ff90d183b6b49734472866018d1d80225ec..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_28.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_29.npz b/katoptron/Juelich/samples_files/Xiao_29.npz
deleted file mode 100644
index 05886390d5c8c3f0919d66847a30efe9a5030bd7..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_29.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_3.npz b/katoptron/Juelich/samples_files/Xiao_3.npz
deleted file mode 100644
index 63c39112096774687963de5731858ea2d26e230d..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_3.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_30.npz b/katoptron/Juelich/samples_files/Xiao_30.npz
deleted file mode 100644
index 22f997509d24910547f8adc3d2ddd3c51168035c..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_30.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_31.npz b/katoptron/Juelich/samples_files/Xiao_31.npz
deleted file mode 100644
index 3bdc6c63e013b0e30cfc8c8ad3c7d1c86d0959ec..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_31.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_32.npz b/katoptron/Juelich/samples_files/Xiao_32.npz
deleted file mode 100644
index 2c97d1fa8065ac520a899b96feaaead81a4e12ca..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_32.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_33.npz b/katoptron/Juelich/samples_files/Xiao_33.npz
deleted file mode 100644
index 942988c3efefab15b3694e248d9bfda092369197..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_33.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_34.npz b/katoptron/Juelich/samples_files/Xiao_34.npz
deleted file mode 100644
index 8955d9aa2ab42b31f257eeacc025c6bea6d17ef7..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_34.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_35.npz b/katoptron/Juelich/samples_files/Xiao_35.npz
deleted file mode 100644
index 341b57eb9cf65f0d53296c644ba4811f54973f41..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_35.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_36.npz b/katoptron/Juelich/samples_files/Xiao_36.npz
deleted file mode 100644
index 43609406a691e9b4591fec857697164dd4873cab..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_36.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_37.npz b/katoptron/Juelich/samples_files/Xiao_37.npz
deleted file mode 100644
index 39e862f48bf5507ca1fdace4238139e9afe618bb..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_37.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_38.npz b/katoptron/Juelich/samples_files/Xiao_38.npz
deleted file mode 100644
index 4646a35d35db324ee59c85a24ef578e5f9c4a85c..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_38.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_39.npz b/katoptron/Juelich/samples_files/Xiao_39.npz
deleted file mode 100644
index 2a0a4bda52b1d0a0ef0e45705181e21cc5ac6376..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_39.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_4.npz b/katoptron/Juelich/samples_files/Xiao_4.npz
deleted file mode 100644
index 63c39112096774687963de5731858ea2d26e230d..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_4.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_40.npz b/katoptron/Juelich/samples_files/Xiao_40.npz
deleted file mode 100644
index a6932e59351b9f03244de8ba0d72ebc48e2276b4..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_40.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_41.npz b/katoptron/Juelich/samples_files/Xiao_41.npz
deleted file mode 100644
index d2e9637a91ca865122e162d4abf50efeb67f09c6..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_41.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_42.npz b/katoptron/Juelich/samples_files/Xiao_42.npz
deleted file mode 100644
index 7964cc28089a4fbad5ee731886f5af0386b85cbc..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_42.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_43.npz b/katoptron/Juelich/samples_files/Xiao_43.npz
deleted file mode 100644
index 8429ceb24d4090cbee0145043b46dd7abcb7bf64..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_43.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_44.npz b/katoptron/Juelich/samples_files/Xiao_44.npz
deleted file mode 100644
index 6e078a8acf2ceeb2ecdf2d53efcc08a80f06fefd..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_44.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_45.npz b/katoptron/Juelich/samples_files/Xiao_45.npz
deleted file mode 100644
index f00ed1da3c4f3ab343b2b2bd31fa1c03ce330bc1..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_45.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_46.npz b/katoptron/Juelich/samples_files/Xiao_46.npz
deleted file mode 100644
index f9b42f0abf0fb038536695e9d7e7245ee5e12dee..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_46.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_47.npz b/katoptron/Juelich/samples_files/Xiao_47.npz
deleted file mode 100644
index 033ecdd992e4aa2e9d3ddcce73cc47e83cdaae74..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_47.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_48.npz b/katoptron/Juelich/samples_files/Xiao_48.npz
deleted file mode 100644
index 3e193d9e087bd7c7719995d8c2d2fd484321cba1..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_48.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_49.npz b/katoptron/Juelich/samples_files/Xiao_49.npz
deleted file mode 100644
index 0918916be6ac617f97c4e44b4bca1e49cf754a2f..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_49.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_5.npz b/katoptron/Juelich/samples_files/Xiao_5.npz
deleted file mode 100644
index eed3e60620c924c1e5958248531446c026112b0a..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_5.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_50.npz b/katoptron/Juelich/samples_files/Xiao_50.npz
deleted file mode 100644
index f35763aa71725038ca9e6d42f970f7a5b9ac173d..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_50.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_6.npz b/katoptron/Juelich/samples_files/Xiao_6.npz
deleted file mode 100644
index 417801c9203949b37de027fa7be0afd3d2f20b43..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_6.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_7.npz b/katoptron/Juelich/samples_files/Xiao_7.npz
deleted file mode 100644
index 9b1946fea901b32ada4d1794ca36a0e5003c89ad..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_7.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_8.npz b/katoptron/Juelich/samples_files/Xiao_8.npz
deleted file mode 100644
index 6f4c1c3ae433bf11eaa6563bde78415e29229831..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_8.npz and /dev/null differ
diff --git a/katoptron/Juelich/samples_files/Xiao_9.npz b/katoptron/Juelich/samples_files/Xiao_9.npz
deleted file mode 100644
index 959ddd04c781034755bd4a1fbc88d29835429067..0000000000000000000000000000000000000000
Binary files a/katoptron/Juelich/samples_files/Xiao_9.npz and /dev/null differ
diff --git a/katoptron/Juelich/slurm/blake.slurm.sh b/katoptron/Juelich/slurm/blake.slurm.sh
deleted file mode 100644
index e5e54cafc63c60efdd48fba44cfdb4f0a3b66fe9..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/slurm/blake.slurm.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=Mirror_AB
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/Mirror_AB.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export n_nodes=1
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,1t
-export KMP_AFFINITY=compact
-
-export ensemble_size=1
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-export N_MPI_PER_SOCKET=1
-
-n_MPI=$(( 2*n_nodes ))
-base_dir=$(pwd)
-msh_file=${base_dir}/katoptron/Juelich/mesh/fused_mirror_assembly_mm.msh
-workspace_dir=${base_dir}/workspace/katoptron_Juelich_tests_M1_assembly_fused
-msh_part_file=${workspace_dir}/fused_mirror_assembly_mm_part_${n_MPI}.msh
-
-if [ ! -d ${workspace_dir} ] 
-then
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -e ${msh_part_file} ]
-then
-    gmsh -3 ${msh_file} -o ${msh_part_file} -part ${n_MPI}
-fi
-
-mpirun -npersocket ${N_MPI_PER_SOCKET} python run.py -k ${OMP_NUM_THREADS} katoptron/Juelich/tests/M1_assembly_fused.py
diff --git a/katoptron/Juelich/slurm/blake_ER_NER.slurm.sh b/katoptron/Juelich/slurm/blake_ER_NER.slurm.sh
deleted file mode 100644
index 6ac1bc52d9bf7d04a67c643ac9c4f945f15f19c7..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/slurm/blake_ER_NER.slurm.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=Mirror
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/Mirror.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export n_nodes=1
-
-function setEnsembleReduction(){
-  remove2env INCLUDE "${Trilinos_DIR}/include"
-  remove2env LIB "${Trilinos_DIR}/lib"
-  remove2env PYTHONPATH "${Trilinos_DIR}/lib/python2.7/site-packages"
-  remove2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages/PyTrilinos"
-  remove2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages"
-  remove2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib"
-  if [ “$1” == “false” ]; then
-    export Trilinos_DIR=$Trilinos_DIR_NO_ER
-    export Waves_DIR=$Waves_DIR_NO_ER
-    export ensemble_reduction="false"
-  else
-    export Trilinos_DIR=$Trilinos_DIR_ER
-    export Waves_DIR=$Waves_DIR_ER
-    export ensemble_reduction="true"
-  fi
-  add2env INCLUDE "${Trilinos_DIR}/include" end
-  add2env LIB "${Trilinos_DIR}/lib" end
-  add2env PYTHONPATH "${Trilinos_DIR}/lib/python2.7/site-packages" front
-  add2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages/PyTrilinos" end
-  add2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib/python2.7/site-packages" end
-  add2env LD_LIBRARY_PATH "${Trilinos_DIR}/lib" end
-  cd $Waves_DIR
-}
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-export N_MPI_PER_SOCKET=1
-
-ensemble_sizes=( 1 8 16 32)
-run_NER=true
-run_ER=true
-
-setEnsembleReduction false
-
-n_MPI=$(( 2*n_nodes ))
-base_dir=$(pwd)
-msh_file=${base_dir}/katoptron/Juelich/mesh/fused_mirror_assembly_mm.msh
-workspace_NER_dir=${base_dir}/workspace/katoptron_Juelich_tests_M1_assembly_fused_MC_k
-msh_part_NER_file=${workspace_NER_dir}/fused_mirror_assembly_mm_part_${n_MPI}.msh
-
-if [ ! -d ${workspace_NER_dir} ] 
-then
-    mkdir ${workspace_NER_dir}
-fi
-
-if [ ! -e ${msh_part_NER_file} ]
-then
-    gmsh -3 ${msh_file} -o ${msh_part_NER_file} -part ${n_MPI}
-fi
-
-if [ "$run_NER" = true ]; then
-  for s in "${ensemble_sizes[@]}"
-  do
-    export ensemble_size=$s
-    mpirun -npersocket ${N_MPI_PER_SOCKET} python run.py -k ${OMP_NUM_THREADS} katoptron/Juelich/tests/M1_assembly_fused_MC_k.py
-  done
-fi
-
-ensemble_sizes=( 8 16 32)
-
-setEnsembleReduction true
-
-base_dir=$(pwd)
-workspace_ER_dir=${base_dir}/workspace/katoptron_Juelich_tests_M1_assembly_fused_MC_k
-msh_part_ER_file=${workspace_ER_dir}/fused_mirror_assembly_mm_part_${n_MPI}.msh
-
-if [ ! -d ${workspace_ER_dir} ] 
-then
-    mkdir ${workspace_ER_dir}
-fi
-
-cp ${msh_part_NER_file} ${msh_part_ER_file}
-
-if [ "$run_ER" = true ]; then
-  for s in "${ensemble_sizes[@]}"
-  do
-    export ensemble_size=$s
-    mpirun -npersocket ${N_MPI_PER_SOCKET} python run.py -k ${OMP_NUM_THREADS} katoptron/Juelich/tests/M1_assembly_fused_MC_k.py
-  done
-fi
\ No newline at end of file
diff --git a/katoptron/Juelich/slurm/blake_all.slurm.sh b/katoptron/Juelich/slurm/blake_all.slurm.sh
deleted file mode 100644
index fa0a52a96104574b6462ed58f0050aca08bc55a0..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/slurm/blake_all.slurm.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=Mirror_all
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 2
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/Mirror_all.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export n_nodes=2
-
-ensemble_sizes=( 1 8 16 32)
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-export N_MPI_PER_SOCKET=1
-
-n_MPI=$(( 2*n_nodes ))
-base_dir=$(pwd)
-msh_file=${base_dir}/katoptron/Juelich/mesh/fused_mirror_assembly_all_mm.msh
-workspace_dir=${base_dir}/workspace/katoptron_Juelich_tests_M1_assembly_fused_all
-msh_part_file=${workspace_dir}/fused_mirror_assembly_all_mm_part_${n_MPI}.msh
-
-if [ ! -d ${workspace_dir} ] 
-then
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -e ${msh_part_file} ]
-then
-    gmsh -3 ${msh_file} -o ${msh_part_file} -part ${n_MPI}
-fi
-
-for s in "${ensemble_sizes[@]}"
-do
-    export ensemble_size=$s
-    mpirun -npersocket ${N_MPI_PER_SOCKET} python run.py -k ${OMP_NUM_THREADS} katoptron/Juelich/tests/M1_assembly_fused_all.py
-done
diff --git a/katoptron/Juelich/slurm/blake_order.slurm.sh b/katoptron/Juelich/slurm/blake_order.slurm.sh
deleted file mode 100644
index fecd4d790865d42c36ca91adf20c2aed483d522d..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/slurm/blake_order.slurm.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=M_order
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/M_order.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export n_nodes=1
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,1t
-export KMP_AFFINITY=compact
-
-export ensemble_size=1
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-export N_MPI_PER_SOCKET=1
-
-n_MPI=$(( 2*n_nodes ))
-base_dir=$(pwd)
-msh_file=${base_dir}/katoptron/Juelich/mesh/fused_mirror_assembly_mm.msh
-workspace_dir=${base_dir}/workspace/katoptron_Juelich_tests_M1_assembly_fused_MC_k_order
-msh_part_file=${workspace_dir}/fused_mirror_assembly_mm_part_${n_MPI}.msh
-
-if [ ! -d ${workspace_dir} ] 
-then
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -e ${msh_part_file} ]
-then
-    gmsh -3 ${msh_file} -o ${msh_part_file} -part ${n_MPI}
-fi
-
-mpirun -npersocket ${N_MPI_PER_SOCKET} python run.py -k ${OMP_NUM_THREADS} katoptron/Juelich/tests/M1_assembly_fused_MC_k_order.py
diff --git a/katoptron/Juelich/slurm/blake_preload.slurm.sh b/katoptron/Juelich/slurm/blake_preload.slurm.sh
deleted file mode 100644
index e7952bb35ad8f6c0a4839a29615a46adbe3e7945..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/slurm/blake_preload.slurm.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=Mirror_AB
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/Mirror_AB.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export n_nodes=1
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_PLACE_THREADS=24c,1t
-export KMP_AFFINITY=compact
-
-export ensemble_size=1
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-export N_MPI_PER_SOCKET=1
-
-n_MPI=$(( 2*n_nodes ))
-base_dir=$(pwd)
-msh_file=${base_dir}/katoptron/Juelich/mesh/fused_mirror_assembly_mm.msh
-workspace_dir=${base_dir}/workspace/katoptron_Juelich_tests_M1_assembly_fused_preload
-msh_part_file=${workspace_dir}/fused_mirror_assembly_mm_part_${n_MPI}.msh
-
-if [ ! -d ${workspace_dir} ] 
-then
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -e ${msh_part_file} ]
-then
-    gmsh -3 ${msh_file} -o ${msh_part_file} -part ${n_MPI}
-fi
-
-mpirun -npersocket ${N_MPI_PER_SOCKET} python run.py -k ${OMP_NUM_THREADS} katoptron/Juelich/tests/M1_assembly_fused_preload.py
diff --git a/katoptron/Juelich/smoothers/AMG_BGS_gs_gs.xml b/katoptron/Juelich/smoothers/AMG_BGS_gs_gs.xml
deleted file mode 100644
index 4a44425b2ec2da05cd9fab0d5f6470bf0aaec900..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/AMG_BGS_gs_gs.xml
+++ /dev/null
@@ -1,226 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-    
-    <!-- sub block factories -->
-    <!-- BLOCK 1 -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myDropFact1">
-      <Parameter name="factory" type="string" value="CoalesceDropFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact2">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>    
-
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>    
-    </ParameterList>
-
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-
-    <!-- BLOCK 2 -->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/> <!-- use old aggregates! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>
-    </ParameterList>
-
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <!-- <Parameter name="Graph" type="string" value="myDropFact1"/> -->
-    </ParameterList>
-
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/><!-- reuse aggs -->
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-	      <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-	      <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-    </ParameterList>
-
-
-    <!-- BLOCK SMOOTHERS -->
-    
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>      
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="20"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.97"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>      
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="20"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1.04"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySCHWARZ1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type"  type="string" value="SCHWARZ"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="schwarz: overlap level"            type="int"    value="1"/>
-        <Parameter name="schwarz: combine mode"             type="string" value="Zero"/>
-        <Parameter name="subdomain solver name"             type="string" value="RELAXATION"/>
-        <ParameterList name="subdomain solver parameters">
-          <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-          <Parameter name="relaxation: sweeps" type="int"    value="1"/>
-          <Parameter name="relaxation: damping factor" type="double" value="0.79"/>
-        </ParameterList>
-      </ParameterList>
-    </ParameterList>    
-
-    <ParameterList name="mySCHWARZ2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type"  type="string" value="SCHWARZ"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="schwarz: overlap level"            type="int"    value="1"/>
-        <Parameter name="schwarz: combine mode"             type="string" value="Zero"/>
-        <Parameter name="subdomain solver name"             type="string" value="RELAXATION"/>
-        <ParameterList name="subdomain solver parameters">
-          <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-          <Parameter name="relaxation: sweeps" type="int"    value="1"/>
-          <Parameter name="relaxation: damping factor" type="double" value="0.79"/>
-        </ParameterList>
-      </ParameterList>
-    </ParameterList>        
-
-    <!-- Use Block GS: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="Backward mode" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="3"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
diff --git a/katoptron/Juelich/smoothers/AMG_BGS_gs_gs_old.xml b/katoptron/Juelich/smoothers/AMG_BGS_gs_gs_old.xml
deleted file mode 100644
index 170ffb5fd6ef95767e8282bb0f058489b19d7264..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/AMG_BGS_gs_gs_old.xml
+++ /dev/null
@@ -1,294 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-    
-    <!-- sub block factories -->
-    <!-- BLOCK 1 -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myDropFact1">
-      <Parameter name="factory" type="string" value="CoalesceDropFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact2">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>    
-
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>            
-    </ParameterList>
-
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-
-    <!-- BLOCK 2 -->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/> <!-- use old aggregates! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>            
-    </ParameterList>
-
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <!-- <Parameter name="Graph" type="string" value="myDropFact1"/> -->
-    </ParameterList>
-
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/><!-- reuse aggs -->
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-	      <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-	      <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-    </ParameterList>
-
-
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="10"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="10"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.8"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact3">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="BASKER"/>
-    </ParameterList>    
-
-    <ParameterList name="mySmooFact4">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="100"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>    
-
-    <ParameterList name="mySmooFact5">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="100"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>    
-
-    <!-- Use Block GS: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="Backward mode" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockSmootherDirect">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="Backward mode" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact4"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact5"/>
-      </ParameterList>
-    </ParameterList>    
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-    <!-- =======================  REPARTITIONING  ======================= -->
-    <!-- amalgamation of coarse level matrix -->
-    <ParameterList name="myRebAmalgFact">
-      <Parameter name="factory"                        type="string" value="AmalgamationFactory"/>
-      <Parameter name="A"                              type="string" value="myBlockedRAPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myRepartitionHeuristicFact">
-      <Parameter name="factory"                        type="string" value="RepartitionHeuristicFactory"/>
-      <Parameter name="A"                              type="string" value="myBlockedRAPFact"/>
-      <Parameter name="repartition: min rows per proc"      type="int"    value="2000"/>
-      <Parameter name="repartition: max imbalance"          type="double" value="1.1"/>
-      <Parameter name="repartition: start level"            type="int"    value="1"/>    
-    </ParameterList>
-    
-    <ParameterList name="myZoltanInterface">
-      <Parameter name="factory"                             type="string" value="ZoltanInterface"/>
-      <Parameter name="A"                                   type="string" value="myBlockedRAPFact"/>
-      <Parameter name="number of partitions"                type="string" value="myRepartitionHeuristicFact"/>
-      <!--<Parameter name="Coordinates"                         type="string" value="myTransferCoordinatesFact"/>-->
-    </ParameterList>
-
-    <ParameterList name="myRepartitionFact">
-      <Parameter name="factory"                             type="string" value="RepartitionFactory"/>
-      <Parameter name="A"                                   type="string" value="myBlockedRAPFact"/>
-      <Parameter name="number of partitions"                type="string" value="myRepartitionHeuristicFact"/>
-      <Parameter name="Partition"                           type="string" value="myZoltanInterface"/>
-      <Parameter name="repartition: remap parts"            type="bool"   value="false"/>
-    </ParameterList>
-
-    <ParameterList name="myRebalanceProlongatorFact">
-      <Parameter name="factory"                        type="string" value="RebalanceTransferFactory"/>
-      <Parameter name="type"                           type="string" value="Interpolation"/>
-      <Parameter name="P"                              type="string" value="myBlockedPFact"/>
-      <Parameter name="Nullspace"                      type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myRebalanceRestrictionFact">
-      <Parameter name="factory"                        type="string" value="RebalanceTransferFactory"/>
-      <Parameter name="type"                           type="string" value="Restriction"/>
-      <Parameter name="R"                              type="string" value="myBlockedRFact"/>
-    </ParameterList>
-
-    <ParameterList name="myRebalanceAFact">
-      <Parameter name="factory"                        type="string" value="RebalanceAcFactory"/>
-      <Parameter name="A"                              type="string" value="myBlockedRAPFact"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="4"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myRebalanceProlongatorFact"/>
-      <Parameter name="R"                 type="string"   value="myRebalanceRestrictionFact"/>
-      <Parameter name="A"                 type="string"   value="myRebalanceAFact"/>
-      <Parameter name="Importer"          type="string"   value="myRepartitionFact"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
diff --git a/katoptron/Juelich/smoothers/AMG_BGS_gs_gs_rep.xml b/katoptron/Juelich/smoothers/AMG_BGS_gs_gs_rep.xml
deleted file mode 100644
index ea2db74e767207b27551664a3f64356fff200af0..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/AMG_BGS_gs_gs_rep.xml
+++ /dev/null
@@ -1,380 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-    
-    <!-- sub block factories -->
-    <!-- BLOCK 1 -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myDropFact1">
-      <Parameter name="factory" type="string" value="CoalesceDropFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact2">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>    
-
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>            
-    </ParameterList>
-
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-
-    <!-- BLOCK 2 -->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/> <!-- use old aggregates! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>            
-    </ParameterList>
-
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <!-- <Parameter name="Graph" type="string" value="myDropFact1"/> -->
-    </ParameterList>
-
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact2"/><!-- reuse aggs -->
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-	      <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-	      <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <!-- we need the factories from the first group -->      
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>    
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>
-      </ParameterList>      
-    </ParameterList>
-
-
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="10"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="10"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.8"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact3">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="BASKER"/>
-    </ParameterList>    
-
-    <ParameterList name="mySmooFact4">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="100"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>    
-
-    <ParameterList name="mySmooFact5">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="100"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>    
-
-    <!-- Use Block GS: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="Backward mode" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockSmootherDirect">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="Backward mode" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact4"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact5"/>
-      </ParameterList>
-    </ParameterList>    
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-    <!-- =======================  REPARTITIONING  ======================= -->
-    <!-- amalgamation of coarse level matrix -->
-
-    <ParameterList name="myRepartitionHeuristicFactory">
-      <Parameter name="factory" type="string" value="RepartitionHeuristicFactory"/>
-      <Parameter name="A"                               type="string"  value="myBlockedRAPFact"/>
-      <Parameter name="repartition: start level"        type="int"     value="2"/>
-      <Parameter name="repartition: min rows per proc"  type="int"     value="256"/>
-      <Parameter name="repartition: nonzeroImbalance"   type="double"  value="1.2"/>
-    </ParameterList> 
-
-    <ParameterList name="myRebSubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="A"                         type="string"  value="myBlockedRAPFact"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-    </ParameterList>    
-
-    <ParameterList name="myRebSubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="A"                         type="string"  value="myBlockedRAPFact"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-    </ParameterList>    
-
-    <ParameterList name="myInputCoordsFact">
-      <Parameter name="factory" type="string" value="FineLevelInputDataFactory"/>      
-      <Parameter name="Variable" type="string" value="CoOrdinates"/>  
-      <Parameter name="Variable type" type="string" value="MultiVector"/>  
-      <Parameter name="Fine level factory" type="string" value="NoFactory"/>  
-      <!--<Parameter name="Coarse level factory" type="string" value="myTransferCoordinatesFact"/>-->
-      <!--<Parameter name="Coarse level factory" type="string" value="NoFactory"/> TO BE DEFINED LATER -->
-    </ParameterList>        
-
-    <ParameterList name="myZoltanInterface1">
-      <Parameter name="factory"                             type="string" value="ZoltanInterface"/>
-      <Parameter name="A"                                   type="string" value="myRebSubBlockAFactory1"/>
-      <Parameter name="number of partitions"                type="string" value="myRepartitionHeuristicFactory"/>      
-    </ParameterList>
-
-    <ParameterList name="myZoltanInterface2">
-      <Parameter name="factory"                             type="string" value="ZoltanInterface"/>
-      <Parameter name="A"                                   type="string" value="myRebSubBlockAFactory2"/>
-      <Parameter name="number of partitions"                type="string" value="myRepartitionHeuristicFactory"/>      
-    </ParameterList>    
-
-    <ParameterList name="myRepartitionFactory1">
-      <Parameter name="factory" type="string" value="RepartitionFactory"/>
-      <Parameter name="A"                         type="string"  value="myRebSubBlockAFactory1"/>
-      <Parameter name="Partition"                 type="string"  value="myZoltanInterface1"/>
-      <Parameter name="number of partitions"      type="string"  value="myRepartitionHeuristicFactory"/>
-      <Parameter name="repartition: print partition distribution" type="bool" value="true"/>
-      <Parameter name="repartition: remap parts" type="bool" value="true"/>
-    </ParameterList>    
-
-    <ParameterList name="myRepartitionFactory2">
-      <Parameter name="factory" type="string" value="RepartitionFactory"/>
-      <Parameter name="A"                         type="string"  value="myRebSubBlockAFactory2"/>
-      <Parameter name="Partition"                 type="string"  value="myZoltanInterface2"/>
-      <Parameter name="number of partitions"      type="string"  value="myRepartitionHeuristicFactory"/>
-      <Parameter name="repartition: print partition distribution" type="bool" value="true"/>
-      <Parameter name="repartition: remap parts" type="bool" value="false"/>
-    </ParameterList>        
-
-    <ParameterList name="myRebFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/> <!-- non-rebalanced A00! -->
-      <Parameter name="Importer" type="string" value="myRepartitionFactory1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="number of partitions"      type="string"  value="myRepartitionHeuristicFactory"/>
-      <Parameter name="Coordinates"                         type="string" value="myInputCoordsFact"/>
-    </ParameterList>    
-
-    <ParameterList name="myRebSecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/> <!-- non-rebalanced A11! -->
-      <Parameter name="Importer" type="string" value="myRepartitionFactory2"/>
-      <Parameter name="number of partitions"      type="string"  value="myRepartitionHeuristicFactory"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="Coordinates"                         type="string" value="myInputCoordsFact"/>
-    </ParameterList>  
-
-    <ParameterList name="myRebBlockedPFact">
-      <Parameter name="factory" type="string" value="RebalanceBlockInterpolationFactory"/>
-      <Parameter name="A" type="string" value="myBlockedRAPFact"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myRebFirstGroup"/>
-      </ParameterList>
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="myRebSecondGroup"/>
-      </ParameterList>      
-    </ParameterList>   
-
-    <ParameterList name="myInputCoordsFactDeps">
-      <Parameter name="dependency for" type="string" value="myInputCoordsFact"/>
-      <Parameter name="Coarse level factory" type="string" value="myTransferCoordinatesFact"/>
-    </ParameterList>
-
-    <ParameterList name="myRebBlockedRFact">
-      <Parameter name="factory" type="string" value="RebalanceBlockRestrictionFactory"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <Parameter name="repartition: use subcommunicators" type="bool" value="false"/>
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myRebFirstGroup"/>
-      </ParameterList>
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="myRebSecondGroup"/>
-      </ParameterList>            
-    </ParameterList>     
-    
-    <ParameterList name="myRebBlockedAcFact">
-      <Parameter name="factory" type="string" value="RebalanceBlockAcFactory"/>
-      <Parameter name="A" type="string" value="myBlockedRAPFact"/>
-      <Parameter name="repartition: use subcommunicators" type="bool" value="false"/>
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myRebFirstGroup"/>
-      </ParameterList>
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="myRebSecondGroup"/>
-      </ParameterList>            
-    </ParameterList> 
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="4"/>
-    <Parameter name="coarse: max size"    type="int"      value="2500"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myRebBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myRebBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myRebBlockedAcFact"/>    
-      <Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>  
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
diff --git a/katoptron/Juelich/smoothers/heat_no_contact.xml b/katoptron/Juelich/smoothers/heat_no_contact.xml
deleted file mode 100644
index 7b1148789fe445240df704f7855719b652c4057f..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/heat_no_contact.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="5"/>
-  <Parameter name="smoother: type" type="string" value="RELAXATION"/>
-  <ParameterList name="smoother: params">
-    <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-  </ParameterList>
-  <Parameter name="coarse: type" type="string" value="Klu"/>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-  <Parameter name="tentative: calculate qr" type="bool" value="false"/>
-  <Parameter name="number of equations"   type="int"  value="4"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/Juelich/smoothers/heat_no_contact_mtgs.xml b/katoptron/Juelich/smoothers/heat_no_contact_mtgs.xml
deleted file mode 100644
index 6685c2d51dcfa42250eb1cf31516ece3b9344236..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/heat_no_contact_mtgs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="5"/>
-  <Parameter name="smoother: type" type="string" value="RELAXATION"/>
-  <ParameterList name="smoother: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="15"/>
-    <Parameter name="relaxation: damping factor" type="double" value="1.1724"/>
-    <Parameter name="relaxation: backward mode" type="bool" value="true"/>
-  </ParameterList>
-  <Parameter name="coarse: type" type="string" value="Klu"/>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-  <Parameter name="tentative: calculate qr" type="bool" value="false"/>
-  <Parameter name="number of equations"   type="int"  value="4"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/Juelich/smoothers/mySIM1.xml b/katoptron/Juelich/smoothers/mySIM1.xml
deleted file mode 100644
index 1c217e5cb3b18c8da24062fc0b22c6c66a803705..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/mySIM1.xml
+++ /dev/null
@@ -1,190 +0,0 @@
-<ParameterList name="MueLu">
-
-  <!-- Configuration of the Xpetra operator (fine level) -->
-  <ParameterList name="Matrix">
-    <Parameter name="number of equations"                         type="int" value="1"/> <!-- Number of PDE equations at each grid node.-->
-  </ParameterList>
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-
-    <!-- sub block factories -->
-    <!-- BLOCK 1 -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myDropFact1">
-      <Parameter name="factory" type="string" value="CoalesceDropFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-
-    <!-- BLOCK 2 -->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use old aggregates! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="Graph" type="string" value="myDropFact1"/>
-    </ParameterList>
-
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/><!-- reuse aggs -->
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-	      <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-	      <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-    </ParameterList>
-
-    <!-- BLOCK SMOOTHERS -->
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="20"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="10"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.8"/>
-      </ParameterList>
-    </ParameterList>
-
-
-    <!-- Use Block GS: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="50"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"                            type="int"      value="3"/>
-    <Parameter name="coarse: max size"                      type="int"      value="10"/>
-    <Parameter name="verbosity"                             type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"                          type="int"      value="0"/>
-      <Parameter name="Smoother"                            type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"                        type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                                   type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                                   type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                                   type="string"   value="myBlockedRAPFact"/>
-    </ParameterList>
-
-  </ParameterList>
-</ParameterList>
diff --git a/katoptron/Juelich/smoothers/mySIM1_old.xml b/katoptron/Juelich/smoothers/mySIM1_old.xml
deleted file mode 100644
index dbfa1ac497857933219b97329ab90ff3d0386dd7..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/smoothers/mySIM1_old.xml
+++ /dev/null
@@ -1,190 +0,0 @@
-<ParameterList name="MueLu">
-
-  <!-- Configuration of the Xpetra operator (fine level) -->
-  <ParameterList name="Matrix">
-    <Parameter name="number of equations"                         type="int" value="1"/> <!-- Number of PDE equations at each grid node.-->
-  </ParameterList>
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-
-    <!-- sub block factories -->
-    <!-- BLOCK 1 -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myDropFact1">
-      <Parameter name="factory" type="string" value="CoalesceDropFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="0"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-
-    <!-- BLOCK 2 -->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3,1 }"/>
-      <Parameter name="Strided block id" type="int" value="1"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use old aggregates! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="Graph" type="string" value="myDropFact1"/>
-    </ParameterList>
-
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-	<Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-	<Parameter name="P" type="string" value="myTentativePFact2"/>
-	<Parameter name="Aggregates" type="string" value="myAggFact1"/><!-- reuse aggs -->
-	<Parameter name="Nullspace" type="string" value="myNspFact2"/>
-	<Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-	<Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-	<Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-    </ParameterList>
-
-    <!-- BLOCK SMOOTHERS -->
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="20"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="10"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.8"/>
-      </ParameterList>
-    </ParameterList>
-
-
-    <!-- Use Block GS: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="50"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"                       type="int"      value="3"/>
-    <Parameter name="coarse: max size"                         type="int"      value="10"/>
-    <Parameter name="verbosity"                             type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"                          type="int"      value="0"/>
-      <Parameter name="Smoother"                            type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"                        type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                                   type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                                   type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                                   type="string"   value="myBlockedRAPFact"/>
-    </ParameterList>
-
-  </ParameterList>
-</ParameterList>
diff --git a/katoptron/Juelich/tests/M1_assembly_contact.py b/katoptron/Juelich/tests/M1_assembly_contact.py
deleted file mode 100644
index c5ac3c9e43525ebe500d9ecac44e73ae4633b54d..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_contact.py
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def evaluate_one_ensemble(ensemble_size,
-                          msh,
-                          comm,
-                          file_dir,
-                          randomVariable_1,
-                          randomVariable_2,
-                          randomVariable_3,
-                          scale_u,
-                          scale_T,
-                          option,
-                          baking=False):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    small_disk_footprint = False
-    use_block = True
-
-    comm, rank, siz = m.utilities.import_MPI()
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-    solverList[
-        "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-    solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    geo_name = 'contact_mirror_assembly_mm.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir+'/../mesh', work_dir, comm, rank, size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-    solverList[
-        "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-    solverList["Scaled Block 0"] = True
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    pbl = m.Problem(msh, comm)
-
-    ensemble_size = 1
-
-    scale_u = 1000.
-    scale_T = 1.
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 200E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 15.3 * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 118E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 345 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.8E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * scale_d
-
-    E_I718 = 183E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 15.8 * scale_k
-    d_I718 = 1.38E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             180. * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             180. * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             180. * scale_k, d_AlN)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Dirichlet(pbl, "Holder x-y-z clamping point", "Clamped", 1, 0., 1, 0., 1,
-                0., 0, 0., ensemble_size)
-    m.Dirichlet(pbl, "Holder z clamping point", "Clamped", 0, 0., 0, 0., 1, 0.,
-                0, 0., ensemble_size)
-    m.Dirichlet(pbl, "Holder z-y clamping point", "Clamped", 0, 0., 1, 0., 1,
-                0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-
-    m.Dirichlet(pbl, "Mirror surface", "Clamped", 1, 0., 1, 0., 1, -10., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-    '''
-    zero = np.zeros(ensemble_size)
-    hf = 20. / 0.0121 * np.ones(
-        ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-                1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 20E6 * scale_hsource)
-    m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-    if material_option(option) == 1:
-        m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-    elif material_option(option) == 2:
-        m.Source(pbl, "Holder", "ihg", 0.6E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.3E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 3", "ihg", 0.8E6 * scale_hsource)
-    '''
-
-    nThreads = u.Initialize_Kokkos()
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    slv.start()
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/tests/M1_assembly_fused.py b/katoptron/Juelich/tests/M1_assembly_fused.py
deleted file mode 100644
index 762dd765def1fae8f80f1725e23507db2ea6349d..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_fused.py
+++ /dev/null
@@ -1,559 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def irradiation(irradotion_index, p1=1., p3=1.95):
-    sigma_1_min = 0.1
-    sigma_1_max = 0.1
-    sigma_3_min = 0.05
-    sigma_3_max = 0.05
-
-    sigma_1 = sigma_1_min + (sigma_1_max - sigma_1_min) * irradotion_index
-    sigma_3 = sigma_3_min + (sigma_3_max - sigma_3_min) * irradotion_index
-
-    mode_min = 70
-    mode_max = 180
-
-    mode_1 = mode_min + (mode_max - mode_min) * irradotion_index**p1
-    mode_3 = mode_min + (mode_max - mode_min) * irradotion_index**p3
-
-    mu_1 = np.log(mode_1)  # + sigma_1**2
-    mu_3 = np.log(mode_3)  # + sigma_3**2
-
-    return sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3
-
-
-def random_case(N, id_case):
-    comm, rank, siz = m.utilities.import_MPI()
-    np.random.seed(42)
-
-    sigma = 0.15
-    mode = 180
-    mu = np.log(mode) + sigma**2
-
-    qMC = True
-
-    if id_case == 'qMC 1':
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = randomVariable_halton[0, :]
-        randomVariable_2 = randomVariable_halton[1, :]
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'MC 1':
-        randomVariable_1 = np.random.lognormal(mu, sigma, N)
-        randomVariable_2 = np.random.lognormal(mu, sigma, N)
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'qMC 2':
-        mode_min = 70
-        mode_max = 180
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_2 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_3 = mode_min + (mode_max -
-                                       mode_min) * halton_points[1, :]
-    elif id_case == 'qMC 3':
-        from scipy.stats import lognorm
-        mode_min = 70
-        mode_max = 180
-        n_rand = 3
-        halton_points = np.zeros((n_rand, N))
-
-        randomVariable_1 = np.zeros((N, ))
-        randomVariable_3 = np.zeros((N, ))
-
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-            sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3 = irradiation(
-                halton_points[0, i])
-            randomVariable_1[i] = lognorm.ppf(halton_points[1, i],
-                                              sigma_1,
-                                              scale=np.exp(mu_1))
-            randomVariable_3[i] = lognorm.ppf(halton_points[2, i],
-                                              sigma_3,
-                                              scale=np.exp(mu_3))
-
-        randomVariable_2 = randomVariable_1
-    elif id_case == 'Xiao':
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-        weights = loaded['weights']
-        randomVariable_1 = samples[0:N, 0]
-        randomVariable_3 = samples[0:N, 1]
-        randomVariable_2 = randomVariable_1
-
-    if rank == 0:
-        np.savetxt('randomVariable_1.txt', randomVariable_1)
-        np.savetxt('randomVariable_2.txt', randomVariable_2)
-        np.savetxt('randomVariable_3.txt', randomVariable_3)
-
-    return randomVariable_1, randomVariable_2, randomVariable_3
-
-
-def material_option(option):
-    return int(option[-1])
-
-
-def clamping_option(option):
-    return str(option[0])
-
-
-def scale_msh(msh, scale):
-    for n in msh.nodes:
-        for i in range(0, 3):
-            n.pos[i] = n.pos[i] * scale
-
-
-def tar_results(directory, filename, rank, all=False):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        if all:
-            for file in glob.glob('*'):
-                if file.endswith(".tar.gz"):
-                    print(file + ' is not included')
-                else:
-                    tf.add(file)
-        else:
-            for file in glob.glob('r*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/t*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/b*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.npz'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.out'):
-                tf.add(file)
-        tf.close()
-
-
-def evaluate_one_ensemble(ensemble_size, msh, comm, file_dir, randomVariable_1,
-                          randomVariable_2, randomVariable_3, scale_u,
-                          scale_T, option, baking=False):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    small_disk_footprint = False
-    use_block = True
-
-    comm, rank, siz = m.utilities.import_MPI()
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    if use_block:
-        if ensemble_size >= 16 and siz == 2 and clamping_option(option) == "A":
-            solverList["Num Blocks"] = 150
-        else:
-            solverList["Num Blocks"] = 200
-
-        solverList['Use blocked matrix'] = True
-
-        solverList['Use blocked status test'] = True
-        solverList['Use blocked status test: x'] = True
-        solverList['Use blocked status test: T'] = True
-        solverList['Use weighted status test'] = True
-
-        solverList['Ensemble Convergence Tolerance: T - relative'] = True
-        solverList['Ensemble Convergence Tolerance: x - relative'] = True
-        solverList[
-            'Ensemble Convergence Tolerance: T - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: x - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: weights - relative'] = False
-
-        solverList['Ensemble Convergence Tolerance'] = 10**(-5)
-        solverList['Ensemble Convergence Tolerance: x'] = 10**(-6)
-        solverList['Ensemble Convergence Tolerance: T'] = 10**(-7)
-        solverList['Ensemble Convergence Tolerance: weights'] = 10**(-3)
-
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/AMG_BGS_gs_gs.xml'
-    else:
-        solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-        solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 200E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 15.3 * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 118E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 345 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.8E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * np.ones(ensemble_size) * scale_d
-
-    E_I718 = 183E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 15.8 * scale_k
-    d_I718 = 1.38E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if material_option(option) == 1:
-        m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-    elif material_option(option) == 2:
-        m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_1 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_2 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_3 * scale_k, d_AlN)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if clamping_option(option) == "A":
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0, 0., 0, 0., 1, 0.,
-                    0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1, 0., 1, 0., 0,
-                    0., 0, 0., ensemble_size)
-
-    elif clamping_option(option) == "B":
-        m.Dirichlet(pbl, "Holder x-y-z clamping point", "Clamped", 1, 0., 1,
-                    0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z clamping point", "Clamped", 0, 0., 0, 0.,
-                    1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z-y clamping point", "Clamped", 0, 0., 1, 0.,
-                    1, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-
-    if not baking:
-        zero = np.zeros(ensemble_size)
-        hf = 20. / 0.0121 * np.ones(
-            ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-        m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-                  1, hf, ensemble_size)
-
-        m.Source(pbl, "Mirror", "ihg", 20E6 * scale_hsource)
-        m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-        if material_option(option) == 1:
-            m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-        elif material_option(option) == 2:
-            m.Source(pbl, "Holder", "ihg", 0.6E6 * scale_hsource)
-
-        m.Source(pbl, "Spacer 1 part 1", "ihg", 0.3E6 * scale_hsource)
-        m.Source(pbl, "Spacer 2 part 1", "ihg", 0.3E6 * scale_hsource)
-        m.Source(pbl, "Spacer 3 part 1", "ihg", 0.3E6 * scale_hsource)
-
-        m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-        m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-        m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-        m.Source(pbl, "Shaft 1", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Shaft 2", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Shaft 3", "ihg", 0.8E6 * scale_hsource)
-
-        m.Source(pbl, "Nut 1", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Nut 2", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Nut 3", "ihg", 0.8E6 * scale_hsource)
-
-        m.Source(pbl, "Washer 1", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Washer 2", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Washer 3", "ihg", 0.8E6 * scale_hsource)
-
-    if use_block:
-        m.Weight(pbl, "Mirror", 1, 0., 1, 0., 1, 1., 1, 0., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    tag_name = "Mirror surface"
-    name_sol = "x_mm.txt"
-    DOFperNode = 4
-    which_dof = 2
-
-    x, y, z, tri, dz = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                    ensemble_size, name_sol)
-    which_dof = 3
-    x, y, z, tri, T = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                   ensemble_size, name_sol)
-    np.savez('mirror_data_' + str(rank), x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-
-    if rank == 0:
-        for i in range(1, siz):
-            data = comm.recv(source=i, tag=11)
-    else:
-        comm.send(1, dest=0, tag=11)
-
-    if small_disk_footprint:
-        if rank == 0:
-            os.remove(name_sol)
-
-    if rank == 0:
-        #OAX = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[0]
-        #OAY = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[1]
-        OAX, OAY = 0.0595, 0.017
-        OAX = (OAX / scale_u)
-        OAY = (OAY / scale_u)
-        #OAX, OAY = 0.0595, 0.017
-        for i in range(0, siz):
-            npzfile = np.load('mirror_data_' + str(i) + '.npz')
-            x_i = npzfile['x']
-            y_i = npzfile['y']
-            z_i = 0. * x_i
-            dz_i = npzfile['dz']
-            tri_i = npzfile['tri']
-            T_i = npzfile['T']
-            if i == 0:
-                x = x_i
-                y = y_i
-                z = z_i
-                dz = dz_i
-                tri = tri_i
-                T = T_i
-                nNodes = len(x)
-            else:
-                x = np.append(x, x_i, axis=0)
-                y = np.append(y, y_i, axis=0)
-                z = np.append(z, z_i, axis=0)
-                dz = np.append(dz, dz_i, axis=0)
-                tri = np.append(tri, tri_i + nNodes, axis=0)
-                T = np.append(T, T_i, axis=0)
-                nNodes = len(x)
-        x = (x / scale_u)
-        y = (y / scale_u)
-        z = (z / scale_u)
-        dz = (dz / scale_u)
-        T = T * scale_T + T_ref
-        np.savez('mirror_data_all', x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-        for i in range(0, ensemble_size):
-            optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-                x, y, z, tri, dz[:, i], "m", np.array([OAX, OAY]))
-            np.savez('mirror_optical_results_' + str(i),
-                     optical_coefficients=optical_coefficients,
-                     dz_residual=dz_residual)
-            np.savetxt('mirror_optical_results_' + str(i) + '.out',
-                       optical_coefficients)
-
-    if small_disk_footprint:
-        if rank == 0:
-            for i in range(0, siz):
-                os.remove('mirror_data_' + str(i) + '.npz')
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, rank, size, file_dir,
-                           randomVariable1, randomVariable2, randomVariable3,
-                           scale_u, scale_T, option, baking=False):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = int(np.floor(N // ensemble_size))
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(option, comm, rank, size)
-            os.chdir(option)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            randomVariable_cur1 = randomVariable1[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur2 = randomVariable2[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur3 = randomVariable3[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            evaluate_one_ensemble(ensemble_size, msh, comm, file_dir,
-                                  randomVariable_cur1, randomVariable_cur2,
-                                  randomVariable_cur3, scale_u, scale_T, option, baking)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    directory = 'MPI_' + str(size)
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    mesh_name = 'fused_mirror_assembly_mm_part_' + str(size) + '.msh'
-
-    msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-
-    scale_u_1 = 1000.
-    scale_u_2 = 1.
-    scale_u = scale_u_1 * scale_u_2
-    scale_T = 1.
-
-    scale_msh(msh, scale_u_2)
-
-    randomVariable_1 = np.array([180., 30.])
-    randomVariable_2 = np.array([180., 30.])
-    randomVariable_3 = np.array([180., 30.])
-
-    ensemble_size = int(os.getenv('ensemble_size', 1))
-
-    ensemble_sizes = [ensemble_size]
-
-    N = 2
-
-    option = 'A2'
-
-    directory = 'A2_baking'
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, rank, size, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=True)
-    os.chdir('..')
-
-    directory = 'A2'
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=False)
-    os.chdir('..')
-
-    option = 'B2'
-
-    directory = 'B2_baking'
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=True)
-    os.chdir('..')
-
-    directory = 'B2'
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=False)
-    os.chdir('..')
-
-    os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/tests/M1_assembly_fused_MC_k.py b/katoptron/Juelich/tests/M1_assembly_fused_MC_k.py
deleted file mode 100644
index 185b585cf99a8e368827aeb19a51e2e79fb63e32..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_fused_MC_k.py
+++ /dev/null
@@ -1,545 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def irradiation(irradotion_index, p1=1., p3=1.95):
-    sigma_1_min = 0.1
-    sigma_1_max = 0.1
-    sigma_3_min = 0.05
-    sigma_3_max = 0.05
-
-    sigma_1 = sigma_1_min + (sigma_1_max - sigma_1_min) * irradotion_index
-    sigma_3 = sigma_3_min + (sigma_3_max - sigma_3_min) * irradotion_index
-
-    mode_min = 70
-    mode_max = 180
-
-    mode_1 = mode_min + (mode_max - mode_min) * irradotion_index**p1
-    mode_3 = mode_min + (mode_max - mode_min) * irradotion_index**p3
-
-    mu_1 = np.log(mode_1)  # + sigma_1**2
-    mu_3 = np.log(mode_3)  # + sigma_3**2
-
-    return sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3
-
-
-def random_case(N, id_case):
-    comm, rank, siz = m.utilities.import_MPI()
-    np.random.seed(42)
-
-    sigma = 0.15
-    mode = 180
-    mu = np.log(mode) + sigma**2
-
-    qMC = True
-
-    if id_case == 'qMC 1':
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = randomVariable_halton[0, :]
-        randomVariable_2 = randomVariable_halton[1, :]
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'MC 1':
-        randomVariable_1 = np.random.lognormal(mu, sigma, N)
-        randomVariable_2 = np.random.lognormal(mu, sigma, N)
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'qMC 2':
-        mode_min = 70
-        mode_max = 180
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_2 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_3 = mode_min + (mode_max -
-                                       mode_min) * halton_points[1, :]
-    elif id_case == 'qMC 3':
-        from scipy.stats import lognorm
-        mode_min = 70
-        mode_max = 180
-        n_rand = 3
-        halton_points = np.zeros((n_rand, N))
-
-        randomVariable_1 = np.zeros((N, ))
-        randomVariable_3 = np.zeros((N, ))
-
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-            sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3 = irradiation(
-                halton_points[0, i])
-            randomVariable_1[i] = lognorm.ppf(halton_points[1, i],
-                                              sigma_1,
-                                              scale=np.exp(mu_1))
-            randomVariable_3[i] = lognorm.ppf(halton_points[2, i],
-                                              sigma_3,
-                                              scale=np.exp(mu_3))
-
-        randomVariable_2 = randomVariable_1
-    elif id_case == 'Xiao':
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-        weights = loaded['weights']
-        randomVariable_1 = samples[0:N, 0]
-        randomVariable_3 = samples[0:N, 1]
-        randomVariable_2 = randomVariable_1
-
-    if rank == 0:
-        np.savetxt('randomVariable_1.txt', randomVariable_1)
-        np.savetxt('randomVariable_2.txt', randomVariable_2)
-        np.savetxt('randomVariable_3.txt', randomVariable_3)
-
-    return randomVariable_1, randomVariable_2, randomVariable_3
-
-
-def material_option(option):
-    return int(option[-1])
-
-
-def clamping_option(option):
-    return str(option[0])
-
-
-def scale_msh(msh, scale):
-    for n in msh.nodes:
-        for i in range(0, 3):
-            n.pos[i] = n.pos[i] * scale
-
-
-def tar_results(directory, filename, rank, all=False):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        if all:
-            for file in glob.glob('*'):
-                if file.endswith(".tar.gz"):
-                    print(file + ' is not included')
-                else:
-                    tf.add(file)
-        else:
-            for file in glob.glob('r*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/t*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/b*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.npz'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.out'):
-                tf.add(file)
-        tf.close()
-
-
-def evaluate_one_ensemble(ensemble_size, msh, comm, file_dir, randomVariable_1,
-                          randomVariable_2, randomVariable_3, scale_u,
-                          scale_T):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    small_disk_footprint = True
-    use_block = True
-
-    comm, rank, siz = m.utilities.import_MPI()
-
-    option = 'A2'
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    if use_block:
-        if ensemble_size >= 16 and siz == 2 and clamping_option(option) == "A":
-            solverList["Num Blocks"] = 150
-        else:
-            solverList["Num Blocks"] = 200
-
-        solverList['Use blocked matrix'] = True
-
-        solverList['Use blocked status test'] = True
-        solverList['Use blocked status test: x'] = True
-        solverList['Use blocked status test: T'] = True
-        solverList['Use weighted status test'] = True
-
-        solverList['Ensemble Convergence Tolerance: T - relative'] = True
-        solverList['Ensemble Convergence Tolerance: x - relative'] = True
-        solverList[
-            'Ensemble Convergence Tolerance: T - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: x - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: weights - relative'] = False
-
-        solverList['Ensemble Convergence Tolerance'] = 10**(-5)
-        solverList['Ensemble Convergence Tolerance: x'] = 10**(-6)
-        solverList['Ensemble Convergence Tolerance: T'] = 10**(-7)
-        solverList['Ensemble Convergence Tolerance: weights'] = 10**(-3)
-
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/AMG_BGS_gs_gs.xml'
-    else:
-        solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-        solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 200E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 15.3 * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 118E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 345 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.8E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * np.ones(ensemble_size) * scale_d
-
-    E_I718 = 183E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 15.8 * scale_k
-    d_I718 = 1.38E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if material_option(option) == 1:
-        m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-    elif material_option(option) == 2:
-        m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_1 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_2 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_3 * scale_k, d_AlN)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if clamping_option(option) == "A":
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0, 0., 0, 0., 1, 0.,
-                    0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1, 0., 1, 0., 0,
-                    0., 0, 0., ensemble_size)
-
-    elif clamping_option(option) == "B":
-        m.Dirichlet(pbl, "Holder x-y-z clamping point", "Clamped", 1, 0., 1,
-                    0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z clamping point", "Clamped", 0, 0., 0, 0.,
-                    1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z-y clamping point", "Clamped", 0, 0., 1, 0.,
-                    1, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = 20. / 0.0121 * np.ones(
-        ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-              1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 20E6 * scale_hsource)
-    m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-    if material_option(option) == 1:
-        m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-    elif material_option(option) == 2:
-        m.Source(pbl, "Holder", "ihg", 0.6E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.3E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 3", "ihg", 0.8E6 * scale_hsource)
-
-    if use_block:
-        m.Weight(pbl, "Mirror", 1, 0., 1, 0., 1, 1., 1, 0., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    tag_name = "Mirror surface"
-    name_sol = "x_mm.txt"
-    DOFperNode = 4
-    which_dof = 2
-
-    x, y, z, tri, dz = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                    ensemble_size, name_sol)
-    which_dof = 3
-    x, y, z, tri, T = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                   ensemble_size, name_sol)
-    np.savez('mirror_data_' + str(rank), x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-
-    if rank == 0:
-        for i in range(1, siz):
-            data = comm.recv(source=i, tag=11)
-    else:
-        comm.send(1, dest=0, tag=11)
-
-    if small_disk_footprint:
-        if rank == 0:
-            os.remove(name_sol)
-
-    if rank == 0:
-        #OAX = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[0]
-        #OAY = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[1]
-        OAX, OAY = 0.0595, 0.017
-        OAX = (OAX / scale_u)
-        OAY = (OAY / scale_u)
-        #OAX, OAY = 0.0595, 0.017
-        for i in range(0, siz):
-            npzfile = np.load('mirror_data_' + str(i) + '.npz')
-            x_i = npzfile['x']
-            y_i = npzfile['y']
-            z_i = 0. * x_i
-            dz_i = npzfile['dz']
-            tri_i = npzfile['tri']
-            T_i = npzfile['T']
-            if i == 0:
-                x = x_i
-                y = y_i
-                z = z_i
-                dz = dz_i
-                tri = tri_i
-                T = T_i
-                nNodes = len(x)
-            else:
-                x = np.append(x, x_i, axis=0)
-                y = np.append(y, y_i, axis=0)
-                z = np.append(z, z_i, axis=0)
-                dz = np.append(dz, dz_i, axis=0)
-                tri = np.append(tri, tri_i + nNodes, axis=0)
-                T = np.append(T, T_i, axis=0)
-                nNodes = len(x)
-        x = (x / scale_u)
-        y = (y / scale_u)
-        z = (z / scale_u)
-        dz = (dz / scale_u)
-        T = T * scale_T + T_ref
-        np.savez('mirror_data_all', x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-        for i in range(0, ensemble_size):
-            optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-                x, y, z, tri, dz[:, i], "m", np.array([OAX, OAY]))
-            np.savez('mirror_optical_results_' + str(i),
-                     optical_coefficients=optical_coefficients,
-                     dz_residual=dz_residual)
-            np.savetxt('mirror_optical_results_' + str(i) + '.out',
-                       optical_coefficients)
-
-    if small_disk_footprint:
-        if rank == 0:
-            for i in range(0, siz):
-                os.remove('mirror_data_' + str(i) + '.npz')
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable1, randomVariable2, randomVariable3,
-                           scale_u, scale_T):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    comm, rank, size = m.utilities.import_MPI()
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = int(np.floor(N // ensemble_size))
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(directory, comm, rank, size)
-            os.chdir(directory)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            randomVariable_cur1 = randomVariable1[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur2 = randomVariable2[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur3 = randomVariable3[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            evaluate_one_ensemble(ensemble_size, msh, comm, file_dir,
-                                  randomVariable_cur1, randomVariable_cur2,
-                                  randomVariable_cur3, scale_u, scale_T)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    directory = 'MPI_' + str(siz)
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-    mesh_name = 'fused_mirror_assembly_mm_part_' + str(siz) + '.msh'
-
-    msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-
-    # sigma = 0.05
-    # Scaled = True, tol = 10**(-8), scale_T=1
-    #       1 -> 55   (m)           -> smooth T QoI unsmooth u QoI
-    #    1000 -> 125  (mm)          -> smooth T QoI unsmooth u QoI
-    #  10 000 -> 126  (100 \mu m)   -> smooth T QoI nearly smooth u QoI
-    #  50 000 -> 167  (20 \mu m)    -> smooth T QoI nearly smooth u QoI
-    # 100 000 -> 175  (10 \mu m)    -> smooth QoI (OK)
-    # Scaled = False, tol = 10**(-8), scale_T=1
-    #       1 -> 222   (m)          -> Solver has experienced a loss of accuracy!
-    #    1000 -> 222  (mm)
-    #  10 000 ->   (100 \mu m)
-    # 100 000 -> 222  (10 \mu m)    -> No loss of accuracy
-    # Scaled = True, tol = 10**(-8),
-    #  scale_u = 1000.  and scale_T = 1.   -> 125  (KO)
-    #  scale_u = 1000.  and scale_T = 100. -> 174  nearly smooth
-    #  scale_u = 10000. and scale_T = 1.   -> 126  (KO)
-    #  scale_u = 10000. and scale_T = 100. -> 204  (OK)
-    #  scale_u = 10000. and scale_T = 400. -> 217  (OK)
-
-    scale_u_1 = 1000.
-    scale_u_2 = 1.
-    scale_u = scale_u_1 * scale_u_2
-    scale_T = 1.
-
-    scale_msh(msh, scale_u_2)
-
-    N = 20
-    id_case = 'Xiao'
-
-    randomVariable_1, randomVariable_2, randomVariable_3 = random_case(
-        N, id_case)
-
-    ensemble_size = int(os.getenv('ensemble_size', 1))
-
-    ensemble_sizes = [ensemble_size]
-
-    N = len(randomVariable_1)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T)
-
-    os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/tests/M1_assembly_fused_MC_k_order.py b/katoptron/Juelich/tests/M1_assembly_fused_MC_k_order.py
deleted file mode 100644
index 565e6e0a9f0f10b720cbed7679e83fbedfaa467e..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_fused_MC_k_order.py
+++ /dev/null
@@ -1,554 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def irradiation(irradotion_index, p1=1., p3=1.95):
-    sigma_1_min = 0.1
-    sigma_1_max = 0.1
-    sigma_3_min = 0.05
-    sigma_3_max = 0.05
-
-    sigma_1 = sigma_1_min + (sigma_1_max - sigma_1_min) * irradotion_index
-    sigma_3 = sigma_3_min + (sigma_3_max - sigma_3_min) * irradotion_index
-
-    mode_min = 70
-    mode_max = 180
-
-    mode_1 = mode_min + (mode_max - mode_min) * irradotion_index**p1
-    mode_3 = mode_min + (mode_max - mode_min) * irradotion_index**p3
-
-    mu_1 = np.log(mode_1)  # + sigma_1**2
-    mu_3 = np.log(mode_3)  # + sigma_3**2
-
-    return sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3
-
-
-def random_case(N, id_case):
-    comm, rank, siz = m.utilities.import_MPI()
-    np.random.seed(42)
-
-    sigma = 0.15
-    mode = 180
-    mu = np.log(mode) + sigma**2
-
-    qMC = True
-
-    if id_case == 'qMC 1':
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = randomVariable_halton[0, :]
-        randomVariable_2 = randomVariable_halton[1, :]
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'MC 1':
-        randomVariable_1 = np.random.lognormal(mu, sigma, N)
-        randomVariable_2 = np.random.lognormal(mu, sigma, N)
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'qMC 2':
-        mode_min = 70
-        mode_max = 180
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_2 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_3 = mode_min + (mode_max -
-                                       mode_min) * halton_points[1, :]
-    elif id_case == 'qMC 3':
-        from scipy.stats import lognorm
-        mode_min = 70
-        mode_max = 180
-        n_rand = 3
-        halton_points = np.zeros((n_rand, N))
-
-        randomVariable_1 = np.zeros((N, ))
-        randomVariable_3 = np.zeros((N, ))
-
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-            sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3 = irradiation(
-                halton_points[0, i])
-            randomVariable_1[i] = lognorm.ppf(halton_points[1, i],
-                                              sigma_1,
-                                              scale=np.exp(mu_1))
-            randomVariable_3[i] = lognorm.ppf(halton_points[2, i],
-                                              sigma_3,
-                                              scale=np.exp(mu_3))
-
-        randomVariable_2 = randomVariable_1
-    elif id_case == 'Xiao':
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-        weights = loaded['weights']
-        randomVariable_1 = samples[0:N, 0]
-        randomVariable_3 = samples[0:N, 1]
-        randomVariable_2 = randomVariable_1
-
-    if rank == 0:
-        np.savetxt('randomVariable_1.txt', randomVariable_1)
-        np.savetxt('randomVariable_2.txt', randomVariable_2)
-        np.savetxt('randomVariable_3.txt', randomVariable_3)
-
-    return randomVariable_1, randomVariable_2, randomVariable_3
-
-
-def material_option(option):
-    return int(option[-1])
-
-
-def clamping_option(option):
-    return str(option[0])
-
-
-def scale_msh(msh, scale):
-    for n in msh.nodes:
-        for i in range(0, 3):
-            n.pos[i] = n.pos[i] * scale
-
-
-def tar_results(directory, filename, rank, all=False):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        if all:
-            for file in glob.glob('*'):
-                if file.endswith(".tar.gz"):
-                    print(file + ' is not included')
-                else:
-                    tf.add(file)
-        else:
-            for file in glob.glob('r*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/t*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/b*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.npz'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.out'):
-                tf.add(file)
-        tf.close()
-
-
-def evaluate_one_ensemble(ensemble_size, msh, comm, file_dir, randomVariable_1,
-                          randomVariable_2, randomVariable_3, scale_u,
-                          scale_T):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    small_disk_footprint = True
-    use_block = True
-
-    comm, rank, siz = m.utilities.import_MPI()
-
-    option = 'A2'
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList["Num Blocks"] = 2
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    solverList['Write matrix and vectors'] = False
-
-    if use_block:
-        if ensemble_size >= 16 and siz == 2 and clamping_option(option) == "A":
-            solverList["Num Blocks"] = 150
-        else:
-            solverList["Num Blocks"] = 200
-
-        solverList['Use blocked matrix'] = True
-
-        solverList['Use blocked status test'] = True
-        solverList['Use blocked status test: x'] = True
-        solverList['Use blocked status test: T'] = True
-        solverList['Use weighted status test'] = True
-
-        solverList['Ensemble Convergence Tolerance: T - relative'] = True
-        solverList['Ensemble Convergence Tolerance: x - relative'] = True
-        solverList[
-            'Ensemble Convergence Tolerance: T - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: x - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: weights - relative'] = False
-
-        solverList['Ensemble Convergence Tolerance'] = 10**(-5)
-        solverList['Ensemble Convergence Tolerance: x'] = 10**(-6)
-        solverList['Ensemble Convergence Tolerance: T'] = 10**(-7)
-        solverList['Ensemble Convergence Tolerance: weights'] = 10**(-3)
-
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/AMG_BGS_gs_gs.xml'
-    else:
-        solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-        solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 200E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 15.3 * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 118E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 345 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.8E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * np.ones(ensemble_size) * scale_d
-
-    E_I718 = 183E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 15.8 * scale_k
-    d_I718 = 1.38E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if material_option(option) == 1:
-        m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-    elif material_option(option) == 2:
-        m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_1 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_2 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_3 * scale_k, d_AlN)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if clamping_option(option) == "A":
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0, 0., 0, 0., 1, 0.,
-                    0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1, 0., 1, 0., 0,
-                    0., 0, 0., ensemble_size)
-
-    elif clamping_option(option) == "B":
-        m.Dirichlet(pbl, "Holder x-y-z clamping point", "Clamped", 1, 0., 1,
-                    0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z clamping point", "Clamped", 0, 0., 0, 0.,
-                    1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z-y clamping point", "Clamped", 0, 0., 1, 0.,
-                    1, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = 20. / 0.0121 * np.ones(
-        ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-              1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 20E6 * scale_hsource)
-    m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-    if material_option(option) == 1:
-        m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-    elif material_option(option) == 2:
-        m.Source(pbl, "Holder", "ihg", 0.6E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.3E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 3", "ihg", 0.8E6 * scale_hsource)
-
-    if use_block:
-        m.Weight(pbl, "Mirror", 1, 0., 1, 0., 1, 1., 1, 0., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    tag_name = "Mirror surface"
-    name_sol = "x_mm.txt"
-    DOFperNode = 4
-    which_dof = 2
-
-    x, y, z, tri, dz = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                    ensemble_size, name_sol)
-    which_dof = 3
-    x, y, z, tri, T = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                   ensemble_size, name_sol)
-    np.savez('mirror_data_' + str(rank), x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-
-    if rank == 0:
-        for i in range(1, siz):
-            data = comm.recv(source=i, tag=11)
-    else:
-        comm.send(1, dest=0, tag=11)
-
-    if small_disk_footprint:
-        if rank == 0:
-            os.remove(name_sol)
-
-    if rank == 0:
-        #OAX = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[0]
-        #OAY = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[1]
-        OAX, OAY = 0.0595, 0.017
-        OAX = (OAX / scale_u)
-        OAY = (OAY / scale_u)
-        #OAX, OAY = 0.0595, 0.017
-        for i in range(0, siz):
-            npzfile = np.load('mirror_data_' + str(i) + '.npz')
-            x_i = npzfile['x']
-            y_i = npzfile['y']
-            z_i = 0. * x_i
-            dz_i = npzfile['dz']
-            tri_i = npzfile['tri']
-            T_i = npzfile['T']
-            if i == 0:
-                x = x_i
-                y = y_i
-                z = z_i
-                dz = dz_i
-                tri = tri_i
-                T = T_i
-                nNodes = len(x)
-            else:
-                x = np.append(x, x_i, axis=0)
-                y = np.append(y, y_i, axis=0)
-                z = np.append(z, z_i, axis=0)
-                dz = np.append(dz, dz_i, axis=0)
-                tri = np.append(tri, tri_i + nNodes, axis=0)
-                T = np.append(T, T_i, axis=0)
-                nNodes = len(x)
-        x = (x / scale_u)
-        y = (y / scale_u)
-        z = (z / scale_u)
-        dz = (dz / scale_u)
-        T = T * scale_T + T_ref
-        np.savez('mirror_data_all', x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-        for i in range(0, ensemble_size):
-            optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-                x, y, z, tri, dz[:, i], "m", np.array([OAX, OAY]))
-            np.savez('mirror_optical_results_' + str(i),
-                     optical_coefficients=optical_coefficients,
-                     dz_residual=dz_residual)
-            np.savetxt('mirror_optical_results_' + str(i) + '.out',
-                       optical_coefficients)
-
-    if small_disk_footprint:
-        if rank == 0:
-            for i in range(0, siz):
-                os.remove('mirror_data_' + str(i) + '.npz')
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable1, randomVariable2, randomVariable3,
-                           scale_u, scale_T):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = int(np.floor(N // ensemble_size))
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(directory, comm, rank, size)
-            os.chdir(directory)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            randomVariable_cur1 = randomVariable1[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur2 = randomVariable2[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur3 = randomVariable3[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            evaluate_one_ensemble(ensemble_size, msh, comm, file_dir,
-                                  randomVariable_cur1, randomVariable_cur2,
-                                  randomVariable_cur3, scale_u, scale_T)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    mesh_name = 'fused_mirror_assembly_mm_part_' + str(siz) + '.msh'
-
-    msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-
-    # sigma = 0.05
-    # Scaled = True, tol = 10**(-8), scale_T=1
-    #       1 -> 55   (m)           -> smooth T QoI unsmooth u QoI
-    #    1000 -> 125  (mm)          -> smooth T QoI unsmooth u QoI
-    #  10 000 -> 126  (100 \mu m)   -> smooth T QoI nearly smooth u QoI
-    #  50 000 -> 167  (20 \mu m)    -> smooth T QoI nearly smooth u QoI
-    # 100 000 -> 175  (10 \mu m)    -> smooth QoI (OK)
-    # Scaled = False, tol = 10**(-8), scale_T=1
-    #       1 -> 222   (m)          -> Solver has experienced a loss of accuracy!
-    #    1000 -> 222  (mm)
-    #  10 000 ->   (100 \mu m)
-    # 100 000 -> 222  (10 \mu m)    -> No loss of accuracy
-    # Scaled = True, tol = 10**(-8),
-    #  scale_u = 1000.  and scale_T = 1.   -> 125  (KO)
-    #  scale_u = 1000.  and scale_T = 100. -> 174  nearly smooth
-    #  scale_u = 10000. and scale_T = 1.   -> 126  (KO)
-    #  scale_u = 10000. and scale_T = 100. -> 204  (OK)
-    #  scale_u = 10000. and scale_T = 400. -> 217  (OK)
-
-    scale_u_1 = 1000.
-    scale_u_2 = 1.
-    scale_u = scale_u_1*scale_u_2
-    scale_T = 1.
-
-    # Convert mm to m
-    #scale_msh(msh, 0.001)
-    scale_msh(msh, scale_u_2)
-
-    orders = np.arange(2, 46, 2)
-
-    for order in orders:
-        id_case = 'Xiao'
-        directory = 'order_'+str(order)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N = order
-        randomVariable_1, randomVariable_2, randomVariable_3 = random_case(
-            N, id_case)
-
-        N = len(randomVariable_1)
-
-        ensemble_size = int(os.getenv('ensemble_size', 1))
-        ensemble_sizes = [ensemble_size]
-
-        evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                               randomVariable_1, randomVariable_2,
-                               randomVariable_3, scale_u, scale_T)
-        os.chdir('..')
-    #tar_results(work_dir, 'QoI_results', rank)
-    #tar_results(work_dir, 'all_results', rank, True)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/tests/M1_assembly_fused_all.py b/katoptron/Juelich/tests/M1_assembly_fused_all.py
deleted file mode 100644
index 1331f463d0a653512ce3b98f79d69abb7fd0f572..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_fused_all.py
+++ /dev/null
@@ -1,475 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def irradiation(irradotion_index, p1=1., p3=1.95):
-    sigma_1_min = 0.1
-    sigma_1_max = 0.1
-    sigma_3_min = 0.05
-    sigma_3_max = 0.05
-
-    sigma_1 = sigma_1_min + (sigma_1_max - sigma_1_min) * irradotion_index
-    sigma_3 = sigma_3_min + (sigma_3_max - sigma_3_min) * irradotion_index
-
-    mode_min = 70
-    mode_max = 180
-
-    mode_1 = mode_min + (mode_max - mode_min) * irradotion_index**p1
-    mode_3 = mode_min + (mode_max - mode_min) * irradotion_index**p3
-
-    mu_1 = np.log(mode_1)  # + sigma_1**2
-    mu_3 = np.log(mode_3)  # + sigma_3**2
-
-    return sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3
-
-
-def random_case(N, id_case):
-    comm, rank, siz = m.utilities.import_MPI()
-    np.random.seed(42)
-
-    sigma = 0.15
-    mode = 180
-    mu = np.log(mode) + sigma**2
-
-    qMC = True
-
-    if id_case == 'qMC 1':
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = randomVariable_halton[0, :]
-        randomVariable_2 = randomVariable_halton[1, :]
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'MC 1':
-        randomVariable_1 = np.random.lognormal(mu, sigma, N)
-        randomVariable_2 = np.random.lognormal(mu, sigma, N)
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'qMC 2':
-        mode_min = 70
-        mode_max = 180
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_2 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_3 = mode_min + (mode_max -
-                                       mode_min) * halton_points[1, :]
-    elif id_case == 'qMC 3':
-        from scipy.stats import lognorm
-        mode_min = 70
-        mode_max = 180
-        n_rand = 3
-        halton_points = np.zeros((n_rand, N))
-
-        randomVariable_1 = np.zeros((N, ))
-        randomVariable_3 = np.zeros((N, ))
-
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-            sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3 = irradiation(
-                halton_points[0, i])
-            randomVariable_1[i] = lognorm.ppf(halton_points[1, i],
-                                              sigma_1,
-                                              scale=np.exp(mu_1))
-            randomVariable_3[i] = lognorm.ppf(halton_points[2, i],
-                                              sigma_3,
-                                              scale=np.exp(mu_3))
-
-        randomVariable_2 = randomVariable_1
-    elif id_case == 'Xiao':
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-        weights = loaded['weights']
-        randomVariable_1 = samples[0:N, 0]
-        randomVariable_3 = samples[0:N, 1]
-        randomVariable_2 = randomVariable_1
-
-    if rank == 0:
-        np.savetxt('randomVariable_1.txt', randomVariable_1)
-        np.savetxt('randomVariable_2.txt', randomVariable_2)
-        np.savetxt('randomVariable_3.txt', randomVariable_3)
-
-    return randomVariable_1, randomVariable_2, randomVariable_3
-
-
-def material_option(option):
-    return int(option[-1])
-
-
-def clamping_option(option):
-    return str(option[0])
-
-
-def scale_msh(msh, scale):
-    for n in msh.nodes:
-        for i in range(0, 3):
-            n.pos[i] = n.pos[i] * scale
-
-
-def tar_results(directory, filename, rank, all=False):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        if all:
-            for file in glob.glob('*'):
-                if file.endswith(".tar.gz"):
-                    print(file + ' is not included')
-                else:
-                    tf.add(file)
-        else:
-            for file in glob.glob('r*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/t*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/b*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.npz'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.out'):
-                tf.add(file)
-        tf.close()
-
-
-def evaluate_one_ensemble(ensemble_size,
-                          msh,
-                          comm,
-                          file_dir,
-                          randomVariable_1,
-                          randomVariable_2,
-                          randomVariable_3,
-                          scale_u,
-                          scale_T,
-                          small_disk_footprint=True):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    use_block = True
-
-    comm, rank, size = m.utilities.import_MPI()
-
-    option = 'B2'
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    if use_block:
-        if ensemble_size >= 16 and size == 2 and clamping_option(option) == "A":
-            solverList["Num Blocks"] = 150
-        else:
-            solverList["Num Blocks"] = 250
-
-        solverList['Use blocked matrix'] = True
-
-        solverList['Use blocked status test'] = True
-        solverList['Use blocked status test: x'] = True
-        solverList['Use blocked status test: T'] = True
-        solverList['Use weighted status test'] = False
-
-        solverList['Ensemble Convergence Tolerance: T - relative'] = True
-        solverList['Ensemble Convergence Tolerance: x - relative'] = True
-        solverList[
-            'Ensemble Convergence Tolerance: T - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: x - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: weights - relative'] = False
-
-        solverList['Ensemble Convergence Tolerance'] = 1e-5
-        solverList['Ensemble Convergence Tolerance: x'] = 1e-5
-        solverList['Ensemble Convergence Tolerance: T'] = 1e-7
-        solverList['Ensemble Convergence Tolerance: weights'] = 5e-3
-
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/AMG_BGS_gs_gs.xml'
-    else:
-        solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-        solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 200E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 15.3 * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 118E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 345 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.8E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * np.ones(ensemble_size) * scale_d
-
-    E_I718 = 183E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 15.8 * scale_k
-    d_I718 = 1.38E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if material_option(option) == 1:
-        m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-        m.Medium(pbl, "Holder 2", "SS", E_SS, nu_SS, k_SS, d_SS)
-        m.Medium(pbl, "Pipes", "SS", E_SS, nu_SS, k_SS, d_SS)
-    elif material_option(option) == 2:
-        m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-        m.Medium(pbl, "Holder 2", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-        m.Medium(pbl, "Pipes", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-
-    m.Medium(pbl, "Bolts", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_1 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_2 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_3 * scale_k, d_AlN)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    m.Dirichlet(pbl, "Holder x", "Clamped", 1, 0., 0, 0., 0, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "Holder yz", "Clamped", 0, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    m.Dirichlet(pbl, "Holder z", "Clamped", 0, 0., 0, 0., 1, 0., 0, 0.,
-                ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) scale_T), ensemble_size)
-
-    zero = np.zeros(ensemble_size)
-    hf = 20. / 0.0121 * np.ones(
-        ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-    m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-              1, hf, ensemble_size)
-
-    m.Source(pbl, "Mirror", "ihg", 20E6 * scale_hsource)
-    m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-    if material_option(option) == 1:
-        m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Holder 2", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Pipes", "ihg", 0.7E6 * scale_hsource)
-    elif material_option(option) == 2:
-        m.Source(pbl, "Holder", "ihg", 0.6E6 * scale_hsource)
-        m.Source(pbl, "Holder 2", "ihg", 0.6E6 * scale_hsource)
-        m.Source(pbl, "Pipes", "ihg", 0.6E6 * scale_hsource)
-    m.Source(pbl, "Bolts", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 1", "ihg", 0.3E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 1", "ihg", 0.3E6 * scale_hsource)
-
-    m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-    m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-    m.Source(pbl, "Shaft 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Shaft 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Nut 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Nut 3", "ihg", 0.8E6 * scale_hsource)
-
-    m.Source(pbl, "Washer 1", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 2", "ihg", 0.8E6 * scale_hsource)
-    m.Source(pbl, "Washer 3", "ihg", 0.8E6 * scale_hsource)
-
-    if use_block:
-        m.Weight(pbl, "Mirror", 1, 0., 1, 0., 1, 1., 1, 0., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable1, randomVariable2, randomVariable3,
-                           scale_u, scale_T):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    comm, rank, size = m.utilities.import_MPI()
-    small_disk_footprint = True
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = int(np.floor(N // ensemble_size))
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(directory, comm, rank, size)
-            os.chdir(directory)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            randomVariable_cur1 = randomVariable1[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur2 = randomVariable2[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur3 = randomVariable3[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            evaluate_one_ensemble(ensemble_size,
-                                  msh,
-                                  comm,
-                                  file_dir,
-                                  randomVariable_cur1,
-                                  randomVariable_cur2,
-                                  randomVariable_cur3,
-                                  scale_u,
-                                  scale_T,
-                                  small_disk_footprint=small_disk_footprint)
-            small_disk_footprint = True
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    directory = 'MPI_' + str(size)
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    mesh_name = 'fused_mirror_assembly_all_mm_part_' + str(size) + '.msh'
-
-    msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-
-    scale_u_1 = 1000.
-    scale_u_2 = 1.
-    scale_u = scale_u_1 * scale_u_2
-    scale_T = 1.
-
-    scale_msh(msh, scale_u_2)
-
-    N = 12
-    id_case = 'Xiao'
-
-    randomVariable_1, randomVariable_2, randomVariable_3 = random_case(
-        N, id_case)
-
-    ensemble_size = int(os.getenv('ensemble_size', 1))
-
-    ensemble_sizes = [ensemble_size]
-
-    N = len(randomVariable_1)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T)
-
-    os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/tests/M1_assembly_fused_old.py b/katoptron/Juelich/tests/M1_assembly_fused_old.py
deleted file mode 100644
index 4fc098117ca99da05b9fb1de58fc7b7e3f9dbfc8..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_fused_old.py
+++ /dev/null
@@ -1,568 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def irradiation(irradotion_index, p1=1., p3=1.95):
-    sigma_1_min = 0.1
-    sigma_1_max = 0.1
-    sigma_3_min = 0.05
-    sigma_3_max = 0.05
-
-    sigma_1 = sigma_1_min + (sigma_1_max - sigma_1_min) * irradotion_index
-    sigma_3 = sigma_3_min + (sigma_3_max - sigma_3_min) * irradotion_index
-
-    mode_min = 70
-    mode_max = 180
-
-    mode_1 = mode_min + (mode_max - mode_min) * irradotion_index**p1
-    mode_3 = mode_min + (mode_max - mode_min) * irradotion_index**p3
-
-    mu_1 = np.log(mode_1)  # + sigma_1**2
-    mu_3 = np.log(mode_3)  # + sigma_3**2
-
-    return sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3
-
-
-def random_case(N, id_case):
-    comm, rank, siz = m.utilities.import_MPI()
-    np.random.seed(42)
-
-    sigma = 0.15
-    mode = 180
-    mu = np.log(mode) + sigma**2
-
-    qMC = True
-
-    if id_case == 'qMC 1':
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = randomVariable_halton[0, :]
-        randomVariable_2 = randomVariable_halton[1, :]
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'MC 1':
-        randomVariable_1 = np.random.lognormal(mu, sigma, N)
-        randomVariable_2 = np.random.lognormal(mu, sigma, N)
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'qMC 2':
-        mode_min = 70
-        mode_max = 180
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_2 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_3 = mode_min + (mode_max -
-                                       mode_min) * halton_points[1, :]
-    elif id_case == 'qMC 3':
-        from scipy.stats import lognorm
-        mode_min = 70
-        mode_max = 180
-        n_rand = 3
-        halton_points = np.zeros((n_rand, N))
-
-        randomVariable_1 = np.zeros((N, ))
-        randomVariable_3 = np.zeros((N, ))
-
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-            sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3 = irradiation(
-                halton_points[0, i])
-            randomVariable_1[i] = lognorm.ppf(halton_points[1, i],
-                                              sigma_1,
-                                              scale=np.exp(mu_1))
-            randomVariable_3[i] = lognorm.ppf(halton_points[2, i],
-                                              sigma_3,
-                                              scale=np.exp(mu_3))
-
-        randomVariable_2 = randomVariable_1
-    elif id_case == 'Xiao':
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-        weights = loaded['weights']
-        randomVariable_1 = samples[0:N, 0]
-        randomVariable_3 = samples[0:N, 1]
-        randomVariable_2 = randomVariable_1
-
-    if rank == 0:
-        np.savetxt('randomVariable_1.txt', randomVariable_1)
-        np.savetxt('randomVariable_2.txt', randomVariable_2)
-        np.savetxt('randomVariable_3.txt', randomVariable_3)
-
-    return randomVariable_1, randomVariable_2, randomVariable_3
-
-
-def material_option(option):
-    return int(option[-1])
-
-
-def clamping_option(option):
-    return str(option[0])
-
-
-def scale_msh(msh, scale):
-    for n in msh.nodes:
-        for i in range(0, 3):
-            n.pos[i] = n.pos[i] * scale
-
-
-def tar_results(directory, filename, rank, all=False):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        if all:
-            for file in glob.glob('*'):
-                if file.endswith(".tar.gz"):
-                    print(file + ' is not included')
-                else:
-                    tf.add(file)
-        else:
-            for file in glob.glob('r*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/t*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/b*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.npz'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.out'):
-                tf.add(file)
-        tf.close()
-
-
-def evaluate_one_ensemble(ensemble_size, msh, comm, file_dir, randomVariable_1,
-                          randomVariable_2, randomVariable_3, scale_u,
-                          scale_T, option, baking=False):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    small_disk_footprint = False
-    use_block = True
-
-    comm, rank, siz = m.utilities.import_MPI()
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    if use_block:
-        if ensemble_size >= 16 and siz == 2 and clamping_option(option) == "A":
-            solverList["Num Blocks"] = 150
-        else:
-            solverList["Num Blocks"] = 200
-
-        solverList['Use blocked matrix'] = True
-
-        solverList['Use blocked status test'] = True
-        solverList['Use blocked status test: x'] = True
-        solverList['Use blocked status test: T'] = True
-        solverList['Use weighted status test'] = True
-
-        solverList['Ensemble Convergence Tolerance: T - relative'] = True
-        solverList['Ensemble Convergence Tolerance: x - relative'] = True
-        solverList[
-            'Ensemble Convergence Tolerance: T - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: x - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: weights - relative'] = False
-
-        solverList['Ensemble Convergence Tolerance'] = 10**(-5)
-        solverList['Ensemble Convergence Tolerance: x'] = 10**(-6)
-        solverList['Ensemble Convergence Tolerance: T'] = 10**(-7)
-        solverList['Ensemble Convergence Tolerance: weights'] = 10**(-3)
-
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/AMG_BGS_gs_gs.xml'
-    else:
-        solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-        solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.26 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 180E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.26 * np.ones(ensemble_size)
-    k_SS = 20. * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 130E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.26 * np.ones(ensemble_size)
-    k_CuCrZr = 280 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.6E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * np.ones(ensemble_size) * scale_d
-
-    E_I718 = 180E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.26 * np.ones(ensemble_size)
-    k_I718 = 20. * scale_k
-    d_I718 = 1.4E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if material_option(option) == 1:
-        m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-    elif material_option(option) == 2:
-        m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    '''
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_1 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_2 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_3 * scale_k, d_AlN)
-    '''
-
-    m.Medium(pbl, "Spacer 1 part 1", "CuCrZr", E_CuCrZr, nu_AlN,
-             k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 2 part 1", "CuCrZr", E_CuCrZr, nu_AlN,
-             k_CuCrZr, d_CuCrZr)
-    m.Medium(pbl, "Spacer 3 part 1", "CuCrZr", E_CuCrZr, nu_AlN,
-             k_CuCrZr, d_CuCrZr)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if clamping_option(option) == "A":
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0, 0., 0, 0., 1, 0.,
-                    0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1, 0., 1, 0., 0,
-                    0., 0, 0., ensemble_size)
-
-    elif clamping_option(option) == "B":
-        m.Dirichlet(pbl, "Holder x-y-z clamping point", "Clamped", 1, 0., 1,
-                    0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z clamping point", "Clamped", 0, 0., 0, 0.,
-                    1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z-y clamping point", "Clamped", 0, 0., 1, 0.,
-                    1, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-
-    if not baking:
-        zero = np.zeros(ensemble_size)
-        hf = 70. / 0.0121 * np.ones(
-            ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-        m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-                  1, hf, ensemble_size)
-
-        m.Source(pbl, "Mirror", "ihg", 70E6 * scale_hsource)
-        m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-        if material_option(option) == 1:
-            m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-        elif material_option(option) == 2:
-            m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-
-        m.Source(pbl, "Spacer 1 part 1", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Spacer 2 part 1", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Spacer 3 part 1", "ihg", 0.7E6 * scale_hsource)
-
-        m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-        m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-        m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-        m.Source(pbl, "Shaft 1", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Shaft 2", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Shaft 3", "ihg", 0.7E6 * scale_hsource)
-
-        m.Source(pbl, "Nut 1", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Nut 2", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Nut 3", "ihg", 0.7E6 * scale_hsource)
-
-        m.Source(pbl, "Washer 1", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Washer 2", "ihg", 0.7E6 * scale_hsource)
-        m.Source(pbl, "Washer 3", "ihg", 0.7E6 * scale_hsource)
-
-    if use_block:
-        m.Weight(pbl, "Mirror", 1, 0., 1, 0., 1, 1., 1, 0., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    tag_name = "Mirror surface"
-    name_sol = "x_mm.txt"
-    DOFperNode = 4
-    which_dof = 2
-
-    x, y, z, tri, dz = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                    ensemble_size, name_sol)
-    which_dof = 3
-    x, y, z, tri, T = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                   ensemble_size, name_sol)
-    np.savez('mirror_data_' + str(rank), x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-
-    if rank == 0:
-        for i in range(1, siz):
-            data = comm.recv(source=i, tag=11)
-    else:
-        comm.send(1, dest=0, tag=11)
-
-    if small_disk_footprint:
-        if rank == 0:
-            os.remove(name_sol)
-
-    if rank == 0:
-        #OAX = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[0]
-        #OAY = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[1]
-        OAX, OAY = 0.0595, 0.017
-        OAX = (OAX / scale_u)
-        OAY = (OAY / scale_u)
-        #OAX, OAY = 0.0595, 0.017
-        for i in range(0, siz):
-            npzfile = np.load('mirror_data_' + str(i) + '.npz')
-            x_i = npzfile['x']
-            y_i = npzfile['y']
-            z_i = 0. * x_i
-            dz_i = npzfile['dz']
-            tri_i = npzfile['tri']
-            T_i = npzfile['T']
-            if i == 0:
-                x = x_i
-                y = y_i
-                z = z_i
-                dz = dz_i
-                tri = tri_i
-                T = T_i
-                nNodes = len(x)
-            else:
-                x = np.append(x, x_i, axis=0)
-                y = np.append(y, y_i, axis=0)
-                z = np.append(z, z_i, axis=0)
-                dz = np.append(dz, dz_i, axis=0)
-                tri = np.append(tri, tri_i + nNodes, axis=0)
-                T = np.append(T, T_i, axis=0)
-                nNodes = len(x)
-        x = (x / scale_u)
-        y = (y / scale_u)
-        z = (z / scale_u)
-        dz = (dz / scale_u)
-        T = T * scale_T + T_ref
-        np.savez('mirror_data_all', x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-        for i in range(0, ensemble_size):
-            optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-                x, y, z, tri, dz[:, i], "m", np.array([OAX, OAY]))
-            np.savez('mirror_optical_results_' + str(i),
-                     optical_coefficients=optical_coefficients,
-                     dz_residual=dz_residual)
-            np.savetxt('mirror_optical_results_' + str(i) + '.out',
-                       optical_coefficients)
-
-    if small_disk_footprint:
-        if rank == 0:
-            for i in range(0, siz):
-                os.remove('mirror_data_' + str(i) + '.npz')
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable1, randomVariable2, randomVariable3,
-                           scale_u, scale_T, option, baking=False):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = int(np.floor(N // ensemble_size))
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(directory, comm, rank, size)
-            os.chdir(directory)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            randomVariable_cur1 = randomVariable1[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur2 = randomVariable2[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur3 = randomVariable3[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            evaluate_one_ensemble(ensemble_size, msh, comm, file_dir,
-                                  randomVariable_cur1, randomVariable_cur2,
-                                  randomVariable_cur3, scale_u, scale_T, option, baking)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, siz = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    directory = 'MPI_' + str(siz)
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    mesh_name = 'fused_mirror_assembly_mm_part_' + str(siz) + '.msh'
-
-    msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-
-    scale_u_1 = 1000.
-    scale_u_2 = 1.
-    scale_u = scale_u_1 * scale_u_2
-    scale_T = 1.
-
-    scale_msh(msh, scale_u_2)
-
-    randomVariable_1 = np.array([180., 30.])
-    randomVariable_2 = np.array([180., 30.])
-    randomVariable_3 = np.array([180., 30.])
-
-    ensemble_size = int(os.getenv('ensemble_size', 1))
-
-    ensemble_sizes = [ensemble_size]
-
-    N = 1
-
-    option = 'A1'
-    '''
-    directory = 'A1_baking'
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=True)
-    os.chdir('..')
-    '''
-    directory = 'A1'
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=False)
-    os.chdir('..')
-    '''
-    option = 'B1'
-
-    directory = 'B1_baking'
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=True)
-    os.chdir('..')
-
-    directory = 'B1'
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=False)
-    os.chdir('..')
-    '''
-    os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/Juelich/tests/M1_assembly_fused_preload.py b/katoptron/Juelich/tests/M1_assembly_fused_preload.py
deleted file mode 100644
index b5cbd209ac82d91d2702d99288db5bbb39168741..0000000000000000000000000000000000000000
--- a/katoptron/Juelich/tests/M1_assembly_fused_preload.py
+++ /dev/null
@@ -1,544 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import numpy as np
-import shlex
-import subprocess
-import os
-import tarfile
-import glob
-
-from katoptron.Juelich.UQ.halton import *
-from katoptron.Juelich.UQ.copulas import *
-
-
-def irradiation(irradotion_index, p1=1., p3=1.95):
-    sigma_1_min = 0.1
-    sigma_1_max = 0.1
-    sigma_3_min = 0.05
-    sigma_3_max = 0.05
-
-    sigma_1 = sigma_1_min + (sigma_1_max - sigma_1_min) * irradotion_index
-    sigma_3 = sigma_3_min + (sigma_3_max - sigma_3_min) * irradotion_index
-
-    mode_min = 70
-    mode_max = 180
-
-    mode_1 = mode_min + (mode_max - mode_min) * irradotion_index**p1
-    mode_3 = mode_min + (mode_max - mode_min) * irradotion_index**p3
-
-    mu_1 = np.log(mode_1)  # + sigma_1**2
-    mu_3 = np.log(mode_3)  # + sigma_3**2
-
-    return sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3
-
-
-def random_case(N, id_case):
-    comm, rank, siz = m.utilities.import_MPI()
-    np.random.seed(42)
-
-    sigma = 0.15
-    mode = 180
-    mu = np.log(mode) + sigma**2
-
-    qMC = True
-
-    if id_case == 'qMC 1':
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = randomVariable_halton[0, :]
-        randomVariable_2 = randomVariable_halton[1, :]
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'MC 1':
-        randomVariable_1 = np.random.lognormal(mu, sigma, N)
-        randomVariable_2 = np.random.lognormal(mu, sigma, N)
-        randomVariable_3 = mode * np.ones((N, ))
-    elif id_case == 'qMC 2':
-        mode_min = 70
-        mode_max = 180
-        n_rand = 2
-        halton_points = np.zeros((n_rand, N))
-        for i in range(0, N):
-            halton_points[:, i] = halton(i, n_rand)
-
-        randomVariable_halton = lognormal(halton_points, [mu, mu],
-                                          [sigma, sigma])
-        randomVariable_1 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_2 = mode_min + (mode_max -
-                                       mode_min) * halton_points[0, :]
-        randomVariable_3 = mode_min + (mode_max -
-                                       mode_min) * halton_points[1, :]
-    elif id_case == 'qMC 3':
-        from scipy.stats import lognorm
-        mode_min = 70
-        mode_max = 180
-        n_rand = 3
-        halton_points = np.zeros((n_rand, N))
-
-        randomVariable_1 = np.zeros((N, ))
-        randomVariable_3 = np.zeros((N, ))
-
-        for i in range(0, N):
-            halton_points[:, i] = halton(i + 1, n_rand)
-            sigma_1, sigma_3, mode_1, mode_3, mu_1, mu_3 = irradiation(
-                halton_points[0, i])
-            randomVariable_1[i] = lognorm.ppf(halton_points[1, i],
-                                              sigma_1,
-                                              scale=np.exp(mu_1))
-            randomVariable_3[i] = lognorm.ppf(halton_points[2, i],
-                                              sigma_3,
-                                              scale=np.exp(mu_3))
-
-        randomVariable_2 = randomVariable_1
-    elif id_case == 'Xiao':
-        file_dir = os.path.dirname(__file__)
-        loaded = np.load(file_dir + '/../samples_files/Xiao_' + str(N) +
-                         '.npz')
-        samples = loaded['samples']
-        N = samples.shape[0]
-        weights = loaded['weights']
-        randomVariable_1 = samples[0:N, 0]
-        randomVariable_3 = samples[0:N, 1]
-        randomVariable_2 = randomVariable_1
-
-    if rank == 0:
-        np.savetxt('randomVariable_1.txt', randomVariable_1)
-        np.savetxt('randomVariable_2.txt', randomVariable_2)
-        np.savetxt('randomVariable_3.txt', randomVariable_3)
-
-    return randomVariable_1, randomVariable_2, randomVariable_3
-
-
-def material_option(option):
-    return int(option[-1])
-
-
-def clamping_option(option):
-    return str(option[0])
-
-
-def scale_msh(msh, scale):
-    for n in msh.nodes:
-        for i in range(0, 3):
-            n.pos[i] = n.pos[i] * scale
-
-
-def tar_results(directory, filename, rank, all=False):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        if all:
-            for file in glob.glob('*'):
-                if file.endswith(".tar.gz"):
-                    print(file + ' is not included')
-                else:
-                    tf.add(file)
-        else:
-            for file in glob.glob('r*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/t*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/b*.txt'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.npz'):
-                tf.add(file)
-            for file in glob.glob('*/*/*.out'):
-                tf.add(file)
-        tf.close()
-
-
-def evaluate_one_ensemble(ensemble_size, msh, comm, file_dir, randomVariable_1,
-                          randomVariable_2, randomVariable_3, scale_u,
-                          scale_T, option, baking=False):
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    small_disk_footprint = False
-    use_block = True
-
-    comm, rank, siz = m.utilities.import_MPI()
-
-    solverList = Teuchos.ParameterList()
-    solverList['type'] = "BlockGmres"
-
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    if small_disk_footprint:
-        solverList['Write vtk files'] = False
-
-    solverList['convert MueLu xml file'] = True
-    solverList["use xml file"] = True
-
-    if use_block:
-        if ensemble_size >= 16 and siz == 2 and clamping_option(option) == "A":
-            solverList["Num Blocks"] = 150
-        else:
-            solverList["Num Blocks"] = 200
-
-        solverList['Use blocked matrix'] = True
-
-        solverList['Use blocked status test'] = True
-        solverList['Use blocked status test: x'] = True
-        solverList['Use blocked status test: T'] = True
-        solverList['Use weighted status test'] = True
-
-        solverList['Ensemble Convergence Tolerance: T - relative'] = True
-        solverList['Ensemble Convergence Tolerance: x - relative'] = True
-        solverList[
-            'Ensemble Convergence Tolerance: T - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: x - relative full rhs'] = False
-        solverList[
-            'Ensemble Convergence Tolerance: weights - relative'] = False
-
-        solverList['Ensemble Convergence Tolerance'] = 10**(-5)
-        solverList['Ensemble Convergence Tolerance: x'] = 10**(-6)
-        solverList['Ensemble Convergence Tolerance: T'] = 10**(-7)
-        solverList['Ensemble Convergence Tolerance: weights'] = 10**(-3)
-
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/AMG_BGS_gs_gs.xml'
-    else:
-        solverList['Ensemble Convergence Tolerance'] = 10**(-8)
-        solverList[
-            "MueLu xml file name"] = file_dir + '/../smoothers/heat_no_contact_mtgs.xml'
-
-        solverList["Scaled Block 0"] = True
-    pbl = m.Problem(msh, comm)
-
-    # Distance in the mesh are represented in meters
-
-    scale_E = 1. / scale_u**2
-    scale_k = (scale_T / scale_u)
-    scale_hsource = 1. / scale_u**3
-    scale_hflux = 1. / scale_u**2
-    scale_d = scale_T
-
-    # 379 000 MPa = 379 GPa = 379E9 Pa
-    E_rhodium = 379E9 * np.ones(ensemble_size) * scale_E
-    nu_rhodium = 0.26 * np.ones(ensemble_size)
-    # 0.150 kW/(m K) = 150 W/(m K)
-    k_rhodium = 150 * scale_k
-    d_rhodium = 0.781E-05 * scale_d
-
-    E_WCu = 280E9 * np.ones(ensemble_size) * scale_E
-    nu_WCu = 0.298 * np.ones(ensemble_size)
-    k_WCu = 180 * scale_k
-    d_WCu = 0.88E-05 * scale_d
-
-    E_SS = 200E9 * np.ones(ensemble_size) * scale_E
-    nu_SS = 0.3 * np.ones(ensemble_size)
-    k_SS = 15.3 * scale_k
-    d_SS = 1.57E-05 * scale_d
-
-    E_CuCrZr = 118E9 * np.ones(ensemble_size) * scale_E
-    nu_CuCrZr = 0.33 * np.ones(ensemble_size)
-    k_CuCrZr = 345 * np.ones(ensemble_size) * scale_k
-    d_CuCrZr = 1.8E-05 * np.ones(ensemble_size) * scale_d
-
-    E_AlN = 320E9 * np.ones(ensemble_size) * scale_E
-    nu_AlN = 0.24 * np.ones(ensemble_size)
-    k_AlN = 180 * np.ones(ensemble_size) * scale_k
-    d_AlN = 0.48E-05 * np.ones(ensemble_size) * scale_d
-
-    E_I718 = 183E9 * np.ones(ensemble_size) * scale_E
-    nu_I718 = 0.31 * np.ones(ensemble_size)
-    k_I718 = 15.8 * scale_k
-    d_I718 = 1.38E-05 * scale_d
-
-    T_ref = 22.
-
-    m.Medium(pbl, "Mirror", "rhodium", E_rhodium, nu_rhodium, k_rhodium,
-             d_rhodium)
-    m.Medium(pbl, "Substrate", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if material_option(option) == 1:
-        m.Medium(pbl, "Holder", "SS", E_SS, nu_SS, k_SS, d_SS)
-    elif material_option(option) == 2:
-        m.Medium(pbl, "Holder", "CuCrZr", E_CuCrZr, nu_CuCrZr, k_CuCrZr,
-                 d_CuCrZr)
-
-    m.Medium(pbl, "Washer 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Washer 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Shaft 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Shaft 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Nut 1", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 2", "I718", E_I718, nu_I718, k_I718, d_I718)
-    m.Medium(pbl, "Nut 3", "I718", E_I718, nu_I718, k_I718, d_I718)
-
-    m.Medium(pbl, "Spacer 1 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_1 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 2 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_2 * scale_k, d_AlN)
-    m.Medium(pbl, "Spacer 3 part 1", "AlN", E_AlN, nu_AlN,
-             randomVariable_3 * scale_k, d_AlN)
-
-    m.Medium(pbl, "Spacer 1 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 2 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-    m.Medium(pbl, "Spacer 3 part 2", "WCu", E_WCu, nu_WCu, k_WCu, d_WCu)
-
-    if clamping_option(option) == "A":
-        m.Dirichlet(pbl, "Holder z clamping", "Clamped", 0, 0., 0, 0., 1, 0.,
-                    0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder x-y clamping", "Clamped", 1, 0., 1, 0., 0,
-                    0., 0, 0., ensemble_size)
-
-    elif clamping_option(option) == "B":
-        m.Dirichlet(pbl, "Holder x-y-z clamping point", "Clamped", 1, 0., 1,
-                    0., 1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z clamping point", "Clamped", 0, 0., 0, 0.,
-                    1, 0., 0, 0., ensemble_size)
-        m.Dirichlet(pbl, "Holder z-y clamping point", "Clamped", 0, 0., 1, 0.,
-                    1, 0., 0, 0., ensemble_size)
-
-    m.Dirichlet(pbl, "Cooling channels", "Clamped", 0, 0., 0, 0., 0, 0., 1,
-                ((70. - T_ref) / scale_T), ensemble_size)
-
-    if not baking:
-        zero = np.zeros(ensemble_size)
-        hf = 20. / 0.0121 * np.ones(
-            ensemble_size) * scale_hflux  # 20 W / (0.0121 m^2)
-
-        m.Neumann(pbl, "Mirror surface", "heat fluxes", 0, zero, 0, zero, 0, zero,
-                  1, hf, ensemble_size)
-
-        m.Source(pbl, "Mirror", "ihg", 20E6 * scale_hsource)
-        m.Source(pbl, "Substrate", "ihg", 2.45E6 * scale_hsource)
-
-        if material_option(option) == 1:
-            m.Source(pbl, "Holder", "ihg", 0.7E6 * scale_hsource)
-        elif material_option(option) == 2:
-            m.Source(pbl, "Holder", "ihg", 0.6E6 * scale_hsource)
-
-        m.Source(pbl, "Spacer 1 part 1", "ihg", 0.3E6 * scale_hsource)
-        m.Source(pbl, "Spacer 2 part 1", "ihg", 0.3E6 * scale_hsource)
-        m.Source(pbl, "Spacer 3 part 1", "ihg", 0.3E6 * scale_hsource)
-
-        m.Source(pbl, "Spacer 1 part 2", "ihg", 2.45E6 * scale_hsource)
-        m.Source(pbl, "Spacer 2 part 2", "ihg", 2.45E6 * scale_hsource)
-        m.Source(pbl, "Spacer 3 part 2", "ihg", 2.45E6 * scale_hsource)
-
-        m.Source(pbl, "Shaft 1", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Shaft 2", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Shaft 3", "ihg", 0.8E6 * scale_hsource)
-
-        m.Source(pbl, "Nut 1", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Nut 2", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Nut 3", "ihg", 0.8E6 * scale_hsource)
-
-        m.Source(pbl, "Washer 1", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Washer 2", "ihg", 0.8E6 * scale_hsource)
-        m.Source(pbl, "Washer 3", "ihg", 0.8E6 * scale_hsource)
-
-    if use_block:
-        m.Weight(pbl, "Mirror", 1, 0., 1, 0., 1, 1., 1, 0., ensemble_size)
-
-    slv = m.IterativeSolver(pbl, args.k, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    tag_name = "Mirror surface"
-    name_sol = "x_mm.txt"
-    DOFperNode = 4
-    which_dof = 2
-
-    x, y, z, tri, dz = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                    ensemble_size, name_sol)
-    which_dof = 3
-    x, y, z, tri, T = u.extract_2D(msh, tag_name, DOFperNode, which_dof,
-                                   ensemble_size, name_sol)
-    np.savez('mirror_data_' + str(rank), x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-
-    if rank == 0:
-        for i in range(1, siz):
-            data = comm.recv(source=i, tag=11)
-    else:
-        comm.send(1, dest=0, tag=11)
-
-    if small_disk_footprint:
-        if rank == 0:
-            os.remove(name_sol)
-
-    if rank == 0:
-        #OAX = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[0]
-        #OAY = msh.ntags["Optical Axis"].elems[0].nodes[0].pos[1]
-        OAX, OAY = 0.0595, 0.017
-        OAX = (OAX / scale_u)
-        OAY = (OAY / scale_u)
-        #OAX, OAY = 0.0595, 0.017
-        for i in range(0, siz):
-            npzfile = np.load('mirror_data_' + str(i) + '.npz')
-            x_i = npzfile['x']
-            y_i = npzfile['y']
-            z_i = 0. * x_i
-            dz_i = npzfile['dz']
-            tri_i = npzfile['tri']
-            T_i = npzfile['T']
-            if i == 0:
-                x = x_i
-                y = y_i
-                z = z_i
-                dz = dz_i
-                tri = tri_i
-                T = T_i
-                nNodes = len(x)
-            else:
-                x = np.append(x, x_i, axis=0)
-                y = np.append(y, y_i, axis=0)
-                z = np.append(z, z_i, axis=0)
-                dz = np.append(dz, dz_i, axis=0)
-                tri = np.append(tri, tri_i + nNodes, axis=0)
-                T = np.append(T, T_i, axis=0)
-                nNodes = len(x)
-        x = (x / scale_u)
-        y = (y / scale_u)
-        z = (z / scale_u)
-        dz = (dz / scale_u)
-        T = T * scale_T + T_ref
-        np.savez('mirror_data_all', x=x, y=y, z=z, tri=tri, dz=dz, T=T)
-        for i in range(0, ensemble_size):
-            optical_coefficients, dz_residual = u.compute_RBM_Curvature_Irreg(
-                x, y, z, tri, dz[:, i], "m", np.array([OAX, OAY]))
-            np.savez('mirror_optical_results_' + str(i),
-                     optical_coefficients=optical_coefficients,
-                     dz_residual=dz_residual)
-            np.savetxt('mirror_optical_results_' + str(i) + '.out',
-                       optical_coefficients)
-
-    if small_disk_footprint:
-        if rank == 0:
-            for i in range(0, siz):
-                os.remove('mirror_data_' + str(i) + '.npz')
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable1, randomVariable2, randomVariable3,
-                           scale_u, scale_T, option, baking=False):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = int(np.floor(N // ensemble_size))
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(directory, comm, rank, size)
-            os.chdir(directory)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            randomVariable_cur1 = randomVariable1[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur2 = randomVariable2[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            randomVariable_cur3 = randomVariable3[ensemble_index_start:
-                                                  ensemble_index_end]
-
-            evaluate_one_ensemble(ensemble_size, msh, comm, file_dir,
-                                  randomVariable_cur1, randomVariable_cur2,
-                                  randomVariable_cur3, scale_u, scale_T, option, baking)
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, siz = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    directory = 'MPI_' + str(siz)
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-
-    mesh_name = 'fused_mirror_assembly_mm_part_' + str(siz) + '.msh'
-
-    msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-
-    scale_u_1 = 1000.
-    scale_u_2 = 1.
-    scale_u = scale_u_1 * scale_u_2
-    scale_T = 1.
-
-    scale_msh(msh, scale_u_2)
-
-    N = 20
-    id_case = 'Xiao'
-
-    randomVariable_1, randomVariable_2, randomVariable_3 = random_case(
-        N, id_case)
-
-    ensemble_size = int(os.getenv('ensemble_size', 1))
-
-    ensemble_sizes = [ensemble_size]
-
-    N = len(randomVariable_1)
-
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=False)
-    os.chdir('..')
-
-    option = 'B2'
-
-    u.mkdir_MPI(option, comm, rank, size)
-    os.chdir(option)
-
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, file_dir,
-                           randomVariable_1, randomVariable_2,
-                           randomVariable_3, scale_u, scale_T, option, baking=False)
-    os.chdir('..')
-
-    os.chdir('..')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/__init__.py b/katoptron/__init__.py
deleted file mode 100644
index bd6e47794ebe4ac07a2e04f6a1daa8e5ab8a55e8..0000000000000000000000000000000000000000
--- a/katoptron/__init__.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8; -*-
-# katoptron MODULE initialization file
-
-
-import fwk
-import tbox
-try:
-  from katoptronw import *
-except:
-  print('katoptronw is not imported, this build is only enough for python post processing')
diff --git a/katoptron/_src/CMakeLists.txt b/katoptron/_src/CMakeLists.txt
deleted file mode 100644
index d7fd03c000fc46b9cf2dda1a4169395706a37c25..0000000000000000000000000000000000000000
--- a/katoptron/_src/CMakeLists.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-# CMake input file of the SWIG wrapper around "katoptronw.so"
-
-INCLUDE(${SWIG_USE_FILE})
-
-INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-
-FILE(GLOB SRCS *.h *.cpp *.inl *.swg)
-FILE(GLOB ISRCS *.i)
-
-SET(CMAKE_SWIG_FLAGS "")
-SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON)
-
-
-# -- Search for Trilinos
-FIND_PACKAGE(Trilinos REQUIRED)
-FIND_PACKAGE(MPI4PY REQUIRED)
-#FIND_PACKAGE(NUMPY REQUIRED)
-
-set (_VERB 1)  # set to 1 for debugging
-IF(_VERB)
-    MESSAGE("\nFound MPI4PY!  Here are the details: ")
-    MESSAGE("   MPI4PY_INCLUDE_DIR = ${MPI4PY_INCLUDE_DIR}")
-    MESSAGE("   TRILINOS_SOURCE_DIR = ${TEST_INCLUDE_DIR}")
-    MESSAGE("End of MPI4PY details\n")
-ENDIF()
-
-# --------------------------------------------------------------
-# Finds MPI (including MSMPI)
-# --------------------------------------------------------------
-if(WIN32)
-    FIND_PATH(MPI_INCLUDE_PATH NAMES  mpi.h HINTS "$ENV{MSMPI_INC}")
-    if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-        set(MS_MPI_ARCH_DIR x64)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB64}")
-    else()
-        set(MS_MPI_ARCH_DIR x86)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB32}")
-    endif()
-else()
-    find_package(MPI REQUIRED)
-    # intel mpi (mpi.h doit etre inclus avant stdio.h)
-    # ou definir ces 2 macros
-    ADD_DEFINITIONS(-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX)
-endif()
-# --------------------------------------------------------------
-
-
-#Teuchos.i
-#export TRILINOS_SOURCE_DIR=/Users/kliegeois/dev/Trilinos-master
-#SET(TRILINOS_SOURCE_DIR /Users/kliegeois/dev/Trilinos-master)
-#SET(TRILINOS_BUILD_DIR /Users/kliegeois/dev/TrilinosB)
-
-IF(1)
-SET(SWINCFLAGS
--I${PROJECT_SOURCE_DIR}/katoptron/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
--I${MPI4PY_INCLUDE_DIR}
--I${Trilinos_INCLUDE_DIRS}
--I${TRILINOS_SOURCE_DIR}/packages/PyTrilinos/src
--I${TRILINOS_SOURCE_DIR}/packages/teuchos/parameterlist/src
--I${TRILINOS_BUILD_DIR}/packages/PyTrilinos/doc/Doxygen
-)
-ELSE()
-SET(SWINCFLAGS
--I${PROJECT_SOURCE_DIR}/katoptron/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
--I${MPI4PY_INCLUDE_DIR}
--I${Trilinos_INCLUDE_DIRS}
-)
-ENDIF()
-# Teuchos.i
-# Teuchos_dox.i
-
-SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES SWIG_FLAGS "${SWINCFLAGS}")
-
-SWIG_ADD_MODULE(katoptronw python ${ISRCS} ${SRCS})
-MACRO_DebugPostfix(_katoptronw)
-
-# ---
-
-
-IF(1)
-INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/katoptron/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src 
-                     ${Trilinos_INCLUDE_DIRS}
-                     ${Trilinos_TPL_INCLUDE_DIRS}
-                     ${MPI_INCLUDE_PATH}
-                     ${MPI4PY_INCLUDE_DIR}
-                     ${TRILINOS_SOURCE_DIR}/packages/teuchos/parameterlist/src
-                     ${TRILINOS_SOURCE_DIR}/packages/teuchos/core/src
-                     ${TRILINOS_SOURCE_DIR}/packages/PyTrilinos/src
-                     ${NUMPY_INCLUDE_DIR})
-ELSE()
-INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/katoptron/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
-                     ${Trilinos_INCLUDE_DIRS}
-                     ${Trilinos_TPL_INCLUDE_DIRS}
-                     ${MPI_INCLUDE_PATH}
-                     ${MPI4PY_INCLUDE_DIR})
-ENDIF()
-# numpy/arrayobject.h
-SWIG_LINK_LIBRARIES(katoptronw
-                    katoptron tbox fwk ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${PYTHON_LIBRARIES}
-)
-
-INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/katoptronw.py DESTINATION ${CMAKE_INSTALL_PREFIX})
-INSTALL(TARGETS _katoptronw DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/katoptron/_src/katoptronw.i b/katoptron/_src/katoptronw.i
deleted file mode 100644
index ef5cb1aa8b36719170812a70830934a07a01eb88..0000000000000000000000000000000000000000
--- a/katoptron/_src/katoptronw.i
+++ /dev/null
@@ -1,134 +0,0 @@
-// SWIG input file of the 'katoptron' module
-
-%feature("autodoc","1");
-
-%module(docstring=
-"'katoptronw' module: tests of Trilinos library
-(c) ULg - A&M",
-directors="1",
-threads="1"
-) katoptronw
-%{
-
-#include <string>
-#include <sstream>
-#include <typeinfo>
-#include "katoptron.h"
-
-#include <mpi.h>
-#include "Teuchos_ParameterList.hpp"
-
-#include "fwkw.h"
-#include "tboxw.h"
-
-#include "DiscreteProblem.h"
-#include "wProblem.h"
-//#include "wSolver.h"
-#include "wMedium.h"
-#include "wDirichlet.h"
-#include "wNeumann.h"
-#include "wRandomVariable.h"
-#include "wSource.h"
-#include "wContact.h"
-#include "wWeight.h"
-#include "wDisplayHook.h"
-#include "LinearSolver.h"
-#include "IterativeSolver.h"
-
-#include <vector>
-
-#include "Kokkos_Init.h"
-
-#include "EnsembleReduction.h"
-
-//Fix for missing SWIGPY_SLICE_ARG with some versions of swig.
-#if PY_VERSION_HEX >= 0x03020000
-# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
-#else
-# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
-#endif
-
-%}
-
-%include "fwkw.swg"
-
-// ----------- MODULES UTILISES ------------
-%import "fwkw.i"
-%import "tboxw.i"
-
-
-// ----------- KATOPTRON CLASSES ----------------
-
-// Instantiate some std templates
-
-%include mpi4py/mpi4py.i
-%mpi4py_typemap(Comm, MPI_Comm);
-
-%feature("notabstract") MpiComm_int;
-//%include Teuchos.i
-
-
-//%teuchos_rcp_pydict_overrides(CONST, CLASS...);
-
-%include "katoptron.h"
-
-%shared_ptr(katoptron::Medium);
-%shared_ptr(katoptron::Dirichlet);
-%shared_ptr(katoptron::Neumann);
-%shared_ptr(katoptron::RandomVariable);
-%shared_ptr(katoptron::Contact);
-%shared_ptr(katoptron::Weight);
-%shared_ptr(katoptron::Source);
-%shared_ptr(katoptron::Problem);
-
-%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");
-    }
-}
-
-%include "wRandomVariable.h"
-
-%immutable katoptron::Problem::msh; // avoid the creation of the setter method
-%include "wProblem.h"
-//%include "wSolver.h"
-%immutable katoptron::LinearSolver::tms;
-%include "LinearSolver.h"
-%include "IterativeSolver.h"
-
-%pythonappend katoptron::Medium::Medium "self.thisown=0"
-%include "wMedium.h"
-%pythonappend katoptron::Dirichlet::Dirichlet "self.thisown=0"
-%include "wDirichlet.h"
-%pythonappend katoptron::Neumann::Neumann "self.thisown=0"
-%include "wNeumann.h"
-
-%pythonappend katoptron::Weight::Weight "self.thisown=0"
-%include "wWeight.h"
-
-%pythonappend katoptron::Source::Source "self.thisown=0"
-%include "wSource.h"
-%pythonappend katoptron::Contact::Contact "self.thisown=0"
-%include "wContact.h"
-
-%include "DiscreteProblem.h"
-namespace katoptron {
-    %template(DiscreteProblem_d) DiscreteProblem<double>;
-}
-
-%include "Kokkos_Init.h"
-void Kokkos_Initialize(int nThreads);
-void Kokkos_Finalize(void);
-
-%include "EnsembleReduction.h"
-bool UseEnsembleReduction();
-
-namespace std {
-    %template(std_vector_KatProblem) vector<katoptron::Problem*>;
-}
-
diff --git a/katoptron/convergence.py b/katoptron/convergence.py
deleted file mode 100644
index 2cc46f3dca39e56c5440a0b645ba0cfb6c23b3d5..0000000000000000000000000000000000000000
--- a/katoptron/convergence.py
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import numpy as np
-
-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()
-except:
-    comm = None
-    rank = 0
-    siz = 1
-    name = "noname"
-
-
-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 Index_no_repetition_2:
-    def __init__(self, among_i):
-        self.among_i = among_i
-        self.n = len(among_i)
-        self.i = np.zeros((2,), dtype=int)
-        self.i_index = np.zeros((2,), dtype=int)
-        self.is_valid = True
-        for j in range(0, 2):
-            self.i_index[j] = j
-            self.i[j] = among_i[self.i_index[j]]
-
-    def compute_next(self):
-        n = self.n
-        if self.i_index[1] < n-1:
-            self.i_index[1] = self.i_index[1]+1
-            self.i[1] = self.among_i[self.i_index[1]]
-        else:
-            if self.i_index[0] < n-2:
-                self.i_index[0] = self.i_index[0]+1
-                self.i_index[1] = self.i_index[0]+1
-                for j in range(0, 2):
-                    self.i[j] = self.among_i[self.i_index[j]]
-            else:
-                self.is_valid = False
-        return self.is_valid
-
-    def get_i(self):
-        return self.i
-
-
-class Index_no_repetition:
-    def __init__(self, k, n, n_0=0):
-        self.k = k
-        self.n = n
-        self.i = np.zeros((k,), dtype=int)
-        self.i_max = np.zeros((k,), dtype=int)
-        self.is_valid = True
-        for j in range(0, k):
-            self.i[j] = n_0+j
-        for j in range(0, k-1):
-            self.i_max[j] = self.i[j+1] - 1
-        self.i_max[-1] = n - 1
-
-    def compute_next(self):
-        k = self.k
-        mask = (self.i < self.i_max-1)
-        tmp = np.argwhere(mask == True)
-        j = -1
-        for i in range(0, k):
-            j = (1-mask[i])*j + mask[i]*i
-        if j == -1:
-            self.is_valid = False
-        else:
-            self.i[j:k] = self.i[j]+1+np.arange(0, k-j)
-            if j == 0:
-                j_1 = 0
-            else:
-                j_1 = j - 1
-            self.i_max[j_1:k-1] = self.i[j_1+1:k]
-        return self.is_valid
-
-    def get_is_valid(self):
-        return self.is_valid
-
-    def get_i(self):
-        return self.i
-
-
-def compute_convergence(k_max, n, omegas, deltas, A, b, x0, verbose=False):
-    if siz > 1:
-        convergence = compute_convergence_mpi(
-            k_max, n, omegas, deltas, A, b, x0, verbose)
-    else:
-        convergence = compute_convergence_serial(
-            k_max, n, omegas, deltas, A, b, x0, verbose)
-    return convergence
-
-
-def compute_sum_of_product_times_product(k, n, omegas, deltas):
-    i1 = Index_no_repetition(k, n)
-    results_sum = 0.
-    while True:
-        results_product_1 = 1.
-        results_product_2 = 1.
-        index = i1.get_i()
-        print(index)
-        results_product_1 = results_product_1 * np.prod(omegas[index])
-        i2 = Index_no_repetition_2(index)
-        while True:
-            index2 = i2.get_i()
-            tmp = np.absolute(deltas[index2[0]]-deltas[index2[1]])
-            results_product_2 = results_product_2 * tmp**2
-            if not i2.compute_next():
-                break
-        results_sum = results_sum + results_product_1 * results_product_2
-        if not i1.compute_next():
-            break
-    return results_sum
-
-
-def compute_convergence_serial(k_max, n, omegas, deltas, A, b, x0, verbose):
-    convergence = np.ones((k_max,))
-    convergence[0] = (np.linalg.norm(b - A.dot(x0)))**2
-    old_sum = compute_sum_of_product_times_product(2, n, omegas, deltas)
-    convergence[1] = old_sum
-    for k in range(2, k_max):
-        new_sum = compute_sum_of_product_times_product(k+1, n, omegas, deltas)
-        convergence[k] = new_sum / old_sum
-        if verbose:
-            print(convergence)
-        old_sum = new_sum
-    return convergence
-
-
-def compute_convergence_mpi(k_max, n, omegas, deltas, A, b, x0, verbose):
-    convergence = np.ones((k_max,))
-    convergence[0] = (np.linalg.norm(b - A.dot(x0)))**2
-
-    if rank == 0:
-        master = Master()
-        old_sum = master.start(2, n, omegas, deltas)
-        convergence[1] = old_sum
-    else:
-        worker = Worker(rank)
-        worker.start()
-
-    for k in range(2, k_max):
-        if rank == 0:
-            master = Master()
-            new_sum = master.start(k+1, n, omegas, deltas)
-            convergence[k] = new_sum / old_sum
-            old_sum = new_sum
-            if verbose:
-                print(convergence)
-        else:
-            worker = Worker(rank)
-            worker.start()
-    return convergence
-
-
-class Job:
-    """ Class containing data transmitted between MPI procs
-    """
-
-    def __init__(self, omegas, deltas, index):
-                # input
-        self.omegas = omegas
-        self.deltas = deltas
-        self.index = index
-        # output
-        self.partial_sum = 0.
-
-    def execute(self):
-        """
-        [executed by worker processes]
-        solve a given job and calculate "partial_sum"
-        """
-        results_product_1 = 1.
-        results_product_2 = 1.
-        results_product_1 = results_product_1 * \
-            np.prod(self.omegas[self.index])
-        i2 = Index_no_repetition_2(self.index)
-        while True:
-            index2 = i2.get_i()
-            tmp = np.absolute(self.deltas[index2[0]]-self.deltas[index2[1]])
-            results_product_2 = results_product_2 * tmp**2
-            if not i2.compute_next():
-                break
-        self.partial_sum = self.partial_sum + results_product_1 * results_product_2
-
-
-class Master:
-    """
-    MPI Process with rank #0
-    """
-
-    def __init__(self):
-        self.slaves = list(range(1, siz))
-
-    def start(self, k, n, omegas, deltas):
-        """
-        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)
-
-        # -----------------------------------------
-
-        for s in self.slaves:
-            if verb:
-                print("[%d] sending wake-up signal to worker %d" % (rank, s))
-            comm.send(None, dest=s, tag=tags.WAKEUP)
-
-        #################################################
-
-        i1 = Index_no_repetition(k, n)
-        results_sum = 0
-
-        #################################################
-
-        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)
-
-                #################################################
-
-                if i1.get_is_valid():
-                    job = Job(omegas, deltas, i1.get_i())
-
-                    if verb:
-                        print("[0] sending job to %d" % source)
-                    comm.send(job, dest=source, tag=tags.START)
-
-                    # -------------------
-
-                    i1.compute_next()
-                else:
-
-                    #################################################
-
-                    if verb:
-                        print("[%d] exit %d" % (rank, source))
-                    comm.send(None, dest=source, tag=tags.EXIT)
-
-            elif tag == tags.DONE:
-                if verb:
-                    print("[0] worker %d gives me its results" % source)
-
-                #################################################
-                results_sum = results_sum + data.partial_sum
-                #################################################
-
-            elif tag == tags.EXIT:
-                closed_workers += 1
-                if verb:
-                    print("[0] worker %d exited (%d worker(s) still running)" % (
-                        source, num_workers-closed_workers))
-
-        # -----------------------------------------
-
-        self.killslaves()
-
-        return results_sum
-
-    def killslaves(self):
-        global rank
-        for s in self.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, rank):
-        self.rank = rank
-
-    def start(self):
-        """
-        worker loop
-        """
-        if self.rank == 0:
-            raise Exception("this routine should be called with MPI rank!=0")
-
-        if verb:
-            print("[%d] starting worker" % self.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" % self.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" % self.rank)
-                        job.execute()
-                        if verb:
-                            print("[%d] sending job results" % self.rank)
-                        comm.send(job, dest=0, tag=tags.DONE)
-                    elif tag == tags.EXIT:
-                        if verb:
-                            print("[%d] sending exit confirmation" % self.rank)
-                        comm.send(None, dest=0, tag=tags.EXIT)
-                        break
-            elif tag == tags.SUICIDE:
-                if verb:
-                    print("[%d] I'm dying..." % self.rank)
-                break
diff --git a/katoptron/eigenvalues.py b/katoptron/eigenvalues.py
deleted file mode 100644
index ac08a75a5dd66857814d581989f3e7f47c5cf176..0000000000000000000000000000000000000000
--- a/katoptron/eigenvalues.py
+++ /dev/null
@@ -1,637 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import numpy as np
-
-from scipy.linalg import eig
-
-tol = 1e-6
-
-
-class Gauss_Seidel:
-    def __init__(self, A, n=1, damping=1.):
-        from scipy.sparse import tril
-        from scipy.sparse import triu
-        from scipy.sparse import eye
-        from scipy.sparse import diags
-
-        D = diags(A.diagonal(), 0)
-        E = -tril(A, -1)
-        F = -triu(A, 1)
-
-        self.x = np.zeros((A.shape[0],))
-
-        self.M = (D-damping*E).tocsr()
-        self.N = damping*F+(1-damping)*D
-        self.damping = damping
-        self.n = n
-
-        self.shape = [A.shape[0], A.shape[0]]
-
-    def dot(self, b):
-        from scipy.sparse.linalg import spsolve_triangular
-        self.x = spsolve_triangular(self.M, self.damping*b)
-        for i in range(0, self.n-1):
-            self.x = spsolve_triangular(
-                self.M, self.N.dot(self.x)+self.damping*b)
-        return self.x
-
-
-class SIMPLE_preconditioned_matrix:
-    def __init__(self, Q, invQ, G, GT, R, invR, omega=1.):
-        from scipy.sparse import diags
-        self.n1 = Q.shape[0]
-        self.n2 = G.shape[1]
-
-        self.x = np.zeros((self.n1+self.n2,))
-        self.x_tmp = np.zeros((self.n1+self.n2,))
-
-        self.omega = omega
-
-        self.Q = Q
-        self.G = G
-        self.GT = GT
-
-        self.R = R
-
-        self.invQ = invQ
-        self.invR = invR
-
-        Qdiag = Q.diagonal()
-        self.invD = diags(1 / Qdiag, 0)
-
-        self.shape = [Q.shape[0]+G.shape[1], Q.shape[0]+G.shape[1]]
-
-    def dot(self, b):
-        n1 = self.n1
-        n2 = self.n2
-
-        self.x[0:n1] = self.invQ.dot(b[0:n1])
-        self.x[n1:n1+n2] = self.invR.dot(b[n1:n1+n2]-self.GT.dot(self.x[0:n1]))
-
-        self.x_tmp[0:n1] = self.x[0:n1] - self.omega * \
-            self.invD.dot(self.G.dot(self.x[n1:n1+n2]))
-        self.x_tmp[n1:n1+n2] = self.omega*self.x[n1:n1+n2]
-
-        self.x[0:n1] = self.Q.dot(self.x_tmp[0:n1]) + \
-            self.G.dot(self.x_tmp[n1:n1+n2])
-        self.x[n1:n1+n2] = self.GT.dot(self.x_tmp[0:n1])
-
-        return self.x
-
-
-def read_mm(filename, ensemble_id=-1, is_sparse=True):
-    from scipy.sparse import csr_matrix
-
-    X_dim = np.genfromtxt(filename, skip_header=1, max_rows=1)
-    m = X_dim[0].astype(int)
-    n = X_dim[1].astype(int)
-
-    if is_sparse:
-        nnz = X_dim[2].astype(int)
-        if ensemble_id == -1:
-            # No ensemble typed data
-            X = np.loadtxt(filename, skiprows=2)
-
-            row = X[:, 0].astype(int)-1
-            col = X[:, 1].astype(int)-1
-            data = X[:, 2]
-
-        else:
-            # Ensemble typed data
-            X = np.genfromtxt(filename, skip_header=2,
-                              usecols=(0, 1, 3+ensemble_id))
-
-            row = X[:, 0].astype(int)-1
-            col = X[:, 1].astype(int)-1
-            data = X[:, 2]
-
-        mask = data != 0.
-        A = csr_matrix((data[mask], (row[mask], col[mask])), shape=(m, n))
-        B = A.tocsc()
-    else:
-        X = np.loadtxt(filename, skiprows=2)
-        if n != 1:
-            B = X.reshape((m, n)).T
-        else:
-            B = X.reshape((m,))
-
-    return B
-
-
-def create_block(A11, A12, A21, A22):
-    from scipy.sparse import bmat
-    A = bmat([[A11, A12], [A21, A22]])
-    return A
-
-
-def get_symmetrical_part(A):
-    A2 = A
-    tmp = A - A.T
-    A2[tmp != 0] = 0
-    return A2
-
-
-def Schur_complement(GT, invQ, G):
-    R = -GT*invQ*G
-    return R
-
-
-def approx_Schur_complement(Q, G, GT):
-    from scipy.sparse import diags
-    Qdiag = Q.diagonal()
-    invD = diags(1 / Qdiag, 0)
-    R = Schur_complement(GT, invD, G)
-    return R
-
-
-def SIMPLE_prec(Q, invQ, G, GT, R, invR, use_invQG=False, omega=1.):
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    Qdiag = Q.diagonal()
-    invD = diags(1 / Qdiag, 0)
-    n1 = Q.shape[0]
-    n2 = R.shape[0]
-    if use_invQG:
-        print('Warning: use_invQG is OK in SIMPLE only if we use a direct solver for each block for now')
-        print('Warning: this returned the preconditioned matrix and not the preconditioner matrix')
-        GTinvQ = invQ.T
-        invP = create_block(eye(n1)-(eye(n1)-Q*invD)*G*invR *
-                            GTinvQ, (eye(n1)-Q*invD)*G*invR, None, eye(n2))
-    else:
-        B = create_block(eye(n1), -omega*invD*G, None, omega*eye(n2))
-        invM = create_block(invQ, None, -invR*GT*invQ, invR)
-        invP = B*invM
-
-    return invP
-
-
-def compute_inv(A):
-    from scipy.sparse.linalg import inv
-    invA = inv(A)
-    return invA
-
-
-def compute_inv_on_image(A, B):
-    # Compute the inverse of A applied on the image of B:
-    # invAB = A^{—1} * B
-    from scipy.sparse.linalg import spsolve
-    from scipy.sparse import issparse
-
-    if issparse(B):
-        B2 = B.todense()
-    else:
-        B2 = B
-
-    invAB = spsolve(A, B2)
-    return invAB
-
-
-def compute_inv_GS(A, n, damping=1.):
-    from scipy.sparse import tril
-    from scipy.sparse import triu
-    from scipy.sparse import eye
-    from scipy.sparse import diags
-    from scipy.sparse import issparse
-    Adiag = A.diagonal()
-    D = diags(Adiag, 0)
-    E = -tril(A, -1)
-    F = -triu(A, 1)
-
-    M = (D-damping*E).tocsc()
-    N = damping*F+(1-damping)*D
-    invM = compute_inv(M)
-    invMN = invM*N
-    invA = invM*damping
-
-    invMN_pow = invMN
-
-    for i in range(0, n-1):
-        invA = invA + invMN_pow*invM*damping
-        invMN_pow = invMN_pow * invMN
-
-    return invA
-
-
-def compute_VW(A, b, m=0, N=1):
-    from scipy.linalg import qr
-    n = A.shape[0]
-
-    if m == 0:
-        m = n
-
-    V = np.zeros((n, m))
-    W = np.zeros((n, m))
-
-    tmp = b.reshape((n,))
-    previous_vec = np.zeros((n,))
-    V[:, 0] = tmp / np.linalg.norm(tmp)
-    previous_vec = A.dot(V[:, 0])
-    W[:, 0] = previous_vec / np.linalg.norm(previous_vec)
-
-    for i in range(1, m):
-        tmp = previous_vec
-        for j in range(0, i):
-            tmp = tmp - (np.inner(tmp, V[:, j])) * V[:, j]
-        norm = np.linalg.norm(tmp)
-        if norm <= tol:
-            m = i
-            break
-        tmp = tmp / norm
-        V[:, i] = tmp
-        previous_vec = A.dot(V[:, i])
-        norm = np.linalg.norm(previous_vec)
-        W[:, i] = previous_vec / norm
-    V = V[:, 0:m]
-    W = W[:, 0:m]
-
-    q, r = np.linalg.qr(W)
-    W = q
-
-    for i_N in range(0, N):
-        q, r = np.linalg.qr(V)
-        V = q
-        if i_N != 0:
-            q, r = np.linalg.qr(W)
-            W = q
-
-    product = np.dot(W.T, b)
-
-    for i in range(0, len(product)):
-        if product[i] < 0:
-            W[:, i] = -W[:, i]
-    return V, W
-
-
-def compute_V(A, b, m=0, N=0):
-    n = A.shape[0]
-
-    if m == 0:
-        m = n
-
-    V = np.zeros((n, m))
-
-    tmp = b.reshape((n,))
-    V[:, 0] = tmp / np.linalg.norm(tmp)
-    for i in range(1, m):
-        tmp = A.dot(V[:, i-1])
-        for j in range(0, i):
-            tmp = tmp - (np.inner(tmp, V[:, j])) * V[:, j]
-        norm = np.linalg.norm(tmp)
-        if norm <= tol:
-            m = i
-            break
-        else:
-            tmp = tmp / norm
-            V[:, i] = tmp
-    V = V[:, 0:m]
-    for i in range(0, N):
-        for i in range(1, m):
-            tmp = V[:, i]
-            for j in range(0, i):
-                tmp = tmp - (np.inner(tmp, V[:, j])) * V[:, j]
-            norm = np.linalg.norm(tmp)
-            if norm <= tol:
-                m = i
-                break
-            else:
-                tmp = tmp / norm
-                V[:, i] = tmp
-        V = V[:, 0:m]
-    return V
-
-
-def compute_W(A, b, V, N=0):
-    from scipy.linalg import qr
-    n = V.shape[0]
-    m = V.shape[1]
-    tmp = A.dot(V[:, 0])
-    W = np.zeros((n, m))
-
-    W[:, 0] = tmp / np.linalg.norm(tmp)
-
-    for i in range(1, m):
-        tmp = A.dot(V[:, i])
-        for j in range(0, i):
-            tmp = tmp - (np.inner(tmp, W[:, j])) * W[:, j]
-        norm = np.linalg.norm(tmp)
-        W[:, i] = tmp / norm
-    for i in range(0, N):
-        for i in range(1, m):
-            tmp = W[:, i]
-            for j in range(0, i):
-                tmp = tmp - (np.inner(tmp, W[:, j])) * W[:, j]
-            W[:, i] = tmp / np.linalg.norm(tmp)
-
-    product = np.dot(W.T, b)
-
-    for i in range(0, len(product)):
-        if product[i] < 0:
-            W[:, i] = -W[:, i]
-
-    return W
-
-
-def compute_eig_Q(V, W):
-    Q = np.dot(V.T, W)
-    a, Z = eig(Q)
-
-    return a, Z
-
-
-def compute_deltas_omegas(V, W, b):
-    import cmath
-    deltas, Z = compute_eig_Q(V, W)
-    omegas = np.zeros((Z.shape[1],))
-    for i in range(0, len(omegas)):
-        tmp = cmath.polar(Z[0, i])
-        omegas[i] = tmp[0]**2
-
-    return deltas, omegas
-
-
-def eigenvalues_ZE(Q, invQ, G, GT, R, invR, use_invQG=False):
-    from scipy.sparse import diags
-    from scipy.sparse import issparse
-    Qdiag = Q.diagonal()
-    D = diags(1 / Qdiag, 0)
-    invD = diags(1/ Qdiag, 0)
-    n1 = Q.shape[0]
-    n2 = R.shape[0]
-    v = np.ones((n1+n2,), dtype=complex)
-
-    J = invD*(D-Q)
-    if use_invQG:
-        invQG = invQ
-    else:
-        invQG = invQ*G
-    ZE = J*invQG*invR*GT
-
-    if issparse(ZE):
-        ZE2 = ZE.todense()
-    else:
-        ZE2 = ZE
-
-    a, V = eig(ZE2)
-
-    v[0:n1] = a
-
-    return v
-
-
-def eigenvalues_SR(invQ, G, GT, R, use_invQG=False):
-    from scipy.sparse import issparse
-    n1 = invQ.shape[0]
-    n2 = R.shape[0]
-    v = np.ones((n1+n2,), dtype=complex)
-
-    if use_invQG:
-        invQG = invQ
-    else:
-        invQG = invQ*G
-
-    S = -GT*invQG
-
-    if issparse(S):
-        S2 = S.todense()
-    else:
-        S2 = S
-
-    if issparse(R):
-        R2 = R.todense()
-    else:
-        R2 = R
-
-    a, V = eig(S2, R2)
-
-    v[0:n2] = a
-
-    return v
-
-
-def compute_1_eigenvector_per_eigenvale(A, v):
-    from scipy.sparse.linalg import eigs
-    n = A.shape[0]
-    if len(v) != 1:
-        nv = v.shape[0]
-    else:
-        nv = 1
-
-    V = np.zeros((n, nv))
-    b = np.zeros((n,))
-
-    for i in range(0, nv):
-        values, vectors = eigs(A, k=1, sigma=v[i].real)
-        V[:, i] = vectors.reshape((n,))
-
-    return V
-
-
-def jacobi_iteration_matrix(A):
-    from scipy.sparse import diags
-    from scipy.sparse import eye
-
-    diagA = A.diagonal()
-    invD = diags(1 / diagA, 0)
-
-    jacobi_iteration_matrix = eye(A.shape[0]) - np.dot(invD, A)
-    return jacobi_iteration_matrix
-
-
-def is_SPD(A, tol=1e-8):
-    # Linked to theorem 10.1.2 (p. 512 in Golub, Matrix Computation)
-    # if A is SPD, then GS converge for any initial guess
-    A = A.todense()
-    if not np.allclose(A, A.T, atol=tol):
-        return False
-    else:
-        try:
-            L = np.linalg.cholesky(A)
-        except:
-            return False
-    return True
-
-
-def compute_eig_and_departure_from_orthogonality(A):
-    from numpy import linalg as LA
-    w, v = LA.eig(A)
-    cond = LA.cond(v)
-    return w, v, cond
-
-
-def diagonal_dominance(A):
-    is_diagonal_dominance = True
-    for i in range(0, A.shape[0]):
-        diag = np.absolute(A[i, i])
-        sum_row = np.sum(np.absolute(A[i, :]))
-        sum_row = sum_row - diag
-        if diag <= sum_row:
-            print(str(diag) + ' <= ' + str(sum_row) + ' at row ' + str(i))
-            is_diagonal_dominance = False
-            break
-    return is_diagonal_dominance
-
-
-def spectral_radius(A):
-    from scipy.sparse.linalg import eigs
-    w, v = eigs(A, k=10, which='LM')
-
-    spectral_radius_A = np.absolute(w[0])
-    return spectral_radius_A
-
-
-def sparse_matrix_2_norm(A):
-    from scipy.sparse.linalg import svds
-    u, s, vt = svds(A, k=1)
-    norm_A = s[0]
-    return norm_A
-
-
-def compute_theta(v):
-    import cmath
-    theta = np.zeros((len(v),))
-    for x in range(len(v)):
-        tmp = cmath.polar(v[x])
-        theta[x] = tmp[1]
-    return theta
-
-
-def compute_cum_delta(theta, deltas, omegas, n):
-    theta_discrete = np.linspace(-np.pi, np.pi, n)
-    cum_delta = np.zeros((n,))
-    deriv_delta = np.zeros((n,))
-    cum_delta_omega = np.zeros((n,))
-    deriv_delta_omega = np.zeros((n,))
-
-    n_theta = len(theta)
-
-    first_index = 0
-    second_index = 0
-    for i in range(1, n):
-        for j in range(second_index, n_theta):
-            if theta_discrete[i] < theta[j]:
-                second_index = j
-                break
-        #indices = np.argwhere((theta_discrete[i-1] <= theta ) & (theta < theta_discrete[i]))
-        cum_delta[i] = cum_delta[i-1] + second_index-first_index
-        cum_delta_omega[i] = cum_delta_omega[i-1] + \
-            np.sum(omegas[first_index:second_index])
-        deriv_delta[i] = second_index-(first_index / (2*np.pi/n))
-        deriv_delta_omega[i] = (
-            np.sum(omegas[first_index:second_index])/ (2*np.pi/n))
-        first_index = second_index
-
-    percent_delta = (cum_delta / cum_delta[n-1])
-    percent_delta_omega = (cum_delta_omega / cum_delta_omega[n-1])
-
-    return theta_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega
-
-
-def write_eigenvalues(v, filename):
-    np.savetxt(filename, v, fmt='%f %f')
-
-
-def write_eigenvectors(v, V, filename):
-    np.savetxt(filename+'_eigenvalues.txt', v, fmt='%f %f')
-    nv = V.shape[1]
-    for i in range(0, nv):
-        np.savetxt(filename+'_eigenvectors_'+str(i)+'.txt', V[:, i])
-
-
-def plot_eigenvalues_on_unit_circle(v):
-    import matplotlib.pyplot as plt
-    import cmath
-    fig = plt.figure()
-    ax = fig.add_subplot(111, projection='polar')
-    an = np.linspace(0, 2*np.pi, 100)
-    ax.plot(an, np.ones(an.shape), zorder=1)
-    for x in range(len(v)):
-        tmp = cmath.polar(v[x])
-        r = tmp[0]
-        theta = tmp[1]
-        ax.plot(theta, r, 'ro', zorder=2)
-    ax.set_ylim(0, 1.5)
-    ax.grid(True)
-
-
-def plot_eigenvalues_on_unit_circle_highlight(v, indices):
-    import matplotlib.pyplot as plt
-    import cmath
-    fig = plt.figure()
-    ax = fig.add_subplot(111, projection='polar')
-    an = np.linspace(0, 2*np.pi, 100)
-    ax.plot(an, np.ones(an.shape), zorder=1)
-    for x in range(len(v)):
-        tmp = cmath.polar(v[x])
-        r = tmp[0]
-        theta = tmp[1]
-        if indices[x] == 0:
-            ax.plot(theta, r, 'go', alpha=0.3, zorder=2)
-        else:
-            ax.plot(theta, r, 'ro', zorder=10)
-    ax.set_ylim(0, 1.5)
-    ax.grid(True)
-
-
-def plot_polar_function(theta, f, rho_min, rho_max):
-    import matplotlib.pyplot as plt
-    scale = (rho_max-rho_min) / np.max(f)
-    rho = rho_min + scale*f
-    plt.plot(theta, rho, zorder=3)
-    plt.ylim(0, rho_max+0.5)
-
-
-def plot_omegas(v):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    v = -np.sort(-v)
-    plt.semilogy(v)
-    plt.grid(True)
-
-
-def plot_omegas_percent(v):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    v = -np.sort(-v)
-    plt.plot(np.cumsum(v) / np.sum(v))
-    plt.grid(True)
-
-
-def main():
-    filename = 'ApCTC_mm.txt'
-    Q = read_mm(filename)
-    filename = 'B_mm.txt'
-    GT = read_mm(filename)
-    G = GT.transpose()
-
-    A = create_block(Q, G, GT, None)
-
-    R = approx_Schur_complement(Q, G, GT)
-
-    invQ = compute_inv(Q)
-    invR = compute_inv(R)
-    invP = SIMPLE_prec(Q, invQ, G, GT, R, invR)
-
-    AinvP = (A*invP).todense()
-
-    a, v = eig(AinvP)
-
-    display = 1
-
-    if display:
-        import matplotlib.pyplot as plt
-        for x in range(len(a)):
-            plt.plot(a[x].real, a[x].imag, 'ro', label='python')
-        limit = np.max(np.ceil(np.absolute(a)))
-        plt.xlim((-limit, limit))
-        plt.ylim((-limit, limit))
-        plt.show()
-
-    v2 = eigenvalues_SR(Q, invQ, G, GT, R, invR)
-
-    write_eigenvalues(a, 'eigenvalues_direct_direct.txt')
-    write_eigenvalues(v2, 'eigenvalues_direct_direct_2.txt')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/exe/CMakeLists.txt b/katoptron/exe/CMakeLists.txt
deleted file mode 100644
index d69d79753cd65a035129fb065a1c07cde052e84b..0000000000000000000000000000000000000000
--- a/katoptron/exe/CMakeLists.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-# Example of compiled problem using "katoptron"
-
-FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
-
-ADD_EXECUTABLE(katoptron1 ${SRCS})
-MACRO_DebugPostfix(katoptron1)
-
-
-# -- Search for Trilinos
-FIND_PACKAGE(Trilinos REQUIRED)
-
-set (_VERB 0)  # set to 1 for debugging
-IF(_VERB)
-    MESSAGE("\nFound Trilinos!  Here are the details: ")
-    MESSAGE("   Trilinos_DIR = ${Trilinos_DIR}")
-    MESSAGE("   Trilinos_VERSION = ${Trilinos_VERSION}")
-    MESSAGE("   Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
-    MESSAGE("   Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
-    MESSAGE("   Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
-    MESSAGE("   Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
-    MESSAGE("   Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
-    MESSAGE("   Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
-    MESSAGE("   Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
-    MESSAGE("   Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
-    MESSAGE("   Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
-    MESSAGE("End of Trilinos details\n")
-ENDIF()
-
-# MPI check 
-LIST(FIND Trilinos_TPL_LIST MPI MPI_List_ID)
-IF (MPI_List_ID GREATER -1)
-  MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI ENABLED")
-  SET(MYAPP_MPI TRUE)
-  ADD_DEFINITIONS(-DMYAPP_MPI)
-ELSE()
-  MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI NOT ENABLED")
-  SET(MYAPP_MPI FALSE)
-ENDIF()
-
-# Set optional dependency in MyApp on Epetra package: 
-#   this toggles code within  #ifdef MYAPP_EPETRA 
-LIST(FIND Trilinos_PACKAGE_LIST Epetra Epetra_List_ID)
-IF (Epetra_List_ID GREATER -1)
-  ADD_DEFINITIONS(-DMYAPP_EPETRA)
-  MESSAGE("-- Looking for Epetra: -- found, compiling with -DMYAPP_EPETRA")
-  SET(MYAPP_EPETRA TRUE)
-ELSE()
-  MESSAGE("-- Looking for Epetra: -- not found.")
-  SET(MYAPP_EPETRA FALSE)
-ENDIF()
-
-# --------------------------------------------------------------
-# Finds MPI (including MSMPI)
-# --------------------------------------------------------------
-if(WIN32)  
-    FIND_PATH(MPI_INCLUDE_PATH NAMES  mpi.h HINTS "$ENV{MSMPI_INC}")
-    if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-        set(MS_MPI_ARCH_DIR x64)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB64}")
-    else()
-        set(MS_MPI_ARCH_DIR x86)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB32}")
-    endif()
-else()
-    find_package(MPI REQUIRED)
-    # intel mpi (mpi.h doit etre inclus avant stdio.h)
-    # ou definir ces 2 macros
-    ADD_DEFINITIONS(-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX)
-endif()
-# --------------------------------------------------------------
-
-list(REMOVE_ITEM Trilinos_LIBRARIES pytrilinos)
-
-INCLUDE_DIRECTORIES( ${MPI_INCLUDE_PATH}
-                     ${PROJECT_SOURCE_DIR}/katoptron/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
-                     ${Trilinos_INCLUDE_DIRS} 
-                     ${Trilinos_TPL_INCLUDE_DIRS}
-                     )
-
-LINK_DIRECTORIES (${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
-        
-TARGET_LINK_LIBRARIES(  katoptron1 
-                        katoptron
-                        tbox 
-                        fwk 
-                        ${Trilinos_LIBRARIES}
-                        ${Trilinos_TPL_LIBRARIES}
-                        ${MPI_LIBRARIES})
\ No newline at end of file
diff --git a/katoptron/exe/main.cpp b/katoptron/exe/main.cpp
deleted file mode 100644
index b2e2067230f878d34fc16d76bee0ba543bf96bac..0000000000000000000000000000000000000000
--- a/katoptron/exe/main.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-#include "katoptron.h"
-#include "wMshData.h"
-#include "wProblem.h"
-#include "wMedium.h"
-#include "wDirichlet.h"
-#include "wNeumann.h"
-#include "wContact.h"
-#include "IterativeSolver.h"
-#include <mpi.h>
-
-#include "wGmshImport.h"
-#include "wNode.h"
-#include "DiscreteProblem.h"
-
-#include <iostream>
-#include <cmath>
-
-#include <Teuchos_ParameterList.hpp>
-#include <Teuchos_RCP.hpp>
-
-#include <stdlib.h>
-
-#include <xmmintrin.h>
-#include <cmath>
-
-#include "Belos_Tpetra_MP_Vector.hpp"
-#include "BelosLinearProblem.hpp"
-#include "BelosPseudoBlockGmresSolMgr.hpp"
-
-#include "Kokkos_Init.h"
-
-const double pi = std::acos(-1);
-
-template <typename scalar>
-void test_function(int ensemble_size)
-{
-
-    typedef Tpetra::Vector<>::local_ordinal_type local_ordinal_type;
-    typedef Tpetra::Vector<>::global_ordinal_type global_ordinal_type;
-
-    //typedef Tpetra::Map<> map_type;
-    //typedef Tpetra::Vector<>::scalar_type scalar_type;
-    //typedef Tpetra::Vector<>::mag_type magnitude_type;
-    typedef Tpetra::MultiVector<scalar, local_ordinal_type, global_ordinal_type> multivector_type;
-    //typedef Tpetra::CrsMatrix<scalar,local_ordinal_type,global_ordinal_type> crs_matrix_type;
-    //typedef Tpetra::CrsGraph<local_ordinal_type,global_ordinal_type> crs_graph_type;
-    //typedef Tpetra::Vector<scalar,local_ordinal_type,global_ordinal_type> vector_type;
-
-    int worldsize;
-    MPI_Comm_size(MPI_COMM_WORLD, &worldsize);
-
-    int myrank;
-    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-
-    int DOFperNode = 3;
-
-    std::string mesh_name;
-    mesh_name = "cube.msh";
-
-    auto msh = std::make_shared<MshData>();
-    auto gmshLoader = std::make_shared<GmshImport>(msh);
-    if (worldsize > 1)
-        gmshLoader->load(mesh_name, myrank);
-    else
-        gmshLoader->load(mesh_name, -1);
-
-    //auto numNodes = msh->nodes.size();
-
-    katoptron::Problem pbl(msh, MPI_COMM_WORLD);
-
-    double E_value = 21000.;
-    double nu_value = 0.29;
-    double k = 0.;
-    double d = 0.;
-
-    std::vector<double> E, nu;
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        E.push_back(E_value);
-        nu.push_back(nu_value);
-    }
-
-    katoptron::Medium md0(pbl, std::string("Body 1"), std::string("Mat 1"), E, nu, k, d);
-    pbl.media[0] = &md0;
-
-    std::vector<double> zero, dy;
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        zero.push_back((double)0.);
-        dy.push_back((double)1.);
-    }
-
-    katoptron::Dirichlet ud0(pbl, std::string("Surf 1 1"), std::string("Clamped 1"), 1, zero, 1, zero, 1, zero, 0, zero);
-    katoptron::Dirichlet ud1(pbl, std::string("Surf 1 2"), std::string("Clamped 1"), 0, zero, 1, dy, 0, zero, 0, zero);
-
-    pbl.duBCs[0] = &ud0;
-    pbl.duBCs[1] = &ud1;
-
-    Teuchos::ParameterList solverList;
-
-    scalar tol = (scalar)1E-06;
-    solverList.set(std::string("Convergence Tolerance"), tol);
-    solverList.set(std::string("Maximum Iterations"), 1000);
-    solverList.set(std::string("Verbosity"), 33);
-    solverList.set(std::string("Flexible Gmres"), false);
-    solverList.set(std::string("Output Style"), 1);
-    solverList.set(std::string("Output Frequency"), 1);
-    //solverList.set(std::string("MueLu xml file name"),              std::string("nested_multigrid_2_lvls.xml"));
-    solverList.set(std::string("Output Style"), 1);
-    //solverList.set(std::string("convert MueLu xml file"),           true);
-    solverList.set(std::string("Use preconditioner"), false);
-    solverList.set(std::string("Maximum active set iteration"), 1);
-    solverList.set(std::string("type"), std::string("BlockGmres"));
-
-    RCP<Teuchos::ParameterList> solverList2 = rcp(new Teuchos::ParameterList(solverList));
-
-    RCP<Teuchos::ParameterList> randomParams = rcp(new Teuchos::ParameterList());
-    //katoptron::IterativeSolver slv(pbl, 1, solverList2, DOFperNode, (ensemble_size > 1), ensemble_size);
-
-    auto begin = std::chrono::high_resolution_clock::now();
-
-    Kokkos::View<scalar *, Kokkos::LayoutLeft> a = Kokkos::View<scalar *, Kokkos::LayoutLeft>("KL Random Variables", 0);
-    katoptron::DiscreteProblem<scalar> discreteProblem(pbl, DOFperNode, randomParams, a);
-
-    discreteProblem.computeMatrices();
-    discreteProblem.computeLoads();
-
-    typedef multivector_type MV;
-    typedef typename multivector_type::dot_type belos_scalar;
-    typedef Tpetra::Operator<scalar> OP;
-    typedef Belos::LinearProblem<belos_scalar, MV, OP> BLinProb;
-    RCP<BLinProb> blinproblem = rcp(new BLinProb(discreteProblem.algebraic->matrices->K, discreteProblem.algebraic->vectors->x, discreteProblem.algebraic->vectors->b));
-    blinproblem->setProblem();
-    RCP<Teuchos::ParameterList> belosParams = rcp(new Teuchos::ParameterList(solverList));
-    RCP<Belos::SolverManager<belos_scalar, MV, OP>> blinsolver =
-        rcp(new Belos::PseudoBlockGmresSolMgr<belos_scalar, MV, OP>(blinproblem, belosParams));
-    //Belos::ReturnType ret = blinsolver->solve();
-    blinsolver->solve();
-
-    auto end = std::chrono::high_resolution_clock::now();
-    double total_time = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin).count();
-    std::cout << ensemble_size << " " << total_time << " nanosec" << std::endl;
-}
-
-template <typename scalar>
-void test_function2(int ensemble_size)
-{
-    int worldsize;
-    MPI_Comm_size(MPI_COMM_WORLD, &worldsize);
-
-    int myrank;
-    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-
-    int DOFperNode = 3;
-
-    std::string mesh_name;
-    mesh_name = "cube.msh";
-
-    auto msh = std::make_shared<MshData>();
-    auto gmshLoader = std::make_shared<GmshImport>(msh);
-    if (worldsize > 1)
-        gmshLoader->load(mesh_name, myrank);
-    else
-        gmshLoader->load(mesh_name, -1);
-
-    //auto numNodes = msh->nodes.size();
-
-    katoptron::Problem pbl(msh, MPI_COMM_WORLD);
-
-    double E_value = 21000.;
-    double nu_value = 0.29;
-    double k = 0.;
-    double d = 0.;
-
-    std::vector<double> E, nu;
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        E.push_back(E_value);
-        nu.push_back(nu_value);
-    }
-
-    katoptron::Medium md0(pbl, std::string("Body 1"), std::string("Mat 1"), E, nu, k, d);
-    pbl.media[0] = &md0;
-
-    std::vector<double> zero, dy;
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        zero.push_back((double)0.);
-        dy.push_back((double)1.);
-    }
-
-    katoptron::Dirichlet ud0(pbl, std::string("Surf 1 1"), std::string("Clamped 1"), 1, zero, 1, zero, 1, zero, 0, zero);
-    katoptron::Dirichlet ud1(pbl, std::string("Surf 1 2"), std::string("Clamped 1"), 0, zero, 1, dy, 0, zero, 0, zero);
-
-    pbl.duBCs[0] = &ud0;
-    pbl.duBCs[1] = &ud1;
-
-    Teuchos::ParameterList solverList;
-
-    solverList.set(std::string("Ensemble Convergence Tolerance"), 1E-06);
-    solverList.set(std::string("Maximum Iterations"), 1000);
-    solverList.set(std::string("Verbosity"), 33);
-    solverList.set(std::string("Flexible Gmres"), false);
-    solverList.set(std::string("Output Style"), 1);
-    solverList.set(std::string("Output Frequency"), 1);
-    //solverList.set(std::string("MueLu xml file name"),              std::string("nested_multigrid_2_lvls.xml"));
-    solverList.set(std::string("Output Style"), 1);
-    //solverList.set(std::string("convert MueLu xml file"),           true);
-    solverList.set(std::string("Use preconditioner"), false);
-    solverList.set(std::string("Maximum active set iteration"), 1);
-    solverList.set(std::string("type"), std::string("BlockGmres"));
-    solverList.set(std::string("Write vtk files"), false);
-
-    RCP<Teuchos::ParameterList> solverList2 = rcp(new Teuchos::ParameterList(solverList));
-    katoptron::IterativeSolver slv(pbl, solverList2, DOFperNode, ensemble_size);
-
-    auto begin2 = std::chrono::high_resolution_clock::now();
-    slv.start();
-    auto end2 = std::chrono::high_resolution_clock::now();
-    double total_time2 = std::chrono::duration_cast<std::chrono::nanoseconds>(end2 - begin2).count();
-    std::cout << ensemble_size << " " << total_time2 << " nanosec" << std::endl;
-}
-
-int main(int argc, char **argv)
-{
-    size_t case_id, N, k;
-    if (argc > 1)
-        case_id = atoi(argv[1]);
-    else
-        case_id = 1;
-
-    if (argc > 2)
-        N = atoi(argv[2]);
-    else
-        N = 1;
-
-    if (argc > 3)
-        k = atoi(argv[3]);
-    else
-        k = 1;
-
-    MPI_Init(NULL, NULL);
-    Kokkos_Initialize(k);
-    {
-        const int ensemble_size = 1;
-        typedef double scalar;
-        for (size_t i = 0; i < N; ++i)
-        {
-            std::cout << " ==================== " << std::endl;
-            std::cout << " =-- start test " << i << " --= " << std::endl;
-            std::cout << " ==================== " << std::endl;
-            if (case_id == 1)
-                test_function<scalar>(ensemble_size);
-            else
-                test_function2<scalar>(ensemble_size);
-        }
-    }
-    Kokkos_Finalize();
-    MPI_Finalize();
-}
diff --git a/katoptron/matlab/Belos/read_belos.m b/katoptron/matlab/Belos/read_belos.m
deleted file mode 100644
index 6ec2699acf61598f43377361cf12745f01f58b7f..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/read_belos.m
+++ /dev/null
@@ -1,40 +0,0 @@
-function [it, res] = read_belos(filename)
-
-    it = [];
-    res = [];
-
-    fid = fopen(filename);
-
-    tline = fgetl(fid);
-    while ischar(tline)
-        current_length = length(tline);
-        if current_length > 5
-            if tline(1:4) == 'Iter'             
-                % get the iteration id
-                i_1 = 5;
-                i_2 = 5;
-                while tline(i_2) ~= ','
-                    i_2 = i_2+1;
-                end
-                it = [it, str2num(tline(i_1:i_2-1))];    
-                
-                % get the res
-                i_1 = i_2;
-                i_2 = current_length;
-                while tline(i_1) ~= ':'
-                    i_1 = i_1+1;
-                end
-                res = [res, str2num(tline(i_1+1:i_2))];                   
-            end
-        end
-        tline = fgetl(fid);
-    end
-    
-    figure
-    semilogy(it,res,'*')
-    grid on
-    box on
-    set(gca,'fontsize',18)
-    xlabel('Iteration')
-    ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-end
\ No newline at end of file
diff --git a/katoptron/matlab/Belos/test_belos.m b/katoptron/matlab/Belos/test_belos.m
deleted file mode 100644
index 9242fbe45cb95efd82e11270eafa33759684b9f8..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos.m
+++ /dev/null
@@ -1,10 +0,0 @@
-clc
-clear all
-[it_0, res_0] = read_belos('belos_nu_0.txt');
-[it_m02, res_m02] = read_belos('belos_nu_m02.txt');
-close all
-[it, res] = read_belos('belos_nu_02.txt');
-hold on
-plot(it_0,res_0,'*g')
-plot(it_m02,res_m02,'*r')
-
diff --git a/katoptron/matlab/Belos/test_belos2.m b/katoptron/matlab/Belos/test_belos2.m
deleted file mode 100644
index a3b0bb196a9d14108451b76dfe7b6b893e0988c4..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos2.m
+++ /dev/null
@@ -1,41 +0,0 @@
-clc
-clear all
-[it_wo, res_wo] = read_belos('belos_without_prec.txt');
-[it_w, res_w] = read_belos('belos_with_prec.txt');
-close all
-
-
-figure
-semilogy(it_wo,res_wo,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_w,res_w,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-hold off
-
-figure
-
-H = show_trilinos_graph('matrix_after_bc.text');
-figure
-spy(H)
-
-H_sym = (H'+H)/2;
-HH = H*H';
-
-H_d_max = eigs(H, 1);
-H_d_min = eigs(H, 1, 'sm');
-
-H_sym_d_max = eigs(H_sym, 1);
-H_sym_d_min = eigs(H_sym, 1, 'sm');
-
-HH_d_max = eigs(HH, 1);
-HH_d_min = eigs(HH, 1, 'sm');
\ No newline at end of file
diff --git a/katoptron/matlab/Belos/test_belos3.m b/katoptron/matlab/Belos/test_belos3.m
deleted file mode 100644
index 4ef5180c94459a0bfac520040dd2478a1a0eceb5..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos3.m
+++ /dev/null
@@ -1,41 +0,0 @@
-clc
-clear all
-[it_wo, res_wo] = read_belos('belos.txt');
-close all
-
-
-figure
-semilogy(it_wo,res_wo,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-
-figure
-
-H = show_trilinos_graph('matrix_after_bc.text');
-figure
-spy(H)
-
-H_sym = (H'+H)/2;
-HH = H*H';
-
-H_d_max = eigs(H, 1);
-H_d_min = eigs(H, 1, 'sm');
-
-H_sym_d_max = eigs(H_sym, 1);
-H_sym_d_min = eigs(H_sym, 1, 'sm');
-
-HH_d_max = eigs(HH, 1);
-HH_d_min = eigs(HH, 1, 'sm');
-
-%%
-
-mu = H_sym_d_min;
-sigma = sqrt(HH_d_max);
-
-rate = sqrt(1-mu^2/sigma^2)
\ No newline at end of file
diff --git a/katoptron/matlab/Belos/test_belos4.m b/katoptron/matlab/Belos/test_belos4.m
deleted file mode 100644
index 88aa66644c94df5ac04b2586a38de236ec30a185..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos4.m
+++ /dev/null
@@ -1,84 +0,0 @@
-clc
-clear all
-[it_fg, res_fg] = read_belos('first_guess_belos_50it.text');
-[it_sg, res_sg] = read_belos('second_guess_belos_50it.text');
-
-[it_e1, res_e1] = read_belos('ensemble1_guess_belos_50it.text');
-[it_e2, res_e2] = read_belos('ensemble2_guess_belos_50it.text');
-[it_e3, res_e3] = read_belos('ensemble3_guess_belos_50it.text');
-[it_e4, res_e4] = read_belos('ensemble4_guess_belos_50it.text');
-close all
-
-
-figure
-semilogy(it_fg, res_fg,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_sg, res_sg,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-
-
-figure
-
-semilogy(it_fg, res_fg,'s','LineWidth',0.5,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_sg, res_sg,'s','LineWidth',0.5,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-
-semilogy(it_e1, res_e1,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-
-semilogy(it_e2, res_e2,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','y')
-semilogy(it_e3, res_e3,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','b')
-semilogy(it_e4, res_e4,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-
-
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-
-fg_sol = load('solution_first_guess.text');
-sg_sol = load('solution_second_guess.text');
-
-e1_sol = load('solution_e1_50it.text');
-e2_sol = load('solution_e2_50it.text');
-e3_sol = load('solution_e3_50it.text');
-e4_sol = load('solution_e4_50it.text');
-
-%%
-clc
-max(abs(e1_sol(:,1)-fg_sol))
-max(abs(e1_sol(:,2)-fg_sol))
-max(abs(e2_sol(:,1)-fg_sol))
-max(abs(e2_sol(:,2)-sg_sol))
-max(abs(e3_sol(:,1)-sg_sol))
-max(abs(e3_sol(:,2)-fg_sol))
-max(abs(e4_sol(:,1)-sg_sol))
-max(abs(e4_sol(:,2)-sg_sol))
\ No newline at end of file
diff --git a/katoptron/matlab/Belos/test_belos5.m b/katoptron/matlab/Belos/test_belos5.m
deleted file mode 100644
index 5e73867a88ecddfe625ae0f006bfd43ffb047c57..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos5.m
+++ /dev/null
@@ -1,43 +0,0 @@
-clc
-clear all
-[it_fg, res_fg] = read_belos('low_frequence_belos.text');
-[it_fgw, res_fgw] = read_belos('low_frequence_w_noise_belos.text');
-[it_sg, res_sg] = read_belos('high_frequence_belos.text');
-[it_sgw, res_sgw] = read_belos('high_frequence_w_noise_belos.text');
-[it_tg, res_tg] = read_belos('low_and_high_frequence_belos.text');
-[it_tgw, res_tgw] = read_belos('low_and_high_frequence_w_noise_belos.text');
-close all
-
-
-figure
-semilogy(it_fg, res_fg,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_fgw, res_fgw,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','r',...
-    'MarkerFaceColor','r')
-semilogy(it_sg, res_sg,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-semilogy(it_sgw, res_sgw,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','g',...
-    'MarkerFaceColor','g')
-semilogy(it_tg, res_tg,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','b')
-semilogy(it_tgw, res_tgw,'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','b',...
-    'MarkerFaceColor','b')
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-
diff --git a/katoptron/matlab/Belos/test_belos6.m b/katoptron/matlab/Belos/test_belos6.m
deleted file mode 100644
index cbad3c020f9aae96784cb419f12d3e037e2c06bf..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos6.m
+++ /dev/null
@@ -1,76 +0,0 @@
-close all
-clc
-clear all
-[it_1g, res_1g] = read_belos('multi_low_frequence_belos.text');
-[it_2g, res_2g] = read_belos('multi_high_frequence_belos.text');
-
-[it_3g, res_3g] = read_belos('multi_low_frequence_belos2.text');
-[it_4g, res_4g] = read_belos('multi_high_frequence_belos2.text');
-[it_5g, res_5g] = read_belos('multiFGuess_belos.text');
-[it_6g, res_6g] = read_belos('multiF2Guess_belos.text');
-
-[it_1e, res_1e] = read_belos('multi_frequence_ensemble1_belos.text');
-[it_2e, res_2e] = read_belos('multi_frequence_ensemble2_belos.text');
-
-[it_3e, res_3e] = read_belos('multi_frequence_ensemble3_belos.text');
-[it_4e, res_4e] = read_belos('multi_frequence_ensemble4_belos.text');
-
-
-%%
-close all
-figure
-semilogy(it_1g, res_1g,'o','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_2g, res_2g,'o','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-semilogy(it_3g, res_3g,'s','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-semilogy(it_4g, res_4g,'s','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-semilogy(it_5g, res_5g,'s','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','b')
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-hold off
-
-figure
-semilogy(it_1g, res_1g,'r','LineWidth',2)
-hold on
-semilogy(it_2g, res_2g,'g','LineWidth',2)
-semilogy(it_1e, res_1e,'o','LineWidth',0.5,...
-    'MarkerSize',16,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-semilogy(it_2e, res_2e,'o','LineWidth',0.5,...
-    'MarkerSize',16,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-semilogy(it_3e, res_3e,'s','LineWidth',0.5,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-semilogy(it_4e, res_4e,'s','LineWidth',0.5,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-hold off
diff --git a/katoptron/matlab/Belos/test_belos7.m b/katoptron/matlab/Belos/test_belos7.m
deleted file mode 100644
index fc0df41935be86ae0b7750025ec91d41d992a138..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos7.m
+++ /dev/null
@@ -1,204 +0,0 @@
-close all
-clc
-clear all
-
-Afull = load('matrixA.txt');
-A = sparse(Afull);
-
-b = load('vector_after_bc.text');
-
-if size(b,2) == 2
-    b = b(:,1);
-end
-
-solution_1it_ensemble1 = load('multi_frequence_ensemble1_belos_1it_solution.text');
-solution_1it_ensemble2 = load('multi_frequence_ensemble2_belos_1it_solution.text');
-solution_1it_ensemble3 = load('multi_frequence_ensemble3_belos_1it_solution.text');
-solution_1it_ensemble4 = load('multi_frequence_ensemble4_belos_1it_solution.text');
-
-guess_ensemble1 = load('multi_frequence_ensemble1_guess.text');
-guess_ensemble2 = load('multi_frequence_ensemble2_guess.text');
-guess_ensemble3 = load('multi_frequence_ensemble3_guess.text');
-guess_ensemble4 = load('multi_frequence_ensemble4_guess.text');
-
-[it_1e, res_1e] = read_belos('multi_frequence_ensemble1_belos_1it.text');
-[it_2e, res_2e] = read_belos('multi_frequence_ensemble2_belos_1it.text');
-
-[it_3e, res_3e] = read_belos('multi_frequence_ensemble3_belos_1it.text');
-[it_4e, res_4e] = read_belos('multi_frequence_ensemble4_belos_1it.text');
-
-
-%%
-close all
-figure
-semilogy(it_1e, res_1e,'o','LineWidth',0.5,...
-    'MarkerSize',16,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_2e, res_2e,'o','LineWidth',0.5,...
-    'MarkerSize',16,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-semilogy(it_3e, res_3e,'s','LineWidth',0.5,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-semilogy(it_4e, res_4e,'s','LineWidth',0.5,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-hold off
-
-%%
-format long
-solution_1it_ensemble1_1 = solution_1it_ensemble1(:,1);
-solution_1it_ensemble1_2 = solution_1it_ensemble1(:,2);
-
-solution_1it_ensemble2_1 = solution_1it_ensemble2(:,1);
-solution_1it_ensemble2_2 = solution_1it_ensemble2(:,2);
-
-solution_1it_ensemble3_1 = solution_1it_ensemble3(:,1);
-solution_1it_ensemble3_2 = solution_1it_ensemble3(:,2);
-
-solution_1it_ensemble4_1 = solution_1it_ensemble4(:,1);
-solution_1it_ensemble4_2 = solution_1it_ensemble4(:,2);
-
-guess_ensemble5 = guess_ensemble2;
-solution_1it_ensemble5 = [solution_1it_ensemble1(:,1),solution_1it_ensemble4(:,2)];
-
-norm_r0 = zeros(5,3);
-
-norm_r0(1,1) = norm(b-A*guess_ensemble1(:,1));
-norm_r0(1,2) = norm(b-A*guess_ensemble1(:,2));
-
-norm_r0(2,1) = norm(b-A*guess_ensemble2(:,1));
-norm_r0(2,2) = norm(b-A*guess_ensemble2(:,2));
-
-norm_r0(3,1) = norm(b-A*guess_ensemble3(:,1));
-norm_r0(3,2) = norm(b-A*guess_ensemble3(:,2));
-
-norm_r0(4,1) = norm(b-A*guess_ensemble4(:,1));
-norm_r0(4,2) = norm(b-A*guess_ensemble4(:,2));
-
-norm_r0(5,1) = norm(b-A*guess_ensemble5(:,1));
-norm_r0(5,2) = norm(b-A*guess_ensemble5(:,2));
-
-for i=1:5
-    norm_r0(i,3) = sqrt(norm_r0(i,1)^2+norm_r0(i,2)^2);
-end
-
-norm_1it = zeros(5,3);
-
-norm_1it(1,1) = norm(b-A*solution_1it_ensemble1_1);
-norm_1it(1,2) = norm(b-A*solution_1it_ensemble1_2);
-
-norm_1it(2,1) = norm(b-A*solution_1it_ensemble2_1);
-norm_1it(2,2) = norm(b-A*solution_1it_ensemble2_2);
-
-norm_1it(3,1) = norm(b-A*solution_1it_ensemble3_1);
-norm_1it(3,2) = norm(b-A*solution_1it_ensemble3_2);
-
-norm_1it(4,1) = norm(b-A*solution_1it_ensemble4_1);
-norm_1it(4,2) = norm(b-A*solution_1it_ensemble4_2);
-
-norm_1it(5,1) = norm(b-A*solution_1it_ensemble5(:,1));
-norm_1it(5,2) = norm(b-A*solution_1it_ensemble5(:,2));
-
-for i=1:5
-    norm_1it(i,3) = sqrt(norm_1it(i,1)^2+norm_1it(i,2)^2);
-end
-
-ratio_1it_r0 = zeros(5,4);
-for i=1:5
-    ratio_1it_r0(i,1:3) = norm_1it(i,:)./norm_r0(i,:);
-end
-
-ratio_1it_r0(1:4,4) = [res_1e(end);res_2e(end);res_3e(end);res_4e(end)];
-
-clc
-norm_r0
-norm_1it
-ratio_1it_r0
-
-c_1 = zeros(5,3);
-max_abs_error = zeros(5,3);
-
-for i =1:2
-    r0 = b-A*guess_ensemble1(:,i);
-    %r0 = r0 /norm(r0);
-    c_1(1,i) = r0'*(solution_1it_ensemble1(:,i)-guess_ensemble1(:,i))/norm(r0)^2;
-    max_abs_error(1,i) = max(abs(guess_ensemble1(:,i)+c_1(1,i)*r0-solution_1it_ensemble1(:,i)));
-end
-
-guess = [guess_ensemble1(:,1);guess_ensemble1(:,2)];
-r0 = [b-A*guess_ensemble1(:,1);b-A*guess_ensemble1(:,2)];
-sol = [solution_1it_ensemble1(:,1);solution_1it_ensemble1(:,2)];
-%r0 = r0 /norm(r0);
-c_1(1,3) = r0'*(sol-guess)/norm(r0)^2;
-max_abs_error(1,3) = max(abs(guess+c_1(1,3)*r0-sol));
-
-for i =1:2
-    r0 = b-A*guess_ensemble2(:,i);
-    %r0 = r0 /norm(r0);
-    c_1(2,i) = r0'*(solution_1it_ensemble2(:,i)-guess_ensemble2(:,i))/norm(r0)^2;
-    max_abs_error(2,i) = max(abs(guess_ensemble2(:,i)+c_1(2,i)*r0-solution_1it_ensemble2(:,i)));
-end
-
-guess = [guess_ensemble2(:,1);guess_ensemble2(:,2)];
-r0 = [b-A*guess_ensemble2(:,1);b-A*guess_ensemble2(:,2)];
-sol = [solution_1it_ensemble2(:,1);solution_1it_ensemble2(:,2)];
-%r0 = r0 /norm(r0);
-c_1(2,3) = r0'*(sol-guess)/norm(r0)^2;
-max_abs_error(2,3) = max(abs(guess+c_1(2,3)*r0-sol));
-
-for i =1:2
-    r0 = b-A*guess_ensemble3(:,i);
-    %r0 = r0 /norm(r0);
-    c_1(3,i) = r0'*(solution_1it_ensemble3(:,i)-guess_ensemble3(:,i))/norm(r0)^2;
-    max_abs_error(3,i) = max(abs(guess_ensemble3(:,i)+c_1(3,i)*r0-solution_1it_ensemble3(:,i)));
-end
-
-guess = [guess_ensemble3(:,1);guess_ensemble3(:,2)];
-r0 = [b-A*guess_ensemble3(:,1);b-A*guess_ensemble3(:,2)];
-sol = [solution_1it_ensemble3(:,1);solution_1it_ensemble3(:,2)];
-%r0 = r0 /norm(r0);
-c_1(3,3) = r0'*(sol-guess)/norm(r0)^2;
-max_abs_error(3,3) = max(abs(guess+c_1(3,3)*r0-sol));
-
-for i =1:2
-    r0 = b-A*guess_ensemble4(:,i);
-    %r0 = r0 /norm(r0);
-    c_1(4,i) = r0'*(solution_1it_ensemble4(:,i)-guess_ensemble4(:,i))/norm(r0)^2;
-    max_abs_error(4,i) = max(abs(guess_ensemble4(:,i)+c_1(4,i)*r0-solution_1it_ensemble4(:,i)));
-end
-
-guess = [guess_ensemble4(:,1);guess_ensemble4(:,2)];
-r0 = [b-A*guess_ensemble4(:,1);b-A*guess_ensemble4(:,2)];
-sol = [solution_1it_ensemble4(:,1);solution_1it_ensemble4(:,2)];
-%r0 = r0 /norm(r0);
-c_1(4,3) = r0'*(sol-guess)/norm(r0)^2;
-max_abs_error(4,3) = max(abs(guess+c_1(4,3)*r0-sol));
-
-for i =1:2
-    r0 = b-A*guess_ensemble5(:,i);
-    %r0 = r0 /norm(r0);
-    c_1(5,i) = r0'*(solution_1it_ensemble5(:,i)-guess_ensemble5(:,i))/norm(r0)^2;
-    max_abs_error(5,i) = max(abs(guess_ensemble5(:,i)+c_1(5,i)*r0-solution_1it_ensemble5(:,i)));
-end
-
-guess = [guess_ensemble5(:,1);guess_ensemble5(:,2)];
-r0 = [b-A*guess_ensemble5(:,1);b-A*guess_ensemble5(:,2)];
-sol = [solution_1it_ensemble5(:,1);solution_1it_ensemble5(:,2)];
-%r0 = r0 /norm(r0);
-c_1(5,3) = r0'*(sol-guess)/norm(r0)^2;
-max_abs_error(5,3) = max(abs(guess+c_1(5,3)*r0-sol));
-
-c_1
-max_abs_error
\ No newline at end of file
diff --git a/katoptron/matlab/Belos/test_belos8.m b/katoptron/matlab/Belos/test_belos8.m
deleted file mode 100644
index a157e5f189ecdd07460b8779bdef8a4e4d7335fc..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Belos/test_belos8.m
+++ /dev/null
@@ -1,25 +0,0 @@
-%close all
-clc
-clear all
-
-[it_1g, res_1g] = read_belos('multiFGuess_belos.text');
-[it_2g, res_2g] = read_belos('multiFGuess_belos_preconditioned.text');
-
-%%
-close all
-figure
-semilogy(it_1g, res_1g,'o','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r')
-hold on
-semilogy(it_2g, res_2g,'o','LineWidth',1,...
-    'MarkerSize',8,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','g')
-grid on
-box on
-set(gca,'fontsize',18)
-xlabel('Iteration')
-ylabel('(2-Norm Res Vec) / (2-Norm Prec Res0)')
-hold off
diff --git a/katoptron/matlab/CPU statistic/amesos2_klu2.mat b/katoptron/matlab/CPU statistic/amesos2_klu2.mat
deleted file mode 100644
index f00dacc8efdaaaef8c220acc2504d01acd889e18..0000000000000000000000000000000000000000
Binary files a/katoptron/matlab/CPU statistic/amesos2_klu2.mat and /dev/null differ
diff --git a/katoptron/matlab/CPU statistic/amesos_belos.mat b/katoptron/matlab/CPU statistic/amesos_belos.mat
deleted file mode 100644
index 7988f8339f14b60bbff74236cf804e5464f57e51..0000000000000000000000000000000000000000
Binary files a/katoptron/matlab/CPU statistic/amesos_belos.mat and /dev/null differ
diff --git a/katoptron/matlab/CPU statistic/cube_.tex b/katoptron/matlab/CPU statistic/cube_.tex
deleted file mode 100644
index ab7dfc3b54f4bc87c6017087ca60a8c1699895a4..0000000000000000000000000000000000000000
--- a/katoptron/matlab/CPU statistic/cube_.tex	
+++ /dev/null
@@ -1,238 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=6.027778in,
-height=4.669444in,
-at={(1.011111in,0.726389in)},
-scale only axis,
-xmin=1,
-xmax=200,
-xlabel={Number of linear iterations},
-xmajorgrids,
-ymin=0.3,
-ymax=1,
-ylabel={Scalability [-]},
-ymajorgrids,
-legend style={at={(0.97,0.03)},anchor=south east,legend cell align=left,align=left,draw=white!15!black}
-]
-\addplot [color=blue,solid,line width=2.0pt]
-  table[row sep=crcr]{%
-1	0.314102564102564\\
-2	0.411347517730496\\
-3	0.48030303030303\\
-4	0.531746031746032\\
-5	0.571596244131455\\
-6	0.60337552742616\\
-7	0.629310344827586\\
-8	0.650877192982456\\
-9	0.669093851132686\\
-10	0.684684684684685\\
-11	0.698179271708683\\
-12	0.70997375328084\\
-13	0.72037037037037\\
-14	0.72960372960373\\
-15	0.737858719646799\\
-16	0.745283018867924\\
-17	0.751996007984032\\
-18	0.758095238095238\\
-19	0.763661202185792\\
-20	0.768760907504363\\
-21	0.773450586264657\\
-22	0.777777777777778\\
-23	0.781782945736434\\
-24	0.785500747384155\\
-25	0.788961038961039\\
-26	0.792189679218968\\
-27	0.795209176788124\\
-28	0.798039215686274\\
-29	0.800697084917617\\
-30	0.80319803198032\\
-31	0.805555555555556\\
-32	0.807781649245064\\
-33	0.809887005649717\\
-34	0.811881188118812\\
-35	0.813772775991425\\
-36	0.815569487983281\\
-37	0.817278287461774\\
-38	0.818905472636816\\
-39	0.820456754130223\\
-40	0.821937321937322\\
-41	0.823351903435469\\
-42	0.824704813805631\\
-43	0.826\\
-44	0.827241079199304\\
-45	0.82843137254902\\
-46	0.829573934837093\\
-47	0.830671580671581\\
-48	0.831726907630522\\
-49	0.83274231678487\\
-50	0.833720030935808\\
-51	0.83466211085801\\
-52	0.835570469798658\\
-53	0.836446886446886\\
-54	0.837293016558675\\
-55	0.838110403397027\\
-56	0.838900487125957\\
-57	0.839664613278576\\
-58	0.84040404040404\\
-59	0.841119946984758\\
-60	0.841813437703849\\
-61	0.842485549132948\\
-62	0.843137254901961\\
-63	0.843769470404984\\
-64	0.844383057090239\\
-65	0.844978826376286\\
-66	0.845557543231962\\
-67	0.846119929453263\\
-68	0.846666666666667\\
-69	0.847198399085192\\
-70	0.847715736040609\\
-71	0.848219254312743\\
-72	0.848709500274574\\
-73	0.849186991869919\\
-74	0.849652220438737\\
-75	0.850105652403592\\
-76	0.850547730829421\\
-77	0.850978876867594\\
-78	0.851399491094148\\
-79	0.851809954751131\\
-80	0.852210630899156\\
-81	0.852601865488464\\
-82	0.852983988355167\\
-83	0.853357314148681\\
-84	0.853722143195828\\
-85	0.854078762306611\\
-86	0.854427445526194\\
-87	0.854768454837231\\
-88	0.855102040816327\\
-89	0.855428443248093\\
-90	0.855747891699956\\
-91	0.856060606060606\\
-92	0.856366797044763\\
-93	0.856666666666667\\
-94	0.856960408684547\\
-95	0.857248209018121\\
-96	0.85753024614101\\
-97	0.857806691449814\\
-98	0.858077709611452\\
-99	0.858343458890239\\
-100	0.858604091456077\\
-101	0.85885975367501\\
-102	0.859110586383314\\
-103	0.859356725146199\\
-104	0.859598300502124\\
-105	0.859835438193647\\
-106	0.860068259385665\\
-107	0.860296880871853\\
-108	0.860521415270019\\
-109	0.860741971207088\\
-110	0.860958653494329\\
-111	0.861171563293435\\
-112	0.861380798274002\\
-113	0.861586452762923\\
-114	0.861788617886179\\
-115	0.86198738170347\\
-116	0.862182829336114\\
-117	0.86237504308859\\
-118	0.862564102564103\\
-119	0.8627500847745\\
-120	0.862933064244871\\
-121	0.863113113113113\\
-122	0.86329030122476\\
-123	0.863464696223317\\
-124	0.863636363636364\\
-125	0.863805366957646\\
-126	0.863971767725377\\
-127	0.864135625596944\\
-128	0.864296998420221\\
-129	0.864455942301662\\
-130	0.864612511671335\\
-131	0.864766759345073\\
-132	0.86491873658387\\
-133	0.865068493150685\\
-134	0.865216077364763\\
-135	0.865361536153616\\
-136	0.86550491510277\\
-137	0.865646258503401\\
-138	0.865785609397944\\
-139	0.865923009623797\\
-140	0.866058499855199\\
-141	0.866192119643371\\
-142	0.866323907455013\\
-143	0.86645390070922\\
-144	0.866582135812905\\
-145	0.866708648194794\\
-146	0.866833472338059\\
-147	0.866956641811654\\
-148	0.867078189300412\\
-149	0.86719814663396\\
-150	0.867316544814514\\
-151	0.867433414043583\\
-152	0.867548783747661\\
-153	0.867662682602922\\
-154	0.867775138558987\\
-155	0.867886178861789\\
-156	0.86799583007558\\
-157	0.868104118104118\\
-158	0.868211068211068\\
-159	0.868316705039652\\
-160	0.868421052631579\\
-161	0.868524134445287\\
-162	0.868625973373524\\
-163	0.8687265917603\\
-164	0.868826011417225\\
-165	0.86892425363928\\
-166	0.869021339220015\\
-167	0.869117288466228\\
-168	0.869212121212121\\
-169	0.869305856832972\\
-170	0.869398514258327\\
-171	0.869490111984751\\
-172	0.869580668088131\\
-173	0.869670200235571\\
-174	0.869758725696885\\
-175	0.869846261355695\\
-176	0.869932823720176\\
-177	0.870018428933426\\
-178	0.870103092783505\\
-179	0.870186830713147\\
-180	0.870269657829141\\
-181	0.870351588911427\\
-182	0.870432638421879\\
-183	0.870512820512821\\
-184	0.870592149035263\\
-185	0.870670637546879\\
-186	0.870748299319728\\
-187	0.870825147347741\\
-188	0.870901194353963\\
-189	0.87097645279758\\
-190	0.871050934880722\\
-191	0.871124652555057\\
-192	0.871197617528185\\
-193	0.871269841269841\\
-194	0.871341335017898\\
-195	0.871412109784203\\
-196	0.871482176360225\\
-197	0.871551545322547\\
-198	0.871620227038184\\
-199	0.871688231669747\\
-200	0.871755569180462\\
-};
-\addlegendentry{Actual};
-
-\addplot [color=red,dashed,line width=2.0pt]
-  table[row sep=crcr]{%
-1	1\\
-200	1\\
-};
-\addlegendentry{Ideal};
-
-\end{axis}
-\end{tikzpicture}%
\ No newline at end of file
diff --git a/katoptron/matlab/CPU statistic/cube_test_nic4_distributed.m b/katoptron/matlab/CPU statistic/cube_test_nic4_distributed.m
deleted file mode 100644
index 8d3ca747241bd720a78798d9eb69282aac2a8885..0000000000000000000000000000000000000000
--- a/katoptron/matlab/CPU statistic/cube_test_nic4_distributed.m	
+++ /dev/null
@@ -1,182 +0,0 @@
-close all
-clc
-clear all
-
-np = 1:19;
-
-%222.9
-map = [0.1, 58.8, 27.9, 15.1, 10.2, 7.2, 5.2, 4.1, 3.3, 2.7, 2.3, 2.0, 1.6, 1.4, 1.3, 1.1, 1.0, 0.9, 0.8];
-graph = [75.4, 37.8, 27.0, 19.2, 15.7, 13.7, 11.5, 10.2, 8.7, 8.0, 7.5, 6.8, 6.4, 5.8, 5.4, 5.2, 5.0, 4.8, 4.5];
-assembly = [140.3, 71.6, 46.1, 35.9, 28.6, 23.9, 20.0, 17.9, 15.3, 13.9, 12.6, 11.7, 10.4, 10., 9.4, 8.5, 7.7, 7.5, 7.3];
-
-total = map+graph+assembly;
-
-line_width = 1.5;
-bar_width = 1;
-figure
-b1 = bar(np+0.5,map+graph+assembly,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(np+0.5,graph+assembly,bar_width,'g','LineWidth',line_width);
-b3 = bar(np+0.5,assembly,bar_width,'b','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Real CPU cost [sec]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,20])
-legend([b1,b2,b3],'Map','Graph','Matrix')
-%matlab2tikz('mpi_cube_real_CPU.tex')
-
-
-figure
-b1 = bar(np+0.5,(map+graph+assembly)./total,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(np+0.5,(graph+assembly)./total,bar_width,'g','LineWidth',line_width);
-b3 = bar(np+0.5,assembly./total,bar_width,'b','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Relative CPU cost [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,20])
-legend([b1,b2,b3],'Map','Graph','Matrix', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_relative_CPU.tex')
-
-% figure
-% b1 = bar(np+0.5,(map+graph+assembly).*np,bar_width,'r','LineWidth',line_width);
-% hold on 
-% b2 = bar(np+0.5,(graph+assembly).*np,bar_width,'g','LineWidth',line_width);
-% b3 = bar(np+0.5,(assembly).*np,bar_width,'b','LineWidth',line_width);
-% xlabel('MPI process')
-% ylabel('Used CPU cost [sec]')
-% set(gca,'fontsize',18)
-% grid on
-% box on
-% xlim([1,20])
-% legend([b1,b2,b3],'Map','Graph','Matrix')
-%matlab2tikz('mpi_cube_used_CPU.tex')
-
-line_width = 2;
-
-figure
-p1 = plot(np,total(1)./total,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(np,np,'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up.tex')
-
-figure
-p1 =plot(np,(total(1))./(total.*np),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,19],[1,1],'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability.tex')
-
-%%
-
-figure
-p1 = plot(np,assembly(1)./assembly,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(np,np,'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up.tex')
-
-figure
-p1 =plot(np,(assembly(1))./(assembly.*np),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,19],[1,1],'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability.tex')
-
-%%
-
-close all
-clc
-clear all
-
-np = 12;
-
-n_iter = linspace(1,200,200);
-
-map = [0.1,2.];
-graph = [75.4,6.8];
-assembly = [140.3,11.7];
-
-for i=1:length(n_iter)
-    total(i,:) = map(:)+graph(:)+n_iter(i)*assembly(:);
-end
-
-line_width = 2;
-
-figure
-p1 = plot(n_iter,total(:,1)./total(:,2),'-b',...
-                'LineWidth',line_width);
-hold on
-p2 = plot([1,max(n_iter)],[np,np],'r--','LineWidth',line_width);
-p3 = plot([1,max(n_iter)],[assembly(1)/assembly(2),assembly(1)/assembly(2)],'g--','LineWidth',line_width);
-xlabel('Number of linear iterations')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,max(n_iter)])
-ylim([10,12])
-legend([p1,p2,p3],'Actual','Ideal','Theoretical limit', 'Location','SouthEast')
-matlab2tikz('cube_linear_speed_mpi.tex')
-
-figure
-p1 =plot(n_iter,total(:,1)./(total(:,2)*np),'-b',...
-                'LineWidth',line_width);
-hold on
-p2 = plot([1,max(n_iter)],[1,1],'r--','LineWidth',line_width);
-p3 = plot([1,max(n_iter)],[assembly(1)/(np*assembly(2)),assembly(1)/(np*assembly(2))],'g--','LineWidth',line_width);
-xlabel('Number of linear iterations')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,max(n_iter)])
-ylim([0.8,1])
-legend([p1,p2,p3],'Actual','Ideal','Theoretical limit', 'Location','SouthEast')
-matlab2tikz('cube_linear_sca_mpi.tex')
-
diff --git a/katoptron/matlab/CPU statistic/cube_test_nic4_distributed_mean.m b/katoptron/matlab/CPU statistic/cube_test_nic4_distributed_mean.m
deleted file mode 100644
index bebb6835de99554e0d18219420a5c68704fd538c..0000000000000000000000000000000000000000
--- a/katoptron/matlab/CPU statistic/cube_test_nic4_distributed_mean.m	
+++ /dev/null
@@ -1,188 +0,0 @@
-close all
-clc
-clear all
-
-np = 1:19;
-
-%222.9
-map = [0.04, 47.54, 21.84, 12.75, 8.53, 5.76, 4.23, 3.42, 2.6, 2.15, 1.97, 3.25, 4.48, 1.23, 1.05, 3.55, 0.78, 3.58, 3.35];
-graph = [18.92, 12.99, 8.75, 7.55, 6.10, 5.03, 4.37, 3.94, 3.26, 3.03, 2.87, 3.95, 4.84, 2.24, 2.04, 3.81, 1.82, 4.01, 3.69];
-assembly = [51.54, 25.83, 17.31, 14.68, 11.63, 9.56, 8.48, 7.13, 5.94, 5.59, 5.10, 5.98, 8.32, 4.05, 3.74, 5.23, 3.36, 6.46, 6.01];
-export = [1.28, 1.09, 0.78, 0.64, 0.53, 0.45, 0.39, 0.35, 0.33, 0.29, 0.29, 0.35, 0.42, 0.23, 0.21, 0.2, 0.23, 0.35, 0.36];
-
-assembly = assembly + export;
-map = 0*map;
-% 10 error
-
-
-total = map+graph+assembly;
-
-line_width = 1.5;
-bar_width = 1;
-figure
-b1 = bar(np+0.5,map+graph+assembly,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(np+0.5,graph+assembly,bar_width,'g','LineWidth',line_width);
-b3 = bar(np+0.5,assembly,bar_width,'b','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Real CPU cost [sec]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,20])
-legend([b1,b2,b3],'Map','Graph','Matrix')
-%matlab2tikz('mpi_cube_real_CPU.tex')
-
-
-figure
-b1 = bar(np+0.5,(map+graph+assembly)./total,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(np+0.5,(graph+assembly)./total,bar_width,'g','LineWidth',line_width);
-b3 = bar(np+0.5,assembly./total,bar_width,'b','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Relative CPU cost [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,20])
-legend([b1,b2,b3],'Map','Graph','Matrix', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_relative_CPU.tex')
-
-% figure
-% b1 = bar(np+0.5,(map+graph+assembly).*np,bar_width,'r','LineWidth',line_width);
-% hold on 
-% b2 = bar(np+0.5,(graph+assembly).*np,bar_width,'g','LineWidth',line_width);
-% b3 = bar(np+0.5,(assembly).*np,bar_width,'b','LineWidth',line_width);
-% xlabel('MPI process')
-% ylabel('Used CPU cost [sec]')
-% set(gca,'fontsize',18)
-% grid on
-% box on
-% xlim([1,20])
-% legend([b1,b2,b3],'Map','Graph','Matrix')
-%matlab2tikz('mpi_cube_used_CPU.tex')
-
-line_width = 2;
-
-figure
-p1 = plot(np,total(1)./total,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(np,np,'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up.tex')
-
-figure
-p1 =plot(np,(total(1))./(total.*np),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,19],[1,1],'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability.tex')
-
-%%
-
-figure
-p1 = plot(np,assembly(1)./assembly,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(np,np,'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up.tex')
-
-figure
-p1 =plot(np,(assembly(1))./(assembly.*np),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,19],[1,1],'r--','LineWidth',line_width);
-xlabel('MPI process')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,19])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability.tex')
-
-%%
-
-close all
-clc
-clear all
-
-np = 12;
-
-n_iter = linspace(1,200,200);
-
-map = [0.1,2.];
-graph = [75.4,6.8];
-assembly = [140.3,11.7];
-
-for i=1:length(n_iter)
-    total(i,:) = map(:)+graph(:)+n_iter(i)*assembly(:);
-end
-
-line_width = 2;
-
-figure
-p1 = plot(n_iter,total(:,1)./total(:,2),'-b',...
-                'LineWidth',line_width);
-hold on
-p2 = plot([1,max(n_iter)],[np,np],'r--','LineWidth',line_width);
-p3 = plot([1,max(n_iter)],[assembly(1)/assembly(2),assembly(1)/assembly(2)],'g--','LineWidth',line_width);
-xlabel('Number of linear iterations')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,max(n_iter)])
-ylim([10,12])
-legend([p1,p2,p3],'Actual','Ideal','Theoretical limit', 'Location','SouthEast')
-matlab2tikz('cube_linear_speed_mpi.tex')
-
-figure
-p1 =plot(n_iter,total(:,1)./(total(:,2)*np),'-b',...
-                'LineWidth',line_width);
-hold on
-p2 = plot([1,max(n_iter)],[1,1],'r--','LineWidth',line_width);
-p3 = plot([1,max(n_iter)],[assembly(1)/(np*assembly(2)),assembly(1)/(np*assembly(2))],'g--','LineWidth',line_width);
-xlabel('Number of linear iterations')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,max(n_iter)])
-ylim([0.8,1])
-legend([p1,p2,p3],'Actual','Ideal','Theoretical limit', 'Location','SouthEast')
-matlab2tikz('cube_linear_sca_mpi.tex')
-
diff --git a/katoptron/matlab/CPU statistic/cube_test_nic4_shared.m b/katoptron/matlab/CPU statistic/cube_test_nic4_shared.m
deleted file mode 100644
index 498ceb2c9292a1cc2be441a97a9d2d15b7b51ed4..0000000000000000000000000000000000000000
--- a/katoptron/matlab/CPU statistic/cube_test_nic4_shared.m	
+++ /dev/null
@@ -1,283 +0,0 @@
-close all
-clc
-clear all
-
-np = 1;
-
-k = 1:8;
-
-map = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ,0.1, 0.1];
-graph = [75.4, 75.5, 60.8,60.4,74.2,73.8,73.6,73.6];
-assembly = [140.3, 74.0, 38.,28.6,30.1,25.0,21.4,19.0];
-
-total = map+graph+assembly;
-
-line_width = 1.5;
-bar_width = 1;
-figure
-b1 = bar(k+0.5,map+graph+assembly,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(k+0.5,graph+assembly,bar_width,'g','LineWidth',line_width);
-b3 = bar(k+0.5,assembly,bar_width,'b','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Real CPU cost [sec]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,9])
-legend([b1,b2,b3],'Map','Graph','Matrix')
-%matlab2tikz('mpi_cube_real_CPU_s1.tex')
-
-
-figure
-b1 = bar(k+0.5,(map+graph+assembly)./total,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(k+0.5,(graph+assembly)./total,bar_width,'g','LineWidth',line_width);
-b3 = bar(k+0.5,assembly./total,bar_width,'b','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Relative CPU cost [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,9])
-legend([b1,b2,b3],'Map','Graph','Matrix', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_relative_CPU_s1.tex')
-
-% figure
-% b1 = bar(np+0.5,(map+graph+assembly).*np,bar_width,'r','LineWidth',line_width);
-% hold on 
-% b2 = bar(np+0.5,(graph+assembly).*np,bar_width,'g','LineWidth',line_width);
-% b3 = bar(np+0.5,(assembly).*np,bar_width,'b','LineWidth',line_width);
-% xlabel('MPI process')
-% ylabel('Used CPU cost [sec]')
-% set(gca,'fontsize',18)
-% grid on
-% box on
-% xlim([1,20])
-% legend([b1,b2,b3],'Map','Graph','Matrix')
-%%matlab2tikz('mpi_cube_used_CPU.tex')
-
-line_width = 2;
-
-figure
-p1 = plot(k,total(1)./total,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(k,k,'r--','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,8])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up_s1.tex')
-
-figure
-p1 =plot(k,(total(1))./(total.*k),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,8],[1,1],'r--','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,8])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability_s1.tex')
-
-
-%%
-
-close all
-clc
-clear all
-
-np = 16;
-
-k = 1:6;
-
-
-map = [1.1, 1.1, 1.1, 2.6, 2.7,1.1];
-graph = [5.2, 5.2, 5.2, 10.8, 5.2,5.1];
-assembly = [8.5, 4.3, 3.0, 2.3, 1.6,1.6];
-
-total = map+graph+assembly;
-
-line_width = 1.5;
-bar_width = 1;
-figure
-b1 = bar(k+0.5,map+graph+assembly,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(k+0.5,graph+assembly,bar_width,'g','LineWidth',line_width);
-b3 = bar(k+0.5,assembly,bar_width,'b','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Real CPU cost [sec]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,9])
-legend([b1,b2,b3],'Map','Graph','Matrix')
-%matlab2tikz('mpi_cube_real_CPU_s2.tex')
-
-
-figure
-b1 = bar(k+0.5,(map+graph+assembly)./total,bar_width,'r','LineWidth',line_width);
-hold on 
-b2 = bar(k+0.5,(graph+assembly)./total,bar_width,'g','LineWidth',line_width);
-b3 = bar(k+0.5,assembly./total,bar_width,'b','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Relative CPU cost [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,9])
-legend([b1,b2,b3],'Map','Graph','Matrix', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_relative_CPU_s2.tex')
-
-% figure
-% b1 = bar(np+0.5,(map+graph+assembly).*np,bar_width,'r','LineWidth',line_width);
-% hold on 
-% b2 = bar(np+0.5,(graph+assembly).*np,bar_width,'g','LineWidth',line_width);
-% b3 = bar(np+0.5,(assembly).*np,bar_width,'b','LineWidth',line_width);
-% xlabel('MPI process')
-% ylabel('Used CPU cost [sec]')
-% set(gca,'fontsize',18)
-% grid on
-% box on
-% xlim([1,20])
-% legend([b1,b2,b3],'Map','Graph','Matrix')
-%%matlab2tikz('mpi_cube_used_CPU.tex')
-
-line_width = 2;
-
-figure
-p1 = plot(k,total(1)./total,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(k,k,'r--','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,8])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up_s2.tex')
-
-figure
-p1 =plot(k,(total(1))./(total.*k),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,8],[1,1],'r--','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,8])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability_s2.tex')
-
-%%
-
-figure
-p1 = plot(k,assembly(1)./assembly,'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot(k,k,'r--','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,8])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_speed_up_s2.tex')
-
-figure
-p1 =plot(k,(assembly(1))./(assembly.*k),'-bo',...
-                'LineWidth',line_width,...
-                'MarkerEdgeColor','b',...
-                'MarkerFaceColor',[.49 1 .63],...
-                'MarkerSize',10);
-hold on
-p2 = plot([1,8],[1,1],'r--','LineWidth',line_width);
-xlabel('Threads')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,8])
-legend([p1,p2],'Actual','Ideal', 'Location','SouthEast')
-%matlab2tikz('mpi_cube_scalability_s2.tex')
-
-
-%%
-
-close all
-clc
-clear all
-
-np = 16;
-k = 6;
-
-n_iter = linspace(1,500,200);
-
-map = [1.1,1.1];
-graph = [5.1,5.1];
-assembly = [8.5,1.6];
-
-for i=1:length(n_iter)
-    total(i,:) = map(:)+graph(:)+n_iter(i)*assembly(:);
-end
-
-line_width = 2;
-
-figure
-p1 = plot(n_iter,total(:,1)./total(:,2),'-b',...
-                'LineWidth',line_width);
-hold on
-p2 = plot([1,max(n_iter)],[k,k],'r--','LineWidth',line_width);
-p3 = plot([1,max(n_iter)],[assembly(1)/assembly(2),assembly(1)/assembly(2)],'g--','LineWidth',line_width);
-xlabel('Number of linear iterations')
-ylabel('Speedup [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,max(n_iter)])
-ylim([1,6])
-legend([p1,p2,p3],'Actual','Ideal','Theoretical limit', 'Location','SouthEast')
-%matlab2tikz('cube_linear_speed.tex')
-
-figure
-p1 =plot(n_iter,total(:,1)./(total(:,2)*k),'-b',...
-                'LineWidth',line_width);
-hold on
-p2 = plot([1,max(n_iter)],[1,1],'r--','LineWidth',line_width);
-p3 = plot([1,max(n_iter)],[assembly(1)/(6*assembly(2)),assembly(1)/(6*assembly(2))],'g--','LineWidth',line_width);
-xlabel('Number of linear iterations')
-ylabel('Efficiency [-]')
-set(gca,'fontsize',18)
-grid on
-box on
-xlim([1,max(n_iter)])
-ylim([0,1])
-legend([p1,p2,p3],'Actual','Ideal','Theoretical limit', 'Location','SouthEast')
-%matlab2tikz('cube_linear_sca.tex')
diff --git a/katoptron/matlab/CPU statistic/read_workspace.m b/katoptron/matlab/CPU statistic/read_workspace.m
deleted file mode 100644
index bdfd6a9ec6dcf8930b157c218511f043fd34c55b..0000000000000000000000000000000000000000
--- a/katoptron/matlab/CPU statistic/read_workspace.m	
+++ /dev/null
@@ -1,5 +0,0 @@
-function n = read_workspace(path, name, first_id, last_id)
-
-    
-
-end
\ No newline at end of file
diff --git a/katoptron/matlab/Krylov/createVandermond.m b/katoptron/matlab/Krylov/createVandermond.m
deleted file mode 100644
index 957c0fa8bcb392ac5394d1bf6c1689dfe7817d6e..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Krylov/createVandermond.m
+++ /dev/null
@@ -1,64 +0,0 @@
-clear all
-close all
-clc
-lambda = [1,1,1.0000001,1.000001,3.99999,4,4.00001];
-
-tol = 10^(-8);
-figure
-subplot(1,3,1)
-plot(lambda,ones(size(lambda)),'*')
-grid on
-axis equal
-m = length(lambda);
-
-%m = 10;
-n = 20;
-
-r_eig = ones(m,1);
-% lambda = ones(m,1);
-% for i=1:m
-%     lambda(i) = m+1-i;
-% end
-
-
-
-
-C_eig = zeros(m,n);
-C_eig(:,1) = r_eig;
-ranks = zeros(1,n); 
-ranks(1) = 1;
-
-for i=2:n
-    C_eig(:,i) = diag(lambda)*C_eig(:,i-1);
-    ranks(i) = rank(C_eig(:,1:i),tol);
-end
-
-subplot(1,3,2)
-plot(1:n,ranks,'*')
-xlim([1,n])
-ylim([1,n])
-grid on
-axis equal
-
-C_eig
-
-max_det = zeros(1,n);
-for i=1:n
-    if i > m
-        break
-    end
-    C = nchoosek(1:m,i);
-     
-    for j=1:size(C,1)
-        current_det = det(C_eig(C(j,:),1:i));
-        if current_det > max_det(i)
-            max_det(i) = current_det;
-        end
-    end
-end
-
-subplot(1,3,3)
-plot(1:n,max_det,'*')
-xlim([1,n])
-
-grid on
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/eigenvaluesOneDTest.m b/katoptron/matlab/Multigrid/eigenvaluesOneDTest.m
deleted file mode 100644
index c5f1b793635ba0d8fc7eec0611244d88a4bbd6d7..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/eigenvaluesOneDTest.m
+++ /dev/null
@@ -1,113 +0,0 @@
-clear all
-close all
-clc
-format long
-
-L = 1;
-n = 1:31;
-ni = [1,3,7,15,31];
-
-[ theta, eigenvaluesA, eigenvaluesAh] = oneDLaplacianEigenvalues( n, L );
-
-eigenvaluesAh(:,ni)
-
-figure
-subplot(2,2,1)
-hold on
-for i=1:length(n)
-    for j=1:n(i)
-        if j>(n(i)/2)
-            plot(i,eigenvaluesA(j,i),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','g',...
-            'MarkerFaceColor','g');
-        else
-            plot(i,eigenvaluesA(j,i),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','r',...
-            'MarkerFaceColor','r');
-        end
-    end
-end
-for i=1:(length(n)-1)
-    plot([i,i+1],[eigenvaluesA(n(i),i),eigenvaluesA(n(i+1),i+1)],'k','linewidth',2)
-    plot([i,i+1],[eigenvaluesA(1,i),eigenvaluesA(1,i+1)],'k','linewidth',2)
-end
-hold off
-grid on
-box on
-
-subplot(2,2,2)
-hold on
-for i=1:length(n)
-    for j=1:n(i)
-        if j>(n(i)/2)
-            plot(i,eigenvaluesAh(j,i),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','g',...
-            'MarkerFaceColor','g');
-        else
-            plot(i,eigenvaluesAh(j,i),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','r',...
-            'MarkerFaceColor','r');
-        end
-    end
-end
-for i=1:(length(n)-1)
-    plot([i,i+1],[eigenvaluesAh(n(i),i),eigenvaluesAh(n(i+1),i+1)],'k','linewidth',2)
-    plot([i,i+1],[eigenvaluesAh(1,i),eigenvaluesAh(1,i+1)],'k','linewidth',2)
-end
-hold off
-grid on
-box on
-
-subplot(2,2,3)
-hold on
-for i=1:length(ni)
-    for j=1:ni(i)
-        if j>(n(ni(i))/2)
-            plot(n(ni(i)),eigenvaluesA(j,ni(i)),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','g',...
-            'MarkerFaceColor','g');
-        else
-            plot(n(ni(i)),eigenvaluesA(j,ni(i)),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','r',...
-            'MarkerFaceColor','r');
-        end
-    end
-end
-for i=1:(length(n)-1)
-    plot([i,i+1],[eigenvaluesA(n(i),i),eigenvaluesA(n(i+1),i+1)],'k','linewidth',2)
-    plot([i,i+1],[eigenvaluesA(1,i),eigenvaluesA(1,i+1)],'k','linewidth',2)
-end
-hold off
-grid on
-box on
-
-subplot(2,2,4)
-hold on
-for i=1:length(ni)
-    for j=1:n(ni(i))
-        if j>(n(ni(i))/2)
-            plot(n(ni(i)),eigenvaluesAh(j,ni(i)),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','g',...
-            'MarkerFaceColor','g');
-        else
-            plot(n(ni(i)),eigenvaluesAh(j,ni(i)),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','r',...
-            'MarkerFaceColor','r');
-        end
-    end
-end
-for i=1:(length(n)-1)
-    plot([i,i+1],[eigenvaluesAh(n(i),i),eigenvaluesAh(n(i+1),i+1)],'k','linewidth',2)
-    plot([i,i+1],[eigenvaluesAh(1,i),eigenvaluesAh(1,i+1)],'k','linewidth',2)
-end
-hold off
-grid on
-box on
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/oneDLaplacianEigenvalues.m b/katoptron/matlab/Multigrid/oneDLaplacianEigenvalues.m
deleted file mode 100644
index 738ba5e7a3c980e5f80c3bd1e4a9c9cda1cf6447..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/oneDLaplacianEigenvalues.m
+++ /dev/null
@@ -1,17 +0,0 @@
-function [ theta, eigenvaluesA, eigenvaluesAh] = oneDLaplacianEigenvalues( n, L )
-
-theta = zeros(max(n),length(n));
-eigenvaluesA = zeros(max(n),length(n));
-eigenvaluesAh = zeros(max(n),length(n));
-
-for i=1:length(n)
-    h = L/(n(i)+1);
-
-    for k=1:n(i)
-        theta(k,i) = k*pi/(n(i)+1);
-        eigenvaluesA(k,i) = 4*sin(theta(k,i)/2)^2;
-        eigenvaluesAh(k,i) = eigenvaluesA(k,i)/h^2;
-    end
-end
-end
-
diff --git a/katoptron/matlab/Multigrid/oneDLaplacianMatrix.m b/katoptron/matlab/Multigrid/oneDLaplacianMatrix.m
deleted file mode 100644
index 6c765de6c645217e689b1b9999847c026ec7bd38..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/oneDLaplacianMatrix.m
+++ /dev/null
@@ -1,9 +0,0 @@
-function [ A,Ah,h ] = oneDLaplacianMatrix( n, L )
-
-    h = L/(n+1);
-    A = full(gallery('tridiag',n,-1,2,-1));
-    Ah = (1/h^2)*A;
-
-
-end
-
diff --git a/katoptron/matlab/Multigrid/oneDProlongation.m b/katoptron/matlab/Multigrid/oneDProlongation.m
deleted file mode 100644
index 40ccea79a00f70c41beafb0c05cc8e0f3353bc70..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/oneDProlongation.m
+++ /dev/null
@@ -1,10 +0,0 @@
-function [I_H_h,n2] = oneDProlongation(n)
-
-    n2 = (n-1)/2;
-    I_H_h = zeros(n,n2);
-    
-    for i=1:n2
-        I_H_h((2*(i-1))+(1:3),i) = [1;2;1];
-    end
-    I_H_h = I_H_h/2;
-end
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/oneDRestriction.m b/katoptron/matlab/Multigrid/oneDRestriction.m
deleted file mode 100644
index 63a0d07b87be68720fec78bb59646e985b84eb65..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/oneDRestriction.m
+++ /dev/null
@@ -1,10 +0,0 @@
-function [I_h_H,n2] = oneDRestriction(n)
-
-    n2 = (n-1)/2;
-    I_h_H = zeros(n2,n);
-    
-    for i=1:n2
-        I_h_H(i,(2*(i-1))+(1:3)) = [1,2,1];
-    end
-    I_h_H = I_h_H/4;
-end
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/read_agregate.m b/katoptron/matlab/Multigrid/read_agregate.m
deleted file mode 100644
index 051fa1e6614b5c400bc0968fee956341e65d4b2b..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/read_agregate.m
+++ /dev/null
@@ -1,20 +0,0 @@
-function [indices] = read_agregate(filename,agg_id,proc)
-
-    indices = [];
-
-    fid = fopen(filename);
-
-    line_start = ['Agg ',int2str(agg_id), ' Proc ', int2str(proc),':'];
-    tline = fgetl(fid);
-    while ischar(tline)
-        current_length = length(tline);
-        
-        if tline(1:length(line_start)) == line_start
-             indices = str2num(tline((length(line_start)+1):current_length));
-                
-             break
-        end
-        tline = fgetl(fid);
-    end
-    fclose(fid);
-end
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/richardsonSmoother.m b/katoptron/matlab/Multigrid/richardsonSmoother.m
deleted file mode 100644
index fdf159e97d36147be15f1445a2afa0ffc92c5aa8..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/richardsonSmoother.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function [x_new, S_nu] = richardsonSmoother(x_old,A,b,omega,nu)
-
-    I = eye(size(A));
-    S = I-omega*A;
-    g = omega*b;
-    
-    for i=1:nu
-        x_new = S*x_old+g;
-        x_old = x_new;
-    end
-    
-    S_nu = S^nu;
-end
-   
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/testOneDProlongation.m b/katoptron/matlab/Multigrid/testOneDProlongation.m
deleted file mode 100644
index dfbfc5795efa3cc1cd38cb7ac36c2b6eda318b95..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/testOneDProlongation.m
+++ /dev/null
@@ -1,96 +0,0 @@
-clear all
-close all
-clc
-format long
-
-L = 1;
-nH = 7;
-n = 2*nH+1;
-mode = 4;
-[ Ah,Ahh,h ] = oneDLaplacianMatrix( n, L );
-
-
-
-H = 2 *h;
-
-[I_h_H,n2] = oneDRestriction(n);
-[I_H_h,n2] = oneDProlongation(n);
-AH = I_h_H * Ah * I_H_h;
-
-
-
-[Vh,D] = eig(Ah);
-d = diag(D);
-[VH,DH] = eig(AH);
-
-
-V = zeros(n,n);
-for k =1:n
-    for i =1:n
-        V(i,k) = sin(i*k*pi/(n+1));
-    end
-end
-
-
-[Vh,Dh] = eig(Ah);
-
-tmp = diag(V'*Vh);
-for i=1:n
-   if tmp(i) < 0
-       Vh(:,i) = -Vh(:,i);
-   end
-end
-tmp = diag(VH'*I_h_H*Vh);
-for i=1:((n-1)/2)
-   VH(:,i) = VH(:,i)/tmp(i); % change the norm 
-end
-
-xH = VH(:,mode);
-maxx = max(abs(xH));
-xH = xH / maxx;
-
-xh = I_H_h * xH;
-
-figure
-subplot(2,3,1)
-plot([0:H:L],[0;xH;0],'o-','linewidth',2)
-
-box on 
-grid on
-subplot(2,3,2)
-plot([0:h:L],[0;xh;0],'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,3)
-plot([0:h:L],[0;xh;0],'o-','linewidth',2)
-hold on
-plot([0:H:L],[0;xH;0],'o-','linewidth',2)
-plot([0:H:L],[0;VH(:,mode);0]*norm([0;xH;0])/norm([0;VH(:,mode);0]),'o--','linewidth',2)
-box on 
-grid on
-subplot(2,3,4)
-
-plot(0:((n-1)/2-1),VH'*xH,'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,5)
-plot(0:(n-1),Vh'*xh,'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,6)
-plot(0:(n-1),Vh'*xh,'o-','linewidth',2)
-hold on
-plot(0:((n-1)/2-1),VH'*xH,'o-','linewidth',2)
-plot(0:((n-1)/2-1),VH'*VH(:,mode)*norm([0;xH;0])/norm([0;VH(:,mode);0]),'o--','linewidth',2)
-
-box on 
-grid on
-
-figure
-tmp = Vh'*xh;
-subplot(2,2,1)
-plot(0:(nH-1),VH'*xH,'o-','linewidth',2)
-subplot(2,2,2)
-plot(0:(nH-1),tmp(1:nH),'o-','linewidth',2)
-subplot(2,2,4)
-plot(0:(nH-1),tmp(n:-1:n-nH+1),'o-','linewidth',2)
diff --git a/katoptron/matlab/Multigrid/testOneDRestriction.m b/katoptron/matlab/Multigrid/testOneDRestriction.m
deleted file mode 100644
index 4680a02702fa017293fb1fd555d619079dbfcb4d..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/testOneDRestriction.m
+++ /dev/null
@@ -1,98 +0,0 @@
-
-clear all
-close all
-clc
-format long
-
-L = 1;
-n = 15;
-nH = (n-1)/2;
-mode = 12;
-[ Ah,Ahh,h ] = oneDLaplacianMatrix( n, L );
-
-
-
-H = 2 *h;
-
-[I_h_H,n2] = oneDRestriction(n);
-[I_H_h,n2] = oneDProlongation(n);
-AH = I_h_H * Ah * I_H_h;
-
-
-
-[Vh,D] = eig(Ah);
-d = diag(D);
-[VH,DH] = eig(AH);
-
-
-V = zeros(n,n);
-for k =1:n
-    for i =1:n
-        V(i,k) = sin(i*k*pi/(n+1));
-    end
-end
-
-
-[Vh,Dh] = eig(Ah);
-
-tmp = diag(V'*Vh);
-for i=1:n
-   if tmp(i) < 0
-       Vh(:,i) = -Vh(:,i);
-   end
-end
-tmp = diag(VH'*I_h_H*Vh);
-for i=1:((n-1)/2)
-   VH(:,i) = VH(:,i)/tmp(i); % change the norm 
-end
-
-xh = Vh(:,mode);
-maxx = max(abs(xh));
-xh = xh / maxx;
-
-xH = I_h_H * xh;
-
-figure
-subplot(2,3,1)
-plot([0:h:L],[0;xh;0],'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,2)
-plot([0:H:L],[0;xH;0],'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,3)
-plot([0:h:L],[0;xh;0],'o-','linewidth',2)
-hold on
-plot([0:H:L],[0;xH;0],'o-','linewidth',2)
-if mode <= size(VH,2)
-    plot([0:H:L],[0;VH(:,mode);0]*norm([0;xH;0])/norm([0;VH(:,mode);0]),'o--','linewidth',2)
-end
-box on 
-grid on
-subplot(2,3,4)
-plot(0:(n-1),Vh'*xh,'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,5)
-plot(0:((n-1)/2-1),VH'*xH,'o-','linewidth',2)
-box on 
-grid on
-subplot(2,3,6)
-plot(0:(n-1),Vh'*xh,'o-','linewidth',2)
-hold on
-plot(0:((n-1)/2-1),VH'*xH,'o-','linewidth',2)
-if mode <= size(VH,2)
-    plot(0:((n-1)/2-1),VH'*VH(:,mode)*norm([0;xH;0])/norm([0;VH(:,mode);0]),'o--','linewidth',2)
-end
-box on 
-grid on
-
-figure
-tmp = Vh'*xh;
-subplot(2,2,1)
-plot(0:(nH-1),tmp(1:nH),'o-','linewidth',2)
-subplot(2,2,3)
-plot(0:(nH-1),tmp(n:-1:n-nH+1),'o-','linewidth',2)
-subplot(2,2,2)
-plot(0:(nH-1),VH'*xH,'o-','linewidth',2)
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/testOneDTwoGridCycle.m b/katoptron/matlab/Multigrid/testOneDTwoGridCycle.m
deleted file mode 100644
index a3602964c3bd43cafe71ead95236ba5ebedc32fe..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/testOneDTwoGridCycle.m
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-clear all
-close all
-clc
-format long
-
-L = 1;
-n = 21;
-
-nu1 = 10;
-nu2 = 10;
-
-eigeninitialguess = 1;
-numeigenvectors = n;
-ndisplay = n*10;
-b_eigenvectors = [];%[1,12];
-b_coeff = [];%[1/20,4];
-
-omega = 1/4;
-dimension = 1;
-display = 0;
-
-%%
-[ Ah,Ahh,h ] = oneDLaplacianMatrix( n, L );
-
-V = zeros(n,n);
-for k =1:n
-    for i =1:n
-        V(i,k) = sin(i*k*pi/(n+1));
-    end
-end
-
-
-[Vh,Dh] = eig(Ah);
-
-tmp = diag(V'*Vh);
-for i=1:n
-   if tmp(i) < 0
-       Vh(:,i) = -Vh(:,i);
-   end
-end
-
-
-x = zeros(n,1);
-xdisplay = (linspace(0,1,ndisplay))';
-ydisplay = zeros(ndisplay,1);
-if eigeninitialguess
-    for k =1:numeigenvectors
-        x = x + sin(k*pi*(h:h:(L-h))');%Vh(:,k);
-        ydisplay = ydisplay + sin(k*pi*xdisplay);%+ max(Vh(:,k))*sin(k*pi*xdisplay)/max(sin(k*pi*xdisplay));
-    end
-else
-    x = rand(n,1)-0.5;%V(:,1)+V(:,5)+V(:,21)+V(:,29)+V(:,209);
-    maxx = max(abs(x));
-    x = x / maxx;
-end
-b =  zeros(size(x));
-for i =1:length(b_coeff) 
-    b = b + b_coeff(i)*sin(b_eigenvectors(i)*pi*(h:h:(L-h))');
-end
-
-x_old = x;
-[x,M,x1,xH1,xH,xcc,AH,I_h_H,I_H_h] = twoGridCycle(x,Ah,b,omega,nu1,nu2,dimension,display,L,h);
-x_new = x;
-
-max(abs(x))
-
-
-[VH,DH] = eig(AH);
-
-tmp = diag(VH'*I_h_H*Vh);
-for i=1:((n-1)/2)
-   VH(:,i) = VH(:,i)/tmp(i); % change the norm 
-end
-
-scrsz = get(groot,'Screensize');
-figure('Position',[1 1 scrsz(3) scrsz(4)])
-subplot(2,1,1)
-plot([0:h:L],[0;x_old;0],'linewidth',3)
-hold on
-plot([0:h:L],[0;x1;0],'linewidth',3)
-plot([0:2*h:L],[0;xH1;0],'linewidth',3)
-plot([0:2*h:L],[0;xH;0],'linewidth',3)
-plot([0:h:L],[0;xcc;0],'linewidth',3)
-
-box on 
-grid on 
-plot([0:h:L],[0;x_new;0],'linewidth',3)
-if eigeninitialguess
-    plot(xdisplay,ydisplay,'--','linewidth',2)
-end
-hold off
-legend('initial guess','smoothed guess','smoothed guess on coars mesh','coars mesh solution','coars corrected','smoothed corrected' ,'Location','northoutside','Orientation','horizontal')
-
-
-subplot(2,1,2)
-plot(0:(n-1),Vh'*x_old,'linewidth',3)
-hold on
-plot(0:(n-1),Vh'*x1,'linewidth',3)
-plot(0:((n-1)/2-1),VH'*xH1,'linewidth',3)
-plot(0:((n-1)/2-1),VH'*xH,'linewidth',3)
-plot(0:(n-1),Vh'*xcc,'linewidth',3)
-box on 
-grid on 
-plot(0:(n-1),Vh'*x_new,'linewidth',3)
-
-%plot(0:((n-1)/2-1),VH'*I_h_H*x_old,'linewidth',3)
-
-xlim([0,n-1])
-hold off
-
-
-B = Ah;
-[V,D] = eig(B);
-d = diag(D);
-figure
-subplot(2,3,1)
-plot(real(d),imag(d),'o')
-axis equal
-subplot(2,3,4)
-nbins = 100;
-hist(real(d),nbins)
-
-B = M;
-[V,D] = eig(B);
-d = diag(D);
-subplot(2,3,2)
-plot(real(d),imag(d),'o')
-axis equal
-subplot(2,3,5)
-nbins = 100;
-hist(real(d),nbins)
-
-B = M*Ah;
-[V,D] = eig(B);
-d = diag(D);
-subplot(2,3,3)
-plot(real(d),imag(d),'o')
-axis equal
-subplot(2,3,6)
-nbins = 100;
-hist(real(d),nbins)
-
-% B\(M*b)
-% Ah\b
-% x_new
-
diff --git a/katoptron/matlab/Multigrid/testRichardsonSmoother.m b/katoptron/matlab/Multigrid/testRichardsonSmoother.m
deleted file mode 100644
index 4361c424c44d82e2cb3ff92dbfbed3f0464aff58..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/testRichardsonSmoother.m
+++ /dev/null
@@ -1,33 +0,0 @@
-
-clear all
-close all
-clc
-format long
-
-L = 1;
-n = 100;
-[ A,Ah,h ] = oneDLaplacianMatrix( n, L );
-
-[V,D] = eig(A);
-d = diag(D);
-
-figure
-plot(d)
-
-
-x = V(:,1)+V(:,5)+V(:,52);
-maxx = max(abs(x));
-x = x / maxx;
-b = zeros(size(x));
-
-omega = 1/4;
-nu = 20;
-figure
-plot([0:h:L],[0;x;0],'linewidth',2)
-hold on
-for i=1:10
-    x = richardsonSmoother(x,A,b,omega,nu);
-    plot([0:h:L],[0;x;0],'linewidth',2)
-end
-box on 
-grid on
\ No newline at end of file
diff --git a/katoptron/matlab/Multigrid/twoGridCycle.m b/katoptron/matlab/Multigrid/twoGridCycle.m
deleted file mode 100644
index 08d6327a65c7b54ac93d0756cefbcf947d192e1c..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Multigrid/twoGridCycle.m
+++ /dev/null
@@ -1,101 +0,0 @@
-function [xh,M,x1,xH1,xH,xcc,AH,I_h_H,I_H_h] = twoGridCycle(xh,Ah,bh,omega,nu1,nu2,dimension,display,L,h)
-
-if display
-    scrsz = get(groot,'Screensize');
-    figure('Position',[1 scrsz(4)/2 scrsz(3) scrsz(4)/2])
-    plot([0:h:L],[0;xh;0],'linewidth',3)
-    hold on
-    box on 
-    grid on 
-end
-
-I = eye(size(Ah));
-
-n = size(Ah,1);
-if dimension == 1 
-    [I_h_H,n2] = oneDRestriction(n);
-    [I_H_h,n2] = oneDProlongation(n);
-end
-
-AH = I_h_H * Ah * I_H_h;
-
-S_nu1 = eye(size(Ah));
-if nu1 >= 1
-    [xh, S_nu1] = richardsonSmoother(xh,Ah,bh,omega,nu1);
-end
-
-x1 = xh;
-
-if display
-    plot([0:h:L],[0;xh;0],'linewidth',3)
-end
-
-rh = bh - Ah * xh;
-
-rH = I_h_H * rh;
-
-invAH = inv(AH);
-deltaH = invAH*rH;
-
-xH1 = I_h_H * xh;
-xH = xH1 + deltaH;
-
-
-xh = xh + I_H_h * deltaH;
-max(abs(xh - I_H_h * xH))
-%xh = I_H_h * xH;
-%xH = I_h_H * xh;
-max(abs(invAH*I_h_H*bh))
-max(abs(xH))
-
-xcc = xh;
-
-if display
-    plot([0:h:L],[0;xh;0],'linewidth',3)
-end
-
-S_nu2 = eye(size(Ah));
-if nu2 >= 1
-    [xh, S_nu2] = richardsonSmoother(xh,Ah,bh,omega,nu2);
-end
-
-if display
-    plot([0:h:L],[0;xh;0],'linewidth',3)
-    hold off
-    legend('initial guess','smoothed guess','coars corrected','smoothed corrected' ,'Location','northoutside','Orientation','horizontal')
-end
-
-disp '1'
-(I-I_H_h*invAH*I_h_H*Ah)*x1
-disp '2'
-xcc
-
-M = S_nu2*(I-I_H_h*invAH*I_h_H*Ah)*S_nu1;
-
-if display
-    rank(I_H_h*AH*I_h_H)
-    [V,D] = eig(I_H_h*AH*I_h_H);
-    [V,D2] = eig(I-inv(M)*Ah);%eig(I-I_H_h*invAH*I_h_H*Ah);
-    d = diag(D);    
-    figure('Position',[1 1 scrsz(3)/2 scrsz(4)/3])
-
-    plot(real(d),imag(d),'o','LineWidth',1,...
-            'MarkerSize',8,...
-            'MarkerEdgeColor','b',...
-            'MarkerFaceColor','b');
-    box on 
-    grid on   
-    
-    figure('Position',[scrsz(3)/2 1 scrsz(3)/2 scrsz(4)/3])
-    edges = [-0.01:0.02:1.01];
-    h = histogram(real(d),edges);
-%     d0 = find(d < 0.5);
-%     d1 = find(d > 0.5);
-%     plot([0,1],[length(d0),length(d1)],'o','LineWidth',1,...
-%             'MarkerSize',8,...
-%             'MarkerEdgeColor','b',...
-%             'MarkerFaceColor','b'); 
-    box on 
-    grid on   
-end
-end
\ No newline at end of file
diff --git a/katoptron/matlab/Richardson/oneDLaplacian.m b/katoptron/matlab/Richardson/oneDLaplacian.m
deleted file mode 100644
index ac4ac5f50887f3a9e639265e74df15a35f9e6970..0000000000000000000000000000000000000000
--- a/katoptron/matlab/Richardson/oneDLaplacian.m
+++ /dev/null
@@ -1,117 +0,0 @@
-clear all
-close all
-clc
-
-n = 10;
-nIter = n;
-A = full(gallery('tridiag',n,-1,2,-1));
-
-L = 1;
-l = linspace(0,L,n);
-h = l(2)-l(1);
-A = A*(1/h^2);
-A(1,1) = 1;
-A(1,2) = 0;
-A(end,end-1) = 0;
-A(end,end) = 1;
-
-b = zeros(n,1);
-
-[V,D] = eig(A);
-
-max(max(abs(A*V-V*D)))
-
-d = diag(D);
-%[d,indices] = sort(d,'descend');
-%V = V(:,indices);
-
-tau = 1/max(d);
-
-x = zeros(n,nIter);
-coef = zeros(n,nIter);
-x(:,1) = V(:,1);
-res = zeros(nIter,1);
-res(1) = norm(b - A*x(:,1));
-coef(:,1) = V'*x(:,1);
-for i=2:nIter
-    x(:,i) = x(:,i-1) + tau*(b - A*x(:,i-1));
-    res(i) = norm(b - A*x(:,i));
-    
-    coef(:,i) = V'*x(:,i);
-end
-
-figure
-subplot(2,2,1)
-ax = gca;
-plot(3,d(3),'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-hold on 
-for i=4:n
-    if ax.ColorOrderIndex > size(ax.ColorOrder,1)
-        ax.ColorOrderIndex = 1;
-    end    
-    plot(i,d(i),'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-end
-plot(1,d(1),'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r');
-plot(2,d(2),'o','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor','r');
-hold off
-xlim([1,n])
-
-subplot(2,2,2)
-ax = gca;
-plot(1:nIter,abs(coef(3,:)),'o-','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-hold on 
-for i=4:n
-    if ax.ColorOrderIndex > size(ax.ColorOrder,1)
-        ax.ColorOrderIndex = 1;
-    end
-    plot(1:nIter,abs(coef(i,:)),'o-','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-end
-hold off
-xlim([1,nIter])
-
-subplot(2,2,3)
-ax = gca;
-plot(l,x(:,1),'o-','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-hold on 
-for i=2:nIter
-    if ax.ColorOrderIndex > size(ax.ColorOrder,1)
-        ax.ColorOrderIndex = 1;
-    end
-    plot(l,x(:,i),'o-','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-end
-hold off
-
-subplot(2,2,4)
-ax = gca;
-plot(1:nIter,res,'o-','LineWidth',0.5,...
-    'MarkerSize',6,...
-    'MarkerEdgeColor','k',...
-    'MarkerFaceColor',ax.ColorOrder(ax.ColorOrderIndex,:));
-xlim([1,nIter])
-
-%  https://www.wolframalpha.com/input/?i=g(n%2B1)%3D(1-a)*g(n)%2Bb
-%  https://www.wolframalpha.com/input/?i=lim+n-%3Einf+((1-a)%5En+*(-a*b%2Ba*c%2Bb)%2B(a-1)*b)%2F((a-1)*a)+if+-1+%3C+(1-a)+%3C1
diff --git a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/.gitattributes b/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/.gitattributes
deleted file mode 100755
index e966fd74841ae613751173dc26d5eaf4b038b762..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Declare files that will always have CRLF line endings on checkout.
-*.* text eol=crlf
diff --git a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/LICENSE.TXT b/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/LICENSE.TXT
deleted file mode 100755
index d0381d6d04c77c78c42ae875f97d38483ba0c636..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/LICENSE.TXT
+++ /dev/null
@@ -1,176 +0,0 @@
-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
diff --git a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/README.md b/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/README.md
deleted file mode 100755
index 4f69245454843257b22b736a605bbf61852d848b..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-BrewerMap
-=========
-
-The complete palette of ColorBrewer colormaps for MATLAB. Simple selection by scheme name and map length.
-
-
-One function provides the complete selection of the ColorBrewer colorschemes, especially intended for mapping and plots with attractive, distinguishable colors.
-
-Simple to use: only the the colormap length and the colorscheme name are needed to select and define an output colormap. The colorscheme can be preselected by the user, after which only the colormap length is required to define an output colormap.
-
-The function can be used as a drop-in replacement for the inbuilt colormap functions and it is compatible with all MATLAB functions that require a colormap. The function consists of just one M-file that provides all of the ColorBrewer colorschemes (no mat file, no third party files, no file-clutter!). Downsampling or interpolation of the nodes occurs automatically, if required (interpolation occurs within the Lab colorspace). As an option, the colormap can be returned reversed.
-
-Calling brewermap('demo') creates a figure that displays all of the ColorBrewer colorschemes.
-
-This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). See the ColorBrewer website for further information about each colorscheme, colorblind suitability, licensing, and citations.
-
-### Examples ###
-
-    % Plot a scheme's RGB values:
-    rgbplot(brewermap(9,'Blues')) % standard
-    rgbplot(brewermap(9,'*Blues')) % reversed
-    
-    % View information about a colorscheme:
-    [~,num,typ] = brewermap(0,'Paired')
-    num = 12
-    typ = 'Qualitative'
-    
-    % Multiline plot using matrices:
-    N = 6;
-    axes('ColorOrder',brewermap(N,'Pastel2'),'NextPlot','replacechildren')
-    X = linspace(0,pi*3,1000);
-    Y = bsxfun(@(x,n)n*sin(x+2*n*pi/N), X.', 1:N);
-    plot(X,Y, 'linewidth',4)
-    
-    % Multiline plot in a loop:
-    N = 6;
-    set(0,'DefaultAxesColorOrder',brewermap(N,'Accent'))
-    X = linspace(0,pi*3,1000);
-    Y = bsxfun(@(x,n)n*sin(x+2*n*pi/N), X.', 1:N);
-    for n = 1:N
-    plot(X(:),Y(:,n), 'linewidth',4);
-    hold all
-    end
-    
-    % New colors for the COLORMAP example:
-    load spine
-    image(X)
-    colormap(brewermap([],'YlGnBu'))
-    
-    % New colors for the SURF example:
-    [X,Y,Z] = peaks(30);
-    surfc(X,Y,Z)
-    colormap(brewermap([],'RdYlGn'))
-    axis([-3,3,-3,3,-10,5])
-    
-    % New colors for the CONTOURCMAP example:
-    brewermap('PuOr'); % preselect the colorscheme.
-    load topo
-    load coast
-    figure
-    worldmap(topo, topolegend)
-    contourfm(topo, topolegend);
-    contourcmap('brewermap', 'Colorbar','on', 'Location','horizontal',...
-    'TitleString','Contour Intervals in Meters');
-    plotm(lat, long, 'k')
-
-### Note ###
-
-Note that the function BREWERMAP:
-* Consists of just one convenient M-file (no .mat files or file clutter).
-* No third-party file dependencies.
-* Interpolates in the Lab colorspace.
-* Requires just the standard ColorBrewer scheme name to select the colorscheme.
-* Supports all ColorBrewer colorschemes.
-* Outputs a MATLAB standard N-by-3 numeric RGB array.
-* Default length is the standard MATLAB default colormap length (same length as the current colormap).
-* Is compatible with all MATLAB functions that use colormaps (eg: CONTOURCMAP).
-* Includes the option to reverse the colormap color sequence.
-* Does not break ColorBrewer's Apache license conditions!
-
-### Note ###
-
-The following files are part of GitHub/git repository, and are not required for using this submission in MATLAB:
-* .gitattributes
-* README.md
diff --git a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/brewermap.m b/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/brewermap.m
deleted file mode 100755
index 4d2b0dc6afde6e8e1cf2ff0135f3a5f2c0dea33a..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/brewermap.m
+++ /dev/null
@@ -1,518 +0,0 @@
-function [map,num,typ] = brewermap(N,scheme)
-% The complete selection of ColorBrewer colorschemes (RGB colormaps).
-%
-% (c) 2017 Stephen Cobeldick
-%
-% Returns any RGB colormap from the ColorBrewer colorschemes, especially
-% intended for mapping and plots with attractive, distinguishable colors.
-%
-%%% Syntax (basic):
-%  map = brewermap(N,scheme); % Select colormap length, select any colorscheme.
-%  brewermap('demo')          % View a figure showing all ColorBrewer colorschemes.
-%  schemes = brewermap('list')% Return a list of all ColorBrewer colorschemes.
-%  [map,num,typ] = brewermap(...); % The current colorscheme's number of nodes and type.
-%
-%%% Syntax (preselect colorscheme):
-%  old = brewermap(scheme); % Preselect any colorscheme, return the previous scheme.
-%  map = brewermap(N);      % Use preselected scheme, select colormap length.
-%  map = brewermap;         % Use preselected scheme, length same as current figure's colormap.
-%
-% See also CUBEHELIX RGBPLOT3 RGBPLOT COLORMAP COLORBAR PLOT PLOT3 SURF IMAGE AXES SET JET LBMAP PARULA
-%
-%% Color Schemes %%
-%
-% This product includes color specifications and designs developed by Cynthia Brewer.
-% See the ColorBrewer website for further information about each colorscheme,
-% colour-blind suitability, licensing, and citations: http://colorbrewer.org/
-%
-% To reverse the colormap sequence simply prefix the string token with '*'.
-%
-% Each colorscheme is defined by a set of hand-picked RGB values (nodes).
-% If <N> is greater than the requested colorscheme's number of nodes then:
-%  * Sequential and Diverging schemes are interpolated to give a larger
-%    colormap. The interpolation is performed in the Lab colorspace.
-%  * Qualitative schemes are repeated to give a larger colormap.
-% Else:
-%  * Exact values from the ColorBrewer sequences are returned for all schemes.
-%
-%%% Diverging
-%
-% Scheme|'BrBG'|'PRGn'|'PiYG'|'PuOr'|'RdBu'|'RdGy'|'RdYlBu'|'RdYlGn'|'Spectral'|
-% ------|------|------|------|------|------|------|--------|--------|----------|
-% Nodes |  11  |  11  |  11  |  11  |  11  |  11  |   11   |   11   |    11    |
-%
-%%% Qualitative
-%
-% Scheme|'Accent'|'Dark2'|'Paired'|'Pastel1'|'Pastel2'|'Set1'|'Set2'|'Set3'|
-% ------|--------|-------|--------|---------|---------|------|------|------|
-% Nodes |   8    |   8   |   12   |    9    |    8    |   9  |  8   |  12  |
-%
-%%% Sequential
-%
-% Scheme|'Blues'|'BuGn'|'BuPu'|'GnBu'|'Greens'|'Greys'|'OrRd'|'Oranges'|'PuBu'|
-% ------|-------|------|------|------|--------|-------|------|---------|------|
-% Nodes |   9   |  9   |  9   |  9   |   9    |   9   |  9   |    9    |  9   |
-%
-% Scheme|'PuBuGn'|'PuRd'|'Purples'|'RdPu'|'Reds'|'YlGn'|'YlGnBu'|'YlOrBr'|'YlOrRd'|
-% ------|--------|------|---------|------|------|------|--------|--------|--------|
-% Nodes |   9    |  9   |    9    |  9   |  9   |  9   |   9    |   9    |   9    |
-%
-%% Examples %%
-%
-%%% Plot a scheme's RGB values:
-% rgbplot(brewermap(9,'Blues'))  % standard
-% rgbplot(brewermap(9,'*Blues')) % reversed
-%
-%%% View information about a colorscheme:
-% [~,num,typ] = brewermap(0,'Paired')
-% num = 12
-% typ = 'Qualitative'
-%
-%%% Multi-line plot using matrices:
-% N = 6;
-% axes('ColorOrder',brewermap(N,'Pastel2'),'NextPlot','replacechildren')
-% X = linspace(0,pi*3,1000);
-% Y = bsxfun(@(x,n)n*sin(x+2*n*pi/N), X(:), 1:N);
-% plot(X,Y, 'linewidth',4)
-%
-%%% Multi-line plot in a loop:
-% N = 6;
-% set(0,'DefaultAxesColorOrder',brewermap(N,'Accent'))
-% X = linspace(0,pi*3,1000);
-% Y = bsxfun(@(x,n)n*sin(x+2*n*pi/N), X(:), 1:N);
-% for n = 1:N
-%     plot(X(:),Y(:,n), 'linewidth',4);
-%     hold all
-% end
-%
-%%% New colors for the COLORMAP example:
-% load spine
-% image(X)
-% colormap(brewermap([],'YlGnBu'))
-%
-%%% New colors for the SURF example:
-% [X,Y,Z] = peaks(30);
-% surfc(X,Y,Z)
-% colormap(brewermap([],'RdYlGn'))
-% axis([-3,3,-3,3,-10,5])
-%
-%%% New colors for the CONTOURCMAP example:
-% brewermap('PuOr'); % preselect the colorscheme.
-% load topo
-% load coast
-% figure
-% worldmap(topo, topolegend)
-% contourfm(topo, topolegend);
-% contourcmap('brewermap', 'Colorbar','on', 'Location','horizontal',...
-% 'TitleString','Contour Intervals in Meters');
-% plotm(lat, long, 'k')
-%
-%% Input and Output Arguments %%
-%
-%%% Inputs (*=default):
-% N = NumericScalar, N>=0, an integer to define the colormap length.
-%   = *[], use the length of the current figure's colormap (see COLORMAP).
-%   = StringToken, to preselect this ColorBrewer scheme for later use.
-%   = 'demo', create a figure showing all of the ColorBrewer schemes.
-%   = 'list', return a cell array of strings listing all ColorBrewer schemes.
-% scheme = StringToken, a ColorBrewer scheme name to select the colorscheme.
-%        = *none, use the preselected colorscheme (must be set previously!).
-%
-%%% Outputs:
-% map = NumericMatrix, size Nx3, a colormap of RGB values between 0 and 1.
-% num = NumericScalar, the number of nodes defining the ColorBrewer scheme.
-% typ = String, the colorscheme type: 'Diverging'/'Qualitative'/'Sequential'.
-% OR
-% schemes = CellArray of Strings, a list of every ColorBrewer scheme.
-%
-% [map,num,typ] = brewermap(*N,*scheme)
-% OR
-% schemes = brewermap('list')
-
-%% Input Wrangling %%
-%
-persistent tok isr
-%
-str = 'A colorscheme must be preselected before calling without a scheme token.';
-%
-% The order of names in <vec>: case-insensitive sort by type and then by name:
-vec = {'BrBG';'PiYG';'PRGn';'PuOr';'RdBu';'RdGy';'RdYlBu';'RdYlGn';'Spectral';'Accent';'Dark2';'Paired';'Pastel1';'Pastel2';'Set1';'Set2';'Set3';'Blues';'BuGn';'BuPu';'GnBu';'Greens';'Greys';'OrRd';'Oranges';'PuBu';'PuBuGn';'PuRd';'Purples';'RdPu';'Reds';'YlGn';'YlGnBu';'YlOrBr';'YlOrRd'};
-%
-if nargin==0 % Current figure's colormap length and the preselected colorscheme.
-	assert(~isempty(tok),str)
-	[map,num,typ] = bmSample([],isr,tok);
-elseif nargin==2 % Input colormap length and colorscheme.
-	assert(isnumeric(N),'The first argument must be a scalar numeric, or empty.')
-	assert(ischar(scheme)&&isrow(scheme),'The second argument must be a string.')
-	tmp = strncmp('*',scheme,1);
-	[map,num,typ] = bmSample(N,tmp,bmMatch(vec,scheme(1+tmp:end)));
-elseif isnumeric(N) % Input colormap length and the preselected colorscheme.
-	assert(~isempty(tok),str)
-	[map,num,typ] = bmSample(N,isr,tok);
-else% String
-	assert(ischar(N)&&isrow(N),'The first argument must be a string or scalar numeric.')
-	switch lower(N)
-		case 'demo' % Plot all colorschemes in a figure.
-			bmDemoFig(vec)
-		case 'list' % Return a list of all colorschemes.
-			[num,typ] = cellfun(@bmSelect,vec,'UniformOutput',false);
-			num = cat(1,num{:});
-			map = vec;
-		otherwise % Store the preselected colorscheme token.
-			map = tok;
-			tmp = strncmp('*',N,1);
-			tok = bmMatch(vec,N(1+tmp:end));
-			[num,typ] = bmSelect(tok);
-			isr = tmp; % only update |isr| when name is okay.
-	end
-end
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%brewermap
-function tok = bmMatch(vec,str)
-idx = strcmpi(vec,str);
-assert(any(idx),'Colorscheme "%s" is not supported. Check the token tables.',str)
-tok = vec{idx};
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmMatch
-function [map,num,typ] = bmSample(N,isr,tok)
-% Pick a colorscheme, downsample/interpolate to the requested colormap length.
-%
-if isempty(N)
-	N = size(get(gcf,'colormap'),1);
-else
-	assert(isscalar(N)&&isreal(N),'First argument must be a real numeric scalar, or empty.')
-end
-%
-% obtain nodes:
-[num,typ,rgb] = bmSelect(tok);
-% downsample:
-[idx,itp] = bmIndex(N,num,typ,isr);
-map = rgb(idx,:);
-% interpolate:
-if itp
-	M = [3.2406,-1.5372,-0.4986;-0.9689,1.8758,0.0415;0.0557,-0.2040,1.0570];
-	wpt = [0.95047,1,1.08883]; % D65
-	%
-	map = bmRGB2Lab(map,M,wpt); % optional
-	%
-	% Extrapolate a small amount at both ends:
-	%vec = linspace(0,num+1,N+2);
-	%map = interp1(1:num,map,vec(2:end-1),'linear','extrap');
-	% Interpolation completely within ends:
-	map = interp1(1:num,map,linspace(1,num,N),'spline');
-	%
-	map = bmLab2RGB(map,M,wpt); % optional
-end
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmSample
-function rgb = bmGammaCor(rgb)
-% Gamma correction of RGB data.
-idx = rgb <= 0.0031308;
-rgb(idx) = 12.92 * rgb(idx);
-rgb(~idx) = real(1.055 * rgb(~idx).^(1/2.4) - 0.055);
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmGammaCor
-function rgb = bmGammaInv(rgb)
-% Inverse gamma correction of RGB data.
-idx = rgb <= 0.04045;
-rgb(idx) = rgb(idx) / 12.92;
-rgb(~idx) = real(((rgb(~idx) + 0.055) / 1.055).^2.4);
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmGammaInv
-function lab = bmRGB2Lab(rgb,M,wpt) % Nx3 <- Nx3
-% Convert a matrix of RGB values to Lab.
-%
-%applycform(rgb,makecform('srgb2lab','AdaptedWhitePoint',wpt))
-%
-% RGB2XYZ:
-xyz = (M \ bmGammaInv(rgb.')).';
-% Remember to include my license when copying my implementation.
-% XYZ2Lab:
-xyz = bsxfun(@rdivide,xyz,wpt);
-idx = xyz>(6/29)^3;
-F = idx.*(xyz.^(1/3)) + ~idx.*(xyz*(29/6)^2/3+4/29);
-lab(:,2:3) = bsxfun(@times,[500,200],F(:,1:2)-F(:,2:3));
-lab(:,1) = 116*F(:,2) - 16;
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmRGB2Lab
-function rgb = bmLab2RGB(lab,M,wpt) % Nx3 <- Nx3
-% Convert a matrix of Lab values to RGB.
-%
-%applycform(lab,makecform('lab2srgb','AdaptedWhitePoint',wpt))
-%
-% Lab2XYZ
-tmp = bsxfun(@rdivide,lab(:,[2,1,3]),[500,Inf,-200]);
-tmp = bsxfun(@plus,tmp,(lab(:,1)+16)/116);
-idx = tmp>(6/29);
-tmp = idx.*(tmp.^3) + ~idx.*(3*(6/29)^2*(tmp-4/29));
-xyz = bsxfun(@times,tmp,wpt);
-% Remember to include my license when copying my implementation.
-% XYZ2RGB
-rgb = max(0,min(1, bmGammaCor(xyz * M.')));
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%cbLab2RGB
-function bmDemoFig(seq)
-% Creates a figure showing all of the ColorBrewer colorschemes.
-%
-persistent cbh axh
-%
-xmx = max(cellfun(@bmSelect,seq));
-ymx = numel(seq);
-%
-if ishghandle(cbh)
-	figure(cbh);
-	delete(axh);
-else
-	cbh = figure('HandleVisibility','callback', 'IntegerHandle','off',...
-		'NumberTitle','off', 'Name',[mfilename,' Demo'],'Color','white');
-end
-%
-axh = axes('Parent',cbh, 'Color','none',...
-	'XTick',0:xmx, 'YTick',0.5:ymx, 'YTickLabel',seq, 'YDir','reverse');
-title(axh,['ColorBrewer Color Schemes (',mfilename,'.m)'], 'Interpreter','none')
-xlabel(axh,'Scheme Nodes')
-ylabel(axh,'Scheme Name')
-axf = get(axh,'FontName');
-%
-for y = 1:ymx
-	[num,typ,rgb] = bmSelect(seq{y});
-	map = rgb(bmIndex(num,num,typ,false),:); % downsample
-	for x = 1:num
-		patch([x-1,x-1,x,x],[y-1,y,y,y-1],1, 'FaceColor',map(x,:), 'Parent',axh)
-	end
-	text(xmx+0.1,y-0.5,typ, 'Parent',axh, 'FontName',axf)
-end
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmDemoFig
-function [idx,itp] = bmIndex(N,num,typ,isr)
-% Ensure exactly the same colors as in the online ColorBrewer schemes.
-%
-itp = N>num;
-switch typ
-	case 'Qualitative'
-		itp = false;
-		idx = 1+mod(0:N-1,num);
-	case 'Diverging'
-		switch N
-			case 1 % extrapolated
-				idx = 8;
-			case 2 % extrapolated
-				idx = [4,12];
-			case 3
-				idx = [5,8,11];
-			case 4
-				idx = [3,6,10,13];
-			case 5
-				idx = [3,6,8,10,13];
-			case 6
-				idx = [2,5,7,9,11,14];
-			case 7
-				idx = [2,5,7,8,9,11,14];
-			case 8
-				idx = [2,4,6,7,9,10,12,14];
-			case 9
-				idx = [2,4,6,7,8,9,10,12,14];
-			case 10
-				idx = [1,2,4,6,7,9,10,12,14,15];
-			otherwise
-				idx = [1,2,4,6,7,8,9,10,12,14,15];
-		end
-	case 'Sequential'
-		switch N
-			case 1 % extrapolated
-				idx = 6;
-			case 2 % extrapolated
-				idx = [4,8];
-			case 3
-				idx = [3,6,9];
-			case 4
-				idx = [2,5,7,10];
-			case 5
-				idx = [2,5,7,9,11];
-			case 6
-				idx = [2,4,6,7,9,11];
-			case 7
-				idx = [2,4,6,7,8,10,12];
-			case 8
-				idx = [1,3,4,6,7,8,10,12];
-			otherwise
-				idx = [1,3,4,6,7,8,10,11,13];
-		end
-	otherwise
-		error('The colorscheme type "%s" is not recognized',typ)
-end
-%
-if isr
-	idx = idx(end:-1:1);
-end
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmIndex
-function [num,typ,rgb] = bmSelect(tok)
-% Return the length, type and RGB values of any colorscheme.
-%
-switch tok % ColorName
-	case 'BrBG'
-		rgb = [84,48,5;140,81,10;166,97,26;191,129,45;216,179,101;223,194,125;246,232,195;245,245,245;199,234,229;128,205,193;90,180,172;53,151,143;1,133,113;1,102,94;0,60,48];
-		typ = 'Diverging';
-	case 'PiYG'
-		rgb = [142,1,82;197,27,125;208,28,139;222,119,174;233,163,201;241,182,218;253,224,239;247,247,247;230,245,208;184,225,134;161,215,106;127,188,65;77,172,38;77,146,33;39,100,25];
-		typ = 'Diverging';
-	case 'PRGn'
-		rgb = [64,0,75;118,42,131;123,50,148;153,112,171;175,141,195;194,165,207;231,212,232;247,247,247;217,240,211;166,219,160;127,191,123;90,174,97;0,136,55;27,120,55;0,68,27];
-		typ = 'Diverging';
-	case 'PuOr'
-		rgb = [127,59,8;179,88,6;230,97,1;224,130,20;241,163,64;253,184,99;254,224,182;247,247,247;216,218,235;178,171,210;153,142,195;128,115,172;94,60,153;84,39,136;45,0,75];
-		typ = 'Diverging';
-	case 'RdBu'
-		rgb = [103,0,31;178,24,43;202,0,32;214,96,77;239,138,98;244,165,130;253,219,199;247,247,247;209,229,240;146,197,222;103,169,207;67,147,195;5,113,176;33,102,172;5,48,97];
-		typ = 'Diverging';
-	case 'RdGy'
-		rgb = [103,0,31;178,24,43;202,0,32;214,96,77;239,138,98;244,165,130;253,219,199;255,255,255;224,224,224;186,186,186;153,153,153;135,135,135;64,64,64;77,77,77;26,26,26];
-		typ = 'Diverging';
-	case 'RdYlBu'
-		rgb = [165,0,38;215,48,39;215,25,28;244,109,67;252,141,89;253,174,97;254,224,144;255,255,191;224,243,248;171,217,233;145,191,219;116,173,209;44,123,182;69,117,180;49,54,149];
-		typ = 'Diverging';
-	case 'RdYlGn'
-		rgb = [165,0,38;215,48,39;215,25,28;244,109,67;252,141,89;253,174,97;254,224,139;255,255,191;217,239,139;166,217,106;145,207,96;102,189,99;26,150,65;26,152,80;0,104,55];
-		typ = 'Diverging';
-	case 'Spectral'
-		rgb = [158,1,66;213,62,79;215,25,28;244,109,67;252,141,89;253,174,97;254,224,139;255,255,191;230,245,152;171,221,164;153,213,148;102,194,165;43,131,186;50,136,189;94,79,162];
-		typ = 'Diverging';
-	case 'Accent'
-		rgb = [127,201,127;190,174,212;253,192,134;255,255,153;56,108,176;240,2,127;191,91,23;102,102,102];
-		typ = 'Qualitative';
-	case 'Dark2'
-		rgb = [27,158,119;217,95,2;117,112,179;231,41,138;102,166,30;230,171,2;166,118,29;102,102,102];
-		typ = 'Qualitative';
-	case 'Paired'
-		rgb = [166,206,227;31,120,180;178,223,138;51,160,44;251,154,153;227,26,28;253,191,111;255,127,0;202,178,214;106,61,154;255,255,153;177,89,40];
-		typ = 'Qualitative';
-	case 'Pastel1'
-		rgb = [251,180,174;179,205,227;204,235,197;222,203,228;254,217,166;255,255,204;229,216,189;253,218,236;242,242,242];
-		typ = 'Qualitative';
-	case 'Pastel2'
-		rgb = [179,226,205;253,205,172;203,213,232;244,202,228;230,245,201;255,242,174;241,226,204;204,204,204];
-		typ = 'Qualitative';
-	case 'Set1'
-		rgb = [228,26,28;55,126,184;77,175,74;152,78,163;255,127,0;255,255,51;166,86,40;247,129,191;153,153,153];
-		typ = 'Qualitative';
-	case 'Set2'
-		rgb = [102,194,165;252,141,98;141,160,203;231,138,195;166,216,84;255,217,47;229,196,148;179,179,179];
-		typ = 'Qualitative';
-	case 'Set3'
-		rgb = [141,211,199;255,255,179;190,186,218;251,128,114;128,177,211;253,180,98;179,222,105;252,205,229;217,217,217;188,128,189;204,235,197;255,237,111];
-		typ = 'Qualitative';
-	case 'Blues'
-		rgb = [247,251,255;239,243,255;222,235,247;198,219,239;189,215,231;158,202,225;107,174,214;66,146,198;49,130,189;33,113,181;8,81,156;8,69,148;8,48,107];
-		typ = 'Sequential';
-	case 'BuGn'
-		rgb = [247,252,253;237,248,251;229,245,249;204,236,230;178,226,226;153,216,201;102,194,164;65,174,118;44,162,95;35,139,69;0,109,44;0,88,36;0,68,27];
-		typ = 'Sequential';
-	case 'BuPu'
-		rgb = [247,252,253;237,248,251;224,236,244;191,211,230;179,205,227;158,188,218;140,150,198;140,107,177;136,86,167;136,65,157;129,15,124;110,1,107;77,0,75];
-		typ = 'Sequential';
-	case 'GnBu'
-		rgb = [247,252,240;240,249,232;224,243,219;204,235,197;186,228,188;168,221,181;123,204,196;78,179,211;67,162,202;43,140,190;8,104,172;8,88,158;8,64,129];
-		typ = 'Sequential';
-	case 'Greens'
-		rgb = [247,252,245;237,248,233;229,245,224;199,233,192;186,228,179;161,217,155;116,196,118;65,171,93;49,163,84;35,139,69;0,109,44;0,90,50;0,68,27];
-		typ = 'Sequential';
-	case 'Greys'
-		rgb = [255,255,255;247,247,247;240,240,240;217,217,217;204,204,204;189,189,189;150,150,150;115,115,115;99,99,99;82,82,82;37,37,37;37,37,37;0,0,0];
-		typ = 'Sequential';
-	case 'OrRd'
-		rgb = [255,247,236;254,240,217;254,232,200;253,212,158;253,204,138;253,187,132;252,141,89;239,101,72;227,74,51;215,48,31;179,0,0;153,0,0;127,0,0];
-		typ = 'Sequential';
-	case 'Oranges'
-		rgb = [255,245,235;254,237,222;254,230,206;253,208,162;253,190,133;253,174,107;253,141,60;241,105,19;230,85,13;217,72,1;166,54,3;140,45,4;127,39,4];
-		typ = 'Sequential';
-	case 'PuBu'
-		rgb = [255,247,251;241,238,246;236,231,242;208,209,230;189,201,225;166,189,219;116,169,207;54,144,192;43,140,190;5,112,176;4,90,141;3,78,123;2,56,88];
-		typ = 'Sequential';
-	case 'PuBuGn'
-		rgb = [255,247,251;246,239,247;236,226,240;208,209,230;189,201,225;166,189,219;103,169,207;54,144,192;28,144,153;2,129,138;1,108,89;1,100,80;1,70,54];
-		typ = 'Sequential';
-	case 'PuRd'
-		rgb = [247,244,249;241,238,246;231,225,239;212,185,218;215,181,216;201,148,199;223,101,176;231,41,138;221,28,119;206,18,86;152,0,67;145,0,63;103,0,31];
-		typ = 'Sequential';
-	case 'Purples'
-		rgb = [252,251,253;242,240,247;239,237,245;218,218,235;203,201,226;188,189,220;158,154,200;128,125,186;117,107,177;106,81,163;84,39,143;74,20,134;63,0,125];
-		typ = 'Sequential';
-	case 'RdPu'
-		rgb = [255,247,243;254,235,226;253,224,221;252,197,192;251,180,185;250,159,181;247,104,161;221,52,151;197,27,138;174,1,126;122,1,119;122,1,119;73,0,106];
-		typ = 'Sequential';
-	case 'Reds'
-		rgb = [255,245,240;254,229,217;254,224,210;252,187,161;252,174,145;252,146,114;251,106,74;239,59,44;222,45,38;203,24,29;165,15,21;153,0,13;103,0,13];
-		typ = 'Sequential';
-	case 'YlGn'
-		rgb = [255,255,229;255,255,204;247,252,185;217,240,163;194,230,153;173,221,142;120,198,121;65,171,93;49,163,84;35,132,67;0,104,55;0,90,50;0,69,41];
-		typ = 'Sequential';
-	case 'YlGnBu'
-		rgb = [255,255,217;255,255,204;237,248,177;199,233,180;161,218,180;127,205,187;65,182,196;29,145,192;44,127,184;34,94,168;37,52,148;12,44,132;8,29,88];
-		typ = 'Sequential';
-	case 'YlOrBr'
-		rgb = [255,255,229;255,255,212;255,247,188;254,227,145;254,217,142;254,196,79;254,153,41;236,112,20;217,95,14;204,76,2;153,52,4;140,45,4;102,37,6];
-		typ = 'Sequential';
-	case 'YlOrRd'
-		rgb = [255,255,204;255,255,178;255,237,160;254,217,118;254,204,92;254,178,76;253,141,60;252,78,42;240,59,32;227,26,28;189,0,38;177,0,38;128,0,38];
-		typ = 'Sequential';
-	otherwise
-		error('Colorscheme "%s" is not supported. Check the token tables.',tok)
-end
-%
-rgb = rgb./255;
-%
-switch typ
-	case 'Diverging'
-		num = 11;
-	case 'Qualitative'
-		num = size(rgb,1);
-	case 'Sequential'
-		num = 9;
-	otherwise
-		error('The colorscheme type "%s" is not recognized',typ)
-end
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmSelect
-% Code and Implementation:
-% Copyright (c) 2017 Stephen Cobeldick
-% Color Specifications Only:
-% Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University.
-%
-% 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.
-%
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are met:
-%
-% 1. Redistributions as source code must retain the above copyright notice, this
-% list of conditions and the following disclaimer.
-%
-% 2. The end-user documentation included with the redistribution, if any, must
-% include the following acknowledgment: "This product includes color
-% specifications and designs developed by Cynthia Brewer
-% (http://colorbrewer.org/)." Alternately, this acknowledgment may appear in the
-% software itself, if and wherever such third-party acknowledgments normally appear.
-%
-% 4. The name "ColorBrewer" must not be used to endorse or promote products
-% derived from this software without prior written permission. For written
-% permission, please contact Cynthia Brewer at cbrewer@psu.edu.
-%
-% 5. Products derived from this software may not be called "ColorBrewer", nor
-% may "ColorBrewer" appear in their name, without prior written permission of Cynthia Brewer.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%license
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/brewermap_view.m b/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/brewermap_view.m
deleted file mode 100755
index d1661447651ccbfec9ec91f74ee3db47cb060887..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/DrosteEffect-BrewerMap-c64a384/brewermap_view.m
+++ /dev/null
@@ -1,323 +0,0 @@
-function [map,scheme] = brewermap_view(N,scheme)
-% An interactive figure for ColorBrewer colormap selection. With demo!
-%
-% (c) 2017 Stephen Cobeldick
-%
-% View Cynthia Brewer's ColorBrewer color schemes in a figure.
-%
-% * Two colorbars give the color scheme in color and grayscale.
-% * A button toggles between 3D-cube and 2D-lineplot of the RGB values.
-% * A button toggles an endless cycle through the color schemes.
-% * A button reverses the colormap.
-% * 35 buttons select any ColorBrewer color scheme.
-% * Text with the color scheme's type (Diverging/Qualitative/Sequential)
-% * Text with the color scheme's number of nodes (defining colors).
-%
-%%% Syntax:
-%  brewermap_view
-%  brewermap_view(N)
-%  brewermap_view(N,scheme)
-%  brewermap_view([],...)
-%  brewermap_view({axes/figure handles},...) % see "Adjust External Colormaps"
-%  [map,scheme] = brewermap_view(...)
-%
-% Calling the function with an output argument blocks MATLAB execution until
-% the figure is deleted: the final colormap and scheme are then returned.
-%
-% See also BREWERMAP CUBEHELIX RGBPLOT COLORMAP COLORMAPEDITOR COLORBAR UICONTROL ADDLISTENER
-%
-%% Adjust Colormaps of Other Figures or Axes %%
-%
-%%% Example:
-%
-% load spine
-% image(X)
-% brewermap_view({gca})
-%
-% Very useful! Simply provide a cell array of axes or figure handles when
-% calling this function, and their colormaps will be updated in real-time:
-% note that MATLAB versions <=2010 only support axes handles for this!
-%
-%% Input and Output Arguments %%
-%
-%%% Inputs (*=default):
-%  N  = NumericScalar, an integer to define the colormap length.
-%     = *[], colormap length of one hundred and twenty-eight (128).
-%     = {axes/figure handles}, their colormaps will be updated by BREWERMAP_VIEW.
-%  scheme = String, a ColorBrewer color scheme name.
-%
-%%% Outputs (these block execution until the figure is deleted!):
-%  map    = NumericMatrix, the colormap defined when the figure is closed.
-%  scheme = StringToken, the name of the color scheme given in <map>.
-%
-% [map,scheme] = brewermap_view(N,scheme)
-
-%% Input Wrangling %%
-%
-persistent H
-%
-xtH = {};
-% Parse colormap size:
-if nargin<1 || isnumeric(N)&&isempty(N)
-	N = 128;
-elseif iscell(N)&&numel(N)
-	ish = all(1==cellfun('prodofsize',N)&cellfun(@ishghandle,N));
-	assert(ish,'Input <N> may be a cell array of scalar axes or figure handles.')
-	xtH = N;
-	N = size(colormap(xtH{1}),1);
-else
-	assert(isnumeric(N)&&isscalar(N),'Input <N> must be a scalar numeric.')
-	assert(isreal(N)&&fix(N)==N&&N>0,'Input <N> must be positive real integer: %g+%gi',N,imag(N))
-	N = double(N);
-end
-%
-[mcs,mun,pyt] = brewermap('list');
-%
-% Parse scheme name:
-if nargin<2
-	scheme = mcs{1+rem(round(now*1e7),numel(mcs))};
-else
-	assert(ischar(scheme)&&isrow(scheme),'Second input <scheme> must be a string.')
-end
-% Check if a reversed colormap was requested:
-isR = strncmp(scheme,'*',1);
-scheme = scheme(1+isR:end);
-%
-%% Create Figure %%
-%
-% LHS and RHS slider bounds/limits, and slider step sizes:
-lbd = 1;
-rbd = 128;
-%
-% Define the 3D cube axis order:
-xyz = 'RGB';
-[~,xyz] = ismember(xyz,'RGB');
-%
-if isempty(H) || ~ishghandle(H.fig)
-	% Check brewermap version:
-	ers = 'The function BREWERMAP returned an unexpected %s.';
-	assert(all(35==[numel(mcs),numel(mun),numel(pyt)]),ers,'array size')
-	tmp = find(any(diff(+char(pyt)),2));
-	assert(numel(tmp)==2&&all(tmp==[9;17]),ers,'scheme name sequence')
-	%
-	% Create a new figure:
-	ClBk = struct('bmvChgS',@bmvChgS, 'bmvRevM',@bmvRevM,...
-		'bmv2D3D',@bmv2D3D, 'bmvDemo',@bmvDemo, 'bmvSldr',@bmvSldr);
-	H = bmvPlot(N,scheme, mcs, lbd, rbd, xyz, ClBk);
-end
-%
-bmvUpDt()
-%
-if nargout
-	waitfor(H.fig);
-else
-	clear map
-end
-%
-%% Nested Functions %%
-%
-	function bmvUpDt()
-		% Update all graphics objects in the figure.
-		%
-		% Get ColorBrewer colormap and grayscale equivalent:
-		[map,num,typ] = brewermap(N,[char(42*ones(1,isR)),scheme]);
-		mag = sum(map*[0.298936;0.587043;0.114021],2);
-		%
-		% Update colorbar values:
-		set(H.cbAx, 'YLim', [0,abs(N)+(N==0)]+0.5);
-		set(H.cbIm(1), 'CData',reshape(map,[],1,3))
-		set(H.cbIm(2), 'CData',repmat(mag,[1,1,3]))
-		%
-		% Update 2D line / 3D patch values:
-		if  get(H.D2D3, 'Value') % 2D
-			set(H.ln2D, 'XData',linspace(0,1,abs(N)));
-			set(H.ln2D, {'YData'},num2cell([map,mag],1).');
-		else % 3D
-			set(H.pt3D,...
-				'XData',map(:,xyz(1)),...
-				'YData',map(:,xyz(2)),...
-				'ZData',map(:,xyz(3)), 'FaceVertexCData',map)
-		end
-		%
-		% Update reverse button:
-		set(H.bRev, 'Value',isR)
-		%
-		% Update warning text:
-		str = {typ;sprintf('%d Nodes',num)};
-		set(H.warn,'String',str);
-		%
-		% Update parameter value text:
-		set(H.vTxt(1), 'String',sprintf('N = %.0f',N));
-		%
-		% Update external axes/figure:
-		for k = find(cellfun(@ishghandle,xtH))
-			colormap(xtH{k},map);
-		end
-	end
-%
-	function bmv2D3D(h,~)
-		% Switch between 2D-line and 3D-cube representation.
-		%
-		if get(h,'Value') % 2D
-			set(H.ax3D, 'HitTest','off', 'Visible','off')
-			set(H.ax2D, 'HitTest','on')
-			set(H.pt3D, 'Visible','off')
-			set(H.ln2D, 'Visible','on')
-		else % 3D
-			set(H.ax2D, 'HitTest','off')
-			set(H.ax3D, 'HitTest','on', 'Visible','on')
-			set(H.ln2D, 'Visible','off')
-			set(H.pt3D, 'Visible','on')
-		end
-		%
-		bmvUpDt();
-	end
-%
-	function bmvChgS(~,e)
-		% Change the color scheme.
-		%
-		scheme = get(e.NewValue,'String');
-		%
-		bmvUpDt()
-	end
-%
-	function bmvRevM(h,~)
-		% Reverse the colormap.
-		%
-		isR = get(h,'Value');
-		%
-		bmvUpDt()
-	end
-%
-	function bmvSldr(~,~)
-		% Update the slider position.
-		%
-		N = round(get(H.vSld,'Value'));
-		%
-		bmvUpDt()
-	end
-%
-	function bmvDemo(h,~)
-		% Display all ColorBrewer schemes sequentially.
-		%
-		while ishghandle(h)&&get(h,'Value')
-			%
-			ids = 1+mod(find(strcmpi(scheme,mcs)),numel(mcs));
-			set(H.bGrp,'SelectedObject',H.bEig(ids));
-			scheme = mcs{ids};
-			%
-			bmvUpDt();
-			%
-			% Faster/slower:
-			pause(1.2);
-		end
-		%
-	end
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%brewermap_view
-function H = bmvPlot(N,scheme, mcs, lbd, rbd, xyz, ClBk)
-% Draw a new figure with RGBplot axes, ColorBar axes, and uicontrol sliders.
-%
-M = 9; % buttons per column
-gap = 0.01; % gaps
-bth = 0.04; % demo height
-btw = 0.09; % demo width
-uih = 0.40; % height of UI control group
-cbw = 0.21; % width of both colorbars
-axh = 1-uih-2*gap; % axes height
-wdt = 1-cbw-2*gap; % axes width
-stp = [1,10]; % slider step
-%
-H.fig = figure('HandleVisibility','callback', 'Color','white',...
-	'IntegerHandle','off', 'NumberTitle','off',...
-	'Name','ColorBrewer Interactive Scheme Selector');
-%
-% Add 2D lineplot:
-H.ax2D = axes('Parent',H.fig, 'Position',[gap, uih+gap, wdt, axh],...
-	'ColorOrder',[1,0,0; 0,1,0; 0,0,1; 0.6,0.6,0.6], 'HitTest','off',...
-	'Visible','off', 'XLim',[0,1], 'YLim',[0,1], 'XTick',[], 'YTick',[]);
-H.ln2D = line([0,0,0,0;1,1,1,1],[0,0,0,0;1,1,1,1], 'Parent',H.ax2D, 'Visible','off');
-%
-% Add 3D scatterplot:
-H.ax3D = axes('Parent',H.fig, 'OuterPosition',[0, uih, wdt+2*gap, 1-uih],...
-	'Visible','on', 'XLim',[0,1], 'YLim',[0,1], 'ZLim',[0,1], 'HitTest','on');
-H.pt3D = patch('Parent',H.ax3D, 'XData',[0;1], 'YData',[0;1], 'ZData',[0;1],...
-	'Visible','on', 'LineStyle','none', 'FaceColor','none', 'MarkerEdgeColor','none',...
-	'Marker','o', 'MarkerFaceColor','flat', 'MarkerSize',10, 'FaceVertexCData',[1,1,0;1,0,1]);
-view(H.ax3D,3);
-grid(H.ax3D,'on')
-lbl = {'Red','Green','Blue'};
-xlabel(H.ax3D,lbl{xyz(1)})
-ylabel(H.ax3D,lbl{xyz(2)})
-zlabel(H.ax3D,lbl{xyz(3)})
-%
-% Add warning text:
-H.warn = text('Parent',H.ax2D, 'Units','normalized', 'Position',[1,1],...
-	'HorizontalAlignment','right', 'VerticalAlignment','top', 'Color','k');
-%
-% Add demo button:
-H.demo = uicontrol(H.fig, 'Style','togglebutton', 'Units','normalized',...
-	'Position',[gap,uih+gap+0*bth,btw,bth], 'String','Demo',...
-	'Max',1, 'Min',0, 'Callback',ClBk.bmvDemo);
-% Add 2D/3D button:
-H.D2D3 = uicontrol(H.fig, 'Style','togglebutton', 'Units','normalized',...
-	'Position',[gap,uih+gap+1*bth,btw,bth], 'String','2D / 3D',...
-	'Max',1, 'Min',0, 'Callback',ClBk.bmv2D3D);
-% Add reverse button:
-H.bRev = uicontrol(H.fig, 'Style','togglebutton', 'Units','normalized',...
-	'Position',[gap,uih+gap+2*bth,btw,bth], 'String','Reverse',...
-	'Max',1, 'Min',0, 'Callback',ClBk.bmvRevM);
-%
-% Add colorbars:
-C = reshape([1,1,1],1,[],3);
-H.cbAx(1) = axes('Parent',H.fig, 'Visible','off', 'Units','normalized',...
-	'Position',[1-cbw/1,gap,cbw/2-gap,1-2*gap], 'YLim',[0.5,1.5],...
-	'YDir','reverse', 'HitTest','off');
-H.cbAx(2) = axes('Parent',H.fig, 'Visible','off', 'Units','normalized',...
-	'Position',[1-cbw/2,gap,cbw/2-gap,1-2*gap], 'YLim',[0.5,1.5],...
-	'YDir','reverse', 'HitTest','off');
-H.cbIm(1) = image('Parent',H.cbAx(1), 'CData',C);
-H.cbIm(2) = image('Parent',H.cbAx(2), 'CData',C);
-%
-% Add parameter slider, listener, and corresponding text:
-sv = max(lbd,min(rbd,N));
-H.vTxt = uicontrol(H.fig,'Style','text', 'Units','normalized',...
-	'Position',[gap,uih-bth,btw,bth], 'String','X');
-H.vSld = uicontrol(H.fig,'Style','slider', 'Units','normalized',...
-	'Position',[gap,gap,btw,uih-bth], 'Min',lbd(1), 'Max',rbd(1),...
-	'SliderStep',stp(1,:)/(rbd(1)-lbd(1)), 'Value',sv(1));
-addlistener(H.vSld, 'Value', 'PostSet',ClBk.bmvSldr);
-%
-% Add scheme button group:
-H.bGrp = uibuttongroup('Parent',H.fig, 'BorderType','none', 'Units','normalized',...
-	'BackgroundColor','white', 'Position',[2*gap+btw,gap,wdt-btw-gap,uih-gap]);
-% Determine button locations:
-Z = 1:numel(mcs);
-Z = Z+(Z>17);
-C = (ceil(Z/M)-1)/4;
-R = (M-1-mod(Z-1,M))/M;
-% Add scheme buttons to group:
-for k = numel(mcs):-1:1
-	H.bEig(k) = uicontrol('Parent',H.bGrp, 'Style','Toggle', 'String',mcs{k},...
-		'Unit','normalized', 'Position',[C(k),R(k),1/4,1/M]);
-end
-set(H.bGrp,'SelectedObject',H.bEig(strcmpi(scheme,mcs)));
-set(H.bGrp,'SelectionChangeFcn',ClBk.bmvChgS);
-%
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bmvPlot
-%
-% Copyright (c) 2017 Stephen Cobeldick
-%
-% 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.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%license
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/AUTHORS b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/AUTHORS
deleted file mode 100644
index 2558a19f7c3ce5d8ca82069cb4178fe791339001..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Nico Schlömer designed and implemented the intial version and is the current maintainer.
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/COPYING b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/COPYING
deleted file mode 100644
index 15dc1832b0e5c62c9400a6b8b093bf510ce6cdf8..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/COPYING
+++ /dev/null
@@ -1,24 +0,0 @@
-Copyright (c) 2008--2012 Nico Schlömer
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without 
-modification, are permitted provided that the following conditions are 
-met:
-
-    * Redistributions of source code must retain the above copyright 
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright 
-      notice, this list of conditions and the following disclaimer in 
-      the documentation and/or other materials provided with the distribution
-      
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/ChangeLog b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/ChangeLog
deleted file mode 100644
index 911c5e4d1f1d128035a3a9b4c4f6c43a76de8b2f..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/ChangeLog
+++ /dev/null
@@ -1,388 +0,0 @@
-2014-11-21  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.6.0.
-	* Annotation support in R2014a and earlier
-	* New subplot positioning approach (by Klaus Broelemann) that uses absolute
-	  instead of relative positions.
-	* Support stacked bar plots and others in the same axes (needs pgfplots
-	  1.11).
-	* Support legends with multiline entries.
-	* Support for the alpha channel in PNG output.
-	* Test framework updated and doesn't display figures by default.
-	* Major code clean-up and code complexity checks.
-	* Bug fixes:
-	    - Cycle paths only when needed (#317, #49, #404)
-	    - Don't use infinite xmin/max, etc. (#436)
-	    - Warn about the noSize parameter (#431)
-	    - Images aren't flipped anymore (#401)
-	    - No scientific notation in width/height (#396)
-	    - Axes with custom colors (#376)
-	    - Mesh plots are exported properly (#382)
-	    - Legend colors are handled better (#389)
-	    - Handle Z axis properties for quiver3 (#406)
-	    - Better text handling, e.g. degrees (#402)
-	    - Don't output absolute paths into TikZ by default
-	    - ...
-
-2014-10-20  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.5.0.
-	* Support for MATLAB 2014b (with it's substantial graphics changes).
-	  All credit goes to Egon Geerardyn.
-	* Bugfixes:
-	    - single bar width
-	    - invisible bar plots
-	    - surface options
-	    - patch plots and cycling
-	    - patches with literal colors
-
-2014-03-07  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.7.
-	* Acid tests: Remove MATLAB-based eps2pdf.
-	* Bugfixes:
-	    - multiple patches
-	    - log plot with nonzero baseline
-	    - marker options for scatter plots
-	    - table data formatting
-	    - several fixes for Octave
-
-2014-02-07  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.6.
-	* Set externalData default to false.
-	* Properly check for required Pgfplots version.
-	* Marker scaling in scatter plots.
-
-2014-02-02  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.5.
-	* Arrange data in tables.
-	* Optionally define custom colors.
-	* Allow for strict setting of font sizes.
-	* Bugfixes:
-	   - tick labels for log plots
-	   - tick labels with commas
-
-2014-01-02  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.4.
-	* Support for color maps with scatter plots.
-	* Support for different-length up-down error bars.
-	* Input options validation.
-	* Bugfixes:
-	   - legends for both area and line plots
-	   - invisible text fields
-
-2013-10-20  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.3.
-	* Support for 3D quiver plots.
-	* Extended support for colorbar axis options.
-	* New logo!
-	* Bugfixes:
-	   - text generation
-	   - extraCode option
-	   - join strings
-	   - ...
-
-2013-09-12  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.2.
-	* Support for explicit color specification in 3D plots.
-	* Better color handling for patch plots.
-	* Support for various unicode characters.
-	* Bugfixes:
-	   - edge colors for bar plots
-	   - multiple color bars
-	   - ...
-
-2013-08-14  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.1.
-	* Replaced option `extraTikzpictureCode` by `extraCode`
-	  for inserting code at the beginning of the file.
-	* Support for relative text positioning.
-	* Improved documentation.
-	* Code cleanup: moved all figure manipulations over to cleanfigure()
-	* Bugfixes:
-	   - error bars
-	   - empty tick labels
-	   - ...
-
-2013-06-26  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.4.0.
-	* Added cleanfigure() for removing unwanted entities from a plot
-	  before conversion
-	* Add option `floatFormat` to allow for custom specification of the format
-	  of float numbers
-	* Bugfixes:
-	   - linewidth for patches
-	   - ...
-
-2013-04-13  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.3.3.
-	* Support for:
-	   - pictures in LaTeX subfloats
-	* Bugfixes:
-	   - axes labels
-	   - extra* options
-	   - logscaled axes
-	   - ...
-
-2013-03-14  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.3.2.
-	* Support for:
-	   - waterfall plots
-	* Bugfixes:
-	   - axis locations
-	   - color handling
-	   - stacked bars
-	   - ...
-
-2013-02-15  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.3.1.
-	* Use table{} for plots for cleaner output files.
-	* Support for:
-	   - hg transformations
-	   - pcolor plots
-	* Removed command line options:
-	   - minimumPointsDistance
-	* Bugfixes:
-	   - legend positioning and alignment
-	   - tick labels
-	   - a bunch of fixed for Octave
-	   - line width for markers
-	   - axis labels for color bars
-	   - image trimming
-	   - subplots with bars
-	   - ...
-
-2012-11-19  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.3.0.
-	* Support for:
-	   - area plots
-	   - legend position
-	   - inner color bars
-	   - log-scaled color bars
-	* New command line options:
-	   - standalone (create compilable TeX file)
-	   - checkForUpdates
-	* mlint cleanups.
-	* Removed deprecated options.
-	* Bugfixes:
-	   - colorbar-axis association
-	   - option parsing
-	   - automatic updater
-	   - unit 'px'
-	   - ...
-
-2012-09-01  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.2.3.
-	* Multiline text for all entities.
-	* Support for logical images.
-	* Support for multiple legends (legends in subplots).
-	* Fixed version check bug.
-	* Fix minumumPointsDistance.
-
-2012-07-19  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.2.2.
-	* Support for multiline titles and axis labels.
-	* Respect log-scaled axes for minimumPointsDistance.
-	* Add support for automatic graph labels via
-	  new option.
-	* About 5 bugfixes.
-
-2012-05-04  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.2.1.
-	* Support for color maps.
-	* Support for native color bars.
-	* Partial support for hist3 plots.
-	* Support for spectrogram plots.
-	* Support for rotated text.
-	* Native handling of Infs/NaNs.
-	* Better info text.
-	* matlab2tikz version checking.
-	* Line plotting code cleanup.
-	* About 10 bugfixes.
-
-2012-03-17  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.2.0.
-	* Greatly overhauled text handling. (Burkhart Lingner)
-	* Added option 'tikzFileComment'.
-	* Added option 'parseStrings'.
-	* Added option 'extraTikzpictureSettings'.
-	* Added proper documetion (for 'help matlab2tikz').
-	* Improved legend positioning, orientation.
-	* Support for horizontal bar plots.
-	* Get bar widths right.
-	* Doubles are plottet with 15-digit precision now.
-	* Support for rectangle objects.
-	* Better color handling.
-	* Testing framework improvements.
-	* Several bugfixes:
-	   - ticks handled more concisely
-	   - line splitting bugs
-	   - ...
-
-2011-11-22  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.1.4.
-	* Support for scatter 3D plots.
-	* Support for 3D parameter curves.
-	* Support for 3D patches.
-	* Support for minor ticks.
-	* Add option interpretTickLabelsAsTex (default false).
-	* Several bugfixes:
-	   - %-sign in annotations
-	   - fixed \omega and friends in annotations
-	   - proper legend for bar plots
-	   - don't override PNG files if there is
-	     more than one image plot
-	   - don't always close patch paths
-
-2011-08-22  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.1.3.
-	* Greatly overhauled text handling.
-	* Better Octave compatibility.
-	* Several bugfixes:
-	    - subplot order
-	    - environment detection
-
-
-2011-06-02  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.1.2.
-	* Support for logscaled color bar.
-	* Support for truecolor images.
-	* Initial support for text handles.
-	* Speed up processing for line plots.
-	* Several bugfixes:
-	   - axis labels, tick labels, etc. for z-axis
-	   - marker handling for scatter plots
-	   - fix for unicolor scatter plots
-
-2011-04-06  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.1.1.
-	* Improved Octave compatibility.
-	* Several bugfixes:
-	   - input parser
-
-2011-01-31  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.1.0.
-	* Basic Octave compatibility.
-	* Several bugfixes:
-	   - bar plots fix (thanks to Christoph Rüdiger)
-	   - fix legends with split graphs
-
-2010-09-10  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.0.7.
-	* Compatibility fixes for older MATLAB installations.
-	* Several bugfixes:
-	   - line plots with only one point
-	   - certain surface plots
-	   - orientation of triangle markers ("<" vs. ">")
-	   - display of the color "purple"
-
-2010-05-06  Nico Schlömer  <nico.schloemer@gmail.com>
-
-	* Version 0.0.6.
-	* Support for scatter plots.
-	* Preliminary support for surface plots; thanks to Pooya.
-	* Large changes in the codebase:
-	  - next to matlab2tikz.m, the file pgfplotsEnvironment.m
-	    is now needed as well; it provides a much better
-	    structured approach to storing and writing environments
-	    when parsing the MATLAB(R) figure
-	* proper MATLAB(R) version check
-	* lots of small fixes
-
-2009-12-21  Nico Schlömer  <nico.schloemer@ua.ac.be>
-
-	* Version 0.0.5.
-	* Improvements in axis handling:
-	  - colored axes
-	  - allow different left and right ordinates
-	* Improvements for line plots:
-
-	* Version 0.0.5.
-	* Improvements in axis handling:
-	  - colored axes
-	  - allow different left and right ordinates
-	* Improvements for line plots:
-	  - far outliers are moved toward the plot, avoiding 'Dimension too
-	    large'-type errors in LaTeX
-	  - optional point reduction by new option 'minimumPointsDistance'
-	* Improvements for image handling:
-	  - creation of a PNG file, added by '\addplot graphics'
-	  - fixed axis orientation bug
-	* Bugfixes for:
-	  - multiple axes
-	  - CMYK colors
-	  - legend text alignment (thanks Dragen Mitrevski)
-	  - transparent patches (thanks Carlos Russo)
-	* Added support for:
-	  - background color
-	  - Bode plots
-	  - zplane plots
-	  - freqz plots
-
-
-2009-06-09  Nico Schlömer  <nico.schloemer@ua.ac.be>
-
-	* Version 0.0.4.
-	* Added support for:
-	  - error bars (thanks Robert Whittlesey for the suggestion)
-	* Improvents in:
-	  - legends (thanks Theo Markettos for the patch),
-	  - images,
-	  - quiver plots (thanks Robert for spotting this).
-	* Improved options handling.
-	* Allow for custom file encoding (thanks Donghua Wang for the
-	suggestion).
-	* Numerous bugfixes (thanks Andreas Gäb).
-
-2009-03-08  Nico Schlömer  <nico.schloemer@ua.ac.be>
-
-	* Version 0.0.3.
-	* Added support for:
-	  - subplots
-	  - reverse axes
-	* Completed support for:
-	  - images
-
-2009-01-08  Nico Schlömer  <nico.schloemer@ua.ac.be>
-
-	* Version 0.0.2.
-	* Added support for:
-	  - quiver (arrow) plots
-	  - bar plots
-	  - stem plots
-	  - stairs plots
-	* Added preliminary support for:
-	  - images
-	  - rose plots
-	  - compass plots
-	  - polar plots
-	* Moreover, large code improvement have been introduced, notably:
-	  - aspect ratio handling
-	  - color handling
-	  - plot options handling
-
-
-2008-11-07  Nico Schlömer  <nico.schloemer@ua.ac.be>
-
-	* Initial version 0.0.1.
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/Makefile b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/Makefile
deleted file mode 100644
index 1d9d6e9b293476bf6c6ade41bb8048d0dd6ec373..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# This makefile creates a release tarball.
-
-MATLAB2TIKZ_DIR=.
-VERSION=0.4.7
-
-default: release
-
-release:
-	# The license is automatically added by
-	# MathWorks after the upload.
-	@zip -r matlab2tikz_${VERSION}.zip \
-     ${MATLAB2TIKZ_DIR}/AUTHORS \
-     ${MATLAB2TIKZ_DIR}/ChangeLog \
-     ${MATLAB2TIKZ_DIR}/README.md \
-     ${MATLAB2TIKZ_DIR}/THANKS \
-     ${MATLAB2TIKZ_DIR}/version-${VERSION} \
-     ${MATLAB2TIKZ_DIR}/tools/ \
-     ${MATLAB2TIKZ_DIR}/src/
-
-clean:
-	rm -f matlab2tikz_${VERSION}.zip
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/README.md b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/README.md
deleted file mode 100644
index aedbc18e5d7fa0bf5ba00886dd428671b7d1d32e..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-![matlab2tikz](https://raw.githubusercontent.com/wiki/matlab2tikz/matlab2tikz/matlab2tikz.png)
-
-[![Build Status](https://travis-ci.org/matlab2tikz/matlab2tikz.svg?branch=master)](https://travis-ci.org/matlab2tikz/matlab2tikz)
-
-This is matlab2tikz, a MATLAB(R) script for converting MATLAB(R) figures into
-native TikZ/Pgfplots figures.
-
-To download and rate matlab2tikz, go to its page on MathWorks 
-http://www.mathworks.com/matlabcentral/fileexchange/22022.
-
-matlab2tikz supports the conversion of most MATLAB figures,
-including 2D and 3D plots. For plots constructed with third-
-party packages, your mileage may vary.
-
-The workflow is as follows.
-
-0. a. Place the matlab2tikz scripts (contents of src/ folder) in a directory
-      where MATLAB can find it (the current directory, for example).
-   b. Make sure that your LaTeX installation includes the packages
-     * TikZ (aka PGF, >=2.00) and
-     * Pgfplots (>=1.3).
-
-1. Generate your plot in MATLAB.
-
-2. Invoke matlab2tikz by
-```matlab
->> matlab2tikz();
-```
-   or
-```matlab
->> matlab2tikz('myfile.tex');
-```
-  The script accepts numerous options; check them out by invoking the help,
-```matlab
->> help matlab2tikz
-```
-Sometimes, MATLAB makes it hard to create matching LaTeX plots by keeping
-invisible objects around or stretches the plots too far beyond the bounding box.
-Use
-```matlab
->> cleanfigure;
->> matlab2tikz('myfile.tex');
-```
-to first clean the figure of unwanted entities, and then convert it to TeX.
-
-3. Add the contents of `myfile.tex` into your LaTeX source code; a
-   convenient way of doing so is to use `\input{/path/to/myfile.tex}`.
-   Also make sure that at the header of your document the Pgfplots package
-   is included:
-```latex
-\documentclass{article}
-\usepackage{pgfplots}
-% and optionally (as of Pgfplots 1.3):
-\pgfplotsset{compat=newest}
-\pgfplotsset{plot coordinates/math parser=false}
-\newlength\figureheight
-\newlength\figurewidth
-\begin{document}
-\input{myfile.tex}
-\end{document}
-```
-
-There are reported incompatibilities with the following LaTeX packages:
-   * signalflowdiagram <http://www.texample.net/tikz/examples/signal-flow-building-blocks/>
-     (Check out <http://sourceforge.net/tracker/?func=detail&aid=3312653&group_id=224188&atid=1060656>.)
-
-If you experience bugs, have nice examples of what matlab2tikz can do, or if
-you are just looking for more information, please visit the web page of
-matlab2tikz <https://github.com/matlab2tikz/matlab2tikz>.
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/THANKS b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/THANKS
deleted file mode 100644
index 74103b84acc6ad625904eb460458b397ee5d172c..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/THANKS
+++ /dev/null
@@ -1,47 +0,0 @@
-matlab2tikz has once greatly profited from its ancestor, Matfig2PGF,
-
-  http://www.mathworks.com/matlabcentral/fileexchange/12962
-
-Matfig2PGF is written by Paul Wagenaars.
-
-Also, the authors would like to thank Christian Feuersänger for the Pgfplots
-package which forms the basis for the matlab2tikz output on the LaTeX side.
-
-Thanks for patches, suggestions, and other contributions go to
-
- Katherine Elkington
- Andreas Gäb
- Roman Gesenhues
- David Haberthür
- Patrick Häcker
- Mykel Kochenderfer
- Henk Kortier
- Theo Markettos
- Dragan Mitrevski
- Carlos Russo
- Robert Whittlesey
- Pooya Ziraksaz
- Johannes Schmitz
- Christoph Rüdiger
- Ben Abbott
- Johannes Mueller-Roemer
- Julien Ridoux
- Burkart Lingner
- Francesco Montorsi
- Ricardo Santiago Mozos
- Eike Blechschmidt
- Michael Schoeberl
- Patrick Häcker
- Egon Geerardyn
- Oleg Komarov
- Klaus Broelemann
- Peter Pablo
- ...
-
-and MathWorks' very own
-
- Martijn Aben
- Bastiaan Zuurendonk
- Michael Glasser
-
-and many more!
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/logos/matlab2tikz.svg b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/logos/matlab2tikz.svg
deleted file mode 100644
index ea2a8f7d2d3a976ef8b641db57efed52b221802b..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/logos/matlab2tikz.svg
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="744.09448819"
-   height="1052.3622047"
-   id="svg3051"
-   version="1.1"
-   inkscape:version="0.48.5 r10040"
-   sodipodi:docname="m2t.svg">
-  <defs
-     id="defs3053" />
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="0.25"
-     inkscape:cx="696.59128"
-     inkscape:cy="461.26734"
-     inkscape:document-units="px"
-     inkscape:current-layer="layer1"
-     showgrid="false"
-     inkscape:window-width="1280"
-     inkscape:window-height="738"
-     inkscape:window-x="0"
-     inkscape:window-y="27"
-     inkscape:window-maximized="1" />
-  <metadata
-     id="metadata3056">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Layer 1"
-     inkscape:groupmode="layer"
-     id="layer1">
-    <path
-       style="fill:#ef8200;fill-opacity:1;stroke:none"
-       d="m 229.79347,889.91953 c -51.20296,-69.53548 -110.45905,-150.5284 -117.8477,-161.07762 -3.66043,-5.22621 -4.15923,-6.45766 -2.93039,-7.23468 0.81449,-0.51503 2.1559,-0.94763 2.9809,-0.96134 4.45183,-0.074 21.84491,-16.50352 39.70528,-37.5057 64.93246,-76.3547 212.14442,-292.5117 313.27925,-460 28.45805,-47.12908 55.23448,-94.70724 59.01417,-107.81682 2.21373,-7.67817 3.30364,-4.58186 5.54982,7.259 0.84717,4.46595 9.42069,39.94343 19.05225,78.83886 61.4356,248.09709 88.96885,376.22196 95.45994,444.21896 1.34274,14.06576 0.80116,31.67542 -1.06339,34.57694 -0.67969,1.05768 -29.41344,23.07306 -63.85279,48.92306 -46.63668,35.00526 -216.41083,162.82778 -297.77739,224.19582 l -3.13285,2.36286 z"
-       id="path3072" />
-    <path
-       style="fill:#ffd912;fill-opacity:1"
-       d="M 828.49628,790.87316 C 751.45425,746.41551 656.62349,689.46978 647.33146,682.08395 c -2.47911,-1.97053 -2.52321,-2.17947 -1.05805,-5.01277 3.18772,-6.16438 4.02557,-14.85566 3.44538,-35.74002 -0.80529,-28.98647 -5.98761,-65.55929 -17.38517,-122.69097 -18.80756,-94.27528 -55.9766,-241.89492 -91.4729,-363.29152 -4.95189,-16.93533 -13.8484,-44.15875 -13.64905,-44.7568 0.19935,-0.59804 7.77507,16.91106 10.71396,23.16944 14.72516,31.35732 169.10504,368.5638 262.04653,572.37888 18.81036,41.25 35.965,78.78344 38.1214,83.40766 2.15641,4.62421 3.80419,8.50202 3.66173,8.61735 -0.14245,0.11533 -6.10901,-3.16608 -13.25901,-7.29204 z"
-       id="path3070" />
-    <path
-       style="fill:#00b0cf;fill-opacity:1"
-       d="M 98.496283,712.93087 C 76.224153,691.69469 25.659453,651.42885 -55.133796,590.59166 l -36.630081,-27.58239 14.630081,-4.80606 C 1.4604828e-5,532.86436 84.848253,489.14509 155.49628,438.33721 c 90.71369,-65.23848 211.18904,-171.14032 339.75,-298.65155 14.7125,-14.59237 30.24771,-31.09621 30.24771,-30.65137 0,1.46965 -5.56006,9.74411 -33.50167,53.6059 -117.938,185.13504 -236.74752,364.94776 -300.3065,454.5 -22.45559,31.6391 -46.86362,64.24839 -58.75719,78.5 -10.15154,12.16419 -23.13943,25.02746 -25.20109,24.95928 -0.6772,-0.0224 -4.83126,-3.47326 -9.231257,-7.6686 z"
-       id="path2987" />
-    <text
-       xml:space="preserve"
-       style="font-size:256.08959961px;font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ef8200;fill-opacity:1;stroke:none;font-family:Monotype Corsiva;-inkscape-font-specification:Monotype Corsiva Bold Italic"
-       x="835.56165"
-       y="469.78217"
-       id="text3863"
-       sodipodi:linespacing="125%"><tspan
-         sodipodi:role="line"
-         id="tspan3865"
-         x="835.56165"
-         y="469.78217"
-         style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans Italic"><tspan
-           style="font-style:normal;-inkscape-font-specification:Liberation Sans"
-           id="tspan2999">MATLAB</tspan><tspan
-           style="font-style:italic;font-weight:bold;-inkscape-font-specification:Liberation Sans Italic"
-           id="tspan2997">2</tspan></tspan><tspan
-         sodipodi:role="line"
-         x="835.56165"
-         y="789.89417"
-         id="tspan3867"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ef8200;fill-opacity:1;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans"
-           id="tspan3875">Ti</tspan><tspan
-           style="font-style:italic;-inkscape-font-specification:Liberation Sans Italic"
-           id="tspan2995">k</tspan><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans"
-           id="tspan3873">Z</tspan></tspan></text>
-  </g>
-</svg>
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cleanfigure.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cleanfigure.m
deleted file mode 100644
index ffc0feef203d48643ae36c50840c71eab62a185c..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cleanfigure.m
+++ /dev/null
@@ -1,524 +0,0 @@
-function cleanfigure(varargin)
-%   CLEANFIGURE() removes the unnecessary objects from your MATLAB plot
-%   to give you a better experience with matlab2tikz.
-%   CLEANFIGURE comes with several options that can be combined at will.
-%
-%   CLEANFIGURE('handle',HANDLE,...) explicitly specifies the
-%   handle of the figure that is to be stored. (default: gcf)
-%
-%   CLEANFIGURE('minimumPointsDistance',DOUBLE,...) explicitly specified the
-%   minimum distance between two points. (default: 1.0e-10)
-%
-%   Example
-%      x = -pi:pi/1000:pi;
-%      y = tan(sin(x)) - sin(tan(x));
-%      plot(x,y,'--rs');
-%      cleanfigure();
-%
-
-%   Copyright (c) 2013--2014, Nico Schlömer <nico.schloemer@gmail.com>
-%   All rights reserved.
-%
-%   Redistribution and use in source and binary forms, with or without
-%   modification, are permitted provided that the following conditions are
-%   met:
-%
-%      * Redistributions of source code must retain the above copyright
-%        notice, this list of conditions and the following disclaimer.
-%      * Redistributions in binary form must reproduce the above copyright
-%        notice, this list of conditions and the following disclaimer in
-%        the documentation and/or other materials provided with the distribution
-%
-%   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-%   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-%   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-%   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-%   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-%   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-%   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-%   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-%   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-%   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-%   POSSIBILITY OF SUCH DAMAGE.
-
-  % Treat hidden handles, too.
-  shh = get(0, 'ShowHiddenHandles');
-  set(0, 'ShowHiddenHandles', 'on');
-
-  % Keep track of the current axes.
-  meta.gca = [];
-
-  % Set up command line options.
-  m2t.cmdOpts = m2tInputParser;
-  m2t.cmdOpts = m2t.cmdOpts.addParamValue(m2t.cmdOpts, 'minimumPointsDistance', 1.0e-10, @isnumeric);
-  m2t.cmdOpts = m2t.cmdOpts.addParamValue(m2t.cmdOpts, 'handle', gcf, @ishandle);
-
-  % Finally parse all the elements.
-  m2t.cmdOpts = m2t.cmdOpts.parse(m2t.cmdOpts, varargin{:});
-
-  % Recurse down the tree of plot objects and clean up the leaves.
-  for h = m2t.cmdOpts.Results.handle(:)'
-    recursiveCleanup(meta, h, m2t.cmdOpts.Results.minimumPointsDistance, 0);
-  end
-
-  % Reset to initial state.
-  set(0, 'ShowHiddenHandles', shh);
-
-  return;
-end
-% =========================================================================
-function indent = recursiveCleanup(meta, h, minimumPointsDistance, indent)
-
-  type = get(h, 'Type');
-
-  %display(sprintf([repmat(' ',1,indent), type, '->']))
-
-  % Don't try to be smart about quiver groups.
-  % NOTE:
-  % A better way to write `strcmp(get(h,...))` would be to use
-  %     isa(handle(h), 'specgraph.quivergroup').
-  % The handle() function isn't supported by Octave, though, so let's stick
-  % with strcmp().
-  if strcmp(get(h, 'Type'), 'specgraph.quivergroup')
-  %if strcmp(class(handle(h)), 'specgraph.quivergroup')
-      return;
-  end
-
-  % Update the current axes.
-  if strcmp(get(h, 'Type'), 'axes')
-      meta.gca = h;
-  end
-
-  children = get(h, 'Children');
-  if ~isempty(children)
-      for child = children(:)'
-          indent = indent + 4;
-          indent = recursiveCleanup(meta, child, minimumPointsDistance, indent);
-          indent = indent - 4;
-      end
-  else
-      % We're in a leaf, so apply all the fancy simplications.
-
-      %% Skip invisible objects.
-      %if ~strcmp(get(h, 'Visible'), 'on')
-      %    display(sprintf([repmat(' ',1,indent), '  invisible']))
-      %    return;
-      %end
-
-      %display(sprintf([repmat(' ',1,indent), '  handle this']))
-
-      if strcmp(type, 'line')
-          pruneOutsideBox(meta, h);
-          % Move some points closer to the box to avoid TeX:DimensionTooLarge
-          % errors. This may involve inserting extra points.
-          movePointsCloser(meta, h);
-          % Don't be too precise.
-          coarsenLine(meta, h, minimumPointsDistance);
-      elseif strcmp(type, 'text')
-          % Check if text is inside bounds by checking if the Extent rectangle
-          % and the axes box overlap.
-          xlim = get(meta.gca, 'XLim');
-          ylim = get(meta.gca, 'YLim');
-          extent = get(h, 'Extent');
-          extent(3:4) = extent(1:2) + extent(3:4);
-          overlap = xlim(1) < extent(3) && xlim(2) > extent(1) ...
-                 && ylim(1) < extent(4) && ylim(2) > extent(2);
-          if ~overlap
-              % Artificially disable visibility. m2t will check and skip.
-              set(h, 'Visible', 'off');
-          end
-      end
-  end
-
-  return;
-end
-% =========================================================================
-function pruneOutsideBox(meta, handle)
-  % Some sections of the line may sit outside of the visible box.
-  % Cut those off.
-
-  xData = get(handle, 'XData');
-  yData = get(handle, 'YData');
-  zData = get(handle, 'ZData');
-
-  if isempty(zData)
-    data = [xData(:), yData(:)];
-  else
-    data = [xData(:), yData(:), zData(:)];
-  end
-
-  if isempty(data)
-      return;
-  end
-
-  %hasLines = ~strcmp(lineStyle,'none') && lineWidth>0.0;
-  %hasMarkers = ~strcmp(marker,'none');
-  hasLines = true;
-  hasMarkers = true;
-  xLim = get(meta.gca, 'XLim');
-  yLim = get(meta.gca, 'YLim');
-
-  tol = 1.0e-10;
-  relaxedXLim = xLim + [-tol, tol];
-  relaxedYLim = yLim + [-tol, tol];
-
-  numPoints = size(data, 1);
-
-  % Get which points are inside a (slightly larger) box.
-  dataIsInBox = isInBox(data(:,1:2), ...
-                        relaxedXLim, relaxedYLim);
-
-  % By default, don't plot any points.
-  shouldPlot = false(numPoints, 1);
-  if hasMarkers
-      shouldPlot = shouldPlot | dataIsInBox;
-  end
-  if hasLines
-      % Check if the connecting line is in the box.
-      segvis = segmentVisible(data(:,1:2), ...
-                              dataIsInBox, xLim, yLim);
-      % Plot points which are next to an edge which is in the box.
-      shouldPlot = shouldPlot | [false; segvis] | [segvis; false];
-  end
-
-  if ~all(shouldPlot)
-      % There are two options here:
-      %      data = data(shouldPlot, :);
-      % i.e., simply removing the data that isn't supposed to be plotted.
-      % For line plots, this has the disadvantage that the line between two
-      % 'loose' ends may now appear in the figure.
-      % To avoid this, add a row of NaNs wherever a block of actual data is
-      % removed.
-      chunkIndices = [];
-      k = 1;
-      while k <= numPoints
-          % fast forward to shouldPlot==True
-          while k<=numPoints && ~shouldPlot(k)
-              k = k+1;
-          end
-          kStart = k;
-          % fast forward to shouldPlot==False
-          while k<=numPoints && shouldPlot(k)
-              k = k+1;
-          end
-          kEnd = k-1;
-
-          if kStart <= kEnd
-              chunkIndices = [chunkIndices; ...
-                              [kStart, kEnd]];
-          end
-      end
-
-      % Create masked data with NaN padding.
-      % Make sure that there are no NaNs at the beginning of the data since
-      % this would be interpreted as column names by Pgfplots.
-      if size(chunkIndices, 1) > 0
-          ci = chunkIndices(1,:);
-          newData = data(ci(1):ci(2), :);
-          n = size(data, 2);
-          for ci = chunkIndices(2:end,:)'
-               newData = [newData; ...
-                          NaN(1, n); ...
-                          data(ci(1):ci(2), :)];
-          end
-          data = newData;
-      end
-  end
-
-  % Override with the new data.
-  set(handle, 'XData', data(:, 1));
-  set(handle, 'YData', data(:, 2));
-  if ~isempty(zData)
-    set(handle, 'ZData', data(:, 3));
-  end
-
-  return;
-end
-% =========================================================================
-function out = segmentVisible(data, dataIsInBox, xLim, yLim)
-    % Given a bounding box {x,y}Lim, loop through all pairs of subsequent nodes
-    % in p and determine whether the line between the pair crosses the box.
-
-    n = size(data, 1);
-    out = false(n-1, 1);
-    for k = 1:n-1
-        out(k) =  (dataIsInBox(k) && all(isfinite(data(k+1,:)))) ... % one of the neighbors is inside the box
-               || (dataIsInBox(k+1) && all(isfinite(data(k,:)))) ... % and the other is finite
-               || segmentsIntersect(data(k,:), data(k+1,:), ...
-                                    [xLim(1);yLim(1)], [xLim(1);yLim(2)]) ... % left border
-               || segmentsIntersect(data(k,:), data(k+1,:), ...
-                                    [xLim(1);yLim(1)], [xLim(2);yLim(1)]) ... % bottom border
-               || segmentsIntersect(data(k,:), data(k+1,:), ...
-                                    [xLim(2);yLim(1)], [xLim(2);yLim(2)]) ... % right border
-               || segmentsIntersect(data(k,:), data(k+1,:), ...
-                                    [xLim(1);yLim(2)], [xLim(2);yLim(2)]); % top border
-    end
-
-end
-% =========================================================================
-function out = segmentsIntersect(X1, X2, X3, X4)
-  % Checks whether the segments X1--X2 and X3--X4 intersect.
-  lambda = crossLines(X1, X2, X3, X4);
-  out = all(lambda > 0.0) && all(lambda < 1.0);
-  return
-end
-% =========================================================================
-function coarsenLine(meta, handle, minimumPointsDistance)
-  % Reduce the number of data points in the line handle.
-  % Given a minimum distance at which two nodes are considered different,
-  % this can help with plots that contain a large amount of data points not
-  % all of which need to be plotted.
-  %
-  if ( abs(minimumPointsDistance) < 1.0e-15 )
-      % bail out early
-      return
-  end
-
-  % Extract the data from the current line handle.
-  xData = get(handle, 'XData');
-  yData = get(handle, 'YData');
-  zData = get(handle, 'ZData');
-  if ~isempty(zData)
-    % Don't do funny stuff when zData is present.
-    return;
-  end
-
-  data = [xData(:), yData(:)];
-
-  if isempty(data)
-      return;
-  end
-
-  % Generate a mask which is true for the first point, and all
-  % subsequent points which have a greater norm2-distance from
-  % the previous point than 'threshold'.
-  n = size(data, 1);
-
-  % Get info about log scaling.
-  isXlog = strcmp(get(meta.gca, 'XScale'), 'log');
-  isYlog = strcmp(get(meta.gca, 'YScale'), 'log');
-
-  mask = false(n, 1);
-
-  XRef = data(1,:);
-  mask(1) = true;
-  for kk = 2:n
-      % Compute the visible distance of those points,
-      % incorporating possible log-scaling of the axes.
-      visDiff = XRef - data(kk,:);
-      if isXlog
-          % visDiff(1) = log10(XRef(1)) - log10(data(kk,1));
-          visDiff(1) = log10(visDiff(1));
-      end
-      if isYlog
-          visDiff(2) = log10(visDiff(2));
-      end
-      % Check if it's larger than the threshold and
-      % update the reference point in that case.
-      if norm(visDiff) > minimumPointsDistance
-          XRef = data(kk,:);
-          mask(kk) = true;
-      end
-  end
-  mask(end) = true;
-
-  % Make sure to keep NaNs.
-  mask = mask | any(isnan(data)')';
-
-  % Set the new (masked) data.
-  set(handle, 'XData', data(mask, 1));
-  set(handle, 'YData', data(mask, 2));
-
-  return;
-end
-% =========================================================================
-function movePointsCloser(meta, handle)
-  % Move all points outside a box much larger than the visible one
-  % to the boundary of that box and make sure that lines in the visible
-  % box are preserved. This typically involves replacing one point by
-  % two new ones and a NaN.
-
-  % Extract the data from the current line handle.
-  xData = get(handle, 'XData');
-  yData = get(handle, 'YData');
-  zData = get(handle, 'ZData');
-
-  if ~isempty(zData) && any(zData(1)~=zData)
-    % Don't do funny stuff with varying zData.
-    return;
-  end
-
-  data = [xData(:), yData(:)];
-
-  xlim = get(meta.gca, 'XLim');
-  ylim = get(meta.gca, 'YLim');
-
-  xWidth = xlim(2) - xlim(1);
-  yWidth = ylim(2) - ylim(1);
-  % Don't choose the larger box too large to make sure that the values inside
-  % it can still be treated by TeX.
-  extendFactor = 0.1;
-  largeXLim = xlim + extendFactor * [-xWidth, xWidth];
-  largeYLim = ylim + extendFactor * [-yWidth, yWidth];
-
-  % Get which points are in an extended box (the limits of which
-  % don't exceed TeX's memory).
-  dataIsInLargeBox = isInBox(data(:,1:2), ...
-                             largeXLim, largeYLim);
-
-  % Count the NaNs as being inside the box.
-  dataIsInLargeBox = dataIsInLargeBox | any(isnan(data)')';
-
-  % Loop through all points which are to be included in the plot yet do not
-  % fit into the extended box, and gather the points by which they are to be
-  % replaced.
-  replaceIndices = find(~dataIsInLargeBox)';
-  m = length(replaceIndices);
-  r = cell(m, 1);
-  for k = 1:m
-      i = replaceIndices(k);
-      r{k} = [];
-      if i > 1 && all(isfinite(data(i-1,:)))
-          newPoint = moveToBox(data(i,:), data(i-1,:), largeXLim, largeYLim);
-          % Don't bother if the point is inf:
-          % There's no intersection with the large box, so even the
-          % connection between the two after they have been moved
-          % won't be probably be visible.
-          if all(isfinite(newPoint))
-              r{k} = [r{k}; newPoint];
-          end
-      end
-      if i < size(data,1) && all(isfinite(data(i+1,:)))
-          newPoint = moveToBox(data(i,:), data(i+1,:), largeXLim, largeYLim);
-          % Don't bother if the point is inf:
-          % There's no intersection with the large box, so even the
-          % connection between the two after they have been moved
-          % won't be probably be visible.
-          if all(isfinite(newPoint))
-              r{k} = [r{k}; newPoint];
-          end
-      end
-  end
-
-  % Insert all r{k}{:} at replaceIndices[k].
-  dataNew = [];
-  lastReplIndex = 0;
-  lastEntryIsReplacement = false;
-  for k = 1:m
-     % Make sure that two subsequent moved points are separated by a NaN entry.
-     % This is to make sure that there is no visible line between two moved
-     % points that wasn't there before.
-     d = data(lastReplIndex+1:replaceIndices(k)-1,:);
-     if size(r{k}, 1) == 2
-         % Two replacement entries -- pad them with a NaN.
-         rep = [r{k}(1, :); ...
-                NaN(1, size(r{k}, 2)); ...
-                r{k}(2, :)];
-     else
-         rep = r{k};
-     end
-     if isempty(d) && ~isempty(rep) && lastEntryIsReplacement
-         % The last entry was a replacment, and the first one now is.
-         % Prepend a NaN.
-         rep = [NaN(1, size(r{k}, 2)); ...
-                rep];
-     end
-     % Add the data.
-     if ~isempty(d)
-         dataNew = [dataNew; ...
-                    d];
-         lastEntryIsReplacement = false;
-     end
-     if ~isempty(rep)
-         dataNew = [dataNew; ...
-                    rep];
-         lastEntryIsReplacement = true;
-     end
-     lastReplIndex = replaceIndices(k);
-  end
-  dataNew = [dataNew; ...
-             data(lastReplIndex+1:end,:)];
-
-  % Set the new (masked) data.
-  set(handle, 'XData', dataNew(:,1));
-  set(handle, 'YData', dataNew(:,2));
-  if ~isempty(zData)
-    % As per precondition, all zData entries are equal.
-    zDataNew = zData(1) * ones(size(dataNew,1), 1);
-    set(handle, 'zData', zDataNew);
-  end
-
-  return;
-end
-% =========================================================================
-function xNew = moveToBox(x, xRef, xlim, ylim)
-  % Takes a box defined by xlim, ylim, one point x and a reference point
-  % xRef.
-  % Returns the point xNew that sits on the line segment between x and xRef
-  % *and* on the box. If several such points exist, take the closest one
-  % to x.
-
-  % Find out with which border the line x---xRef intersects, and determine
-  % the smallest parameter alpha such that x + alpha*(xRef-x)
-  % sits on the boundary.
-  minAlpha = inf;
-  % left boundary:
-  lambda = crossLines(x, xRef, [xlim(1);ylim(1)], [xlim(1);ylim(2)]);
-  if 0.0 < lambda(2) && lambda(2) < 1.0 && abs(minAlpha) > abs(lambda(1))
-      minAlpha = lambda(1);
-  end
-
-  % bottom boundary:
-  lambda = crossLines(x, xRef, [xlim(1);ylim(1)], [xlim(2);ylim(1)]);
-  if 0.0 < lambda(2) && lambda(2) < 1.0 && abs(minAlpha) > abs(lambda(1))
-      minAlpha = lambda(1);
-  end
-
-  % right boundary:
-  lambda = crossLines(x, xRef, [xlim(2);ylim(1)], [xlim(2);ylim(2)]);
-  if 0.0 < lambda(2) && lambda(2) < 1.0 && abs(minAlpha) > abs(lambda(1))
-      minAlpha = lambda(1);
-  end
-
-  % top boundary:
-  lambda = crossLines(x, xRef, [xlim(1);ylim(2)], [xlim(2);ylim(2)]);
-  if 0.0 < lambda(2) && lambda(2) < 1.0 && abs(minAlpha) > abs(lambda(1))
-      minAlpha = lambda(1);
-  end
-
-  % create the new point
-  xNew = x + minAlpha*(xRef-x);
-end
-% =========================================================================
-function out = isInBox(data, xLim, yLim)
-
-  out = data(:,1) > xLim(1) & data(:,1) < xLim(2) ...
-      & data(:,2) > yLim(1) & data(:,2) < yLim(2);
-
-end
-% =========================================================================
-function lambda = crossLines(X1, X2, X3, X4)
-  % Given four points X_k=(x_k,y_k), k\in{1,2,3,4}, and the two lines defined
-  % by those,
-  %
-  %  L1(lambda) = X1 + lambda (X2 - X1)
-  %  L2(lambda) = X3 + lambda (X4 - X3)
-  %
-  % returns the lambda for which they intersect (and Inf if they are parallel).
-  % Technically, one needs to solve the 2x2 equation system
-  %
-  %   x1 + lambda1 (x2-x1)  =  x3 + lambda2 (x4-x3)
-  %   y1 + lambda1 (y2-y1)  =  y3 + lambda2 (y4-y3)
-  %
-  % for lambda and mu.
-
-  rhs = X3(:) - X1(:);
-  % Divide by det even if it's 0: Infs are returned.
-  % A = [X2-X1, -(X4-X3)];
-  detA = -(X2(1)-X1(1))*(X4(2)-X3(2)) + (X2(2)-X1(2))*(X4(1)-X3(1));
-  invA = [-(X4(2)-X3(2)), X4(1)-X3(1);...
-          -(X2(2)-X1(2)), X2(1)-X1(1)] / detA;
-  lambda = invA * rhs;
-
-end
-% =========================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cond_2 b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cond_2
deleted file mode 100644
index 92c8bdfd0261dfb22aa789b8be103063776a2475..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cond_2
+++ /dev/null
@@ -1,38 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=4.489655in,
-height=3.541034in,
-at={(0.753103in,0.477931in)},
-scale only axis,
-separate axis lines,
-every outer x axis line/.append style={black},
-every x tick label/.append style={font=\color{black}},
-xmin=1,
-xmax=5,
-xlabel={Nombre de paramètres},
-xmajorgrids,
-every outer y axis line/.append style={black},
-every y tick label/.append style={font=\color{black}},
-ymin=80,
-ymax=170,
-ylabel={Conditionnement},
-ymajorgrids
-]
-\addplot [color=red,solid,line width=2.0pt,forget plot]
-  table[row sep=crcr]{%
-1	88.563537144876\\
-2	105.940559773145\\
-3	124.236088112109\\
-4	143.61998422876\\
-5	164.222442760817\\
-};
-\end{axis}
-\end{tikzpicture}%
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cond_2.tex b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cond_2.tex
deleted file mode 100644
index 92c8bdfd0261dfb22aa789b8be103063776a2475..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/cond_2.tex
+++ /dev/null
@@ -1,38 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=4.489655in,
-height=3.541034in,
-at={(0.753103in,0.477931in)},
-scale only axis,
-separate axis lines,
-every outer x axis line/.append style={black},
-every x tick label/.append style={font=\color{black}},
-xmin=1,
-xmax=5,
-xlabel={Nombre de paramètres},
-xmajorgrids,
-every outer y axis line/.append style={black},
-every y tick label/.append style={font=\color{black}},
-ymin=80,
-ymax=170,
-ylabel={Conditionnement},
-ymajorgrids
-]
-\addplot [color=red,solid,line width=2.0pt,forget plot]
-  table[row sep=crcr]{%
-1	88.563537144876\\
-2	105.940559773145\\
-3	124.236088112109\\
-4	143.61998422876\\
-5	164.222442760817\\
-};
-\end{axis}
-\end{tikzpicture}%
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/figure2dot.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/figure2dot.m
deleted file mode 100644
index 73df420d4e901ae55b9937784d00c3a5a7c47e62..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/figure2dot.m
+++ /dev/null
@@ -1,155 +0,0 @@
-function figure2dot(filename)
-%FIGURE2DOT    Save figure in Graphviz (.dot) file.
-%   FIGURE2DOT() saves the current figure as dot-file.
-%
-
-%   Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
-%   All rights reserved.
-%
-%   Redistribution and use in source and binary forms, with or without
-%   modification, are permitted provided that the following conditions are
-%   met:
-%
-%      * Redistributions of source code must retain the above copyright
-%        notice, this list of conditions and the following disclaimer.
-%      * Redistributions in binary form must reproduce the above copyright
-%        notice, this list of conditions and the following disclaimer in
-%        the documentation and/or other materials provided with the distribution
-%
-%   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-%   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-%   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-%   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-%   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-%   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-%   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-%   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-%   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-%   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-%   POSSIBILITY OF SUCH DAMAGE.
-%
-% =========================================================================
-  global node_number
-
-  % also show hidden handles
-  set(0, 'ShowHiddenHandles', 'on');
-
-  filehandle = fopen(filename, 'w');
-
-  % start printing
-  fprintf(filehandle, 'digraph simple_hierarchy {\n\n');
-
-  fprintf(filehandle, 'node[shape=box];\n\n');
-
-  % define the root node
-  node_number = 0;
-  p = get(gcf, 'Parent');
-  % define root element
-  type = get(p, 'Type');
-  fprintf(filehandle, 'N%d [label="%s"]\n\n', node_number, type);
-
-  % start recursion
-  plot_children(filehandle, p, node_number);
-
-  % finish off
-  fprintf(filehandle, '}');
-  fclose(filehandle);
-  set(0, 'ShowHiddenHandles', 'off');
-
-end
-% =========================================================================
-function plot_children(fh, h, id)
-
-  global node_number
-
-  % get the children
-  children = get(h, 'Children');
-
-  % -----------------------------------------------------------------------
-  % loop through the children
-  for child = children(:)'
-      % define child number
-      node_number = node_number + 1;
-      type = get(child, 'Type');
-      % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-      % skip certain entries
-      if  strcmp(type, 'uimenu'       ) || ...
-          strcmp(type, 'uitoolbar'    ) || ...
-          strcmp(type, 'uicontextmenu')
-          continue;
-      end
-      % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-      label = cell(0);
-      label = [label, sprintf('Type: %s', type)];
-
-      hClass = class(handle(child));
-      label  = [label, sprintf('Class: %s', hClass)];
-
-      tag = get(child, 'Tag');
-      if ~isempty(tag)
-          label = [label, sprintf('Tag: %s', tag)];
-      end
-
-      visibility = get(child, 'Visible');
-      color = []; % set default value
-      if ~strcmp(visibility, 'on')
-          label = [label, sprintf('Visible: %s', visibility)];
-          color = 'gray';
-      end
-
-      handlevisibility = get(child, 'HandleVisibility');
-      if ~strcmp(handlevisibility, 'on')
-          label = [label, sprintf('HandleVisibility: %s', handlevisibility)];
-      end
-
-      % gather options
-      options = cell(0);
-      if ~isempty(label)
-          options = [options, ['label=', collapse(label,'\n')]];
-      end
-      if ~isempty(color)
-          options = [options, ['color=', color]];
-      end
-
-      % print node
-      fprintf(fh, 'N%d [label="%s"]\n', node_number, collapse(label, '\n'));
-
-      % connect to the child
-      fprintf(fh, 'N%d -> N%d;\n\n', id, node_number);
-
-      % recurse
-      plot_children(fh, child, node_number);
-  end
-  % -----------------------------------------------------------------------
-
-end
-% =========================================================================
-function newstr = collapse(cellstr, delimiter)
-  % This function collapses a cell of strings to a single string (with a
-  % given delimiter inbetween two strings, if desired).
-  %
-  % Example of usage:
-  %              collapse(cellstr, ',')
-
-  if length(cellstr)<1
-     newstr = [];
-     return
-  end
-
-  if isnumeric(cellstr{1})
-      newstr = my_num2str(cellstr{1});
-  else
-      newstr = cellstr{1};
-  end
-
-  for k = 2:length(cellstr)
-      if isnumeric(cellstr{k})
-          str = my_num2str(cellstr{k});
-      else
-          str = cellstr{k};
-      end
-      newstr = [newstr, delimiter, str];
-  end
-
-end
-% =========================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/m2tInputParser.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/m2tInputParser.m
deleted file mode 100644
index 30147cddcb17e7238ed45c5267e59abdf772a909..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/m2tInputParser.m
+++ /dev/null
@@ -1,256 +0,0 @@
-function parser = m2tInputParser()
-%MATLAB2TIKZINPUTPARSER   Input parsing for matlab2tikz..
-%   This implementation exists because Octave is lacking one.
-
-%   Copyright (c) 2008--2014 Nico Schlömer
-%   All rights reserved.
-%
-%   Redistribution and use in source and binary forms, with or without
-%   modification, are permitted provided that the following conditions are
-%   met:
-%
-%       * Redistributions of source code must retain the above copyright
-%         notice, this list of conditions and the following disclaimer.
-%       * Redistributions in binary form must reproduce the above copyright
-%         notice, this list of conditions and the following disclaimer in
-%         the documentation and/or other materials provided with the distribution
-%
-%   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-%   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-%   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-%   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-%   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-%   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-%   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-%   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-%   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-%   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-%   POSSIBILITY OF SUCH DAMAGE.
-% =========================================================================
-  % Initialize the structure.
-  parser = struct ();
-  % Public Properties
-  parser.Results = {};
-  % Enabel/disable parameters case sensitivity.
-  parser.CaseSensitive = false;
-  % Keep parameters not defined by the constructor.
-  parser.KeepUnmatched = false;
-  % Enable/disable warning for parameters not defined by the constructor.
-  parser.WarnUnmatched = true;
-  % Enable/disable passing arguments in a structure.
-  parser.StructExpand = true;
-  % Names of parameters defined in input parser constructor.
-  parser.Parameters = {};
-  % Names of parameters not defined in the constructor.
-  parser.Unmatched = struct ();
-  % Names of parameters using default values.
-  parser.UsingDefaults = {};
-  % Names of deprecated parameters and their alternatives
-  parser.DeprecatedParameters = struct();
-
-  % Handles for functions that act on the object.
-  parser.addRequired    = @addRequired;
-  parser.addOptional    = @addOptional;
-  parser.addParamValue  = @addParamValue;
-  parser.deprecateParam = @deprecateParam;
-  parser.parse          = @parse;
-
-  % Initialize the parser plan
-  parser.plan = {};
-end
-% =========================================================================
-function p = parser_plan (q, arg_type, name, default, validator)
-  p = q;
-  plan = p.plan;
-  if (isempty (plan))
-    plan = struct ();
-    n = 1;
-  else
-    n = numel (plan) + 1;
-  end
-  plan(n).type      = arg_type;
-  plan(n).name      = name;
-  plan(n).default   = default;
-  plan(n).validator = validator;
-  p.plan = plan;
-end
-% =========================================================================
-function p = addRequired (p, name, validator)
-  p = parser_plan (p, 'required', name, [], validator);
-end
-% =========================================================================
-function p = addOptional (p, name, default, validator)
-  p = parser_plan (p, 'optional', name, default, validator);
-end
-% =========================================================================
-function p = addParamValue (p, name, default, validator)
-  p = parser_plan (p, 'paramvalue', name, default, validator);
-end
-% =========================================================================
-function p = deprecateParam (p, name, alternatives)
-  if isempty(alternatives)
-      alternatives = {};
-  elseif ischar(alternatives)
-      alternatives = {alternatives}; % make cellstr
-  elseif ~iscellstr(alternatives)
-      error('m2tInputParser:BadAlternatives',...
-            'Alternatives for a deprecated parameter must be a char or cellstr');
-  end
-  p.DeprecatedParameters.(name) = alternatives;
-end
-% =========================================================================
-function p = parse (p, varargin)
-  plan = p.plan;
-  results = p.Results;
-  using_defaults = {};
-  if (p.CaseSensitive)
-    name_cmp = @strcmp;
-  else
-    name_cmp = @strcmpi;
-  end
-  if (p.StructExpand)
-    k = find (cellfun (@isstruct, varargin));
-    for m = numel(k):-1:1
-      n = k(m);
-      s = varargin{n};
-      c = [fieldnames(s).'; struct2cell(s).'];
-      c = c(:).';
-      if (n > 1 && n < numel (varargin))
-        varargin = horzcat (varargin(1:n-1), c, varargin(n+1:end));
-      elseif (numel (varargin) == 1)
-        varargin = c;
-      elseif (n == 1);
-        varargin = horzcat (c, varargin(n+1:end));
-      else % n == numel (varargin)
-        varargin = horzcat (varargin(1:n-1), c);
-      end
-    end
-  end
-  if (isempty (results))
-    results = struct ();
-  end
-  type = {plan.type};
-  n = find( strcmp( type, 'paramvalue' ) );
-  m = setdiff (1:numel( plan ), n );
-  plan = plan ([n,m]);
-  for n = 1 : numel (plan)
-    found = false;
-    results.(plan(n).name) = plan(n).default;
-    if (~ isempty (varargin))
-      switch plan(n).type
-      case 'required'
-        found = true;
-        if (strcmpi (varargin{1}, plan(n).name))
-          varargin(1) = [];
-        end
-        value = varargin{1};
-        varargin(1) = [];
-      case 'optional'
-        m = find (cellfun (@ischar, varargin));
-        k = find (name_cmp (plan(n).name, varargin(m)));
-        if (isempty (k) && validate_arg (plan(n).validator, varargin{1}))
-          found = true;
-          value = varargin{1};
-          varargin(1) = [];
-        elseif (~ isempty (k))
-          m = m(k);
-          found = true;
-          value = varargin{max(m)+1};
-          varargin(union(m,m+1)) = [];
-        end
-      case 'paramvalue'
-        m = find( cellfun (@ischar, varargin) );
-        k = find (name_cmp (plan(n).name, varargin(m)));
-        if (~ isempty (k))
-          found = true;
-          m = m(k);
-          value = varargin{max(m)+1};
-          varargin(union(m,m+1)) = [];
-        end
-      otherwise
-        error( sprintf ('%s:parse', mfilename), ...
-               'parse (%s): Invalid argument type.', mfilename ...
-             )
-      end
-    end
-    if (found)
-      if (validate_arg (plan(n).validator, value))
-        results.(plan(n).name) = value;
-      else
-        error( sprintf ('%s:invalidinput', mfilename), ...
-               '%s: Input argument ''%s'' has invalid value.\n', mfilename, plan(n).name ...
-             );
-      end
-      p.Parameters = union (p.Parameters, {plan(n).name});
-    elseif (strcmp (plan(n).type, 'required'))
-      error( sprintf ('%s:missinginput', mfilename), ...
-             '%s: input ''%s'' is missing.\n', mfilename, plan(n).name ...
-           );
-    else
-      using_defaults = union (using_defaults, {plan(n).name});
-    end
-  end
-
-  if ~isempty(varargin)
-    % Include properties that do not match specified properties
-      for n = 1:2:numel(varargin)
-        if ischar(varargin{n})
-          if p.KeepUnmatched
-            results.(varargin{n}) = varargin{n+1};
-          end
-          if p.WarnUnmatched
-            warning(sprintf('%s:unmatchedArgument',mfilename), ...
-                    'Ignoring unknown argument "%s"', varargin{n});
-          end
-          p.Unmatched.(varargin{n}) = varargin{n+1};
-        else
-          error (sprintf ('%s:invalidinput', mfilename), ...
-                 '%s: invalid input', mfilename)
-        end
-      end
-  end
-
-  % Store the results of the parsing
-  p.Results = results;
-  p.UsingDefaults = using_defaults;
-
-  warnForDeprecatedParameters(p);
-end
-% =========================================================================
-function result = validate_arg (validator, arg)
-  try
-    result = validator (arg);
-  catch %#ok
-    result = false;
-  end
-end
-% =========================================================================
-function warnForDeprecatedParameters(p)
-  usedDeprecatedParameters = intersect(p.Parameters, fieldnames(p.DeprecatedParameters));
-
-  for iParam = 1:numel(usedDeprecatedParameters)
-      oldParameter = usedDeprecatedParameters{iParam};
-      alternatives = p.DeprecatedParameters.(oldParameter);
-
-      switch numel(alternatives)
-          case 0
-              replacements = '';
-          case 1
-              replacements = ['''' alternatives{1} ''''];
-          otherwise
-              replacements = deblank(sprintf('''%s'' and ',alternatives{:}));
-              replacements = regexprep(replacements,' and$','');
-      end
-      if ~isempty(replacements)
-          replacements = sprintf('From now on, please use %s to control the output.\n',replacements);
-      end
-
-      message = ['\n===============================================================================\n', ...
-                  'You are using the deprecated parameter ''%s''.\n', ...
-                  '%s', ...
-                  '==============================================================================='];
-      warning('matlab2tikz:deprecatedParameter', ...
-                message, oldParameter, replacements);
-
-  end
-end
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/matlab2tikz.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/matlab2tikz.m
deleted file mode 100644
index faae1d0578b4da27dab5a8e85dbe4f87a7b53efd..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/matlab2tikz.m
+++ /dev/null
@@ -1,5555 +0,0 @@
-function matlab2tikz(varargin)
-%MATLAB2TIKZ    Save figure in native LaTeX (TikZ/Pgfplots).
-%   MATLAB2TIKZ() saves the current figure as LaTeX file.
-%   MATLAB2TIKZ comes with several options that can be combined at will.
-%
-%   MATLAB2TIKZ(FILENAME,...) or MATLAB2TIKZ('filename',FILENAME,...)
-%   stores the LaTeX code in FILENAME.
-%
-%   MATLAB2TIKZ('filehandle',FILEHANDLE,...) stores the LaTeX code in the file
-%   referenced by FILEHANDLE. (default: [])
-%
-%   MATLAB2TIKZ('figurehandle',FIGUREHANDLE,...) explicitly specifies the
-%   handle of the figure that is to be stored. (default: gcf)
-%
-%   MATLAB2TIKZ('colormap',DOUBLE,...) explicitly specifies the colormap to be
-%   used. (default: current color map)
-%
-%   MATLAB2TIKZ('strict',BOOL,...) tells MATLAB2TIKZ to adhere to MATLAB(R)
-%   conventions wherever there is room for relaxation. (default: false)
-%
-%   MATLAB2TIKZ('strictFontSize',BOOL,...) retains the exact font sizes
-%   specified in MATLAB for the TikZ code. This goes against normal LaTeX
-%   practice. (default: false)
-%
-%   MATLAB2TIKZ('showInfo',BOOL,...) turns informational output on or off.
-%   (default: true)
-%
-%   MATLAB2TIKZ('showWarnings',BOOL,...) turns warnings on or off.
-%   (default: true)
-%
-%   MATLAB2TIKZ('imagesAsPng',BOOL,...) stores MATLAB(R) images as (lossless)
-%   PNG files. This is more efficient than storing the image color data as TikZ
-%   matrix. (default: true)
-%
-%   MATLAB2TIKZ('externalData',BOOL,...) stores all data points in external
-%   files as tab separated values (TSV files). (default: false)
-%
-%   MATLAB2TIKZ('dataPath',CHAR, ...) defines where external data files
-%   and/or PNG figures are saved. It can be either an absolute or a relative
-%   path with respect to your MATLAB work directory. By default, data files are
-%   placed in the same directory as the TikZ output file. To place data files
-%   in your MATLAB work directory, you can use '.'. (default: [])
-%
-%   MATLAB2TIKZ('relativeDataPath',CHAR, ...) tells MATLAB2TIKZ to use the
-%   given path to follow the external data files and PNG files. This is the
-%   relative path from your main LaTeX file to the data file directory.
-%   By default the same directory is used as the output (default: [])
-%
-%   MATLAB2TIKZ('height',CHAR,...) sets the height of the image. This can be
-%   any LaTeX-compatible length, e.g., '3in' or '5cm' or '0.5\textwidth'.  If
-%   unspecified, MATLAB2TIKZ tries to make a reasonable guess.
-%
-%   MATLAB2TIKZ('width',CHAR,...) sets the width of the image.
-%   If unspecified, MATLAB2TIKZ tries to make a reasonable guess.
-%
-%   MATLAB2TIKZ('noSize',BOOL,...) determines whether 'width', 'height', and
-%   'scale only axis' are specified in the generated TikZ output. For compatibility with the
-%   tikzscale package set this to true. (default: false)
-%
-%   MATLAB2TIKZ('extraCode',CHAR or CELLCHAR,...) explicitly adds extra code
-%   at the beginning of the output file. (default: [])
-%
-%   MATLAB2TIKZ('extraCodeAtEnd',CHAR or CELLCHAR,...) explicitly adds extra
-%   code at the end of the output file. (default: [])
-%
-%   MATLAB2TIKZ('extraAxisOptions',CHAR or CELLCHAR,...) explicitly adds extra
-%   options to the Pgfplots axis environment. (default: [])
-%
-%   MATLAB2TIKZ('extraColors', {{'name',[R G B]}, ...} , ...) adds
-%   user-defined named RGB-color definitions to the TikZ output.
-%   R, G and B are expected between 0 and 1. (default: {})
-%
-%   MATLAB2TIKZ('extraTikzpictureOptions',CHAR or CELLCHAR,...)
-%   explicitly adds extra options to the tikzpicture environment. (default: [])
-%
-%   MATLAB2TIKZ('encoding',CHAR,...) sets the encoding of the output file.
-%
-%   MATLAB2TIKZ('floatFormat',CHAR,...) sets the format used for float values.
-%   You can use this to decrease the file size. (default: '%.15g')
-%
-%   MATLAB2TIKZ('maxChunkLength',INT,...) sets maximum number of data points
-%   per \addplot for line plots (default: 4000)
-%
-%   MATLAB2TIKZ('parseStrings',BOOL,...) determines whether title, axes labels
-%   and the like are parsed into LaTeX by MATLAB2TIKZ's parser.
-%   If you want greater flexibility, set this to false and use straight LaTeX
-%   for your labels. (default: true)
-%
-%   MATLAB2TIKZ('parseStringsAsMath',BOOL,...) determines whether to use TeX's
-%   math mode for more characters (e.g. operators and figures). (default: false)
-%
-%   MATLAB2TIKZ('showHiddenStrings',BOOL,...) determines whether to show
-%   strings whose were deliberately hidden. This is usually unnecessary, but
-%   can come in handy for unusual plot types (e.g., polar plots). (default:
-%   false)
-%
-%   MATLAB2TIKZ('interpretTickLabelsAsTex',BOOL,...) determines whether to
-%   interpret tick labels as TeX. MATLAB(R) doesn't do that by default.
-%   (default: false)
-%
-%   MATLAB2TIKZ('tikzFileComment',CHAR,...) adds a custom comment to the header
-%   of the output file. (default: '')
-%
-%   MATLAB2TIKZ('automaticLabels',BOOL,...) determines whether to automatically
-%   add labels to plots (where applicable) which make it possible to refer
-%   to them using \ref{...} (e.g., in the caption of a figure). (default: false)
-%
-%   MATLAB2TIKZ('standalone',BOOL,...) determines whether to produce
-%   a standalone compilable LaTeX file. Setting this to true may be useful for
-%   taking a peek at what the figure will look like. (default: false)
-%
-%   MATLAB2TIKZ('checkForUpdates',BOOL,...) determines whether to automatically
-%   check for updates of matlab2tikz. (default: true)
-%
-%   Example
-%      x = -pi:pi/10:pi;
-%      y = tan(sin(x)) - sin(tan(x));
-%      plot(x,y,'--rs');
-%      matlab2tikz('myfile.tex');
-%
-
-%   Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
-%   All rights reserved.
-%
-%   Redistribution and use in source and binary forms, with or without
-%   modification, are permitted provided that the following conditions are
-%   met:
-%
-%      * Redistributions of source code must retain the above copyright
-%        notice, this list of conditions and the following disclaimer.
-%      * Redistributions in binary form must reproduce the above copyright
-%        notice, this list of conditions and the following disclaimer in
-%        the documentation and/or other materials provided with the distribution
-%
-%   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-%   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-%   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-%   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-%   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-%   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-%   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-%   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-%   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-%   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-%   POSSIBILITY OF SUCH DAMAGE.
-
-%   Note:
-%   This program was based on Paul Wagenaars' Matfig2PGF that can be
-%   found on http://www.mathworks.com/matlabcentral/fileexchange/12962 .
-
-%% Check if we are in MATLAB or Octave.
-[m2t.env, m2t.envVersion] = getEnvironment();
-
-minimalVersion = struct('MATLAB', struct('name','2014a', 'num',[8 3]), ...
-                        'Octave', struct('name','3.8', 'num',[3 8]));
-checkDeprecatedEnvironment(m2t, minimalVersion);
-
-m2t.cmdOpts = [];
-m2t.currentHandles = [];
-
-m2t.transform = []; % For hgtransform groups
-m2t.pgfplotsVersion = [1,3];
-m2t.name = 'matlab2tikz';
-m2t.version = '0.6.0';
-m2t.author = 'Nico Schlömer';
-m2t.authorEmail = 'nico.schloemer@gmail.com';
-m2t.years = '2008--2014';
-m2t.website = 'http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz';
-VCID = VersionControlIdentifier();
-m2t.versionFull = strtrim(sprintf('v%s %s', m2t.version, VCID));
-
-m2t.tol = 1.0e-15; % numerical tolerance (e.g. used to test equality of doubles)
-m2t.imageAsPngNo = 0;
-m2t.dataFileNo   = 0;
-m2t.barplotId    = 0; % identification flag for bar plots
-m2t.quiverId     = 0; % identification flag for quiver plot styles
-m2t.automaticLabelIndex = 0;
-
-% definition of color depth
-m2t.colorDepth     = 48; %[bit] RGB color depth (typical values: 24, 30, 48)
-m2t.colorPrecision = 2^(-m2t.colorDepth/3);
-m2t.colorFormat    = sprintf('%%0.%df',ceil(-log10(m2t.colorPrecision)));
-
-% the actual contents of the TikZ file go here
-m2t.content = struct('name',     '', ...
-                     'comment',  [], ...
-                     'options',  {opts_new()}, ...
-                     'content',  {cell(0)}, ...
-                     'children', {cell(0)});
-m2t.preamble = sprintf(['\\usepackage{pgfplots}\n', ...
-                        '\\usepackage{grffile}\n', ...
-                        '\\pgfplotsset{compat=newest}\n', ...
-                        '\\usetikzlibrary{plotmarks}\n', ...
-                        '\\usepackage{amsmath}\n']);
-
-%% scan the options
-ipp = m2tInputParser;
-
-ipp = ipp.addOptional(ipp, 'filename',   '', @(x) filenameValidation(x,ipp));
-ipp = ipp.addOptional(ipp, 'filehandle', [], @filehandleValidation);
-
-ipp = ipp.addParamValue(ipp, 'figurehandle', get(0,'CurrentFigure'), @ishandle);
-ipp = ipp.addParamValue(ipp, 'colormap', [], @isnumeric);
-ipp = ipp.addParamValue(ipp, 'strict', false, @islogical);
-ipp = ipp.addParamValue(ipp, 'strictFontSize', false, @islogical);
-ipp = ipp.addParamValue(ipp, 'showInfo', true, @islogical);
-ipp = ipp.addParamValue(ipp, 'showWarnings', true, @islogical);
-ipp = ipp.addParamValue(ipp, 'checkForUpdates', true, @islogical);
-
-ipp = ipp.addParamValue(ipp, 'encoding' , '', @ischar);
-ipp = ipp.addParamValue(ipp, 'standalone', false, @islogical);
-ipp = ipp.addParamValue(ipp, 'tikzFileComment', '', @ischar);
-ipp = ipp.addParamValue(ipp, 'extraColors', {}, @iscolordefinitions);
-ipp = ipp.addParamValue(ipp, 'extraCode', {}, @isCellOrChar);
-ipp = ipp.addParamValue(ipp, 'extraCodeAtEnd', {}, @isCellOrChar);
-ipp = ipp.addParamValue(ipp, 'extraAxisOptions', {}, @isCellOrChar);
-ipp = ipp.addParamValue(ipp, 'extraTikzpictureOptions', {}, @isCellOrChar);
-ipp = ipp.addParamValue(ipp, 'floatFormat', '%.15g', @ischar);
-ipp = ipp.addParamValue(ipp, 'automaticLabels', false, @islogical);
-ipp = ipp.addParamValue(ipp, 'showHiddenStrings', false, @islogical);
-ipp = ipp.addParamValue(ipp, 'height', '', @ischar);
-ipp = ipp.addParamValue(ipp, 'width' , '', @ischar);
-ipp = ipp.addParamValue(ipp, 'imagesAsPng', true, @islogical);
-ipp = ipp.addParamValue(ipp, 'externalData', false, @islogical);
-ipp = ipp.addParamValue(ipp, 'dataPath', '', @ischar);
-ipp = ipp.addParamValue(ipp, 'relativeDataPath', '', @ischar);
-ipp = ipp.addParamValue(ipp, 'noSize', false, @islogical);
-
-% Maximum chunk length.
-% TeX parses files line by line with a buffer of size buf_size. If the
-% plot has too many data points, pdfTeX's buffer size may be exceeded.
-% As a work-around, the plot is split into several smaller chunks.
-%
-% What is a "large" array?
-% TeX parser buffer is buf_size=200 000 char on Mac TeXLive, let's say
-% 100 000 to be on the safe side.
-% 1 point is represented by 25 characters (estimation): 2 coordinates (10
-% char), 2 brackets, comma and white space, + 1 extra char.
-% That gives a magic arbitrary number of 4000 data points per array.
-ipp = ipp.addParamValue(ipp, 'maxChunkLength', 4000, @isnumeric);
-
-% By default strings like axis labels are parsed to match the appearance of
-% strings as closely as possible to that generated by MATLAB.
-% If the user wants to have particular strings in the matlab2tikz output that
-% can't be generated in MATLAB, they can disable string parsing. In that case
-% all strings are piped literally to the LaTeX output.
-ipp = ipp.addParamValue(ipp, 'parseStrings', true, @islogical);
-
-% In addition to regular string parsing, an additional stage can be enabled
-% which uses TeX's math mode for more characters like figures and operators.
-ipp = ipp.addParamValue(ipp, 'parseStringsAsMath', false, @islogical);
-
-% As opposed to titles, axis labels and such, MATLAB(R) does not interpret tick
-% labels as TeX. matlab2tikz retains this behavior, but if it is desired to
-% interpret the tick labels as TeX, set this option to true.
-ipp = ipp.addParamValue(ipp, 'interpretTickLabelsAsTex', false, @islogical);
-
-%% deprecated parameters (will auto-generate warnings upon parse)
-ipp = ipp.addParamValue(ipp, 'relativePngPath', '', @ischar);
-ipp = ipp.deprecateParam(ipp, 'relativePngPath', 'relativeDataPath');
-
-%% Finally parse all the arguments
-ipp = ipp.parse(ipp, varargin{:});
-m2t.cmdOpts = ipp; % store the input parser back into the m2t data struct
-
-%% inform users of potentially dangerous options
-warnAboutParameter(m2t, 'parseStringsAsMath', @(opt)(opt==true), ...
-    ['This may produce undesirable string output. For full control over output\n', ...
-     'strings please set the parameter "parseStrings" to false.']);
-warnAboutParameter(m2t, 'noSize', @(opt)(opt==true), ...
-     'This may impede both axes sizing and placement!');
-warnAboutParameter(m2t, 'imagesAsPng', @(opt)(opt==false), ...
-     ['It is highly recommended to use PNG data to store images.\n', ...
-      'Make sure to set "imagesAsPng" to true.']);
-
-% The following color RGB-values which will need to be defined.
-% 'extraRgbColorNames' contains their designated names, 'extraRgbColorSpecs'
-% their specifications.
-[m2t.extraRgbColorNames, m2t.extraRgbColorSpecs] = ...
-    dealColorDefinitions(m2t.cmdOpts.Results.extraColors);
-
-%% shortcut
-m2t.ff = m2t.cmdOpts.Results.floatFormat;
-
-%% add global elements
-if isempty(m2t.cmdOpts.Results.figurehandle)
-    error('matlab2tikz:figureNotFound','MATLAB figure not found.');
-end
-m2t.currentHandles.gcf = m2t.cmdOpts.Results.figurehandle;
-if m2t.cmdOpts.Results.colormap
-    m2t.currentHandles.colormap = m2t.cmdOpts.Results.colormap;
-else
-    m2t.currentHandles.colormap = get(m2t.currentHandles.gcf, 'colormap');
-end
-
-%% handle output file handle/file name
-[m2t, fid, fileWasOpen] = openFileForOutput(m2t);
-
-% By default, reference the PNG (if required) from the TikZ file
-% as the file path of the TikZ file itself. This works if the MATLAB script
-% is executed in the same folder where the TeX file sits.
-if isempty(m2t.cmdOpts.Results.relativeDataPath)
-    if ~isempty(m2t.cmdOpts.Results.relativePngPath)
-        %NOTE: eventually break backwards compatibility of relative PNG path
-        m2t.relativeDataPath = m2t.cmdOpts.Results.relativePngPath;
-        userWarning(m2t, ['Using "relativePngPath" for "relativeDataPath".', ...
-            ' This will stop working in a future release.']);
-    else
-        m2t.relativeDataPath = m2t.cmdOpts.Results.relativeDataPath;
-    end
-else
-    m2t.relativeDataPath = m2t.cmdOpts.Results.relativeDataPath;
-end
-if isempty(m2t.cmdOpts.Results.dataPath)
-    m2t.dataPath = fileparts(m2t.tikzFileName);
-else
-    m2t.dataPath = m2t.cmdOpts.Results.dataPath;
-end
-
-
-userInfo(m2t, ['(To disable info messages, pass [''showInfo'', false] to matlab2tikz.)\n', ...
-    '(For all other options, type ''help matlab2tikz''.)\n']);
-
-userInfo(m2t, '\nThis is %s %s.\n', m2t.name, m2t.versionFull)
-
-%% Check for a new matlab2tikz version outside version control
-if m2t.cmdOpts.Results.checkForUpdates && isempty(VCID)
-  m2tUpdater(...
-    m2t.name, ...
-    m2t.website, ...
-    m2t.version, ...
-    m2t.cmdOpts.Results.showInfo, ...
-    m2t.env...
-    );
-end
-
-%% print some version info to the screen
-versionInfo = ['The latest updates can be retrieved from\n'         ,...
-               '   %s\n'                                            ,...
-               'where you can also make suggestions and rate %s.\n' ,...
-               'For usage instructions, bug reports, the latest '   ,...
-               'development versions and more, see\n'               ,...
-               '   https://github.com/matlab2tikz/matlab2tikz,\n'       ,...
-               '   https://github.com/matlab2tikz/matlab2tikz/wiki,\n'  ,...
-               '   https://github.com/matlab2tikz/matlab2tikz/issues.\n'];
-userInfo(m2t, versionInfo, m2t.website, m2t.name);
-
-%% Save the figure as TikZ to file
-saveToFile(m2t, fid, fileWasOpen);
-end
-% ==============================================================================
-function [m2t, fid, fileWasOpen] = openFileForOutput(m2t)
-% opens the output file and/or show a dialog to select one
-if ~isempty(m2t.cmdOpts.Results.filehandle)
-    fid     = m2t.cmdOpts.Results.filehandle;
-    fileWasOpen = true;
-    if ~isempty(m2t.cmdOpts.Results.filename)
-        userWarning(m2t, ...
-            'File handle AND file name for output given. File handle used, file name discarded.')
-    end
-else
-    fileWasOpen = false;
-    % set filename
-    if ~isempty(m2t.cmdOpts.Results.filename)
-        filename = m2t.cmdOpts.Results.filename;
-    else
-        [filename, pathname] = uiputfile({'*.tex;*.tikz'; '*.*'}, 'Save File');
-        filename = fullfile(pathname, filename);
-    end
-
-    fid = fileOpenForWrite(m2t, filename);
-end
-m2t.tikzFileName = fopen(fid);
-end
-% ==============================================================================
-function l = filenameValidation(x, p)
-% is the filename argument NOT another keyword?
-    l = ischar(x) && ~any(strcmp(x,p.Parameters));
-end
-% ==============================================================================
-function l = filehandleValidation(x)
-% is the filehandle the handle to an opened file?
-    l = isnumeric(x) && any(x==fopen('all'));
-end
-% ==============================================================================
-function l = isCellOrChar(x)
-    l = iscell(x) || ischar(x);
-end
-% ==============================================================================
-function isValid = iscolordefinitions(colors)
-    isRGBTuple   = @(c)( numel(c) == 3 && all(0<=c & c<=1) );
-    isValidEntry = @(e)( iscell(e) && ischar(e{1}) && isRGBTuple(e{2}) );
-
-    isValid = iscell(colors) && all(cellfun(isValidEntry, colors));
-end
-% ==============================================================================
-function fid = fileOpenForWrite(m2t, filename)
-    encoding = switchMatOct(m2t, {'native', m2t.cmdOpts.Results.encoding}, {});
-
-    fid      = fopen(filename, 'w', encoding{:});
-    if fid == -1
-        error('matlab2tikz:fileOpenError', ...
-            'Unable to open file ''%s'' for writing.', filename);
-    end
-end
-% ==============================================================================
-function path = TeXpath(path)
-    path = strrep(path, filesep, '/');
-% TeX uses '/' as a file separator (as UNIX). Windows, however, uses
-% '\' which is not supported by TeX as a file separator
-end
-% ==============================================================================
-function m2t = saveToFile(m2t, fid, fileWasOpen)
-% Save the figure as TikZ to a file. All other routines are called from here.
-
-    % It is important to turn hidden handles on, as visible lines (such as the
-    % axes in polar plots, for example), are otherwise hidden from their
-    % parental handles (and can hence not be discovered by matlab2tikz).
-    % With ShowHiddenHandles 'on', there is no escape. :)
-    set(0, 'ShowHiddenHandles', 'on');
-
-    % get all axes handles
-    [m2t, axesHandles] = findPlotAxes(m2t, m2t.currentHandles.gcf);
-
-    % Turn around the handles vector to make sure that plots that appeared
-    % first also appear first in the vector. This has effects on the alignment
-    % and the order in which the plots appear in the final TikZ file.
-    % In fact, this is not really important but makes things more 'natural'.
-    axesHandles = axesHandles(end:-1:1);
-
-    % Alternative Positioning of axes.
-    % Select relevant Axes and draw them.
-    [relevantAxesHandles, axesBoundingBox] = getRelevantAxes(m2t, axesHandles);
-
-    m2t.axesBoundingBox = axesBoundingBox;
-    m2t.axesContainers = {};
-    for relevantAxesHandle = relevantAxesHandles
-        m2t = drawAxes(m2t, relevantAxesHandle);
-    end
-
-    % Handle color bars.
-    for cbar = m2t.cbarHandles(:)'
-        m2t = handleColorbar(m2t, cbar);
-    end
-
-    % Add all axes containers to the file contents.
-    for axesContainer = m2t.axesContainers
-        m2t.content = addChildren(m2t.content, axesContainer);
-    end
-
-    set(0, 'ShowHiddenHandles', 'off');
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % actually print the stuff
-    minimalPgfplotsVersion = formatPgfplotsVersion(m2t, m2t.pgfplotsVersion);
-
-    environment = sprintf('%s %s',m2t.env, m2t.envVersion);
-    m2t.content.comment = sprintf(['This file was created by %s.\n', ...
-        ' Minimal pgfplots version: %s\n'], ...
-        m2t.name, ...
-        minimalPgfplotsVersion);
-
-    if m2t.cmdOpts.Results.showInfo
-        % disable this info if showInfo=false
-        m2t.content.comment = [m2t.content.comment, ...
-            sprintf(['\n',...
-            'The latest updates can be retrieved from\n', ...
-            '  %s\n', ...
-            'where you can also make suggestions and rate %s.\n'], ...
-            m2t.website, m2t.name ) ...
-            ];
-    end
-
-    userInfo(m2t, 'You will need pgfplots version %s or newer to compile the TikZ output.',...
-        minimalPgfplotsVersion);
-
-    % Add custom comment.
-    if ~isempty(m2t.cmdOpts.Results.tikzFileComment)
-        m2t.content.comment = [m2t.content.comment, ...
-            sprintf('\n%s\n', m2t.cmdOpts.Results.tikzFileComment)
-            ];
-    end
-
-    m2t.content.name = 'tikzpicture';
-
-    % Add custom TikZ options if any given.
-    m2t.content.options = opts_append_userdefined(m2t.content.options, ...
-                                   m2t.cmdOpts.Results.extraTikzpictureOptions);
-
-    m2t.content.colors = generateColorDefinitions(m2t.extraRgbColorNames, ...
-                            m2t.extraRgbColorSpecs, m2t.colorFormat);
-
-    % Finally print it to the file,
-    addComments(fid, m2t.content.comment);
-
-    if m2t.cmdOpts.Results.standalone
-        fprintf(fid, '\\documentclass[tikz]{standalone}\n%s\n',  m2t.preamble);
-    end
-
-    addCustomCode(fid, '', m2t.cmdOpts.Results.extraCode, '');
-
-    if m2t.cmdOpts.Results.standalone
-        fprintf(fid, '\\begin{document}\n');
-    end
-    % printAll() handles the actual figure plotting.
-    printAll(m2t, m2t.content, fid);
-
-    addCustomCode(fid, '\n', m2t.cmdOpts.Results.extraCodeAtEnd, '');
-
-    if m2t.cmdOpts.Results.standalone
-        fprintf(fid, '\n\\end{document}');
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-    % close the file if necessary
-    if ~fileWasOpen
-        fclose(fid);
-    end
-end
-% ==============================================================================
-function str = generateColorDefinitions(names, specs, colorFormat)
-% output the color definitions to LaTeX
-    str = '';
-    ff  = colorFormat;
-    if ~isempty(names)
-        m2t.content.colors = sprintf('%%\n%% defining custom colors\n');
-        for k = 1:length(names)
-            % make sure to append with '%' to avoid spacing woes
-            str = [str, ...
-                sprintf(['\\definecolor{%s}{rgb}{', ff, ',', ff, ',', ff,'}%%\n'], ...
-                names{k}', specs{k})];
-        end
-        str = [str sprintf('%%\n')];
-    end
-end
-% ==============================================================================
-function [m2t, axesHandles] = findPlotAxes(m2t, fh)
-% find axes handles that are not legends/colorbars
-    % NOTE: also do R2014b to avoid code duplication
-    axesHandles = findobj(fh, 'type', 'axes');
-
-    % Remove all legend handles as they are treated separately.
-    if ~isempty(axesHandles)
-        % TODO fix for octave
-        tagKeyword = switchMatOct(m2t, 'Tag', 'tag');
-        % Find all legend handles. This is MATLAB-only.
-        m2t.legendHandles = findobj(fh, tagKeyword, 'legend');
-        m2t.legendHandles = m2t.legendHandles(:)';
-        axesHandles = setdiff(axesHandles, m2t.legendHandles);
-    end
-
-    % Remove all legend handles as they are treated separately.
-    if ~isempty(axesHandles)
-        colorbarKeyword = switchMatOct(m2t, 'Colorbar', 'colorbar');
-        % Find all colorbar handles. This is MATLAB-only.
-        cbarHandles = findobj(fh, tagKeyword, colorbarKeyword);
-        % Octave also finds text handles here; no idea why. Filter.
-        m2t.cbarHandles = [];
-        for h = cbarHandles(:)'
-          if strcmpi(get(h, 'Type'),'axes')
-            m2t.cbarHandles = [m2t.cbarHandles, h];
-          end
-        end
-        m2t.cbarHandles = m2t.cbarHandles(:)';
-        axesHandles = setdiff(axesHandles, m2t.cbarHandles);
-    else
-        m2t.cbarHandles = [];
-    end
-
-end
-% ==============================================================================
-function addComments(fid, comment)
-% prints TeX comments to file stream |fid|
-    if ~isempty(comment)
-        newline = sprintf('\n');
-        newlineTeX = sprintf('\n%%');
-        fprintf(fid, '%% %s\n', strrep(comment, newline, newlineTeX));
-    end
-end
-% ==============================================================================
-function addCustomCode(fid, before, code, after)
-    if ~isempty(code)
-        fprintf(fid, before);
-        if ischar(code)
-            code = {code};
-        end
-        if iscellstr(code)
-            for str = code(:)'
-                fprintf(fid, '%s\n', str{1});
-            end
-        else
-            error('matlab2tikz:saveToFile', 'Need str or cellstr.');
-        end
-        fprintf(fid,after);
-    end
-end
-% ==============================================================================
-function [m2t, pgfEnvironments] = handleAllChildren(m2t, handle)
-% Draw all children of a graphics object (if they need to be drawn).
-% #COMPLEX: mainly a switch-case
-    str = '';
-    children = get(handle, 'Children');
-
-    % prepare cell array of pgfEnvironments
-    pgfEnvironments = cell(0);
-
-    % It's important that we go from back to front here, as this is
-    % how MATLAB does it, too. Significant for patch (contour) plots,
-    % and the order of plotting the colored patches.
-    for child = children(end:-1:1)'
-        % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-        [m2t, legendString, interpreter] = findLegendInformation(m2t, child);
-        % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-        switch char(get(child, 'Type'))
-            % 'axes' environments are treated separately.
-
-            case 'line'
-                [m2t, str] = drawLine(m2t, child);
-
-            case 'patch'
-                [m2t, str] = drawPatch(m2t, child);
-
-            case 'image'
-                [m2t, str] = drawImage(m2t, child);
-
-            case 'contour'
-                [m2t, str] = drawContour(m2t, child);
-
-            case {'hggroup', 'matlab.graphics.primitive.Group', ...
-                  'scatter', 'bar', 'stair', 'stem' ,'errorbar', 'area', ...
-                  'quiver'}
-                [m2t, str] = drawHggroup(m2t, child);
-
-            case 'hgtransform'
-                % From http://www.mathworks.de/de/help/matlab/ref/hgtransformproperties.html:
-                % Matrix: 4-by-4 matrix
-                %   Transformation matrix applied to hgtransform object and its
-                %   children. The hgtransform object applies the transformation
-                %   matrix to all its children.
-                % More information at http://www.mathworks.de/de/help/matlab/creating_plots/group-objects.html.
-                m2t.transform = get(child, 'Matrix');
-                [m2t, str] = handleAllChildren(m2t, child);
-                m2t.transform = [];
-
-            case 'surface'
-                [m2t, str] = drawSurface(m2t, child);
-
-            case 'text'
-                [m2t, str] = drawVisibleText(m2t, child);
-
-            case 'rectangle'
-                [m2t, str] = drawRectangle(m2t, child);
-
-            case {'uitoolbar', 'uimenu', 'uicontextmenu', 'uitoggletool',...
-                    'uitogglesplittool', 'uipushtool', 'hgjavacomponent'}
-                % don't to anything for these handles and its children
-                str = '';
-
-            case ''
-                warning('matlab2tikz:NoChildren',...
-                        ['No children found for handle %d. ',...
-                         'Carrying on as if nothing happened'], handle);
-
-            otherwise
-                error('matlab2tikz:handleAllChildren',                 ...
-                    'I don''t know how to handle this object: %s\n', ...
-                    get(child, 'Type'));
-
-        end
-
-        [m2t, str] = addLegendInformation(m2t, str, legendString, interpreter);
-
-        % append the environment
-        pgfEnvironments{end+1} = str;
-    end
-end
-% ==============================================================================
-function [m2t, legendString, interpreter] = findLegendInformation(m2t, child)
-% Check if 'child' is referenced in a legend.
-% If yes, some plot types may want to add stuff (e.g. 'forget plot').
-% Add '\addlegendentry{...}' then after the plot.
-legendString = '';
-interpreter  = '';
-hasLegend = false;
-
-% Check if current handle is referenced in a legend.
-switch m2t.env
-    case 'MATLAB'
-        if ~isempty(m2t.legendHandles)
-            % Make sure that m2t.legendHandles is a row vector.
-            for legendHandle = m2t.legendHandles(:)'
-                ud = get(legendHandle, 'UserData');
-                if isfield(ud, 'handles')
-                    plotChildren = ud.handles;
-                else
-                    plotChildren = getOrDefault(legendHandle, 'PlotChildren', []);
-                end
-                if ~isempty(child)
-                    k = find(child == plotChildren);
-                    if isempty(k)
-                        % Lines of error bar plots are not referenced
-                        % directly in legends as an error bars plot contains
-                        % two "lines": the data and the deviations. Here, the
-                        % legends refer to the specgraph.errorbarseries
-                        % handle which is 'Parent' to the line handle.
-                        k = find(get(child,'Parent') == plotChildren);
-                    end
-                    if ~isempty(k)
-                        % Legend entry found. Add it to the plot.
-                        hasLegend = true;
-                        interpreter = get(legendHandle, 'Interpreter');
-                        if ~isempty(ud) && isfield(ud,'strings')
-                            legendString = ud.lstrings(k);
-                        else
-                            legendString = get(child, 'DisplayName');
-                        end
-                    end
-                end
-            end
-        end
-    case 'Octave'
-        % Octave associates legends with axes, not with (line) plot.
-        % The variable m2t.gcaHasLegend is set in drawAxes().
-        hasLegend = ~isempty(m2t.gcaAssociatedLegend);
-        interpreter = get(m2t.gcaAssociatedLegend, 'interpreter');
-        legendString = getOrDefault(child,'displayname','');
-    otherwise
-        errorUnknownEnvironment();
-end
-
-% split string to cell, if newline character '\n' (ASCII 10) is present
-delimeter = sprintf('\n');
-legendString = regexp(legendString,delimeter,'split');
-
-m2t.currentHandleHasLegend = hasLegend && ~isempty(legendString);
-end
-% ==============================================================================
-function [m2t, str] = addLegendInformation(m2t, str, legendString, interpreter)
-% Add legend after the plot data.
-% The test for ischar(str) && ~isempty(str) is a workaround for hggroups;
-% the output might not necessarily be a string, but a cellstr.
-    if ischar(str) && ~isempty(str) && m2t.currentHandleHasLegend
-        c = prettyPrint(m2t, legendString, interpreter);
-        % We also need a legend alignment option to make multiline
-        % legend entries work. This is added by default in getLegendOpts().
-        str = [str, sprintf('\\addlegendentry{%s};\n\n', join(m2t, c, '\\'))];
-    end
-end
-% ==============================================================================
-function data = applyHgTransform(m2t, data)
-    if ~isempty(m2t.transform)
-        R = m2t.transform(1:3,1:3);
-        t = m2t.transform(1:3,4);
-        n = size(data, 1);
-        data = data * R' + kron(ones(n,1), t');
-    end
-end
-% ==============================================================================
-function m2t = drawAxes(m2t, handle)
-% Input arguments:
-%    handle.................The axes environment handle.
-
-% Handle special cases.
-    switch lower(get(handle, 'Tag'))
-        case 'colorbar'
-            m2t = handleColorbar(m2t, handle);
-            return
-        case 'legend'
-            % In MATLAB, an axis and its legend are siblings, while in Pgfplots,
-            % the \legend (or \addlegendentry) command must appear within the axis
-            % environment, so handle it there.
-            return
-        otherwise
-            % continue as usual
-    end
-
-    % Initialize empty environment.
-    % Use a struct instead of a custom subclass of hgsetget (which would
-    % facilitate writing clean code) as structs are more portable (old MATLAB(R)
-    % versions, GNU Octave).
-    m2t.axesContainers{end+1} = struct('handle', handle, ...
-        'name', '', ...
-        'comment', [], ...
-        'options', {opts_new()}, ...
-        'content', {cell(0)}, ...
-        'children', {cell(0)});
-
-    % update gca
-    m2t.currentHandles.gca = handle;
-
-    % Bar plots need to have some values counted per axis. Setting
-    % m2t.barplotId to 0 makes sure these are recomputed in drawBarSeries()
-    % TODO: find nicer approach for barplots
-    m2t.barplotId = 0;
-
-    m2t.gcaAssociatedLegend = getAssociatedLegend(m2t, handle);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % get the axes position
-    pos = getAxesPosition(m2t, handle, ...
-        m2t.cmdOpts.Results.width, ...
-        m2t.cmdOpts.Results.height, ...
-        m2t.axesBoundingBox);
-    % Axes should not be in px any more
-
-    % set the width
-    if (~m2t.cmdOpts.Results.noSize)
-        % optionally prevents setting the width and height of the axis
-        m2t = setDimensionOfAxes(m2t, 'width',  pos.w);
-        m2t = setDimensionOfAxes(m2t, 'height', pos.h);
-
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, 'at', ...
-                ['{(' formatDim(pos.x.value, pos.x.unit) ','...
-                      formatDim(pos.y.value, pos.y.unit) ')}']);
-        % the following is general MATLAB behavior:
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'scale only axis', []);
-    end
-    % Add the physical dimension of one unit of length in the coordinate system.
-    % This is used later on to translate lengths to physical units where
-    % necessary (e.g., in bar plots).
-    m2t.unitlength.x.unit = pos.w.unit;
-    xLim = get(m2t.currentHandles.gca, 'XLim');
-    m2t.unitlength.x.value = pos.w.value / (xLim(2)-xLim(1));
-    m2t.unitlength.y.unit = pos.h.unit;
-    yLim = get(m2t.currentHandles.gca, 'YLim');
-    m2t.unitlength.y.value = pos.h.value / (yLim(2)-yLim(1));
-    for axis = 'xyz'
-        m2t.([axis 'AxisReversed']) = ...
-            strcmp(get(handle,[upper(axis),'Dir']), 'reverse');
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % In MATLAB, all plots are treated as 3D plots; it's just the view that
-    % makes 2D plots appear like 2D.
-    % Recurse into the children of this environment. Do this here to give the
-    % contained plots the chance to set m2t.currentAxesContain3dData to true.
-    m2t.currentAxesContain3dData = false;
-    [m2t, childrenEnvs] = handleAllChildren(m2t, handle);
-    m2t.axesContainers{end} = addChildren(m2t.axesContainers{end}, childrenEnvs);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % The rest of this is handling axes options.
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % Get other axis options (ticks, axis color, label,...).
-    % This is set here such that the axis orientation indicator in m2t is set
-    % before -- if ~isVisible(handle) -- the handle's children are called.
-    [m2t, xopts] = getAxisOptions(m2t, handle, 'x');
-    [m2t, yopts] = getAxisOptions(m2t, handle, 'y');
-
-    m2t.axesContainers{end}.options = opts_merge(m2t.axesContainers{end}.options, ...
-                                            xopts, yopts);
-    if m2t.currentAxesContain3dData
-        [m2t, zopts] = getAxisOptions(m2t, handle, 'z');
-        m2t.axesContainers{end}.options = opts_merge(m2t.axesContainers{end}.options, zopts);
-
-         m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'view', sprintf(['{', m2t.ff, '}{', m2t.ff, '}'], get(handle, 'View')));
-    end
-    hasXGrid = false;
-    hasYGrid = false;
-    hasZGrid = false;
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    if ~isVisible(handle)
-        % Setting hide{x,y} axis also hides the axis labels in Pgfplots whereas
-        % in MATLAB, they may still be visible. Well.
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, 'hide axis', []);
-        %    % An invisible axes container *can* have visible children, so don't
-        %    % immediately bail out here.
-        %    children = get(handle, 'Children');
-        %    for child = children(:)'
-        %        if isVisible(child)
-        %            % If the axes contain something that's visible, add an invisible
-        %            % axes pair.
-        %            m2t.axesContainers{end}.name = 'axis';
-        %            m2t.axesContainers{end}.options = {m2t.axesContainers{end}.options{:}, ...
-        %                                               'hide x axis', 'hide y axis'};
-        %            m2t.axesContainers{end}.comment = getTag(handle);
-        %            break;
-        %        end
-        %    end
-        %    % recurse into the children of this environment
-        %    [m2t, childrenEnvs] = handleAllChildren(m2t, handle);
-        %    m2t.axesContainers{end} = addChildren(m2t.axesContainers{end}, childrenEnvs);
-        %    return
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    m2t.axesContainers{end}.name = 'axis';
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % background color
-    m2t = drawBackgroundOfAxes(m2t, handle);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % title
-    m2t = drawTitleOfAxes(m2t, handle);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % axes locations
-    m2t = drawBoxAndLineLocationsOfAxes(m2t, handle);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % grid line style
-    if hasXGrid || hasYGrid || hasZGrid
-        matlabGridLineStyle = get(handle, 'GridLineStyle');
-        % Take over the grid line style in any case when in strict mode.
-        % If not, don't add anything in case of default line grid line style
-        % and effectively take Pgfplots' default.
-        defaultMatlabGridLineStyle = ':';
-        if m2t.cmdOpts.Results.strict ...
-                || ~strcmp(matlabGridLineStyle,defaultMatlabGridLineStyle)
-            gls = translateLineStyle(matlabGridLineStyle);
-            axisGridOpts = {'grid style', sprintf('{%s}', gls)};
-            m2t.axesContainers{end}.options = cat(1, ...
-                m2t.axesContainers{end}.options,...
-                axisGridOpts);
-        end
-    else
-        % When specifying 'axis on top', the axes stay above all graphs (which is
-        % default MATLAB behavior), but so do the grids (which is not default
-        % behavior).
-        %TODO: use proper grid ordering
-        if m2t.cmdOpts.Results.strict
-            m2t.axesContainers{end}.options = ...
-                opts_add(m2t.axesContainers{end}.options, ...
-                'axis on top', []);
-        end
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    m2t = drawLegendOptionsOfAxes(m2t, handle);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % add manually given extra axis options
-    m2t.axesContainers{end}.options = opts_append_userdefined(...
-        m2t.axesContainers{end}.options, m2t.cmdOpts.Results.extraAxisOptions);
-end
-% ==============================================================================
-function legendhandle = getAssociatedLegend(m2t, handle)
-% Check if the axis is referenced by a legend (only necessary for Octave)
-    legendhandle = [];
-    switch m2t.env
-        case 'Octave'
-            if ~isempty(m2t.legendHandles)
-                % Make sure that m2t.legendHandles is a row vector.
-                for lhandle = m2t.legendHandles(:)'
-                    ud = get(lhandle, 'UserData');
-                    if any(handle == ud.handle)
-                        legendhandle = lhandle;
-                        break;
-                    end
-                end
-            end
-        case 'MATLAB'
-            % no action needed
-        otherwise
-            errorUnknownEnvironment();
-    end
-end
-% ==============================================================================
-function m2t = setDimensionOfAxes(m2t, widthOrHeight, dimension)
-% sets the dimension "name" of the current axes to the struct "dim"
-    m2t.axesContainers{end}.options = opts_add(...
-            m2t.axesContainers{end}.options, widthOrHeight, ...
-            formatDim(dimension.value, dimension.unit));
-end
-% ==============================================================================
-function m2t = drawBackgroundOfAxes(m2t, handle)
-% draw the background color of the current axes
-    backgroundColor = get(handle, 'Color');
-    if ~isNone(backgroundColor)
-        [m2t, col] = getColor(m2t, handle, backgroundColor, 'patch');
-        if ~strcmp(col, 'white')
-            m2t.axesContainers{end}.options = ...
-                opts_add(m2t.axesContainers{end}.options, ...
-                'axis background/.style', sprintf('{fill=%s}', col));
-        end
-    end
-end
-% ==============================================================================
-function m2t = drawTitleOfAxes(m2t, handle)
-% processes the title of an axes object
-    title = get(get(handle, 'Title'), 'String');
-    if ~isempty(title)
-        titleInterpreter = get(get(handle, 'Title'), 'Interpreter');
-        title = prettyPrint(m2t, title, titleInterpreter);
-        titleStyle = getFontStyle(m2t, get(handle,'Title'));
-        if length(title) > 1
-            titleStyle = opts_add(titleStyle, 'align', 'center');
-        end
-        if ~isempty(titleStyle)
-            m2t.axesContainers{end}.options = opts_add(...
-                m2t.axesContainers{end}.options, 'title style', ...
-                sprintf('{%s}', opts_print(m2t, titleStyle, ',')));
-        end
-        title = join(m2t, title, '\\[1ex]');
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'title', sprintf('{%s}', title));
-    end
-end
-% ==============================================================================
-function m2t = drawBoxAndLineLocationsOfAxes(m2t, handle)
-% draw the box and axis line location of an axes object
-    isboxOn = strcmp(get(handle, 'box'), 'on');
-    xloc = get(handle, 'XAxisLocation');
-    if isboxOn
-        if strcmp(xloc, 'bottom')
-            % default; nothing added
-        elseif strcmp(xloc, 'top')
-            m2t.axesContainers{end}.options = ...
-                opts_add(m2t.axesContainers{end}.options, ...
-                'axis x line*', 'top');
-        else
-            error('matlab2tikz:drawAxes', ...
-                'Illegal axis location ''%s''.', xloc);
-        end
-    else % box off
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'axis x line*', xloc);
-    end
-    yloc = get(handle, 'YAxisLocation');
-    if isboxOn
-        if strcmp(yloc, 'left')
-            % default; nothing added
-        elseif strcmp(yloc, 'right')
-            m2t.axesContainers{end}.options = ...
-                opts_add(m2t.axesContainers{end}.options, ...
-                'axis y line*', 'right');
-        else
-            error('matlab2tikz:drawAxes', ...
-                'Illegal axis location ''%s''.', yloc);
-        end
-    else % box off
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'axis y line*', yloc);
-    end
-    if m2t.currentAxesContain3dData
-        % There's no such attribute as 'ZAxisLocation'.
-        % Instead, the default seems to be 'left'.
-        if ~isboxOn
-            m2t.axesContainers{end}.options = ...
-                opts_add(m2t.axesContainers{end}.options, ...
-                'axis z line*', 'left');
-        end
-    end
-end
-% ==============================================================================
-function m2t = drawLegendOptionsOfAxes(m2t, handle)
-    % See if there are any legends that need to be plotted.
-    % Since the legends are at the same level as axes in the hierarchy,
-    % we can't work out which relates to which using the tree
-    % so we have to do it by looking for a plot inside which the legend sits.
-    % This could be done better with a heuristic of finding
-    % the nearest legend to a plot, which would cope with legends outside
-    % plot boundaries.
-    switch m2t.env
-        case 'MATLAB'
-            legendHandle = legend(handle);
-            if ~isempty(legendHandle)
-                [m2t, key, legendOpts] = getLegendOpts(m2t, legendHandle);
-                m2t.axesContainers{end}.options = ...
-                    opts_add(m2t.axesContainers{end}.options, ...
-                    key, ...
-                    ['{', legendOpts, '}']);
-            end
-        case 'Octave'
-            % TODO: How to uniquely connect a legend with a pair of axes in Octave?
-            axisDims = pos2dims(get(handle,'Position')); %#ok
-            % siblings of this handle:
-            siblings = get(get(handle,'Parent'), 'Children');
-            % "siblings" always(?) is a column vector. Iterating over the column
-            % with the for statement below wouldn't return the individual vector
-            % elements but the same column vector, resulting in no legends exported.
-            % So let's make sure "siblings" is a row vector by reshaping it:
-            siblings = reshape(siblings, 1, []);
-            for sibling = siblings
-                if sibling && strcmp(get(sibling,'Type'), 'axes') && strcmp(get(sibling,'Tag'), 'legend')
-                    legDims = pos2dims(get(sibling, 'Position')); %#ok
-
-                    % TODO The following logic does not work for 3D plots.
-                    %      => Commented out.
-                    %      This creates problems though for stacked plots with legends.
-                    %                if (   legDims.left   > axisDims.left ...
-                    %                     && legDims.bottom > axisDims.bottom ...
-                    %                     && legDims.left + legDims.width < axisDims.left + axisDims.width ...
-                    %                     && legDims.bottom + legDims.height  < axisDims.bottom + axisDims.height)
-                    [m2t, key, legendOpts] = getLegendOpts(m2t, sibling);
-                    m2t.axesContainers{end}.options = ...
-                        opts_add(m2t.axesContainers{end}.options, ...
-                        key, ...
-                        ['{', legendOpts, '}']);
-                    %                end
-                end
-            end
-        otherwise
-            errorUnknownEnvironment();
-    end
-end
-% ==============================================================================
-function m2t = handleColorbar(m2t, handle)
-    if isempty(handle)
-        return;
-    end
-
-    % Find the axes environment that this colorbar belongs to.
-    parentAxesHandle = double(get(handle,'axes'));
-    parentFound = false;
-    for k = 1:length(m2t.axesContainers)
-        if m2t.axesContainers{k}.handle == parentAxesHandle
-            k0 = k;
-            parentFound = true;
-            break;
-        end
-    end
-    if parentFound
-        m2t.axesContainers{k0}.options = ...
-            opts_append(m2t.axesContainers{k0}.options, ...
-            matlab2pgfplotsColormap(m2t, m2t.currentHandles.colormap), []);
-        % Append cell string.
-        m2t.axesContainers{k0}.options = cat(1,...
-            m2t.axesContainers{k0}.options, ...
-            getColorbarOptions(m2t, handle));
-    else
-        warning('matlab2tikz:parentAxesOfColorBarNotFound',...
-            'Could not find parent axes for color bar. Skipping.');
-    end
-end
-% ==============================================================================
-function tag = getTag(handle)
-    % if a tag is given, use it as comment
-    tag = get(handle, 'tag');
-    if ~isempty(tag)
-        tag = sprintf('Axis "%s"', tag);
-    else
-        tag = sprintf('Axis at [%.2g %.2f %.2g %.2g]', get(handle, 'position'));
-    end
-end
-% ==============================================================================
-function [m2t, options] = getAxisOptions(m2t, handle, axis)
-    if ~ismember(axis, {'x','y','z'})
-        error('matlab2tikz:illegalAxisSpecifier',...
-            'Illegal axis specifier ''%s''.', axis);
-    end
-    options = opts_new();
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % axis colors
-    [color, isDfltColor] = getAndCheckDefault('Axes', handle, ...
-                                              [upper(axis),'Color'], [ 0 0 0 ]);
-    if ~isDfltColor || m2t.cmdOpts.Results.strict
-        [m2t, col] = getColor(m2t, handle, color, 'patch');
-        if strcmp(get(handle, 'box'), 'on')
-            % If the axes are arranged as a box, make sure that the individual
-            % axes are drawn as four separate paths. This makes the alignment
-            % at the box corners somewhat less nice, but allows for different
-            % axis styles (e.g., colors).
-            options = opts_add(options, 'separate axis lines', []);
-        end
-        options = ...
-            opts_add(options, ...
-            ['every outer ', axis, ' axis line/.append style'], ...
-            ['{', col, '}']);
-        options = ...
-            opts_add(options, ...
-            ['every ',axis,' tick label/.append style'], ...
-            ['{font=\color{',col,'}}']);
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % handle the orientation
-    isAxisReversed = strcmp(get(handle,[upper(axis),'Dir']), 'reverse');
-    m2t.([axis 'AxisReversed']) = isAxisReversed;
-    if isAxisReversed
-        options = opts_add(options, [axis, ' dir'], 'reverse');
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    axisScale = getOrDefault(handle, [upper(axis) 'Scale'], 'lin');
-    if strcmp(axisScale, 'log');
-        options = opts_add(options, [axis,'mode'], 'log');
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % get axis limits
-    limits = get(handle, [upper(axis),'Lim']);
-    if isfinite(limits(1))
-        options = opts_add(options, [axis,'min'], sprintf(m2t.ff, limits(1)));
-    end
-    if isfinite(limits(2))
-        options = opts_add(options, [axis,'max'], sprintf(m2t.ff, limits(2)));
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % get ticks along with the labels
-    [ticks, tickLabels, hasMinorTicks, tickDir] = getAxisTicks(m2t, handle, axis);
-
-    % According to http://www.mathworks.com/help/techdoc/ref/axes_props.html,
-    % the number of minor ticks is automatically determined by MATLAB(R) to
-    % fit the size of the axis. Until we know how to extract this number, use
-    % a reasonable default.
-    matlabDefaultNumMinorTicks = 3;
-    if ~isempty(ticks)
-        options = opts_add(options, ...
-            [axis,'tick'], sprintf('{%s}', ticks));
-    end
-    if ~isempty(tickLabels)
-        options = opts_add(options, ...
-            [axis,'ticklabels'], sprintf('{%s}', tickLabels));
-    end
-    if hasMinorTicks
-        options = opts_add(options, ...
-            [axis,'minorticks'], 'true');
-        if m2t.cmdOpts.Results.strict
-            options = ...
-                opts_add(options, ...
-                sprintf('minor %s tick num', axis), ...
-                sprintf('{%d}', matlabDefaultNumMinorTicks));
-        end
-    end
-    if strcmpi(tickDir,'out')
-        options = opts_add(options, ...
-            'tick align','outside');
-    elseif strcmpi(tickDir,'both')
-        options = opts_add(options, ...
-        'tick align','center');
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % get axis label
-    axisLabel = get(get(handle, [upper(axis),'Label']), 'String');
-    if ~isempty(axisLabel)
-        axisLabelInterpreter = ...
-            get(get(handle, [upper(axis),'Label']), 'Interpreter');
-        label = prettyPrint(m2t, axisLabel, axisLabelInterpreter);
-        if length(label) > 1
-            % If there's more than one cell item, the list
-            % is displayed multi-row in MATLAB(R).
-            % To replicate the same in Pgfplots, one can
-            % use xlabel={first\\second\\third} only if the
-            % alignment or the width of the "label box"
-            % is defined. This is a restriction that comes with
-            % TikZ nodes.
-            options = opts_add(options, ...
-                [axis, 'label style'], '{align=center}');
-        end
-        label = join(m2t, label,'\\[1ex]');
-        %if isVisible(handle)
-        options = opts_add(options, ...
-            [axis, 'label'], sprintf('{%s}', label));
-        %else
-        %    m2t.axesContainers{end}.options{end+1} = ...
-        %        sprintf(['extra description/.code={\n', ...
-        %                 '\\node[/pgfplots/every axis label,/pgfplots/every axis %s label]{%s};\n', ...
-        %                 '}'], axis, label);
-        %end
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % get grids
-    if strcmp(getOrDefault(handle, [upper(axis),'Grid'], 'off'), 'on');
-        options = opts_add(options, [axis, 'majorgrids'], []);
-    end
-    if strcmp(getOrDefault(handle, [upper(axis),'MinorGrid'], 'off'), 'on');
-        options = opts_add(options, [axis, 'minorgrids'], []);
-    end
-end
-% ==============================================================================
-function bool = axisIsVisible(axisHandle)
-    if ~isVisible(axisHandle)
-        % An invisible axes container *can* have visible children, so don't
-        % immediately bail out here.
-        children = get(axisHandle, 'Children');
-        bool = false;
-        for child = children(:)'
-            if isVisible(child)
-                bool = true;
-                return;
-            end
-        end
-    else
-        bool = true;
-    end
-end
-% ==============================================================================
-function [m2t, str] = drawLine(m2t, handle, yDeviation)
-% Returns the code for drawing a regular line and error bars.
-% This is an extremely common operation and takes place in most of the
-% not too fancy plots.
-    str = '';
-
-    if ~isVisible(handle)
-        return
-    end
-
-    lineStyle = get(handle, 'LineStyle');
-    lineWidth = get(handle, 'LineWidth');
-    marker = get(handle, 'Marker');
-
-    % Get draw options.
-    color = get(handle, 'Color');
-    [m2t, xcolor] = getColor(m2t, handle, color, 'patch');
-    lineOptions = getLineOptions(m2t, lineStyle, lineWidth);
-    [m2t, markerOptions] = getMarkerOptions(m2t, handle);
-    drawOptions = [{sprintf('color=%s', xcolor)}, ... % color
-        lineOptions, ...
-        markerOptions];
-
-    % Check for "special" lines, e.g.:
-    if strcmp(get(handle, 'Tag'), 'zplane_unitcircle')
-        % Draw unit circle and axes.
-        % TODO Don't hardcode "10".
-        opts = join(m2t, drawOptions, ',');
-        str = [sprintf('\\draw[%s] (axis cs:0,0) circle[radius=1];\n', opts),...
-            sprintf('\\draw[%s] (axis cs:-10,0)--(axis cs:10,0);\n', opts), ...
-            sprintf('\\draw[%s] (axis cs:0,-10)--(axis cs:0,10);\n', opts)];
-        return
-    end
-
-    hasLines = ~isNone(lineStyle) && lineWidth>0.0;
-    hasMarkers = ~isNone(marker);
-    if ~hasLines && ~hasMarkers
-        return
-    end
-
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % Plot the actual line data.
-    % First put them all together in one multiarray.
-    % This also implicitly makes sure that the lengths match.
-    xData = get(handle, 'XData');
-    yData = get(handle, 'YData');
-    zData = getOrDefault(handle, 'ZData', []);
-    % We would like to do
-    %   data = [xData(:), yData(:), zData(:)],
-    % but Octave fails. Hence this isempty() construction.
-    if isempty(zData)
-        data = [xData(:), yData(:)];
-    else
-        data = applyHgTransform(m2t, [xData(:), yData(:), zData(:)]);
-    end
-
-    % check if the *optional* argument 'yDeviation' was given
-    hasDeviations = false;
-    if nargin > 2
-        data = [data, yDeviation(:,1:2)];
-        hasDeviations = true;
-    end
-
-    % Check if any value is infinite/NaN. In that case, add appropriate option.
-    if any(~isfinite(data(:)))
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, 'unbounded coords', 'jump');
-    end
-
-    if ~isempty(zData)
-        % Don't try to be smart in parametric 3d plots: Just plot all the data.
-        [m2t, table] = makeTable(m2t, {'','',''}, data);
-        str = sprintf('%s\\addplot3 [%s]\n table[row sep=crcr] {%s};\n ', ...
-            str, join(m2t, drawOptions, ','), table);
-
-        m2t.currentAxesContain3dData = true;
-    else
-        % split the data into logical chunks
-        dataCell = splitLine(m2t, hasLines, data);
-
-        % plot them
-        for k = 1:length(dataCell)
-            % If the line has a legend string, make sure to only include a legend
-            % entry for the *last* occurrence of the plot series.
-            % Hence the condition k<length(xDataCell).
-            %if ~isempty(m2t.legendHandles) && (~m2t.currentHandleHasLegend || k < length(dataCell))
-            if ~m2t.currentHandleHasLegend || k < length(dataCell)
-                % No legend entry found. Don't include plot in legend.
-                opts = join(m2t, [drawOptions, {'forget plot'}], ',');
-            else
-                opts = join(m2t, drawOptions, ',');
-            end
-
-            [m2t, Part] = plotLine2d(m2t, opts, dataCell{k});
-            str = [str, Part];
-        end
-    end
-
-    if m2t.cmdOpts.Results.automaticLabels
-        [m2t, label] = addLabel(m2t);
-        str = [str, label];
-    end
-end
-% ==============================================================================
-function [m2t, str] = addLabel(m2t)
-    [pathstr, name] = fileparts(m2t.cmdOpts.Results.filename); %#ok
-    label = sprintf('addplot:%s%d', name, m2t.automaticLabelIndex);
-    str = sprintf('\\label{%s}\n', label);
-    m2t.automaticLabelIndex = m2t.automaticLabelIndex + 1;
-
-    userWarning(m2t, 'Automatically added label ''%s'' for line plot.', label);
-end
-% ==============================================================================
-function [m2t,str] = plotLine2d(m2t, opts, data)
-    errorbarMode = (size(data,2) == 4); % is (optional) yDeviation given?
-
-    str = '';
-    if errorbarMode
-        m2t = needsPgfplotsVersion(m2t, [1,9]);
-        str = sprintf('plot [error bars/.cd, y dir = both, y explicit]\n');
-    end
-
-    % Convert to string array then cell to call sprintf once (and no loops).
-    if errorbarMode
-        tabOpts = 'row sep=crcr, y error plus index=2, y error minus index=3';
-    else
-        tabOpts = 'row sep=crcr';
-    end
-    [m2t, table] = makeTable(m2t, repmat({''}, size(data,2)), data);
-    str = sprintf('\\addplot [%s]\n %s table[%s]{%s};\n',...
-        opts, str, tabOpts, table);
-end
-% ==============================================================================
-function dataCell = splitLine(m2t, hasLines, data)
-% Split the xData, yData into several chunks of data for each of which
-% an \addplot will be generated.
-    dataCell{1} = data;
-
-    % Split each of the current chunks further with respect to outliers.
-    dataCell = splitByArraySize(m2t, hasLines, dataCell);
-end
-% ==============================================================================
-function dataCellNew = splitByArraySize(m2t, hasLines, dataCell)
-% TeX parses files line by line with a buffer of size buf_size. If the
-% plot has too many data points, pdfTeX's buffer size may be exceeded.
-% As a work-around, the plot is split into several smaller plots, and this
-% function does the job.
-    dataCellNew = cell(0);
-
-    for data = dataCell
-        chunkStart = 1;
-        len = size(data{1}, 1);
-        while chunkStart <= len
-            chunkEnd = min(chunkStart + m2t.cmdOpts.Results.maxChunkLength - 1, len);
-
-            % Copy over the data to the new containers.
-            dataCellNew{end+1} = data{1}(chunkStart:chunkEnd,:);
-
-            % If the plot has lines, add an extra (overlap) point to the data
-            % stream; otherwise the line between two data chunks would be broken.
-            if hasLines && chunkEnd~=len
-                dataCellNew{end} = [dataCellNew{end};...
-                    data{1}(chunkEnd+1,:)];
-            end
-
-            chunkStart = chunkEnd + 1;
-        end
-    end
-end
-% ==============================================================================
-function lineOpts = getLineOptions(m2t, lineStyle, lineWidth)
-% Gathers the line options.
-    lineOpts = cell(0);
-
-    if ~isNone(lineStyle) && (lineWidth > m2t.tol)
-        lineOpts{end+1} = sprintf('%s', translateLineStyle(lineStyle));
-    end
-
-    % Take over the line width in any case when in strict mode. If not, don't add
-    % anything in case of default line width and effectively take Pgfplots'
-    % default.
-    % Also apply the line width if no actual line is there; the markers make use
-    % of this, too.
-    matlabDefaultLineWidth = 0.5;
-    if m2t.cmdOpts.Results.strict ...
-            || ~abs(lineWidth-matlabDefaultLineWidth) <= m2t.tol
-        lineOpts{end+1} = sprintf('line width=%.1fpt', lineWidth);
-    end
-end
-% ==============================================================================
-function [m2t, drawOptions] = getMarkerOptions(m2t, h)
-% Handles the marker properties of a line (or any other) plot.
-    drawOptions = cell(0);
-
-    marker = get(h, 'Marker');
-
-    if ~isNone(marker)
-        markerSize = get(h, 'MarkerSize');
-        lineStyle  = get(h, 'LineStyle');
-        lineWidth  = get(h, 'LineWidth');
-
-        [tikzMarkerSize, isDefault] = ...
-            translateMarkerSize(m2t, marker, markerSize);
-
-        % take over the marker size in any case when in strict mode;
-        % if not, don't add anything in case of default marker size
-        % and effectively take Pgfplots' default.
-        if m2t.cmdOpts.Results.strict || ~isDefault
-            drawOptions{end+1} = sprintf('mark size=%.1fpt', tikzMarkerSize);
-        end
-
-        markOptions = cell(0);
-        % make sure that the markers get painted in solid (and not dashed)
-        % if the 'lineStyle' is not solid (otherwise there is no problem)
-        if ~strcmp(lineStyle, 'solid')
-            markOptions{end+1} = 'solid';
-        end
-
-        % print no lines
-        if isNone(lineStyle) || lineWidth==0
-            drawOptions{end+1} = 'only marks';
-        end
-
-        % get the marker color right
-        markerFaceColor = get(h, 'markerfaceColor');
-        markerEdgeColor = get(h, 'markeredgeColor');
-        [tikzMarker, markOptions] = translateMarker(m2t, marker,         ...
-            markOptions, ~isNone(markerFaceColor));
-        if ~isNone(markerFaceColor)
-            [m2t, xcolor] = getColor(m2t, h, markerFaceColor, 'patch');
-            if ~isempty(xcolor)
-                markOptions{end+1} = sprintf('fill=%s', xcolor);
-            end
-        end
-        if ~isNone(markerEdgeColor) && ~strcmp(markerEdgeColor,'auto')
-            [m2t, xcolor] = getColor(m2t, h, markerEdgeColor, 'patch');
-            if ~isempty(xcolor)
-                markOptions{end+1} = sprintf('draw=%s', xcolor);
-            end
-        end
-
-        % add it all to drawOptions
-        drawOptions{end+1} = sprintf('mark=%s', tikzMarker);
-
-        if ~isempty(markOptions)
-            mo = join(m2t, markOptions, ',');
-            drawOptions{end+1} = ['mark options={', mo, '}'];
-        end
-    end
-end
-% ==============================================================================
-function [tikzMarkerSize, isDefault] = ...
-    translateMarkerSize(m2t, matlabMarker, matlabMarkerSize)
-% The markersizes of Matlab and TikZ are related, but not equal. This
-% is because
-%
-%  1.) MATLAB uses the MarkerSize property to describe something like
-%      the diameter of the mark, while TikZ refers to the 'radius',
-%  2.) MATLAB and TikZ take different measures (e.g. the
-%      edge of a square vs. its diagonal).
-    if(~ischar(matlabMarker))
-        error('matlab2tikz:translateMarkerSize',                      ...
-            'Variable matlabMarker is not a string.');
-    end
-
-    if(~isnumeric(matlabMarkerSize))
-        error('matlab2tikz:translateMarkerSize',                      ...
-            'Variable matlabMarkerSize is not a numeral.');
-    end
-
-    % 6pt is the default MATLAB marker size for all markers
-    defaultMatlabMarkerSize = 6;
-    isDefault = abs(matlabMarkerSize(1)-defaultMatlabMarkerSize)<m2t.tol;
-    % matlabMarkerSize can be vector data, use first index to check the default
-    % marker size. When the script also handles different markers together with
-    % changing size and color, the test should be extended to a vector norm, e.g.
-    % sqrt(e^T*e) < tol, where e=matlabMarkerSize-defaultMatlabMarkerSize
-
-    switch (matlabMarker)
-        case 'none'
-            tikzMarkerSize = [];
-        case {'+','o','x','*','p','pentagram','h','hexagram'}
-            % In MATLAB, the marker size refers to the edge length of a
-            % square (for example) (~diameter), whereas in TikZ the
-            % distance of an edge to the center is the measure (~radius).
-            % Hence divide by 2.
-            tikzMarkerSize = matlabMarkerSize(:) / 2;
-        case '.'
-            % as documented on the Matlab help pages:
-            %
-            % Note that MATLAB draws the point marker (specified by the '.'
-            % symbol) at one-third the specified size.
-            % The point (.) marker type does not change size when the
-            % specified value is less than 5.
-            %
-            tikzMarkerSize = matlabMarkerSize(:) / 2 / 3;
-        case {'s','square'}
-            % Matlab measures the diameter, TikZ half the edge length
-            tikzMarkerSize = matlabMarkerSize(:) / 2 / sqrt(2);
-        case {'d','diamond'}
-            % MATLAB measures the width, TikZ the height of the diamond;
-            % the acute angle (at the top and the bottom of the diamond)
-            % is a manually measured 75 degrees (in TikZ, and MATLAB
-            % probably very similar); use this as a base for calculations
-            tikzMarkerSize = matlabMarkerSize(:) / 2 / atan(75/2 *pi/180);
-        case {'^','v','<','>'}
-            % for triangles, matlab takes the height
-            % and tikz the circumcircle radius;
-            % the triangles are always equiangular
-            tikzMarkerSize = matlabMarkerSize(:) / 2 * (2/3);
-        otherwise
-            error('matlab2tikz:translateMarkerSize',                   ...
-                'Unknown matlabMarker ''%s''.', matlabMarker);
-    end
-end
-% ==============================================================================
-function [tikzMarker, markOptions] = ...
-    translateMarker(m2t, matlabMarker, markOptions, faceColorToggle)
-% Translates MATLAB markers to their Tikz equivalents
-% #COMPLEX: inherently large switch-case
-    if ~ischar(matlabMarker)
-        error('matlab2tikz:translateMarker:MarkerNotAString',...
-            'matlabMarker is not a string.');
-    end
-
-    switch (matlabMarker)
-        case 'none'
-            tikzMarker = '';
-        case '+'
-            tikzMarker = '+';
-        case 'o'
-            if faceColorToggle
-                tikzMarker = '*';
-            else
-                tikzMarker = 'o';
-            end
-        case '.'
-            tikzMarker = '*';
-        case 'x'
-            tikzMarker = 'x';
-        otherwise  % the following markers are only available with PGF's
-            % plotmarks library
-            userInfo(m2t, '\nMake sure to load \\usetikzlibrary{plotmarks} in the preamble.\n');
-            hasFilledVariant = true;
-            switch (matlabMarker)
-
-                case '*'
-                    tikzMarker = 'asterisk';
-                    hasFilledVariant = false;
-
-                case {'s','square'}
-                    tikzMarker = 'square';
-
-                case {'d','diamond'}
-                    tikzMarker = 'diamond';
-
-                case '^'
-                    tikzMarker = 'triangle';
-
-                case 'v'
-                    tikzMarker = 'triangle';
-                    markOptions{end+1} = 'rotate=180';
-
-                case '<'
-                    tikzMarker = 'triangle';
-                    markOptions{end+1} = 'rotate=90';
-
-                case '>'
-                    tikzMarker = 'triangle';
-                    markOptions{end+1} = 'rotate=270';
-
-                case {'p','pentagram'}
-                    tikzMarker = 'star';
-
-                case {'h','hexagram'}
-                    userWarning(m2t, 'MATLAB''s marker ''hexagram'' not available in TikZ. Replacing by ''star''.');
-                    tikzMarker = 'star';
-
-                otherwise
-                    error('matlab2tikz:translateMarker:unknownMatlabMarker',...
-                        'Unknown matlabMarker ''%s''.',matlabMarker);
-            end
-            if faceColorToggle && hasFilledVariant
-                tikzMarker = [tikzMarker '*'];
-            end
-    end
-end
-% ==============================================================================
-function [m2t, str] = drawPatch(m2t, handle)
-% Draws a 'patch' graphics object (as found in contourf plots, for example).
-%
-    str = '';
-
-    if ~isVisible(handle)
-        return
-    end
-
-    % MATLAB's patch elements are matrices in which each column represents a a
-    % distinct graphical object. Usually there is only one column, but there may
-    % be more (-->hist plots, although they are now handled within the barplot
-    % framework).
-    XData = get(handle, 'XData');
-    YData = get(handle, 'YData');
-    ZData = get(handle, 'ZData');
-
-    % see if individual color values are present
-    CData = get(handle, 'CData');
-
-    % If the data points are given in three vectors, we are dealing with one
-    % single patch. If they are all matrices, then the columns of matrix
-    % represent one patch each.
-    if min(size(XData)) == 1
-        % Make sure vectors are column vectors.
-        XData = XData(:);
-        YData = YData(:);
-        ZData = ZData(:);
-        CData = CData(:);
-    end
-
-    numPatches = size(XData, 2);
-
-    % Ensure that if we have multiple patches and only FaceColor is specified,
-    % that it doesn't error when creating each patch with cData = CData(:, k);;
-    if isempty(CData)
-        CData = zeros(1,numPatches);
-    end
-    if length(CData) == 1
-        CData = CData(1,1) * ones(1,numPatches);
-    end
-
-    for k = 1:numPatches
-        xData = XData(:, k);
-        yData = YData(:, k);
-
-        if isempty(ZData)
-            columnNames = {'x', 'y'};
-            data = [xData(:), yData(:)];
-            plotType = 'addplot';
-        else
-            zData = ZData(:, k);
-            columnNames = {'x', 'y', 'z'};
-            data = applyHgTransform(m2t, [xData(:), yData(:), zData(:)]);
-            plotType = 'addplot3';
-            m2t.currentAxesContain3dData = true;
-        end
-
-        cData = CData(:, k);
-        % -----------------------------------------------------------------------
-        % gather the draw options
-        % Make sure that legends are shown in area mode.
-        drawOptions = {'area legend'};
-
-        % Use the '\\' as a row separator to make sure that the generated figures
-        % work in subplot environments.
-        tableOptions = {'row sep=crcr'};
-
-        [m2t, markerOptions] = getMarkerOptions(m2t, handle);
-        drawOptions = [drawOptions, markerOptions];
-
-        % Add the proper color map even if the map data isn't directly used in
-        % the plot to make sure that we get correct color bars.
-        if ~all(cData == cData(1)) && length(cData) == length(xData)
-            % Add the color map.
-            m2t.axesContainers{end}.options = ...
-                opts_append(m2t.axesContainers{end}.options, ...
-                matlab2pgfplotsColormap(m2t, m2t.currentHandles.colormap), []);
-        end
-        % If full color data is provided, we can use point meta color data.
-        % For some reason, this only works for filled contours in Pgfplots, so
-        % fall back to explicit color specifications for line plots.
-        if ~all(cData == cData(1)) && length(cData) == length(xData) ...
-                && ~isNone(get(handle, 'FaceColor'))
-            data = [data, cData(:)];
-            drawOptions{end+1} = 'patch';
-            columnNames{end+1} = 'c';
-            tableOptions{end+1} = 'point meta=\thisrow{c}';
-        else
-            % Probably one color only, so things we're probably only dealing with
-            % one patch here.
-            % line width
-            lineStyle = get(handle, 'LineStyle');
-            lineWidth = get(handle, 'LineWidth');
-            lineOptions = getLineOptions(m2t, lineStyle, lineWidth);
-            drawOptions = [drawOptions, lineOptions];
-
-            % Find out color values.
-            % fill color
-            faceColor = get(handle, 'FaceColor');
-
-            % If it still has 'interp', then the CData for the patch is
-            % just an index into the colormap. Convert to RGB
-            if strcmpi(faceColor,'interp')
-                    [m2t, index] = cdata2colorindex(m2t, cData(1),handle);
-                    faceColor    = m2t.currentHandles.colormap(index,:);
-            end
-
-            if ~isNone(faceColor)
-                [m2t, xFaceColor] = getColor(m2t, handle, faceColor, 'patch');
-                drawOptions{end+1} = sprintf('fill=%s', xFaceColor);
-                xFaceAlpha = get(handle, 'FaceAlpha');
-                if abs(xFaceAlpha - 1.0) > m2t.tol
-                    drawOptions{end+1} = sprintf('opacity=%s', xFaceAlpha);
-                end
-            end
-
-            % draw color
-            edgeColor = get(handle, 'EdgeColor');
-            lineStyle = get(handle, 'LineStyle');
-            if isNone(lineStyle) || isNone(edgeColor)
-                drawOptions{end+1} = 'draw=none';
-            else
-                [m2t, xEdgeColor] = getColor(m2t, handle, edgeColor, 'patch');
-                if isempty(xEdgeColor)
-                    % getColor() wasn't able to return a color. This is because
-                    % cdata was an actual vector with different values in it,
-                    % meaning that the color changes along the edge. This is the
-                    % case, for example, with waterfall() plots.
-                    % An actual color maps is needed here.
-                    %
-                    drawOptions{end+1} = 'mesh'; % or surf
-                    m2t.axesContainers{end}.options = ...
-                        opts_append(m2t.axesContainers{end}.options, ...
-                        matlab2pgfplotsColormap(m2t, m2t.currentHandles.colormap), []);
-                    % Append upper and lower limit of the color mapping.
-                    clim = caxis;
-                    m2t.axesContainers{end}.options = ...
-                        opts_add(m2t.axesContainers{end}.options, ...
-                        'point meta min', sprintf(m2t.ff, clim(1)));
-                    m2t.axesContainers{end}.options = ...
-                        opts_add(m2t.axesContainers{end}.options, ...
-                        'point meta max', sprintf(m2t.ff, clim(2)));
-                    % Note:
-                    % Pgfplots can't currently use FaceColor and colormapped edge
-                    % color in one go. The option 'surf' makes sure that
-                    % colormapped edge colors are used. Face colors are not
-                    % displayed.
-                else
-                    % getColor() returned a reasonable color value.
-                    drawOptions{end+1} = sprintf('draw=%s', xEdgeColor);
-                end
-            end
-        end
-
-        if ~m2t.currentHandleHasLegend
-            % No legend entry found. Don't include plot in legend.
-            drawOptions{end+1} = 'forget plot';
-        end
-
-        drawOpts = join(m2t, drawOptions, ',');
-        % -----------------------------------------------------------------------
-        if any(~isfinite(data(:)))
-            m2t.axesContainers{end}.options = ...
-                opts_add(m2t.axesContainers{end}.options, ...
-                'unbounded coords', 'jump');
-        end
-        % Plot the actual data.
-        [m2t, table] = makeTable(m2t, columnNames, data);
-
-        cycle = conditionallyCyclePath(data);
-        str = sprintf('%s\n\\%s[%s]\ntable[%s] {%s}%s;\n\n',...
-            str, plotType, drawOpts, join(m2t, tableOptions, ', '), table, cycle);
-end
-end
-% ==============================================================================
-function [cycle] = conditionallyCyclePath(data)
-% returns "--cycle" when the path should be cyclic in pgfplots
-% Mostly, this is the case UNLESS the data record starts or ends with a NaN
-% record (i.e. a break in the path)
-    if any(~isfinite(data([1 end],:)))
-        cycle = '';
-    else
-        cycle = '--cycle';
-    end
-end
-% ==============================================================================
-function [m2t, str] = drawImage(m2t, handle)
-    str = '';
-
-    if ~isVisible(handle)
-        return
-    end
-
-    % read x-, y-, and color-data
-    xData = get(handle, 'XData');
-    yData = get(handle, 'YData');
-    cData = get(handle, 'CData');
-
-    % Flip the image over as the PNG gets written starting at (0,0),
-    % which is the top left corner.
-    cData = cData(end:-1:1,:,:);
-
-    if (m2t.cmdOpts.Results.imagesAsPng)
-        [m2t, str] = imageAsPNG(m2t, handle, xData, yData, cData);
-    else
-        [m2t, str] = imageAsTikZ(m2t, handle, xData, yData, cData);
-    end
-
-    % Make sure that the axes are still visible above the image.
-    m2t.axesContainers{end}.options = ...
-        opts_add(m2t.axesContainers{end}.options, ...
-        'axis on top', []);
-end
-% ==============================================================================
-function [m2t, str] = imageAsPNG(m2t, handle, xData, yData, cData)
-    m2t.imageAsPngNo = m2t.imageAsPngNo + 1;
-    % ------------------------------------------------------------------------
-    % draw a png image
-    [pngFileName, pngReferencePath] = externalFilename(m2t, m2t.imageAsPngNo, '.png');
-
-    % Get color indices for indexed images and truecolor values otherwise
-    if ndims(cData) == 2 %#ok don't use ismatrix (cfr. #143)
-        [m2t, colorData] = cdata2colorindex(m2t, cData, handle);
-    else
-        colorData = cData;
-    end
-
-    m = size(cData, 1);
-    n = size(cData, 2);
-
-    colorData = flipImageIfAxesReversed(m2t, colorData);
-
-    % Write an indexed or a truecolor image
-    alpha = normalizedAlphaValues(m2t, get(handle,'AlphaData'), handle);
-    if numel(alpha)==1
-        alpha = alpha(ones(size(colorData(:,:,1))));
-    end
-    hasAlpha = ~all(alpha(:)==1);
-    if hasAlpha
-        alphaOpts = {'Alpha', alpha};
-    else
-        alphaOpts = {};
-    end
-    if (ndims(colorData) == 2) %#ok don't use ismatrix (cfr. #143)
-        if size(m2t.currentHandles.colormap, 1) <= 256 && ~hasAlpha
-            % imwrite supports maximum 256 values in a colormap (i.e. 8 bit)
-            % and no alpha channel for indexed PNG images.
-            imwrite(colorData, m2t.currentHandles.colormap, ...
-                pngFileName, 'png');
-        else % use true-color instead
-            imwrite(ind2rgb(colorData, m2t.currentHandles.colormap), ...
-                pngFileName, 'png', alphaOpts{:});
-        end
-    else
-        imwrite(colorData, pngFileName, 'png', alphaOpts{:});
-    end
-    % -----------------------------------------------------------------------
-    % dimensions of a pixel in axes units
-    if n == 1
-        xLim = get(m2t.currentHandles.gca, 'XLim');
-        xw = xLim(2) - xLim(1);
-    else
-        xw = (xData(end)-xData(1)) / (n-1);
-    end
-    if m == 1
-        yLim = get(m2t.currentHandles.gca, 'YLim');
-        yw = yLim(2) - yLim(1);
-    else
-        yw = (yData(end)-yData(1)) / (m-1);
-    end
-
-    opts = opts_new();
-    opts = opts_add(opts, 'xmin', sprintf(m2t.ff, xData(1  ) - xw/2));
-    opts = opts_add(opts, 'xmax', sprintf(m2t.ff, xData(end) + xw/2));
-    opts = opts_add(opts, 'ymin', sprintf(m2t.ff, yData(1  ) - yw/2));
-    opts = opts_add(opts, 'ymax', sprintf(m2t.ff, yData(end) + yw/2));
-
-    str = sprintf('\\addplot [forget plot] graphics [%s] {%s};\n', ...
-        opts_print(m2t, opts, ','), pngReferencePath);
-
-    userInfo(m2t, ...
-        ['\nA PNG file is stored at ''%s'' for which\n', ...
-        'the TikZ file contains a reference to ''%s''.\n', ...
-        'You may need to adapt this, depending on the relative\n', ...
-        'locations of the master TeX file and the included TikZ file.\n'], ...
-        pngFileName, pngReferencePath);
-end
-function [m2t, str] = imageAsTikZ(m2t, handle, xData, yData, cData)
-% writes an image as raw TikZ commands (STRONGLY DISCOURAGED)
-    str = '';
-
-    % Generate uniformly distributed X, Y, although xData and yData may be
-    % non-uniform.
-    % This is MATLAB(R) behavior.
-    switch length(xData)
-        case 2 % only the limits given; common for generic image plots
-            hX = 1;
-        case size(cData,1) % specific x-data is given
-            hX = (xData(end)-xData(1)) / (length(xData)-1);
-        otherwise
-            error('drawImage:arrayLengthMismatch', ...
-                'Array lengths not matching (%d = size(cdata,1) ~= length(xData) = %d).', m, length(xData));
-    end
-    X = xData(1):hX:xData(end);
-
-    switch length(yData)
-        case 2 % only the limits given; common for generic image plots
-            hY = 1;
-        case size(cData,2) % specific y-data is given
-            hY = (yData(end)-yData(1)) / (length(yData)-1);
-        otherwise
-            error('drawImage:arrayLengthMismatch', ...
-                'Array lengths not matching (%d = size(cdata,2) ~= length(yData) = %d).', n, length(yData));
-    end
-    Y = yData(1):hY:yData(end);
-
-    m = length(X);
-    n = length(Y);
-    [m2t, xcolor] = getColor(m2t, handle, cData, 'image');
-
-    % The following section takes pretty long to execute, although in
-    % principle it is discouraged to use TikZ for those; LaTeX will take
-    % forever to compile.
-    % Still, a bug has been filed on MathWorks to allow for one-line
-    % sprintf'ing with (string+num) cells (Request ID: 1-9WHK4W);
-    % <http://www.mathworks.de/support/service_requests/Service_Request_Detail.do?ID=183481&filter=&sort=&statusorder=0&dateorder=0>.
-    % An alternative approach could be to use 'surf' or 'patch' of pgfplots
-    % with inline tables.
-
-    for i = 1:m
-        for j = 1:n
-            str = [str, ...
-                sprintf(['\t\\fill [%s] (axis cs:', m2t.ff,',', m2t.ff,') rectangle (axis cs:',m2t.ff,',',m2t.ff,');\n'], ...
-                xcolor{m-i+1,j}, Y(j)-hY/2,  X(i)-hX/2, Y(j)+hY/2, X(i)+hX/2 )];
-        end
-    end
-end
-% ==============================================================================
-function [colorData] = flipImageIfAxesReversed(m2t, colorData)
-% flip the image if reversed
-    if m2t.xAxisReversed
-        colorData = colorData(:, end:-1:1, :);
-    end
-    if m2t.yAxisReversed
-        colorData = colorData(end:-1:1, :, :);
-    end
-end
-% ==============================================================================
-function alpha = normalizedAlphaValues(m2t, alpha, handle)
-    alphaDataMapping = getOrDefault(handle, 'AlphaDataMapping', 'none');
-    switch lower(alphaDataMapping)
-        case 'none'  % no rescaling needed
-        case 'scaled'
-            ALim = get(m2t.currentHandles.gca, 'ALim');
-            AMax = ALim(2);
-            AMin = ALim(1);
-            if ~isfinite(AMax)
-                AMax = max(alpha(:)); %NOTE: is this right?
-            end
-            alpha = (alpha - AMin)./(AMax - AMin);
-        case 'direct'
-            alpha = ind2rgb(alpha, get(m2t.currentHandles.gcf, 'Alphamap'));
-        otherwise
-            error('matlab2tikz:UnknownAlphaMapping', ...
-                  'Unknown alpha mapping "%s"', alphaMapping);
-    end
-    alpha = min(1,max(alpha,0)); % clip at range [0, 1]
-end
-% ==============================================================================
-function [m2t, str] = drawContour(m2t, h)
-% draw a contour group (MATLAB R2014b and newer only)
-plotoptions = opts_new();
-plotoptions = opts_add(plotoptions,'contour prepared');
-plotoptions = opts_add(plotoptions,'contour prepared format','matlab');
-if strcmpi(get(h,'ShowText'),'off')
-    plotoptions = opts_add(plotoptions,'contour/labels','false');
-end
-if strcmpi(get(h,'Fill'),'on')
-    userWarning(m2t, 'Filled contour replaced by unfilled contour plot.');
-    %FIXME: implement colored contour plots
-end
-%TODO: explicit color handling for contour plots
-
-contours = get(h,'ContourMatrix');
-
-[m2t, table] = makeTable(m2t, {'',''}, contours.');
-
-str = sprintf('\\addplot[%s] table[row sep=crcr] {%%\n%s};\n', ...
-              opts_print(m2t, plotoptions, ', '), table);
-
-end
-% ==============================================================================
-function [m2t, str] = drawHggroup(m2t, h)
-% Octave doesn't have the handle() function, so there's no way to determine
-% the nature of the plot anymore at this point.  Set to 'unknown' to force
-% fallback handling. This produces something for bar plots, for example.
-% #COMPLEX: big switch-case
-    try
-        cl = class(handle(h));
-    catch %#ok
-        cl = 'unknown';
-    end
-
-    switch(cl)
-        case {'specgraph.barseries', 'matlab.graphics.chart.primitive.Bar'}
-            % hist plots and friends
-            [m2t, str] = drawBarseries(m2t, h);
-
-        case {'specgraph.stemseries', 'matlab.graphics.chart.primitive.Stem'}
-            % stem plots
-            [m2t, str] = drawStemSeries(m2t, h);
-
-        case {'specgraph.stairseries', 'matlab.graphics.chart.primitive.Stair'}
-            % stair plots
-            [m2t, str] = drawStairSeries(m2t, h);
-
-        case {'specgraph.areaseries', 'matlab.graphics.chart.primitive.Area'}
-            % scatter plots
-            [m2t,str] = drawAreaSeries(m2t, h);
-
-        case {'specgraph.quivergroup', 'matlab.graphics.chart.primitive.Quiver'}
-            % quiver arrows
-            [m2t, str] = drawQuiverGroup(m2t, h);
-
-        case {'specgraph.errorbarseries', 'matlab.graphics.chart.primitive.ErrorBar'}
-            % error bars
-            [m2t,str] = drawErrorBars(m2t, h);
-
-        case {'specgraph.scattergroup','matlab.graphics.chart.primitive.Scatter'}
-            % scatter plots
-            [m2t,str] = drawScatterPlot(m2t, h);
-
-        case {'specgraph.contourgroup', 'hggroup', 'matlab.graphics.primitive.Group'}
-            % handle all those the usual way
-            [m2t, str] = handleAllChildren(m2t, h);
-
-        case 'scribe.scribeellipse'
-            % Annotation: ellipse
-            [m2t, str] = drawEllipse(m2t, h);
-
-        case {'scribe.arrow', 'scribe.doublearrow', 'scribe.line'}
-            % Annotation: single and double Arrow, line
-            % These annotations are fully represented by their children
-            [m2t, str] = handleAllChildren(m2t, h);
-
-        case 'scribe.textbox'
-            % Annotation: text box
-            [m2t, str] = drawText(m2t, h);
-
-        case 'scribe.textarrow'
-            % Annotation: text arrow
-            [m2t, str] = drawTextarrow(m2t, h);
-
-        case 'scribe.scriberect'
-            % Annotation: rectangle
-            [m2t, str] = drawRectangle(m2t, h);
-
-        case 'unknown'
-            % Weird spurious class from Octave.
-            [m2t, str] = handleAllChildren(m2t, h);
-
-        otherwise
-            userWarning(m2t, 'Don''t know class ''%s''. Default handling.', cl);
-            try
-                m2tBackup = m2t;
-                [m2t, str] = handleAllChildren(m2t, h);
-            catch ME
-                userWarning(m2t, 'Default handling for ''%s'' failed. Continuing as if it did not occur. \n Original Message:\n %s', cl, getReport(ME));
-                [m2t, str] = deal(m2tBackup, ''); % roll-back
-            end
-    end
-end
-% ==============================================================================
-function [m2t,env] = drawSurface(m2t, handle)
-    str = '';
-    [m2t, opts, plotType] = surfaceOpts(m2t, handle);
-
-    % Allow for empty surf
-    if isNone(plotType)
-        m2t.currentAxesContain3dData = true;
-        env = str;
-        return
-    end
-
-    dx = get(handle, 'XData');
-    dy = get(handle, 'YData');
-    dz = get(handle, 'ZData');
-    if any(~isfinite(dx(:))) || any(~isfinite(dy(:))) || any(~isfinite(dz(:)))
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'unbounded coords', 'jump');
-    end
-
-    [numcols, numrows] = size(dz);
-
-    % If dx or dy are given as vectors, convert them to the (wasteful) matrix
-    % representation first. This makes sure we can treat the data with one
-    % single sprintf() command below.
-    if isvector(dx)
-        dx = ones(numcols,1) * dx(:)';
-    end
-    if isvector(dy)
-        dy = dy(:) * ones(1,numrows);
-    end
-
-    % Add 'z buffer=sort' to the options to make sphere plot and the like not
-    % overlap. There are different options here some of which may be more
-    % advantageous in other situations; check out Pgfplots' manual here.
-    % Since 'z buffer=sort' is computationally more expensive for LaTeX, try
-    % to avoid it for the most default situations, e.g., when dx and dy are
-    % rank-1-matrices.
-    if any(~isnan(dx(1,:)) & dx(1,:) ~= dx(2,:)) ...
-            || any(~isnan(dy(:,1)) & dy(:,1) ~= dy(:,2))
-        opts{end+1} = 'z buffer=sort';
-    end
-
-    % There are several possibilities of how colors are specified for surface
-    % plots:
-    %    * explicitly by RGB-values,
-    %    * implicitly through a color map with a point-meta coordinate,
-    %    * implicitly through a color map with a given coordinate (e.g., z).
-    %
-
-    % Check if we need extra CData.
-    colors = get(handle, 'CData');
-    if length(size(colors)) == 3 && size(colors, 3) == 3
-        % Explicit RGB-coded colors.
-        opts{end+1} = 'mesh/color input=explicit';
-
-        formatType = 'table[row sep=crcr,header=false,meta index=3]';
-        r = colors(:, :, 1);
-        g = colors(:, :, 2);
-        b = colors(:, :, 3);
-        colorFormat = join(m2t, repmat({m2t.ff},[3 1]),',');
-        color = arrayfun(@(r,g,b)(sprintf(colorFormat,r,g,b)), ...
-            r(:),g(:),b(:),'UniformOutput',false);
-
-        %formatType = 'table[row sep=crcr,header=false]';
-        %formatString = [m2t.ff, ' ', m2t.ff, ' ', m2t.ff, '\\\\\n'];
-        %data = applyHgTransform(m2t, [dx(:), dy(:), dz(:)]);
-
-        %elseif length(size(colors)) > 2 || any(isnan(colors(:)))
-        %    needsPointmeta = false;
-    else
-        opts{end+1} = matlab2pgfplotsColormap(m2t, ...
-            m2t.currentHandles.colormap);
-        % If NaNs are present in the color specifications, don't use them for
-        % Pgfplots; they may be interpreted as strings there. The option
-        % 'header=false' will be explicitly added.
-        % Note:
-        % Pgfplots actually does a better job than MATLAB in determining what
-        % colors to use for the patches. The circular test case on
-        % http://www.mathworks.de/de/help/matlab/ref/pcolor.html, for example
-        % yields a symmetric setup in Pgfplots (and doesn't in MATLAB).
-        needsPointmeta = any(xor(isnan(dz), isnan(colors)) ...
-            | (abs(colors - dz) > 1.0e-10));
-        if needsPointmeta
-            % Get color map.
-            formatType = 'table[row sep=crcr,header=false,meta index=3]';
-            opts{end+1} = 'point meta=explicit';
-            color = colors(:);
-        else
-            formatType = 'table[row sep=crcr,header=false]';
-            color = '';
-        end
-    end
-    data = applyHgTransform(m2t, [dx(:), dy(:), dz(:)]);
-
-    % Add mesh/rows=<num rows> for specifying the row data instead of empty
-    % lines in the data list below. This makes it possible to reduce the
-    % data writing to one single sprintf() call.
-    opts{end+1} = sprintf('mesh/rows=%d', numrows);
-
-    opts = join(m2t, opts, ',\n');
-    str = [str, sprintf(['\n\\addplot3[%%\n%s,\n', opts ,']'], plotType)];
-
-    % TODO Check if surf plot is 'spectrogram' or 'surf' and run corresponding
-    % algorithm.
-    % Spectrograms need to have the grid removed,
-    % m2t.axesContainers{end}.options{end+1} = 'grid=none';
-    % Here is where everything is put together.
-    tabArgs = {'',data(:,1),'',data(:,2),'',data(:,3)};
-    if ~isempty(color)
-        tabArgs(end+1:end+2) = {'',color};
-    end
-    [m2t, table] = makeTable(m2t, tabArgs{:});
-
-    str = sprintf('%s\n%s {%%\n%s};\n', str, formatType, table);
-    env = str;
-
-    % TODO:
-    % - remove grids in spectrogram by either removing grid command
-    %   or adding: 'grid=none' from/in axis options
-    % - handling of huge data amounts in LaTeX.
-
-    if m2t.cmdOpts.Results.automaticLabels
-        [m2t, label] = addLabel(m2t);
-        str = [str, label]; %#ok
-    end
-
-    m2t.currentAxesContain3dData = true;
-end
-% ==============================================================================
-function [m2t, str] = drawVisibleText(m2t, handle)
-% Wrapper for drawText() that only draws visible text
-
-    % There may be some text objects floating around a MATLAB figure which are
-    % handled by other subfunctions (labels etc.) or don't need to be handled at
-    % all.
-    % The HandleVisibility says something about whether the text handle is
-    % visible as a data structure or not. Typically, a handle is hidden if the
-    % graphics aren't supposed to be altered, e.g., axis labels.  Most of those
-    % entities are captured by matlab2tikz one way or another, but sometimes they
-    % are not. This is the case, for example, with polar plots and the axis
-    % descriptions therein.  Also, Matlab treats text objects with a NaN in the
-    % position as invisible.
-    if any(isnan(get(handle, 'Position')) | isnan(get(handle, 'Rotation'))) ...
-            || strcmp(get(handle, 'Visible'), 'off') ...
-            || (strcmp(get(handle, 'HandleVisibility'), 'off') && ...
-                ~m2t.cmdOpts.Results.showHiddenStrings)
-
-        str = '';
-        return;
-    end
-
-    [m2t, str] = drawText(m2t, handle);
-
-end
-% ==============================================================================
-function [m2t, str] = drawText(m2t, handle)
-% Adding text node anywhere in the axes environment.
-% Not that, in Pgfplots, long texts get cut off at the axes. This is
-% Different from the default MATLAB behavior. To fix this, one could use
-% /pgfplots/after end axis/.code.
-
-    str = '';
-
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % get required properties
-    color  = get(handle, 'Color');
-    [m2t, tcolor] = getColor(m2t, handle, color, 'patch');
-    bgColor = get(handle,'BackgroundColor');
-    EdgeColor = get(handle, 'EdgeColor');
-    HorizontalAlignment = get(handle, 'HorizontalAlignment');
-    String = get(handle, 'String');
-    Interpreter = get(handle, 'Interpreter');
-    String = prettyPrint(m2t, String, Interpreter);
-    % Concatenate multiple lines
-    String = join(m2t, String, '\\');
-    VerticalAlignment = get(handle, 'VerticalAlignment');
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % translate them to pgf style
-    style = opts_new();
-    if ~isNone(bgColor)
-        [m2t, bcolor] = getColor(m2t, handle, bgColor, 'patch');
-        style = opts_add(style, 'fill', bcolor);
-    end
-    switch VerticalAlignment
-        case {'top', 'cap'}
-            style = opts_add(style, 'below');
-        case {'baseline', 'bottom'}
-            style = opts_add(style, 'above');
-    end
-    switch HorizontalAlignment
-        case 'left'
-            style = opts_add(style, 'right');
-        case 'right'
-            style = opts_add(style, 'left');
-    end
-    % Add Horizontal alignment
-    style = opts_add(style, 'align', HorizontalAlignment);
-
-    % remove invisible border around \node to make the text align precisely
-    style = opts_add(style, 'inner sep', '0mm');
-
-    % Add rotation, if existing
-    defaultRotation = 0.0;
-    rot = getOrDefault(handle, 'Rotation', defaultRotation);
-    if rot ~= defaultRotation
-        style = opts_add(style, 'rotate', sprintf(m2t.ff, rot));
-    end
-
-    style = opts_merge(style, getFontStyle(m2t, handle));
-
-    style = opts_add(style, 'text', tcolor);
-    if ~isNone(EdgeColor)
-        [m2t, ecolor] = getColor(m2t, handle, EdgeColor, 'patch');
-        style = opts_add(style, 'draw', ecolor);
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % plot the thing
-    pos = get(handle, 'Position');
-    units = get(handle, 'Units');
-    switch length(pos)
-        case 2    % Text within a 2d plot
-            switch units
-                case 'normalized'
-                    posString = sprintf(['(rel axis cs:', m2t.ff, ',', m2t.ff, ')'], pos);
-                case 'data'
-                    posString = sprintf(['(axis cs:', m2t.ff, ',', m2t.ff, ')'], pos);
-                otherwise
-                    defaultUnit = 'cm';
-                    pos = convertUnits(pos, units, defaultUnit);
-                    posString = ['(' formatDim(pos(1), defaultUnit) ',' ...
-                                     formatDim(pos(2), defaultUnit) ')'];
-            end
-
-            xlim = get(m2t.currentHandles.gca,'XLim');
-            ylim = get(m2t.currentHandles.gca,'YLim');
-            if pos(1) < xlim(1) || pos(1) > xlim(2) ...
-                    || pos(2) < ylim(1) || pos(2) > ylim(2)
-                m2t.axesContainers{end}.options = ...
-                    opts_add(m2t.axesContainers{end}.options, ...
-                    'clip', 'false');
-            end
-        case 3    % Text within a 3d plot
-            pos = applyHgTransform(m2t, pos);
-            if strcmp(units, 'normalized')
-                posString = sprintf(['(rel axis cs:',m2t.ff,',',m2t.ff,',',m2t.ff,')'], pos);
-            else
-                posString = sprintf(['(axis cs:',m2t.ff,',',m2t.ff,',',m2t.ff,')'], pos);
-            end
-
-            xlim = get(m2t.currentHandles.gca, 'XLim');
-            ylim = get(m2t.currentHandles.gca, 'YLim');
-            zlim = get(m2t.currentHandles.gca, 'ZLim');
-            if pos(1) < xlim(1) || pos(1) > xlim(2) ...
-                    || pos(2) < ylim(1) || pos(2) > ylim(2) ...
-                    || pos(3) < zlim(1) || pos(3) > zlim(2)
-                m2t.axesContainers{end}.options = ...
-                    opts_add(m2t.axesContainers{end}.options, ...
-                    'clip', 'false');
-            end
-        case 4    % Textbox
-            % TODO:
-            %   - size of the box (e.g. using node attributes minimum width / height)
-            %   - Alignment of the resized box
-            switch units
-                case 'normalized'
-                    posString = sprintf(['(rel axis cs:', m2t.ff, ',', m2t.ff, ')'], pos(1:2));
-                case 'data'
-                    posString = sprintf(['(axis cs:', m2t.ff, ',', m2t.ff, ')'], pos(1:2));
-                otherwise
-                    defaultUnit = 'cm';
-                    pos = convertUnits(pos, units, defaultUnit);
-                    posString = ['(' formatDim(pos(1), defaultUnit) ',' ...
-                                     formatDim(pos(2), defaultUnit) ')'];
-            end
-
-            xlim = get(m2t.currentHandles.gca,'XLim');
-            ylim = get(m2t.currentHandles.gca,'YLim');
-            if pos(1) < xlim(1) || pos(1) > xlim(2) ...
-                    || pos(2) < ylim(1) || pos(2) > ylim(2)
-                m2t.axesContainers{end}.options = ...
-                    opts_add(m2t.axesContainers{end}.options, ...
-                    'clip', 'false');
-            end
-        otherwise
-            error('matlab2tikz:drawText', ...
-                'Illegal text position specification.');
-    end
-    str = sprintf('\\node[%s]\nat %s {%s};\n', ...
-        opts_print(m2t, style, ', '), posString, String);
-end
-% ==============================================================================
-function [m2t, str] = drawRectangle(m2t, handle)
-    str = '';
-
-    % there may be some text objects floating around a Matlab figure which
-    % are handled by other subfunctions (labels etc.) or don't need to be
-    % handled at all
-    if     strcmp(get(handle, 'Visible'), 'off') ...
-            || strcmp(get(handle, 'HandleVisibility'), 'off')
-        return;
-    end
-
-    % TODO handle Curvature = [0.8 0.4]
-
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    lineStyle = get(handle, 'LineStyle');
-    lineWidth = get(handle, 'LineWidth');
-    if isNone(lineStyle) || lineWidth==0
-        return
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % Get draw options.
-    lineOptions = getLineOptions(m2t, lineStyle, lineWidth);
-
-    colorOptions = cell(0);
-    % fill color
-    faceColor  = get(handle, 'FaceColor');
-    if ~isNone(faceColor)
-        [m2t, xFaceColor] = getColor(m2t, handle, faceColor, 'patch');
-        colorOptions{end+1} = sprintf('fill=%s', xFaceColor);
-    end
-    % draw color
-    edgeColor = get(handle, 'EdgeColor');
-    lineStyle = get(handle, 'LineStyle');
-    if isNone(lineStyle) || isNone(edgeColor)
-        colorOptions{end+1} = 'draw=none';
-    else
-        [m2t, xEdgeColor] = getColor(m2t, handle, edgeColor, 'patch');
-        colorOptions{end+1} = sprintf('draw=%s', xEdgeColor);
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    pos = pos2dims(get(handle, 'Position'));
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    drawOptions = [lineOptions, colorOptions];
-    % plot the thing
-    str = sprintf(['\\draw[%s] (axis cs:',m2t.ff,',',m2t.ff, ')', ...
-                   ' rectangle (axis cs:',m2t.ff,',',m2t.ff,');\n'], ...
-         join(m2t, drawOptions,', '), pos.left, pos.bottom, pos.right, pos.top);
-end
-% ==============================================================================
-function [m2t,surfOptions,plotType] = surfaceOpts(m2t, handle)
-    faceColor = get(handle, 'FaceColor');
-    edgeColor = get(handle, 'EdgeColor');
-
-    % Check for surf or mesh plot. Second argument in if-check corresponds to
-    % default values for mesh plot in MATLAB.
-    if isNone(faceColor)
-        plotType = 'mesh';
-    else
-        plotType = 'surf';
-    end
-
-    surfOptions = cell(0);
-
-    % Set opacity if FaceAlpha < 1 in MATLAB
-    faceAlpha = get(handle, 'FaceAlpha');
-    if isnumeric(faceAlpha) && faceAlpha ~= 1.0
-        surfOptions{end+1} = sprintf(['opacity=', m2t.ff], faceAlpha);
-    end
-
-    % TODO Revisit this selection and create a bunch of test plots.
-    switch plotType
-
-        % SURFACE
-        case 'surf'
-
-            % Edge 'none'
-            if isNone(edgeColor)
-                if strcmpi(faceColor, 'flat')
-                    surfOptions{end+1} = 'shader=flat';
-                elseif strcmpi(faceColor, 'interp');
-                    surfOptions{end+1} = 'shader=interp';
-                end
-
-            % Edge 'interp'
-            elseif strcmpi(edgeColor, 'interp')
-                if strcmpi(faceColor, 'interp')
-                    surfOptions{end+1} = 'shader=interp';
-                else
-                    surfOptions{end+1} = 'shader=faceted';
-                    [m2t,xFaceColor]   = getColor(m2t, handle, faceColor, 'patch');
-                    surfOptions{end+1} = sprintf('color=%s',xFaceColor);
-                end
-
-            % Edge 'flat'
-            elseif strcmpi(edgeColor, 'flat')
-                if strcmpi(faceColor, 'flat')
-                    surfOptions{end+1} = 'shader=flat';
-                elseif strcmpi(faceColor, 'interp')
-                    surfOptions{end+1} = 'shader=faceted interp';
-                elseif isnumeric(faceColor)
-                    [m2t, xFaceColor] = getColor(m2t, handle, faceColor, 'patch');
-                    surfOptions{end+1} = sprintf('fill=%s',xFaceColor);
-                end
-
-            % Edge RGB
-            else
-                [m2t, xEdgeColor]  = getColor(m2t, handle, edgeColor, 'patch');
-                surfOptions{end+1} = sprintf('faceted color=%s', xEdgeColor);
-                if isnumeric(faceColor)
-                    [m2t, xFaceColor]  = getColor(m2t, handle, faceColor, 'patch');
-                    surfOptions{end+1} = sprintf('color=%s', xFaceColor);
-                else
-                    surfOptions{end+1} = 'shader=faceted';
-                end
-            end
-
-        % MESH
-        case 'mesh'
-            if ~isNone(edgeColor)
-
-                % Edge 'interp'
-                if strcmpi(edgeColor, 'interp')
-                    surfOptions{end+1} = 'shader=flat';
-
-                % Edge RGB
-                else
-                    [m2t, xEdgeColor]  = getColor(m2t, handle, edgeColor, 'patch');
-                    surfOptions{end+1} = sprintf('color=%s', xEdgeColor);
-                end
-            else
-                plotType = 'none';
-            end
-    end
-end
-% ==============================================================================
-function [m2t, str] = drawScatterPlot(m2t, h)
-    str = '';
-
-    xData = get(h, 'XData');
-    yData = get(h, 'YData');
-    zData = get(h, 'ZData');
-    cData = get(h, 'CData');
-    sData = get(h, 'SizeData');
-
-    matlabMarker = get(h, 'Marker');
-    markerFaceColor = get(h, 'MarkerFaceColor');
-    markerEdgeColor = get(h, 'MarkerEdgeColor');
-    hasFaceColor = ~isNone(markerFaceColor);
-    hasEdgeColor = ~isNone(markerEdgeColor);
-    markOptions = cell(0);
-    [tikzMarker, markOptions] = translateMarker(m2t, matlabMarker, ...
-        markOptions, hasFaceColor);
-
-    constMarkerkSize = length(sData) == 1; % constant marker size
-
-    % Rescale marker size (not definitive, follow discussion on:
-    % https://github.com/matlab2tikz/matlab2tikz/pull/316)
-    sData = translateMarkerSize(m2t, matlabMarker, sqrt(sData)/2);
-
-    if length(cData) == 3
-        % No special treatment for the colors or markers are needed.
-        % All markers have the same color.
-        if hasFaceColor && ~strcmp(markerFaceColor,'flat');
-            [m2t, xcolor] = getColor(m2t, h, markerFaceColor,'patch');
-        else
-            [m2t, xcolor] = getColor(m2t, h, cData, 'patch');
-        end
-        if hasEdgeColor && ~strcmp(markerEdgeColor,'flat');
-            [m2t, ecolor] = getColor(m2t, h, markerEdgeColor,'patch');
-        else
-            [m2t, ecolor] = getColor(m2t, h, cData, 'patch');
-        end
-        if constMarkerkSize
-            drawOptions = { 'only marks', ...
-                ['mark=' tikzMarker], ...
-                ['mark options={', join(m2t, markOptions, ','), '}'],...
-                sprintf('mark size=%.4fpt', sData)};
-            if hasFaceColor && hasEdgeColor
-                drawOptions{end+1} = { ['draw=' ecolor], ...
-                    ['fill=' xcolor] };
-            else
-                drawOptions{end+1} = ['color=' xcolor];
-            end
-        else % if changing marker size but same color on all marks
-            markerOptions = { ['mark=', tikzMarker], ...
-                ['mark options={', join(m2t, markOptions, ','), '}'] };
-            if hasEdgeColor
-                markerOptions{end+1} = ['draw=' ecolor];
-            else
-                markerOptions{end+1} = ['draw=' xcolor];
-            end
-            if hasFaceColor
-                markerOptions{end+1} = ['fill=' xcolor];
-            end
-            % for changing marker size, the 'scatter' option has to be added
-            drawOptions = { 'scatter', ...
-                'only marks', ...
-                ['color=' xcolor], ...
-                ['mark=' tikzMarker], ...
-                ['mark options={', join(m2t, markOptions, ','), '}'] };
-            if ~hasFaceColor
-                drawOptions{end+1} = { ['scatter/use mapped color=' xcolor] };
-            else
-                drawOptions{end+1} = { ['scatter/use mapped color={', join(m2t, markerOptions,','), '}'] };
-            end
-        end
-    elseif size(cData,2) == 3
-        drawOptions = { 'only marks' ...
-            % TODO Get this in order as soon as Pgfplots can do "scatter rgb".
-            %                        'scatter rgb' ...
-            };
-    else
-        markerOptions = { ['mark=', tikzMarker], ...
-            ['mark options={', join(m2t, markOptions, ','), '}'] };
-        if hasEdgeColor && hasFaceColor
-            [m2t, ecolor] = getColor(m2t, h, markerEdgeColor,'patch');
-            markerOptions{end+1} = ['draw=' ecolor];
-        else
-            markerOptions{end+1} = 'draw=mapped color';
-        end
-        if hasFaceColor
-            markerOptions{end+1} = 'fill=mapped color';
-        end
-        drawOptions = { 'scatter', ...
-            'only marks', ...
-            'scatter src=explicit', ...
-            ['scatter/use mapped color={', join(m2t, markerOptions,','), '}'] };
-        % Add color map.
-        m2t.axesContainers{end}.options = ...
-            opts_append(m2t.axesContainers{end}.options, ...
-            matlab2pgfplotsColormap(m2t, m2t.currentHandles.colormap), []);
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % Plot the thing.
-    if isempty(zData)
-        env = 'addplot';
-        if length(sData) == 1
-            nColumns = 2;
-            data = [xData(:), yData(:)];
-        else
-            nColumns = 3;
-            sColumn = 2;
-            data = [xData(:), yData(:), sData(:)];
-        end
-    else
-        env = 'addplot3';
-        m2t.currentAxesContain3dData = true;
-        if length(sData) == 1
-            nColumns = 3;
-            data = applyHgTransform(m2t, [xData(:),yData(:),zData(:)]);
-        else
-            nColumns = 4;
-            sColumn = 3;
-            data = applyHgTransform(m2t, [xData(:),yData(:),zData(:),sData(:)]);
-        end
-    end
-    if ~constMarkerkSize %
-        drawOptions{end+1} = { ['visualization depends on={\thisrowno{', num2str(sColumn), '} \as \perpointmarksize}'], ...
-            'scatter/@pre marker code/.append style={/tikz/mark size=\perpointmarksize}' };
-    end
-    drawOpts = join(m2t, drawOptions, ',');
-
-    metaPart = '';
-    if length(cData) == 3
-        % If size(cData,1)==1, then all the colors are the same and have
-        % already been accounted for above.
-
-    elseif size(cData,2) == 3
-        %TODO Hm, can't deal with this?
-        %[m2t, col] = rgb2colorliteral(m2t, cData(k,:));
-        %str = strcat(str, sprintf(' [%s]\n', col));
-    else
-        metaPart = sprintf('meta index=%d',size(data,2));
-        data = [data, cData(:)];
-        nColumns = nColumns + 1;
-    end
-
-    % The actual printing.
-    [m2t, table] = makeTable(m2t, repmat({''},1,nColumns), data);
-    str = sprintf('%s\\%s[%s] plot table[row sep=crcr,%s]{%s};\n', str, env, ...
-        drawOpts, metaPart, table);
-end
-% ==============================================================================
-function [m2t, str] = drawBarseries(m2t, h)
-% Takes care of plots like the ones produced by MATLAB's hist.
-% The main pillar is Pgfplots's '{x,y}bar' plot.
-%
-% TODO Get rid of code duplication with 'drawAxes'.
-
-    str = '';
-
-    if ~isVisible(h)
-        return; % don't bother drawing invisible things
-    end
-
-    % drawAxes sets m2t.barplotId to 0, so all values are recomputed for subplots.
-    if m2t.barplotId == 0
-        % 'barplotId' provides a consecutively numbered ID for each
-        % barseries plot. This allows for a proper handling of multiple bars.
-        m2t.barplotTotalNumber = [];
-        m2t.barShifts = [];
-        m2t.barAddedAxisOption = false;
-    end
-
-    % Add 'log origin = infty' if BaseValue differs from zero (log origin=0 is
-    % the default behaviour since Pgfplots v1.5).
-    baseValue = get(h, 'BaseValue');
-    if baseValue ~= 0.0
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, ...
-            'log origin', 'infty');
-    end
-
-    [m2t, numBars] = countBarplotSiblings(m2t, h);
-
-    xData = get(h, 'XData');
-    yData = get(h, 'YData');
-
-    % init drawOptions
-    drawOptions = opts_new();
-
-    barlayout = get(h, 'BarLayout');
-    isHoriz = strcmp(get(h, 'Horizontal'), 'on');
-    if (isHoriz)
-        barType = 'xbar';
-    else
-        barType = 'ybar';
-    end
-    switch barlayout
-        case 'grouped'  % grouped bar plots
-            m2t.barplotId = m2t.barplotId + 1;
-
-            % Maximum group width relative to the minimum distance between two
-            % x-values. See <MATLAB>/toolbox/matlab/specgraph/makebars.m
-            maxGroupWidth = 0.8;
-            if numBars == 1
-                groupWidth = 1.0;
-            else
-                groupWidth = min(maxGroupWidth, numBars/(numBars+1.5));
-            end
-
-            % Calculate the width of each bar and the center point shift as in
-            % makebars.m
-            if isempty(m2t.barShifts)
-                % Get the shifts of the bar centers.
-                % In case of numBars==1, this returns 0,
-                % In case of numBars==2, this returns [-1/4, 1/4],
-                % In case of numBars==3, this returns [-1/3, 0, 1/3],
-                % and so forth.
-                barWidth = groupWidth/numBars; % assumption
-                m2t.barShifts = ((1:numBars) - 0.5) * barWidth - groupWidth/2;
-            end
-
-            % From http://www.mathworks.com/help/techdoc/ref/bar.html:
-            % bar(...,width) sets the relative bar width and controls the
-            % separation of bars within a group. The default width is 0.8, so if
-            % you do not specify X, the bars within a group have a slight
-            % separation. If width is 1, the bars within a group touch one
-            % another. The value of width must be a scalar.
-            barWidth = get(h, 'BarWidth') * groupWidth / numBars;
-
-            if numel(xData) == 1
-                dx = 1;
-            else
-                dx = min(diff(xData)); % used as scaling factor for all other lengths
-            end
-
-            % MATLAB treats shift and width in normalized coordinate units,
-            % whereas Pgfplots requires physical units (pt,cm,...); hence
-            % have the units converted.
-            if (isHoriz)
-                physicalBarWidth = dx * barWidth * m2t.unitlength.y.value;
-                physicalBarShift = dx * m2t.barShifts(m2t.barplotId) * m2t.unitlength.y.value;
-                physicalBarUnit = m2t.unitlength.y.unit;
-            else
-                physicalBarWidth = dx * barWidth * m2t.unitlength.x.value;
-                physicalBarShift = dx * m2t.barShifts(m2t.barplotId) * m2t.unitlength.x.value;
-                physicalBarUnit = m2t.unitlength.x.unit;
-            end
-            drawOptions = opts_add(drawOptions, barType);
-            drawOptions = opts_add(drawOptions, 'bar width', ...
-                                 formatDim(physicalBarWidth, physicalBarUnit));
-            if physicalBarShift ~= 0.0
-                drawOptions = opts_add(drawOptions, 'bar shift', ...
-                                 formatDim(physicalBarShift, physicalBarUnit));
-            end
-
-        case 'stacked' % stacked plots
-            % Pass option to parent axis & disallow anything but stacked plots
-            % Make sure this happens exactly *once*.
-
-            if ~m2t.barAddedAxisOption
-                bWFactor = get(h, 'BarWidth');
-                m2t.axesContainers{end}.options = ...
-                    opts_add(m2t.axesContainers{end}.options, ...
-                    'bar width', ...
-                    formatDim(m2t.unitlength.x.value*bWFactor, m2t.unitlength.x.unit));
-                m2t.barAddedAxisOption = true;
-            end
-
-            % Somewhere between pgfplots 1.5 and 1.8 and starting
-            % again from 1.11, the option {x|y}bar stacked can be applied to
-            % \addplot instead of the figure and thus allows to combine stacked
-            % bar plots and other kinds of plots in the same axis.
-            % Thus, it is advisable to use pgfplots 1.11. In older versions, the
-            % plot will only contain a single bar series, but should compile fine.
-            m2t = needsPgfplotsVersion(m2t, [1,11]);
-            drawOptions = opts_add(drawOptions, [barType ' stacked']);
-        otherwise
-            error('matlab2tikz:drawBarseries', ...
-                'Don''t know how to handle BarLayout ''%s''.', barlayout);
-    end
-
-    % define edge color
-    edgeColor = get(h, 'EdgeColor');
-    lineStyle = get(h, 'LineStyle');
-    if isNone(lineStyle) || isNone(edgeColor)
-        drawOptions = opts_add(drawOptions, 'draw', 'none');
-    else
-        [m2t, xEdgeColor] = getColor(m2t, h, edgeColor, 'patch');
-        drawOptions = opts_add(drawOptions, 'draw', xEdgeColor);
-    end
-
-    [m2t, drawOptions] = getFaceColorOfBar(m2t, h, drawOptions);
-
-    % Add 'area legend' to the options as otherwise the legend indicators
-    % will just highlight the edges.
-    m2t.axesContainers{end}.options = ...
-        opts_add(m2t.axesContainers{end}.options, 'area legend');
-
-    % plot the thing
-    if isHoriz
-        [yDataPlot, xDataPlot] = deal(xData, yData); % swap values
-    else
-        [xDataPlot, yDataPlot] = deal(xData, yData);
-    end
-
-    drawOpts = opts_print(m2t, drawOptions, ',');
-    [m2t, table ] = makeTable(m2t, '', xDataPlot, '', yDataPlot);
-    str = sprintf('\\addplot[%s] plot table[row sep=crcr] {%s};\n', drawOpts, table);
-end
-% ==============================================================================
-function [m2t, numBars] = countBarplotSiblings(m2t, h)
-% Count the number of sibling bar plots
-    if isempty(m2t.barplotTotalNumber)
-        m2t.barplotTotalNumber = 0;
-        siblings = get(get(h, 'Parent'), 'Children');
-        for s = siblings(:)'
-
-            if ~isVisible(s)
-                continue;  % skip invisible objects
-            end
-
-            if any(strcmpi(get(s, 'Type'), {'hggroup','Bar'}))
-                cl = class(handle(s));
-                switch cl
-                    case {'specgraph.barseries', 'matlab.graphics.chart.primitive.Bar'}
-                        m2t.barplotTotalNumber = m2t.barplotTotalNumber + 1;
-                    case 'specgraph.errorbarseries'
-                        % TODO
-                        % Unfortunately, MATLAB(R) treats error bars and
-                        % corresponding bar plots as siblings of a common axes
-                        % object. For error bars to work with bar plots -- which
-                        % is trivially possible in Pgfplots -- one has to match
-                        % errorbar and bar objects (probably by their values).
-                        userWarning(m2t, 'Error bars discarded (to be implemented).');
-                    otherwise
-                        error('matlab2tikz:drawBarseries',          ...
-                            'Unknown class''%s''.', cl);
-                end
-            end
-        end
-    end
-    numBars = m2t.barplotTotalNumber;
-end
-% ==============================================================================
-function [m2t, drawOptions] = getFaceColorOfBar(m2t, h, drawOptions)
-% retrieve the FaceColor of a barseries object
-    if ~isempty(get(h,'Children'))
-        % quite oddly, before MATLAB R2014b this value is stored in a child
-        % patch and not in the object itself
-        obj = get(h, 'Children');
-    else % R2014b and newer
-        obj = h;
-    end
-    faceColor = get(obj, 'FaceColor');
-    if ~isNone(faceColor)
-        [m2t, xFaceColor] = getColor(m2t, h, faceColor, 'patch');
-        drawOptions = opts_add(drawOptions, 'fill', xFaceColor);
-    end
-end
-% ==============================================================================
-function [m2t, str] = drawStemSeries(m2t, h)
-    [m2t, str] = drawStemOrStairSeries_(m2t, h, 'ycomb');
-end
-function [m2t, str] = drawStairSeries(m2t, h)
-    [m2t, str] = drawStemOrStairSeries_(m2t, h, 'const plot');
-end
-function [m2t, str] = drawStemOrStairSeries_(m2t, h, plotType)
-    str = '';
-
-    lineStyle = get(h, 'LineStyle');
-    lineWidth = get(h, 'LineWidth');
-    marker    = get(h, 'Marker');
-
-    if ((isNone(lineStyle) || lineWidth==0) && isNone(marker))
-        return % nothing to plot!
-    end
-
-    %% deal with draw options
-    color = get(h, 'Color');
-    [m2t, plotColor] = getColor(m2t, h, color, 'patch');
-
-    lineOptions = getLineOptions(m2t, lineStyle, lineWidth);
-    [m2t, markerOptions] = getMarkerOptions(m2t, h);
-
-    drawOptions = [plotType,                      ...
-        sprintf('color=%s', plotColor),...
-        lineOptions, ...
-        markerOptions];
-
-    %% insert draw options
-    drawOpts =  join(m2t, drawOptions, ',');
-
-    %% plot the thing
-    xData = get(h, 'XData');
-    yData = get(h, 'YData');
-    [m2t, table] = makeTable(m2t, '', xData, '', yData);
-
-    str = sprintf('%s\\addplot[%s] plot table[row sep=crcr] {%s};\n', ...
-        str, drawOpts, table);
-end
-% ==============================================================================
-function [m2t, str] = drawAreaSeries(m2t, h)
-% Takes care of MATLAB's stem plots.
-%
-% TODO Get rid of code duplication with 'drawAxes'.
-
-    str = '';
-
-    if ~isfield(m2t, 'addedAreaOption') || isempty(m2t.addedAreaOption) || ~m2t.addedAreaOption
-        % Add 'area style' to axes options.
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, 'area style', []);
-        m2t.axesContainers{end}.options = ...
-            opts_add(m2t.axesContainers{end}.options, 'stack plots', 'y');
-        m2t.addedAreaOption = true;
-    end
-
-    % Handle draw options.
-    % define edge color
-    drawOptions = {};
-    edgeColor = get(h, 'EdgeColor');
-    [m2t, xEdgeColor] = getColor(m2t, h, edgeColor, 'patch');
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % define face color;
-    if ~isempty(get(h,'Children'))
-        % quite oddly, before MATLAB R2014b this value is stored in a child
-        % patch and not in the object itself
-        obj = get(h, 'Children');
-    else % R2014b and newer
-        obj = h;
-    end
-    faceColor = get(obj, 'FaceColor');
-    [m2t, xFaceColor] = getColor(m2t, h, faceColor, 'patch');
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % gather the draw options
-    lineStyle = get(h, 'LineStyle');
-    drawOptions{end+1} = sprintf('fill=%s', xFaceColor);
-    if isNone(lineStyle)
-        drawOptions{end+1} = 'draw=none';
-    else
-        drawOptions{end+1} = sprintf('draw=%s', xEdgeColor);
-    end
-    drawOpts = join(m2t, drawOptions, ',');
-
-    % plot the thing
-    xData = get(h, 'XData');
-    yData = get(h, 'YData');
-    [m2t, table] = makeTable(m2t, '', xData, '', yData);
-    str = sprintf('%s\\addplot[%s] plot table[row sep=crcr]{%s}\n\\closedcycle;\n',...
-        str, drawOpts, table);
-end
-% ==============================================================================
-function [m2t, str] = drawQuiverGroup(m2t, h)
-% Takes care of MATLAB's quiver plots.
-
-    % used for arrow styles, in case there are more than one quiver fields
-    m2t.quiverId = m2t.quiverId + 1;
-
-    str = '';
-
-    [x,y,z,u,v,w,is3D] = getAndRescaleQuivers(h);
-
-    % prepare output
-    if is3D
-        name = 'addplot3';
-        format = [m2t.ff,',',m2t.ff,',',m2t.ff];
-        m2t.currentAxesContain3dData = true;
-    else % 2D plotting
-        name   = 'addplot';
-        format = [m2t.ff,',',m2t.ff];
-    end
-
-    data = NaN(6,numel(x));
-    data(1,:) = x;
-    data(2,:) = y;
-    data(3,:) = z;
-    data(4,:) = x + u;
-    data(5,:) = y + v;
-    data(6,:) = z + w;
-
-    if ~is3D
-        data([3 6],:) = []; % remove Z-direction
-    end
-
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % gather the arrow options
-    showArrowHead = get(h, 'ShowArrowHead');
-    lineStyle     = get(h, 'LineStyle');
-    lineWidth     = get(h, 'LineWidth');
-
-    if (isNone(lineStyle) || lineWidth==0)  && ~showArrowHead
-        return
-    end
-
-    arrowOpts = cell(0);
-    if showArrowHead
-        arrowOpts = [arrowOpts, '->'];
-    else
-        arrowOpts = [arrowOpts, '-'];
-    end
-
-    color = get(h, 'Color');
-    [m2t, arrowcolor] = getColor(m2t, h, color, 'patch');
-    arrowOpts = [arrowOpts, ...
-        sprintf('color=%s', arrowcolor), ... % color
-        getLineOptions(m2t, lineStyle, lineWidth), ... % line options
-        ];
-
-    % define arrow style
-    arrowOptions = join(m2t, arrowOpts, ',');
-
-    % Append the arrow style to the TikZ options themselves.
-    % TODO: Look into replacing this by something more 'local',
-    % (see \pgfplotset{}).
-    m2t.content.options = opts_add(m2t.content.options,...
-        sprintf('arrow%d/.style', m2t.quiverId), ...
-        ['{', arrowOptions, '}']);
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % return the vector field code
-    str = [str, ...
-        sprintf(['\\',name,' [arrow',num2str(m2t.quiverId), '] ', ...
-        'coordinates{(',format,') (',format,')};\n'],...
-        data)];
-    %FIXME: external
-end
-% ==============================================================================
-function [x,y,z,u,v,w,is3D] = getAndRescaleQuivers(h)
-% get and rescale the arrows from a quivergroup object
-    x = get(h, 'XData');
-    y = get(h, 'YData');
-    z = getOrDefault(h, 'ZData', []);
-
-    u = get(h, 'UData');
-    v = get(h, 'VData');
-    w = getOrDefault(h, 'WData', []);
-
-    if isempty(z)
-        z = 0;
-        w = 0;
-        is3D  = false;
-    else
-        is3D = true;
-    end
-
-    % MATLAB uses a scaling algorithm to determine the size of the arrows.
-    % Before R2014b, the processed coordinates were available. This is no longer
-    % the case, so we have to re-implement it. In MATLAB it is implemented in
-    % the |quiver3|  (and |quiver|) function.
-    if any(size(x)==1)
-        nX = sqrt(numel(x)); nY = nX;
-    else
-        [nY, nX] = size(x);
-    end
-    range  = @(xyzData)(max(xyzData(:)) - min(xyzData(:)));
-    euclid = @(x,y,z)(sqrt(x.^2 + y.^2 + z.^2));
-    dx = range(x)/nX;
-    dy = range(y)/nY;
-    dz = range(z)/max(nX,nY);
-    dd = euclid(dx, dy, dz);
-    if dd > 0
-        vectorLength = euclid(u/dd,v/dd,w/dd);
-        maxLength = max(vectorLength(:));
-    else
-        maxLength = 1;
-    end
-    if getOrDefault(h, 'AutoScale', true)
-        scaleFactor = getOrDefault(h,'AutoScaleFactor', 0.9) / maxLength;
-    else
-        scaleFactor = 1;
-    end
-    x = x(:).'; u = u(:).'*scaleFactor;
-    y = y(:).'; v = v(:).'*scaleFactor;
-    z = z(:).'; w = w(:).'*scaleFactor;
-end
-% ==============================================================================
-function [m2t, str] = drawErrorBars(m2t, h)
-% Takes care of MATLAB's error bar plots.
-    if isa(h,'matlab.graphics.chart.primitive.ErrorBar') % MATLAB R2014b+
-        hData = h;
-        upDev = get(h, 'UData');
-        loDev = get(h, 'LData');
-
-        yDeviations = [upDev(:), loDev(:)];
-
-    else % Legacy Handling (Octave and MATLAB R2014a and older):
-        % 'errorseries' plots have two line-plot children, one of which contains
-        % the information about the center points; 'XData' and 'YData' components
-        % are both of length n.
-        % The other contains the information about the deviations (errors), more
-        % more precisely: the lines to be drawn. Those are
-        %        ___
-        %         |
-        %         |
-        %         X  <-- (x0,y0)
-        %         |
-        %        _|_
-        %
-        %    X: x0,     x0,     x0-eps, x0+eps, x0-eps, x0+eps;
-        %    Y: y0-dev, y0+dev, y0-dev, y0-dev, y0+dev, y0+dev.
-        %
-        % Hence, 'XData' and 'YData' are of length 6*n and contain redundant info.
-        % Some versions of MATLAB(R) insert more columns with NaNs (to be able to
-        % pass the entire X, Y arrays into plot()) such that the data is laid out as
-        %
-        %    X: x0,     x0,     NaN, x0-eps, x0+eps, NaN, x0-eps, x0+eps;
-        %    Y: y0-dev, y0+dev, NaN, y0-dev, y0-dev, NaN, y0+dev, y0+dev,
-        %
-        % or with another columns of NaNs added at the end.
-        c = get(h, 'Children');
-
-        % Find out which contains the data and which the deviations.
-        %TODO: this can be simplified using sort
-        n1 = length(get(c(1),'XData'));
-        n2 = length(get(c(2),'XData'));
-        if n2 == 6*n1
-            % 1 contains centerpoint info
-            dataIdx  = 1;
-            errorIdx = 2;
-            numDevData = 6;
-        elseif n1 == 6*n2
-            % 2 contains centerpoint info
-            dataIdx  = 2;
-            errorIdx = 1;
-            numDevData = 6;
-        elseif n2 == 9*n1-1 || n2 == 9*n1
-            % 1 contains centerpoint info
-            dataIdx  = 1;
-            errorIdx = 2;
-            numDevData = 9;
-        elseif n1 == 9*n2-1 || n1 == 9*n2
-            % 2 contains centerpoint info
-            dataIdx  = 2;
-            errorIdx = 1;
-            numDevData = 9;
-        else
-            error('drawErrorBars:errorMatch', ...
-                'Sizes of and error data not matching (6*%d ~= %d and 6*%d ~= %d, 9*%d-1 ~= %d, 9*%d-1 ~= %d).', ...
-                n1, n2, n2, n1, n1, n2, n2, n1);
-        end
-        hData  = c(dataIdx);
-        hError = c(errorIdx);
-
-        % prepare error array (that is, gather the y-deviations)
-        yValues = get(hData , 'YData');
-        yErrors = get(hError, 'YData');
-
-        n = length(yValues);
-
-        yDeviations = zeros(n, 2);
-
-        %TODO: this can be vectorized
-        for k = 1:n
-            % upper deviation
-            kk = numDevData*(k-1) + 1;
-            upDev = abs(yValues(k) - yErrors(kk));
-
-            % lower deviation
-            kk = numDevData*(k-1) + 2;
-            loDev = abs(yValues(k) - yErrors(kk));
-
-            yDeviations(k,:) = [upDev loDev];
-        end
-    end
-    % Now run drawLine() with deviation information.
-    [m2t, str] = drawLine(m2t, hData, yDeviations);
-end
-% ==============================================================================
-function [m2t, str] = drawEllipse(m2t, handle)
-% Takes care of MATLAB's ellipse annotations.
-%
-
-%     c = get(h, 'Children');
-
-    p = get(handle,'position');
-    radius = p([3 4]) / 2;
-    center = p([1 2]) + radius;
-
-    str = '';
-
-    lineStyle = get(handle, 'LineStyle');
-    lineWidth = get(handle, 'LineWidth');
-
-    color = get(handle, 'Color');
-    [m2t, xcolor] = getColor(m2t, handle, color, 'patch');
-    lineOptions = getLineOptions(m2t, lineStyle, lineWidth);
-
-    filling = get(handle, 'FaceColor');
-
-    %% Has a filling?
-    if isNone(filling)
-        drawOptions = [{sprintf('%s', xcolor)}, ... % color
-            lineOptions];
-        drawCommand = '\draw';
-    else
-        [m2t, xcolorF] = getColor(m2t, handle, filling, 'patch');
-        drawOptions = [{sprintf('draw=%s,fill=%s', xcolor,xcolorF)}, ... % color
-            lineOptions];
-        drawCommand = '\filldraw';
-    end
-
-    opt = join(m2t, drawOptions, ',');
-
-    str = sprintf('%s [%s] (axis cs:%g,%g) ellipse [x radius=%g, y radius=%g];\n', ...
-        drawCommand, opt, center, radius);
-end
-% ==============================================================================
-function [m2t, str] = drawTextarrow(m2t, handle)
-% Takes care of MATLAB's textarrow annotations.
-
-    % handleAllChildren to draw the arrow
-    [m2t, str] = handleAllChildren(m2t, handle);
-
-    % handleAllChildren ignores the text, unless hidden strings are shown
-    if ~m2t.cmdOpts.Results.showHiddenStrings
-        child = findobj(handle, 'type', 'text');
-        [m2t, str{end+1}] = drawText(m2t, child);
-    end
-end
-% ==============================================================================
-function out = linearFunction(X, Y)
-% Return the linear function that goes through (X[1], Y[1]), (X[2], Y[2]).
-    out = @(x) (Y(2,:)*(x-X(1)) + Y(1,:)*(X(2)-x)) / (X(2)-X(1));
-end
-% ==============================================================================
-function matlabColormap = pgfplots2matlabColormap(points, rgb, numColors)
-% Translates a Pgfplots colormap to a MATLAB color map.
-    matlabColormap = zeros(numColors, 3);
-    % Point indices between which to interpolate.
-    I = [1, 2];
-    f = linearFunction(points(I), rgb(I,:));
-    for k = 1:numColors
-        x = (k-1)/(numColors-1) * points(end);
-        if x > points(I(2))
-            I = I + 1;
-            f = linearFunction(points(I), rgb(I,:));
-        end
-        matlabColormap(k,:) = f(x);
-    end
-end
-% ==============================================================================
-function pgfplotsColormap = matlab2pgfplotsColormap(m2t, matlabColormap)
-% Translates a MATLAB color map into a Pgfplots colormap.
-
-% First check if we could use a default Pgfplots color map.
-% Unfortunately, MATLAB and Pgfplots color maps will never exactly coincide
-% except to the most simple cases such as blackwhite. This is because of a
-% slight incompatibility of Pgfplots and MATLAB colormaps:
-% In MATLAB, indexing goes from 1 through 64, whereas in Pgfplots you can
-% specify any range, the default ones having something like
-% (0: red, 1: yellow, 2: blue).
-% To specify this exact color map in MATLAB, one would have to put 'red' at
-% 1, blue at 64, and yellow in the middle of the two, 32.5 that is.
-% Not really sure how MATLAB rounds here: 32, 33? Anyways, it will be
-% slightly off and hence not match the Pgfplots color map.
-% As a workaround, build the MATLAB-formatted colormaps of Pgfplots default
-% color maps, and check if matlabColormap is close to it. If yes, take it.
-
-% For now, comment out the color maps which haven't landed yet in Pgfplots.
-    pgfmaps = { %struct('name', 'colormap/autumn', ...
-        %       'points', [0,1], ...
-        %       'values', [[1,0,0];[1,1,0]]), ...
-        %struct('name', 'colormap/bled', ...
-        %       'points', 0:6, ...
-        %       'values', [[0,0,0];[43,43,0];[0,85,0];[0,128,128];[0,0,170];[213,0,213];[255,0,0]]/255), ...
-        %struct('name', 'colormap/bright', ...
-        %       'points', 0:7, ...
-        %       'values', [[0,0,0];[78,3,100];[2,74,255];[255,21,181];[255,113,26];[147,213,114];[230,255,0];[255,255,255]]/255), ...
-        %struct('name', 'colormap/bone', ...
-        %       'points', [0,3,6,8], ...
-        %       'values', [[0,0,0];[84,84,116];[167,199,199];[255,255,255]]/255), ...
-        %struct('name', 'colormap/cold', ...
-        %       'points', 0:3, ...
-        %       'values', [[0,0,0];[0,0,1];[0,1,1];[1,1,1]]), ...
-        %struct('name', 'colormap/copper', ...
-        %       'points', [0,4,5], ...
-        %       'values', [[0,0,0];[255,159,101];[255,199,127]]/255), ...
-        %struct('name', 'colormap/copper2', ...
-        %       'points', 0:4, ...
-        %       'values', [[0,0,0];[68,62,63];[170,112,95];[207,194,138];[255,255,255]]/255), ...
-        %struct('name', 'colormap/hsv', ...
-        %       'points', 0:6, ...
-        %       'values', [[1,0,0];[1,1,0];[0,1,0];[0,1,1];[0,0,1];[1,0,1];[1,0,0]]), ...
-        struct('name', 'colormap/hot', ...
-        'points', 0:3, ...
-        'values', [[0,0,1];[1,1,0];[1,0.5,0];[1,0,0]]), ... % TODO check this
-        struct('name', 'colormap/hot2', ...
-        'points', [0,3,6,8], ...
-        'values', [[0,0,0];[1,0,0];[1,1,0];[1,1,1]]), ...
-        struct('name', 'colormap/jet', ...
-        'points', [0,1,3,5,7,8], ...
-        'values', [[0,0,128];[0,0,255];[0,255,255];[255,255,0];[255,0,0];[128,0,0]]/255), ...
-        struct('name', 'colormap/blackwhite', ...
-        'points', [0,1], ...
-        'values', [[0,0,0];[1,1,1]]), ...
-        struct('name', 'colormap/bluered', ...
-        'points', 0:5, ...
-        'values', [[0,0,180];[0,255,255];[100,255,0];[255,255,0];[255,0,0];[128,0,0]]/255), ...
-        struct('name', 'colormap/cool', ...
-        'points', [0,1,2], ...
-        'values', [[255,255,255];[0,128,255];[255,0,255]]/255), ...
-        struct('name', 'colormap/greenyellow', ...
-        'points', [0,1], ...
-        'values', [[0,128,0];[255,255,0]]/255), ...
-        struct('name', 'colormap/redyellow', ...
-        'points', [0,1], ...
-        'values', [[255,0,0];[255,255,0]]/255), ...
-        struct('name', 'colormap/violet', ...
-        'points', [0,1,2], ...
-        'values', [[25,25,122];[255,255,255];[238,140,238]]/255) ...
-        };
-
-    % The tolerance is a subjective matter of course.
-    % Some figures:
-    %    * The norm-distance between MATLAB's gray and bone is 6.8e-2.
-    %    * The norm-distance between MATLAB's jet and Pgfplots's jet is 2.8e-2.
-    %    * The norm-distance between MATLAB's hot and Pgfplots's hot2 is 2.1e-2.
-    tol = 5.0e-2;
-
-    for map = pgfmaps
-        numColors = size(matlabColormap, 1);
-        mmap = pgfplots2matlabColormap(map{1}.points, map{1}.values, numColors);
-        alpha = norm(matlabColormap - mmap) / sqrt(numColors);
-        if alpha < tol
-            userInfo(m2t, 'Found %s to be a pretty good match for your color map (||diff||=%g).', ...
-                map{1}.name, alpha);
-            pgfplotsColormap = map{1}.name;
-            return
-        end
-    end
-
-    % Build a custom color map.
-    % Loop over the data, stop at each spot where the linear
-    % interpolation is interrupted, and set a color mark there.
-    m = size(matlabColormap, 1);
-    steps = [1, 2];
-    % A colormap with a single color is valid in MATLAB but an error in
-    % pgfplots. Repeating the color produces the desired effect in this
-    % case.
-    if m==1
-        colors=[matlabColormap(1,:);matlabColormap(1,:)];
-    else
-        colors = [matlabColormap(1,:); matlabColormap(2,:)];
-        f = linearFunction(steps, colors);
-        k = 3;
-        while k <= m
-            if norm(matlabColormap(k,:) - f(k)) > 1.0e-10
-                % Add the previous step to the color list
-                steps(end) = k-1;
-                colors(end,:) = matlabColormap(k-1,:);
-                steps = [steps, k];
-                colors = [colors; matlabColormap(k,:)];
-                f = linearFunction(steps(end-1:end), colors(end-1:end,:));
-            end
-            k = k+1;
-        end
-        steps(end) = m;
-        colors(end,:) = matlabColormap(m,:);
-    end
-
-    % Get it in Pgfplots-readable form.
-    unit = 'pt';
-    colSpecs = {};
-    for k = 1:length(steps)
-        x = steps(k)-1;
-        sprintf('rgb(%d%s)=(%g, %g, %g)', x, unit, colors(k));
-        colSpecs{k} = sprintf('rgb(%d%s)=(%g,%g,%g)', x, unit, colors(k,:));
-    end
-    pgfplotsColormap = sprintf('colormap={mymap}{[1%s] %s}', unit, join(m2t, colSpecs, '; '));
-end
-% ==============================================================================
-function fontStyle = getFontStyle(m2t, handle)
-    fontStyle = '';
-    if strcmpi(get(handle, 'FontWeight'),'Bold')
-        fontStyle = sprintf('%s\\bfseries',fontStyle);
-    end
-    if strcmpi(get(handle, 'FontAngle'), 'Italic')
-        fontStyle = sprintf('%s\\itshape',fontStyle);
-    end
-    if m2t.cmdOpts.Results.strictFontSize
-        fontSize  = get(handle,'FontSize');
-        fontUnits = matlab2texUnits(get(handle,'FontUnits'), 'pt');
-        fontStyle = sprintf('\\fontsize{%d%s}{1em}%s\\selectfont',fontSize,fontUnits,fontStyle);
-    else
-        % don't try to be smart and "translate" MATLAB font sizes to proper LaTeX
-        % ones: it cannot be done. LaTeX uses semantic sizes (e.g. \small)
-        % whose actual dimensions depend on the document style, context, ...
-    end
-
-    if ~isempty(fontStyle)
-        fontStyle = opts_add(opts_new, 'font', fontStyle);
-    else
-        fontStyle = opts_new();
-    end
-end
-% ==============================================================================
-function axisOptions = getColorbarOptions(m2t, handle)
-
-    % begin collecting axes options
-    axisOptions = opts_new();
-    cbarOptions = {};
-    cbarStyleOptions = opts_new();
-
-    % set position, ticks etc. of the colorbar
-    loc = get(handle, 'Location');
-
-    switch lower(loc) % case insensitive (MATLAB: CamelCase, Octave: lower case)
-        case 'north'
-            cbarOptions{end+1} = 'horizontal';
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'at',...
-                '{(0.5,0.97)}');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'anchor',...
-                'north');
-            cbarStyleOptions = opts_add(cbarStyleOptions,...
-                'xticklabel pos', 'lower');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'width',...
-                '0.97*\pgfkeysvalueof{/pgfplots/parent axis width}');
-        case 'south'
-            cbarOptions{end+1} = 'horizontal';
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'at',...
-                '{(0.5,0.03)}');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'anchor', ...
-                'south');
-            cbarStyleOptions = opts_add(cbarStyleOptions, ...
-                'xticklabel pos','upper');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'width',...
-                '0.97*\pgfkeysvalueof{/pgfplots/parent axis width}');
-        case 'east'
-            cbarOptions{end+1} = 'right';
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'at',...
-                '{(0.97,0.5)}');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'anchor', ...
-                'east');
-            cbarStyleOptions = opts_add(cbarStyleOptions, ...
-                'xticklabel pos','left');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'width',...
-                '0.97*\pgfkeysvalueof{/pgfplots/parent axis width}');
-        case 'west'
-            cbarOptions{end+1} = 'left';
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'at',...
-                '{(0.03,0.5)}');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'anchor',...
-                'west');
-            cbarStyleOptions = opts_add(cbarStyleOptions,...
-                'xticklabel pos', 'right');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'width',...
-                '0.97*\pgfkeysvalueof{/pgfplots/parent axis width}');
-        case 'eastoutside'
-            %cbarOptions{end+1} = 'right';
-        case 'westoutside'
-            cbarOptions{end+1} = 'left';
-        case 'northoutside'
-            % TODO move to top
-            cbarOptions{end+1} = 'horizontal';
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'at',...
-                '{(0.5,1.03)}');
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'anchor',...
-                'south');
-            cbarStyleOptions = opts_add(cbarStyleOptions,...
-                'xticklabel pos', 'upper');
-        case 'southoutside'
-
-            cbarOptions{end+1} = 'horizontal';
-        otherwise
-            error('matlab2tikz:getColorOptions:unknownLocation',...
-                'getColorbarOptions: Unknown ''Location'' %s.', loc)
-    end
-
-    % axis label and direction
-    if isHG2(m2t)
-        % VERSION: Starting from R2014b there is only one field `label`.
-        % The colorbar's position determines, if it should be a x- or y-label.
-
-        % label
-        % TODO: Move redundant interpreter and multiline code to a separate
-        % function. It is duplicated below in 'title' and in functions
-        % 'getAxisOptions' and 'drawTitleOfAxes'.
-        labelString = get(get(handle, 'Label'), 'String');
-        if ~isempty(labelString) % add only, if not empty
-            labelInterpreter = get(get(handle, 'Label'), 'Interpreter');
-            labelString = prettyPrint(m2t, labelString, labelInterpreter);
-            if length(labelString) > 1 % multiline
-                cbarStyleOptions = opts_add(cbarStyleOptions, 'label style', ...
-                    '{align=center}');
-            end
-            labelString = join(m2t, labelString, '\\[1ex]');
-
-            if ~isempty(cbarOptions) && strcmpi(cbarOptions{1}, 'horizontal')
-                labelOption = 'xlabel';
-            else
-                labelOption = 'ylabel';
-            end
-
-            cbarStyleOptions = opts_add(cbarStyleOptions, labelOption, ...
-                sprintf('{%s}', labelString));
-        end
-
-        % direction
-        dirString = get(handle, 'Direction');
-        if ~strcmpi(dirString, 'normal') % only if not 'normal'
-            if ~isempty(cbarOptions) && strcmpi(cbarOptions{1}, 'horizontal')
-                dirOption = 'x dir';
-            else
-                dirOption = 'y dir';
-            end
-            cbarStyleOptions = opts_add(cbarStyleOptions, dirOption, dirString);
-        end
-
-        % TODO HG2: colorbar ticks and colorbar tick labels
-
-    else
-        % VERSION: Up to MATLAB R2014a and OCTAVE
-        [m2t, xo] = getAxisOptions(m2t, handle, 'x');
-        [m2t, yo] = getAxisOptions(m2t, handle, 'y');
-        xyo = opts_merge(xo, yo);
-        xyo = opts_remove(xyo, 'xmin','xmax','xtick','ymin','ymax','ytick');
-
-        cbarStyleOptions = opts_merge(cbarStyleOptions, xyo);
-    end
-
-    % title
-    title = get(get(handle, 'Title'), 'String');
-    if ~isempty(title)
-        titleInterpreter = get(get(handle, 'Title'), 'Interpreter');
-        title = prettyPrint(m2t, title, titleInterpreter);
-        if length(title) > 1 % multiline
-            cbarStyleOptions = opts_add(cbarStyleOptions, 'title style', ...
-                    '{align=center}');
-        end
-        title = join(m2t, title, '\\[1ex]');
-        cbarStyleOptions = opts_add(cbarStyleOptions, 'title', ...
-            sprintf('{%s}', title));
-    end
-
-    if m2t.cmdOpts.Results.strict
-        % Sampled colors.
-        numColors = size(m2t.currentHandles.colormap, 1);
-        cbarOptions{end+1} = 'sampled';
-        cbarStyleOptions = opts_add(cbarStyleOptions, 'samples', ...
-            sprintf('%d', numColors+1));
-
-    end
-
-    % Merge them together in axisOptions.
-    if isempty(cbarOptions)
-        axisOptions = opts_add(axisOptions, 'colorbar', []);
-    else
-        if length(cbarOptions) > 1
-            userWarning(m2t, ...
-                'Pgfplots cannot deal with more than one colorbar option yet.');
-        end
-        axisOptions = opts_add(axisOptions, ['colorbar ', cbarOptions{1}]);
-    end
-
-    if ~isempty(cbarStyleOptions)
-        axisOptions = opts_add(axisOptions, ...
-            'colorbar style', ...
-            ['{' opts_print(m2t, cbarStyleOptions, ',') '}']);
-    end
-
-    % Append upper and lower limit of the colorbar.
-    % TODO Use caxis not only for color bars.
-    clim = caxis(get(handle, 'axes'));
-    axisOptions = opts_add(axisOptions, 'point meta min', sprintf(m2t.ff, clim(1)));
-    axisOptions = opts_add(axisOptions, 'point meta max', sprintf(m2t.ff, clim(2)));
-
-    % do _not_ handle colorbar's children
-end
-% ==============================================================================
-function [m2t, xcolor] = getColor(m2t, handle, color, mode)
-% Handles MATLAB colors and makes them available to TikZ.
-% This includes translation of the color value as well as explicit
-% definition of the color if it is not available in TikZ by default.
-%
-% The variable 'mode' essentially determines what format 'color' can
-% have. Possible values are (as strings) 'patch' and 'image'.
-
-% check if the color is straight given in rgb
-% -- notice that we need the extra NaN test with respect to the QUIRK
-%    below
-    if isreal(color) && numel(color)==3 && ~any(isnan(color))
-        % everything alright: rgb color here
-        [m2t, xcolor] = rgb2colorliteral(m2t, color);
-    else
-        switch lower(mode)
-            case 'patch'
-                [m2t, xcolor] = patchcolor2xcolor(m2t, color, handle);
-            case 'image'
-                [m2t, colorindex] = cdata2colorindex(m2t, color, handle);
-                m = size(colorindex, 1);
-                n = size(colorindex, 2);
-                xcolor = cell(m, n);
-                for i = 1:m
-                    for j = 1:n
-                        [m2t, xc] = rgb2colorliteral(m2t, m2t.currentHandles.colormap(colorindex(i,j), :));
-                        xcolor{i, j} = xc;
-                    end
-                end
-            otherwise
-                error(['matlab2tikz:getColor', ...
-                    'Argument ''mode'' has illegal value ''%s''.'], ...
-                    mode);
-        end
-    end
-end
-% ==============================================================================
-function [m2t, xcolor] = patchcolor2xcolor(m2t, color, patchhandle)
-% Transforms a color of the edge or the face of a patch to an xcolor literal.
-    if ~ischar(color) && ~isnumeric(color)
-        error('patchcolor2xcolor:illegalInput', ...
-            'Input argument ''color'' not a string or numeric.');
-    end
-    if isnumeric(color)
-        [m2t, xcolor] = rgb2colorliteral(m2t, color);
-    else
-        switch color
-            case 'flat'
-                cdata = getCDataWithFallbacks(patchhandle);
-
-                col1 = cdata(1,1);
-                if all(isnan(cdata) | abs(cdata-col1)<1.0e-10)
-                    [m2t, colorindex] = cdata2colorindex(m2t, col1, patchhandle);
-                    [m2t, xcolor] = rgb2colorliteral(m2t, m2t.currentHandles.colormap(colorindex, :));
-                else
-                    % Don't return anything meaningful and count on the caller
-                    % to make something of it.
-                    xcolor = [];
-                end
-
-            case 'auto'
-                color = get(patchhandle, 'Color');
-                [m2t, xcolor] = rgb2colorliteral(m2t, color);
-
-            case 'none'
-                error('matlab2tikz:anycolor2rgb:ColorModelNoneNotAllowed',...
-                    ['Color model ''none'' not allowed here. ',...
-                    'Make sure this case gets intercepted before.']);
-
-            otherwise
-                    error('matlab2tikz:anycolor2rgb:UnknownColorModel',...
-                    'Don''t know how to handle the color model ''%s''.',color);
-        end
-    end
-end
-% ==============================================================================
-function cdata = getCDataWithFallbacks(patchhandle)
-% Looks for CData at different places
-    cdata = getOrDefault(patchhandle, 'CData', []);
-
-    if isempty(cdata) || ~isnumeric(cdata)
-        child = get(patchhandle, 'Children');
-        cdata = get(child, 'CData');
-    end
-    if isempty(cdata) || ~isnumeric(cdata)
-        % R2014b+: CData is implicit by the ordering of the siblings
-        siblings = get(get(patchhandle, 'Parent'), 'Children');
-        cdata = find(siblings(end:-1:1)==patchhandle);
-    end
-end
-% ==============================================================================
-function [m2t, colorindex] = cdata2colorindex(m2t, cdata, imagehandle)
-% Transforms a color in CData format to an index in the color map.
-% Only does something if CDataMapping is 'scaled', really.
-
-    if ~isnumeric(cdata) && ~islogical(cdata)
-        error('matlab2tikz:cdata2colorindex:unknownCDataType',...
-            'Don''t know how to handle CData ''%s''.',cdata);
-    end
-
-    axeshandle = m2t.currentHandles.gca;
-
-    % -----------------------------------------------------------------------
-    % For the following, see, for example, the MATLAB help page for 'image',
-    % section 'Image CDataMapping'.
-    switch get(imagehandle, 'CDataMapping')
-        case 'scaled'
-            % need to scale within clim
-            % see MATLAB's manual page for caxis for details
-            clim = get(axeshandle, 'clim');
-            m = size(m2t.currentHandles.colormap, 1);
-            colorindex = zeros(size(cdata));
-            idx1 = cdata <= clim(1);
-            idx2 = cdata >= clim(2);
-            idx3 = ~idx1 & ~idx2;
-            colorindex(idx1) = 1;
-            colorindex(idx2) = m;
-            colorindex(idx3) = fix((cdata(idx3)-clim(1)) / (clim(2)-clim(1)) *m) ...
-                + 1;
-        case 'direct'
-            % direct index
-            colorindex = cdata;
-
-        otherwise
-            error('matlab2tikz:anycolor2rgb:unknownCDataMapping',...
-                'Unknown CDataMapping ''%s''.',cdatamapping);
-    end
-end
-% ==============================================================================
-function [m2t, key, lOpts] = getLegendOpts(m2t, handle)
-% Need to check that there's nothing inside visible before we
-% abandon this legend -- an invisible property of the parent just
-% means the legend has no box.
-    children = get(handle, 'Children');
-    if ~isVisible(handle) && ~any(isVisible(children))
-        return
-    end
-
-    lStyle = opts_new();
-
-    lStyle = legendPosition(m2t, handle, lStyle);
-    lStyle = legendOrientation(m2t, handle, lStyle);
-    lStyle = legendEntryAlignment(m2t, handle, lStyle);
-
-    % If the plot has 'legend boxoff', we have the 'not visible'
-    % property, so turn off line and background fill.
-    if (~isVisible(handle))
-        lStyle = opts_add(lStyle, 'fill', 'none');
-        lStyle = opts_add(lStyle, 'draw', 'none');
-    else
-        % handle colors
-        [edgeColor, isDfltEdge] = getAndCheckDefault('Legend', handle, ...
-                                                     'EdgeColor', [1 1 1]);
-        if isNone(edgeColor)
-            lStyle = opts_add(lStyle, 'draw', 'none');
-
-        elseif ~isDfltEdge
-            [m2t, col] = getColor(m2t, handle, edgeColor, 'patch');
-            lStyle = opts_add(lStyle, 'draw', col);
-        end
-
-        [fillColor, isDfltFill] = getAndCheckDefault('Legend', handle, ...
-                                                     'Color', [1 1 1]);
-        if isNone(fillColor)
-            lStyle = opts_add(lStyle, 'fill', 'none');
-
-        elseif ~isDfltFill
-            [m2t, col] = getColor(m2t, handle, fillColor, 'patch');
-            lStyle = opts_add(lStyle, 'fill', col);
-        end
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-    key = 'legend style';
-    lOpts = opts_print(m2t, lStyle, ',');
-end
-% ==============================================================================
-function [lStyle] = legendOrientation(m2t, handle, lStyle)
-% handle legend orientation
-    ori = get(handle, 'Orientation');
-    switch lower(ori)
-        case 'horizontal'
-            numLegendEntries = sprintf('%d',length(get(handle, 'String')));
-            lStyle = opts_add(lStyle, 'legend columns', numLegendEntries);
-
-        case 'vertical'
-            % Use default.
-        otherwise
-            userWarning(m2t, [' Unknown legend orientation ''',ori,'''' ...
-                '. Choosing default (vertical).']);
-    end
-end
-% ==============================================================================
-function [lStyle] = legendPosition(m2t, handle, lStyle)
-% handle legend location
-% #COMPLEX: just a big switch-case
-    loc  = get(handle, 'Location');
-    dist = 0.03;  % distance to to axes in normalized coordinates
-    % MATLAB(R)'s keywords are camel cased (e.g., 'NorthOutside'), in Octave
-    % small cased ('northoutside'). Hence, use lower() for uniformity.
-    switch lower(loc)
-        case 'northeast'
-            return % don't do anything in this (default) case
-        case 'northwest'
-            position = [dist, 1-dist];
-            anchor   = 'north west';
-        case 'southwest'
-            position = [dist, dist];
-            anchor   = 'south west';
-        case 'southeast'
-            position = [1-dist, dist];
-            anchor   = 'south east';
-        case 'north'
-            position = [0.5, 1-dist];
-            anchor   = 'north';
-        case 'east'
-            position = [1-dist, 0.5];
-            anchor   = 'east';
-        case 'south'
-            position = [0.5, dist];
-            anchor   = 'south';
-        case 'west'
-            position = [dist, 0.5];
-            anchor   = 'west';
-        case 'northoutside'
-            position = [0.5, 1+dist];
-            anchor = 'south';
-        case 'southoutside'
-            position = [0.5, -dist];
-            anchor = 'north';
-        case 'eastoutside'
-            position = [1+dist, 0.5];
-            anchor = 'west';
-        case 'westoutside'
-            position = [-dist, 0.5];
-            anchor = 'east';
-        case 'northeastoutside'
-            position = [1+dist, 1];
-            anchor = 'north west';
-        case 'northwestoutside'
-            position = [-dist, 1];
-            anchor = 'north east';
-        case 'southeastoutside'
-            position = [1+dist, 0];
-            anchor = 'south west';
-        case 'southwestoutside'
-            position = [-dist, 0];
-            anchor = 'south east';
-        case 'none'
-            legendPos = get(handle, 'Position');
-            unit = get(handle, 'Units');
-            if isequal(unit, 'normalized')
-                position = legendPos(1:2);
-            else
-                % Calculate where the legend is located w.r.t. the axes.
-                axesPos = get(m2t.currentHandles.gca, 'Position');
-                axesUnit = get(m2t.currentHandles.gca, 'Units');
-                % Convert to legend unit
-                axesPos = convertUnits(axesPos, axesUnit, unit);
-                % By default, the axes position is given w.r.t. to the figure,
-                % and so is the legend.
-                position = (legendPos(1:2)-axesPos(1:2)) ./ axesPos(3:4);
-            end
-            anchor = 'south west';
-        case {'best','bestoutside'}
-            % TODO: Implement these.
-            % The position could be determined by means of 'Position' and/or
-            % 'OuterPosition' of the legend handle; in fact, this could be made
-            % a general principle for all legend placements.
-            userWarning(m2t, [sprintf(' Option ''%s'' not yet implemented.',loc),         ...
-                ' Choosing default.']);
-            return % use defaults
-
-        otherwise
-            userWarning(m2t, [' Unknown legend location ''',loc,''''           ...
-                '. Choosing default.']);
-            return % use defaults
-    end
-
-    % set legend position
-    %TODO: shouldn't this include units?
-    lStyle = opts_add(lStyle, 'at',  sprintf('{(%s,%s)}', ...
-                        formatDim(position(1)), formatDim(position(2))));
-    lStyle = opts_add(lStyle, 'anchor', anchor);
-
-end
-% ==============================================================================
-function [lStyle] = legendEntryAlignment(m2t, handle, lStyle)
-% determines the text and picture alignment inside a legend
-    textalign = '';
-    pictalign = '';
-    switch m2t.env
-        case 'Octave'
-            % Octave allows to change the alignment of legend text and
-            % pictograms using legend('left') and legend('right')
-            textpos = get(handle, 'textposition');
-            switch lower(textpos)
-                case 'left'
-                    % pictogram right of flush right text
-                    textalign = 'left';
-                    pictalign = 'right';
-                case 'right'
-                    % pictogram left of flush left text (default)
-                    textalign = 'right';
-                    pictalign = 'left';
-                otherwise
-                    userWarning(m2t, ...
-                        ['Unknown legend text position ''',...
-                        textpos, '''. Choosing default.']);
-            end
-        case 'MATLAB'
-            % does not specify text/pictogram alignment in legends
-        otherwise
-            errorUnknownEnvironment();
-    end
-
-    % set alignment of legend text and pictograms, if available
-    if ~isempty(textalign) && ~isempty(pictalign)
-        lStyle = opts_add(lStyle, 'legend cell align', textalign);
-        lStyle = opts_add(lStyle, 'align', textalign);
-        lStyle = opts_add(lStyle, 'legend plot pos', pictalign);
-    else
-        % Make sure the entries are flush left (default MATLAB behavior).
-        % This is also import for multiline legend entries: Without alignment
-        % specification, the TeX document won't compile.
-        % 'legend plot pos' is not set explicitly, since 'left' is default.
-        lStyle = opts_add(lStyle, 'legend cell align', 'left');
-        lStyle = opts_add(lStyle, 'align', 'left');
-    end
-end
-% ==============================================================================
-function [pgfTicks, pgfTickLabels, hasMinorTicks, tickDirection] = getAxisTicks(m2t, handle, axis)
-% Return axis tick marks Pgfplots style. Nice: Tick lengths and such
-% details are taken care of by Pgfplots.
-    if ~strcmpi(axis,'x') && ~strcmpi(axis,'y') && ~strcmpi(axis,'z')
-        error('matlab2tikz:illegalAxisSpecifier',...
-            'Illegal axis specifier ''%s''.', axis);
-    end
-
-    keywordTickMode = [upper(axis), 'TickMode'];
-    tickMode = get(handle, keywordTickMode);
-    keywordTick = [upper(axis), 'Tick'];
-    ticks = get(handle, keywordTick);
-    if isempty(ticks)
-        % If no ticks are present, we need to enforce this in any case.
-        pgfTicks = '\empty';
-    else
-        if strcmp(tickMode, 'auto') && ~m2t.cmdOpts.Results.strict
-            % If the ticks are set automatically, and strict conversion is
-            % not required, then let Pgfplots take care of the ticks.
-            % In most cases, this looks a lot better anyway.
-            pgfTicks = [];
-        else % strcmp(tickMode,'manual') || m2t.cmdOpts.Results.strict
-            pgfTicks = join(m2t, cellstr(num2str(ticks(:))), ', ');
-        end
-    end
-
-    keywordTickLabelMode = [upper(axis), 'TickLabelMode'];
-    tickLabelMode = get(handle, keywordTickLabelMode);
-    keywordTickLabel = [upper(axis), 'TickLabel'];
-    tickLabels = cellstr(get(handle, keywordTickLabel));
-    if strcmp(tickLabelMode, 'auto') && ~m2t.cmdOpts.Results.strict
-        pgfTickLabels = [];
-    else % strcmp(tickLabelMode,'manual') || m2t.cmdOpts.Results.strict
-        keywordScale = [upper(axis), 'Scale'];
-        isAxisLog = strcmp(getOrDefault(handle,keywordScale, 'lin'), 'log');
-        [pgfTicks, pgfTickLabels] = ...
-            matlabTicks2pgfplotsTicks(m2t, ticks, tickLabels, isAxisLog, tickLabelMode);
-    end
-
-    keywordMinorTick = [upper(axis), 'MinorTick'];
-    hasMinorTicks = strcmp(getOrDefault(handle, keywordMinorTick, 'off'), 'on');
-    tickDirection = getOrDefault(handle, 'TickDir', 'in');
-end
-% ==============================================================================
-function [pTicks, pTickLabels] = ...
-    matlabTicks2pgfplotsTicks(m2t, ticks, tickLabels, isLogAxis, tickLabelMode)
-% Converts MATLAB style ticks and tick labels to pgfplots style (if needed)
-    if isempty(ticks)
-        pTicks      = '\empty';
-        pTickLabels = [];
-        return
-    end
-
-    % set ticks + labels
-    pTicks = join(m2t, num2cell(ticks), ',');
-
-    % if there's no specific labels, return empty
-    if isempty(tickLabels) || (length(tickLabels)==1 && isempty(tickLabels{1}))
-        pTickLabels = '\empty';
-        return
-    end
-
-    % sometimes tickLabels are cells, sometimes plain arrays
-    % -- unify this to cells
-    if ischar(tickLabels)
-        tickLabels = strtrim(mat2cell(tickLabels,                  ...
-            ones(size(tickLabels,1), 1), ...
-            size(tickLabels, 2)          ...
-            ) ...
-            );
-    end
-
-    % What MATLAB does when there the number of ticks and tick labels do not
-    % coincide is somewhat unclear. To fix bug
-    %     https://github.com/matlab2tikz/matlab2tikz/issues/161,
-    % cut off the first entries in `ticks`.
-    m = length(ticks);
-    n = length(tickLabels);
-    if n < m
-        ticks = ticks(m-n+1:end);
-    end
-
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    % Check if tickLabels are really necessary (and not already covered by
-    % the tick values themselves).
-    plotLabelsNecessary = false;
-
-    k = find(ticks ~= 0.0, 1); % get an index with non-zero tick value
-    if isLogAxis || isempty(k) % only a 0-tick
-        scalingFactor = 1;
-    else
-        % When plotting axis, MATLAB might scale the axes by a factor of ten,
-        % say 10^n, and plot a 'x 10^k' next to the respective axis. This is
-        % common practice when the tick marks are really large or small
-        % numbers.
-        % Unfortunately, MATLAB doesn't contain the information about the
-        % scaling anywhere in the plot, and at the same time the {x,y}TickLabels
-        % are given as t*10^k, thus no longer corresponding to the actual
-        % value t.
-        % Try to find the scaling factor here. This is then used to check
-        % whether or not explicit {x,y}TickLabels are really necessary.
-        s = str2double(tickLabels{k});
-        scalingFactor = ticks(k)/s;
-        % check if the factor is indeed a power of 10
-        S = log10(scalingFactor);
-        if abs(round(S)-S) > m2t.tol
-            scalingFactor = 1.0;
-        end
-    end
-
-    for k = 1:min(length(ticks),length(tickLabels))
-        % Don't use str2num here as then, literal strings as 'pi' get
-        % legally transformed into 3.14... and the need for an explicit
-        % label will not be recognized. str2double returns a NaN for 'pi'.
-        if isLogAxis
-            s = 10^(str2double(tickLabels{k}));
-        else
-            s = str2double(tickLabels{k});
-        end
-        if isnan(s)  ||  abs(ticks(k)-s*scalingFactor) > m2t.tol
-            plotLabelsNecessary = true;
-            break;
-        end
-    end
-    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-    if plotLabelsNecessary
-        % if the axis is logscaled, MATLAB does not store the labels,
-        % but the exponents to 10
-        if isLogAxis
-            for k = 1:length(tickLabels)
-                if isnumeric(tickLabels{k})
-                    str = num2str(tickLabels{k});
-                else
-                    str = tickLabels{k};
-                end
-                if strcmpi(tickLabelMode,'auto')
-                    tickLabels{k} = sprintf('$10^{%s}$', str);
-                end
-            end
-        end
-        tickLabels = cellfun(@(l)(sprintf('{%s}',l)), tickLabels, ...
-            'UniformOutput', false);
-        pTickLabels = join(m2t, tickLabels, ',');
-    else
-        pTickLabels = [];
-    end
-end
-% ==============================================================================
-function tikzLineStyle = translateLineStyle(matlabLineStyle)
-    if(~ischar(matlabLineStyle))
-        error('matlab2tikz:translateLineStyle:NotAString',...
-            'Variable matlabLineStyle is not a string.');
-    end
-
-    switch (matlabLineStyle)
-        case 'none'
-            tikzLineStyle = '';
-        case '-'
-            tikzLineStyle = 'solid';
-        case '--'
-            tikzLineStyle = 'dashed';
-        case ':'
-            tikzLineStyle = 'dotted';
-        case '-.'
-            tikzLineStyle = 'dash pattern=on 1pt off 3pt on 3pt off 3pt';
-        otherwise
-            error('matlab2tikz:translateLineStyle:UnknownLineStyle',...
-                'Unknown matlabLineStyle ''%s''.', matlabLineStyle);
-    end
-end
-% ==============================================================================
-function [m2t, table] = makeTable(m2t, varargin)
-%   [m2t,table] = makeTable(m2t, 'name1', data1, 'name2', data2, ...)
-%   [m2t,table] = makeTable(m2t, {'name1','name2',...}, {data1, data2, ...})
-%   [m2t,table] = makeTable(m2t, {'name1','name2',...}, [data1(:), data2(:), ...])
-%
-%  When all the names are empty, no header is printed
-    [variables, data] = parseInputsForTable_(varargin{:});
-
-    COLSEP = sprintf('\t');
-    if m2t.cmdOpts.Results.externalData
-        ROWSEP = sprintf('\n');
-    else
-        ROWSEP = sprintf('\\\\\n');
-    end
-
-    nColumns  = numel(data);
-    nRows     = cellfun(@numel, data);
-    if ~all(nRows==nRows(1))
-        warning('matlab2tikz:makeTableDifferentNumberOfRows',...
-            'Different data lengths [%s]. Only including the first %d ones.',...
-            num2str(nRows), min(nRows));
-    end
-    nRows = min(nRows);
-
-    FORMAT = repmat({m2t.ff}, 1, nColumns);
-    FORMAT(cellfun(@isCellOrChar, data)) = {'%s'};
-    FORMAT = join(m2t, FORMAT, COLSEP);
-    if all(cellfun(@isempty, variables))
-        header = {};
-    else
-        header = {join(m2t, variables, COLSEP)};
-    end
-
-    table = cell(nRows,1);
-    for iRow = 1:nRows
-        thisData = cellfun(@(x)(x(iRow)), data, 'UniformOutput', false);
-        for jCol = 1:nColumns
-            if iscell(thisData{jCol}) %TODO: probably this can be done more clearly
-                thisData{jCol} = thisData{jCol}{1};
-            end
-        end
-        table{iRow} = sprintf(FORMAT, thisData{:});
-    end
-    table = lower(table); % convert NaN and Inf to lower case for TikZ
-    table = [join(m2t, [header;table], ROWSEP) ROWSEP];
-
-    if m2t.cmdOpts.Results.externalData
-        % output data to external file
-        m2t.dataFileNo = m2t.dataFileNo + 1;
-        [filename, latexFilename] = externalFilename(m2t, m2t.dataFileNo, '.tsv');
-
-        % write the data table to an external file
-        fid = fileOpenForWrite(m2t, filename);
-        fprintf(fid, '%s', table);
-        fclose(fid);
-
-        % put the filename in the TikZ output
-        table = latexFilename;
-    else
-        % output data with "%newline" prepended for formatting consistency
-        % do NOT prepend another newline in the output: LaTeX will crash.
-        table = sprintf('%%\n%s', table);
-    end
-end
-% ==============================================================================
-function [variables, data] = parseInputsForTable_(varargin)
-% parse input arguments for |makeTable|
-    if numel(varargin) == 2 % cell syntax
-        variables = varargin{1};
-        data      = varargin{2};
-        if ischar(variables)
-            % one variable, one data vector -> (cell, cell)
-            variables = {variables};
-            data      = {data};
-        elseif iscellstr(variables) && ~iscell(data)
-            % multiple variables, one data matrix -> (cell, cell) by column
-            data = num2cell(data, 1);
-        end
-    else % key-value syntax
-        variables = varargin(1:2:end-1);
-        data      = varargin(2:2:end);
-    end
-end
-% ==============================================================================
-function [path, texpath] = externalFilename(m2t, counter, extension)
-% generates a file name for an external data file and its relative TeX path
-
-    [dummy, name] = fileparts(m2t.tikzFileName); %#ok
-    baseFilename  = [name '-' num2str(counter) extension];
-    path    = fullfile(m2t.dataPath, baseFilename);
-    texpath = TeXpath(fullfile(m2t.relativeDataPath, baseFilename));
-end
-% ==============================================================================
-function [names,definitions] = dealColorDefinitions(mergedColorDefs)
-    if isempty(mergedColorDefs)
-        mergedColorDefs = {};
-    end
-    [names,definitions] = cellfun(@(x)(deal(x{:})),  mergedColorDefs, ...
-        'UniformOutput', false);
-end
-% ==============================================================================
-function [m2t, colorLiteral] = rgb2colorliteral(m2t, rgb)
-% Translates an rgb value to an xcolor literal
-%
-% Possible outputs:
-%  - xcolor literal color, e.g. 'blue'
-%  - mixture of 2 previously defined colors, e.g. 'red!70!green'
-%  - a newly defined color, e.g. 'mycolor10'
-
-% Take a look at xcolor.sty for the color definitions.
-% In xcolor.sty some colors are defined in CMYK space and approximated
-% crudely for RGB color space. So it is better to redefine those colors
-% instead of using xcolor's:
-%    'cyan' , 'magenta', 'yellow', 'olive'
-%    [0,1,1], [1,0,1]  , [1,1,0] , [0.5,0.5,0]
-
-    xcolColorNames = {'white', 'black', 'red', 'green', 'blue', ...
-                      'brown', 'lime', 'orange', 'pink', ...
-                      'purple', 'teal', 'violet', ...
-                      'darkgray', 'gray', 'lightgray'};
-    xcolColorSpecs = {[1,1,1], [0,0,0], [1,0,0], [0,1,0], [0,0,1], ...
-                      [0.75,0.5,0.25], [0.75,1,0], [1,0.5,0], [1,0.75,0.75], ...
-                      [0.75,0,0.25], [0,0.5,0.5], [0.5,0,0.5], ...
-                      [0.25,0.25,0.25], [0.5,0.5,0.5], [0.75,0.75,0.75]};
-
-    colorNames = [xcolColorNames, m2t.extraRgbColorNames];
-    colorSpecs = [xcolColorSpecs, m2t.extraRgbColorSpecs];
-
-    %% check if rgb is a predefined color
-    for kColor = 1:length(colorSpecs)
-        Ck = colorSpecs{kColor}(:);
-        if max(abs(Ck - rgb(:))) < m2t.colorPrecision
-            colorLiteral = colorNames{kColor};
-            return % exact color was predefined
-        end
-    end
-
-    %% check if the color is a linear combination of two already defined colors
-    for iColor = 1:length(colorSpecs)
-        for jColor = iColor+1:length(colorSpecs)
-            Ci = colorSpecs{iColor}(:);
-            Cj = colorSpecs{jColor}(:);
-
-            % solve color mixing equation `Ck = p * Ci + (1-p) * Cj` for p
-            p  = (Ci-Cj) \ (rgb(:)-Cj);
-            p  = round(100*p)/100;  % round to a percentage
-            Ck = p * Ci + (1-p)*Cj; % approximated mixed color
-
-            if p <= 1 && p >= 0 && max(abs(Ck(:) - rgb(:))) < m2t.colorPrecision
-                colorLiteral = sprintf('%s!%d!%s', colorNames{iColor}, round(p*100), ...
-                    colorNames{jColor});
-                return % linear combination found
-            end
-        end
-    end
-
-    %% Define colors that are not a linear combination of two known colors
-    colorLiteral = sprintf('mycolor%d', length(m2t.extraRgbColorNames)+1);
-    m2t.extraRgbColorNames{end+1} = colorLiteral;
-    m2t.extraRgbColorSpecs{end+1} = rgb;
-end
-% ==============================================================================
-function newstr = join(m2t, cellstr, delimiter)
-% This function joins a cell of strings to a single string (with a
-% given delimiter in between two strings, if desired).
-%
-% Example of usage:
-%              join(m2t, cellstr, ',')
-    if isempty(cellstr)
-        newstr = '';
-        return
-    end
-
-    % convert all values to strings first
-    nElem = numel(cellstr);
-    for k = 1:nElem
-        if isnumeric(cellstr{k})
-            cellstr{k} = sprintf(m2t.ff, cellstr{k});
-        elseif iscell(cellstr{k})
-            cellstr{k} = join(m2t, cellstr{k}, delimiter);
-            % this will fail for heavily nested cells
-        elseif ~ischar(cellstr{k})
-            error('matlab2tikz:join:NotCellstrOrNumeric',...
-                'Expected cellstr or numeric.');
-        end
-    end
-
-    % inspired by strjoin of recent versions of MATLAB
-    newstr = cell(2,nElem);
-    newstr(1,:)         = reshape(cellstr, 1, nElem);
-    newstr(2,1:nElem-1) = {delimiter}; % put delimiters in-between the elements
-    newstr = [newstr{:}];
-end
-% ==============================================================================
-function [width, height, unit] = getNaturalFigureDimension(m2t)
-    % Returns the size of figure (in inch)
-    % To stay compatible with getNaturalAxesDimensions, the unit 'in' is
-    % also returned.
-
-    % Get current figure size
-    figuresize = get(m2t.currentHandles.gcf, 'Position');
-    figuresize = figuresize([3 4]);
-    figureunit = get(m2t.currentHandles.gcf, 'Units');
-
-    % Convert Figure Size
-    unit = 'in';
-    figuresize = convertUnits(figuresize, figureunit, unit);
-
-    % Split size into width and height
-    width  = figuresize(1);
-    height = figuresize(2);
-
-end
-% ==============================================================================
-function dimension = getFigureDimensions(m2t, widthString, heightString)
-% Returns the physical dimension of the figure.
-
-    [width, height, unit] = getNaturalFigureDimension(m2t);
-
-    % get the natural width-height ration of the plot
-    axesWidthHeightRatio = width / height;
-    % check matlab2tikz arguments
-    if ~isempty(widthString)
-        width = extractValueUnit(widthString);
-    end
-    if ~isempty(heightString)
-        height = extractValueUnit(heightString);
-    end
-
-    % prepare the output
-    if ~isempty(widthString) && ~isempty(heightString)
-        dimension.x.unit  = width.unit;
-        dimension.x.value = width.value;
-        dimension.y.unit  = height.unit;
-        dimension.y.value = height.value;
-    elseif ~isempty(widthString)
-        dimension.x.unit  = width.unit;
-        dimension.x.value = width.value;
-        dimension.y.unit  = width.unit;
-        dimension.y.value = width.value / axesWidthHeightRatio;
-    elseif ~isempty(heightString)
-        dimension.y.unit  = height.unit;
-        dimension.y.value = height.value;
-        dimension.x.unit  = height.unit;
-        dimension.x.value = height.value * axesWidthHeightRatio;
-    else % neither width nor height given
-        dimension.x.unit  = unit;
-        dimension.x.value = width;
-        dimension.y.unit  = unit;
-        dimension.y.value = height;
-    end
-end
-% ==============================================================================
-function position = getAxesPosition(m2t, handle, widthString, heightString, axesBoundingBox)
-% Returns the physical position of the axes. This includes - in difference
-% to the Dimension - also an offset to shift the axes inside the figure
-% An optional bounding box can be used to omit empty borders.
-
-    % Deal with optional parameter
-    if nargin < 4
-        axesBoundingBox = [0 0 1 1];
-    end
-
-    % First get the whole figures size
-    figDim = getFigureDimensions(m2t, widthString, heightString);
-
-    % Get the relative position of the axis
-    relPos = getRelativeAxesPosition(m2t, handle, axesBoundingBox);
-
-    position.x.value = relPos(1) * figDim.x.value;
-    position.x.unit  = figDim.x.unit;
-    position.y.value = relPos(2) * figDim.y.value;
-    position.y.unit  = figDim.y.unit;
-    position.w.value = relPos(3) * figDim.x.value;
-    position.w.unit  = figDim.x.unit;
-    position.h.value = relPos(4) * figDim.y.value;
-    position.h.unit  = figDim.y.unit;
-end
-% ==============================================================================
-function [position] = getRelativeAxesPosition(m2t, axesHandles, axesBoundingBox)
-% Returns the relative position of axes within the figure.
-% Position is an (n,4) matrix with [minX, minY, width, height] for each
-% handle. All these values are relative to the figure size, which means
-% that [0, 0, 1, 1] covers the whole figure.
-% It is possible to add a second parameter with the relative coordinates of
-% a bounding box around all axes of the figure (see getRelevantAxes()). In
-% this case, relative positions are rescaled so that the bounding box is
-% [0, 0, 1, 1]
-
-    % Get Figure Dimension
-    [figWidth, figHeight, figUnits] = getNaturalFigureDimension(m2t);
-
-    % Initialize position
-    position = zeros(numel(axesHandles), 4);
-    % Iterate over all handles
-    for i = 1:numel(axesHandles)
-        axesHandle = axesHandles(i);
-        axesPos = get(axesHandle, 'Position');
-        axesUnits = get(axesHandle, 'Units');
-        if isequal(lower(axesUnits), 'normalized')
-            % Position is already relative
-            position(i,:) = axesPos;
-        else
-            % Convert figure size into axes units
-            figureSize = convertUnits([figWidth, figHeight], figUnits, axesUnits);
-            % Figure size into axes units to get the relative size
-            position(i,:) = axesPos ./ [figureSize, figureSize];
-
-        end
-
-        % Change size if DataAspectRatioMode is manual
-        if isequal(lower(get(axesHandle,'DataAspectRatioMode')),'manual')
-            % get limits
-            xLim = get(axesHandle, 'XLim');
-            yLim = get(axesHandle, 'YLim');
-            % Get Aspect Ratio between width and height
-            aspectRatio = get(axesHandle,'DataAspectRatio');
-            % And Adjust it to the figure dimensions
-            aspectRatio = aspectRatio(1) * figWidth * (yLim(2) - yLim(1)) ...
-                / (aspectRatio(2) * figHeight * (xLim(2)-xLim(1)));
-            % Recompute height
-            newHeight = position(i,3) * aspectRatio;
-            % shrink width if newHeight is too large
-            if newHeight > position(i,4)
-                % Recompute width
-                newWidth = position(i,4) / aspectRatio;
-                % Center Axis
-                offset = (position(i,3) - newWidth) / 2;
-                position(i,1) = position(i,1) + offset;
-                % Store new width
-                position(i,3) = newWidth;
-            else
-                % Center Axis
-                offset = (position(i,4) - newHeight) / 2;
-                position(i,2) = position(i,2) + offset;
-                % Store new height
-                position(i,4) = newHeight;
-            end
-        end
-    end
-
-    %% Rescale if axesBoundingBox is given
-    if exist('axesBoundingBox','var')
-        % shift position so that [0, 0] is the lower left corner of the
-        % bounding box
-        position(:,1) = position(:,1) - axesBoundingBox(1);
-        position(:,2) = position(:,2) - axesBoundingBox(2);
-        % Recale
-        position(:,[1 3]) = position(:,[1 3]) / max(axesBoundingBox([3 4]));
-        position(:,[2 4]) = position(:,[2 4]) / max(axesBoundingBox([3 4]));
-    end
-end
-% ==============================================================================
-function texUnits = matlab2texUnits(matlabUnits, fallbackValue)
-    switch matlabUnits
-        case 'pixels'
-            texUnits = 'px'; % only in pdfTex/LuaTeX
-        case 'centimeters'
-            texUnits = 'cm';
-        case 'characters'
-            texUnits = 'em';
-        case 'points'
-            texUnits = 'pt';
-        case 'inches'
-            texUnits = 'in';
-        otherwise
-            texUnits = fallbackValue;
-    end
-end
-% ==============================================================================
-function dstValue = convertUnits(srcValue, srcUnit, dstUnit)
-% Converts values between different units.
-%   srcValue stores a length (or vector of lengths) in srcUnit.
-% The resulting dstValue is the converted length into dstUnit.
-%
-% Currently supported units are: in, cm, px, pt
-
-    % Use tex units, if possible (to make things simple)
-    srcUnit = matlab2texUnits(lower(srcUnit),lower(srcUnit));
-    dstUnit = matlab2texUnits(lower(dstUnit),lower(dstUnit));
-
-    if isequal(srcUnit, dstUnit)
-        dstValue = srcValue;
-        return % conversion to the same unit => factor = 1
-    end
-
-    units  = {srcUnit, dstUnit};
-    factor = ones(1,2);
-    for ii = 1:numel(factor) % Same code for srcUnit and dstUnit
-        % Use inches as intermediate unit
-        % Compute the factor to convert an inch into another unit
-        switch units{ii}
-            case 'cm'
-               factor(ii) = 2.54;
-            case 'px'
-               factor(ii) = get(0, 'ScreenPixelsPerInch');
-            case 'in'
-                factor(ii) = 1;
-            case 'pt'
-                factor(ii) = 72;
-            otherwise
-                warning('MATLAB2TIKZ:UnknownPhysicalUnit',...
-                'Can not convert unit ''%s''. Using conversion factor 1.', units{ii});
-        end
-    end
-
-    dstValue = srcValue * factor(2) / factor(1);
-end
-% ==============================================================================
-function out = extractValueUnit(str)
-% Decompose m2t.cmdOpts.Results.width into value and unit.
-
-    % Regular expression to match '4.12cm', '\figurewidth', ...
-    fp_regex = '[-+]?\d*\.?\d*(?:e[-+]?\d+)?';
-    pattern = strcat('(', fp_regex, ')?', '(\\?[a-z]+)');
-
-    [dummy,dummy,dummy,dummy,t,dummy] = regexp(str, pattern, 'match'); %#ok
-
-    if length(t)~=1
-        error('getAxesDimensions:illegalLength', ...
-            'The width string ''%s'' could not be decomposed into value-unit pair.', str);
-    end
-
-    if length(t{1}) == 1
-        out.value = 1.0; % such as in '1.0\figurewidth'
-        out.unit  = strtrim(t{1}{1});
-    elseif length(t{1}) == 2 && isempty(t{1}{1})
-        % MATLAB(R) does this:
-        % length(t{1})==2 always, but the first field may be empty.
-        out.value = 1.0;
-        out.unit  = strtrim(t{1}{2});
-    elseif length(t{1}) == 2
-        out.value = str2double(t{1}{1});
-        out.unit  = strtrim(t{1}{2});
-    else
-        error('getAxesDimensions:illegalLength', ...
-            'The width string ''%s'' could not be decomposed into value-unit pair.', str);
-    end
-end
-% ==============================================================================
-function str = escapeCharacters(str)
-% Replaces "%" and "\" with respectively "%%" and "\\"
-    str = strrep(str, '%' , '%%');
-    str = strrep(str, '\' , '\\');
-end
-% ==============================================================================
-function bool = isNone(value)
-% Checks whether a value is 'none'
-    bool = strcmpi(value, 'none');
-end
-% ==============================================================================
-function val = getOrDefault(handle, key, default)
-% gets the value or returns the default value if no such property exists
-    if all(isprop(handle, key))
-        val = get(handle, key);
-    else
-        val = default;
-    end
-end
-% ==============================================================================
-function val = getFactoryOrDefault(type, key, fallback)
-% get factory default value for a certain type of HG object
-% this CANNOT be done using |getOrDefault| as |isprop| doesn't work for
-% factory/default settings. Hence, we use a more expensive try-catch instead.
-    try
-        groot = 0;
-        val = get(groot, ['Factory' type key]);
-    catch
-        val = fallback;
-    end
-end
-% ==============================================================================
-function [val, isDefault] = getAndCheckDefault(type, handle, key, default)
-% gets the value from a handle of certain type and check the default values
-    default   = getFactoryOrDefault(type, key, default);
-    val       = getOrDefault(handle, key, default);
-    isDefault = isequal(val, default);
-end
-% ==============================================================================
-function [m2t, opts] = addIfNotDefault(m2t, type, handle, key, default, pgfKey, opts)
-% sets an option in the options array named `pgfKey` if the MATLAB option is
-% not a default value
-    [value, isDefault] = getAndCheckDefault(type, handle, key, default);
-    if ~isDefault || m2t.cmdOpts.Results.strict
-        opts = opts_add(opts, pgfKey, value);
-    end
-end
-% ==============================================================================
-function out = isVisible(handles)
-% Determines whether an object is actually visible or not.
-    out = strcmp(get(handles,'Visible'), 'on');
-    % There's another handle property, 'HandleVisibility', which may or may not
-    % determine the visibility of the object. Empirically, it seems to be 'off'
-    % whenever we're dealing with an object that's not user-created, such as
-    % automatic axis ticks, baselines in bar plots, axis lines for polar plots
-    % and so forth. For now, don't check 'HandleVisibility'.
-end
-% ==============================================================================
-function [relevantAxesHandles, axesBoundingBox] = getRelevantAxes(m2t, axesHandles)
-% Returns relevant axes. These are defines as visible axes that are no
-% colorbars. In addition, a bounding box around all relevant Axes is
-% computed. This can be used to avoid undesired borders.
-% This function is the remaining code of alignSubPlots() in the alternative
-% positioning system.
-    relevantAxesHandles = [];
-    for axesHandle = axesHandles(:)'
-        % Only handle visible non-colorbar handles.
-        if axisIsVisible(axesHandle) && ~strcmp(get(axesHandle,'Tag'), 'Colorbar')
-            relevantAxesHandles(end+1) = axesHandle;
-        end
-    end
-
-    % Compute the bounding box if width or height of the figure are set by
-    % parameter
-    if ~isempty(m2t.cmdOpts.Results.width) || ~isempty(m2t.cmdOpts.Results.height)
-        % TODO: check if relevant Axes or all Axes are better.
-        axesBoundingBox = getRelativeAxesPosition(m2t, relevantAxesHandles);
-        % Compute second corner from width and height for each axes
-        axesBoundingBox(:,[3 4]) = axesBoundingBox(:,[1 2]) + axesBoundingBox(:,[3 4]);
-        % Combine axes corners to get the bounding box
-        axesBoundingBox = [min(axesBoundingBox(:,[1 2]),[],1), max(axesBoundingBox(:,[3 4]), [], 1)];
-        % Compute width and height of the bounding box
-        axesBoundingBox(:,[3 4]) = axesBoundingBox(:,[3 4]) - axesBoundingBox(:,[1 2]);
-    else
-        % Otherwise take the whole figure as bounding box => lengths are
-        % not changed in tikz
-        axesBoundingBox = [0, 0, 1, 1];
-    end
-end
-% ==============================================================================
-function userInfo(m2t, message, varargin)
-% Display usage information.
-    if m2t.cmdOpts.Results.showInfo
-        mess = sprintf(message, varargin{:});
-
-        mess = strrep(mess, sprintf('\n'), sprintf('\n *** '));
-        fprintf(' *** %s\n', mess);
-    end
-end
-% ==============================================================================
-function userWarning(m2t, message, varargin)
-% Drop-in replacement for warning().
-    if m2t.cmdOpts.Results.showWarnings
-        warning('matlab2tikz:userWarning', message, varargin{:});
-    end
-end
-% ==============================================================================
-function warnAboutParameter(m2t, parameter, isActive, message)
-% warn the user about the use of a dangerous parameter
-    line = ['\n' repmat('=',1,80) '\n'];
-    if isActive(m2t.cmdOpts.Results.(parameter))
-        userWarning(m2t, [line, 'You are using the "%s" parameter.\n', ...
-                          message line], parameter);
-    end
-end
-% ==============================================================================
-function parent = addChildren(parent, children)
-    if isempty(children)
-        return;
-    elseif iscell(children)
-        for k = 1:length(children)
-            parent = addChildren(parent, children{k});
-        end
-    else
-        if isempty(parent.children)
-            parent.children = {children};
-        else
-            parent.children = {parent.children{:} children};
-        end
-    end
-end
-% ==============================================================================
-function printAll(m2t, env, fid)
-    if isfield(env, 'colors') && ~isempty(env.colors)
-        fprintf(fid, '%s', env.colors);
-    end
-
-    if isempty(env.options)
-        fprintf(fid, '\\begin{%s}\n', env.name);
-    else
-        fprintf(fid, '\\begin{%s}[%%\n%s\n]\n', env.name, ...
-                opts_print(m2t, env.options, sprintf(',\n')));
-    end
-
-    for item = env.content
-        fprintf(fid, '%s', char(item));
-    end
-
-    for k = 1:length(env.children)
-        if ischar(env.children{k})
-            fprintf(fid, escapeCharacters(env.children{k}));
-        else
-            fprintf(fid, '\n');
-            printAll(m2t, env.children{k}, fid);
-        end
-    end
-
-    % End the tikzpicture environment with an empty comment and no newline
-    % so no additional space is generated after the tikzpicture in TeX.
-    if strcmp(env.name, 'tikzpicture')
-        fprintf(fid, '\\end{%s}%%', env.name);
-    else
-        fprintf(fid, '\\end{%s}\n', env.name);
-    end
-end
-% ==============================================================================
-function c = prettyPrint(m2t, strings, interpreter)
-% Some resources on how MATLAB handles rich (TeX) markup:
-% http://www.mathworks.com/help/techdoc/ref/text_props.html#String
-% http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-28104
-% http://www.mathworks.com/help/techdoc/ref/text_props.html#Interpreter
-% http://www.mathworks.com/help/techdoc/ref/text.html#f68-481120
-
-    strings = cellstrOneLinePerCell(strings);
-
-    % Now loop over the strings and return them pretty-printed in c.
-    c = {};
-    for k = 1:length(strings)
-        % linear indexing for independence of cell array dimensions
-        s = strings{k};
-
-        % If the user set the matlab2tikz parameter 'parseStrings' to false, no
-        % parsing of strings takes place, thus making the user 100% responsible.
-        if ~m2t.cmdOpts.Results.parseStrings
-            c = strings;
-            return
-        end
-
-        % Make sure we have a valid interpreter set up
-        if ~any(strcmpi(interpreter, {'latex', 'tex', 'none'}))
-            userWarning(m2t, 'Don''t know interpreter ''%s''. Default handling.', interpreter);
-            interpreter = 'tex';
-        end
-
-        % The interpreter property of the text element defines how the string
-        % is parsed
-        switch lower(interpreter)
-            case 'latex' % Basic subset of the LaTeX markup language
-
-                % Replace $$...$$ with $...$ but otherwise leave untouched
-                string = regexprep(s, '^\$\$(.*)\$\$$', '$$1$');
-
-            case 'tex' % Subset of plain TeX markup language
-
-                % Deal with UTF8 characters.
-                string = s;
-
-                % degree symbol following "^" or "_" needs to be escaped
-                string = regexprep(string, '([\^\_])°', '$1{{}^\\circ}');
-                string = strrep(string, '°', '^\circ');
-                string = strrep(string, '∞', '\infty');
-
-                % Parse string piece-wise in a separate function.
-                string = parseTexString(m2t, string);
-
-            case 'none' % Literal characters
-                % Make special characters TeX compatible
-
-                string = strrep(s, '\', '\textbackslash{}');
-                % Note: '{' and '}' can't be converted to '\{' and '\}',
-                %       respectively, via strrep(...) as this would lead to
-                %       backslashes converted to '\textbackslash\{\}' because
-                %       the backslash was converted to '\textbackslash{}' in
-                %       the previous step. Using regular expressions with
-                %       negative look-behind makes sure any braces in 'string'
-                %       were not introduced by escaped backslashes.
-                %       Also keep in mind that escaping braces before backslashes
-                %       would not remedy the issue -- in that case 'string' would
-                %       contain backslashes introduced by brace escaping that are
-                %       not supposed to be printable characters.
-                repl = switchMatOct(m2t, '\\{', '\{');
-                string = regexprep(string, '(?<!\\textbackslash){', repl);
-                repl = switchMatOct(m2t, '\\}', '\}');
-                string = regexprep(string, '(?<!\\textbackslash{)}', repl);
-                string = strrep(string, '$', '\$');
-                string = strrep(string, '%', '\%');
-                string = strrep(string, '_', '\_');
-                string = strrep(string, '^', '\textasciicircum{}');
-                string = strrep(string, '#', '\#');
-                string = strrep(string, '&', '\&');
-                string = strrep(string, '~', '\textasciitilde{}'); % or '\~{}'
-                % Clean up: remove superfluous '{}' if it's followed by a backslash
-                string = strrep(string, '{}\', '\');
-                % Clean up: remove superfluous '{}' at the end of 'string'
-                string = regexprep(string, '\{\}$', '');
-
-                % Make sure to return a string and not a cellstr.
-                if iscellstr(string)
-                    string = string{1};
-                end
-            otherwise
-                error('matlab2tikz:prettyPrint', 'Unknown interpreter');
-        end
-        c{end+1} = string;
-    end
-end
-% ==============================================================================
-function strings = cellstrOneLinePerCell(strings)
-% convert to cellstr that contains only one-line strings
-    if ischar(strings)
-        strings = cellstr(strings);
-    elseif iscellstr(strings)
-        cs = {};
-        for s = strings
-            tmp = cellstr(s);
-            cs = {cs{:}, tmp{:}};
-        end
-        strings = cs;
-    else
-        error('matlab2tikz:cellstrOneLinePerCell', ...
-            'Data type not understood.');
-    end
-end
-% ==============================================================================
-function parsed = parseTexString(m2t, string)
-    if iscellstr(string)
-        % Convert cell string to regular string, otherwise MATLAB complains
-        string = string{:};
-    end
-
-    % Get the position of all braces
-    bracesPos = regexp(string, '\{|\}');
-
-    % Exclude braces that are part of any of these MATLAB-supported TeX commands:
-    % \color{...}  \color[...]{...}  \fontname{...}  \fontsize{...}
-    [sCmd, eCmd] = regexp(string, '\\(color(\[[^\]]*\])?|fontname|fontsize)\{[^}]*\}');
-    for i = 1:length(sCmd)
-        bracesPos(bracesPos >= sCmd(i) & bracesPos <= eCmd(i)) = [];
-    end
-
-    % Exclude braces that are preceded by an odd number of backslashes which
-    % means the brace is escaped and thus to be printed, not a grouping brace
-    expr = '(?<!\\)(\\\\)*\\(\{|\})';
-    escaped = regexp(string, expr, 'end');
-    % It's necessary to go over 'string' with the same RegEx again to catch
-    % overlapping matches, e.g. string == '\{\}'. In such a case the simple
-    % regexp(...) above only finds the first brace. What we have to do is look
-    % only at the part of 'string' that starts with the first brace but doesn't
-    % encompass its escaping backslash. Iterating over all previously found
-    % matches makes sure all overlapping matches are found, too. That way even
-    % cases like string == '\{\} \{\}' are handled correctly.
-    % The call to unique(...) is not necessary to get the behavior described, but
-    % by removing duplicates in 'escaped' it's cleaner than without.
-    for i = escaped
-        escaped = unique([escaped, regexp(string(i:end), expr, 'end') + i-1]);
-    end
-    % Now do the actual removal of escaped braces
-    for i = 1:length(escaped)
-        bracesPos(bracesPos == escaped(i)) = [];
-    end
-
-    parsed = '';
-    % Have a virtual brace one character left of where the actual string
-    % begins (remember, MATLAB strings start counting at 1, not 0). This is
-    % to make sure substrings left of the first brace get parsed, too.
-    prevBracePos = 0;
-    % Iterate over all the brace positions in order to split up 'string'
-    % at those positions and then parse the substrings. A virtual brace is
-    % added right of where the actual string ends to make sure substrings
-    % right of the right-most brace get parsed as well.
-    for currBracePos = [bracesPos, length(string)+1]
-        if (prevBracePos + 1) < currBracePos
-            % Parse the substring between (but not including) prevBracePos
-            % and currBracePos, i.e. between the previous brace and the
-            % current one (but only if there actually is a non-empty
-            % substring). Then append it to the output string.
-            substring = string(prevBracePos+1 : currBracePos-1);
-            parsed = [parsed, parseTexSubstring(m2t, substring)];
-        end
-        if currBracePos <= length(string)
-            % Append the brace itself to the output string, but only if the
-            % current brace position is within the limits of the string, i.e.
-            % don't append anything for the last, virtual brace that is only
-            % there to enable parsing of substrings beyond the right-most
-            % actual brace.
-            brace = string(currBracePos);
-            parsed = [parsed, brace];
-        end
-        % The current brace position will be next iteration's previous one
-        prevBracePos = currBracePos;
-    end
-
-    % Enclose everything in $...$ to use math mode
-    parsed = ['$' parsed '$'];
-    % ...except when everything is text
-    parsed = regexprep(parsed, '^\$\\text\{([^}]*)\}\$$', '$1');
-    % start-> $ \text {(non-}) } $<-end
-    % ...or when the parsed string is empty
-    parsed = regexprep(parsed, '^\$\$$', '');
-end
-% ==============================================================================
-function string = parseTexSubstring(m2t, string)
-    origstr = string; % keep this for warning messages
-
-    % Font families (italic, bold, etc.) get a trailing '{}' because they may be
-    % followed by a letter which would produce an error in (La)TeX.
-    for i = {'it', 'bf', 'rm', 'sl'}
-        string = strrep(string, ['\' i{:}], ['\' i{:} '{}']);
-    end
-
-    % The same holds true for special characters like \alpha
-    % The list of MATLAB-supported TeX characters was taken from
-    % http://www.mathworks.com/help/techdoc/ref/text_props.html#String
-    named = {'alpha', 'angle', 'ast', 'beta', 'gamma', 'delta',     ...
-        'epsilon', 'zeta', 'eta', 'theta', 'vartheta', 'iota', ...
-        'kappa', 'lambda', 'mu', 'nu', 'xi', 'pi', 'rho',      ...
-        'sigma', 'varsigma', 'tau', 'equiv', 'Im', 'otimes',   ...
-        'cap', 'int', 'rfloor', 'lfloor', 'perp', 'wedge',     ...
-        'rceil', 'vee', 'langle', 'upsilon', 'phi', 'chi',     ...
-        'psi', 'omega', 'Gamma', 'Delta', 'Theta', 'Lambda',   ...
-        'Xi', 'Pi', 'Sigma', 'Upsilon', 'Phi', 'Psi', 'Omega', ...
-        'forall', 'exists', 'ni', 'cong', 'approx', 'Re',      ...
-        'oplus', 'cup', 'subseteq', 'lceil', 'cdot', 'neg',    ...
-        'times', 'surd', 'varpi', 'rangle', 'sim', 'leq',      ...
-        'infty', 'clubsuit', 'diamondsuit', 'heartsuit',       ...
-        'spadesuit', 'leftrightarrow', 'leftarrow',            ...
-        'Leftarrow', 'uparrow', 'rightarrow', 'Rightarrow',    ...
-        'downarrow', 'circ', 'pm', 'geq', 'propto', 'partial', ...
-        'bullet', 'div', 'neq', 'aleph', 'wp', 'oslash',       ...
-        'supseteq', 'nabla', 'ldots', 'prime', '0', 'mid',     ...
-        'copyright'                                            };
-    for i = named
-        string = strrep(string, ['\' i{:}], ['\' i{:} '{}']);
-        % FIXME: Only append '{}' if there's an odd number of backslashes
-        %        in front of the items from 'named'. If it's an even
-        %        number instead, that means there's an escaped (printable)
-        %        backslash and some text like "alpha" after that.
-    end
-    % Some special characters' names are subsets of others, e.g. '\o' is
-    % a subset of '\omega'. This would produce undesired double-escapes.
-    % For example if '\o' was converted to '\o{}' after '\omega' has been
-    % converted to '\omega{}' this would result in '\o{}mega{}' instead of
-    % '\omega{}'. Had '\o' been converted to '\o{}' _before_ '\omega' is
-    % converted then the result would be '\o{}mega' and thus also wrong.
-    % To circumvent the problem all those special character names that are
-    % subsets of others are now converted using a regular expression that
-    % uses negative lookahead. The special handling of the backslash is
-    % required for MATLAB/Octave compatibility.
-    string = regexprep(string, '(\\)o(?!mega|times|plus|slash)', '$1o{}');
-    string = regexprep(string, '(\\)in(?!t|fty)', '$1in{}');
-    string = regexprep(string, '(\\)subset(?!eq)', '$1subset{}');
-    string = regexprep(string, '(\\)supset(?!eq)', '$1supset{}');
-
-    % Convert '\0{}' (TeX text mode) to '\emptyset{}' (TeX math mode)
-    string = strrep(string, '\0{}', '\emptyset{}');
-
-    % Add skip to \fontsize
-    % This is required for a successful LaTeX run on the output as in contrast
-    % to MATLAB/Octave it requires the skip parameter (even if it's zero)
-    string = regexprep(string, '(\\fontsize\{[^}]*\})', '$1{0}');
-
-    % Put '\o{}' inside \text{...} as it is a text mode symbol that does not
-    % exist in math mode (and LaTeX gives a warning if you use it in math mode)
-    string = strrep(string, '\o{}', '\text{\o{}}');
-
-    % Put everything that isn't a TeX command inside \text{...}
-    expr = '(\\[a-zA-Z]+(\[[^\]]*\])?(\{[^}]*\}){1,2})';
-    % |( \cmd  )( [...]?  )( {...}{1,2} )|
-    % (              subset $1               )
-    repl = '}$1\\text{';
-    string = regexprep(string, expr, repl);
-    % ...\alpha{}... -> ...}\alpha{}\text{...
-    string = ['\text{' string '}'];
-    % ...}\alpha{}\text{... -> \text{...}\alpha{}\text{...}
-
-    % '_' has to be in math mode so long as it's not escaped as '\_' in which
-    % case it remains as-is. Extra care has to be taken to make sure any
-    % backslashes in front of the underscore are not themselves escaped and
-    % thus printable backslashes. This is the case if there's an even number
-    % of backslashes in a row.
-    repl = '$1}_\\text{';
-    string = regexprep(string, '(?<!\\)((\\\\)*)_', repl);
-
-    % '^' has to be in math mode so long as it's not escaped as '\^' in which
-    % case it is expressed as '\textasciicircum{}' for compatibility with
-    % regular TeX. Same thing here regarding even/odd number of backslashes
-    % as in the case of underscores above.
-    repl = '$1\\textasciicircum{}';
-    string = regexprep(string, '(?<!\\)((\\\\)*)\\\^', repl);
-    repl = '$1}^\\text{';
-    string = regexprep(string, '(?<!\\)((\\\\)*)\^', repl);
-
-    % '<' and '>' has to be either in math mode or needs to be typeset as
-    % '\textless' and '\textgreater' in textmode
-    % This is handled better, if 'parseStringsAsMath' is activated
-    if m2t.cmdOpts.Results.parseStringsAsMath == 0
-        string = regexprep(string, '<', '\\textless');
-        string = regexprep(string, '>', '\\textgreater');
-    end
-
-    % Move font styles like \bf into the \text{} command.
-    expr = '(\\bf|\\it|\\rm|\\fontname)({\w*})+(\\text{)';
-    while regexp(string, expr)
-        string = regexprep(string, expr, '$3$1$2');
-    end
-
-    % Replace Fontnames
-    [~, ~, ~, ~, fonts, ~, subStrings] = regexp(string, '\\fontname{(\w*)}');
-    fonts = fonts2tex(fonts);
-    subStrings = [subStrings; fonts, {''}];
-    string = cell2mat(subStrings(:)');
-
-    % Merge adjacent \text fields:
-    string = mergeAdjacentTexCmds(string, '\text');
-
-    % '\\' has to be escaped to '\textbackslash{}'
-    % This cannot be done with strrep(...) as it would replace e.g. 4 backslashes
-    % with three times the replacement string because it finds overlapping matches
-    % (see http://www.mathworks.de/help/techdoc/ref/strrep.html)
-    % Note: Octave's backslash handling is broken. Even though its output does
-    % not resemble MATLAB's, the same m2t code is used for either software. That
-    % way MATLAB-compatible code produces the same matlab2tikz output no matter
-    % which software it's executed in. So long as this MATLAB incompatibility
-    % remains in Octave you're probably better off not using backslashes in TeX
-    % text anyway.
-    string = regexprep(string, '(\\)\\', '$1textbackslash{}');
-
-    % '_', '^', '{', and '}' are already escaped properly, even in MATLAB's TeX
-    % dialect (and if they're not, that's intentional)
-
-    % Escape "$", "%", and "#" to make them compatible to true TeX while in
-    % MATLAB/Octave they are not escaped
-    string = strrep(string, '$', '\$');
-    string = strrep(string, '%', '\%');
-    string = strrep(string, '#', '\#');
-
-    % Escape "§" as "\S" since it can give UTF-8 problems otherwise.
-    % The TeX string 'a_§' in particular lead to problems in Octave 3.6.0.
-    % m2t transcoded that string into '$\text{a}_\text{*}\text{#}$' with
-    % * = 0xC2 and # = 0xA7 which corresponds with the two-byte UTF-8
-    % encoding. Even though this looks like an Octave bug that shows
-    % during the '..._\text{abc}' to '..._\text{a}\text{bc}' conversion,
-    % it's best to include the workaround here.
-    string = strrep(string, '§', '\S{}');
-
-    % Escape plain "&" in MATLAB and replace it and the following character with
-    % a space in Octave unless the "&" is already escaped
-    switch m2t.env
-        case 'MATLAB'
-            string = strrep(string, '&', '\&');
-        case 'Octave'
-            % Ampersands should already be escaped in Octave.
-            % Octave (tested with 3.6.0) handles un-escaped ampersands a little
-            % funny in that it removes the following character, if there is one:
-            % 'abc&def'      -> 'abc ef'
-            % 'abc&\deltaef' -> 'abc ef'
-            % 'abc&$ef'      -> 'abc ef'
-            % 'abcdef&'      -> 'abcdef'
-            % Don't remove closing brace after '&' as this would result in
-            % unbalanced braces
-            string = regexprep(string, '(?<!\\)&(?!})', ' ');
-            string = regexprep(string, '(?<!\\)&}', '}');
-            if regexp(string, '(?<!\\)&\\')
-                % If there's a backslash after the ampersand, that means not only
-                % the backslash should be removed but the whole escape sequence,
-                % e.g. '\delta' or '\$'. Actually the '\delta' case is the
-                % trickier one since by now 'string' would have been turned from
-                % 'abc&\deltaef' into '\text{abc&}\delta{}\text{ef}', i.e. after
-                % the ampersand first comes a closing brace and then '\delta';
-                % the latter as well as the ampersand itself should be removed
-                % while the brace must remain in place to avoid unbalanced braces.
-                userWarning(m2t,                                                ...
-                    ['TeX string ''%s'' contains a special character '  ...
-                    'after an un-escaped ''&''. The output generated ' ...
-                    'by matlab2tikz will not precisely match that '    ...
-                    'which you see in Octave itself in that the '      ...
-                    'special character and the preceding ''&'' is '    ...
-                    'not replaced with a space.'], origstr)
-            end
-        otherwise
-            errorUnknownEnvironment();
-    end
-
-    % Escape plain "~" in MATLAB and replace escaped "\~" in Octave with a proper
-    % escape sequence. An un-escaped "~" produces weird output in Octave, thus
-    % give a warning in that case
-    switch m2t.env
-        case 'MATLAB'
-            string = strrep(string, '~', '\textasciitilde{}'); % or '\~{}'
-        case 'Octave'
-            string = strrep(string, '\~', '\textasciitilde{}'); % ditto
-            if regexp(string, '(?<!\\)~')
-                userWarning(m2t,                                             ...
-                    ['TeX string ''%s'' contains un-escaped ''~''. ' ...
-                    'For proper display in Octave you probably '    ...
-                    'want to escape it even though that''s '        ...
-                    'incompatible with MATLAB. '                    ...
-                    'In the matlab2tikz output it will have its '   ...
-                    'usual TeX function as a non-breaking space.'], ...
-                    origstr)
-            end
-        otherwise
-            errorUnknownEnvironment();
-    end
-
-    % Convert '..._\text{abc}' and '...^\text{abc}' to '..._\text{a}\text{bc}'
-    % and '...^\text{a}\text{bc}', respectively.
-    % Things get a little more complicated if instead of 'a' it's e.g. '$'. The
-    % latter has been converted to '\$' by now and simply extracting the first
-    % character from '\text{\$bc}' would result in '\text{$}\text{$bc}' which
-    % is syntactically wrong. Instead the whole command '\$' has to be moved in
-    % front of the \text{...} block, e.g. '..._\text{\$bc}' -> '..._\$\text{bc}'.
-    % Note that the problem does not occur for the majority of special characters
-    % like '\alpha' because they use math mode and therefore are never inside a
-    % \text{...} block to begin with. This means that the number of special
-    % characters affected by this issue is actually quite small:
-    %   $ # % & _ { } \o § ~ \ ^
-    expr = ['(_|\^)(\\text)\{([^}\\]|\\\$|\\#|\\%|\\&|\\_|\\\{|\\\}|', ...
-        ... %   (_/^)(\text) {(non-}\| \$ | \#| \%| \&| \_| \{ | \} |
-        ... %   ($1)( $2 )  (                 $3                      ->
-        '\\o\{\}|\\S\{\}|\\textasciitilde\{\}|\\textbackslash\{\}|', ...
-        ... %    \o{}  | \S{}  | \textasciitilde{}  | \textbackslash{}  |
-        ... %  <-                         $3                                 ->
-        '\\textasciicircum\{\})'];
-    %    \textasciicircum{} )
-    %  <-      $3           )
-    string = regexprep(string, expr, '$1$2{$3}$2{');
-
-    % Some further processing makes the output behave more like TeX math mode,
-    % but only if the matlab2tikz parameter parseStringsAsMath=true.
-    if m2t.cmdOpts.Results.parseStringsAsMath
-
-        % Some characters should be in math mode: =-+/,.()<>0-9
-        expr = '(\\text)\{([^}=\-+/,.()<>0-9]*)([=\-+/,.()<>0-9]+)([^}]*)\}';
-        %    \text  {(any non-"x"/'}'char)( any "x" char  )(non-}) }
-        %  ( $1 )  (       $2        )(      $3       )( $4)
-        while regexp(string, expr)
-            % Iterating is necessary to catch all occurrences. See above.
-            string = regexprep(string, expr, '$1{$2}$3$1{$4}');
-        end
-
-        % \text{ } should be a math-mode space
-        string = regexprep(string, '\\text\{(\s+)}', '$1');
-
-        % '<<' probably means 'much smaller than', i.e. '\ll'
-        repl = switchMatOct(m2t, '$1\\ll{}$2', '$1\ll{}$2');
-        string = regexprep(string, '([^<])<<([^<])', repl);
-
-        % '>>' probably means 'much greater than', i.e. '\gg'
-        repl = switchMatOct(m2t, '$1\\gg{}$2', '$1\gg{}$2');
-        string = regexprep(string, '([^>])>>([^>])', repl);
-
-        % Single letters are most likely variables and thus should be in math mode
-        string = regexprep(string, '\\text\{([a-zA-Z])\}', '$1');
-
-    end % parseStringsAsMath
-
-    % Clean up: remove empty \text{}
-    string = strrep(string, '\text{}', '');
-    % \text{}\alpha{}\text{...} -> \alpha{}\text{...}
-
-    % Clean up: convert '{}\' to '\' unless it's prefixed by a backslash which
-    % means the opening brace is escaped and thus a printable character instead
-    % of a grouping brace.
-    string = regexprep(string, '(?<!\\)\{\}(\\)', '$1');
-    % \alpha{}\text{...} -> \alpha\text{...}
-
-    % Clean up: convert '{}}' to '}' unless it's prefixed by a backslash
-    string = regexprep(string, '(?<!\\)\{\}\}', '}');
-
-    % Clean up: remove '{}' at the end of 'string' unless it's prefixed by a
-    % backslash
-    string = regexprep(string, '(?<!\\)\{\}$', '');
-end
-% ==============================================================================
-function tex = fonts2tex(fonts)
-% Returns a tex command for each fontname in the cell array fonts.
-    if ~iscell(fonts)
-        error('matlab2tikz:fonts2tex', ...
-                 'Expecting a cell array as input.');
-    end
-    tex = cell(size(fonts));
-
-    for ii = 1:numel(fonts)
-        font = fonts{ii}{1};
-
-        % List of known fonts.
-        switch lower(font)
-            case 'courier'
-                tex{ii} = '\ttfamily{}';
-            case 'times'
-                tex{ii} = '\rmfamily{}';
-            case {'arial', 'helvetica'}
-                tex{ii} = '\sffamily{}';
-            otherwise
-                warning('matlab2tikz:fonts2tex', ...
-                    'Unknown font ''%s''. Using tex default font.',font);
-                % Unknown font -> Switch to standard font.
-                tex{ii} = '\rm{}';
-        end
-    end
-end
-% ==============================================================================
-function string = mergeAdjacentTexCmds(string, cmd)
-% Merges adjacent tex commands like \text into one command
-    % If necessary, add a backslash
-    if cmd(1) ~= '\'
-        cmd = ['\' cmd];
-    end
-    % Link each bracket to the corresponding bracket
-    link = zeros(size(string));
-    pos = [regexp([' ' string], '([^\\]{)'), ...
-        regexp([' ' string], '([^\\]})')];
-    pos = sort(pos);
-    ii = 1;
-    while ii <= numel(pos)
-        if string(pos(ii)) == '}'
-            link(pos(ii-1)) = pos(ii);
-            link(pos(ii)) = pos(ii - 1);
-            pos([ii-1, ii]) = [];
-            ii = ii - 1;
-        else
-            ii = ii + 1;
-        end
-    end
-    % Find dispensable commands
-    pos = regexp(string, ['}\' cmd '{']);
-    delete = zeros(0,1);
-    len = numel(cmd);
-    for p = pos
-        l = link(p);
-        if l > len && isequal(string(l-len:l-1), cmd)
-            delete(end+1,1) = p;
-        end
-    end
-    %   3. Remove these commands (starting from the back
-    delete = repmat(delete, 1, len+2) + repmat(0:len+1,numel(delete), 1);
-    string(delete(:)) = [];
-end
-function dims = pos2dims(pos)
-% Position quadruplet [left, bottom, width, height] to dimension structure
-    dims = struct('left' , pos(1), 'bottom', pos(2));
-    if numel(pos) == 4
-        dims.width  = pos(3);
-        dims.height = pos(4);
-        dims.right  = dims.left   + dims.width;
-        dims.top    = dims.bottom + dims.height;
-    end
-end
-% OPTION ARRAYS ================================================================
-function opts = opts_new()
-% create a new options array
-    opts = cell(0,2);
-end
-function opts = opts_add(opts, key, value)
-% add a key-value pair to an options array (with duplication check)
-    if ~exist('value','var')
-        value = [];
-    end
-    value = char(value);
-
-    % Check if the key already exists.
-    if opts_has(opts, key)
-        oldValue = opts_get(opts, key);
-        if isequal(value, oldValue)
-            return; % no action needed: value already present
-        else
-            error('matlab2tikz:opts_add', ...
-                 ['Trying to add (%s, %s) to options, but it already ' ...
-                  'contains the conflicting key-value pair (%s, %s).'], ...
-                  key, value, key, oldValue);
-        end
-    end
-    opts = opts_append(opts, key, value);
-end
-function bool = opts_has(opts, key)
-% returns true if the options array contains the key
-    bool = ~isempty(opts) && ismember(key, opts(:,1));
-end
-function value = opts_get(opts, key)
-% returns the value(s) stored for a key in an options array
-    idx = find(ismember(opts(:,1), key));
-    switch numel(idx)
-        case 1
-            value = opts{idx,2}; % just the value
-        otherwise
-            value = opts(idx,2); % as cell array
-    end
-end
-function opts = opts_append(opts, key, value)
-% append a key-value pair to an options array (duplicate keys allowed)
-    if ~exist('value','var') || isempty(value)
-        value = [];
-    end
-    if ~(opts_has(opts, key) && isequal(opts_get(opts, key), value))
-        opts = cat(1, opts, {key, value});
-    end
-end
-function opts = opts_append_userdefined(opts, userDefined)
-% appends user-defined options to an options array
-% the sserDefined options can come either as a single string or a cellstr that
-% is already TikZ-formatted. The internal 2D cell format is NOT supported.
-    if ~isempty(userDefined)
-        if ischar(userDefined)
-            userDefined = {userDefined};
-        end
-        for k = 1:length(userDefined)
-            opts = opts_append(opts, userDefined{k});
-        end
-    end
-end
-function opts = opts_remove(opts, varargin)
-% remove some key-value pairs from an options array
-    keysToDelete = varargin;
-    idxToDelete = ismember(opts(:,1), keysToDelete);
-    opts(idxToDelete, :) = [];
-end
-function opts = opts_merge(opts, varargin)
-% merge multiple options arrays
-    for jArg = 1:numel(varargin)
-        opts2 = varargin{jArg};
-        for k = 1:size(opts2, 1)
-            opts = opts_append(opts, opts2{k,1}, opts2{k,2});
-        end
-    end
-end
-function str  = opts_print(m2t, opts, sep)
-% pretty print an options array
-    nOpts = size(opts,1);
-    c = cell(nOpts,1);
-    for k = 1:nOpts
-        if isempty(opts{k,2})
-            c{k} = sprintf('%s', opts{k,1});
-        else
-            c{k} = sprintf('%s=%s', opts{k,1}, opts{k,2});
-        end
-    end
-    str = join(m2t, c, sep);
-end
-% DEPRECATED OPTION ARRAYS =====================================================
-% TODO: Remove deprecated functions for next release
-function opts = addToOptions(opts, key, value)
-% Adds a key-value pair to a structure and does some sanity-checking.
-    warning('m2t:Deprecated','Use "opts_add" instead!');
-    if ~exist('value','var') || isempty(value)
-        value = [];
-    end
-    opts = opts_add(opts, key, value);
-end
-function opts = merge(opts, varargin)
-% Merges multiple option lists
-    warning('m2t:Deprecated','Use "opts_merge" instead!');
-    opts = opts_merge(opts, varargin{:});
-end
-function str = prettyprintOpts(m2t, opts, sep)
-    warning('m2t:Deprecated','Use "opts_print" instead!');
-    str = opts_print(m2t, opts, sep);
-end
-% ==============================================================================
-function [env,versionString] = getEnvironment()
-% Checks if we are in MATLAB or Octave.
-    alternatives = {'MATLAB','Octave'};
-    for iCase = 1:numel(alternatives)
-        env   = alternatives{iCase};
-        vData = ver(env);
-        if ~isempty(vData)
-            versionString = vData.Version;
-            return; % found the right environment
-        end
-    end
-    % otherwise:
-    env = '';
-    versionString = '';
-end
-% ==============================================================================
-function isHG2 = isHG2(m2t)
-% Checks if graphics system is HG2 (true) or HG1 (false).
-% HG1 : MATLAB up to R2014a and currently all OCTAVE versions
-% HG2 : MATLAB starting from R2014b (version 8.4)
-    isHG2 = false;
-    if strcmpi(m2t.env,'MATLAB') && ...
-        ~isVersionBelow(m2t.env, m2t.envVersion, [8,4])
-        isHG2 = true;
-    end
-end
-% ==============================================================================
-function isBelow = isVersionBelow(env, versionA, versionB)
-% Checks if versionA is smaller than versionB
-    vA         = versionArray(env, versionA);
-    vB         = versionArray(env, versionB);
-    n          = min(length(vA), length(vB));
-    deltaAB    = vA(1:n) - vB(1:n);
-    difference = find(deltaAB, 1, 'first');
-    if isempty(difference)
-        isBelow = false; % equal versions
-    else
-        isBelow = (deltaAB(difference) < 0);
-    end
-end
-% ==============================================================================
-function str = formatDim(value, unit)
-% format the value for use as a TeX dimension
-    if ~exist('unit','var') || isempty(unit)
-        unit = '';
-    end
-    tolerance = 1e-7;
-    value  = round(value/tolerance)*tolerance;
-    if value == 1 && ~isempty(unit) && unit(1) == '\'
-        str = unit; % just use the unit
-    else
-        str = sprintf('%.6f', value);
-        str = regexprep(str, '(\d*\.\d*?)0+$', '$1'); % remove trailing zeros
-        str = regexprep(str, '\.$', ''); % remove trailing period
-        str = [str unit];
-    end
-end
-% ==============================================================================
-function arr = versionArray(env, str)
-% Converts a version string to an array.
-    if ischar(str)
-        % Translate version string from '2.62.8.1' to [2; 62; 8; 1].
-        switch env
-            case 'MATLAB'
-                split = regexp(str, '\.', 'split'); % compatibility MATLAB < R2013a
-            case  'Octave'
-                split = strsplit(str, '.');
-            otherwise
-                errorUnknownEnvironment();
-        end
-        arr = str2num(char(split)); %#ok
-    else
-        arr = str;
-    end
-    arr = arr(:)';
-end
-% ==============================================================================
-function [retval] = switchMatOct(m2t, matlabValue, octaveValue)
-% Returns a different value for MATLAB and Octave
-    switch m2t.env
-        case 'MATLAB'
-            retval = matlabValue;
-        case 'Octave'
-            retval = octaveValue;
-        otherwise
-            errorUnknownEnvironment();
-    end
-end
-% ==============================================================================
-function checkDeprecatedEnvironment(m2t, minimalVersions)
-    if isfield(minimalVersions, m2t.env)
-        minVersion = minimalVersions.(m2t.env);
-        envWithVersion = sprintf('%s %s', m2t.env, minVersion.name);
-
-        if isVersionBelow(m2t.env, m2t.envVersion, minVersion.num)
-            ID = 'matlab2tikz:deprecatedEnvironment';
-
-            warningMessage = ['\n', repmat('=',1,80), '\n\n', ...
-                '  matlab2tikz is tested and developed on   %s   and newer.\n', ...
-                '  This script may still be able to handle your plots, but if you\n', ...
-                '  hit a bug, please consider upgrading your environment first.\n', ...
-                '  Type "warning off %s" to suppress this warning.\n', ...
-                '\n', repmat('=',1,80), ];
-            warning(ID, warningMessage, envWithVersion, ID);
-
-        end
-    else
-        errorUnknownEnvironment();
-    end
-end
-% ==============================================================================
-function errorUnknownEnvironment()
-    error('matlab2tikz:unknownEnvironment',...
-          'Unknown environment. Need MATLAB(R) or Octave.')
-end
-% ==============================================================================
-function m2t = needsPgfplotsVersion(m2t, minVersion)
-    if isVersionBelow(m2t, m2t.pgfplotsVersion, minVersion)
-        m2t.pgfplotsVersion = minVersion;
-    end
-end
-% ==============================================================================
-function str = formatPgfplotsVersion(m2t, version)
-    version = versionArray(m2t, version);
-    if all(isfinite(version))
-        str = sprintf('%d.',version);
-        str = str(1:end-1); % remove the last period
-    else
-        str = 'newest';
-    end
-end
-% ==============================================================================
-function [formatted,treeish] = VersionControlIdentifier()
-% This function gives the (git) commit ID of matlab2tikz
-%
-% This assumes the standard directory structure as used by Nico's master branch:
-%     SOMEPATH/src/matlab2tikz.m with a .git directory in SOMEPATH.
-%
-% The HEAD of that repository is determined from file system information only
-% by following dynamic references (e.g. ref:refs/heds/master) in branch files
-% until an absolute commit hash (e.g. 1a3c9d1...) is found.
-% NOTE: Packed branch references are NOT supported by this approach
-    MAXITER     = 10; % stop following dynamic references after a while
-    formatted   = '';
-    REFPREFIX   = 'ref:';
-    isReference = @(treeish)(any(strfind(treeish, REFPREFIX)));
-    treeish     = [REFPREFIX 'HEAD'];
-    try
-        % get the matlab2tikz directory
-        m2tDir = fileparts(mfilename('fullpath'));
-        gitDir = fullfile(m2tDir,'..','.git');
-
-        nIter = 1;
-        while isReference(treeish)
-            refName    = treeish(numel(REFPREFIX)+1:end);
-            branchFile = fullfile(gitDir, refName);
-
-            if exist(branchFile, 'file') && nIter < MAXITER
-                fid     = fopen(branchFile,'r');
-                treeish = fscanf(fid,'%s');
-                fclose(fid);
-                nIter   = nIter + 1;
-            else % no branch file or iteration limit reached
-                treeish = '';
-                return;
-            end
-        end
-    catch %#ok
-        treeish = '';
-    end
-    if ~isempty(treeish)
-        formatted = sprintf('(commit %s)',treeish);
-    end
-end
-% ==============================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/myfile b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/myfile
deleted file mode 100644
index 43166ea1f31273c48b157724c1de1ee4e5ca775d..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/myfile
+++ /dev/null
@@ -1,43 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=5.25in,
-height=2.586207in,
-at={(0.991379in,0.603448in)},
-scale only axis,
-separate axis lines,
-every outer x axis line/.append style={black},
-every x tick label/.append style={font=\color{black}},
-xmin=0,
-xmax=120,
-xlabel={$\fontsize{18}{0}\text{Prétension [kN]}$},
-xmajorgrids,
-every outer y axis line/.append style={black},
-every y tick label/.append style={font=\color{black}},
-ymin=0,
-ymax=1500,
-ylabel={$\fontsize{18}{0}\text{Surface de contacte [mm}^\text{2}\text{]}$},
-ymajorgrids
-]
-\addplot [color=blue,solid,line width=2.0pt,mark=asterisk,mark options={solid},forget plot]
-  table[row sep=crcr]{%
-10	41.465236444\\
-14	887.294699403\\
-18	1185.146646\\
-22	1185.146646\\
-26	1185.146646\\
-30	1185.146646\\
-50	1185.146646\\
-70	1185.146646\\
-90	1185.146646\\
-110	1185.146646\\
-};
-\end{axis}
-\end{tikzpicture}%
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/private/m2tUpdater.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/private/m2tUpdater.m
deleted file mode 100644
index ea7adcdc11665ad28b775849e92bbf45b7b9c29a..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/private/m2tUpdater.m
+++ /dev/null
@@ -1,142 +0,0 @@
-function updater(name, fileExchangeUrl, version, verbose, env)
-%UPDATER   Auto-update matlab2tikz.
-%   Only for internal usage.
-
-%   Copyright (c) 2012--2014, Nico Schlömer <nico.schloemer@gmail.com>
-%   All rights reserved.
-%
-%   Redistribution and use in source and binary forms, with or without
-%   modification, are permitted provided that the following conditions are
-%   met:
-%
-%      * Redistributions of source code must retain the above copyright
-%        notice, this list of conditions and the following disclaimer.
-%      * Redistributions in binary form must reproduce the above copyright
-%        notice, this list of conditions and the following disclaimer in
-%        the documentation and/or other materials provided with the distribution
-%
-%   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-%   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-%   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-%   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-%   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-%   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-%   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-%   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-%   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-%   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-%   POSSIBILITY OF SUCH DAMAGE.
-% =========================================================================
-  try
-      html = urlread([fileExchangeUrl, '/all_files']);
-  catch %#ok
-      % Couldn't load the URL -- never mind.
-      html = '';
-  end
-  % Search for a string "/version-1.6.3" in the HTML. This assumes
-  % that the package author has added a file by that name to
-  % to package. This is a rather dirty hack around FileExchange's
-  % lack of native versioning information.
-  mostRecentVersion = regexp(html, '/version-(\d+\.\d+\.\d+)', 'tokens');
-  if ~isempty(mostRecentVersion)
-      if isVersionBelow(env, version, mostRecentVersion{1}{1})
-          userInfo(verbose, '**********************************************\n');
-          userInfo(verbose, 'New version available! (%s)\n', mostRecentVersion{1}{1});
-          userInfo(verbose, '**********************************************\n');
-
-          reply = input([' *** Would you like ', name, ' to self-upgrade? y/n [n]:'],'s');
-          if strcmp(reply, 'y')
-              % Download the files and unzip its contents into the folder
-              % above the folder that contains the current script.
-              % This assumes that the file structure is something like
-              %
-              %   src/matlab2tikz.m
-              %   src/[...]
-              %   AUTHORS
-              %   ChangeLog
-              %   [...]
-              %
-              % on the hard drive and the zip file. In particular, this assumes
-              % that the folder on the hard drive is writable by the user
-              % and that matlab2tikz.m is not symlinked from some other place.
-              pathstr = fileparts(mfilename('fullpath'));
-              targetPath = [pathstr, filesep, '..', filesep];
-              userInfo(verbose, ['Downloading and unzipping to ', targetPath, '...']);
-              upgradeSuccess = false;
-              try
-                  unzippedFiles = unzip([fileExchangeUrl, '?download=true'], targetPath);
-                  upgradeSuccess = true; %~isempty(unzippedFiles);
-                  userInfo(verbose, 'done.');
-              catch
-                  userInfo(verbose, 'FAILED.');
-              end
-              if upgradeSuccess
-                  % TODO explicitly delete all of the old content
-                  % Delete old version number file.
-                  versionFile = [pathstr, filesep, 'version-', version];
-                  if exist(versionFile, 'file') == 2
-                      delete(versionFile);
-                  end
-                  % TODO anything better than error()?
-                  error('Upgrade successful. Please re-execute.');
-              else
-                  error('Upgrade failed.');
-              end
-          end
-          userInfo(verbose, '');
-      end
-  end
-end
-% =========================================================================
-function isBelow = isVersionBelow(env, versionA, versionB)
-  % Checks if version string or vector versionA is smaller than
-  % version string or vector versionB.
-
-  vA = versionArray(env, versionA);
-  vB = versionArray(env, versionB);
-
-  isBelow = false;
-  for i = 1:min(length(vA), length(vB))
-    if vA(i) > vB(i)
-      isBelow = false;
-      break;
-    elseif vA(i) < vB(i)
-      isBelow = true;
-      break
-    end
-  end
-
-end
-% =========================================================================
-function arr = versionArray(env, str)
-  % Converts a version string to an array, e.g.,
-  % '2.62.8.1' to [2, 62, 8, 1].
-
-  if ischar(str)
-    if strcmpi(env, 'MATLAB')
-        split = regexp(str, '\.', 'split');
-    elseif strcmpi(env, 'Octave')
-        split = strsplit(str, '.');
-    end
-    arr = str2num(char(split)); %#ok
-  else
-    arr = str;
-  end
-
-end
-% =========================================================================
-function userInfo(verbose, message, varargin)
-  % Display usage information.
-
-  if ~verbose
-      return
-  end
-
-  mess = sprintf(message, varargin{:});
-
-  % Replace '\n' by '\n *** ' and print.
-  mess = strrep( mess, sprintf('\n'), sprintf('\n *** ') );
-  fprintf( ' *** %s\n', mess );
-
-end
-% =========================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/test.text b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/test.text
deleted file mode 100644
index 69bc0dcf9eda9f3edbaf3c95eb0983909eb441bc..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/src/test.text
+++ /dev/null
@@ -1,322 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=9.6875in,
-height=3.34375in,
-at={(1.625in,0.510417in)},
-scale only axis,
-separate axis lines,
-every outer x axis line/.append style={black},
-every x tick label/.append style={font=\color{black}},
-xmin=1,
-xmax=10,
-xlabel={$n_{std}$},
-xmajorgrids,
-every outer y axis line/.append style={black},
-every y tick label/.append style={font=\color{black}},
-ymode=log,
-ymin=100000,
-ymax=1e+15,
-yminorticks=true,
-ylabel={condition number},
-ymajorgrids,
-yminorgrids,
-legend style={legend cell align=left,align=left,draw=black}
-]
-\addplot [color=blue,solid,line width=2.0pt]
-  table[row sep=crcr]{%
-1	215657237.21042\\
-1.04522613	136820225.413517\\
-1.09045226	89608942.44\\
-1.13567839	60417150.9517798\\
-1.18090452	41831190.7629315\\
-1.22613065	29675776.706432\\
-1.27135678	21527373.5999616\\
-1.31658291	15939625.8614052\\
-1.36180905	12026890.1355725\\
-1.40703518	9233775.48088384\\
-1.45226131	7204182.27073421\\
-1.49748744	5705025.83181377\\
-1.54271357	4580776.43354252\\
-1.5879397	3725776.0785063\\
-1.63316583	3067036.45370892\\
-1.67839196	2553345.35426966\\
-1.72361809	2148243.42393524\\
-1.76884422	1825419.54430157\\
-1.81407035	1565644.080049\\
-1.85929648	1354695.28727389\\
-1.90452261	1181937.9131113\\
-1.94974874	1039335.55560049\\
-1.99497487	920756.316696951\\
-2.04020101	821478.398098347\\
-2.08542714	737834.662831489\\
-2.13065327	666954.225424749\\
-2.1758794	606572.911837312\\
-2.22110553	554893.041524291\\
-2.26633166	510479.001106209\\
-2.31155779	472179.23166594\\
-2.35678392	439068.236918351\\
-2.40201005	410404.872449736\\
-2.44723618	385606.329107303\\
-2.49246231	364244.522273867\\
-2.53768844	346098.071307408\\
-2.58291457	331439.715080992\\
-2.6281407	323070.674066522\\
-2.67336683	342018.259472786\\
-2.71859296	404629.185545462\\
-2.7638191	490126.661984278\\
-2.80904523	596166.073119711\\
-2.85427136	725661.314455159\\
-2.89949749	882971.221820954\\
-2.94472362	1073523.04104558\\
-2.98994975	1303861.38755625\\
-3.03517588	1581802.72481281\\
-3.08040201	1916643.18533517\\
-3.12562814	2319409.96384725\\
-3.17085427	2803158.06652063\\
-3.2160804	3383316.09890573\\
-3.26130653	4078088.51824717\\
-3.30653266	4908921.33545744\\
-3.35175879	5901040.91592187\\
-3.39698492	7084075.27483846\\
-3.44221106	8492770.41457107\\
-3.48743719	10167813.939853\\
-3.53266332	12156781.5683035\\
-3.57788945	14515221.8082826\\
-3.62311558	17307898.9755472\\
-3.66834171	20610214.052099\\
-3.71356784	24509827.2407036\\
-3.75879397	29108508.1556598\\
-3.8040201	34524242.7528462\\
-3.84924623	40893629.2122888\\
-3.89447236	48374599.2188472\\
-3.93969849	57149503.4606085\\
-3.98492462	67428607.2710279\\
-4.03015075	79454046.263808\\
-4.07537688	93504292.4951583\\
-4.12060302	109899199.394868\\
-4.16582915	129005681.433262\\
-4.21105528	151244114.639717\\
-4.25628141	177095528.706355\\
-4.30150754	207109697.02042\\
-4.34673367	241914183.663127\\
-4.3919598	282224524.052152\\
-4.43718593	328855574.775\\
-4.48241206	382734264.974901\\
-4.52763819	444913758.875845\\
-4.57286432	516589353.420124\\
-4.61809045	599116112.491952\\
-4.66331658	694028575.782968\\
-4.70854271	803062641.821928\\
-4.75376884	928179891.848816\\
-4.79899497	1071594634.99544\\
-4.84422111	1235803870.6776\\
-4.88944724	1423620520.509\\
-4.93467337	1638210187.87137\\
-4.9798995	1883131892.00857\\
-5.02512563	2162383057.1469\\
-5.07035176	2480449143.7932\\
-5.11557789	2842358530.11134\\
-5.16080402	3253742909.86987\\
-5.20603015	3720903913.42031\\
-5.25125628	4250886324.98886\\
-5.29648241	4851558755.61754\\
-5.34170854	5531702163.04615\\
-5.38693467	6301107163.49668\\
-5.4321608	7170680688.06443\\
-5.47738693	8152563062.37041\\
-5.52261307	9260256184.30458\\
-5.5678392	10508763860.3566\\
-5.61306533	11914745257.4492\\
-5.65829146	13496682903.8006\\
-5.70351759	15275066506.6756\\
-5.74874372	17272591869.1043\\
-5.79396985	19514380668.2299\\
-5.83919598	22028218261.798\\
-5.88442211	24844812785.3959\\
-5.92964824	27998077620.2401\\
-5.97487437	31525439606.0782\\
-6.0201005	35468172326.9619\\
-6.06532663	39871760149.2145\\
-6.11055276	44786292718.9093\\
-6.15577889	50266892837.4064\\
-6.20100503	56374181609.2205\\
-6.24623116	63174782057.1755\\
-6.29145729	70741865465.9649\\
-6.33668342	79155740523.69\\
-6.38190955	88504495353.6966\\
-6.42713568	98884689720.5283\\
-6.47236181	110402100245.653\\
-6.51758794	123172532736.627\\
-6.56281407	137322691872.685\\
-6.6080402	152991125424.64\\
-6.65326633	170329241170.995\\
-6.69849246	189502401912.638\\
-6.74371859	210691108219.242\\
-6.78894472	234092270123.166\\
-6.83417085	259920577253.124\\
-6.87939698	288409974555.423\\
-6.92462312	319815247850.498\\
-6.96984925	354413729710.578\\
-7.01507538	392507129197.163\\
-7.06030151	434423501985.988\\
-7.10552764	480519366253.382\\
-7.15075377	531181966841.959\\
-7.1959799	586831706221.842\\
-7.24120603	647924757226.93\\
-7.28643216	714955854364.587\\
-7.33165829	788461293848.765\\
-7.37688442	869022130770.009\\
-7.42211055	957267616672.292\\
-7.46733668	1053878876991.16\\
-7.51256281	1159592828040.97\\
-7.55778894	1275206352975.12\\
-7.60301508	1401580875580.12\\
-7.64824121	1539647052872.52\\
-7.69346734	1690409888850.37\\
-7.73869347	1854954327003.73\\
-7.7839196	2034450930427.24\\
-7.82914573	2230162170442.56\\
-7.87437186	2443449020877.6\\
-7.91959799	2675778040473.91\\
-7.96482412	2928728919473.7\\
-8.01005025	3204002481542.02\\
-8.05527638	3503429120415.6\\
-8.10050251	3828978067099.6\\
-8.14572864	4182766836195.08\\
-8.19095477	4567071646954.06\\
-8.2361809	4984338352691.71\\
-8.28140704	5437193957739.14\\
-8.32663317	5928458925046.44\\
-8.3718593	6461160390776.81\\
-8.41708543	7038546107707.71\\
-8.46231156	7664098911238.81\\
-8.50753769	8341552808902.62\\
-8.55276382	9074909106182.64\\
-8.59798995	9868454526284.93\\
-8.64321608	10726779534067.6\\
-8.68844221	11654798216265\\
-8.73366834	12657769212309.8\\
-8.77889447	13741318162726.6\\
-8.8241206	14911460665449.6\\
-8.86934673	16174627900245.6\\
-8.91457286	17537692291687.8\\
-8.95979899	19007995815445\\
-9.00502513	20593379106651.1\\
-9.05025126	22302213001529.2\\
-9.09547739	24143431056171.9\\
-9.14070352	26126564528964.6\\
-9.18592965	28261779255201.2\\
-9.23115578	30559914044206.9\\
-9.27638191	33032522158326.2\\
-9.32160804	35691914339897.3\\
-9.36683417	38551204026095.3\\
-9.4120603	41624356372873.2\\
-9.45728643	44926238364588.5\\
-9.50251256	48472672472399.1\\
-9.54773869	52280493366340.5\\
-9.59296482	56367607259008.2\\
-9.63819095	60753054065642.7\\
-9.68341709	65457074706447.7\\
-9.72864322	70501179167793.9\\
-9.77386935	75908220995300.4\\
-9.81909548	81702473021700.5\\
-9.86432161	87909710160957.6\\
-9.90954774	94557293096419.3\\
-9.95477387	101674259806590\\
-10	109291416242262\\
-};
-\addlegendentry{$Z^{\mathrm{T}}WZ$};
-
-\addplot [color=black,solid,line width=2.0pt]
-  table[row sep=crcr]{%
-1	560454412409859\\
-1.18367347	42498932093520.3\\
-1.36734694	5123890528457.51\\
-1.55102041	898105464233.222\\
-1.73469388	211017639202.433\\
-1.91836735	62169676611.3565\\
-2.10204082	21907648647.9303\\
-2.28571429	8926402639.07259\\
-2.46938776	4099829681.95167\\
-2.65306122	2080990765.85216\\
-2.83673469	1149170154.28539\\
-3.02040816	681802436.93214\\
-3.20408163	430217654.276045\\
-3.3877551	286338901.782842\\
-3.57142857	199653116.003929\\
-3.75510204	145016493.147664\\
-3.93877551	109206268.302508\\
-4.12244898	84925264.6026608\\
-4.30612245	67971453.1086336\\
-4.48979592	55832260.7758454\\
-4.67346939	46954284.3116833\\
-4.85714286	40348335.8101153\\
-5.04081633	35368028.5023324\\
-5.2244898	31581611.3051586\\
-5.40816327	28695666.7537723\\
-5.59183673	26508608.7673693\\
-5.7755102	24881882.2485996\\
-5.95918367	23722098.5228357\\
-6.14285714	22970352.5858438\\
-6.32653061	22596848.7230199\\
-6.51020408	22600475.7811779\\
-6.69387755	23014954.4581165\\
-6.87755102	23927246.9235142\\
-7.06122449	25524016.4254314\\
-7.24489796	28202140.1298424\\
-7.42857143	32758502.5023493\\
-7.6122449	40383651.4423756\\
-7.79591837	52193820.5722562\\
-7.97959184	69216418.0492402\\
-8.16326531	92847067.5423836\\
-8.34693878	125078476.218031\\
-8.53061224	168621384.493642\\
-8.71428571	227064562.415315\\
-8.89795918	305097706.446344\\
-9.08163265	408802687.901804\\
-9.26530612	546022951.373956\\
-9.44897959	726825866.229147\\
-9.63265306	964077206.835893\\
-9.81632653	1274151329.46174\\
-10	1677805397.01432\\
-};
-\addlegendentry{$Z^{\mathrm{T}}Z$};
-
-\addplot [color=blue,dashed,line width=2.0pt,forget plot]
-  table[row sep=crcr]{%
-1	323070.674066522\\
-10	323070.674066522\\
-};
-\addplot [color=black,dashed,line width=2.0pt,forget plot]
-  table[row sep=crcr]{%
-1	22596848.7230199\\
-10	22596848.7230199\\
-};
-\addplot [color=blue,dashed,line width=2.0pt,forget plot]
-  table[row sep=crcr]{%
-2.6281407	100000\\
-2.6281407	1e+16\\
-};
-\addplot [color=black,dashed,line width=2.0pt,forget plot]
-  table[row sep=crcr]{%
-6.32653061	100000\\
-6.32653061	1e+16\\
-};
-\addplot [color=black,only marks,mark=*,mark options={solid,fill=green},forget plot]
-  table[row sep=crcr]{%
-2.6281407	323070.674066522\\
-};
-\addplot [color=black,only marks,mark=*,mark options={solid,fill=red},forget plot]
-  table[row sep=crcr]{%
-6.32653061	22596848.7230199\\
-};
-\end{axis}
-\end{tikzpicture}%
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/ACID.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/ACID.m
deleted file mode 100644
index cf35d471800ec03f4e5acb7a6afb5a6b08a6646c..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/ACID.m
+++ /dev/null
@@ -1,2378 +0,0 @@
-% =========================================================================
-% *** FUNCTION ACID
-% ***
-% *** MATLAB2TikZ ACID test functions
-% ***
-% =========================================================================
-% ***
-% *** Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
-% *** All rights reserved.
-% ***
-% *** Redistribution and use in source and binary forms, with or without
-% *** modification, are permitted provided that the following conditions are
-% *** met:
-% ***
-% ***    * Redistributions of source code must retain the above copyright
-% ***      notice, this list of conditions and the following disclaimer.
-% ***    * Redistributions in binary form must reproduce the above copyright
-% ***      notice, this list of conditions and the following disclaimer in
-% ***      the documentation and/or other materials provided with the distribution
-% ***
-% *** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% *** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% *** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% *** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% *** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% *** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% *** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% *** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% *** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% *** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% *** POSSIBILITY OF SUCH DAMAGE.
-% ***
-% =========================================================================
-function [status] = ACID(k)
-
-  % assign the functions to test
-  testfunction_handles = {                        ...
-                           @multiline_labels    , ...
-                           @plain_cos           , ...
-                           @sine_with_markers   , ...
-                           @markerSizes         , ...
-                           @markerSizes2        , ...
-                           @sine_with_annotation, ...
-                           @linesWithOutliers   , ...
-                           @peaks_contour       , ...
-                           @contourPenny        , ...
-                           @peaks_contourf      , ...
-                           @many_random_points  , ...
-                           @double_colorbar     , ...
-                           @randomWithLines     , ...
-                           @double_axes         , ...
-                           @double_axes2        , ...
-                           @logplot             , ...
-                           @colorbarLogplot     , ...
-                           @legendplot          , ...
-                           @legendplotBoxoff    , ...
-                           @moreLegends         , ...
-                           @zoom                , ...
-                           @quiveroverlap       , ...
-                           @quiverplot          , ...
-                           @quiver3plot         , ...
-                           @logicalImage        , ...
-                           @imagescplot         , ...
-                           @imagescplot2        , ...
-                           @stairsplot          , ...
-                           @polarplot           , ...
-                           @roseplot            , ...
-                           @compassplot         , ...
-                           @stemplot            , ...
-                           @stemplot2           , ...
-                           @bars                , ...
-                           @xAxisReversed       , ...
-                           @errorBars           , ...
-                           @errorBars2          , ...
-                           @subplot2x2b         , ...
-                           @manualAlignment     , ...
-                           @subplotCustom       , ...
-                           @legendsubplots      , ...
-                           @bodeplots           , ...
-                           @rlocusPlot          , ...
-                           @mandrillImage       , ...
-                           @besselImage         , ...
-                           @clownImage          , ...
-                           @zplanePlot1         , ...
-                           @zplanePlot2         , ...
-                           @freqResponsePlot    , ...
-                           @axesLocation        , ...
-                           @axesColors          , ...
-                           @multipleAxes        , ...
-                           @scatterPlotRandom   , ...
-                           @scatterPlot         , ...
-                           @scatter3Plot        , ...
-                           @spherePlot          , ...
-                           @surfPlot            , ...
-                           @surfPlot2           , ...
-                           @superkohle          , ...
-                           @meshPlot            , ...
-                           @ylabels             , ...
-                           @spectro             , ... % takes pretty long to LuaLaTeX-compile
-                           @mixedBarLine        , ...
-                           @decayingharmonic    , ...
-                           @texcolor            , ...
-                           @textext             , ...
-                           @texrandom           , ...
-                           @latexmath1          , ...
-                           @latexmath2          , ...
-                           @parameterCurve3d    , ...
-                           @parameterSurf       , ...
-                           @fill3plot           , ...
-                           @rectanglePlot       , ...
-                           @herrorbarPlot       , ...
-                           @hist3d              , ...
-                           @myBoxplot           , ...
-                           @areaPlot            , ...
-                           @customLegend        , ...
-                           @pixelLegend         , ...
-                           @croppedImage        , ...
-                           @pColorPlot          , ...
-                           @hgTransformPlot     , ...
-                           @scatterPlotMarkers  , ...
-                           @multiplePatches     , ...
-                           @logbaseline         , ...
-                           @alphaImage          , ...
-                           @annotation1         , ...
-                           @annotation2         , ...
-                           @annotation3         , ...
-                           @annotationText      , ...
-                           @annotationTextUnits , ...
-                           @imageOrientation_PNG, ...
-                           @imageOrientation_inline, ...
-                           @texInterpreter      , ...
-                           @stackedBarsWithOther, ...
-                           @colorbarLabelTitle
-                         };
-
-
-  numFunctions = length( testfunction_handles );
-
-  if (k<=0)
-      status = testfunction_handles;
-      return;  % This is used for querying numFunctions.
-
-  elseif (k<=numFunctions)
-      status = testfunction_handles{k}();
-      status.function = func2str(testfunction_handles{k});
-
-  else
-      error('testfunctions:outOfBounds', ...
-            'Out of bounds (number of testfunctions=%d)', numFunctions);
-  end
-
-end
-% =========================================================================
-function [stat] = multiline_labels()
-  stat.description = 'Test multiline labels and plot some points.';
-  stat.md5 = '2f08dbb3f961daa409c91ce0f5be65e4';
-
-  m = [0 1 1.5 1 -1];
-  plot(m,'*-'); hold on;
-  plot(m(end:-1:1)-0.5,'x--');
-
-  title({'multline','title'});
-  legend({sprintf('multi-line legends\ndo work 2^2=4'), ...
-        sprintf('second\nplot')});
-  xlabel(sprintf('one\ntwo\nthree'));
-  ylabel({'one','° ∞', 'three'});
-
-  set(gca,'YTick', []);
-  set(gca,'XTickLabel',{});
-end
-% =========================================================================
-function [stat] = plain_cos()
-  stat.description = 'Plain cosine function with minimumPointsDistance of $0.5$.';
-  stat.extraCleanfigureOptions = {'minimumPointsDistance', 0.5};
-  stat.md5 = '888ccfb8de61fe94ef1a4b21b515bbb2';
-
-  fplot( @cos, [0,2*pi] );
-
-  % add some minor ticks
-  set(gca, 'XMinorTick', 'on');
-  set(gca, 'YTick', []);
-
-  % Adjust the aspect ratio when in MATLAB(R) or Octave >= 3.4.
-  env = getEnvironment();
-  if strcmpi(env,'Octave') && isVersionBelow(env, 3,4)
-      % Octave < 3.4 doesn't have daspect unfortunately.
-  else
-      daspect([ 1 2 1 ])
-  end
-end
-% =========================================================================
-function [stat] = sine_with_markers ()
-  % Standard example plot from MATLAB's help pages.
-  stat.description = [ 'Twisted plot of the sine function. '                   ,...
-         'Pay particular attention to how markers and Infs/NaNs are treated.' ];
-  stat.md5 = '96317b8317f3eddee9ca01ca338f6c73';
-
-  x = -pi:pi/10:pi;
-  y = tan(sin(x)) - sin(tan(x));
-  y(3) = NaN;
-  y(7) = Inf;
-  y(11) = -Inf;
-  plot(x,y,'--o', 'Color', [0.6,0.2,0.0], ...
-                  'LineWidth', 1*360/127,...
-                  'MarkerEdgeColor','k',...
-                  'MarkerFaceColor',[0.3,0.1,0.0],...
-                  'MarkerSize', 5*360/127 );
-
-  set( gca, 'Color', [0.9 0.9 1], ...
-            'XTickLabel', [], ...
-            'YTickLabel', [] ...
-     );
-
-  set(gca,'XTick',[0]);
-  set(gca,'XTickLabel',{'null'});
-end
-% =========================================================================
-function [stat] = markerSizes()
-  stat.description = 'Marker sizes.';
-  stat.md5 = '466116e445acacf20b4d712600a43a63';
-
-  hold on;
-
-  h = fill([1 1 2 2],[1 2 2 1],'r');
-  set(h,'LineWidth',10);
-
-  plot([0],[0],'go','Markersize',14,'LineWidth',10)
-  plot([0],[0],'bo','Markersize',14,'LineWidth',1)
-end
-% =========================================================================
-function [stat] = markerSizes2()
-  stat.description = 'Line plot with with different marker sizes.';
-  stat.md5 = '0392b76c0de39655f33710fbd6bd5ac8';
-
-  hold on;
-  grid on;
-
-  n = 1:10;
-  d = 10;
-  s = round(linspace(6,25,10));
-  e = d * ones(size(n));
-  style = {'bx','rd','go','c.','m+','y*','bs','mv','k^','r<','g>','cp','bh'};
-  nStyles = numel(style);
-
-  for ii = 1:nStyles
-      for jj = 1:10
-        plot(n(jj), ii * e(jj),style{ii},'MarkerSize',s(jj));
-      end
-  end
-  xlim([min(n)-1 max(n)+1]);
-  ylim([0 d*(nStyles+1)]);
-  set(gca,'XTick',n,'XTickLabel',s,'XTickLabelMode','manual');
-end
-% =========================================================================
-function [stat] = sine_with_annotation ()
-  stat.description = [ 'Plot of the sine function. ',...
-        'Pay particular attention to how titles and annotations are treated.' ];
-  stat.md5 = 'a59a2a2295b5db533cc733feceda974b';
-
-  x = -pi:.1:pi;
-  y = sin(x);
-  h = plot(x,y);
-  set(gca,'XTick',-pi:pi/2:pi);
-
-  set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'});
-
-  xlabel('-\pi \leq \Theta \leq \pi');
-  ylabel('sin(\Theta)');
-  title({'Plot of sin(\Theta)','subtitle','and here''s one really long subtitle' });
-  text(-pi/4,sin(-pi/4),'\leftarrow sin(-\pi\div4)',...
-      'HorizontalAlignment','left');
-
-  % Doesn't work in Octave
-  %set(findobj(gca,'Type','line','Color',[0 0 1]),...
-  %    'Color','red',...
-  %    'LineWidth',10);
-
-end
-% =========================================================================
-function [stat] = linesWithOutliers()
-    stat.description = 'Lines with outliers.';
-    stat.md5 = 'ea2084452c49d1a6e0379739371b2e0a';
-
-    far = 200;
-    x = [ -far, -1,   -1,  -far, -10, -0.5, 0.5, 10,  far, 1,   1,    far, 10,   0.5, -0.5, -10,  -far ];
-    y = [ -10,  -0.5, 0.5, 10,   far, 1,    1,   far, 10,  0.5, -0.5, -10, -far, -1,  -1,   -far, -0.5 ];
-    plot( x, y,'o-');
-    axis( [-2,2,-2,2] );
-end
-% =========================================================================
-function [stat] = peaks_contour()
-  stat.description = 'Test contour plots.';
-  stat.md5 = 'fd564136304fa8e0dac8365abee077b5';
-
-  [C, h] = contour(peaks(20),10);
-  clabel(C, h);
-
-  % remove y-ticks
-  set(gca,'YTickLabel',[]);
-  set(gca,'YTick',[]);
-
-  colormap winter;
-
-end
-% =========================================================================
-function [stat] = contourPenny()
-  stat.description = 'Contour plot of a US\$ Penny.';
-  stat.md5 = '2bcbbf33b2b4a3de6fe3c282acdbf6ae';
-  stat.issues = [49 404];
-
-  if ~exist('penny.mat','file')
-      fprintf( 'penny data set not found. Skipping.\n\n' );
-      stat.skip = true;
-      return;
-  end
-
-  load penny;
-  contour(flipud(P));
-  axis square;
-
-end
-% =========================================================================
-function [stat] = peaks_contourf ()
-  stat.description = 'Test the contourfill plots.';
-  stat.md5 = '515a8b6209314b8a6ef0051b49b69508';
-
-  contourf(peaks(20), 10);
-  colorbar();
-  legend('my legend');
-%    colorbar('NorthOutside');
-%    colorbar('SouthOutside');
-%    colorbar('WestOutside');
-
-%  colormap([0:0.1:1; 1:-0.1:0; 0:0.1:1]')
-  colormap hsv;
-
-end
-% =========================================================================
-function [stat] = double_colorbar()
-  stat.description = 'Double colorbar.';
-  stat.md5 = '';
-
-  vspace = linspace(-40,40,20);
-  speed_map = magic(20).';
-  Q1_map = magic(20);
-
-  subplot(1, 2, 1);
-  contour(vspace(9:17),vspace(9:17),speed_map(9:17,9:17),20)
-  colorbar
-  axis tight
-  axis square
-  xlabel('$v_{2d}$')
-  ylabel('$v_{2q}$')
-
-  subplot(1, 2, 2)
-  contour(vspace(9:17),vspace(9:17),Q1_map(9:17,9:17),20)
-  colorbar
-  axis tight
-  axis square
-  xlabel('$v_{2d}$')
-  ylabel('$v_{2q}$')
-end
-% =========================================================================
-function [stat] = randomWithLines()
-  stat.description = 'Lissajous points with lines.';
-  stat.md5 = '9ddd96d692c4262ec581bbddea5dc5c0';
-
-  beta = 42.42;
-  t = 1:150;
-  X = [sin(t); cos(beta * t)].';
-
-  %X = randn(150,2);
-  X(:,1) = (X(:,1) * 90) + 75;
-  plot(X(:,1),X(:,2),'o');
-  hold on;
-  M(1)=min(X(:,1));
-  M(2)=max(X(:,1));
-  mn = mean(X(:,2));
-  s  = std(X(:,2));
-  plot(M,[mean(X(:,2)) mean(X(:,2))],'k-');
-  plot(M,mn + 1*[s s],'--');
-  plot(M,mn - 2*[s s],'--');
-  axis('tight');
-end
-% =========================================================================
-function [stat] = many_random_points ()
-  stat.description = 'Test the performance when drawing many points.';
-  stat.md5 = '759011e36b98a371a628a67cc29ca81d';
-
-  n = 1e3;
-  alpha = 1024;
-  beta = 1;
-  gamma = 5.47;
-
-  x = cos( (1:n) * alpha );
-  y = sin( (1:n) * beta + gamma);
-
-  plot ( x, y, '.r' );
-  axis([ 0, 1, 0, 1 ])
-end
-% =========================================================================
-function [stat] = double_axes()
-  stat.description = 'Double axes';
-  stat.md5 = '';
-
-  dyb = 0.1;   % normalized units, bottom offset
-  dyt = 0.1;   % separation between subsequent axes bottoms
-
-  x = [0; 24; 48; 72; 96;];
-  y = [7.653 7.473 7.637 7.652 7.651];
-
-  grid on
-  h1 = plot(x,y,'Color','k');
-
-  % following code is taken from `floatAxisX.m'
-
-  % get position of axes
-  allAxes = findobj(gcf,'type','axes');
-  naxes = length(allAxes);
-  ax1Pos = get(allAxes(naxes),'position');
-
-  % rescale and reposition all axes to handle additional axes
-  for an=1:naxes-1
-     if isequal(rem(an,2),0)
-        % even ones in array of axes handles represent axes on which lines are plotted
-        set(allAxes(an),'Position',[ax1Pos(1,1) ax1Pos(1,2)+dyb ax1Pos(1,3) ax1Pos(1,4)-dyt])
-     else
-        % odd ones in array of axes handles represent axes on which floating x-axss exist
-        axPos = get(allAxes(an),'Position');
-        set(allAxes(an),'Position',[axPos(1,1) axPos(1,2)+dyb axPos(1,3) axPos(1,4)])
-     end
-  end
-  % first axis a special case (doesn't fall into even/odd scenario of figure children)
-  set(allAxes(naxes),'Position',[ax1Pos(1,1) ax1Pos(1,2)+dyb ax1Pos(1,3) ax1Pos(1,4)-dyt])
-  ylimit1 = get(allAxes(naxes),'Ylim');
-
-  % get new position for plotting area of figure
-  ax1Pos = get(allAxes(naxes),'position');
-
-  % axis to which the floating axes will be referenced
-  ref_axis = allAxes(1);
-  refPosition = get(ref_axis,'position');
-
-  % overlay new axes on the existing one
-  ax2 = axes('Position',ax1Pos);
-  % plot data and return handle for the line
-  hl1 = plot(x,y,'k');
-  % make the new axes invisible, leaving only the line visible
-  set(ax2,'visible','off','ylim',ylimit1)
-
-  % set the axis limit mode so that it does not change if the
-  % user resizes the figure window
-  set(ax2,'xLimMode','manual')
-
-  % set up another set of axes to act as floater
-  ax3 = axes('Position',[refPosition(1) refPosition(2)-dyb refPosition(3) 0.01]);
-
-  set(ax3,'box','off','ycolor','w','yticklabel',[],'ytick',[])
-  set(ax3,'XMinorTick','on','color','none','xcolor',get(hl1,'color'))
-
-  xlabel('secondary axis')
-end
-% =========================================================================
-function [stat] = double_axes2()
-  stat.description = 'Double overlayed axes with a flip.' ;
-  stat.md5 = '245182a1593794038e5a601a5b7f6a42';
-
-  ah1=axes;
-  ph=plot([0 1],[0 1]);
-
-  title('Title')
-  ylabel('y')
-  xlabel('x')
-
-  % add a new set of axes
-  % to make a gray grid
-  ah2=axes;
-  % make the background transparent
-  set(ah1,'color','none')
-  % move these axes to the back
-  set(gcf,'Child',flipud(get(gcf,'Children')))
-end
-% =========================================================================
-function [stat] = logplot()
-  stat.description = 'Test logscaled axes.';
-  stat.md5 = '25d66c6fdd92aeb32ddaff72d310e6f5';
-
-  x = logspace(-1,2);
-  loglog(x,exp(x),'-s')
-  grid on;
-end
-% =========================================================================
-function [stat] = colorbarLogplot()
-  stat.description = 'Logscaled colorbar.';
-  stat.md5 = '8c99ef632b10a219daa1f09083d18bf5';
-
-  imagesc([1 10 100]);
-  try
-    set(colorbar(), 'YScale', 'log');
-  catch
-    warning('M2TAcid:LogColorBar',...
-        'Logarithmic Colorbars are not documented in MATLAB R2014b and Octave');
-    stat.skip = true;
-  end
-end
-% =========================================================================
-function [stat] = legendplot()
-  stat.description = 'Test inserting of legends.';
-  stat.md5 = 'a9e097172b3d79183b8ecbebeb4d8bed';
-
-%    x = -pi:pi/20:pi;
-%    plot(x,cos(x),'-ro',x,sin(x),'-.b');
-%    h = legend('one pretty long legend cos_x','sin_x',2);
-%    set(h,'Interpreter','none');
-
-  x = 0:0.01:2*pi;
-  plot( x, sin(x), 'b', ...
-        x, cos(x), 'r' );
-  xlim( [0 2*pi] )
-  ylim( [-0.9 0.9] )
-  title( '{tikz test}' )
-  xlabel( '{x-Values}' )
-  ylabel( '{y-Values}' )
-  legend( 'sin(x)', 'cos(x)', 'Location','NorthOutside', ...
-                              'Orientation', 'Horizontal' );
-  grid on;
-end
-% =========================================================================
-function [stat] = legendplotBoxoff ()
-  stat.description = 'Test inserting of legends.';
-  stat.md5 = '7b378300e46c789401e388cf7501ccd8';
-
-  x = -pi:pi/20:pi;
-  plot( x, cos(x),'-ro',...
-        x, sin(x),'-.b' ...
-      );
-  h = legend( 'cos_x', 'one pretty long legend sin_x', 2 );
-  set( h, 'Interpreter', 'none' );
-  legend boxoff;
-end
-% =========================================================================
-function [stat] = moreLegends()
-  stat.description = 'More legends.';
-
-  x = 0:.1:7;
-  y1 = sin(x);
-  y2 = cos(x);
-  [ax,h1,h2] = plotyy(x,y1,x,y2);
-  legend([h1;h2],'Sine','Cosine');
-end
-% =========================================================================
-function [stat] = zoom()
-  stat.description = 'Plain cosine function, zoomed in.';
-
-  fplot( @sin, [0,2*pi], '-*' );
-  hold on;
-  delta = pi/10;
-
-  plot( [pi/2, pi/2], [1-2*delta, 1+2*delta], 'r' ); % vertical line
-  plot( [pi/2-2*delta, pi/2+2*delta], [1, 1], 'g' ); % horizontal line
-
-  % diamond
-  plot( [ pi/2-delta, pi/2 , pi/2+delta, pi/2 , pi/2-delta ], ...
-        [ 1       , 1-delta,        1, 1+delta, 1        ], 'y'      );
-
-  % boundary lines with markers
-  plot([ pi/2-delta, pi/2 , pi/2+delta, pi/2+delta pi/2+delta, pi/2, pi/2-delta, pi/2-delta ], ...
-       [ 1-delta, 1-delta, 1-delta, 1, 1+delta, 1+delta, 1+delta, 1 ], ...
-       'ok', ...
-       'MarkerSize', 20, ...
-       'MarkerFaceColor', 'g' ...
-       );
-
-  hold off;
-
-  axis([pi/2-delta, pi/2+delta, 1-delta, 1+delta] );
-end
-% =========================================================================
-function [stat] = bars()
-  stat.description = '2x2 Subplot with different bars';
-
-  % dataset grouped
-  bins = 10 * (-0.5:0.1:0.5);
-  numEntries = length(bins);
-
-  alpha = [13 11 7];
-  numBars = numel(alpha);
-  plotData   = zeros(numEntries, numBars);
-  for iBar = 1:numBars
-      plotData(:,iBar) = abs(round(100*sin(alpha(iBar)*(1:numEntries))));
-  end
-
-  % dataset stacked
-  [data,dummy,dummy] = svd(magic(7)); %#ok
-  Y = round(abs(data(2:6,2:4))*10);
-
-  subplot(2,2,1);
-  b1 = bar(bins,plotData,'grouped','BarWidth',1.5);
-  set(gca,'XLim',[1.25*min(bins) 1.25*max(bins)]);
-
-  subplot(2,2,2);
-  barh(bins, plotData, 'grouped', 'BarWidth', 1.3);
-
-  subplot(2,2,3);
-  bar(Y, 'stacked');
-
-  subplot(2,2,4);
-  b2= barh(Y,'stacked','BarWidth', 0.75);
-
-  set(b1(1),'FaceColor','m','EdgeColor','none')
-  set(b2(1),'FaceColor','c','EdgeColor','none')
-
-end
-% =========================================================================
-function [stat] = stemplot()
-  stat.description = 'A simple stem plot.' ;
-
-  x = 0:25;
-  y = [exp(-.07*x).*cos(x);
-       exp(.05*x).*cos(x)]';
-  h = stem(x, y);
-  legend( 'exp(-.07x)*cos(x)', 'exp(.05*x)*cos(x)', 'Location', 'NorthWest');
-  set(h(1),'MarkerFaceColor','blue')
-  set(h(2),'MarkerFaceColor','red','Marker','square')
-end
-% =========================================================================
-function [stat] = stemplot2()
-  stat.description = 'Another simple stem plot.';
-
-  x = 0:25;
-  y = [exp(-.07*x).*cos(x);
-       exp(.05*x).*cos(x)]';
-  h = stem(x, y, 'filled');
-  legend( 'exp(-.07x)*cos(x)', 'exp(.05*x)*cos(x)', 'Location', 'NorthWest');
-end
-% =========================================================================
-function [stat] = stairsplot()
-  stat.description = 'A simple stairs plot.' ;
-
-  x = linspace(-2*pi,2*pi,40);
-  stairs(x,sin(x))
-end
-% =========================================================================
-function [stat] = quiverplot()
-  stat.description = 'A combined quiver/contour plot of $x\exp(-x^2-y^2)$.' ;
-
-  [X,Y] = meshgrid(-2:.2:2);
-  Z = X.*exp(-X.^2 - Y.^2);
-  [DX,DY] = gradient(Z,.2,.2);
-  contour(X,Y,Z);
-  hold on
-  quiver(X,Y,DX,DY);
-  colormap hsv;
-  hold off
-end
-% =========================================================================
-function [stat] = quiver3plot()
-  stat.description = 'Three-dimensional quiver plot.' ;
-
-  vz = 10;            % Velocity
-  a = -32;            % Acceleration
-
-  t = 0:.1:1;
-  z = vz*t + 1/2*a*t.^2;
-
-  vx = 2;
-  x = vx*t;
-  vy = 3;
-  y = vy*t;
-
-  u = gradient(x);
-  v = gradient(y);
-  w = gradient(z);
-  scale = 0;
-  quiver3(x,y,z,u,v,w,scale)
-  view([70 18])
-end
-% =========================================================================
-function [stat] = quiveroverlap ()
-  stat.description = 'Quiver plot with avoided overlap.';
-
-  x = [0 1];
-  y = [0 0];
-  u = [1 -1];
-  v = [1 1];
-
-  quiver(x,y,u,v);
-end
-% =========================================================================
-function [stat] = polarplot ()
-  stat.description = 'A simple polar plot.' ;
-  stat.extraOptions = {'showHiddenStrings',true};
-
-  t = 0:.01:2*pi;
-  polar(t,sin(2*t).*cos(2*t),'--r')
-end
-% =========================================================================
-function [stat] = roseplot ()
-  stat.description = 'A simple rose plot.' ;
-  stat.extraOptions = {'showHiddenStrings',true};
-
-  theta = 2*pi*sin(linspace(0,8,100));
-  rose(theta);
-end
-% =========================================================================
-function [stat] = compassplot ()
-  stat.description = 'A simple compass plot.' ;
-  stat.extraOptions = {'showHiddenStrings',true};
-
-  Z = (1:20).*exp(1i*2*pi*cos(1:20));
-  compass(Z);
-end
-% =========================================================================
-function [stat] = logicalImage()
-  stat.description = 'An image plot of logical matrix values.' ;
-
-  [plotData,dummy,dummy] = svd(magic(10)); %#ok
-  imagesc(plotData > mean(plotData(:)));
-end
-% =========================================================================
-function [stat] = imagescplot()
-  stat.description = 'An imagesc plot of $\sin(x)\cos(y)$.';
-
-  pointsX = 10;
-  pointsY = 20;
-  x = 0:1/pointsX:1;
-  y = 0:1/pointsY:1;
-  z = sin(x)'*cos(y);
-  imagesc(x,y,z);
-end
-% =========================================================================
-function [stat] = imagescplot2()
-  stat.description = 'A trimmed imagesc plot.';
-
-  a=magic(10);
-  x=-5:1:4;
-  y=10:19;
-  imagesc(x,y,a)
-
-  xlim([-3,2])
-  ylim([12,15])
-
-  grid on;
-end
-% =========================================================================
-function [stat] = xAxisReversed ()
-  stat.description = 'Reversed axes with legend.' ;
-
-  n = 100;
-  x = (0:1/n:1);
-  y = exp(x);
-  plot(x,y);
-  set(gca,'XDir','reverse');
-  set(gca,'YDir','reverse');
-  legend( 'Location', 'SouthWest' );
-end
-% =========================================================================
-function [stat] = subplot2x2b ()
-  stat.description = 'Three aligned subplots on a $2\times 2$ subplot grid.' ;
-
-  x = (1:5);
-
-  subplot(2,2,1);
-  y = sin(x.^3);
-  plot(x,y);
-
-  subplot(2,2,2);
-  y = cos(x.^3);
-  plot(x,y);
-
-  subplot(2,2,3:4);
-  y = tan(x);
-  plot(x,y);
-end
-% =========================================================================
-function [stat] = manualAlignment()
-  stat.description = 'Manually aligned figures.';
-
-  xrange = linspace(-3,4,2*1024);
-
-  axes('Position', [0.1 0.1 0.85 0.15]);
-  plot(xrange);
-  ylabel('$n$');
-  xlabel('$x$');
-
-  axes('Position', [0.1 0.25 0.85 0.6]);
-  plot(xrange);
-  set(gca,'XTick',[]);
-end
-% =========================================================================
-function [stat] = subplotCustom ()
-  stat.description = 'Three customized aligned subplots.' ;
-
-  x = (1:5);
-
-  y = cos(sqrt(x));
-  subplot( 'Position', [0.05 0.1 0.3 0.3] )
-  plot(x,y);
-
-  y = sin(sqrt(x));
-  subplot( 'Position', [0.35 0.5 0.3 0.3] )
-  plot(x,y);
-
-  y = tan(sqrt(x));
-  subplot( 'Position', [0.65 0.1 0.3 0.3] )
-  plot(x,y);
-end
-% =========================================================================
-function [stat] = errorBars ()
-  stat.description = 'Generic error bar plot.';
-
-  plotData = 1:10;
-  [u,s,v] = svd(magic(11));
-
-  eH = abs(u(1:10,5));
-  eL = abs(v(1:10,9));
-
-  errorbar(1:10, plotData, eL, eH, '.')
-end
-% =========================================================================
-function [stat] = errorBars2 ()
-  stat.description = 'Another error bar example.';
-
-  data = load( 'myCount.dat' );
-  y = mean( data, 2 );
-  e = std( data, 1, 2 );
-  errorbar( y, e, 'xr' );
-end
-% =========================================================================
-function [stat] = legendsubplots()
-  stat.description = [ 'Subplots with legends. ' , ...
-    'Increase value of "length" in the code to stress-test your TeX installation.' ];
-
-  % size of upper subplot
-  rows = 4;
-  % number of points.  A large number here (eg 1000) will stress-test
-  % matlab2tikz and your TeX installation.  Be prepared for it to run out of
-  % memory
-  length = 100;
-
-  % generate some spurious data
-  t = 0:(4*pi)/length:4*pi;
-  x = t;
-  a = t;
-  y = sin(t) + 0.1*sin(134*t.^2);
-  b = sin(t) + 0.1*cos(134*t.^2) + 0.05*cos(2*t);
-
-  % plot the top figure
-  subplot(rows+2,1,1:rows);
-
-  % first line
-  sigma1 = std(y);
-  tracey = mean(y,1);
-  plot123 = plot(x,tracey,'b-');
-
-  hold on
-
-  % second line
-  sigma2 = std(b);
-  traceb = mean(b,1);
-  plot456 = plot(a,traceb,'r-');
-
-  spec0 = ['Mean V(t)_A (\sigma \approx ' num2str(sigma1,'%0.4f') ')'];
-  spec1 = ['Mean V(t)_B (\sigma \approx ' num2str(sigma2,'%0.4f') ')'];
-
-  hold off
-  %plot123(1:2)
-  legend([plot123; plot456],spec0,spec1)
-  legend boxoff
-  xlabel('Time/s')
-  ylabel('Voltage/V')
-  title('Time traces');
-
-  % now plot a differential trace
-  subplot(rows+2,1,rows+1:rows+2)
-  plot7 = plot(a,traceb-tracey,'k');
-
-  legend(plot7,'\Delta V(t)')
-  legend boxoff
-  xlabel('Time/s')
-  ylabel('\Delta V')
-  title('Differential time traces');
-end
-% =========================================================================
-function [stat] = bodeplots()
-  stat.description = 'Bode plots with legends.';
-
-  if isempty(which('tf'))
-      fprintf( 'function "tf" not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  Rc=1;
-  C=1.5e-6; %F
-
-  % Set inductors
-  L1=4e-3;
-  L2=0.8e-3;
-
-  % Resistances of inductors
-  R1=4;
-  R2=2;
-
-  % Transfer functions
-  % Building transfer functions
-  s=tf('s');
-  Zc=1/(s*C)+Rc;
-  Z1=s*L1+R1;
-  Z2=s*L2+R2;
-  LCLd=(Z2+Zc)/(Z1+Zc);
-  LCL=(s^2*C*L2+1)/(s^2*C*L1+1);
-
-  t=logspace(3,5,1000);
-  bode(LCL,t)
-  hold on
-  bode(LCLd,t)
-  title('Voltage transfer function of a LCL filter')
-  set(findall(gcf,'type','line'),'linewidth',1.5)
-  grid on
-
-  legend('Perfect LCL',' Real LCL','Location','SW')
-end
-% =========================================================================
-function [stat] = rlocusPlot()
-  stat.description = 'rlocus plot.';
-
-  if isempty(which('tf'))
-      fprintf( 'function "tf" not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  s=tf('s');
-  rlocus(tf([1 1],[4 3 1]))
-end
-% =========================================================================
-function [stat] = mandrillImage()
-  stat.description = 'Picture of a mandrill.';
-
-  if ~exist('mandrill.mat','file')
-      fprintf( 'mandrill data set not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  data = load( 'mandrill' );
-  image( data.X )       % show image
-  colormap( data.map )  % adapt colormap
-  axis image            % pixels should be square
-  axis off              % disable axis
-end
-% =========================================================================
-function [stat] = besselImage()
-  stat.description = 'Bessel function.';
-
-  nu   = -5:0.25:5;
-  beta = 0:0.05:2.5;
-
-  m = length(beta);
-  n = length(nu);
-  trace = zeros(m,n);
-  for i=1:length(beta);
-      for j=1:length(nu)
-              if (floor(nu(j))==nu(j))
-                  trace(i,j)=abs(besselj(nu(j),beta(i)));
-              end
-      end
-  end
-
-  imagesc(nu,beta,trace);
-  colorbar()
-  xlabel('Order')
-  ylabel('\beta')
-  set(gca,'YDir','normal')
-end
-% =========================================================================
-function [stat] = clownImage()
-  stat.description = 'Picture of a clown.';
-
-  if ~exist('clown.mat','file')
-      fprintf( 'clown data set not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  data = load( 'clown' );
-  imagesc( data.X )
-  colormap( gray )
-end
-% =========================================================================
-function [stat] = zplanePlot1()
-  stat.description = 'Representation of the complex plane with zplane.';
-
-  % check of the signal processing toolbox is installed
-  if length(ver('signal')) ~= 1
-      fprintf( 'Signal toolbox not found. Skip.\n\n' );
-      stat.skip = true;
-
-      return
-  end
-
-  [z,p] = ellip(4,3,30,200/500);
-  zplane(z,p);
-  title('4th-Order Elliptic Lowpass Digital Filter');
-end
-% =========================================================================
-function [stat] = zplanePlot2()
-  stat.description = 'Representation of the complex plane with zplane.';
-  stat.closeall = true;
-
-  % check of the signal processing toolbox is installed
-  if length(ver('signal')) ~= 1
-      fprintf( 'Signal toolbox not found. Skip.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  [b,a] = ellip(4,3,30,200/500);
-  Hd = dfilt.df1(b,a);
-  zplane(Hd) % FIXME: This opens a new figure that doesn't get closed automatically
-end
-% =========================================================================
-function [stat] = freqResponsePlot()
-  stat.description = 'Frequency response plot.';
-  stat.closeall = true;
-  stat.issues = [409];
-
-  % check of the signal processing toolbox is installed
-  if length(ver('signal')) ~= 1
-      fprintf( 'Signal toolbox not found. Skip.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  b  = fir1(80,0.5,kaiser(81,8));
-  hd = dfilt.dffir(b);
-  freqz(hd); % FIXME: This opens a new figure that doesn't get closed automatically
-end
-% =========================================================================
-function [stat] = axesLocation()
-  stat.description = 'Swapped axis locations.';
-
-  plot(cos(1:10));
-  set(gca,'XAxisLocation','top');
-  set(gca,'YAxisLocation','right');
-end
-% =========================================================================
-function [stat] = axesColors()
-  stat.description = 'Custom axes colors.';
-
-  plot(sin(1:15));
-  set(gca,'XColor','g','YColor','b');
-%  set(gca,'XColor','b','YColor','k');
-  box off;
-end
-% =========================================================================
-function [stat] = multipleAxes()
-  stat.description = 'Multiple axes.';
-
-  x1 = 0:.1:40;
-  y1 = 4.*cos(x1)./(x1+2);
-  x2 = 1:.2:20;
-  y2 = x2.^2./x2.^3;
-
-  line(x1,y1,'Color','r');
-  ax1 = gca;
-  set(ax1,'XColor','r','YColor','r')
-
-  ax2 = axes('Position',get(ax1,'Position'),...
-             'XAxisLocation','top',...
-             'YAxisLocation','right',...
-             'Color','none',...
-             'XColor','k','YColor','k');
-
-  line(x2,y2,'Color','k','Parent',ax2);
-
-  xlimits = get(ax1,'XLim');
-  ylimits = get(ax1,'YLim');
-  xinc = (xlimits(2)-xlimits(1))/5;
-  yinc = (ylimits(2)-ylimits(1))/5;
-
-  % Now set the tick mark locations.
-  set(ax1,'XTick',xlimits(1):xinc:xlimits(2) ,...
-          'YTick',ylimits(1):yinc:ylimits(2) )
-end
-% =========================================================================
-function [stat] = scatterPlotRandom()
-  stat.description = 'Generic scatter plot.';
-
-  n = 1:100;
-  scatter(n, n, 1000*(1+cos(n.^1.5)), n.^8);
-  colormap autumn;
-end
-% =========================================================================
-function [stat] = scatterPlot()
-  stat.description = 'Scatter plot with MATLAB(R) stat.';
-  if ~exist('seamount.mat','file')
-      fprintf( 'seamount data set not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  data = load( 'seamount' );
-  scatter( data.x, data.y, 5, data.z, '^' );
-end
-% =========================================================================
-function [stat] = scatterPlotMarkers()
-  stat.description = 'Scatter plot with with different marker sizes and legend.';
-
-  n = 1:10;
-  d = 10;
-  s = d^2 * n;
-  e = d * ones(size(n));
-  grid on;
-  hold on;
-
-  style = {'bx','rd','go','c.','m+','y*','bs','mv','k^','r<','g>','cp','bh'};
-  names = {'bx','rd','go','c.','m plus','y star','bs','mv',...
-           'k up triangle','r left triangle','g right triangle','cp','bh'};
-
-  nStyles = numel(style);
-  for ii = 1:nStyles
-      scatter(n, ii * e, s, style{ii});
-  end
-  xlim([min(n)-1 max(n)+1]);
-  ylim([0 d*(nStyles+1)]);
-  set(gca,'XTick',n,'XTickLabel',s,'XTickLabelMode','manual');
-
-end
-% =========================================================================
-function [stat] = scatter3Plot()
-  stat.description = 'Scatter3 plot with MATLAB(R) stat.';
-
-  [x,y,z] = sphere(16);
-  X = [x(:)*.5 x(:)*.75 x(:)];
-  Y = [y(:)*.5 y(:)*.75 y(:)];
-  Z = [z(:)*.5 z(:)*.75 z(:)];
-  S = repmat([1 .75 .5]*10,numel(x),1);
-  C = repmat([1 2 3],numel(x),1);
-  scatter3(X(:),Y(:),Z(:),S(:),C(:),'filled'), view(-60,60)
-  view(40,35)
-end
-% =========================================================================
-function [stat] = spherePlot()
-  stat.description = 'Plot a sphere.';
-
-  sphere(30);
-  title('a sphere: x^2+y^2+z^2');
-  xlabel('x');
-  ylabel('y');
-  zlabel('z');
-  axis equal;
-end
-% =========================================================================
-function [stat] = surfPlot()
-  stat.description = 'Surface plot.';
-
-  [X,Y,Z] = peaks(30);
-  surf(X,Y,Z)
-  colormap hsv
-  axis([-3 3 -3 3 -10 5])
-  set(gca,'View',[-37.5,36]);
-
-  hc = colorbar('YTickLabel', ...
-                {'Freezing','Cold','Cool','Neutral',...
-                 'Warm','Hot','Burning','Nuclear'});
-  set(get(hc,'Xlabel'),'String','Multitude');
-  set(get(hc,'Ylabel'),'String','Magnitude');
-  set(hc,'YTick',0:0.7:7);
-  set(hc,'YTickLabel',...
-         {'-0.8' '-0.6' '-0.4' '-0.2' '0.0' ...
-          '0.2' '0.4' '0.6' '0.8' '0.10' '0.12'});
-
-  set(get(hc,'Title'),...
-      'String', 'k(u,v)', ...
-      'FontSize', 12, ...
-      'interpreter', 'tex');
-
-  xlabel( 'x' )
-  ylabel( 'y' )
-  zlabel( 'z' )
-end
-% =========================================================================
-function [stat] = surfPlot2()
-  stat.description = 'Another surface plot.';
-
-  z = [ ones(15, 5) zeros(15,5);
-        zeros(5, 5) zeros( 5,5)];
-
-  surf(abs(fftshift(fft2(z))) + 1);
-  set(gca,'ZScale','log');
-
-  legend( 'legendary', 'Location', 'NorthEastOutside' );
-end
-% =========================================================================
-function [stat] = superkohle()
-
-  if ~exist('initmesh')
-      fprintf( 'initmesh() not found. Skipping.\n\n' );
-      stat.skip = true;
-      return;
-  end
-
-  stat.description = 'Superkohle plot.';
-
-  x1=0;
-  x2=pi;
-  y1=0;
-  y2=pi;
-  omegashape = [2 2 2 2             % 2 = line segment; 1 = circle segment; 4 = elipse segment
-              x1 x2 x2 x1         % start point x
-              x2 x2 x1 x1         % end point x
-              y1 y1 y2 y2         % start point y
-              y1 y2 y2 y1         % end point y
-              1 1 1 1
-              0 0 0 0];
-  [xy,edges,tri] = initmesh(omegashape,'Hgrad',1.05);
-  mmin = 1;
-  while size(xy,2) < mmin
-      [xy,edges,tri] = refinemesh(omegashape,xy,edges,tri);
-  end
-  m = size(xy,2);
-  x = xy(1,:)';
-  y = xy(2,:)';
-  y0 = cos(x).*cos(y);
-
-  pdesurf(xy,tri,y0(:,1));
-  title('y_0');
-  xlabel('x1 axis');
-  ylabel('x2 axis');
-  axis([0 pi 0 pi -1 1]);
-  grid on;
-end
-% =========================================================================
-function [stat] = meshPlot()
-  stat.description = 'Mesh plot.';
-
-  [X,Y,Z] = peaks(30);
-  mesh(X,Y,Z)
-  colormap hsv
-  axis([-3 3 -3 3 -10 5])
-
-  xlabel( 'x' )
-  ylabel( 'y' )
-  zlabel( 'z' )
-end
-% =========================================================================
-function [stat] = ylabels()
-  stat.description = 'Separate y-labels.';
-
-  x = 0:.01:2*pi;
-  H = plotyy(x,sin(x),x,3*cos(x));
-
-  ylabel(H(1),'sin(x)');
-  ylabel(H(2),'3cos(x)');
-
-  xlabel(gca,'time')
-end
-% =========================================================================
-function [stat] = spectro()
-  stat.description = 'Spectrogram plot';
-
-  % In the original test case, this is 0:0.001:2, but that takes forever
-  % for LaTeX to process.
-  if isempty(which('chirp'))
-      fprintf( 'chirp() not found. Skipping.\n\n' );
-      stat.description = [];
-      stat.skip = true;
-      return
-  end
-
-  T = 0:0.005:2;
-  X = chirp(T,100,1,200,'q');
-  spectrogram(X,128,120,128,1E3);
-  title('Quadratic Chirp');
-end
-% =========================================================================
-function [stat] = mixedBarLine()
-  stat.description = 'Mixed bar/line plot.';
-
-  [x,s,v] = svd(magic(33));
-  x = x(end:-1:end-1000);
-  hist(x,10)
-  y = ylim;
-  hold on;
-  plot([mean(x) mean(x)], y, '-r');
-  hold off;
-end
-% =========================================================================
-function [stat] = decayingharmonic()
-  stat.description = 'Decaying harmonic oscillation with \TeX{} title.';
-
-  % Based on an example from
-  % http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-28104
-  A = 0.25;
-  alpha = 0.007;
-  beta = 0.17;
-  t = 0:901;
-  y = A * exp(-alpha*t) .* sin(beta*t);
-  plot(t, y)
-  title('{\itAe}^{-\alpha\itt}sin\beta{\itt}, \alpha<<\beta, \beta>>\alpha, \alpha<\beta, \beta>\alpha')
-  xlabel('Time \musec.')
-  ylabel('Amplitude')
-end
-% =========================================================================
-function [stat] = texcolor()
-  stat.description = 'Multi-colored text using \TeX{} commands.';
-
-  % Taken from an example at
-  % http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-28104
-  text(.1, .5, ['\fontsize{16}black {\color{magenta}magenta '...
-                '\color[rgb]{0 .5 .5}teal \color{red}red} black again'])
-end
-% =========================================================================
-function [stat] = textext()
-  stat.description = 'Formatted text and special characters using \TeX{}.';
-
-  % Taken from an example at
-  % http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-28303
-  txstr(1) = { 'Each cell is a quoted string' };
-  txstr(2) = { 'You can specify how the string is aligned' };
-  txstr(3) = { 'You can use LaTeX symbols like \pi \chi \Xi' };
-  txstr(4) = { '\bfOr use bold \rm\itor italic font\rm' };
-  txstr(5) = { '\fontname{courier}Or even change fonts' };
-  plot( 0:6, sin(0:6) )
-  text( 5.75, sin(2.5), txstr, 'HorizontalAlignment', 'right' )
-end
-% =========================================================================
-function [stat] = texrandom()
-  stat.description = 'Random TeX symbols';
-
-  try
-      rng(42); %fix seed
-      %TODO: fully test tex conversion instead of a random subsample!
-  catch
-      warning('testfuncs:texrandom','Cannot fix seed for random generator!');
-  end
-
-  num = 20; % number of symbols per line
-  symbols = {'\it', '\bf', '\rm', '\sl',                                ...
-             '\alpha', '\angle', '\ast', '\beta', '\gamma', '\delta',   ...
-             '\epsilon', '\zeta', '\eta', '\theta', '\vartheta',        ...
-             '\iota', '\kappa', '\lambda', '\mu', '\nu', '\xi', '\pi',  ...
-             '\rho', '\sigma', '\varsigma', '\tau', '\equiv', '\Im',    ...
-             '\otimes', '\cap', '{\int}', '\rfloor', '\lfloor', '\perp',...
-             '\wedge', '\rceil', '\vee', '\langle', '\upsilon', '\phi', ...
-             '\chi', '\psi', '\omega', '\Gamma', '\Delta', '\Theta',    ...
-             '\Lambda', '\Xi', '\Pi', '\Sigma', '\Upsilon', '\Phi',     ...
-             '\Psi', '\Omega', '\forall', '\exists', '\ni', '{\cong}',  ...
-             '\approx', '\Re', '\oplus', '\cup', '\subseteq', '\lceil', ...
-             '\cdot', '\neg', '\times', '\surd', '\varpi', '\rangle',   ...
-             '\sim', '\leq', '\infty', '\clubsuit', '\diamondsuit',     ...
-             '\heartsuit', '\spadesuit', '\leftrightarrow',             ...
-             '\leftarrow', '\Leftarrow', '\uparrow', '\rightarrow',     ...
-             '\Rightarrow', '\downarrow', '\circ', '\pm', '\geq',       ...
-             '\propto', '\partial', '\bullet', '\div', '\neq',          ...
-             '\aleph', '\wp', '\oslash', '\supseteq', '\nabla',         ...
-             '{\ldots}', '\prime', '\0', '\mid', '\copyright',          ...
-             '\o', '\in', '\subset', '\supset',                         ...
-             '\_', '\^', '\{', '\}', '$', '%', '#',                     ...
-             '(', ')', '+', '-', '=', '/', ',', '.', '<', '>',          ...
-             '!', '?', ':', ';', '*', '[', ']', '§', '"', '''',         ...
-             '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',          ...
-             'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',     ...
-             'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',     ...
-             'w', 'x', 'y', 'z',                                        ...
-             'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',     ...
-             'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',     ...
-             'W', 'X', 'Y', 'Z'                                         ...
-            };
-      % Note: Instead of '\ldots' the list of symbols contains the entry
-      %       '{\ldots}'. This is because TeX gives an error if it
-      %       encounters the sequence '$a_\ldots$' or '$a^\ldots$'. It
-      %       looks like that is a TeX bug. Nevertheless this sequence
-      %       could appear in the random output, therefore \ldots is
-      %       wrapped in braces since '$a_{\ldots}$' and '$a^{\ldots}$'
-      %       don't crash TeX.
-      %       Same thing with '\cong' and '\int'.
-      % \color{red} etc. isn't included
-      % \fontname{Times} etc. isn't included
-      % \fontsize{12} etc. isn't included
-
-  switch getEnvironment()
-      case 'MATLAB'
-          % MATLAB expects tilde and ampersand to be un-escaped and backslashes
-          % to be escaped
-          symbols = [ symbols, {'~', '&', '\\'} ];
-      case 'Octave'
-          % Octave expects tilde and ampersand to be escaped for regular
-          % output. If either are used un-escaped, that creates odd output in
-          % Octave itself, but since matlab2tikz should be able to handle
-          % those cases, let's include the un-escaped symbols in the list.
-          symbols = [ symbols, {'\~', '\&', '~', '&'} ];
-          % Octave's backslash handling is weird to say the least. However,
-          % matlab2tikz treats backslashes the same in Octave as it does in
-          % MATLAB. Therefore, let's add an escaped backslash to the list
-          symbols = [ symbols, {'\\'} ];
-      otherwise
-          error( 'Unknown environment. Need MATLAB(R) or Octave.' )
-  end
-
-  for ypos = [0.9:-.2:.1]
-      % Generate `num' random indices to the list of symbols
-      index = max(ceil(rand(1, num)*length(symbols)), 1);
-      % Assemble symbols into one cell string array
-      string = symbols(index);
-
-      % Add random amount of balanced braces in random positions to `string'.
-      % By potentially generating more than one set of braces randomly, it's
-      % possible to create more complex patterns of nested braces. Increase
-      % `braceprob' to get more braces, but don't use values greater than or
-      % equal 1 which would result in an infinite loop.
-      braceprob = 0.6;
-      while rand(1,1) < braceprob
-          % Generate two random numbers ranging from 1 to n with n = number
-          % of symbols in `string'
-          bracepos = max(ceil(rand(1, 2)*length(string)), 1);
-          % Modify `string' so that an opening brace is inserted before
-          % min(bracepos) symbols and a closing brace after max(bracepos)
-          % symbols. That way any number of symbols from one to all in
-          % `string' are wrapped in braces for min(bracepos) == max(bracepos)
-          % and min(bracepos) == 1 && max(bracepos) == length(string),
-          % respectively.
-          string = [string(1:min(bracepos)-1), {'{'},    ...
-                    string(min(bracepos):max(bracepos)), ...
-                    {'}'}, string(max(bracepos)+1:end)   ];
-      end
-      % Clean up: remove '{}', '{{}}', etc.
-      clean = false;
-      while clean == false
-          clean = true;
-          for i = 1:length(string)-1
-              if strcmp( string(i), '{' ) && strcmp( string(i+1), '}' )
-                  string = [string(1:i-1), string(i+2:end)];
-                  clean = false;
-                  break
-              end
-          end
-      end
-
-      % Subscripts '_' and superscripts '^' in TeX are tricky in that certain
-      % combinations are not allowed and there are some subtleties in regard
-      % to more complicated combinations of sub/superscripts:
-      % - ^a or _a at the beginning of a TeX math expression is permitted.
-      % - a^ or a_ at the end of a TeX math expression is not.
-      % - a__b, a_^b, a^_b, or a^^b is not allowed, as is any number of
-      %   consecutive sub/superscript operators. Actually a^^b does not
-      %   crash TeX, but it produces seemingly random output instead of `b',
-      %   therefore it should be avoided, too.
-      % - a^b^c or a_b_c is not allowed as it results in a "double subscript/
-      %   superscript" error.
-      % - a^b_c or a_b^c, however, does work.
-      % - a^bc^d or a_bc_d also works.
-      % - a^b_c^d or a_b^c_d is not allowed and results in a "double
-      %   subscript/superscript" error.
-      % - a{_}b, a{^}b, {a_}b or {a^}b is not permitted.
-      % - a{_b} or a{^b} is valid TeX code.
-      % - {a_b}_c produces the same output as a_{bc}. Likewise for '^'.
-      % - a_{b_c} results in "a index b sub-index c". Likewise for '^'.
-      % - a^{b}^c or a_{b}_c is not allowed as it results in a "double
-      %   subscript/superscript" error.
-      %
-      % From this we can derive a number of rules:
-      % 1)  The last symbol in a TeX string must not be '^' or '_'.
-      % 2a) There must be at least one non-brace symbol between any '^' and '_'.
-      % 2b) There must be at least one non-brace symbol between any '_' and '^'.
-      % 3a) There must either be at least two non-brace, non-'_' symbols or at
-      %     least one non-brace, non-'_' symbol and one brace (opening or
-      %     closing) between any two '^'.
-      % 3b) There must either be at least two non-brace, non-'^' symbols or at
-      %     least one brace (opening or closing) between any two '_'.
-      % 4)  '^' or '_' must not appear directly before '}'.
-      % 5)  '^' or '_' must not appear directly after '}'.
-      % 6)  Whenever braces were mentioned, that refers to non-empty braces,
-      %     i.e. '{}' counts as nothing. Printable/escaped braces '\{' and '\}'
-      %     also don't count as braces but as regular symbols.
-      % 7)  '^' or '_' must not appear directly before '\it', '\bf', '\rm', or
-      %     '\sl'.
-      % 8)  '^' or '_' must not appear directly after '\it', '\bf', '\rm', or
-      %     '\sl'.
-      %
-      % A few test cases:
-      % Permitted: ^a...  _a...  a^b_c  a_b^c  a^bc^d  a_bc_d  a{_b}  a{^b}
-      %            {a_b}_c  a_{bc}  {a^b}^c  a^{bc}  a_{b_c}  a^{b^c}
-      % Forbidden: ...z^  ...z_  a__b  a_^b  a^_b  [a^^b]  a^b^c  a_b_c
-      %            a^b_c^d  a_b^c_d  a{_}b  a{^}b  {a_}b  {a^}b
-      %            a^{_b}  a_{^b}  a^{b}^c  a_{b}_c
-      %
-      % Now add sub/superscripts according to these rules
-      subsupprob   = 0.1;  % Probability for insertion of a sub/superscript
-      caretdist    = Inf;  % Distance to the last caret
-      underscdist  = Inf;  % Distance to the last underscore
-      bracedist    = Inf;  % Distance to the last brace (opening or closing)
-      pos = 0;
-      % Making sure the post-update `pos' in the while loop is less than the
-      % number of symbols in `string' enforces rule 1: The last symbol in
-      % a TeX string must not be '^' or '_'.
-      while pos+1 < length(string)
-         % Move one symbol further
-         pos = pos + 1;
-         % Enforce rule 7: No sub/superscript directly before '\it', '\bf',
-         %                 '\rm', or '\sl'.
-         if strcmp( string(pos), '\it' ) || strcmp( string(pos), '\bf' ) ...
-         || strcmp( string(pos), '\rm' ) || strcmp( string(pos), '\sl' )
-             continue
-         end
-         % Enforce rule 8: No sub/superscript directly after '\it', '\bf',
-         %                 '\rm', or '\sl'.
-         if (pos > 1)                           ...
-         && (    strcmp( string(pos-1), '\it' ) ...
-              || strcmp( string(pos-1), '\bf' ) ...
-              || strcmp( string(pos-1), '\rm' ) ...
-              || strcmp( string(pos-1), '\sl' ) ...
-            )
-             continue
-         end
-         bracedist = bracedist + 1;
-         % Enforce rule 4: No sub/superscript directly before '}'
-         if strcmp( string(pos), '}' )
-             bracedist = 0; % Also update braces distance
-             continue
-         end
-         % Enforce rule 5: No sub/superscript directly after '}'
-         if (pos > 1) && strcmp( string(pos-1), '}' )
-             continue
-         end
-         % Update distances for either braces or caret/underscore depending
-         % on whether the symbol currently under scrutiny is a brace or not.
-         if strcmp( string(pos), '{' )
-             bracedist = 0;
-         else
-             caretdist = caretdist + 1;
-             underscdist = underscdist + 1;
-         end
-         % Generate two random numbers, then check if any of them is low
-         % enough, so that with probability `subsupprob' a sub/superscript
-         % operator is inserted into `string' at the current position. In
-         % case both random numbers are below the threshold, whether a
-         % subscript or superscript operator is to be inserted depends on
-         % which of the two numbers is smaller.
-         randomnums = rand(1, 2);
-         if min(randomnums) < subsupprob
-             if randomnums(1) < randomnums(2)
-                 % Enforce rule 2b: There must be at least one non-brace
-                 % symbol between previous '_' and to-be-inserted '^'.
-                 if underscdist < 1
-                     continue
-                 end
-                 % Enforce rule 3a: There must either be at least two
-                 % non-brace, non-'_' symbols or at least one brace (opening
-                 % or closing) between any two '^'.
-                 if ~( ((caretdist >= 2) && (underscdist >= 2)) ...
-                       || ((bracedist < 2) && (caretdist >= 2)) )
-                     continue
-                 end
-                 % Insert '^' before `pos'th symbol in `string' now that
-                 % we've made sure all rules are honored.
-                 string = [ string(1:pos-1), {'^'}, string(pos:end) ];
-                 caretdist = 0;
-                 pos = pos + 1;
-             else
-                 % Enforce rule 2a: There must be at least one non-brace
-                 % symbol between previous '^' and to-be-inserted '_'.
-                 if caretdist < 1
-                     continue
-                 end
-                 % Enforce rule 3b: There must either be at least two
-                 % non-brace, non-'^' symbols or at least one brace (opening
-                 % or closing) between any two '_'.
-                 if ~( ((caretdist >= 2) && (underscdist >= 2)) ...
-                       || ((bracedist < 2) && (underscdist >= 2)) )
-                     continue
-                 end
-                 % Insert '_' before `pos'th symbol in `string' now that
-                 % we've made sure all rules are honored.
-                 string = [ string(1:pos-1), {'_'}, string(pos:end) ];
-                 underscdist = 0;
-                 pos = pos + 1;
-             end
-         end
-      end % while pos+1 < length(string)
-
-      % Now convert the cell string array of symbols into one regular string
-      string = [string{:}];
-      % Print the string in the figure to be converted by matlab2tikz
-      text( .05, ypos, string, 'interpreter', 'tex' )
-      % And print it to the console, too, in order to enable analysis of
-      % failed tests
-      fprintf( 'Original string: %s\n', string )
-  end
-
-  title('Random TeX symbols \\\{\}\_\^$%#&')
-end
-% =========================================================================
-function [stat] = latexmath1()
-  stat.description = 'A formula typeset using the \LaTeX{} interpreter.';
-
-  % Adapted from an example at
-  % http://www.mathworks.com/help/techdoc/ref/text_props.html#Interpreter
-  axes
-  title( '\omega\subseteq\Omega' );
-  text( 0.5, 0.5, '$$\int_0^x\!\int_{\Omega} dF(u,v) d\omega$$', ...
-        'Interpreter', 'latex',                   ...
-        'FontSize', 16                            )
-end
-% =========================================================================
-function [stat] = latexmath2()
-  stat.description = 'Some nice-looking formulas typeset using the \LaTeX{} interpreter.';
-
-  % Adapted from an example at
-  % http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#bq558_t
-  set(gcf, 'color', 'white')
-  set(gcf, 'units', 'inches')
-  set(gcf, 'position', [2 2 4 6.5])
-  set(gca, 'visible', 'off')
-
-  % Note: Most likely due to a bug in matlab2tikz the pgfplots output will
-  %       appear empty even though the LaTeX strings are contained in the
-  %       output file. This is because the following (or something like it)
-  %       is missing from the axis environment properties:
-  %       xmin=0, xmax=4, ymin=-1, ymax=6
-  % Note: The matrices in h(1) and h(2) cannot be compiled inside pgfplots.
-  %       They are therefore disabled.
-% h(1) = text( 'units', 'inch', 'position', [.2 5],                    ...
-%       'fontsize', 14, 'interpreter', 'latex', 'string',              ...
-%       [ '$$\hbox {magic(3) is } \left( {\matrix{ 8 & 1 & 6 \cr'      ...
-%         '3 & 5 & 7 \cr 4 & 9 & 2 } } \right)$$'                      ]);
-% h(2) = text( 'units', 'inch', 'position', [.2 4],                    ...
-%       'fontsize', 14, 'interpreter', 'latex', 'string',              ...
-%       [ '$$\left[ {\matrix{\cos(\phi) & -\sin(\phi) \cr'             ...
-%         '\sin(\phi) & \cos(\phi) \cr}} \right]'                      ...
-%         '\left[ \matrix{x \cr y} \right]$$'                          ]);
-  h(3) = text( 'units', 'inch', 'position', [.2 3],                    ...
-        'fontsize', 14, 'interpreter', 'latex', 'string',              ...
-        [ '$$L\{f(t)\}  \equiv  F(s) = \int_0^\infty\!\!{e^{-st}'      ...
-          'f(t)dt}$$'                                                  ]);
-  h(4) = text( 'units', 'inch', 'position', [.2 2],                    ...
-        'fontsize', 14, 'interpreter', 'latex', 'string',              ...
-        '$$e = \sum_{k=0}^\infty {1 \over {k!} } $$'                   );
-  h(5) = text( 'units', 'inch', 'position', [.2 1],                    ...
-        'fontsize', 14, 'interpreter', 'latex', 'string',              ...
-        [ '$$m \ddot y = -m g + C_D \cdot {1 \over 2}'                 ...
-          '\rho {\dot y}^2 \cdot A$$'                                  ]);
-  h(6) = text( 'units', 'inch', 'position', [.2 0],                    ...
-        'fontsize', 14, 'interpreter', 'latex', 'string',              ...
-        '$$\int_{0}^{\infty} x^2 e^{-x^2} dx = \frac{\sqrt{\pi}}{4}$$' );
-
-  % TODO: On processing the matlab2tikz_acidtest output, LaTeX complains
-  %       about the use of \over:
-  %         Package amsmath Warning: Foreign command \over;
-  %         (amsmath)                \frac or \genfrac should be used instead
-end
-% =========================================================================
-function [stat] = parameterCurve3d()
-  stat.description = 'Parameter curve in 3D.';
-
-  ezplot3('sin(t)','cos(t)','t',[0,6*pi]);
-  text(0.5, 0.5, 10, 'abs');
-end
-% =========================================================================
-function [stat] = parameterSurf()
-  stat.description = 'Parameter and surface plot.';
-
-  if ~exist('TriScatteredInterp')
-      fprintf( 'TriScatteredInterp() not found. Skipping.\n\n' );
-      stat.skip = true;
-      return;
-  end
-
-  t = (1:100).';
-  t1 = cos(5.75352*t).^2;
-  t2 = abs(sin(t));
-
-  x = t1*4 - 2;
-  y = t2*4 - 2;
-  z = x.*exp(-x.^2 - y.^2);
-
-  %TODO: do we really need this TriScatteredInterp?
-  % It will be removed from MATLAB
-
-  % Construct the interpolant
-  F = TriScatteredInterp(x,y,z,'linear');
-
-  % Evaluate the interpolant at the locations (qx, qy), qz
-  % is the corresponding value at these locations.
-  ti = -2:.25:2;
-  [qx,qy] = meshgrid(ti,ti);
-  qz = F(qx,qy);
-
-  hold on
-  surf(qx,qy,qz)
-  plot3(x,y,z,'o')
-  view(gca,[-69 14]);
-  hold off
-end
-% =========================================================================
-function [stat] = fill3plot()
-  stat.description = 'fill3 plot.';
-
-  if ~exist('fill3','builtin')
-      fprintf( 'fill3() not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  x1 = -10:0.1:10;
-  x2 = -10:0.1:10;
-  p = sin(x1);
-  d = zeros(1,numel(p));
-  d(2:2:end) = 1;
-  h = p.*d;
-  grid on;
-  fill3(x1,x2,h,'k');
-  view(45,22.5);
-  box on;
-end
-% =========================================================================
-function [stat] = rectanglePlot()
-  stat.description = 'Rectangle handle.';
-
-  rectangle('Position', [0.59,0.35,3.75,1.37],...
-            'Curvature', [0.8,0.4],...
-            'LineWidth', 2, ...
-            'LineStyle', '--' ...
-           );
-  daspect([1,1,1]);
-end
-% =========================================================================
-function [stat] = herrorbarPlot()
-  stat.description = 'herrorbar plot.';
-
-  hold on;
-  X = 1:10;
-  Y = 1:10;
-  err = repmat(0.2, 1, 10);
-  h1 = errorbar(X, Y, err, 'r');
-  h_vec = herrorbar(X, Y, err);
-  for h=h_vec
-      set(h, 'color', [1 0 0]);
-  end
-  h2 = errorbar(X, Y+1, err, 'g');
-  h_vec = herrorbar(X, Y+1, err);
-  for h=h_vec
-      set(h, 'color', [0 1 0]);
-  end
-  legend([h1 h2], {'test1', 'test2'})
-end
-% =========================================================================
-function [stat] = hist3d()
-  stat.description = '3D histogram plot.';
-
-  if ~exist('hist3','builtin') && isempty(which('hist3'))
-      fprintf( 'Statistics toolbox not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-%  load carbig
-%  X = [MPG,Weight];
-%  hist3(X,[7 7]);
-%  xlabel('MPG'); ylabel('Weight');
-%  set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');
-
-  load carbig
-  X = [MPG,Weight];
-  hist3(X,[7 7]);
-  xlabel('MPG'); ylabel('Weight');
-  hist3(X,[7 7],'FaceAlpha',.65);
-  xlabel('MPG'); ylabel('Weight');
-  % Linux crashed with OpenGL.
-  %%set(gcf,'renderer','opengl');
-
-%  load seamount
-%  dat = [-y,x]; % Grid corrected for negative y-values
-%  n = hist3(dat); % Extract histogram data;
-%                  % default to 10x10 bins
-%  view([-37.5, 30]);
-end
-% =========================================================================
-function [stat] = myBoxplot()
-  stat.description = 'Boxplot.';
-
-  if ~exist('boxplot','builtin') && isempty(which('boxplot'))
-      fprintf( 'Statistics toolbox not found. Skipping.\n\n' );
-      stat.skip = true;
-      return
-  end
-
-  errors =[
-     0.810000   3.200000   0.059500
-     0.762500  -3.200000   0.455500
-     0.762500   4.000000   0.901000
-     0.762500   3.600000   0.406000
-     0.192500   3.600000   0.307000
-     0.810000  -3.600000   0.604000
-     1.000000  -2.400000   0.505000
-     0.430000  -2.400000   0.455500
-     1.000000   3.200000   0.158500
-  ];
-
-  boxplot(errors);
-end
-% =========================================================================
-function [stat] = areaPlot()
-  stat.description = 'Area plot.';
-
-  M = magic(5);
-  M = M(1:3,2:4);
-  area(1:3, M);
-  legend('foo', 'bar', 'foobar');
-end
-% =========================================================================
-function [stat] = customLegend()
-  stat.description = 'Custom legend.';
-
-  x = -pi:pi/10:pi;
-  y = tan(sin(x)) - sin(tan(x));
-  plot(x,y,'--rs');
-
-  lh=legend('y',4);
-  set(lh,'color','g')
-  set(lh,'edgecolor','r')
-  set(lh, 'position',[.5 .6 .1 .05])
-end
-% =========================================================================
-function [stat] = pixelLegend()
-  stat.description = 'Legend with pixel position.';
-
-  x = linspace(0,1);
-  plot(x, [x;x.^2]);
-  set(gca, 'units', 'pixels')
-  lh=legend('1', '2');
-  set(lh, 'units','pixels','position', [100 200 65 42])
-end
-% =========================================================================
-function [stat] = croppedImage()
-  stat.description = 'Custom legend.';
-
-  if ~exist('flujet.mat','file')
-      fprintf( 'flujet data set not found. Skipping.\n\n' );
-      stat.skip = true;
-      return;
-  end
-
-  load('flujet','X','map');
-  image(X)
-  colormap(map)
-  %axis off
-  axis image
-  xlim([50 200])
-  ylim([50 200])
-  % colorbar at top
-  colorbar('north');
-  set(gca,'Units','normalized');
-end
-% =========================================================================
-function [stat] = pColorPlot()
-  stat.description = 'pcolor() plot.';
-
-  n = 6;
-  r = (0:n)'/n;
-  theta = pi*(-n:n)/n;
-  X = r*cos(theta);
-  Y = r*sin(theta);
-  C = r*cos(2*theta);
-  pcolor(X,Y,C)
-  axis equal tight
-end
-% =========================================================================
-function [stat] = multiplePatches()
-  stat.description = 'Multiple patches.';
-
-  xdata = [2     2     0     2     5;
-           2     8     2     4     5;
-           8     8     2     4     8];
-  ydata = [4     4     4     2     0;
-           8     4     6     2     2;
-           4     0     4     0     0];
-  cdata = [15     0     4     6    10;
-           1     2     5     7     9;
-           2     3     0     8     3];
-  p = patch(xdata,ydata,cdata,'Marker','o',...
-            'MarkerFaceColor','flat',...
-            'FaceColor','none');
-end
-% =========================================================================
-function [stat] = hgTransformPlot()
-  stat.description = 'hgtransform() plot.';
-
-  % Check out
-  % http://www.mathworks.de/de/help/matlab/ref/hgtransform.html.
-
-  ax = axes('XLim',[-2 1],'YLim',[-2 1],'ZLim',[-1 1]);
-  view(3);
-  grid on;
-  axis equal;
-
-  [x y z] = cylinder([.2 0]);
-  h(1) = surface(x,y,z,'FaceColor','red');
-  h(2) = surface(x,y,-z,'FaceColor','green');
-  h(3) = surface(z,x,y,'FaceColor','blue');
-  h(4) = surface(-z,x,y,'FaceColor','cyan');
-  h(5) = surface(y,z,x,'FaceColor','magenta');
-  h(6) = surface(y,-z,x,'FaceColor','yellow');
-
-  t1 = hgtransform('Parent',ax);
-  t2 = hgtransform('Parent',ax);
-
-  set(h,'Parent',t1);
-  h2 = copyobj(h,t2);
-
-  Txy = makehgtform('translate',[-1.5 -1.5 0]);
-  set(t2,'Matrix',Txy)
-  drawnow
-end
-% =========================================================================
-function [stat] = logbaseline()
-  stat.description = 'Logplot with modified baseline.';
-
-  bar([0 1 2], [1 1e-2 1e-5],'basevalue', 1e-6);
-  set(gca,'YScale','log');
-end
-% =========================================================================
-function [stat] = alphaImage()
-  stat.description = 'Image with alpha channel.';
-
-  N = 20;
-  h_imsc = imagesc(repmat(1:N, N, 1));
-  mask = zeros(N);
-  mask(N/4:3*N/4, N/4:3*N/4) = 1;
-  set(h_imsc, 'AlphaData', double(~mask));
-  set(h_imsc, 'AlphaDataMapping', 'scaled');
-  set(gca, 'ALim', [-1,1]);
-end
-% =========================================================================
-function [stat] = annotation1()
-
-  stat.description = 'Annotations only';
-
-  if ~exist('annotation')
-    fprintf( 'annotation() not found. Skipping.\n\n' );
-    stat.skip = true;
-    return;
-  end
-
-  annotation(gcf,'arrow',[0.192857142857143 0.55],...
-    [0.729952380952381 0.433333333333333]);
-
-  annotation(gcf,'ellipse',...
-    [0.538499999999999 0.240476190476191 0.157928571428572 0.2452380952381]);
-
-  annotation(gcf,'textbox',...
-    [0.3 0.348251748251748 0.0328486806677437 0.0517482517482517],...
-    'String',{'y-x'},...
-    'FontSize',16);
-end
-% =========================================================================
-function [stat] = annotation2()
-  stat.description = 'Annotations over plot';
-
-  if ~exist('annotation')
-    fprintf( 'annotation() not found. Skipping.\n\n' );
-    stat.skip = true;
-    return;
-  end
-
-  axes1 = axes('Parent',gcf);
-  hold(axes1,'all');
-
-  plot(0:pi/20:2*pi,sin(0:pi/20:2*pi))
-
-  annotation(gcf,'arrow',[0.192857142857143 0.55],...
-    [0.729952380952381 0.433333333333333]);
-
-  annotation(gcf,'ellipse',...
-    [0.538499999999999 0.240476190476191 0.157928571428572 0.2452380952381]);
-
-  annotation(gcf,'textbox',...
-    [0.3 0.348251748251748 0.0328486806677437 0.0517482517482517],...
-    'String',{'y-x'},...
-    'FontSize',16,...
-    'FitBoxToText','off',...
-    'LineStyle','none');
-end
-% =========================================================================
-function [stat] = annotation3()
-  stat.description = 'Annotated and unaligned subplots';
-
-  if ~exist('annotation')
-    fprintf( 'annotation() not found. Skipping.\n\n' );
-    stat.skip = true;
-    return;
-  end
-
-  X1 = 0:0.01:1;
-  Y1 = X1.^2;
-  Y2 = Y1.^2;
-  Y3 = X1.^(1/4);
-
-  set(gcf, 'Position', [100 100 1500 600]);
-
-  axes1 = axes('Parent',gcf, 'Position',[0.07 0.4015 0.2488 0.5146]);
-  box(axes1,'on');
-  hold(axes1,'all');
-
-  title('f(x)=x^2');
-
-  plot(X1,Y1,'Parent',axes1, 'DisplayName','(0:0.05:1).^2 vs 0:0.05:1');
-
-  axes2 = axes('Parent',gcf, 'OuterPosition',[0.4062 0 0.2765 0.6314]);
-  box(axes2,'on');
-  hold(axes2,'all');
-
-  plot(X1,Y2,'Parent',axes2,'DisplayName','(0:0.05:1).^4 vs 0:0.05:1');
-
-  axes3 = axes('Parent',gcf, 'Position',[0.7421 0.3185 0.21 0.5480]);
-  box(axes3,'on');
-  hold(axes3,'all');
-
-  plot(X1,Y3,'Parent',axes3,'DisplayName','(0:0.05:1).^(1/4) vs 0:0.05:1');
-
-  annotation(gcf,'textbox',[0.3667 0.5521 0.0124 0.0393], ...
-    'String',{'f^2'}, 'FitBoxToText','off');
-
-  annotation(gcf,'arrow',[0.3263 0.4281], [0.6606 0.3519]);
-
-  annotation(gcf,'textarrow',[0.6766 0.7229], [0.3108 0.6333],...
-    'TextEdgeColor','none', 'HorizontalAlignment','center', ...
-    'String',{'invert'});
-end
-% =========================================================================
-function [stat] = annotationText()
-  stat.description = 'Variations of textual annotations';
-
-  if ~exist('annotation')
-    fprintf( 'annotation() not found. Skipping.\n\n' );
-    stat.skip = true;
-    return;
-  end
-
-  X1 = -5:0.1:5;
-  Y1 = log(X1.^2+1);
-
-  % Resize figure to fit all text inside
-  set(gcf,'Position', [100 100 1000 700]);
-
-  % Otherwise the axes is plotted wrongly
-  drawnow();
-
-  % Create axes
-  axes1 = axes('Parent',gcf);
-  hold(axes1,'all');
-
-  % Create plot
-  plot(X1,Y1);
-
-  % Create text
-  text('Parent',axes1,'String',' \leftarrow some point on the curve',...
-    'Position',[-2.01811125485123 1.5988219895288 7.105427357601e-15]);
-
-  % Create text
-  text('Parent',axes1,'String','another point \rightarrow',...
-    'Position',[1 0.693147180559945 0],...
-    'HorizontalAlignment','right');
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.305611222444885 0.292803442287824 0.122244488977956 0.0942562592047128],...
-    'String',{'This boxes size','should adjust to','the text size'});
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.71643086172344 0.195876288659794 0.10020240480962 0.209240982129118],...
-    'String',{'Multiple Lines due to fixed width'},...
-    'FitBoxToText','off');
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.729456913827655 0.608247422680412 0.0851723446893787 0.104257797902974],...
-    'String',{'Overlapping','and italic'},...
-    'FontAngle','italic',...
-    'FitBoxToText','off',...
-    'BackgroundColor',[0.756862759590149 0.866666674613953 0.776470601558685]);
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.420000437011093 0.680170575692964 0.155149863590109 0.192171438527209],...
-    'VerticalAlignment','middle',...
-    'String',{'Text with a','thick and','dotted','border'},...
-    'HorizontalAlignment','center',...
-    'FitBoxToText','off',...
-    'LineStyle',':',...
-    'LineWidth',4);
-
-  % Create textarrow
-  annotation(gcf,'textarrow',[0.21943887775551 0.2625250501002],...
-    [0.371002132196162 0.235640648011782],'TextEdgeColor','none',...
-    'TextBackgroundColor',[0.678431391716003 0.921568632125854 1],...
-    'TextRotation',30,...
-    'VerticalAlignment','bottom',...
-    'HorizontalAlignment','center',...
-    'String',{'Rotated Text'});
-
-  % Create textarrow
-  annotation(gcf,'textarrow',[0.238436873747493 0.309619238476953],...
-    [0.604315828808828 0.524300441826215],'TextEdgeColor','none',...
-    'TextColor',[1 1 1],...
-    'TextBackgroundColor',[0 0 1],...
-    'TextRotation',30,...
-    'VerticalAlignment','bottom',...
-    'HorizontalAlignment','center',...
-    'String',{'Rotated Text 2'},...
-    'HeadStyle','diamond',...
-    'Color',[1 0 0]);
-end
-% =========================================================================
-function [stat] = annotationTextUnits()
-  stat.description = 'Text with changed Units';
-
-  if ~exist('annotation')
-    fprintf( 'annotation() not found. Skipping.\n\n' );
-    stat.skip = true;
-    return;
-  end
-
-  X1 = -5:0.1:5;
-  Y1 = log(X1.^2+1);
-
-  % Resize figure to fit all text inside
-  set(gcf,'Units', 'inches');
-  set(gcf,'Position', [1.03125, 1.03125, 10.416666666666666, 7.291666666666666 ]);
-
-  % Otherwise the axes is plotted wrongly
-  drawnow();
-
-  % Create axes
-  axes1 = axes('Parent',gcf,'Units','centimeters',...
-    'Position',[3.4369697916666664, 2.035743645833333 20.489627604166664 15.083009739583332]);
-  hold(axes1,'all');
-
-  % Create plot
-  plot(X1,Y1);
-
-  % Create text
-  text('Parent',axes1,'Units','normalized',...
-    'String',' \leftarrow some point on the curve',...
-    'Position',[0.295865633074935 0.457364341085271 0]);
-
-  % Create text
-  text('Parent',axes1,'Units','centimeters',...
-    'String','another point \rightarrow',...
-    'Position',[12.2673383333333 2.98751989583333 0],...
-    'HorizontalAlignment','right');
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.305611222444885 0.292803442287824 0.122244488977956 0.0942562592047128],...
-    'String',{'This boxes size','should adjust to','the text size'},...
-    'FitBoxToText','off',...
-    'Units','pixels');
-
-
-  % Create textarrow
-  annotation(gcf,'textarrow',[0.21943887775551 0.2625250501002],...
-    [0.371002132196162 0.235640648011782],'TextEdgeColor','none',...
-    'TextBackgroundColor',[0.678431391716003 0.921568632125854 1],...
-    'TextRotation',30,...
-    'HorizontalAlignment','center',...
-    'String',{'Rotated Text'},...
-    'Units','points');
-
-  % Create textarrow
-  annotation(gcf,'textarrow',[0.238436873747493 0.309619238476953],...
-    [0.604315828808828 0.524300441826215],'TextEdgeColor','none',...
-    'TextColor',[1 1 1],...
-    'TextBackgroundColor',[0 0 1],...
-    'TextRotation',30,...
-    'HorizontalAlignment','center',...
-    'String',{'Rotated Text 2'},...
-    'HeadStyle','diamond',...
-    'Color',[1 0 0]);
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.71643086172344 0.195876288659794 0.10020240480962 0.209240982129118],...
-    'String',{'Multiple Lines due to fixed width'},...
-    'FitBoxToText','off',...
-    'Units','characters');
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.420000437011093 0.680170575692964 0.155149863590109 0.192171438527209],...
-    'VerticalAlignment','middle',...
-    'String',{'Text with a','thick and','dotted','border'},...
-    'HorizontalAlignment','center',...
-    'FitBoxToText','off',...
-    'LineStyle',':',...
-    'LineWidth',4);
-
-  % Create textbox
-  annotation(gcf,'textbox',...
-    [0.729456913827655 0.608247422680412 0.0851723446893787 0.104257797902974],...
-    'String',{'Overlapping','and italic'},...
-    'FontAngle','italic',...
-    'FitBoxToText','off',...
-    'BackgroundColor',[0.756862759590149 0.866666674613953 0.776470601558685]);
-end
-% =========================================================================
-function [stat] = imageOrientation_inline()
-% Run test and save pictures as inline TikZ code
-    [stat] = imageOrientation(false);
-end
-function [stat] = imageOrientation_PNG()
-% Run test and save pictures as external PNGs
-    [stat] = imageOrientation(true);
-end
-function [stat] = imageOrientation(imagesAsPng)
-% Parameter 'imagesAsPng' is boolean
-    stat.description = ['Systematic test of different axis', ...
-      ' orientations and visibility (imagesAsPng = ', ...
-      num2str(imagesAsPng), ').'];
-    stat.extraOptions = {'imagesAsPng', imagesAsPng};
-
-    data = magic(3);
-
-    subplot(3,2,1);
-    imagesc(data);
-    set(gca,'XDir','normal');
-    xlabel('XDir normal');
-    set(gca,'YDir','normal');
-    ylabel('YDir normal');
-
-    subplot(3,2,2);
-    imagesc(data);
-    set(gca,'XDir','reverse');
-    xlabel('XDir reverse');
-    set(gca,'YDir','normal');
-    ylabel('YDir normal');
-
-    subplot(3,2,3);
-    imagesc(data);
-    set(gca,'XDir','normal');
-    xlabel('XDir normal');
-    set(gca,'YDir','reverse');
-    ylabel('YDir reverse');
-
-    subplot(3,2,4);
-    imagesc(data);
-    set(gca,'XDir','reverse');
-    xlabel('XDir reverse');
-    set(gca,'YDir','reverse');
-    ylabel('YDir reverse');
-
-    subplot(3,2,5);
-    imagesc(data);
-    set(gca,'XDir','normal');
-    xlabel('XDir normal');
-    set(gca,'YDir','reverse');
-    ylabel('YDir reverse');
-    axis off;
-    title('like above, but axis off');
-
-    subplot(3,2,6);
-    imagesc(data);
-    set(gca,'XDir','reverse');
-    xlabel('XDir reverse');
-    set(gca,'YDir','reverse');
-    ylabel('YDir reverse');
-    axis off;
-    title('like above, but axis off');
-end
-% =========================================================================
-function [stat] = texInterpreter()
-    stat.description = 'Combinations of tex commands';
-    axes
-    text(0.1,0.9, {'\bfBold text before \alpha and also afterwards.', 'Even the next line is bold \itand a bit italic.'});
-    text(0.1,0.75, {'Changing \bfthe\fontname{Courier} font or \color[rgb]{0,0.75,0}color doesn''t', 'change the style. Resetting \rmthe style', 'doesn''t change the font or color.'});
-    text(0.1,0.6, 'Styles can be {\bflimited} using \{ and \}.');
-    text(0.1,0.45, {'But what happens to the output if there is', '{\bfuse an \alpha inside} the limitted style.'});
-    text(0.1,0.3, 'Or if the\fontsize{14} size\color{red} and color are \fontsize{10}changed at different\color{blue} points.');
-    text(0.1,0.15, {'Also_{some \bf subscripts} and^{superscripts} are possible.', 'Without brackets, it l^o_oks like t_his.' });
-end
-% =========================================================================
-function [stat] = stackedBarsWithOther()
-  stat.description = 'stacked bar plots and other plots';
-  stat.issues = 442;
-
-  % dataset stacked
-  [data,dummy,summy] = svd(magic(7)); %#ok
-  Y = round(abs(data(2:6,2:4))*10);
-  n = size(Y,1);
-  xVals = (1:n).';
-  yVals = min((xVals).^2, sum(Y,2));
-
-  subplot(2,1,1); hold on;
-  bar(Y,'stack');
-  plot(xVals, yVals, 'Color', 'r', 'LineWidth', 2);
-  legend('show');
-
-  subplot(2,1,2); hold on;
-  b2 = barh(Y,'stack','BarWidth', 0.75);
-  plot(yVals, xVals, 'Color', 'b', 'LineWidth', 2);
-
-  set(b2(1),'FaceColor','c','EdgeColor','none')
-end
-% =========================================================================
-function [stat] = colorbarLabelTitle()
-    stat.description = 'colorbar with label and title';
-    stat.issues = 429;
-
-    % R2014b handles colorbars smart:  `XLabel` and `YLabel` merged into `Label`
-    % Use colormap 'jet' to create comparable output with MATLAB R2014b
-    % * Check horizontal/vertical colorbar (subplots)
-    % * Check if 'direction' is respected
-    % * Check if multiline label and title works
-    % * Check if latex interpreter works in label and title
-
-    subplot(1,2,1)
-    imagesc(magic(3));
-    hc = colorbar;
-    colormap('jet');
-    title(hc,'title $\beta$','Interpreter','latex');
-    ylabel(hc,'label $a^2$','Interpreter','latex');
-    set(hc,'YDir','reverse');
-
-    subplot(1,2,2)
-    label_multiline = {'first','second','third'};
-    title_multiline = {'title 1','title 2'};
-    imagesc(magic(3));
-    hc = colorbar('southoutside');
-    colormap('jet');
-    title(hc,title_multiline);
-    xlabel(hc,label_multiline);
-end
-% =========================================================================
-function env = getEnvironment
-  if ~isempty(ver('MATLAB'))
-     env = 'MATLAB';
-  elseif ~isempty(ver('Octave'))
-     env = 'Octave';
-  else
-     env = [];
-  end
-end
-% =========================================================================
-function [below, noenv] = isVersionBelow ( env, threshMajor, threshMinor )
-  % get version string for `env' by iterating over all toolboxes
-  versionData = ver;
-  versionString = '';
-  for k = 1:max(size(versionData))
-      if strcmp( versionData(k).Name, env )
-          % found it: store and exit the loop
-          versionString = versionData(k).Version;
-          break
-      end
-  end
-
-  if isempty( versionString )
-      % couldn't find `env'
-      below = true;
-      noenv = true;
-      return
-  end
-
-  majorVer = str2double(regexprep( versionString, '^(\d+)\..*', '$1' ));
-  minorVer = str2double(regexprep( versionString, '^\d+\.(\d+\.?\d*)[^\d]*.*', '$1' ));
-
-  if (majorVer < threshMajor) || (majorVer == threshMajor && minorVer < threshMinor)
-      % version of `env' is below threshold
-      below = true;
-  else
-      % version of `env' is same as or above threshold
-      below = false;
-  end
-  noenv = false;
-end
-% =========================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/README b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/README
deleted file mode 100644
index 0c2581a2b7a5424a6f7aa9b6b1bd2299c7f6a939..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/README
+++ /dev/null
@@ -1,27 +0,0 @@
-This test module is part of matlab2tikz.
-
-It provides the means for easily comparing the results of a direct PDF print of
-a figure in MATLAB as opposed to having it exported by matlab2tikz. As a matter
-of fact, this test suite can take any matlab2xxx-converter as argument (see
-step 2 below) with possibly minor modifications to the LaTeX file output.
-
-
- USAGE:
-=======
-  1. Open MATLAB, make matlab2tikz and matlab2tikz_acidtest available for
-     calling (by putting in the MATLAB Path,for example).
-
-  2. Call the script by
-
-        >> matlab2tikz_acidtest( 'testsuite', @ACID );
-
-     What happens is that MATLAB generates a number of figures as defined in
-     ACID.m, and exports them as PDF (using the print command) and by
-     matlab2tikz.
-     At the same time, a LaTeX file is created in the tex-subfolder.
-
-  3. You can compile 'tex/acid.tex' with 'make' (making use of 'tex/Makefile').
-
-If all goes well, the result will be the file 'tex/acid.pdf' which contains a
-list of the test figures, exported as PDF and right next to it the matlab2tikz
-generated plot.
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/codeReport.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/codeReport.m
deleted file mode 100644
index a97c09a0cf88eb6af626de58b409d0338fef0b12..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/codeReport.m
+++ /dev/null
@@ -1,268 +0,0 @@
-function [ report ] = codeReport( varargin )
-%CODEREPORT Builds a report of the code health
-%
-% This function generates a Markdown report on the code health. At the moment
-% this is limited to the McCabe (cyclomatic) complexity of a function and its
-% subfunctions.
-%
-% This makes use of |checkcode| in MATLAB.
-%
-% Usage:
-%
-%   CODEREPORT('function', functionName) to determine which function is
-%   analyzed. (default: matlab2tikz)
-%
-%   CODEREPORT('complexityThreshold', integer ) to set above which complexity, a
-%   function is added to the report (default: 10)
-%
-% See also: checkcode, mlint,
-
-
-    %% input options
-    ipp = m2tInputParser();
-    ipp = ipp.addParamValue(ipp, 'function', 'matlab2tikz', @ischar);
-    ipp = ipp.addParamValue(ipp, 'complexityThreshold', 10, @isnumeric);
-    ipp = ipp.parse(ipp, varargin{:});
-
-    %% generate report data
-    data = checkcode(ipp.Results.function,'-cyc','-struct');
-    [complexityAll, mlintMessages] = splitCycloComplexity(data);
-
-    %% analyze cyclomatic complexity
-    categorizeComplexity = @(x) categoryOfComplexity(x, ...
-                                 ipp.Results.complexityThreshold, ...
-                                 ipp.Results.function);
-
-    complexityAll = arrayfun(@parseCycloComplexity, complexityAll);
-    complexityAll = arrayfun(categorizeComplexity, complexityAll);
-
-    complexity = filter(complexityAll, @(x) strcmpi(x.category, 'Bad'));
-    complexity = sortBy(complexity, 'line', 'ascend');
-    complexity = sortBy(complexity, 'complexity', 'descend');
-
-    [complexityStats] = complexityStatistics(complexityAll);
-
-    %% analyze other messages
-    %TODO: handle all mlint messages and/or other metrics of the code
-
-    %% format report
-    dataStr = complexity;
-    dataStr = arrayfun(@(d) mapField(d, 'function',  @markdownInlineCode), dataStr);
-    if ~isempty(dataStr)
-        dataStr = addFooterRow(dataStr, 'complexity', @sum, {'line',0, 'function',bold('Total')});
-    end
-    dataStr = arrayfun(@(d) mapField(d, 'line',         @integerToString), dataStr);
-    dataStr = arrayfun(@(d) mapField(d, 'complexity',   @integerToString), dataStr);
-
-    report = makeTable(dataStr, {'function', 'complexity'}, ...
-                                {'Function', 'Complexity'});
-
-    %% command line usage
-    if nargout == 0
-        disp(codelinks(report, ipp.Results.function));
-
-        figure('name',sprintf('Complexity statistics of %s', ipp.Results.function));
-        h = statisticsPlot(complexityStats, 'Complexity', 'Number of functions');
-        for hh = h
-            plot(hh, [1 1]*ipp.Results.complexityThreshold, ylim(hh), ...
-                 'k--','DisplayName','Threshold');
-        end
-        legend(h(1),'show','Location','NorthEast');
-
-        clear report
-    end
-
-end
-%% CATEGORIZATION ==============================================================
-function [complexity, others] = splitCycloComplexity(list)
-% splits codereport into McCabe complexity and others
-    filter = @(l) ~isempty(strfind(l.message, 'McCabe complexity'));
-    idxComplexity = arrayfun(filter, list);
-    complexity = list( idxComplexity);
-    others     = list(~idxComplexity);
-end
-function [data] = categoryOfComplexity(data, threshold, mainFunc)
-% categorizes the complexity as "Good", "Bad" or "Accepted"
-  TOKEN = '#COMPLEX'; % token to signal allowed complexity
-
-  try %#ok
-    helpStr = help(sprintf('%s>%s', mainFunc, data.function));
-    if ~isempty(strfind(helpStr, TOKEN))
-        data.category = 'Accepted';
-        return;
-    end
-  end
-  if data.complexity > threshold
-      data.category = 'Bad';
-  else
-      data.category = 'Good';
-  end
-end
-
-%% PARSING =====================================================================
-function [out] = parseCycloComplexity(in)
-% converts McCabe complexity report strings into a better format
-    out = regexp(in.message, ...
-                 'The McCabe complexity of ''(?<function>[A-Za-z0-9_]+)'' is (?<complexity>[0-9]+).', ...
-                 'names');
-    out.complexity = str2double(out.complexity);
-    out.line = in.line;
-end
-
-%% DATA PROCESSING =============================================================
-function selected = filter(list, filterFunc)
-% filters an array according to a binary function
-    idx = logical(arrayfun(filterFunc, list));
-    selected = list(idx);
-end
-function [data] = mapField(data, field, mapping)
-    data.(field) = mapping(data.(field));
-end
-function sorted = sortBy(list, fieldName, mode)
-% sorts a struct array by a single field
-% extra arguments are as for |sort|
-    values = arrayfun(@(m)m.(fieldName), list);
-    [dummy, idxSorted] = sort(values(:), 1, mode); %#ok
-    sorted = list(idxSorted);
-end
-
-function [stat] = complexityStatistics(list)
-% calculate some basic statistics of the complexities
-
-    stat.values     = arrayfun(@(c)(c.complexity), list);
-    stat.binCenter  = sort(unique(stat.values));
-
-    categoryPerElem = {list.category};
-    stat.categories = unique(categoryPerElem);
-    nCategories = numel(stat.categories);
-
-    groupedHist = zeros(numel(stat.binCenter), nCategories);
-    for iCat = 1:nCategories
-        category = stat.categories{iCat};
-        idxCat = ismember(categoryPerElem, category);
-        groupedHist(:,iCat) = hist(stat.values(idxCat), stat.binCenter);
-    end
-
-    stat.histogram  = groupedHist;
-    stat.median     = median(stat.values);
-end
-function [data] = addFooterRow(data, column, func, otherFields)
-% adds a footer row to data table based on calculations of a single column
-footer = data(end);
-for iField = 1:2:numel(otherFields)
-    field = otherFields{iField};
-    value = otherFields{iField+1};
-    footer.(field) = value;
-end
-footer.(column) = func([data(:).(column)]);
-data(end+1) = footer;
-end
-
-%% FORMATTING ==================================================================
-function str = integerToString(value)
-% convert integer to string
-    str = sprintf('%d',value);
-end
-function str = markdownInlineCode(str)
-% format as inline code for markdown
-    str = sprintf('`%s`', str);
-end
-function str = makeTable(data, fields, header)
-% make a markdown table from struct array
-    nData = numel(data);
-    str = '';
-    if nData == 0
-        return; % empty input
-    end
-
-    % determine column sizes
-    nFields = numel(fields);
-    table = cell(nFields, nData);
-    columnWidth = zeros(1,nFields);
-    for iField = 1:nFields
-        field = fields{iField};
-        table(iField, :) = {data(:).(field)};
-        columnWidth(iField) = max(cellfun(@numel, table(iField, :)));
-    end
-    columnWidth = max(columnWidth, cellfun(@numel, header));
-    columnWidth = columnWidth + 2; % empty space left and right
-    columnWidth([1,end]) = columnWidth([1,end]) - 1; % except at the edges
-
-    % format table inside cell array
-    table = [header; table'];
-    for iField = 1:nFields
-        FORMAT = ['%' int2str(columnWidth(iField)) 's'];
-
-        for jData = 1:size(table, 1)
-            table{jData, iField} = strjust(sprintf(FORMAT, ...
-                                           table{jData, iField}), 'center');
-        end
-    end
-
-    % insert separator
-    table = [table(1,:)
-             arrayfun(@(n) repmat('-',1,n), columnWidth, 'UniformOutput',false)
-             table(2:end,:)]';
-
-    % convert cell array to string
-    FORMAT = ['%s' repmat('|%s', 1,nFields-1) '\n'];
-    str = sprintf(FORMAT, table{:});
-
-end
-
-function str = codelinks(str, functionName)
-% replaces inline functions with clickable links in MATLAB
-str = regexprep(str, '`([A-Za-z0-9_]+)`', ...
-                ['`<a href="matlab:edit ' functionName '>$1">$1</a>`']);
-%NOTE: editing function>subfunction will focus on that particular subfunction
-% in the editor (this also works for the main function)
-end
-function str = bold(str)
-str = ['**' str '**'];
-end
-
-%% PLOTTING ====================================================================
-function h = statisticsPlot(stat, xLabel, yLabel)
-% plot a histogram and box plot
-    nCategories = numel(stat.categories);
-    colors = colorscheme;
-
-    h(1) = subplot(5,1,1:4);
-    hold all;
-    hb = bar(stat.binCenter, stat.histogram, 'stacked');
-
-    for iCat = 1:nCategories
-        category = stat.categories{iCat};
-
-        set(hb(iCat), 'DisplayName', category, 'FaceColor', colors.(category), ...
-                   'LineStyle','none');
-    end
-
-    %xlabel(xLabel);
-    ylabel(yLabel);
-
-    h(2) = subplot(5,1,5);
-    hold all;
-
-    boxplot(stat.values,'orientation','horizontal',...
-                        'boxstyle',   'outline', ...
-                        'symbol',     'o', ...
-                        'colors',  colors.All);
-    xlabel(xLabel);
-
-    xlims = [min(stat.binCenter)-1 max(stat.binCenter)+1];
-    c     = 1;
-    ylims = (ylim(h(2)) - c)/3 + c;
-
-    set(h,'XTickMode','manual','XTick',stat.binCenter,'XLim',xlims);
-    set(h(1),'XTickLabel','');
-    set(h(2),'YTickLabel','','YLim',ylims);
-    linkaxes(h, 'x');
-end
-function colors = colorscheme()
-% recognizable color scheme for the categories
- colors.All      = [  0 113 188]/255;
- colors.Good     = [118 171  47]/255;
- colors.Bad      = [161  19  46]/255;
- colors.Accepted = [236 176  31]/255;
-end
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/data/converted/Makefile b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/data/converted/Makefile
deleted file mode 100644
index 2bab3eb52928ab795797d1583f5b2718bb81519e..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/data/converted/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# ./Makefile
-
-ECHOCMD:=/bin/echo -e
-LATEX:=lualatex --shell-escape -interaction=batchmode
-
-TEST_SRCS:=$(wildcard test*-converted.tex)
-TEST_PDFS:=$(TEST_SRCS:.tex=.pdf)
-
-default: $(TEST_PDFS)
-
-%.pdf: %.tex
-	@$(LATEX) $<
-
-.PHONY: clean
-
-clean:
-	rm -f test*-converted.aux \
-		test*-converted.log \
-		test*-converted.pdf
-
-distclean: clean
-	rm -f test*-converted.tex \
-		test*-converted*.png
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/data/reference/Makefile b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/data/reference/Makefile
deleted file mode 100644
index 1c39facf8e114337bfc42cc783f7a39f75fce46a..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/data/reference/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# ./Makefile
-
-EPSTOPDF:=epstopdf
-
-REFERENCE_EPSS:=$(wildcard test*-reference.eps)
-REFERENCE_PDFS:=$(REFERENCE_EPSS:.eps=.pdf)
-
-default: $(REFERENCE_PDFS)
-
-%.pdf: %.eps
-	$(EPSTOPDF) $<
-
-.PHONY: clean
-
-clean:
-	rm -f test*-reference.pdf
-
-distclean: clean
-	rm -f test*-reference.eps
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/herrorbar.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/herrorbar.m
deleted file mode 100644
index 71320285151499540a657c6de90f6442c7f0e1c3..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/herrorbar.m
+++ /dev/null
@@ -1,152 +0,0 @@
-function hh = herrorbar(x, y, l, u, symbol)
-%HERRORBAR Horizontal Error bar plot.
-%   HERRORBAR(X,Y,L,R) plots the graph of vector X vs. vector Y with
-%   horizontal error bars specified by the vectors L and R. L and R contain the
-%   left and right error ranges for each point in X. Each error bar
-%   is L(i) + R(i) long and is drawn a distance of L(i) to the right and R(i)
-%   to the right the points in (X,Y). The vectors X,Y,L and R must all be
-%   the same length. If X,Y,L and R are matrices then each column
-%   produces a separate line.
-%
-%   HERRORBAR(X,Y,E) or HERRORBAR(Y,E) plots X with error bars [X-E X+E].
-%   HERRORBAR(...,'LineSpec') uses the color and linestyle specified by
-%   the string 'LineSpec'. See PLOT for possibilities.
-%
-%   H = HERRORBAR(...) returns a vector of line handles.
-%
-%   Example:
-%      x = 1:10;
-%      y = sin(x);
-%      e = std(y)*ones(size(x));
-%      herrorbar(x,y,e)
-%   draws symmetric horizontal error bars of unit standard deviation.
-%
-%   This code is based on ERRORBAR provided in MATLAB.
-%
-%   See also ERRORBAR
-
-%   Jos van der Geest
-%   email: jos@jasen.nl
-%
-%   File history:
-%   August 2006 (Jos): I have taken back ownership. I like to thank Greg Aloe from
-%   The MathWorks who originally introduced this piece of code to the
-%   Matlab File Exchange.
-%   September 2003 (Greg Aloe): This code was originally provided by Jos
-%   from the newsgroup comp.soft-sys.matlab:
-%   http://newsreader.mathworks.com/WebX?50@118.fdnxaJz9btF^1@.eea3ff9
-%   After unsuccessfully attempting to contact the orignal author, I
-%   decided to take ownership so that others could benefit from finding it
-%   on the MATLAB Central File Exchange.
-
-if min(size(x))==1,
-    npt = length(x);
-    x = x(:);
-    y = y(:);
-    if nargin > 2,
-        if ~ischar(l),
-            l = l(:);
-        end
-        if nargin > 3
-            if ~ischar(u)
-                u = u(:);
-            end
-        end
-    end
-else
-    [npt,n] = size(x);
-end
-
-if nargin == 3
-    if ~ischar(l)
-        u = l;
-        symbol = '-';
-    else
-        symbol = l;
-        l = y;
-        u = y;
-        y = x;
-        [m,n] = size(y);
-        x(:) = (1:npt)'*ones(1,n);;
-    end
-end
-
-if nargin == 4
-    if ischar(u),
-        symbol = u;
-        u = l;
-    else
-        symbol = '-';
-    end
-end
-
-if nargin == 2
-    l = y;
-    u = y;
-    y = x;
-    [m,n] = size(y);
-    x(:) = (1:npt)'*ones(1,n);;
-    symbol = '-';
-end
-
-u = abs(u);
-l = abs(l);
-
-if ischar(x) | ischar(y) | ischar(u) | ischar(l)
-    error('Arguments must be numeric.')
-end
-
-if ~isequal(size(x),size(y)) | ~isequal(size(x),size(l)) | ~isequal(size(x),size(u)),
-    error('The sizes of X, Y, L and U must be the same.');
-end
-
-tee = (max(y(:))-min(y(:)))/100; % make tee .02 x-distance for error bars
-% changed from errorbar.m
-xl = x - l;
-xr = x + u;
-ytop = y + tee;
-ybot = y - tee;
-n = size(y,2);
-% end change
-
-% Plot graph and bars
-hold_state = ishold;
-cax = newplot;
-next = lower(get(cax,'NextPlot'));
-
-% build up nan-separated vector for bars
-% changed from errorbar.m
-xb = zeros(npt*9,n);
-xb(1:9:end,:) = xl;
-xb(2:9:end,:) = xl;
-xb(3:9:end,:) = NaN;
-xb(4:9:end,:) = xl;
-xb(5:9:end,:) = xr;
-xb(6:9:end,:) = NaN;
-xb(7:9:end,:) = xr;
-xb(8:9:end,:) = xr;
-xb(9:9:end,:) = NaN;
-
-yb = zeros(npt*9,n);
-yb(1:9:end,:) = ytop;
-yb(2:9:end,:) = ybot;
-yb(3:9:end,:) = NaN;
-yb(4:9:end,:) = y;
-yb(5:9:end,:) = y;
-yb(6:9:end,:) = NaN;
-yb(7:9:end,:) = ytop;
-yb(8:9:end,:) = ybot;
-yb(9:9:end,:) = NaN;
-% end change
-
-
-[ls,col,mark,msg] = colstyle(symbol); if ~isempty(msg), error(msg); end
-symbol = [ls mark col]; % Use marker only on data part
-esymbol = ['-' col]; % Make sure bars are solid
-
-h = plot(xb,yb,esymbol); hold on
-h = [h;plot(x,y,symbol)];
-
-if ~hold_state, hold off; end
-
-if nargout>0, hh = h; end
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/issues.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/issues.m
deleted file mode 100644
index e6a9fd006cd63d013ee16547c15eca3baf396d6f..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/issues.m
+++ /dev/null
@@ -1,43 +0,0 @@
-function [ status ] = issues( k )
-%ISSUES M2T Test cases related to issues
-%
-% Issue-related test cases for matlab2tikz
-%
-% See also: ACID, matlab2tikz_acidtest
-  testfunction_handles = {
-                           @scatter3Plot3
-                         };
-
-  numFunctions = length( testfunction_handles );
-
-  if (k<=0)
-      status = testfunction_handles;
-      return;  % This is used for querying numFunctions.
-
-  elseif (k<=numFunctions)
-      status = testfunction_handles{k}();
-      status.function = func2str(testfunction_handles{k});
-
-  else
-      error('issues:outOfBounds', ...
-            'Out of bounds (number of testfunctions=%d)', numFunctions);
-  end
-  
-end
-
-% =========================================================================
-function [stat] = scatter3Plot3()
-  stat.description = 'Scatter3 plot with 2 colors';
-  stat.issues = 292;
-  
-  hold on;
-  x = sin(1:5);
-  y = cos(3.4 *(1:5));
-  z = x.*y;
-  scatter3(x,y,z,150,...
-           'MarkerEdgeColor','none','MarkerFaceColor','k');
-  scatter3(-x,y,z,150,...
-           'MarkerEdgeColor','none','MarkerFaceColor','b');
-end
-
-% =========================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/matlab2tikz_acidtest.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/matlab2tikz_acidtest.m
deleted file mode 100644
index ae4324ff2231be9d25ab9534310c0d75d3761538..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/matlab2tikz_acidtest.m
+++ /dev/null
@@ -1,609 +0,0 @@
-function matlab2tikz_acidtest(varargin)
-%MATLAB2TIKZ_ACIDTEST    unit test driver for matlab2tikz
-%
-% MATLAB2TIKZ_ACIDTEST('testFunctionIndices', INDICES, ...) or
-%   MATLAB2TIKZ_ACIDTEST(INDICES, ...) runs the test only for the specified
-%   indices. When empty, all tests are run. (Default: []).
-%
-% MATLAB2TIKZ_ACIDTEST('extraOptions', {'name',value, ...}, ...)
-%   passes the cell array of options to MATLAB2TIKZ. Default: {}
-%
-% MATLAB2TIKZ_ACIDTEST('figureVisible', LOGICAL, ...)
-%   plots the figure visibly during the test process. Default: false
-%
-% MATLAB2TIKZ_ACIDTEST('cleanBefore', LOGICAL, ...)
-%   tries to run "make clean" in the ./tex folder. Default: true
-%
-% MATLAB2TIKZ_ACIDTEST('testsuite', FUNCTION_HANDLE, ...)
-%   Determines which test suite is to be run. Default: @ACID
-%   A test suite is a function that takes a single integer argument, which:
-%     when 0: returns a cell array containing the N function handles to the tests
-%     when >=1 and <=N: runs the appropriate test function
-%     when >N: throws an error
-%
-% See also matlab2tikz, ACID
-
-% Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
-% All rights reserved.
-%
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are met:
-%
-%    * Redistributions of source code must retain the above copyright
-%      notice, this list of conditions and the following disclaimer.
-%    * Redistributions in binary form must reproduce the above copyright
-%      notice, this list of conditions and the following disclaimer in
-%      the documentation and/or other materials provided with the distribution
-%
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
-%
-% =========================================================================
-
-  % In which environment are we?
-  env = getEnvironment();
-  if ~strcmp(env, 'MATLAB') && ~strcmp(env, 'Octave')
-      error('Unknown environment. Need MATLAB(R) or GNU Octave.')
-  end
-
-
-  % -----------------------------------------------------------------------
-  ipp = m2tInputParser;
-
-  ipp = ipp.addOptional(ipp, 'testFunctionIndices', [], @isfloat);
-  ipp = ipp.addParamValue(ipp, 'extraOptions', {}, @iscell);
-  ipp = ipp.addParamValue(ipp, 'figureVisible', false, @islogical);
-  ipp = ipp.addParamValue(ipp, 'testsuite', @ACID, @(x)(isa(x,'function_handle')));
-  ipp = ipp.addParamValue(ipp, 'cleanBefore', true, @islogical);
-
-  ipp = ipp.parse(ipp, varargin{:});
-  % -----------------------------------------------------------------------
-
-  testsuite = ipp.Results.testsuite;
-  testsuiteName = func2str(testsuite);
-
-  % try to clean the output
-  cleanFiles(ipp.Results.cleanBefore);
-
-  % first, initialize the tex output
-  texfile = 'tex/acid.tex';
-  fh = fopen(texfile, 'w');
-  assert(fh ~= -1, 'Could not open TeX file ''%s'' for writing.', texfile);
-  texfile_init(fh);
-
-  % output streams
-  stdout = 1;
-  if strcmp(env, 'Octave') && ~ipp.Results.figureVisible
-      % Use the gnuplot backend to work around an fltk bug, see
-      % <http://savannah.gnu.org/bugs/?43429>.
-      graphics_toolkit gnuplot
-  end
-
-  % query the number of test functions
-  n = length(testsuite(0));
-
-  defaultStatus = emptyStatus();
-
-  if ~isempty(ipp.Results.testFunctionIndices)
-      indices = ipp.Results.testFunctionIndices;
-      % kick out the illegal stuff
-      I = find(indices>=1 & indices<=n);
-      indices = indices(I); %#ok
-  else
-      indices = 1:n;
-  end
-
-  % start overall timing
-  elapsedTimeOverall = tic;
-
-  errorHasOccurred = false;
-
-  % cell array to accomodate different structure
-  status = cell(length(indices), 1);
-
-  for k = 1:length(indices)
-      fprintf(stdout, 'Executing %s test no. %d...\n', testsuiteName, indices(k));
-
-      % open a window
-      fig_handle = figure('visible',onOffBoolean(ipp.Results.figureVisible));
-
-      % plot the figure
-      try
-          status{k} = testsuite(indices(k));
-
-      catch %#ok
-          e = lasterror('reset'); %#ok
-
-          status{k}.description = '\textcolor{red}{Error during plot generation.}';
-          if isempty(status{k}) || ~isfield(status{k}, 'function') ...
-                  || isempty(status{k}.function)
-              status{k}.function = extractFunctionFromError(e, testsuite);
-          end
-
-          [status{k}.plotStage, errorHasOccurred] = errorHandler(e, env);
-      end
-
-      status{k} = fillStruct(status{k}, defaultStatus);
-
-      % plot not successful
-      if status{k}.skip
-          close(fig_handle);
-          continue
-      end
-
-      reference_eps = sprintf('data/reference/test%d-reference.eps', indices(k));
-      reference_pdf = sprintf('data/reference/test%d-reference.pdf', indices(k));
-      reference_fig = sprintf('data/reference/test%d-reference', indices(k));
-      gen_tex = sprintf('data/converted/test%d-converted.tex', indices(k));
-      gen_pdf  = sprintf('data/converted/test%d-converted.pdf', indices(k));
-
-      elapsedTime = tic;
-
-      % Save reference output as PDF
-      try
-          switch env
-              case 'MATLAB'
-                  % MATLAB does not generate properly cropped PDF files.
-                  % So, we generate EPS files that are converted later on.
-                  print(gcf, '-depsc2', reference_eps);
-
-                  % On R2014b Win, line endings in .eps are Unix style
-                  % https://github.com/matlab2tikz/matlab2tikz/issues/370
-                  ensureLineEndings(reference_eps);
-
-              case 'Octave'
-                  % In Octave, figures are properly cropped when using  print().
-                  print(reference_pdf, '-dpdf', '-S415,311', '-r150');
-                  pause(1.0)
-              otherwise
-                  error('Unknown environment. Need MATLAB(R) or GNU Octave.')
-          end
-      catch %#ok
-          e = lasterror('reset'); %#ok
-          [status{k}.saveStage, errorHasOccurred] = errorHandler(e, env);
-      end
-      % now, test matlab2tikz
-      try
-          cleanfigure(status{k}.extraCleanfigureOptions{:});
-          matlab2tikz('filename', gen_tex, ...
-                      'showInfo', false, ...
-                      'checkForUpdates', false, ...
-                      'dataPath', 'data/converted/', ...
-                      'standalone', true, ...
-                      ipp.Results.extraOptions{:}, ...
-                      status{k}.extraOptions{:} ...
-                     );
-      catch %#ok
-          e = lasterror('reset'); %#ok
-          % Remove (corrupted) output file. This is necessary to avoid that the
-          % Makefile tries to compile it and fails.
-          delete(gen_tex)
-          [status{k}.tikzStage, errorHasOccurred] = errorHandler(e, env);
-      end
-
-      % ...and finally write the bits to the LaTeX file
-      texfile_addtest(fh, reference_fig, gen_pdf, status{k}, indices(k), testsuiteName);
-
-      if ~status{k}.closeall
-          close(fig_handle);
-      else
-          close all;
-      end
-
-      elapsedTime = toc(elapsedTime);
-      fprintf(stdout, '%s ', status{k}.function);
-      fprintf(stdout, 'done (%4.2fs).\n\n', elapsedTime);
-  end
-
-  % Write the summary table to the LaTeX file
-  texfile_tab_completion_init(fh)
-  for k = 1:length(indices)
-      stat = status{k};
-      % Break table up into pieces if it gets too long for one page
-      if ~mod(k,35)
-          texfile_tab_completion_finish(fh);
-          texfile_tab_completion_init(fh);
-      end
-
-      fprintf(fh, '%d & \\texttt{%s}', indices(k), name2tex(stat.function));
-      if stat.skip
-          fprintf(fh, ' & --- & skipped & ---');
-      else
-          for err = [stat.plotStage.error, ...
-                     stat.saveStage.error, ...
-                     stat.tikzStage.error]
-              if err
-                  fprintf(fh, ' & \\textcolor{red}{failed}');
-              else
-                  fprintf(fh, ' & \\textcolor{green!50!black}{passed}');
-              end
-          end
-      end
-      fprintf(fh, ' \\\\\n');
-  end
-  texfile_tab_completion_finish(fh);
-
-  % Write the error messages to the LaTeX file if there are any
-  if errorHasOccurred
-      fprintf(fh, '\\section*{Error messages}\n\\scriptsize\n');
-      for k = 1:length(indices)
-          stat = status{k};
-          if isempty(stat.plotStage.message) && ...
-             isempty(stat.saveStage.message) && ...
-             isempty(stat.tikzStage.message)
-              continue % No error messages for this test case
-          end
-
-          fprintf(fh, '\n\\subsection*{Test case %d: \\texttt{%s}}\n', indices(k), name2tex(stat.function));
-          print_verbatim_information(fh, 'Plot generation', stat.plotStage.message);
-          print_verbatim_information(fh, 'PDF generation' , stat.saveStage.message);
-          print_verbatim_information(fh, 'matlab2tikz'    , stat.tikzStage.message);
-      end
-      fprintf(fh, '\n\\normalsize\n\n');
-  end
-
-  % now, finish off the file and close file and window
-  texfile_finish(fh, testsuite);
-  fclose(fh);
-
-  % print out overall timing
-  elapsedTimeOverall = toc(elapsedTimeOverall);
-  fprintf(stdout, 'overall time: %4.2fs\n\n', elapsedTimeOverall);
-
-end
-% =========================================================================
-function cleanFiles(cleanBefore)
-% clean output files in ./tex using make
-    if cleanBefore && exist(fullfile('tex','Makefile'),'file')
-        fprintf(1, 'Cleaning output files...\n');
-        cwd = pwd;
-        try
-            cd('tex');
-            [exitCode, output] = system('make distclean');
-            fprintf(1,'%s\n', output);
-            assert(exitCode==0, 'Exit code 0 means correct execution');
-        catch
-            % This might happen when make is not present
-            fprintf(2, '\tNot completed succesfully\n\n');
-        end
-        cd(cwd);
-    end
-end
-% =========================================================================
-function texfile_init(texfile_handle)
-
-  fprintf(texfile_handle, ...
-           ['\\documentclass[landscape]{scrartcl}\n'                , ...
-            '\\pdfminorversion=6\n\n'                               , ...
-            '\\usepackage{amsmath} %% required for $\\text{xyz}$\n\n', ...
-            '\\usepackage{hyperref}\n'                              , ...
-            '\\usepackage{graphicx}\n'                              , ...
-            '\\usepackage{epstopdf}\n'                              , ...
-            '\\usepackage{tikz}\n'                                  , ...
-            '\\usetikzlibrary{plotmarks}\n\n'                       , ...
-            '\\usepackage{pgfplots}\n'                              , ...
-            '\\pgfplotsset{compat=newest}\n\n'                      , ...
-            '\\usepackage[margin=0.5in]{geometry}\n'                , ...
-            '\\newlength\\figurewidth\n'                            , ...
-            '\\setlength\\figurewidth{0.4\\textwidth}\n\n'          , ...
-            '\\begin{document}\n\n']);
-
-end
-% =========================================================================
-function texfile_finish(texfile_handle, testsuite)
-
-  [env,versionString] = getEnvironment();
-
-
-  fprintf(texfile_handle, ...
-      [
-      '\\newpage\n',...
-      '\\begin{tabular}{ll}\n',...
-      '  Suite    & ' name2tex(func2str(testsuite)) ' \\\\ \n', ...
-      '  Created  & ' datestr(now) ' \\\\ \n', ...
-      '  OS       & ' OSVersion ' \\\\ \n',...
-      '  ' env '  & ' versionString ' \\\\ \n', ...
-      VersionControlIdentifier, ...
-      '  TikZ     & \\expandafter\\csname ver@tikz.sty\\endcsname \\\\ \n',...
-      '  Pgfplots & \\expandafter\\csname ver@pgfplots.sty\\endcsname \\\\ \n',...
-      '\\end{tabular}\n',...
-      '\\end{document}']);
-
-end
-% =========================================================================
-function print_verbatim_information(texfile_handle, title, contents)
-    if ~isempty(contents)
-        fprintf(texfile_handle, ...
-                ['\\subsubsection*{%s}\n', ...
-                 '\\begin{verbatim}\n%s\\end{verbatim}\n'], ...
-                title, contents);
-    end
-end
-% =========================================================================
-function texfile_addtest(texfile_handle, ref_file, gen_tex, status, funcId, testsuiteName)
-  % Actually add the piece of LaTeX code that'll later be used to display
-  % the given test.
-
-  ref_error = status.plotStage.error;
-  gen_error = status.tikzStage.error;
-
-  fprintf(texfile_handle, ...
-          ['\\begin{figure}\n'                                          , ...
-           '  \\centering\n'                                            , ...
-           '  \\begin{tabular}{cc}\n'                                   , ...
-           '    %s & %s \\\\\n'                                         , ...
-           '    reference rendering & generated\n'                      , ...
-           '  \\end{tabular}\n'                                         , ...
-           '  \\caption{%s \\texttt{%s}, \\texttt{%s(%d)}.%s}\n', ...
-          '\\end{figure}\n'                                             , ...
-          '\\clearpage\n\n'],...
-          include_figure(ref_error, 'includegraphics', ref_file), ...
-          include_figure(gen_error, 'includegraphics', gen_tex), ...
-          status.description, ...
-          name2tex(status.function), name2tex(testsuiteName), funcId, ...
-          formatIssuesForTeX(status.issues));
-
-end
-% =========================================================================
-function str = include_figure(errorOccured, command, filename)
-    if errorOccured
-        str = sprintf(['\\tikz{\\draw[red,thick] ', ...
-                       '(0,0) -- (\\figurewidth,\\figurewidth) ', ...
-                       '(0,\\figurewidth) -- (\\figurewidth,0);}']);
-    else
-        switch command
-            case 'includegraphics'
-                strFormat = '\\includegraphics[width=\\figurewidth]{../%s}';
-            case 'input'
-                strFormat = '\\input{../%s}';
-            otherwise
-                error('Matlab2tikz_acidtest:UnknownFigureCommand', ...
-                      'Unknown figure command "%s"', command);
-        end
-        str = sprintf(strFormat, filename);
-    end
-end
-% =========================================================================
-function texfile_tab_completion_init(texfile_handle)
-
-  fprintf(texfile_handle, ['\\clearpage\n\n'                            , ...
-                           '\\begin{table}\n'                           , ...
-                           '\\centering\n'                              , ...
-                           '\\caption{Test case completion summary}\n'  , ...
-                           '\\begin{tabular}{rlccc}\n'                  , ...
-                           'No. & Test case & Plot & PDF & TikZ \\\\\n' , ...
-                           '\\hline\n']);
-
-end
-% =========================================================================
-function texfile_tab_completion_finish(texfile_handle)
-
-  fprintf(texfile_handle, ['\\end{tabular}\n' , ...
-                           '\\end{table}\n\n' ]);
-
-end
-% =========================================================================
-function [env,versionString] = getEnvironment()
-  % Check if we are in MATLAB or Octave.
-  % Calling ver with an argument: iterating over all entries is very slow
-  alternatives = {'MATLAB','Octave'};
-  for iCase = 1:numel(alternatives)
-      env   = alternatives{iCase};
-      vData = ver(env);
-      if ~isempty(vData)
-          versionString = vData.Version;
-          return; % found the right environment
-      end
-  end
-  % otherwise:
-  env = [];
-  versionString = [];
-end
-% =========================================================================
-function [formatted, OSType, OSVersion] = OSVersion()
-    if ismac
-        OSType = 'Mac OS';
-        [dummy, OSVersion] = system('sw_vers -productVersion');
-    elseif ispc
-        OSType = '';% will already contain Windows in the output of `ver`
-        [dummy, OSVersion] = system('ver');
-    elseif isunix
-        OSType = 'Unix';
-        [dummy, OSVersion] = system('uname -r');
-    else
-        OSType = '';
-        OSVersion = '';
-    end
-    formatted = strtrim([OSType ' ' OSVersion]);
-end
-% =========================================================================
-function msg = format_error_message(e)
-    msg = '';
-    if ~isempty(e.message)
-        msg = sprintf('%serror: %s\n', msg, e.message);
-    end
-    if ~isempty(e.identifier)
-        msg = sprintf('%serror: %s\n', msg, e.identifier);
-    end
-    if ~isempty(e.stack)
-        msg = sprintf('%serror: called from:\n', msg);
-        for ee = e.stack(:)'
-            msg = sprintf('%serror:   %s at line %d, in function %s\n', ...
-                          msg, ee.file, ee.line, ee.name);
-        end
-    end
-end
-% =========================================================================
-function disp_error_message(env, msg)
-    stderr = 2;
-    % When displaying the error message in MATLAB, all backslashes
-    % have to be replaced by two backslashes. This must not, however,
-    % be applied constantly as the string that's saved to the LaTeX
-    % output must have only one backslash.
-    if strcmp(env, 'MATLAB')
-        fprintf(stderr, strrep(msg, '\', '\\'));
-    else
-        fprintf(stderr, msg);
-    end
-end
-% =========================================================================
-function [formatted,treeish] = VersionControlIdentifier()
-% This function gives the (git) commit ID of matlab2tikz
-%
-% This assumes the standard directory structure as used by Nico's master branch:
-%     SOMEPATH/src/matlab2tikz.m with a .git directory in SOMEPATH.
-%
-% The HEAD of that repository is determined from file system information only
-% by following dynamic references (e.g. ref:refs/heds/master) in branch files
-% until an absolute commit hash (e.g. 1a3c9d1...) is found.
-% NOTE: Packed branch references are NOT supported by this approach
-    MAXITER     = 10; % stop following dynamic references after a while
-    formatted   = '';
-    REFPREFIX   = 'ref:';
-    isReference = @(treeish)(any(strfind(treeish, REFPREFIX)));
-    treeish     = [REFPREFIX 'HEAD'];
-    try
-        % get the matlab2tikz directory
-        m2tDir = fileparts(mfilename('fullpath'));
-        gitDir = fullfile(m2tDir,'..','.git');
-
-        nIter = 1;
-        while isReference(treeish)
-            refName    = treeish(numel(REFPREFIX)+1:end);
-            branchFile = fullfile(gitDir, refName);
-
-            if exist(branchFile, 'file') && nIter < MAXITER
-                fid     = fopen(branchFile,'r');
-                treeish = fscanf(fid,'%s');
-                fclose(fid);
-                nIter   = nIter + 1;
-            else % no branch file or iteration limit reached
-                treeish = '';
-                return;
-            end
-        end
-    catch %#ok
-        treeish = '';
-    end
-    if ~isempty(treeish)
-        formatted = ['  Commit & ' treeish ' \\\\ \n'];
-    end
-end
-% =========================================================================
-function texName = name2tex(matlabIdentifier)
-texName = strrep(matlabIdentifier, '_', '\_');
-end
-% =========================================================================
-function str = formatIssuesForTeX(issues)
-% make links to GitHub issues for the LaTeX output
-  issues = issues(:)';
-  if isempty(issues)
-      str = '';
-      return
-  end
-  BASEURL = 'https://github.com/matlab2tikz/matlab2tikz/issues/';
-  SEPARATOR = sprintf(' \n');
-  strs = arrayfun(@(n) sprintf(['\\href{' BASEURL '%d}{\\#%d}'], n,n), issues, ...
-                  'UniformOutput', false);
-  strs = [strs; repmat({SEPARATOR}, 1, numel(strs))];
-  str = sprintf('{\\color{blue} \\texttt{%s}}', [strs{:}]);
-end
-% =========================================================================
-function onOff = onOffBoolean(bool)
-if bool
-    onOff = 'on';
-else
-    onOff = 'off';
-end
-end
-% =========================================================================
-function ensureLineEndings(filename)
-% Read in one line and test the ending
-fid = fopen(filename,'r+');
-testline = fgets(fid);
-if ispc && ~strcmpi(testline(end-1:end), sprintf('\r\n'))
-    % Rewind, read the whole
-    fseek(fid,0,'bof');
-    str = fread(fid,'*char')';
-
-    % Replace, overwrite and close
-    str = strrep(str, testline(end), sprintf('\r\n'));
-    fseek(fid,0,'bof');
-    fprintf(fid,'%s',str);
-    fclose(fid);
-end
-end
-% =========================================================================
-function defaultStatus = emptyStatus()
-% constructs an empty status struct
-defaultStatus = struct('function',               '', ...
-                       'description',            '',...
-                       'issues',                 [],...
-                       'skip',                   false, ... % skipped this test?
-                       'closeall',               false, ... % call close all after?
-                       'extraOptions',           {cell(0)}, ...
-                       'extraCleanfigureOptions',{cell(0)}, ...
-                       'plotStage',              emptyStage(), ...
-                       'saveStage',              emptyStage(), ...
-                       'tikzStage',              emptyStage());
-end
-% =========================================================================
-function stage = emptyStage()
-% constructs an empty (workflow) stage struct
-stage = struct('message', '', 'error'  , false);
-end
-% =========================================================================
-function [status] = fillStruct(status, defaultStatus)
-% fills non-existant fields of |data| with those of |defaultData|
-  fields = fieldnames(defaultStatus);
-  for iField = 1:numel(fields)
-      field = fields{iField};
-      if ~isfield(status,field)
-          status.(field) = defaultStatus.(field);
-      end
-  end
-end
-% =========================================================================
-function name = extractFunctionFromError(e, testsuite)
-% extract function name from an error (using the stack)
-    name = '';
-    if isa(testsuite, 'function_handle')
-        testsuite = func2str(testsuite);
-    end
-    for kError = 1:numel(e.stack);
-        ee = e.stack(kError);
-        if isempty(name)
-            name = '';
-            if ~isempty(regexp(ee.name, ['^' testsuite '>'],'once'))
-                % extract function name
-                name = regexprep(ee.name, ['^' testsuite '>(.*)'], '$1');
-            elseif ~isempty(regexp(ee.name, ['^' testsuite],'once')) && ...
-                    kError < numel(e.stack)
-                % new stack trace format (R2014b)
-                if kError > 1
-                    name = e.stack(kError-1).name;
-                end
-            end
-        end
-    end
-end
-% =========================================================================
-function [stage, errorHasOccurred] = errorHandler(e,env)
-% common error handler code: save and print to console
-errorHasOccurred = true;
-stage = emptyStage();
-stage.message = format_error_message(e);
-stage.error   = errorHasOccurred;
-
-disp_error_message(env, stage.message);
-end
-% =========================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/myCount.dat b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/myCount.dat
deleted file mode 100644
index 69e029e2c50b8e00bb7628f1de5cfee5a5eb3580..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/myCount.dat
+++ /dev/null
@@ -1,24 +0,0 @@
-    11    11     9
-     7    13    11
-    14    17    20
-    11    13     9
-    43    51    69
-    38    46    76
-    61   132   186
-    75   135   180
-    38    88   115
-    28    36    55
-    12    12    14
-    18    27    30
-    18    19    29
-    17    15    18
-    19    36    48
-    32    47    10
-    42    65    92
-    57    66   151
-    44    55    90
-   114   145   257
-    35    58    68
-    11    12    15
-    13     9    15
-    10     9     7
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/pointReductionTest.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/pointReductionTest.m
deleted file mode 100644
index 6b6718fbe5d179f8adb00ac4a7019537caffc160..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/pointReductionTest.m
+++ /dev/null
@@ -1,34 +0,0 @@
-% ==============================================================================
-function pointReductionTest()
-
-  breakTime = 5.0;
-
-  testPlots = {@testPlot1, ...
-              };
-               %@testPlot2};
-
-  for testPlot = testPlots
-      testPlot();
-      'a'
-      %pause(breakTime);
-      %pointReduction2d(0.1);
-      pause(breakTime);
-      'b'
-  end
-
-  close all;
-
-end
-% ==============================================================================
-function testPlot1()
-  x = -pi:pi/1000:pi;
-  y = tan(sin(x)) - sin(tan(x));
-  plot(x,y,'--rs');
-end
-% ==============================================================================
-function testPlot2()
-  x = -pi:pi/1000:pi;
-  y = exp(tan(sin(x)) - sin(tan(x)));
-  semilogy(x,y,'--rs');
-end
-% ==============================================================================
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/runtests b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/runtests
deleted file mode 100644
index 1135424cf8010602d9932fe3b29db06bbeafa85b..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/runtests
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/octave -q
-
-# Create 
-#
-template = [ ...
- '%%!test\n', ...
- '%%! display(''Test %d...'');\n', ...
- '%%! graphics_toolkit gnuplot\n', ...
- '%%! try\n', ...
- '%%!   out = ACID(%d);\n', ...
- '%%! catch e\n', ...
- '%%!   error(''Exception in ACID:\\n%%s'', e.message);\n', ...
- '%%! end\n', ...
- '%%! if ~(isfield(out, ''skip'') && out.skip)\n', ...
- '%%!   outputFile = ''data/converted/test%d-converted.tex'';\n', ...
- '%%!   try\n', ...
- '%%!     matlab2tikz( ...\n', ...
- '%%!       ''filename'', outputFile, ...\n', ...
- '%%!       ''width'', ''5cm'', ...\n', ...
- '%%!       ''showInfo'', false, ...\n', ...
- '%%!       ''checkForUpdates'', false, ...\n', ...
- '%%!       ''dataPath'', ''data/converted/'', ...\n', ...
- '%%!       ''standalone'', true ...\n', ...
- '%%!       );\n', ...
- '%%!   catch e\n', ...
- '%%!     error(''Exception in matlab2tikz:\\n%%s'', e.message);\n', ...
- '%%!   end\n', ...
- '%%!   %%type(outputFile);\n', ...
- '%%!   assert(md5sum(outputFile), out.md5);\n', ...
- '%%! end\n', ...
- '%%!\n' ...
- ];
-
-# Create test entries for all tests
-testfile = 'testlist.m';
-fh = fopen(testfile, 'w');
-testcases = ACID(0);
-for k = 1:length(testcases)
-  fprintf(fh, template, k, k, k);
-end
-fclose(fh);
-
-# Actually run the tests.
-# Can't use the [n, max] return arguments
-# <https://www.gnu.org/software/octave/doc/interpreter/Test-Functions.html>
-# since they don't account for exceptions in tests.
-addpath('../src/');
-success = test(testfile);
-
-if success
-  printf('Tests successful.');
-  ierr = 0;
-else
-  ierr = 1;
-end
-exit(ierr);
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/testPatches.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/testPatches.m
deleted file mode 100644
index d4e8cffefca8b1c8ef2cae6a9f3278aa8998282a..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/testPatches.m
+++ /dev/null
@@ -1,121 +0,0 @@
-function status = testPatches(k)
-% TESTPATCHES Test suite for patches
-%
-% See also: ACID, matlab2tikz_acidtest
-
-testfunction_handles = {
-    @patch01;
-    @patch02;
-    @patch03;
-    @patch04;
-    @patch05;
-    @patch06;
-    @patch07;
-    @patch08;
-    };
-
-numFunctions = length( testfunction_handles );
-
-if nargin < 1 || isempty(k) || k <= 0
-    status = testfunction_handles;
-    return;  % This is used for querying numFunctions.
-    
-elseif (k<=numFunctions)
-    status = testfunction_handles{k}();
-    status.function = func2str(testfunction_handles{k});
-    
-else
-    error('patchTests:outOfBounds', ...
-        'Out of bounds (number of testfunctions=%d)', numFunctions);
-end
-
-end
-
-% =========================================================================
-function p = patch00()
-% DO NOT INCLUDE IN ACID LIST
-% Base patch plot for following tests
-xdata = [2 2 0 2 5; 2 8 2 4 5; 8 8 2 4 8];
-ydata = [4 4 4 2 0; 8 4 6 2 2; 4 0 4 0 0];
-zdata = ones(3,5)*2;
-p     = patch(xdata,ydata,zdata);
-end
-% =========================================================================
-function stat = patch01()
-stat.description = 'Set face color red';
-
-p = patch00();
-set(p,'FaceColor','r')
-end
-% =========================================================================
-function stat = patch02()
-stat.description = 'Flat face colors scaled in clim [0,40]';
-
-p = patch00();
-set(gca,'CLim',[0 40])
-cdata = [15 30 25 2 60];
-set(p,'FaceColor','flat','CData',cdata,'CDataMapping','scaled')
-end
-% =========================================================================
-function stat = patch03()
-stat.description = 'Flat face colors direct in clim [0,40]';
-
-p = patch00();
-set(gca,'CLim',[0 40])
-cdata = [15 30 25 2 60];
-set(p,'FaceColor','flat','CData',cdata,'CDataMapping','direct')
-end
-% =========================================================================
-function stat = patch04()
-stat.description = 'Flat face colors with 3D (truecolor) CData';
-
-p = patch00();
-cdata(:,:,1) = [0 0 1 0 0.8];
-cdata(:,:,2) = [0 0 0 0 0.8];
-cdata(:,:,3) = [1 1 1 0 0.8];
-set(p,'FaceColor','flat','CData',cdata)
-end
-% =========================================================================
-function stat = patch05()
-stat.description = 'Flat face color, scaled edge colors in clim [0,40]';
-
-p = patch00();
-set(gca,'CLim',[0 40])
-cdata = [15 30 25 2 60; 12 23 40 13 26; 24 8 1 65 42];
-set(p,'FaceColor','flat','CData',cdata,'EdgeColor','flat','LineWidth',5,'CDataMapping','scaled')
-end
-% =========================================================================
-function stat = patch06()
-stat.description = 'Flat face color, direct edge colors in clim [0,40]';
-
-p = patch00();
-set(gca,'CLim',[0 40])
-cdata = [15 30 25 2 60; 12 23 40 13 26; 24 8 1 65 42];
-set(p,'FaceColor','flat','CData',cdata,'EdgeColor','flat','LineWidth',5,'CDataMapping','direct')
-end
-% =========================================================================
-function stat = patch07()
-stat.description = 'Flat face color with 3D CData and interp edge colors';
-
-p = patch00();
-cdata(:,:,1) = [0 0 1 0 0.8;
-                0 0 1 0.2 0.6;
-                0 1 0 0.4 1];
-cdata(:,:,2) = [0 0 0 0 0.8;
-                1 1 1 0.2 0.6;
-                1 0 0 0.4 0];
-cdata(:,:,3) = [1 1 1 0 0.8;
-                0 1 0 0.2 0.6;
-                1 0 1 0.4 0];
-set(p,'FaceColor','flat','CData',cdata,'EdgeColor','interp','LineWidth',5)
-end
-% =========================================================================
-function stat = patch08()
-stat.description = 'Interp face colors, flat edges, scaled CData in clims [0,40]';
-
-p = patch00();
-set(gca,'CLim',[0 40])
-cdata = [15 30 25 2 60; 12 23 40 13 26; 24 8 1 65 42];
-set(p,'FaceColor','interp','CData',cdata,'EdgeColor','flat','LineWidth',5,'CDataMapping','scaled')
-end
-% =========================================================================
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/testSurfshader.m b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/testSurfshader.m
deleted file mode 100644
index e329d9cf4791992bd69d23596e9f73b755aaf3cb..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/testSurfshader.m
+++ /dev/null
@@ -1,103 +0,0 @@
-function status = testSurfshader(k)
-% TESTSURFSHADER Test suite for Surf/mesh shaders (coloring)
-%
-% See also: ACID, matlab2tikz_acidtest
-
-  testfunction_handles = {
-      @surfShader1;
-      @surfShader2;
-      @surfShader3;
-      @surfShader4;
-      @surfShader5;
-      @surfNoShader;
-      @surfNoPlot;
-      @surfMeshInterp;
-      @surfMeshRGB;
-      };
-
-  numFunctions = length( testfunction_handles );
-
-  if nargin < 1 || isempty(k) || k <= 0
-      status = testfunction_handles;
-      return;  % This is used for querying numFunctions.
-
-  elseif (k<=numFunctions)
-      status = testfunction_handles{k}();
-      status.function = func2str(testfunction_handles{k});
-
-  else
-      error('patchTests:outOfBounds', ...
-            'Out of bounds (number of testfunctions=%d)', numFunctions);
-  end
-  
-end
-
-% =========================================================================
-function [stat] = surfShader1()
-  stat.description = 'shader=flat/(flat mean) | Fc: flat | Ec: none';
-
-  [X,Y,Z]  = peaks(5);
-  surf(X,Y,Z,'FaceColor','flat','EdgeColor','none')
-end
-% =========================================================================
-function [stat] = surfShader2()
-  stat.description = 'shader=interp | Fc: interp | Ec: none';
-
-  [X,Y,Z]  = peaks(5);
-  surf(X,Y,Z,'FaceColor','interp','EdgeColor','none')
-end
-% =========================================================================
-function [stat] = surfShader3()
-  stat.description = 'shader=faceted | Fc: flat | Ec: RGB';
-
-  [X,Y,Z]  = peaks(5);
-  surf(X,Y,Z,'FaceColor','flat','EdgeColor','green')
-end
-% =========================================================================
-function [stat] = surfShader4()
-stat.description = 'shader=faceted | Fc: RGB | Ec: interp';
-env = getEnvironment();
-if strcmpi(env, 'MATLAB') && isVersionBelow(env, 8, 4) %R2014a and older
-    warning('m2t:ACID:surfShader4',...
-        'The MATLAB EPS export may behave strangely for this case');
-end
-
-[X,Y,Z]  = peaks(5);
-surf(X,Y,Z,'FaceColor','blue','EdgeColor','interp')
-end
-% =========================================================================
-function [stat] = surfShader5()
-stat.description = 'shader=faceted interp | Fc: interp | Ec: flat';
-
-[X,Y,Z]  = peaks(5);
-surf(X,Y,Z,'FaceColor','interp','EdgeColor','flat')
-end
-% =========================================================================
-function [stat] = surfNoShader()
-stat.description = 'no shader | Fc: RGB | Ec: RGB';
-
-[X,Y,Z]  = peaks(5);
-surf(X,Y,Z,'FaceColor','blue','EdgeColor','yellow')
-end
-% =========================================================================
-function [stat] = surfNoPlot()
-stat.description = 'no plot | Fc: none | Ec: none';
-
-[X,Y,Z]  = peaks(5);
-surf(X,Y,Z,'FaceColor','none','EdgeColor','none')
-end
-% =========================================================================
-function [stat] = surfMeshInterp()
-stat.description = 'mesh | Fc: none | Ec: interp';
-
-[X,Y,Z]  = peaks(5);
-surf(X,Y,Z,'FaceColor','none','EdgeColor','interp')
-end
-% =========================================================================
-function [stat] = surfMeshRGB()
-stat.description = 'mesh | Fc: none | Ec: RGB';
-
-[X,Y,Z]  = peaks(5);
-surf(X,Y,Z,'FaceColor','none','EdgeColor','green')
-end
-% =========================================================================
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/tex/Makefile b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/tex/Makefile
deleted file mode 100644
index 89809159151e79dbbe860142c6e1526372eeafb2..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/test/tex/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# ./Makefile
-
-ECHOCMD:=/bin/echo -e
-LATEX:=lualatex --shell-escape
-TARGET:=acid
-
-main:
-	cd ../data/reference/ && $(MAKE)
-	cd ../data/converted/ && $(MAKE)
-	@$(LATEX) $(TARGET)
-
-.PHONY: clean
-
-clean:
-	@rm -f $(TARGET).aux \
-	$(TARGET).log \
-	$(TARGET).nav \
-	$(TARGET).out \
-	$(TARGET).snm \
-	$(TARGET).toc \
-	$(TARGET).vrb \
-	$(TARGET).pdf \
-	$(TARGET).dvi \
-	$(TARGET).ps \
-	missfont.log
-	@rm -f *~
-	cd ../data/reference/ && $(MAKE) clean
-	cd ../data/converted/ && $(MAKE) clean
-
-distclean: clean
-	@rm -f $(TARGET).tex
-	cd ../data/reference/ && $(MAKE) distclean
-	cd ../data/converted/ && $(MAKE) distclean
diff --git a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/version-0.6.0 b/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/version-0.6.0
deleted file mode 100644
index 5e89b8a43b4255233cb4eccb979d41153b98d8e3..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz-matlab2tikz-722609f/version-0.6.0
+++ /dev/null
@@ -1,6 +0,0 @@
-This file is there to make sure that the HTML page
-
-  http://www.mathworks.de/matlabcentral/fileexchange/22022-matlab2tikz/all_files
-
-contains the version number in clear text. This is used
-by the automatic updater.
diff --git a/katoptron/matlab/TPL/matlab2tikz2.m b/katoptron/matlab/TPL/matlab2tikz2.m
deleted file mode 100644
index 39c319769cb98c3afcfb2e6c43b6001875c468de..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/matlab2tikz2.m
+++ /dev/null
@@ -1,29 +0,0 @@
-function matlab2tikz2(filename,width_macro,height_macro)
-
-    filename_tmp = [filename,'_tmp'];
-    matlab2tikz(filename_tmp);
-    
-    fid = fopen(filename_tmp);
-    fid2 = fopen(filename, 'w');
-    tline = fgetl(fid);
-    while ischar(tline)
-        if((length(tline)>5) & (tline(1:5) == 'width'))
-            disp(tline)
-            clear tline
-            tline = ['width=',width_macro, ','];
-            disp(tline)
-        elseif((length(tline)>6) & (tline(1:6) == 'height'))
-            disp(tline)
-            clear tline
-            tline = ['height=',height_macro, ','];
-            disp(tline)
-        end
-        fwrite(fid2, tline);
-        fprintf(fid2,char(10));
-        tline = fgetl(fid);
-    end
-
-    fclose(fid);
-    fclose(fid2);
-    
-end
\ No newline at end of file
diff --git a/katoptron/matlab/TPL/test.tex b/katoptron/matlab/TPL/test.tex
deleted file mode 100644
index 1c8f7cfdfdfb43b122d2240ab83fdccc62b38e2a..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/test.tex
+++ /dev/null
@@ -1,130 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\definecolor{mycolor1}{rgb}{0.00000,0.44700,0.74100}%
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=\hi,
-height=\ho,
-at={(1.011111in,0.641667in)},
-scale only axis,
-xmin=-5,
-xmax=5,
-ymin=-80,
-ymax=80
-]
-\addplot [color=mycolor1,solid,forget plot]
-  table[row sep=crcr]{%
--5	-65\\
--4.8989898989899	-58.7883786338026\\
--4.7979797979798	-52.8766648218745\\
--4.6969696969697	-47.258674903303\\
--4.5959595959596	-41.9282252171753\\
--4.49494949494949	-36.8791321025787\\
--4.39393939393939	-32.1052118986003\\
--4.29292929292929	-27.6002809443275\\
--4.19191919191919	-23.3581555788474\\
--4.09090909090909	-19.3726521412472\\
--3.98989898989899	-15.6375869706142\\
--3.88888888888889	-12.1467764060357\\
--3.78787878787879	-8.89403678659878\\
--3.68686868686869	-5.87318445139076\\
--3.58585858585859	-3.07803573949884\\
--3.48484848484848	-0.502406990010293\\
--3.38383838383838	1.85988545798769\\
--3.28282828282828	4.01502526540787\\
--3.18181818181818	5.96919609316303\\
--3.08080808080808	7.72858160216593\\
--2.97979797979798	9.29936545332934\\
--2.87878787878788	10.687731307566\\
--2.77777777777778	11.8998628257887\\
--2.67676767676768	12.9419436689103\\
--2.57575757575758	13.8201574978434\\
--2.47474747474747	14.540687973501\\
--2.37373737373737	15.1097187567956\\
--2.27272727272727	15.5334335086401\\
--2.17171717171717	15.8180158899473\\
--2.07070707070707	15.96964956163\\
--1.96969696969697	15.9945181846008\\
--1.86868686868687	15.8988054197727\\
--1.76767676767677	15.6886949280583\\
--1.66666666666667	15.3703703703704\\
--1.56565656565657	14.9500154076218\\
--1.46464646464646	14.4338137007252\\
--1.36363636363636	13.8279489105935\\
--1.26262626262626	13.1386046981394\\
--1.16161616161616	12.3719647242757\\
--1.06060606060606	11.5342126499151\\
--0.959595959595959	10.6315321359705\\
--0.858585858585859	9.67010684335447\\
--0.757575757575758	8.65612043297994\\
--0.656565656565657	7.59575656575963\\
--0.555555555555555	6.49519890260631\\
--0.454545454545454	5.36063110443275\\
--0.353535353535354	4.19823683215174\\
--0.252525252525253	3.01419974667603\\
--0.151515151515151	1.81470350891838\\
--0.0505050505050502	0.605931779791586\\
-0.0505050505050502	-0.605931779791586\\
-0.151515151515151	-1.81470350891838\\
-0.252525252525253	-3.01419974667603\\
-0.353535353535354	-4.19823683215174\\
-0.454545454545454	-5.36063110443275\\
-0.555555555555555	-6.49519890260631\\
-0.656565656565657	-7.59575656575963\\
-0.757575757575758	-8.65612043297994\\
-0.858585858585859	-9.67010684335447\\
-0.959595959595959	-10.6315321359705\\
-1.06060606060606	-11.5342126499151\\
-1.16161616161616	-12.3719647242757\\
-1.26262626262626	-13.1386046981394\\
-1.36363636363636	-13.8279489105935\\
-1.46464646464646	-14.4338137007252\\
-1.56565656565657	-14.9500154076218\\
-1.66666666666667	-15.3703703703704\\
-1.76767676767677	-15.6886949280583\\
-1.86868686868687	-15.8988054197727\\
-1.96969696969697	-15.9945181846008\\
-2.07070707070707	-15.96964956163\\
-2.17171717171717	-15.8180158899473\\
-2.27272727272727	-15.5334335086401\\
-2.37373737373737	-15.1097187567956\\
-2.47474747474747	-14.540687973501\\
-2.57575757575758	-13.8201574978434\\
-2.67676767676768	-12.9419436689103\\
-2.77777777777778	-11.8998628257887\\
-2.87878787878788	-10.687731307566\\
-2.97979797979798	-9.29936545332933\\
-3.08080808080808	-7.72858160216592\\
-3.18181818181818	-5.96919609316303\\
-3.28282828282828	-4.0150252654079\\
-3.38383838383838	-1.85988545798769\\
-3.48484848484848	0.502406990010286\\
-3.58585858585859	3.07803573949887\\
-3.68686868686869	5.87318445139076\\
-3.78787878787879	8.89403678659875\\
-3.88888888888889	12.1467764060357\\
-3.98989898989899	15.6375869706142\\
-4.09090909090909	19.3726521412472\\
-4.19191919191919	23.3581555788474\\
-4.29292929292929	27.6002809443274\\
-4.39393939393939	32.1052118986004\\
-4.49494949494949	36.8791321025787\\
-4.5959595959596	41.9282252171753\\
-4.6969696969697	47.258674903303\\
-4.7979797979798	52.8766648218745\\
-4.8989898989899	58.7883786338026\\
-5	65\\
-};
-\node[right, align=left, inner sep=0mm, text=black]
-at (axis cs:-2,16,0) {dy/dx = 0};
-\node[right, align=left, inner sep=0mm, text=black]
-at (axis cs:2,-16,0) {dy/dx = 0};
-\end{axis}
-\end{tikzpicture}%
diff --git a/katoptron/matlab/TPL/test.tex_tmp b/katoptron/matlab/TPL/test.tex_tmp
deleted file mode 100644
index b9209af18c83a7567ea76f71ebe33ce50e497774..0000000000000000000000000000000000000000
--- a/katoptron/matlab/TPL/test.tex_tmp
+++ /dev/null
@@ -1,130 +0,0 @@
-% This file was created by matlab2tikz.
-% Minimal pgfplots version: 1.3
-%
-%The latest updates can be retrieved from
-%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
-%where you can also make suggestions and rate matlab2tikz.
-%
-\definecolor{mycolor1}{rgb}{0.00000,0.44700,0.74100}%
-%
-\begin{tikzpicture}
-
-\begin{axis}[%
-width=6.027778in,
-height=4.754167in,
-at={(1.011111in,0.641667in)},
-scale only axis,
-xmin=-5,
-xmax=5,
-ymin=-80,
-ymax=80
-]
-\addplot [color=mycolor1,solid,forget plot]
-  table[row sep=crcr]{%
--5	-65\\
--4.8989898989899	-58.7883786338026\\
--4.7979797979798	-52.8766648218745\\
--4.6969696969697	-47.258674903303\\
--4.5959595959596	-41.9282252171753\\
--4.49494949494949	-36.8791321025787\\
--4.39393939393939	-32.1052118986003\\
--4.29292929292929	-27.6002809443275\\
--4.19191919191919	-23.3581555788474\\
--4.09090909090909	-19.3726521412472\\
--3.98989898989899	-15.6375869706142\\
--3.88888888888889	-12.1467764060357\\
--3.78787878787879	-8.89403678659878\\
--3.68686868686869	-5.87318445139076\\
--3.58585858585859	-3.07803573949884\\
--3.48484848484848	-0.502406990010293\\
--3.38383838383838	1.85988545798769\\
--3.28282828282828	4.01502526540787\\
--3.18181818181818	5.96919609316303\\
--3.08080808080808	7.72858160216593\\
--2.97979797979798	9.29936545332934\\
--2.87878787878788	10.687731307566\\
--2.77777777777778	11.8998628257887\\
--2.67676767676768	12.9419436689103\\
--2.57575757575758	13.8201574978434\\
--2.47474747474747	14.540687973501\\
--2.37373737373737	15.1097187567956\\
--2.27272727272727	15.5334335086401\\
--2.17171717171717	15.8180158899473\\
--2.07070707070707	15.96964956163\\
--1.96969696969697	15.9945181846008\\
--1.86868686868687	15.8988054197727\\
--1.76767676767677	15.6886949280583\\
--1.66666666666667	15.3703703703704\\
--1.56565656565657	14.9500154076218\\
--1.46464646464646	14.4338137007252\\
--1.36363636363636	13.8279489105935\\
--1.26262626262626	13.1386046981394\\
--1.16161616161616	12.3719647242757\\
--1.06060606060606	11.5342126499151\\
--0.959595959595959	10.6315321359705\\
--0.858585858585859	9.67010684335447\\
--0.757575757575758	8.65612043297994\\
--0.656565656565657	7.59575656575963\\
--0.555555555555555	6.49519890260631\\
--0.454545454545454	5.36063110443275\\
--0.353535353535354	4.19823683215174\\
--0.252525252525253	3.01419974667603\\
--0.151515151515151	1.81470350891838\\
--0.0505050505050502	0.605931779791586\\
-0.0505050505050502	-0.605931779791586\\
-0.151515151515151	-1.81470350891838\\
-0.252525252525253	-3.01419974667603\\
-0.353535353535354	-4.19823683215174\\
-0.454545454545454	-5.36063110443275\\
-0.555555555555555	-6.49519890260631\\
-0.656565656565657	-7.59575656575963\\
-0.757575757575758	-8.65612043297994\\
-0.858585858585859	-9.67010684335447\\
-0.959595959595959	-10.6315321359705\\
-1.06060606060606	-11.5342126499151\\
-1.16161616161616	-12.3719647242757\\
-1.26262626262626	-13.1386046981394\\
-1.36363636363636	-13.8279489105935\\
-1.46464646464646	-14.4338137007252\\
-1.56565656565657	-14.9500154076218\\
-1.66666666666667	-15.3703703703704\\
-1.76767676767677	-15.6886949280583\\
-1.86868686868687	-15.8988054197727\\
-1.96969696969697	-15.9945181846008\\
-2.07070707070707	-15.96964956163\\
-2.17171717171717	-15.8180158899473\\
-2.27272727272727	-15.5334335086401\\
-2.37373737373737	-15.1097187567956\\
-2.47474747474747	-14.540687973501\\
-2.57575757575758	-13.8201574978434\\
-2.67676767676768	-12.9419436689103\\
-2.77777777777778	-11.8998628257887\\
-2.87878787878788	-10.687731307566\\
-2.97979797979798	-9.29936545332933\\
-3.08080808080808	-7.72858160216592\\
-3.18181818181818	-5.96919609316303\\
-3.28282828282828	-4.0150252654079\\
-3.38383838383838	-1.85988545798769\\
-3.48484848484848	0.502406990010286\\
-3.58585858585859	3.07803573949887\\
-3.68686868686869	5.87318445139076\\
-3.78787878787879	8.89403678659875\\
-3.88888888888889	12.1467764060357\\
-3.98989898989899	15.6375869706142\\
-4.09090909090909	19.3726521412472\\
-4.19191919191919	23.3581555788474\\
-4.29292929292929	27.6002809443274\\
-4.39393939393939	32.1052118986004\\
-4.49494949494949	36.8791321025787\\
-4.5959595959596	41.9282252171753\\
-4.6969696969697	47.258674903303\\
-4.7979797979798	52.8766648218745\\
-4.8989898989899	58.7883786338026\\
-5	65\\
-};
-\node[right, align=left, inner sep=0mm, text=black]
-at (axis cs:-2,16,0) {dy/dx = 0};
-\node[right, align=left, inner sep=0mm, text=black]
-at (axis cs:2,-16,0) {dy/dx = 0};
-\end{axis}
-\end{tikzpicture}%
\ No newline at end of file
diff --git a/katoptron/matlab/ensemble/eric_data.m b/katoptron/matlab/ensemble/eric_data.m
deleted file mode 100644
index cfea0b6bdedb7ad902e03bf6efa0bbe69370d5f8..0000000000000000000000000000000000000000
--- a/katoptron/matlab/ensemble/eric_data.m
+++ /dev/null
@@ -1,571 +0,0 @@
-% clear all
-% close all
-% clc
-% 
-% throughput_haswell = ...
-% [0.9119170984455955, 7.906111492602527;
-% 3.979274611398962, 10.228603533304188;
-% 7.792746113989635, 10.62563206192646;
-% 11.772020725388602, 11.215931081840303;
-% 15.917098445595853, 11.132030713527676;
-% 19.813471502590673, 11.336537861289713;
-% 23.875647668393782, 11.348773331668632;
-% 27.689119170984455, 11.360259691616193;
-% 31.751295336787564, 11.372495161995118];
-% 
-% throughput_haswell(:,1) = round(throughput_haswell(:,1));
-% 
-% throughput_cray = ...
-% [1.0777202072538863, 2.3162494537736436;
-% 4.145077720207253, 3.0965728197765117;
-% 7.87564766839378, 3.204195018415625;
-% 12.020725388601038, 3.2166801922716672;
-% 15.999999999999998, 3.4214370435108137;
-% 19.979274611398964, 3.3370372682439537;
-% 23.875647668393782, 3.3487733316686317;
-% 27.772020725388607, 3.5532804794306685;
-% 31.834196891191716, 3.469130407640911];
-% 
-% throughput_cray(:,1) = round(throughput_cray(:,1));
-% 
-% throughput_nvidia = ...
-% [0.9948186528497391, 17.159373244272423;
-% 15.999999999999998, 34.168424995318055;
-% 31.834196891191716, 35.08358823896622];
-% 
-% throughput_nvidia(:,1) = round(throughput_nvidia(:,1));
-% 
-% throughput_knc = ...
-% [0.8290155440414484, 14.749235283101314;
-% 7.626943005181348, 15.348024221237274;
-% 15.917098445595853, 19.228416255696352;
-% 23.875647668393782, 24.457207066608397;
-% 31.751295336787564, 25.73394094512765];
-% 
-% throughput_knc(:,1) = round(throughput_knc(:,1));
-% 
-% %%
-% matrix_speed_up_haswell = ...
-% [0.8000000000000007, 0.9986486486486488;
-% 3.9200000000000017, 1.307657657657658;
-% 7.759999999999998, 1.3896396396396398;
-% 11.84, 1.4211711711711714;
-% 15.84, 1.4400900900900904;
-% 19.759999999999998, 1.4495495495495496;
-% 23.839999999999996, 1.4495495495495496;
-% 27.839999999999996, 1.4590090090090093;
-% 31.919999999999995, 1.4653153153153156];
-% 
-% matrix_speed_up_cray = ...
-% [0.8000000000000007, 0.9954954954954955;
-% 4.080000000000002, 1.307657657657658;
-% 7.920000000000002, 1.326576576576577;
-% 12, 1.392792792792793;
-% 15.999999999999996, 1.4211711711711714;
-% 19.92, 1.411711711711712;
-% 23.919999999999995, 1.3833333333333335;
-% 28, 1.4810810810810813;
-% 32, 1.4211711711711714];
-% 
-% matrix_speed_up_nvidia = ...
-% [0.8000000000000007, 1.001801801801802;
-% 15.999999999999996, 1.9855855855855857;
-% 32, 2.032882882882883];
-% 
-% matrix_speed_up_knc = ...
-% [0.8000000000000007, 0.9986486486486488;
-% 7.759999999999998, 1.0490990990990992;
-% 15.84, 1.3234234234234237;
-% 23.759999999999998, 1.6702702702702705;
-% 31.83999999999999, 1.7585585585585588];
-% 
-% matrix_speed_up_haswell(:,1) = round(matrix_speed_up_haswell(:,1));
-% matrix_speed_up_cray(:,1) = round(matrix_speed_up_cray(:,1));
-% matrix_speed_up_nvidia(:,1) = round(matrix_speed_up_nvidia(:,1));
-% matrix_speed_up_knc(:,1) = round(matrix_speed_up_knc(:,1));
-% %%
-% mrhs_assembly_time_haswell = ...
-% [0.8226221079691509, 78.73303167420812;
-% 3.86632390745501, 52.26244343891403;
-% 7.814910025706938, 36.65158371040724;
-% 15.87660668380463, 29.864253393665194;
-% 31.835475578406168, 27.149321266968343];
-% 
-% mrhs_assembly_time_cray = ...
-% [0.9871465295629829, 269.4570135746606;
-% 4.030848329048842, 171.71945701357464;
-% 7.97943444730077, 144.5701357466063;
-% 16.041131105398456, 138.46153846153845;
-% 31.917737789203088, 132.3529411764706];
-% 
-% mrhs_assembly_time_nvidia = ...
-% [0.9871465295629829, 51.58371040723978;
-% 15.958868894601542, 43.43891402714934;
-% 32, 43.43891402714934];
-% 
-% mrhs_assembly_time_knc = ...
-% [0.8226221079691509, 74.66063348416293;
-% 7.814910025706938, 28.50678733031674;
-% 15.87660668380463, 20.361990950226243;
-% 31.835475578406168, 16.968325791855193];
-% 
-% 
-% mrhs_assembly_time_haswell(:,1) = round(mrhs_assembly_time_haswell(:,1));
-% mrhs_assembly_time_cray(:,1) = round(mrhs_assembly_time_cray(:,1));
-% mrhs_assembly_time_nvidia(:,1) = round(mrhs_assembly_time_nvidia(:,1));
-% mrhs_assembly_time_knc(:,1) = round(mrhs_assembly_time_knc(:,1));
-% 
-% %%
-% mrhs_assembly_speed_up_haswell = ...
-% [0.9663930062484223, 0.9955056179775283;
-% 4.007778307041386, 1.501123595505618;
-% 7.850575807671829, 2.1988764044943823;
-% 15.918495895093729, 2.653932584269663;
-% 31.96305864552103, 2.91685393258427];
-% 
-% mrhs_assembly_speed_up_cray = ...
-% [0.9663930062484223, 0.9955056179775283;
-% 4.08883409453893, 1.571910112359551;
-% 8.0040796884194, 1.8550561797752811;
-% 16.06536467819216, 1.9359550561797754;
-% 32.027257698450505, 2.037078651685394];
-% 
-% mrhs_assembly_speed_up_nvidia = ...
-% [0.9663930062484223, 0.9955056179775283;
-% 16.051556502003415, 1.1573033707865177;
-% 32.011656252626864, 1.1573033707865177];
-% 
-% mrhs_assembly_speed_up_knc = ...
-% [0.9663930062484223, 0.9955056179775283;
-% 7.860438790663787, 2.755056179775281;
-% 15.937325226260194, 3.7157303370786523;
-% 31.990674997898516, 4.474157303370787];
-% 
-% mrhs_assembly_speed_up_theoretical = ...
-% [0.9663930062484223, 0.9955056179775283;
-% 4.094572557370617, 1.8955056179775278;
-% 8.010535459105045, 2.2191011235955065;
-% 15.994351200650064, 2.4314606741573037;
-% 32.116024545378124, 2.542696629213484];
-% 
-% mrhs_assembly_speed_up_haswell(:,1) = round(mrhs_assembly_speed_up_haswell(:,1));
-% mrhs_assembly_speed_up_cray(:,1) = round(mrhs_assembly_speed_up_cray(:,1));
-% mrhs_assembly_speed_up_nvidia(:,1) = round(mrhs_assembly_speed_up_nvidia(:,1));
-% mrhs_assembly_speed_up_knc(:,1) = round(mrhs_assembly_speed_up_knc(:,1));
-% mrhs_assembly_speed_up_theoretical(:,1) = round(mrhs_assembly_speed_up_theoretical(:,1));
-% %%
-% halo_time = zeros(5,6);
-% halo_time(:,1:2) = ...
-% [1.079518072289158, 0.927835051546392;
-% 4.086746987951807, 1.4536082474226788;
-% 8.096385542168676, 2.195876288659793;
-% 16.11566265060241, 3.9587628865979383;
-% 31.999999999999996, 7.422680412371134];
-% 
-% halo_time(:,[1,3]) = ...
-% [0.7710843373493983, 1.0515463917525736;
-% 4.086746987951807, 1.6082474226804138;
-% 7.865060240963853, 2.3505154639175245;
-% 15.807228915662652, 3.9278350515463902;
-% 31.922891566265054, 7.824742268041238];
-% 
-% halo_time(:,[1,4]) = ...
-% [0.9253012048192772, 0.927835051546392;
-% 3.9325301204819283, 1.4536082474226788;
-% 7.942168674698795, 2.1030927835051543;
-% 16.11566265060241, 3.8350515463917514;
-% 31.999999999999996, 7.608247422680414];
-% 
-% halo_time(:,[1,5]) = ...
-% [0.7710843373493983, 1.0824742268041234;
-% 4.009638554216867, 1.731958762886599;
-% 7.865060240963853, 2.5670103092783503;
-% 16.038554216867468, 5.041237113402062;
-% 31.922891566265054, 9.34020618556701];
-% 
-% halo_time(:,[1,6]) = ...
-% [1.0024096385542158, 1.144329896907216;
-% 4.009638554216867, 1.8247422680412377;
-% 7.942168674698795, 2.7525773195876297;
-% 16.038554216867468, 5.443298969072165;
-% 31.999999999999996, 10.453608247422682];
-% 
-% halo_time(:,1) = round(halo_time(:,1));
-% 
-% %%
-% halo_speed_up = zeros(5,6);
-% halo_speed_up(:,1:2) = ...
-% [0.9230769230769234, 1.0141388174807187;
-% 4, 2.6079691516709502;
-% 8.000000000000002, 3.4717223650385596;
-% 16.07692307692308, 3.8213367609254494;
-% 32.15384615384615, 4.088688946015424];
-% 
-% halo_speed_up(:,[1,3]) = ...
-% [0.9230769230769234, 1.0141388174807187;
-% 3.8461538461538467, 2.5874035989717212;
-% 7.8461538461538485, 3.410025706940874;
-% 16, 4.057840616966581;
-% 31.846153846153847, 3.9858611825192796];
-% 
-% halo_speed_up(:,[1,4]) = ...
-% [1, 0.9935732647814906;
-% 4.153846153846155, 2.5874035989717212;
-% 7.923076923076925, 3.5745501285347037;
-% 16.07692307692308, 3.996143958868894;
-% 32, 4.07840616966581];
-% 
-% halo_speed_up(:,[1,5]) = ...
-% [0.9230769230769234, 1.0038560411311046;
-% 3.9230769230769234, 2.597686375321336;
-% 8.076923076923078, 3.3791773778920304;
-% 16, 3.482005141388174;
-% 32, 3.7596401028277633];
-% 
-% halo_speed_up(:,[1,6]) = ...
-% [1, 1.0038560411311046;
-% 4, 2.515424164524421;
-% 8.000000000000002, 3.2763496143958863;
-% 16.07692307692308, 3.30719794344473;
-% 32, 3.451156812339331];
-% 
-% halo_speed_up(:,1) = round(halo_speed_up(:,1));
-% halo_speed_up(1,:) = round(halo_speed_up(1,:));
-% 
-% %%
-% multigrid_time_haswell = ...
-% [0.7346938775510221, 161.43497757847535;
-% 3.8367346938775526, 115.69506726457405;
-% 7.836734693877553, 108.96860986547085;
-% 15.836734693877553, 108.96860986547085;
-% 31.755102040816325, 107.62331838565024];
-% 
-% multigrid_time_cray = ...
-% [0.9795918367346967, 516.5919282511211;
-% 4.0000000000000036, 390.13452914798205;
-% 7.918367346938776, 367.2645739910314;
-% 15.918367346938776, 360.5381165919282;
-% 31.91836734693878, 356.50224215246635];
-% 
-% multigrid_time_nvidia = ...
-% [0.8979591836734713, 217.9372197309417;
-% 16.000000000000004, 40.35874439461884;
-% 32, 34.97757847533637];
-% 
-% multigrid_time_knc = ...
-% [0.8163265306122458, 357.84753363228697;
-% 7.836734693877553, 137.21973094170403;
-% 15.836734693877553, 122.42152466367713;
-% 31.836734693877553, 96.86098654708519];
-% 
-% multigrid_time_haswell(:,1) = round(multigrid_time_haswell(:,1));
-% multigrid_time_cray(:,1) = round(multigrid_time_cray(:,1));
-% multigrid_time_nvidia(:,1) = round(multigrid_time_nvidia(:,1));
-% multigrid_time_knc(:,1) = round(multigrid_time_knc(:,1));
-% 
-% %%
-% 
-% multigrid_speed_up_haswell = ...
-% [0.8256346233874332, 1.0224719101123583;
-% 3.9409071993341662, 1.4157303370786511;
-% 7.8678318768206434, 1.5101123595505612;
-% 15.86799833541407, 1.525842696629213;
-% 31.86799833541407, 1.525842696629213];
-% 
-% multigrid_speed_up_cray = ...
-% [1.0476903870162317, 1.0067415730337075;
-% 4.088056595921765, 1.321348314606741;
-% 8.01498127340824, 1.4157303370786511;
-% 16.015147732001665, 1.4314606741573028;
-% 32.015147732001665, 1.4314606741573028];
-% 
-% multigrid_speed_up_nvidia = ...
-% [1.1210986267166057, 0.9438202247191008;
-% 15.98119017894299, 5.222471910112359;
-% 32.135996670828135, 5.8516853932584265];
-% 
-% multigrid_speed_up_knc = ...
-% [0.8998751560549323, 1.0382022471910108;
-% 7.9542238868081565, 2.6741573033707864;
-% 15.883478984602585, 2.988764044943819;
-% 31.965709529754477, 3.7595505617977523];
-% 
-% multigrid_speed_up_haswell(:,1) = round(multigrid_speed_up_haswell(:,1));
-% multigrid_speed_up_cray(:,1) = round(multigrid_speed_up_cray(:,1));
-% multigrid_speed_up_nvidia(:,1) = round(multigrid_speed_up_nvidia(:,1));
-% multigrid_speed_up_knc(:,1) = round(multigrid_speed_up_knc(:,1));
-% 
-% %%
-% multigrid_time = zeros(11,6);
-% multigrid_time (:,1:2) = ...
-% [1.004601335761512, 0.431561091324417;
-% 2.0022310518627857, 0.4648076936073582;
-% 3.9907541866293017, 0.5024579804956508;
-% 8.067136920042914, 0.6656173335946528;
-% 15.871378265692428, 0.6812451424979895;
-% 31.611875431385002, 0.6528401603060142;
-% 65.54680834192969, 0.8049984118080382;
-% 128.93640540214113, 0.8052133245926456;
-% 263.7529429587845, 0.8847067251481749;
-% 512.2327024531801, 0.8827157406719066;
-% 1034.5108168706413, 0.96000324396656];
-% 
-% multigrid_time (:,[1,3]) = ...
-% [0.9898630039192093, 0.24219859833611546;
-% 1.972163655048691, 0.24241756607892295;
-% 3.781986290199016, 0.2514317381578326;
-% 7.736449695170425, 0.3309251387133618;
-% 15.41451655389125, 0.33554779106152055;
-% 31.501006611194768, 0.3225638149046748;
-% 62.81135245994453, 0.39764542093845257;
-% 123.54105127778845, 0.38685112220968176;
-% 252.4499560516854, 0.36726161914480926;
-% 496.95223315463164, 0.4357336433123602;
-% 1015.8300692705786, 0.4469699324849459];
-% 
-% multigrid_time (:,[1,4]) = ...
-% [0.9896311818224733, 0.22018017530935952;
-% 1.9968919285183184, 0.21379767110234038;
-% 3.978621194896021, 0.21621848114782338;
-% 8.034514473381059, 0.28469861523177475;
-% 15.804975192978107, 0.28711537031905743;
-% 31.891504605957156, 0.2807328661120385;
-% 64.38430149678541, 0.3227908925638825;
-% 128.2797245536246, 0.3252117026093655;
-% 262.1025006692223, 0.294612988031115;
-% 509.3374728580412, 0.34986990342441215;
-% 1041.3420944190705, 0.37872093101840276];
-% 
-% multigrid_time (:,[1,5]) = ...
-% [0.9895152911343404, 0.20917096379598155;
-% 2.0481938350469275, 0.1983928849000116;
-% 4.028979554277443, 0.198607797684619;
-% 8.135828113905916, 0.2626842471632187;
-% 16.004272808348748, 0.2651010022505018;
-% 32.29213742842352, 0.25431481343813145;
-% 66.03065729822492, 0.29637689484817553;
-% 128.22565290964383, 0.28557854116120485;
-% 258.69919460762884, 0.265984983138132;
-% 522.4595100453286, 0.3410706441301099;
-% 1041.1469872085095, 0.36110619259699783];
-% 
-% multigrid_time (:,[1,6]) = ...
-% [1.0020632930844884, 0.19376212263545245;
-% 2.0218829033820773, 0.18297593382308208;
-% 3.9772236101291005, 0.18319084660768947;
-% 8.030751609469974, 0.24066176917826287;
-% 16.000899443790264, 0.24528442152642138;
-% 32.287599599458105, 0.24110375962207797;
-% 65.18090612879159, 0.2787581014685707;
-% 128.2466780623628, 0.30099143727993405;
-% 258.77797808513225, 0.2946089330729149;
-% 515.7238781063681, 0.3212500084478296;
-% 1040.6837540786007, 0.31927118884616146];
-% 
-% multigrid_time(:,1) = [1;2;4;8;16;32;64;128;256;512;1024];
-% 
-% %%
-% multigrid_speed_up = zeros(11,5);
-% multigrid_speed_up (:,1:2) = ...
-% [0.9748386077230256, 1.8175824175824178;
-% 1.939765632694965, 1.9593406593406595;
-% 3.8598088750025874, 2.0186813186813186;
-% 7.778860438260265, 2.0351648351648355;
-% 15.282657491732875, 2.0615384615384618;
-% 30.79988248222343, 2.0483516483516486;
-% 62.86846815377844, 2.064835164835165;
-% 123.51388400008273, 2.130769230769231;
-% 248.92353402432835, 2.463736263736264;
-% 495.3161606896037, 2.0615384615384618;
-% 998.2347343083767, 2.173626373626374];
-% 
-% multigrid_speed_up (:,[1,3]) = ...
-% [0.9873391553681163, 1.9791208791208796;
-% 2.0153486066729274, 2.1472527472527476;
-% 3.959433740543081, 2.2989010989010987;
-% 7.979639272217277, 2.3450549450549456;
-% 15.677115545750981, 2.384615384615385;
-% 31.5948529717797, 2.338461538461539;
-% 64.49115541353366, 2.5;
-% 128.32660287856152, 2.5032967032967033;
-% 258.6228403103788, 2.9714285714285715;
-% 501.6676974640312, 2.565934065934066;
-% 1023.9999999999993, 2.5758241758241756];
-% 
-% multigrid_speed_up (:,[1,4]) = ...
-% [0.9873391553681163, 2.0813186813186815;
-% 2.0153486066729274, 2.308791208791209;
-% 4.010206339955046, 2.5;
-% 7.979639272217277, 2.5626373626373624;
-% 15.878146288957785, 2.6021978021978027;
-% 31.5948529717797, 2.6054945054945056;
-% 65.31813821309349, 2.753846153846154;
-% 126.70187969737844, 2.757142857142857;
-% 255.34845671095258, 3.301098901098901;
-% 514.6161564485006, 2.5593406593406596;
-% 1011.0352950969501, 2.6483516483516487];
-% 
-% multigrid_speed_up (:,[1,5]) = ...
-% [1, 2.104395604395605;
-% 1.9898325910847585, 2.374725274725275;
-% 3.909303965123828, 2.565934065934066;
-% 7.979639272217277, 2.651648351648352;
-% 15.677115545750981, 2.6714285714285717;
-% 32.4103423084332, 2.5791208791208793;
-% 64.49115541353366, 2.803296703296703;
-% 126.70187969737844, 2.6483516483516487;
-% 255.34845671095258, 2.987912087912088;
-% 501.6676974640312, 2.684615384615385;
-% 1037.130953869863, 2.9450549450549453];
-% 
-% multigrid_speed_up(:,1) = [1;2;4;8;16;32;64;128;256;512;1024];
-%%
-clear all
-close all
-clc
-load('eric_paper.mat')
-load('timers.mat')
-s = linspace(1,32,100);
-
-figure(1);
-hold on 
-plot(throughput_haswell(:,1),throughput_haswell(:,2),'-o','linewidth',2)
-plot(throughput_cray(:,1),throughput_cray(:,2),'-o','linewidth',2)
-plot(throughput_nvidia(:,1),throughput_nvidia(:,2),'-o','linewidth',2)
-plot(throughput_knc(:,1),throughput_knc(:,2),'-o','linewidth',2)
-xlim([1,32])
-title('throughput')
-grid on
-hold off
-
-figure(2);
-hold on 
-plot(matrix_speed_up_haswell(:,1),matrix_speed_up_haswell(:,2),'-o','linewidth',2)
-plot(matrix_speed_up_cray(:,1),matrix_speed_up_cray(:,2),'-o','linewidth',2)
-plot(matrix_speed_up_nvidia(:,1),matrix_speed_up_nvidia(:,2),'-o','linewidth',2)
-plot(matrix_speed_up_knc(:,1),matrix_speed_up_knc(:,2),'-o','linewidth',2)
-%plot(E,E.*timers(6,1)./timers(6,:),'-o','linewidth',2);
-xlim([1,32])
-title('matrix x vector speed up')
-grid on
-hold off
-
-figure(3);
-hold on 
-plot(mrhs_assembly_time_haswell(:,1),mrhs_assembly_time_haswell(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_time_cray(:,1),mrhs_assembly_time_cray(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_time_nvidia(:,1),mrhs_assembly_time_nvidia(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_time_knc(:,1),mrhs_assembly_time_knc(:,2),'-o','linewidth',2)
-xlim([1,32])
-title('matrix and rhs assembly time')
-grid on
-hold off
-
-figure(4);
-hold on 
-plot(mrhs_assembly_speed_up_haswell(:,1),mrhs_assembly_speed_up_haswell(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_speed_up_cray(:,1),mrhs_assembly_speed_up_cray(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_speed_up_nvidia(:,1),mrhs_assembly_speed_up_nvidia(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_speed_up_knc(:,1),mrhs_assembly_speed_up_knc(:,2),'-o','linewidth',2)
-plot(mrhs_assembly_speed_up_theoretical(:,1),mrhs_assembly_speed_up_theoretical(:,2),'ko','linewidth',2)
-plot(s,(8368+4992).*s./(8368+4992.*s),'k','linewidth',2)
-title('matrix and rhs speed up')
-xlim([1,32])
-grid on
-hold off
-
-figure(5);
-hold on 
-plot(halo_time(:,1),halo_time(:,2),'-o','linewidth',2)
-plot(halo_time(:,1),halo_time(:,3),'-o','linewidth',2)
-plot(halo_time(:,1),halo_time(:,4),'-o','linewidth',2)
-plot(halo_time(:,1),halo_time(:,5),'-o','linewidth',2)
-plot(halo_time(:,1),halo_time(:,6),'-o','linewidth',2)
-title('halo time')
-xlim([1,32])
-grid on
-hold off
-
-figure(6);
-hold on 
-plot(halo_speed_up(:,1),halo_speed_up(:,2),'-o','linewidth',2)
-plot(halo_speed_up(:,1),halo_speed_up(:,3),'-o','linewidth',2)
-plot(halo_speed_up(:,1),halo_speed_up(:,4),'-o','linewidth',2)
-plot(halo_speed_up(:,1),halo_speed_up(:,5),'-o','linewidth',2)
-plot(halo_speed_up(:,1),halo_speed_up(:,6),'-o','linewidth',2)
-title('halo speed up')
-xlim([1,32])
-grid on
-hold off
-
-figure(7);
-hold on 
-plot(multigrid_time_haswell(:,1),multigrid_time_haswell(:,2),'-o','linewidth',2)
-plot(multigrid_time_cray(:,1),multigrid_time_cray(:,2),'-o','linewidth',2)
-plot(multigrid_time_nvidia(:,1),multigrid_time_nvidia(:,2),'-o','linewidth',2)
-plot(multigrid_time_knc(:,1),multigrid_time_knc(:,2),'-o','linewidth',2)
-title('multigrid time')
-xlim([1,32])
-grid on
-hold off
-
-figure(8);
-hold on 
-plot(multigrid_speed_up_haswell(:,1),multigrid_speed_up_haswell(:,2),'-o','linewidth',2)
-plot(multigrid_speed_up_cray(:,1),multigrid_speed_up_cray(:,2),'-o','linewidth',2)
-plot(multigrid_speed_up_nvidia(:,1),multigrid_speed_up_nvidia(:,2),'-o','linewidth',2)
-plot(multigrid_speed_up_knc(:,1),multigrid_speed_up_knc(:,2),'-o','linewidth',2)
-xlim([1,32])
-title('multigrid speed up')
-grid on
-hold off
-
-figure(9);
-semilogx(multigrid_time(:,1),multigrid_time(:,2),'k-o','linewidth',2)
-hold on
-plot(multigrid_time(:,1),multigrid_time(:,3),'-o','linewidth',2)
-plot(multigrid_time(:,1),multigrid_time(:,4),'-o','linewidth',2)
-plot(multigrid_time(:,1),multigrid_time(:,5),'-o','linewidth',2)
-plot(multigrid_time(:,1),multigrid_time(:,6),'-o','linewidth',2)
-xlim([1,1024])
-title('multigrid time')
-grid on
-hold off
-
-figure(10);
-semilogx(multigrid_speed_up(:,1),multigrid_speed_up(:,2),'-o','linewidth',2)
-hold on
-plot(multigrid_speed_up(:,1),multigrid_speed_up(:,3),'-o','linewidth',2)
-plot(multigrid_speed_up(:,1),multigrid_speed_up(:,4),'-o','linewidth',2)
-plot(multigrid_speed_up(:,1),multigrid_speed_up(:,5),'-o','linewidth',2)
-xlim([1,1024])
-title('multigrid speed up')
-grid on
-hold off
-
-%%
-s = linspace(1,64,100);
-%close all
-p = polyfit(halo_time(1:3,1),halo_time(1:3,2),1);
-
-figure(11);
-subplot(1,2,1)
-hold on 
-plot(halo_time(:,1),halo_time(:,2),'-o','linewidth',2)
-plot(s,polyval(p,s),'k','linewidth',2)
-title('halo time')
-%xlim([1,32])
-grid on
-hold off
-subplot(1,2,2)
-hold on 
-%plot(halo_speed_up(:,1),halo_speed_up(:,2),'-o','linewidth',2)
-plot(halo_time(:,1),(halo_time(:,1).*halo_time(1,2))./halo_time(:,2),'-o','linewidth',2)
-plot(s,polyval(p,1).*s./polyval(p,s),'k','linewidth',2)
-plot([min(s),max(s)],[(sum(p))/p(1),(sum(p))/p(1)],'k--','linewidth',2)
-title('halo speed up')
-%xlim([1,32])
-grid on
-hold off
-
-
diff --git a/katoptron/matlab/ensemble/eric_paper.mat b/katoptron/matlab/ensemble/eric_paper.mat
deleted file mode 100644
index 1fe2848fa6caa4f96ed19ac814a9e998508d919f..0000000000000000000000000000000000000000
Binary files a/katoptron/matlab/ensemble/eric_paper.mat and /dev/null differ
diff --git a/katoptron/matlab/ensemble/timers.mat b/katoptron/matlab/ensemble/timers.mat
deleted file mode 100644
index f2bd7eb04e3c5b3b36b8dc7af2a04128daf99749..0000000000000000000000000000000000000000
Binary files a/katoptron/matlab/ensemble/timers.mat and /dev/null differ
diff --git a/katoptron/matlab/gmsh/distancePointPlane.m b/katoptron/matlab/gmsh/distancePointPlane.m
deleted file mode 100644
index 356697c159c31835b9f050267a67d78206596b8b..0000000000000000000000000000000000000000
--- a/katoptron/matlab/gmsh/distancePointPlane.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function d = distancePointPlane(point, plane)
-%DISTANCEPOINTPLANE Signed distance betwen 3D point and plane
-%
-%   D = distancePointPlane(POINT, PLANE)
-%   Returns the euclidean distance between point POINT and the plane PLANE,
-%   given by: 
-%   POINT : [x0 y0 z0]
-%   PLANE : [a b c d]
-%   D     : scalar  
-
-
-d = (plane(1)*point(1)+plane(2)*point(2)+plane(3)*point(3)+plane(4))...
-    /sqrt(plane(1)^2+plane(2)^2+plane(3)^2);
\ No newline at end of file
diff --git a/katoptron/matlab/gmsh/readMshFile.m b/katoptron/matlab/gmsh/readMshFile.m
deleted file mode 100644
index bf89cf7e0a5d93074784f72d9c64d59667a746b1..0000000000000000000000000000000000000000
--- a/katoptron/matlab/gmsh/readMshFile.m
+++ /dev/null
@@ -1,68 +0,0 @@
-function [Nodes,Elements] = readMshFile(filename)
-
-    fileID = fopen(filename,'r');
-    
-    tline = fgetl(fileID);
- 
-    stop = false;
-    while 1        
-        if strcmp(tline,'$Nodes')
-            disp('Start reading nodes');
-            while 1
-                tline = fgetl(fileID);
-                if strcmp(tline,'$EndNodes')
-                    break
-                end    
-                tmp = strread(tline);
-                if length(tmp) == 1
-                    Nodes = zeros(tmp,3);
-                else
-                   Nodes(tmp(1),:) = tmp(2:4); 
-                end
-            end
-            disp('Stop reading nodes');
-        elseif strcmp(tline,'$Elements')
-            disp('Start reading elements');   
-            while 1
-                tline = fgetl(fileID);
-                if strcmp(tline,'$EndElements')
-                    stop = true;
-                    break
-                end  
-                tmp = strread(tline);
-                if length(tmp) == 1
-                    Elements = zeros(tmp,9);
-                else
-                   Elements(tmp(1),1) = tmp(2);
-                   
-                   switch Elements(tmp(1),1)
-                       case 1
-                           %segment
-                           Elements(tmp(1),(end-1):end)= tmp((end-1):end);
-                       case 2
-                           %triangle
-                           Elements(tmp(1),(end-2):end)= tmp((end-2):end);
-                       case 3
-                           %quadrangle
-                           Elements(tmp(1),(end-3):end)= tmp((end-3):end);
-                       case 4
-                           %tetrahedron
-                           Elements(tmp(1),(end-3):end)= tmp((end-3):end);
-                       case 5
-                           %hexahedron
-                           Elements(tmp(1),(end-7):end)= tmp((end-7):end);
-                   end
-                    
-                end
-            end
-            disp('Stop reading elements');                
-        end
-        if stop
-            break
-        end
-        tline = fgetl(fileID);        
-    end
-    
-    fclose(fileID);
-
-end
diff --git a/katoptron/matlab/gmsh/showMsh.m b/katoptron/matlab/gmsh/showMsh.m
deleted file mode 100644
index 8c886c414b02642eb79f469e3a14a26a67fe25cd..0000000000000000000000000000000000000000
--- a/katoptron/matlab/gmsh/showMsh.m
+++ /dev/null
@@ -1,129 +0,0 @@
-function [fig] = showMsh(filename, plane, point, vec1, vec2, tol)
-
-    [Nodes,Elements] = readMshFile(filename);
-    
-    fig = figure;
-    
-    hold on
-    for i=1:size(Nodes,1)
-        if distancePointPlane(Nodes(i,:), plane) < tol
-            x = (Nodes(i,:)-point)*vec1';
-            y = (Nodes(i,:)-point)*vec2';
-            plot(x,y,'k.','MarkerSize',10);
-        end
-    end
-    
-    for i=1:size(Elements,1)
-        switch Elements(i,1)
-            case 1
-                %segment
-                if distancePointPlane(Nodes(Elements(i,end-1),:), plane) < tol && ...
-                   distancePointPlane(Nodes(Elements(i,end),:), plane) < tol
-               
-                    x1 = (Nodes(Elements(i,end-1),:)-point)*vec1';
-                    x2 = (Nodes(Elements(i,end),:)-point)*vec1';
-                    y1 = (Nodes(Elements(i,end-1),:)-point)*vec2';
-                    y2 = (Nodes(Elements(i,end),:)-point)*vec2';   
-                    plot([x1,x2],[y1,y2],'k');
-               
-                end
-
-            case 2
-                %triangle
-                for j=1:3
-                    index1 = size(Elements,2)-j;
-                    if j==3
-                        index1 = size(Elements,2);
-                    end
-                    index2 = size(Elements,2)-j+1;
-                    if distancePointPlane(Nodes(Elements(i,index1),:), plane) < tol && ...
-                       distancePointPlane(Nodes(Elements(i,index2),:), plane) < tol
-
-                        x1 = (Nodes(Elements(i,index1),:)-point)*vec1';
-                        x2 = (Nodes(Elements(i,index2),:)-point)*vec1';
-                        y1 = (Nodes(Elements(i,index1),:)-point)*vec2';
-                        y2 = (Nodes(Elements(i,index2),:)-point)*vec2';   
-                        plot([x1,x2],[y1,y2],'k');
-
-                    end
-                end
-            case 3
-                %quadrangle
-                for j=1:4
-                    index1 = size(Elements,2)-j;
-                    if j==4
-                        index1 = size(Elements,2);
-                    end
-                    index2 = size(Elements,2)-j+1;
-                    if distancePointPlane(Nodes(Elements(i,index1),:), plane) < tol && ...
-                       distancePointPlane(Nodes(Elements(i,index2),:), plane) < tol
-
-                        x1 = (Nodes(Elements(i,index1),:)-point)*vec1';
-                        x2 = (Nodes(Elements(i,index2),:)-point)*vec1';
-                        y1 = (Nodes(Elements(i,index1),:)-point)*vec2';
-                        y2 = (Nodes(Elements(i,index2),:)-point)*vec2';   
-                        plot([x1,x2],[y1,y2],'k');
-
-                    end
-                end
-            case 5
-                %hexahedron
-                for j=1:4
-                    index1 = size(Elements,2)-j;
-                    if j==4
-                        index1 = size(Elements,2);
-                    end
-                    index2 = size(Elements,2)-j+1;
-                    if distancePointPlane(Nodes(Elements(i,index1),:), plane) < tol && ...
-                       distancePointPlane(Nodes(Elements(i,index2),:), plane) < tol
-
-                        x1 = (Nodes(Elements(i,index1),:)-point)*vec1';
-                        x2 = (Nodes(Elements(i,index2),:)-point)*vec1';
-                        y1 = (Nodes(Elements(i,index1),:)-point)*vec2';
-                        y2 = (Nodes(Elements(i,index2),:)-point)*vec2';   
-                        plot([x1,x2],[y1,y2],'k');
-
-                    end
-                end 
-                for j=1:4
-                    index1 = size(Elements,2)-j-4;
-                    if j==4
-                        index1 = size(Elements,2)-4;
-                    end
-                    index2 = size(Elements,2)-j-3;
-                    if distancePointPlane(Nodes(Elements(i,index1),:), plane) < tol && ...
-                       distancePointPlane(Nodes(Elements(i,index2),:), plane) < tol
-
-                        x1 = (Nodes(Elements(i,index1),:)-point)*vec1';
-                        x2 = (Nodes(Elements(i,index2),:)-point)*vec1';
-                        y1 = (Nodes(Elements(i,index1),:)-point)*vec2';
-                        y2 = (Nodes(Elements(i,index2),:)-point)*vec2';   
-                        plot([x1,x2],[y1,y2],'k');
-
-                    end
-                end  
-                for j=1:4
-                    index1 = size(Elements,2)-j-4;
-                    if j==4
-                        index1 = size(Elements,2)-4;
-                    end
-                    index2 = size(Elements,2)-j;
-                    if j==4
-                        index2 = size(Elements,2);
-                    end
-                    if distancePointPlane(Nodes(Elements(i,index1),:), plane) < tol && ...
-                       distancePointPlane(Nodes(Elements(i,index2),:), plane) < tol
-
-                        x1 = (Nodes(Elements(i,index1),:)-point)*vec1';
-                        x2 = (Nodes(Elements(i,index2),:)-point)*vec1';
-                        y1 = (Nodes(Elements(i,index1),:)-point)*vec2';
-                        y2 = (Nodes(Elements(i,index2),:)-point)*vec2';   
-                        plot([x1,x2],[y1,y2],'k');
-
-                    end
-                end              
-        end
-
-    end
-    axis equal
-end
\ No newline at end of file
diff --git a/katoptron/matlab/gmsh/test_readMshFile.m b/katoptron/matlab/gmsh/test_readMshFile.m
deleted file mode 100644
index d6b200498a68760a74259aba7a0bac929a21726d..0000000000000000000000000000000000000000
--- a/katoptron/matlab/gmsh/test_readMshFile.m
+++ /dev/null
@@ -1,80 +0,0 @@
-clear all
-close all
-clc
-
-filename = '../tests/aa.msh';
-[Nodes,Elements] = readMshFile(filename);
-
-
-figure
-hold on
-for i=1:size(Nodes,1)
-    
-    
-end
-
-for i=1:size(Elements,1)
-    switch Elements(i,1)
-        case 1
-            %segment
-            plot3([Nodes(Elements(i,end-1),1),Nodes(Elements(i,end),1)],...
-                  [Nodes(Elements(i,end-1),2),Nodes(Elements(i,end),2)],...
-                  [Nodes(Elements(i,end-1),3),Nodes(Elements(i,end),3)],'k');
-        case 2
-            %triangle
-            for j=1:3
-                plot3([Nodes(Elements(i,end-j),1),Nodes(Elements(i,end-j+1),1)],...
-                      [Nodes(Elements(i,end-j),2),Nodes(Elements(i,end-j+1),2)],...
-                      [Nodes(Elements(i,end-j),3),Nodes(Elements(i,end-j+1),3)],'k');
-            end
-        case 3
-            %quadrangle
-            for j=1:4
-                index1 = size(Elements,2)-j;
-                if j==4
-                    index1 = size(Elements,2);
-                end
-                index2 = size(Elements,2)-j+1;
-                plot3([Nodes(Elements(i,index1),1),Nodes(Elements(i,index2),1)],...
-                      [Nodes(Elements(i,index1),2),Nodes(Elements(i,index2),2)],...
-                      [Nodes(Elements(i,index1),3),Nodes(Elements(i,index2),3)],'k');
-            end
-        case 5
-            %hexahedron
-            for j=1:4
-                index1 = size(Elements,2)-j;
-                if j==4
-                    index1 = size(Elements,2);
-                end
-                index2 = size(Elements,2)-j+1;
-                plot3([Nodes(Elements(i,index1),1),Nodes(Elements(i,index2),1)],...
-                      [Nodes(Elements(i,index1),2),Nodes(Elements(i,index2),2)],...
-                      [Nodes(Elements(i,index1),3),Nodes(Elements(i,index2),3)],'k');
-            end 
-            for j=1:4
-                index1 = size(Elements,2)-j-4;
-                if j==4
-                    index1 = size(Elements,2)-4;
-                end
-                index2 = size(Elements,2)-j-3;
-                plot3([Nodes(Elements(i,index1),1),Nodes(Elements(i,index2),1)],...
-                      [Nodes(Elements(i,index1),2),Nodes(Elements(i,index2),2)],...
-                      [Nodes(Elements(i,index1),3),Nodes(Elements(i,index2),3)],'k');
-            end  
-            for j=1:4
-                index1 = size(Elements,2)-j-4;
-                if j==4
-                    index1 = size(Elements,2)-4;
-                end
-                index2 = size(Elements,2)-j;
-                if j==4
-                    index2 = size(Elements,2);
-                end
-                plot3([Nodes(Elements(i,index1),1),Nodes(Elements(i,index2),1)],...
-                      [Nodes(Elements(i,index1),2),Nodes(Elements(i,index2),2)],...
-                      [Nodes(Elements(i,index1),3),Nodes(Elements(i,index2),3)],'k');
-            end              
-    end
-    
-end
-axis equal
\ No newline at end of file
diff --git a/katoptron/matlab/gmsh/test_showMsh.m b/katoptron/matlab/gmsh/test_showMsh.m
deleted file mode 100644
index c549d99c0ad95fda470210404f31aaf43bb6fe9f..0000000000000000000000000000000000000000
--- a/katoptron/matlab/gmsh/test_showMsh.m
+++ /dev/null
@@ -1,12 +0,0 @@
-clear all
-close all
-clc
-
-filename = '../tests/aa.msh';
-tol = 0.00001;
-plane = [0,1,0,0];
-point = [0,0,0];
-vec1 = [1,0,0];
-vec2 = [0,0,1];
-
-[fig] = showMsh(filename, plane, point, vec1, vec2, tol);
\ No newline at end of file
diff --git a/katoptron/matlab/matrix graph/load_crs_matrix.m b/katoptron/matlab/matrix graph/load_crs_matrix.m
deleted file mode 100644
index 04cf7ba70548ac6670768aa6cfaa234954e7037a..0000000000000000000000000000000000000000
--- a/katoptron/matlab/matrix graph/load_crs_matrix.m	
+++ /dev/null
@@ -1,42 +0,0 @@
-function [ A ] = load_crs_matrix( file_name, ensemble_size, sample )
-
-
-crsA = [];
-
-fid = fopen(file_name);
-
-tline = fgets(fid);
-while length(tline) >=2
-    words = strsplit(tline);
-    if ensemble_size > 1 && length(words) >= 4+ensemble_size
-        if length(crsA) == 0      
-            crsA = zeros(1,3);
-            crsA(1) = str2num(char(words(1)))+1;
-            crsA(2) = str2num(char(words(2)))+1;
-            crsA(3) = str2num(char(words(3+sample)));
-        else
-            
-            crsA = [crsA; str2num(char(words(1)))+1, str2num(char(words(2)))+1, str2num(char(words(3+sample)))];
-        end
-        
-    elseif ensemble_size == 1 && length(words) >= 3
-         if length(crsA) == 0      
-            crsA = zeros(1,3);
-            crsA(1) = str2num(char(words(1)))+1;
-            crsA(2) = str2num(char(words(2)))+1;
-            crsA(3) = str2num(char(words(3)));
-        else
-            
-            crsA = [crsA; str2num(char(words(1)))+1, str2num(char(words(2)))+1, str2num(char(words(3)))];
-        end       
-        
-    end
-    tline = fgets(fid);
-end
-
-fclose(fid);
-
-A = crsA;
-
-end
-
diff --git a/katoptron/matlab/matrix graph/show_graph.m b/katoptron/matlab/matrix graph/show_graph.m
deleted file mode 100644
index b85cc5ad473a09ecf7e3e04396f39b6703dae105..0000000000000000000000000000000000000000
--- a/katoptron/matlab/matrix graph/show_graph.m	
+++ /dev/null
@@ -1,52 +0,0 @@
-function show_graph(A,type)
-
-    figure;
-    xmax = size(A,2);
-    ymax = size(A,1);
-    if type == 'C'
-        imagesc([0.5 xmax-0.5],[0.5 ymax-0.5],A);
-    else
-        imagesc([1.5 xmax+0.5],[1.5 ymax+0.5],A);
-    end
-    axis equal
-    grid on
-    box on
-    %colorbar
-
-
-    if type == 'C'
-        xlim([0,xmax]);
-        ylim([0,ymax]);
-        
-        tmp = [];
-        for i=1:xmax
-            tmp = [tmp, i-1];
-        end
-        set(gca,'XTick',tmp)
-        tmp = [];
-        for i=1:ymax
-            tmp = [tmp, i-1];
-        end
-        set(gca,'YTick',tmp)
-    else
-        xlim([1,xmax+1]);
-        ylim([1,ymax+1]);
-        
-        tmp = [];
-        for i=1:xmax
-            tmp = [tmp, i];
-        end
-        set(gca,'XTick',tmp)
-        tmp = [];
-        for i=1:ymax
-            tmp = [tmp, i];
-        end
-        set(gca,'YTick',tmp)
-    end    
-    caxis([0,1]);
-    
-    set(gca,'fontsize',18)
-    
-    colormap(gray);
-    colormap(flipud(colormap));
-end
\ No newline at end of file
diff --git a/katoptron/matlab/matrix graph/show_trilinos_graph.m b/katoptron/matlab/matrix graph/show_trilinos_graph.m
deleted file mode 100644
index 6d5f5b6743edf77631fecc59e15fe2f0ff007204..0000000000000000000000000000000000000000
--- a/katoptron/matlab/matrix graph/show_trilinos_graph.m	
+++ /dev/null
@@ -1,31 +0,0 @@
-function [H] = show_trilinos_graph(file_name)
-
-trilinos_out = load(file_name);
-
-matrix = trilinos_out;
-matrix(:,1) = matrix(:,1)+1;
-matrix(:,2) = matrix(:,2)+1;
-
-matrix(1,:)
-
-zero_indices = [];
-
-tol = 10^(-16);
-
-for i=1:size(matrix,1)
-    if abs(matrix(i,3)) < tol
-        zero_indices = [zero_indices, i];
-    elseif matrix(i,1) < 1 || matrix(i,2) < 1
-        zero_indices = [zero_indices, i];
-        disp(strcat('Attention, file:  ',file_name,' line:  ', int2str(i)));
-    end
-    
-end
-
-matrix = matrix(setdiff(1:size(matrix,1),zero_indices),1:3);
-
-H = spconvert(matrix);
-%spy(H);
-
-end
-
diff --git a/katoptron/matlab/matrix graph/testSchur.m b/katoptron/matlab/matrix graph/testSchur.m
deleted file mode 100644
index 24747c8647a439ef8cffc74697a15536c2469c01..0000000000000000000000000000000000000000
--- a/katoptron/matlab/matrix graph/testSchur.m	
+++ /dev/null
@@ -1,70 +0,0 @@
-clear all 
-close all
-clc
-
-ensemble_size = 2;
-
-
-A  = load_crs_matrix( 'Schur test input/A 1.txt', ensemble_size,1 );
-B_T  = load_crs_matrix( 'Schur test input/B_T1.txt', ensemble_size,1 );
-
-B1  = load_crs_matrix( 'Schur test input/B1.txt', ensemble_size,1 );
-C1  = load_crs_matrix( 'Schur test input/C1.txt', ensemble_size,1 );
-
-B2  = load_crs_matrix( 'Schur test input/B1.txt', ensemble_size,2 );
-C2  = load_crs_matrix( 'Schur test input/C1.txt', ensemble_size,2 );
-
-%load('schur_test.mat')
-
-%format longEng
-
-format long
-
-crsA = spconvert(A);
-crsB_T = spconvert(B_T);
-crsB1 = spconvert(B1);
-crsB2 = spconvert(B2);
-crsC1 = spconvert(C1);
-crsC2 = spconvert(C2);
-
-n = size(crsA,1);
-n_2 = size(crsB_T,1);
-m = size(crsB_T,2);
-
-fullA = full(crsA);
-fullB_T = zeros(n,m);
-tmpfullB_T = full(crsB_T);
-fullB_T(1:n_2,:) = tmpfullB_T;
-
-fullC1 = zeros(m,m);
-fullC2 = zeros(m,m);
-
-tmpfullC1 = full(crsC1);
-tmpfullC2 = full(crsC2);
-
-fullC1(1:size(crsC1,1),1:size(crsC1,2)) = tmpfullC1;
-fullC2(1:size(crsC2,1),1:size(crsC2,2)) = tmpfullC2;
-
-
-fullB1 = zeros(m,n);
-fullB2 = zeros(m,n);
-
-tmpfullB1 = full(crsB1);
-tmpfullB2 = full(crsB2);
-
-fullB1(1:size(crsB1,1),1:size(crsB1,2)) = tmpfullB1;
-fullB2(1:size(crsB2,1),1:size(crsB2,2)) = tmpfullB2;
-
-invDiagA = diag(1./diag(fullA));
-
-Schur1 = fullC1 - fullB1*invDiagA*fullB_T;
-Schur2 = fullC2 - fullB2*invDiagA*fullB_T;
-
-crsSchur1 = sparse(Schur1);
-crsSchur2 = sparse(Schur2);
-
-diagEnsemble = [full(diag(crsSchur1)),full( diag(crsSchur2))]
-
-
-
-
diff --git a/katoptron/matlab/matrix graph/test_show_graph.m b/katoptron/matlab/matrix graph/test_show_graph.m
deleted file mode 100644
index 36f54c4249a7f57def064be77fbcfbbde514e2d7..0000000000000000000000000000000000000000
--- a/katoptron/matlab/matrix graph/test_show_graph.m	
+++ /dev/null
@@ -1,42 +0,0 @@
-close all
-clear all
-
-XWO0 = [1,1,0,0,0;
-        1,1,1,0,0;
-        0,1,1,0,0;
-        0,0,0,0,0;
-        0,0,0,0,0];
-XWO1 = [0,0,0,0,0;
-        0,0,0,0,0;
-        0,0,1,1,0;
-        0,0,1,1,1;
-        0,0,0,1,1]; 
- 
-X0 = [1,1,0,0,0;
-      1,1,1,0,0;
-      0,1,1,1,0;
-      0,0,0,0,0;
-      0,0,0,0,0];
-  
-X1 = [0,0,0,0,0;
-     0,0,0,0,0;
-     0,0,0,0,0;
-     0,0,1,1,1;
-     0,0,0,1,1];  
- 
-XG = [1,1,0,0,0;
-      1,1,1,0,0;
-      0,1,1,1,0;
-      0,0,1,1,1;
-      0,0,0,1,1];
- 
-show_graph(XWO0,'C')
-%matlab2tikz('XWO0.txt')
-show_graph(XWO1,'C')
-%matlab2tikz('XWO1.txt')
-show_graph(XG,'C')
-%matlab2tikz('XG.txt')
-show_graph(X0,'C')
-%matlab2tikz('X0.txt')
-show_graph(X1,'C')
-%matlab2tikz('X1.txt')
\ No newline at end of file
diff --git a/katoptron/preconditioners/AMG_BGS_gs_gs.xml b/katoptron/preconditioners/AMG_BGS_gs_gs.xml
deleted file mode 100644
index 65889a5d40a4c1eaa2069cb9cc195c696cf8b3fa..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/AMG_BGS_gs_gs.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Elasticity 3 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 3 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) Heat equation-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 1 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 1 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- It needs information about the coarse map for block 1 (myCoarseMap1 in this
-         example). It builds a new coarse map starting with GIDs from myCoarseMap1.maxGID + 1.
-         The number of GIDs is determined using the aggregation information. Since we are
-         reusing the aggregation from the first sub block for this sub block we have to
-         provide that information (myAggFact1). In fact, the information should also available
-         through the group "mySecondGroup", but it does not hurt here. -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="BlockedCoarseMapFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from elasticity block! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="Striding info" type="string" value="{ 1 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from elasticity block! -->
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from elasticity block! -->
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>    
-
-
-    <!-- Use Block GS: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="1.0"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/BraessSarazin_cheby.xml b/katoptron/preconditioners/BraessSarazin_cheby.xml
deleted file mode 100644
index 1b9d268fbc305836f30ebdc1070d1cadeed76768..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/BraessSarazin_cheby.xml
+++ /dev/null
@@ -1,243 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Braess-Sarazin: -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BraessSarazinSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/BraessSarazin_direct.xml b/katoptron/preconditioners/BraessSarazin_direct.xml
deleted file mode 100644
index e41282045bee590a997002a72119351f2edc926f..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/BraessSarazin_direct.xml
+++ /dev/null
@@ -1,237 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use Braess-Sarazin: -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BraessSarazinSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/BraessSarazin_gs.xml b/katoptron/preconditioners/BraessSarazin_gs.xml
deleted file mode 100644
index 348a4f7c485f1383489a3dc4834215d75eaac780..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/BraessSarazin_gs.xml
+++ /dev/null
@@ -1,249 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Braess-Sarazin: -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BraessSarazinSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/BraessSarazin_jacobi.xml b/katoptron/preconditioners/BraessSarazin_jacobi.xml
deleted file mode 100644
index ba583b551854f043a35a3d2bed69e296f1fdf673..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/BraessSarazin_jacobi.xml
+++ /dev/null
@@ -1,249 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Braess-Sarazin: -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BraessSarazinSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/BraessSarazin_mtgs.xml b/katoptron/preconditioners/BraessSarazin_mtgs.xml
deleted file mode 100644
index aa57ebe1ed5381f982b5651e910d01353bfb7e30..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/BraessSarazin_mtgs.xml
+++ /dev/null
@@ -1,251 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Braess-Sarazin: -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BraessSarazinSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/IndefiniteBlockDiagonal_cheby.xml b/katoptron/preconditioners/IndefiniteBlockDiagonal_cheby.xml
deleted file mode 100644
index 9994cda693853fabf8b2f9b76db18460114e438c..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/IndefiniteBlockDiagonal_cheby.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use indefinite block diagonal smoother: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="IndefiniteBlockDiagonalSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/IndefiniteBlockDiagonal_direct.xml b/katoptron/preconditioners/IndefiniteBlockDiagonal_direct.xml
deleted file mode 100644
index 0eb1c647a1d9cb206c2aa3f938d27b1d45f49fae..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/IndefiniteBlockDiagonal_direct.xml
+++ /dev/null
@@ -1,244 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use indefinite block diagonal smoother: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="IndefiniteBlockDiagonalSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/IndefiniteBlockDiagonal_gs.xml b/katoptron/preconditioners/IndefiniteBlockDiagonal_gs.xml
deleted file mode 100644
index 4860200f22b092fe8e637710190fbb5bef7c6dfa..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/IndefiniteBlockDiagonal_gs.xml
+++ /dev/null
@@ -1,256 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use indefinite block diagonal smoother: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="IndefiniteBlockDiagonalSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/IndefiniteBlockDiagonal_jacobi.xml b/katoptron/preconditioners/IndefiniteBlockDiagonal_jacobi.xml
deleted file mode 100644
index b13e54b2025bcd1669ae3e728f372910873b869b..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/IndefiniteBlockDiagonal_jacobi.xml
+++ /dev/null
@@ -1,256 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use indefinite block diagonal smoother: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="IndefiniteBlockDiagonalSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/IndefiniteBlockDiagonal_mtgs.xml b/katoptron/preconditioners/IndefiniteBlockDiagonal_mtgs.xml
deleted file mode 100644
index c6a9d26ed82d6671552d56be88230652b524413c..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/IndefiniteBlockDiagonal_mtgs.xml
+++ /dev/null
@@ -1,258 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use indefinite block diagonal smoother: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="IndefiniteBlockDiagonalSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLEC_cheby.xml b/katoptron/preconditioners/SIMPLEC_cheby.xml
deleted file mode 100644
index 6a860ca049023cfce4fd425d0445514056b66f3a..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLEC_cheby.xml
+++ /dev/null
@@ -1,251 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <!--<Parameter name="lumping" type="bool" value="true"/>-->
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLEC: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLEC_direct.xml b/katoptron/preconditioners/SIMPLEC_direct.xml
deleted file mode 100644
index 181f71e6ff72b5de3ffba6f147cf9fbc93a5bd46..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLEC_direct.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <!--<Parameter name="lumping" type="bool" value="true"/>-->
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use SIMPLEC: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLEC_gs.xml b/katoptron/preconditioners/SIMPLEC_gs.xml
deleted file mode 100644
index aa8574d4028a98a7e90fe210fef158c8f40ed043..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLEC_gs.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <!--<Parameter name="lumping" type="bool" value="true"/>-->
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLEC: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLEC_jacobi.xml b/katoptron/preconditioners/SIMPLEC_jacobi.xml
deleted file mode 100644
index 0748d6782fb3624b5c25dbde8142acf5e6045de7..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLEC_jacobi.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <!--<Parameter name="lumping" type="bool" value="true"/>-->
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLEC: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLEC_mtgs.xml b/katoptron/preconditioners/SIMPLEC_mtgs.xml
deleted file mode 100644
index 750a4c79f05c5281feb26a10ca22c0efd72da84e..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLEC_mtgs.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <!--<Parameter name="lumping" type="bool" value="true"/>-->
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLEC: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="true"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLE_cheby.xml b/katoptron/preconditioners/SIMPLE_cheby.xml
deleted file mode 100644
index 27fc352bd32f4a21a2b3b7d4bcecf387e00b9a14..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_cheby.xml
+++ /dev/null
@@ -1,251 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLE_direct.xml b/katoptron/preconditioners/SIMPLE_direct.xml
deleted file mode 100644
index bbb4f080a0a7eac5beafa609ca025404e55b1588..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_direct.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLE_direct_2_lvls.xml b/katoptron/preconditioners/SIMPLE_direct_2_lvls.xml
deleted file mode 100644
index c1caa86a879d182d0f6ee2ae1d87e7310869f3c5..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_direct_2_lvls.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-        
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="2"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLE_gs.xml b/katoptron/preconditioners/SIMPLE_gs.xml
deleted file mode 100644
index a2ec20ff8279f2310e03c65a75928c87760ec730..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/SIMPLE_gs.xml.in b/katoptron/preconditioners/SIMPLE_gs.xml.in
deleted file mode 100644
index 8bed4cda291862fbaab49eb359fafc41bb25e683..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs.xml.in
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="$BLOCK_11_STRIDING_INFO"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="$BLOCK_00_GS_sweeps"/>
-        <Parameter name="relaxation: damping factor" type="double" value="$BLOCK_00_GS_damping"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="$SCHUR_omega"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="$BLOCK_11_GS_sweeps"/>
-        <Parameter name="relaxation: damping factor" type="double" value="$BLOCK_11_GS_damping"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="$SimpleSmoother_damping"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/SIMPLE_gs_2_lvls.xml b/katoptron/preconditioners/SIMPLE_gs_2_lvls.xml
deleted file mode 100644
index be2fa416ae8115aa1d7402b68fdd7f9df0b12307..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs_2_lvls.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="2"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/SIMPLE_gs_3_sweeps.xml b/katoptron/preconditioners/SIMPLE_gs_3_sweeps.xml
deleted file mode 100644
index 5cc5766797b2f458ad92fb8d15af575dcc20e68c..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs_3_sweeps.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLE_gs_direct.xml.in b/katoptron/preconditioners/SIMPLE_gs_direct.xml.in
deleted file mode 100644
index 60705f07a27d9b9e0507cbd0262e304522554950..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs_direct.xml.in
+++ /dev/null
@@ -1,250 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="$BLOCK_11_STRIDING_INFO"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="$BLOCK_00_GS_sweeps"/>
-        <Parameter name="relaxation: damping factor" type="$BLOCK_00_GS_damping"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="$SCHUR_omega"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="$SimpleSmoother_damping"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/SIMPLE_gs_direct_lvl.xml.in b/katoptron/preconditioners/SIMPLE_gs_direct_lvl.xml.in
deleted file mode 100644
index 802719777c4c9445b12eb70b4dfb8181bcf65659..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs_direct_lvl.xml.in
+++ /dev/null
@@ -1,276 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoalesceDropFact">
-      <Parameter name="factory"                             type="string" value="CoalesceDropFactory"/>
-      <Parameter name="lightweight wrap"                    type="bool"   value="true"/>
-      <!-- for aggregation dropping -->
-      <!--<Parameter name="aggregation: drop tol"               type="double" value="1e-10"/>-->
-    </ParameterList>    
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <!--<Parameter name="aggregation: min agg size" type="int" value="7"/>-->
-      <!--<Parameter name="aggregation: max agg size" type="int" value="10"/>-->
-      <!--<Parameter name="aggregation: max selected neighbors" type="int" value="1"/>-->
-      <!--<Parameter name="Graph"                               type="string" value="myCoalesceDropFact"/>
-      <Parameter name="DofsPerNode"                         type="string" value="myCoalesceDropFact"/>-->        
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>      
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="$BLOCK_11_STRIDING_INFO"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>      
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myAggExport"> 
-      <Parameter name="factory"                             type="string" value="AggregationExportFactory"/> 
-      <Parameter name="Aggregates"                          type="string" value="myAggFact1"/> 
-      <Parameter name="aggregation: output filename"        type="string" value="structured_aggs"/> 
-      <Parameter name="aggregation: output file: agg style" type="string" value="Jacks"/> 
-      <Parameter name="aggregation: output file: agg style" type="string" value="Convex Hulls"/> 
-    </ParameterList> -->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-        <!--<Parameter name="ExportVTK"                   type="string" value="myAggExport"/>-->
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="$BLOCK_00_GS_sweeps"/>
-        <Parameter name="relaxation: damping factor" type="double" value="$BLOCK_00_GS_damping"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="$SCHUR_omega"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="BASKER"/>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="$SimpleSmoother_sweeps"/>
-      <Parameter name="Damping factor" type="double" value="$SimpleSmoother_damping"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-      <Parameter name="type"  type="string" value="BASKER"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="$N_LVLS"/>
-    <Parameter name="coarse: max size"          type="int"      value="$N_SIZES"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-    <Parameter name="aggregation: export visualization data" type="bool" value="$EXPORT_DATA"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <Parameter name="Coordinates"       type="string"   value="myTransferCoordinatesFact"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/SIMPLE_gs_direct_lvl_MT.xml.in b/katoptron/preconditioners/SIMPLE_gs_direct_lvl_MT.xml.in
deleted file mode 100644
index daa5b75ed0558b00ed6b875f4b1240ed2a1ec614..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_gs_direct_lvl_MT.xml.in
+++ /dev/null
@@ -1,276 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_00_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myCoalesceDropFact">
-      <Parameter name="factory"                             type="string" value="CoalesceDropFactory"/>
-      <Parameter name="lightweight wrap"                    type="bool"   value="true"/>
-      <!-- for aggregation dropping -->
-      <!--<Parameter name="aggregation: drop tol"               type="double" value="1e-10"/>-->
-    </ParameterList>    
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <!--<Parameter name="aggregation: min agg size" type="int" value="7"/>-->
-      <!--<Parameter name="aggregation: max agg size" type="int" value="10"/>-->
-      <!--<Parameter name="aggregation: max selected neighbors" type="int" value="1"/>-->
-      <!--<Parameter name="Graph"                               type="string" value="myCoalesceDropFact"/>
-      <Parameter name="DofsPerNode"                         type="string" value="myCoalesceDropFact"/>-->        
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>      
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ $BLOCK_11_STRIDING_INFO }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_11_STRIDING_INFO }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="$BLOCK_11_STRIDING_INFO"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-      <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-      <Parameter name="tentative: calculate qr" type="bool" value="false"/>      
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myAggExport"> 
-      <Parameter name="factory"                             type="string" value="AggregationExportFactory"/> 
-      <Parameter name="Aggregates"                          type="string" value="myAggFact1"/> 
-      <Parameter name="aggregation: output filename"        type="string" value="structured_aggs"/> 
-      <Parameter name="aggregation: output file: agg style" type="string" value="Jacks"/> 
-      <Parameter name="aggregation: output file: agg style" type="string" value="Convex Hulls"/> 
-    </ParameterList> -->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-        <!--<Parameter name="ExportVTK"                   type="string" value="myAggExport"/>-->
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="$BLOCK_00_GS_sweeps"/>
-        <Parameter name="relaxation: damping factor" type="double" value="$BLOCK_00_GS_damping"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="$SCHUR_omega"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="$SimpleSmoother_sweeps"/>
-      <Parameter name="Damping factor" type="double" value="$SimpleSmoother_damping"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-      <Parameter name="type"  type="string" value="BASKER"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="$N_LVLS"/>
-    <Parameter name="coarse: max size"          type="int"      value="$N_SIZES"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-    <Parameter name="aggregation: export visualization data" type="bool" value="$EXPORT_DATA"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <Parameter name="Coordinates"       type="string"   value="myTransferCoordinatesFact"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/SIMPLE_jacobi.xml b/katoptron/preconditioners/SIMPLE_jacobi.xml
deleted file mode 100644
index 8a9ca96c74f443a3cf7204cdb29d8658af5673b8..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_jacobi.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/SIMPLE_mtgs.xml b/katoptron/preconditioners/SIMPLE_mtgs.xml
deleted file mode 100644
index 0cba3b545281161c5169ab358eea82661b263aa7..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/SIMPLE_mtgs.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the
-         Factory creates the default null space containing of constant
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the
-         Factory creates the default null space containing of constant
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="1."/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="1."/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-
diff --git a/katoptron/preconditioners/Uzawa_cheby.xml b/katoptron/preconditioners/Uzawa_cheby.xml
deleted file mode 100644
index 1c8d7bdff671a71fa6dc263f74bb2145710c6187..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/Uzawa_cheby.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="CHEBYSHEV"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="degree" type="int" value="2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Uzawa: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="UzawaSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/Uzawa_direct.xml b/katoptron/preconditioners/Uzawa_direct.xml
deleted file mode 100644
index 0953891f90e5755c9c4f7ddb65a687994ed82460..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/Uzawa_direct.xml
+++ /dev/null
@@ -1,244 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>
-
-    <!-- Use Uzawa: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="UzawaSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/Uzawa_gs.xml b/katoptron/preconditioners/Uzawa_gs.xml
deleted file mode 100644
index 920eaa7e4723e67e1506721955e6182b9324a665..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/Uzawa_gs.xml
+++ /dev/null
@@ -1,256 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Uzawa: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="UzawaSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/Uzawa_jacobi.xml b/katoptron/preconditioners/Uzawa_jacobi.xml
deleted file mode 100644
index becd02d913b4f11ae27f0470ddf6c635c8b77173..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/Uzawa_jacobi.xml
+++ /dev/null
@@ -1,256 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Jacobi"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Uzawa: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="UzawaSmoother"/>
-      <Parameter name="Sweeps" type="int" value="3"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/Uzawa_mtgs.xml b/katoptron/preconditioners/Uzawa_mtgs.xml
deleted file mode 100644
index c1d21dca8244ec1925470c1bb31d02d1dd8ec359..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/Uzawa_mtgs.xml
+++ /dev/null
@@ -1,258 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 2 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="3"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory -->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="false"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="MT Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: symmetric matrix structure" type="bool" value="True"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="3"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use Uzawa: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="UzawaSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/preconditioners/blockdirect.xml b/katoptron/preconditioners/blockdirect.xml
deleted file mode 100644
index 4a5b0a725a2d1e8dac22e6863a2397a672bdb440..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/blockdirect.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="1"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
diff --git a/katoptron/preconditioners/gs_lvl.xml.in b/katoptron/preconditioners/gs_lvl.xml.in
deleted file mode 100644
index 2439cadc0668c278bed430289acdee9149595318..0000000000000000000000000000000000000000
--- a/katoptron/preconditioners/gs_lvl.xml.in
+++ /dev/null
@@ -1,95 +0,0 @@
-
-<ParameterList name="MueLu">
-
-  <ParameterList name="Matrix">
-    <Parameter name="PDE equations"                   type="int" value="$BLOCK_00_STRIDING_INFO"/> <!-- Number of PDE equations at each grid node.-->
-  </ParameterList>
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <ParameterList name="myCoalesceDropFact">
-      <Parameter name="factory"                             type="string" value="CoalesceDropFactory"/>
-      <Parameter name="lightweight wrap"                    type="bool"   value="true"/>
-      <!-- for aggregation dropping -->
-      <Parameter name="aggregation: drop tol"               type="double" value="1e-10"/>
-    </ParameterList>
-
-    <ParameterList name="mySmooFact">
-      <Parameter name="factory"                             type="string" value="TrilinosSmoother"/>
-      <Parameter name="type"                                type="string" value="RELAXATION"/>
-      <Parameter name="overlap"                             type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type"                  type="string" value="MT Gauss-Seidel"/>
-        <Parameter name="relaxation: backward mode"         type="bool"   value="true"/>
-        <Parameter name="relaxation: sweeps"                type="int"    value="$BLOCK_00_GS_sweeps"/>
-        <Parameter name="relaxation: damping factor"        type="double" value="$BLOCK_00_GS_damping"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myCoarseFact">
-      <Parameter name="factory" type="string" value="DirectSolver"/>
-      <Parameter name="type"  type="string" value="KLU"/>
-    </ParameterList>    
-
-    <ParameterList name="myAggFact">
-      <Parameter name="factory"                             type="string" value="UncoupledAggregationFactory"/>
-      <!-- <Parameter name="aggregation: min agg size" type="int" value="7"/> -->
-      <!-- <Parameter name="aggregation: max agg size" type="int" value="4"/> -->
-      <!-- <Parameter name="aggregation: max selected neighbors" type="int" value="1"/> -->      
-      <Parameter name="Graph"                               type="string" value="myCoalesceDropFact"/>
-      <Parameter name="DofsPerNode"                         type="string" value="myCoalesceDropFact"/>      
-    </ParameterList>
-
-    <ParameterList name="MyCoarseMap">
-      <Parameter name="factory"                             type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ $BLOCK_00_STRIDING_INFO }"/>
-      <Parameter name="Aggregates"                          type="string" value="myAggFact"/>
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact">
-      <Parameter name="factory"                             type="string" value="TentativePFactory"/>
-      <Parameter name="Aggregates"                          type="string" value="myAggFact"/>
-      <Parameter name="CoarseMap"                           type="string" value="MyCoarseMap"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact">
-      <Parameter name="factory"                             type="string" value="TransPFactory"/>
-      <Parameter name="P"                                   type="string" value="myTentativePFact"/>
-    </ParameterList>
-
-    <ParameterList name="myAggExport"> 
-      <Parameter name="factory"                             type="string" value="AggregationExportFactory"/> 
-      <Parameter name="Aggregates"                          type="string" value="myAggFact"/> 
-      <Parameter name="aggregation: output filename"        type="string" value="structured_aggs"/> 
-      <Parameter name="aggregation: output file: agg style" type="string" value="Jacks"/> 
-      <Parameter name="aggregation: output file: agg style" type="string" value="Convex Hulls"/>
-    </ParameterList>
-
-    <ParameterList name="myRAPFact">
-      <Parameter name="factory" type="string" value="RAPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact"/>
-      <Parameter name="R" type="string" value="myRFact"/>
-      <ParameterList name="TransferFactories">
-        <Parameter name="ExportVTK"                   type="string" value="myAggExport"/>
-      </ParameterList>
-    </ParameterList>
-
-  </ParameterList>
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-    <Parameter name="max levels"                            type="int"      value="$N_LVLS"/>
-    <Parameter name="coarse: max size"                      type="int"      value="$N_SIZES"/>
-    <Parameter name="verbosity"                             type="string"   value="High"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"                          type="int"      value="0"/>
-      <Parameter name="Smoother"                            type="string"   value="mySmooFact"/>
-      <Parameter name="CoarseSolver"                        type="string"   value="myCoarseFact"/>
-      <Parameter name="P"                                   type="string"   value="myTentativePFact"/>
-      <Parameter name="R"                                   type="string"   value="myRFact"/>           
-      <Parameter name="A"                                   type="string"   value="myRAPFact"/> 
-    </ParameterList>
-  </ParameterList>
-</ParameterList>
\ No newline at end of file
diff --git a/katoptron/readers.py b/katoptron/readers.py
deleted file mode 100644
index 2d887e267b782850b9440d5b891ba812cb514aca..0000000000000000000000000000000000000000
--- a/katoptron/readers.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-import numpy as np
-
-
-def read_timers(filename, querylines):
-    file = open(filename, "r")
-    times = np.zeros((len(querylines),))
-    for line in file:
-        words = line.split()
-        if len(words) == 0:
-            continue
-        for i in range(0, len(querylines)):
-            if times[i] == 0.:
-                if words[0] == querylines[i]:
-                    times[i] = float(words[2])
-                    continue
-    file.close()
-    return times
-
-
-def read_teuchos_timers(filename, querylines):
-    file = open(filename, "r")
-    times = np.zeros((len(querylines),))
-    for line in file:
-        words = line.split()
-        if len(words) == 0:
-            continue
-        for i in range(0, len(querylines)):
-            if times[i] == 0.:
-                querylines_words = querylines[i].split()
-                has_to_be_read = True
-                for j in range(0, len(querylines_words)):
-                    if words[j] != querylines_words[j]:
-                        has_to_be_read = False
-                        break
-                if has_to_be_read:
-                    times[i] = float(words[len(querylines_words)])
-                    continue
-    file.close()
-    return times
-
-
-def read_Belos(filename, ensemble_size):
-    active_set_number = 1
-
-    number_of_criterion = 0
-
-    previously_an_iter = False
-
-    iter_indices = np.array([])
-
-    residuals = np.array([])
-
-    file = open(filename, "r")
-    for line in file:
-        words = line.split()
-        if len(words) == 0:
-            continue
-        if words[0] == "Iter":
-            previously_an_iter = True
-            word = words[1]
-            len_word = len(word)
-            if iter_indices.size != 0:
-                iter_indices = np.append(
-                    iter_indices, [int(word[:(len_word-1)])], axis=0)
-            else:
-                iter_indices = np.array([int(word[:(len_word-1)])])
-
-            if number_of_criterion == 0:
-                word = words[3]
-                len_word = len(word)
-
-                number_of_criterion = int(word[:(len_word-1)])
-            if number_of_criterion == 1:
-                if ensemble_size > 1:
-
-                    residual = np.array([float(words[6])])
-                    for i in range(1, ensemble_size):
-                        residual = np.append(residual, [float(words[6+i])])
-                    if residuals.size != 0:
-                        residuals = np.append(residuals, [residual], axis=0)
-                    else:
-                        residuals = np.array([residual])
-
-                else:
-                    if residuals.size != 0:
-                        residuals = np.append(
-                            residuals, [float(words[5])], axis=0)
-                    else:
-                        residuals = np.array([float(words[5])])
-        elif previously_an_iter:
-            previously_an_iter = False
-            active_set_number = active_set_number + 1
-
-    file.close()
-    return iter_indices, residuals
-
-
-def plot_Belos(iter_indices, residuals, ensemble_size=1, hold=False, color_offset=1):
-    import matplotlib.pyplot as plt
-
-    col = {'c1': (0., 0.4470, 0.7410),     'c2': (0.8500, 0.3250, 0.0980),
-           'c3': (0.9290, 0.6940, 0.1250), 'c4': (0.4940, 0.1840, 0.5560),
-           'c5': (0.4660, 0.6740, 0.1880), 'c6': (0.3010, 0.7450, 0.9330),
-           'c7': (0.6350, 0.0780, 0.1840), 'c8': (0, 0.4470, 0.7410)}
-
-    plt_linewidth = 2
-    plt.style.use('ggplot')
-
-    if hold == False:
-        plt.figure(figsize=(8, 8))
-        plt.grid(True)
-
-    if ensemble_size > 1:
-        for i in range(0, ensemble_size):
-            plt.semilogy(iter_indices, residuals[:, i], '-', color=col['c'+str(
-                color_offset+i)], zorder=2, linewidth=plt_linewidth)
-    else:
-        plt.semilogy(iter_indices, residuals, '-',
-                     color=col['c'+str(color_offset)], zorder=2, linewidth=plt_linewidth)
diff --git a/katoptron/speedup.py b/katoptron/speedup.py
deleted file mode 100644
index 16750d4b85841bc27de59f94f03e1a109b904fbb..0000000000000000000000000000000000000000
--- a/katoptron/speedup.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import numpy as np
-
-from katoptron.readers import *
-
-
-def read_iter_all_ensemble_sizes(n_samples, ensemble_sizes, file_base_dir, reduction=False):
-    iter = np.zeros((len(ensemble_sizes), n_samples))
-    for i in range(0, len(ensemble_sizes)):
-        file_base_dir_2 = file_base_dir + '/' + str(ensemble_sizes[i])+'/'
-        for j in range(0, int((n_samples // ensemble_sizes[i]))):
-            input_MC_file_dir = file_base_dir_2 + str(j)+'/'
-            es = ensemble_sizes[i]
-            if reduction:
-                es = 1
-            iter_indices, residuals = read_Belos(
-                input_MC_file_dir + 'belos_out.txt', es)
-            for k in range(0, ensemble_sizes[i]):
-                iter[i][j*ensemble_sizes[i]+k] = iter_indices[-1]
-    return iter
-
-
-def read_timers_all_ensemble_sizes(n_samples, ensemble_sizes, file_base_dir, querylines, use_waves_timers, use_teuchos_timers):
-    timers = np.zeros((len(ensemble_sizes), n_samples, len(querylines)))
-    timers_s = np.zeros((len(querylines),))
-    for i in range(0, len(ensemble_sizes)):
-        file_base_dir_2 = file_base_dir + '/' + str(ensemble_sizes[i])+'/'
-        for j in range(0, int((n_samples // ensemble_sizes[i]))):
-            input_MC_file_dir = file_base_dir_2 + str(j)+'/'
-            for k in use_waves_timers:
-                timers_s[int(k)] = read_timers(input_MC_file_dir +
-                                               'timers.txt', [querylines[int(k)]])[0]
-            for k in use_teuchos_timers:
-                timers_s[int(k)] = read_teuchos_timers(
-                    input_MC_file_dir + 'teuchos_timers.txt', [querylines[int(k)]])[0]
-            for k in range(0, ensemble_sizes[i]):
-                timers[i][j*ensemble_sizes[i]+k][:] = timers_s[:]
-
-    return timers
-
-
-def compute_speedup(n_samples, ensemble_sizes, file_base_dir, querylines, per_iteration, quantiles, use_waves_timers, use_teuchos_timers, reduction=False):
-    iter = read_iter_all_ensemble_sizes(
-        n_samples, ensemble_sizes, file_base_dir, reduction)
-    timers = read_timers_all_ensemble_sizes(
-        n_samples, ensemble_sizes, file_base_dir, querylines, use_waves_timers, use_teuchos_timers)
-
-    n_quantiles = len(quantiles)
-
-    speedup = np.zeros((len(ensemble_sizes), len(querylines), n_quantiles))
-
-    i_no_ep = 0
-
-    for i in range(0, len(ensemble_sizes)):
-        if i == i_no_ep:
-            speedup[i][:][:] = np.ones((1, len(querylines), n_quantiles))
-        else:
-            cum_timers = np.zeros(
-                (2, int((n_samples // ensemble_sizes[i])), len(querylines)))
-            for j in range(0, int((n_samples // ensemble_sizes[i]))):
-                for l in range(0, len(querylines)):
-                    if per_iteration[l]:
-                        sum_iter = 0
-                    else:
-                        sum_iter = 1
-                    for k in range(0, ensemble_sizes[i]):
-                        cum_timers[0][j][l] = cum_timers[0][j][l] + \
-                            timers[i_no_ep][j*ensemble_sizes[i]+k][l]
-                        if per_iteration[l]:
-                            sum_iter = sum_iter + \
-                                iter[i_no_ep][j*ensemble_sizes[i]+k]
-                    cum_timers[0][j][l] = (
-                        cum_timers[0][j][l] / sum_iter)
-                    if cum_timers[0][j][l] == 0:
-                        print('Warning! The cumulated cpu cost of ' + querylines[l] + ' is zero and is replaced by ' + str(
-                            (0.01 / sum_iter)) + ', the precision of the timers has to be increased or the test is too small.')
-                        cum_timers[0][j][l] = (0.01 / sum_iter)
-                    if per_iteration[l]:
-                        cum_timers[1][j][l] = (
-                            timers[i][j*ensemble_sizes[i]][l] / (iter[i][j*ensemble_sizes[i]]*ensemble_sizes[i]))
-                    else:
-                        cum_timers[1][j][l] = timers[i][j*ensemble_sizes[i]][l]
-            for l in range(0, len(querylines)):
-                speedup[i][l] = np.quantile(
-                    (cum_timers[0, :, l] / cum_timers[1, :, l]), quantiles, axis=0)
-    return speedup
-
-
-def plot_speedup(speedup, ensemble_sizes, which_l=[0], title=None, querylines=None, per_iteration=None):
-    import matplotlib.pyplot as plt
-
-    plt.figure(figsize=(8, 8))
-
-    col = {'c1': (0., 0.4470, 0.7410),     'c2': (0.8500, 0.3250, 0.0980),
-           'c3': (0.9290, 0.6940, 0.1250), 'c4': (0.4940, 0.1840, 0.5560),
-           'c5': (0.4660, 0.6740, 0.1880), 'c6': (0.3010, 0.7450, 0.9330),
-           'c7': (0.6350, 0.0780, 0.1840), 'c8': (0, 0.4470, 0.7410)}
-
-    plt_linewidth = 2
-    plt.style.use('ggplot')
-
-    for i in range(0, len(which_l)):
-        color = col['c'+str(i+1)]
-        for j in range(0, speedup.shape[2]):
-            if j == 0 and querylines is not None:
-                plt.plot(ensemble_sizes, speedup[:, which_l[i], j], color=color,
-                         label=querylines[which_l[i]]+'_'+str(per_iteration[which_l[i]]))
-            else:
-                plt.plot(ensemble_sizes,
-                         speedup[:, which_l[i], j], color=color)
-
-    plt.xlabel('ensemble size')
-    plt.ylabel('speedup')
-    plt.xlim(min(ensemble_sizes), max(ensemble_sizes))
-    if title is not None:
-        plt.title(title)
-    if querylines is not None:
-        plt.legend()
-
-
-def save_speedup(speedup, ensemble_sizes, querylines, filename):
-    tmp = np.zeros((speedup.shape[0], speedup.shape[2]+1))
-    tmp[:, 0] = ensemble_sizes
-    for l in range(0, len(querylines)):
-        for i in range(1, speedup.shape[2]+1):
-            tmp[:, i] = speedup[:, l, i-1]
-        name = filename + '_' + querylines[l] + '.txt'
-        name = name.replace(" ", "_")
-        name = name.replace(":", "")
-        name = name.replace("[", "")
-        name = name.replace("]", "")
-        name = name.replace("(", "")
-        name = name.replace(")", "")
-        name = name.replace("*", "")
-        np.savetxt(name, tmp, delimiter=' ')
-
-
-def compute_R(n_samples, ensemble_sizes, file_base_dir, quantiles, reduction=False):
-    iter = read_iter_all_ensemble_sizes(
-        n_samples, ensemble_sizes, file_base_dir, reduction)
-    n_quantiles = len(quantiles)
-
-    R = np.ones((len(ensemble_sizes), n_quantiles))
-
-    i_no_ep = 0
-
-    for i in range(0, len(ensemble_sizes)):
-        if i != i_no_ep:
-            cum_iter = np.zeros(
-                (2, int((n_samples // ensemble_sizes[i]))))
-            for j in range(0, int((n_samples // ensemble_sizes[i]))):
-                for k in range(0, ensemble_sizes[i]):
-                    cum_iter[0][j] = cum_iter[0][j] + \
-                        iter[i_no_ep][j*ensemble_sizes[i]+k]
-                cum_iter[1][j] = iter[i][j*ensemble_sizes[i]]*ensemble_sizes[i]
-            R[i, :] = np.quantile(
-                (cum_iter[1, :] / cum_iter[0, :]), quantiles, axis=0)
-    return R
-
-
-def save_R(R, filename):
-    name = filename + '.txt'
-    name = name.replace(" ", "_")
-    name = name.replace(":", "")
-    name = name.replace("[", "")
-    name = name.replace("]", "")
-    name = name.replace("(", "")
-    name = name.replace(")", "")
-    name = name.replace("*", "")
-    np.savetxt(name, R, delimiter=' ')
diff --git a/katoptron/src/Algebraic.h b/katoptron/src/Algebraic.h
deleted file mode 100644
index dffadb954257f3b986be93e3c4239c2ffd0899cd..0000000000000000000000000000000000000000
--- a/katoptron/src/Algebraic.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef KATOPTRON_ALGEBRAIC_H
-#define KATOPTRON_ALGEBRAIC_H
-
-#include "katoptron.h"
-#include "Map.h"
-#include "Domain.h"
-#include "Loads.h"
-#include "Graph.h"
-#include "Matrices.h"
-#include "Vectors.h"
-
-#include "LinearSolver.h"
-
-#include "EnsembleTraits.h"
-
-#include <limits>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store Teuchos::RCP to the algebraic information of the problem:
- * <ul>
- *  <li> map: an object that stores all the maps,
- *  <li> graph: an object that stores all the graphs (the sparsity patterns of the matrices),
- *  <li> matrices: an object that stores all the matrices,
- *  <li> vectors: an object that stores all the vectors.
- * </ul>
- */
-template <typename scalar>
-class Algebraic
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-public:
-    Teuchos::RCP<Map> map;
-    Teuchos::RCP<Graph> graph;
-    Teuchos::RCP<Matrices<scalar>> matrices;
-    Teuchos::RCP<Vectors<scalar>> vectors;
-
-    Algebraic(Teuchos::RCP<Map> map, Teuchos::RCP<Domain<scalar>> domain);
-
-    Teuchos::RCP<Tpetra::Vector<scalar, local_ordinal_type, global_ordinal_type>> readVectorFromFile(std::string &name, size_t myRank);
-};
-}; // namespace katoptron
-
-#endif //KATOPTRON_ALGEBRAIC_H
diff --git a/katoptron/src/Algebraic.hpp b/katoptron/src/Algebraic.hpp
deleted file mode 100644
index 1ad56e35fb335a42e106ca8a9d8edf0a43fa2a27..0000000000000000000000000000000000000000
--- a/katoptron/src/Algebraic.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-namespace katoptron
-{
-
-/**
- * @brief Algebraic constructor
- * 
- * This contrusctor calls the constructor of the katoptron::Graph, katoptron::Matrices, and katoptron::Vectors classes.
- * To do so, we need information regarding the distributions of the nodes and elements over the MPI processes (information
- * included in the katoptron::Map class) and information regarding the connectivity between the degrees of freedom (or,
- * equivalently, between the nodes) (information included in katoptron::Domain::elementsList).
- *
- * Arguments:
- * <ul>
- *  <li> map: an RCP to a Map object,
- *  <li> domain: an RCP to a Domain object.
- * </ul>
- */
-template <typename scalar>
-Algebraic<scalar>::Algebraic(Teuchos::RCP<Map> _map, Teuchos::RCP<Domain<scalar>> domain)
-{
-    map = _map;
-
-    LinearSolver::getTimers()["graph"].start();
-    graph = Teuchos::rcp(new Graph(_map, domain->elementsList));
-    LinearSolver::getTimers()["graph"].stop();
-    matrices = Teuchos::rcp(new Matrices<scalar>(graph));
-    vectors = Teuchos::rcp(new Vectors<scalar>(map));
-}
-
-/**
- * @brief Function to read a vector from file and distribute it to the MPI processes.
- * 
- * Arguments:
- * <ul>
- *  <li> name: the name of input file,
- *  <li> myRank: rank of the process.
- * </ul>
- */
-template <typename scalar>
-Teuchos::RCP<Tpetra::Vector<scalar, Map::local_ordinal_type, Map::global_ordinal_type>>
-Algebraic<scalar>::readVectorFromFile(std::string &name, size_t myRank)
-{
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    std::ifstream inputfile;
-    if (myRank == 0)
-        inputfile.open(name);
-
-    RCP<Tpetra::Vector<scalar, Map::local_ordinal_type, Map::global_ordinal_type>> x_0 =
-        rcp(new Tpetra::Vector<scalar, Map::local_ordinal_type, Map::global_ordinal_type>(map->mapOutput, true));
-    RCP<Tpetra::Vector<scalar, Map::local_ordinal_type, Map::global_ordinal_type>> x =
-        rcp(new Tpetra::Vector<scalar, Map::local_ordinal_type, Map::global_ordinal_type>(map->mapDofs, true));
-
-    if (myRank == 0)
-    {
-        auto line_size = map->mapOutput->getGlobalNumElements();
-
-        typedef EnsembleTraits<scalar> ET;
-        const int ensemble_size = ET::size;
-
-        for (Map::global_ordinal_type global_index = 0; global_index < line_size; ++global_index)
-        {
-            scalar tmp;
-            for (auto j = 0; j < ensemble_size; ++j)
-                inputfile >> ET::coeff(tmp, j);
-
-            x_0->replaceGlobalValue(global_index, tmp);
-        }
-        inputfile.close();
-    }
-
-    Tpetra::Export<> exportDof(map->mapOutput, map->mapDofs);
-
-    x->doExport(*x_0, exportDof, Tpetra::ADD);
-    return x;
-}
-
-}; // namespace katoptron
diff --git a/katoptron/src/AlgebraicETI.cpp b/katoptron/src/AlgebraicETI.cpp
deleted file mode 100644
index 2bef1983e77343e17ea78e66e82ff56abc405180..0000000000000000000000000000000000000000
--- a/katoptron/src/AlgebraicETI.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "Algebraic.h"
-#include "Algebraic.hpp"
-
-using namespace katoptron;
-
-template class Algebraic<double>;
-template class Algebraic<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>>;
-template class Algebraic<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>>;
-template class Algebraic<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>>;
-template class Algebraic<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>>;
\ No newline at end of file
diff --git a/katoptron/src/BelosStatusTestWeightedGenResNorm_MP_Vector.hpp b/katoptron/src/BelosStatusTestWeightedGenResNorm_MP_Vector.hpp
deleted file mode 100644
index 2011eb80bddb046603f1500466e5c684777c50c5..0000000000000000000000000000000000000000
--- a/katoptron/src/BelosStatusTestWeightedGenResNorm_MP_Vector.hpp
+++ /dev/null
@@ -1,769 +0,0 @@
-//@HEADER
-// ************************************************************************
-//
-//                 Belos: Block Linear Solvers Package
-//                  Copyright 2004 Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
-//
-// ************************************************************************
-//@HEADER
-
-#ifndef BELOS_STATUS_TEST_WEIGHTED_GEN_RESNORM_MP_VECTORH
-#define BELOS_STATUS_TEST_WEIGHTED_GEN_RESNORM_MP_VECTORH
-
-/*!
-  \file BelosStatusTestWeightedGenResNorm.hpp
-  \brief Belos::StatusTestResNorm for specifying general residual norm stopping criteria.
-*/
-
-#include "BelosStatusTestResNorm.hpp"
-#include "BelosLinearProblem.hpp"
-#include "BelosMultiVecTraits.hpp"
-
-#include "EnsembleTraits.h"
-
-/*!
-  \class Belos::StatusTestWeightedGenResNorm
-  \brief An implementation of StatusTestResNorm using a family of weighted residual norms.
-
-  StatusTestWeightedGenResNorm is an implementation of StatusTestResNorm that allows a user to construct
-  one of a family of residual tests for use as a status/convergence test for Belos.
-  The form of the test is
-   \f[
-   \frac{\|w\odot r_i\|}{\sigma_i} \le \tau
-   \f]
-   where
-   <ul>
-   <li> \f$w\f$ is a vector of weights,
-   <li> \f$\odot\f$ is the Hadamard product,
-   <li> \f$r_i\f$ is the i-th residual std::vector, implicitly or explicitly computed (determined by enum ResType),
-   <li> \f$\|r_i\|\f$ is the i-th residual norm determined by the enum NormType  (1-norm, 2-norm or inf-norm),
-   <li> \f$\sigma_i\f$ is the i-th scale factor that can be passed in as a precomputed number of the templated type,
-   or can be selected from by the enum ScaleType (norm of RHS, norm of initial residual).
-   <li> \f$\tau\f$ is the tolerance that is passed in as a number of the templated type to the constructor.
-   The value of \f$\tau\f$ can be reset using the setTolerance() method.
-   </ul>
-
-*/
-
-namespace Belos
-{
-
-template <class ScalarType, class MV, class OP>
-class StatusTestWeightedGenResNorm : public StatusTestResNorm<ScalarType, MV, OP>
-{
-
-public:
-    // Convenience typedefs
-    typedef Teuchos::ScalarTraits<ScalarType> SCT;
-    typedef typename SCT::magnitudeType MagnitudeType;
-    typedef MultiVecTraits<ScalarType, MV> MVT;
-
-    //! @name Enums.
-    //@{
-
-    /*!
-    \brief Select how the residual std::vector is produced.
-  */
-    enum ResType
-    {
-        Implicit, /*!< Use the residual std::vector produced by the iterative solver. */
-        Explicit  /*!< Explicitly compute the residual std::vector r = b - A*x using the
-                            linear problem. */
-    };
-
-    //@}
-
-    //! @name Constructors/destructors.
-    //@{
-    //! Constructor
-    /*! The constructor takes a single argument specifying the tolerance (\f$\tau\f$).
-    If none of the form definition methods are called, we use \f$\|r\|_2/\|r^{(0)}\|_2 \le \tau\f$
-    as the stopping criterion, where \f$\|r\|_2\f$ uses the least costly form of the 2-norm of
-    residual available from the iterative method and \f$\|r^{(0)}\|_2\f$ is the corresponding norm
-    of the initial residual.  The least costly form of the 2-norm depends on the chosen iterative
-    method.  Most Krylov methods produce the preconditioned residual std::vector in a form that would be
-    exact in infinite precision arithmetic.  This std::vector may be different from the true residual
-    either because left preconditioning was used, or because round-off error has
-    introduced significant error, or both.
-
-    You can also state the number of vectors that must pass the convergence criteria before the
-    status test passes by using the \c quorum argument.
-  */
-    StatusTestWeightedGenResNorm(MagnitudeType Tolerance, Teuchos::RCP<MV> weights, int quorum = -1, bool showMaxResNormOnly = false);
-
-    //! Destructor
-    virtual ~StatusTestWeightedGenResNorm();
-    //@}
-
-    //! @name Form and parameter definition methods.
-    //@{
-
-    //! Define form of the residual, its norm and optional weighting std::vector.
-    /*! This method defines the form of \f$\|r\|\f$.  We specify:
-    <ul>
-    <li> Whether the residual std::vector should be explicitly computed, or taken from the iterative method.
-    <li> The norm to be used on the residual (this may be different than the norm used in
-    DefineScaleForm()).
-    </ul>
-  */
-    int defineResForm(ResType TypeOfResidual, NormType TypeOfNorm);
-
-    //! Define form of the scaling, its norm, its optional weighting std::vector, or, alternatively, define an explicit value.
-    /*! This method defines the form of how the residual is scaled (if at all).  It operates in two modes:
-    <ol>
-    <li> User-provided scaling value:
-    <ul>
-    <li> Set argument TypeOfScaling to UserProvided.
-    <li> Set ScaleValue to a non-zero value that the residual norm will be divided by.
-    <li> TypeOfNorm argument will be ignored.
-    <li> Sample use:  Define ScaleValue = \f$\|A\|_{\infty}\f$ where \f$ A \f$ is the matrix
-    of the linear problem.
-    </ul>
-
-    <li> Use a supported Scaling Form:
-    <ul>
-    <li> Define TypeOfScaling to be the norm of the right hand side, the initial residual std::vector,
-    or to none.
-    <li> Define norm to be used on the scaling std::vector (this may be different than the norm used
-    in DefineResForm()).
-    </ul>
-    </ol>
-  */
-    int defineScaleForm(ScaleType TypeOfScaling, NormType TypeOfNorm, MagnitudeType ScaleValue = Teuchos::ScalarTraits<MagnitudeType>::one());
-
-    NormType getResNormType() { return resnormtype_; }
-
-    //! Set the value of the tolerance
-    /*! We allow the tolerance to be reset for cases where, in the process of testing the residual,
-    we find that the initial tolerance was too tight or too lax.
-  */
-    int setTolerance(MagnitudeType tolerance)
-    {
-        tolerance_ = tolerance;
-        return (0);
-    }
-
-    //! Sets the number of residuals that must pass the convergence test before Passed is returned.
-    //! \note If \c quorum=-1 then all residuals must pass the convergence test before Passed is returned.
-    int setQuorum(int quorum)
-    {
-        quorum_ = quorum;
-        return (0);
-    }
-
-    //! Set whether the only maximum residual norm is displayed when the print() method is called
-    int setShowMaxResNormOnly(bool showMaxResNormOnly)
-    {
-        showMaxResNormOnly_ = showMaxResNormOnly;
-        return (0);
-    }
-
-    //@}
-
-    //! @name Status methods
-    //@{
-    //! Check convergence status: Passed, Failed, or Undefined.
-    /*! This method checks to see if the convergence criteria are met.
-    Depending on how the residual test is constructed this method will return
-    the appropriate status type.
-
-    \return StatusType: Passed, Failed, or Undefined.
-  */
-    StatusType checkStatus(Iteration<ScalarType, MV, OP> *iSolver);
-
-    //! Return the result of the most recent CheckStatus call.
-    StatusType getStatus() const { return (status_); };
-    //@}
-
-    //! @name Reset methods
-    //@{
-
-    //! Resets the internal configuration to the initial state.
-    void reset();
-
-    //@}
-
-    //! @name Print methods
-    //@{
-
-    //! Output formatted description of stopping test to output stream.
-    void print(std::ostream &os, int indent = 0) const;
-
-    //! Print message for each status specific to this stopping test.
-    void printStatus(std::ostream &os, StatusType type) const;
-    //@}
-
-    //! @name Methods to access data members.
-    //@{
-
-    //! Returns the current solution estimate that was computed for the most recent residual test.
-    //! \note This is useful for explicit residual tests, if this test is an implicit residual test
-    //! a null pointer will be returned.
-    Teuchos::RCP<MV> getSolution() { return curSoln_; }
-
-    //! Returns the number of residuals that must pass the convergence test before Passed is returned.
-    //! \note If \c quorum=-1 then all residuals must pass the convergence test before Passed is returned.
-    int getQuorum() const { return quorum_; }
-
-    //! Returns whether the only maximum residual norm is displayed when the print() method is called
-    bool getShowMaxResNormOnly() { return showMaxResNormOnly_; }
-
-    //! Returns the std::vector containing the indices of the residuals that passed the test.
-    std::vector<int> convIndices() { return ind_; }
-
-    //! Returns the value of the tolerance, \f$ \tau \f$, set in the constructor.
-    MagnitudeType getTolerance() const { return (tolerance_); };
-
-    //! Returns the test value, \f$ \frac{\|r\|}{\sigma} \f$, computed in most recent call to CheckStatus.
-    const std::vector<MagnitudeType> *getTestValue() const { return (&testvector_); };
-
-    //! Returns the residual norm value, \f$ \|r\| \f$, computed in most recent call to CheckStatus.
-    const std::vector<MagnitudeType> *getResNormValue() const { return (&resvector_); };
-
-    //! Returns the scaled norm value, \f$ \sigma \f$.
-    const std::vector<MagnitudeType> *getScaledNormValue() const { return (&scalevector_); };
-
-    //! Returns a boolean indicating a loss of accuracy has been detected in computing the residual.
-    //! \note This status test does not check for loss of accuracy, so this method will always return false.
-    bool getLOADetected() const { return false; }
-
-    //! Returns number of ensemble iterations
-    const std::vector<int> getEnsembleIterations() const { return ensemble_iterations; }
-    //@}
-
-    /** @name Misc. */
-    //@{
-
-    /** \brief Call to setup initial scaling std::vector.
-   *
-   * After this function is called <tt>getScaledNormValue()</tt> can be called
-   * to get the scaling std::vector.
-   */
-    StatusType firstCallCheckStatusSetup(Iteration<ScalarType, MV, OP> *iSolver);
-    //@}
-
-    /** \name Overridden from Teuchos::Describable */
-    //@{
-
-    /** \brief Method to return description of the maximum iteration status test  */
-    std::string description() const
-    {
-        std::ostringstream oss;
-        oss << "Belos::StatusTestWeightedGenResNorm<>: " << resFormStr();
-        oss << ", tol = " << tolerance_;
-        return oss.str();
-    }
-    //@}
-
-protected:
-private:
-    //! @name Private methods.
-    //@{
-    /** \brief Description of current residual form */
-    std::string resFormStr() const
-    {
-        std::ostringstream oss;
-        oss << "(";
-        oss << ((resnormtype_ == OneNorm) ? "1-Norm" : (resnormtype_ == TwoNorm) ? "2-Norm" : "Inf-Norm");
-        oss << " Exp";
-        oss << " Res Vec) ";
-
-        // If there is no residual scaling, return current string.
-        if (scaletype_ != None)
-        {
-            // Insert division sign.
-            oss << "/ ";
-
-            // Determine output string for scaling, if there is any.
-            if (scaletype_ == UserProvided)
-                oss << " (User Scale)";
-            else
-            {
-                oss << "(";
-                oss << ((scalenormtype_ == OneNorm) ? "1-Norm" : (resnormtype_ == TwoNorm) ? "2-Norm" : "Inf-Norm");
-                if (scaletype_ == NormOfInitRes || scaletype_ == NormOfFullInitRes || scaletype_ == NormOfFullScaledInitRes)
-                    oss << " Res0";
-                else if (scaletype_ == NormOfPrecInitRes || scaletype_ == NormOfFullPrecInitRes || scaletype_ == NormOfFullScaledPrecInitRes)
-                    oss << " Prec Res0";
-                else
-                    oss << " RHS ";
-                oss << ")";
-            }
-        }
-
-        return oss.str();
-    }
-
-    //@}
-
-    //! @name Private helper functions
-    //@{
-
-    // calculate weighted norm
-    void MvWNorm(const MV &mv, const MV &w, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &normVec, NormType type = TwoNorm)
-    {
-
-        Teuchos::RCP<MV> wmv = MVT::CloneCopy(mv);
-
-        Teuchos::ArrayRCP<typename MV::scalar_type> wmv_entries;
-        Teuchos::ArrayRCP<const typename MV::scalar_type> w_entries;
-
-        for (size_t j = 0; j < MVT::GetNumberVecs(mv); ++j)
-        {
-            wmv_entries = wmv->getDataNonConst(j);
-            w_entries = w.getData(j);
-            for (size_t i = 0; i < wmv_entries.size(); ++i)
-                wmv_entries[i] *= w_entries[i];
-        }
-        MVT::MvNorm(*wmv, normVec, type);
-    }
-    //@}
-
-    //! @name Private data members.
-    //@{
-
-    //! Tolerance used to determine convergence
-    MagnitudeType tolerance_;
-
-    //! Number of residuals that must pass the convergence test before Passed is returned.
-    int quorum_;
-
-    //! Determines if the entries for all of the residuals are shown or just the max.
-    bool showMaxResNormOnly_;
-
-    //! Type of norm to use on residual (OneNorm, TwoNorm, or InfNorm).
-    NormType resnormtype_;
-
-    //! Type of scaling to use (Norm of RHS, Norm of Initial Residual, None or User provided)
-    ScaleType scaletype_;
-
-    //! Type of norm to use on the scaling (OneNorm, TwoNorm, or InfNorm)
-    NormType scalenormtype_;
-
-    //! Scaling value.
-    MagnitudeType scalevalue_;
-
-    //! Scaling std::vector.
-    std::vector<MagnitudeType> scalevector_;
-
-    //! Residual norm std::vector.
-    std::vector<MagnitudeType> resvector_;
-
-    //! Test std::vector = resvector_ / scalevector_
-    std::vector<MagnitudeType> testvector_;
-
-    //! Vector containing the indices for the vectors that passed the test.
-    std::vector<int> ind_;
-
-    //! Most recent solution vector used by this status test.
-    Teuchos::RCP<MV> curSoln_;
-
-    //! Status
-    StatusType status_;
-
-    //! The current blocksize of the linear system being solved.
-    int curBlksz_;
-
-    //! The current number of right-hand sides being solved for.
-    int curNumRHS_;
-
-    //! The indices of the current number of right-hand sides being solved for.
-    std::vector<int> curLSIdx_;
-
-    //! The current number of linear systems that have been loaded into the linear problem.
-    int curLSNum_;
-
-    //! The total number of right-hand sides being solved for.
-    int numrhs_;
-
-    //! Is this the first time CheckStatus is called?
-    bool firstcallCheckStatus_;
-
-    //! Is this the first time DefineResForm is called?
-    bool firstcallDefineResForm_;
-
-    //! Is this the first time DefineScaleForm is called?
-    bool firstcallDefineScaleForm_;
-
-    //! Weights of the used norm:
-    Teuchos::RCP<MV> weights_;
-
-    //! The number of iterations at which point each ensemble component converges
-    std::vector<int> ensemble_iterations;
-
-    //@}
-};
-
-template <class ScalarType, class MV, class OP>
-StatusTestWeightedGenResNorm<ScalarType, MV, OP>::
-    StatusTestWeightedGenResNorm(MagnitudeType Tolerance, Teuchos::RCP<MV> weights, int quorum, bool showMaxResNormOnly)
-    : tolerance_(Tolerance),
-      quorum_(quorum),
-      showMaxResNormOnly_(showMaxResNormOnly),
-      resnormtype_(TwoNorm),
-      scaletype_(NormOfInitRes),
-      scalenormtype_(TwoNorm),
-      scalevalue_(Teuchos::ScalarTraits<MagnitudeType>::one()),
-      status_(Undefined),
-      curBlksz_(0),
-      curNumRHS_(0),
-      curLSNum_(0),
-      numrhs_(0),
-      firstcallCheckStatus_(true),
-      firstcallDefineResForm_(true),
-      firstcallDefineScaleForm_(true),
-      weights_(weights),
-      ensemble_iterations(EnsembleTraits<ScalarType>::size, 0)
-{
-    // This constructor will compute the residual ||r_i||/||r0_i|| <= tolerance using the 2-norm of
-    // the explicit residual std::vector.
-}
-
-template <class ScalarType, class MV, class OP>
-StatusTestWeightedGenResNorm<ScalarType, MV, OP>::~StatusTestWeightedGenResNorm()
-{
-}
-
-template <class ScalarType, class MV, class OP>
-void StatusTestWeightedGenResNorm<ScalarType, MV, OP>::reset()
-{
-    status_ = Undefined;
-    curBlksz_ = 0;
-    curLSNum_ = 0;
-    curLSIdx_.resize(0);
-    numrhs_ = 0;
-    ind_.resize(0);
-    firstcallCheckStatus_ = true;
-    curSoln_ = Teuchos::null;
-}
-
-template <class ScalarType, class MV, class OP>
-int StatusTestWeightedGenResNorm<ScalarType, MV, OP>::defineResForm(ResType TypeOfResidual, NormType TypeOfNorm)
-{
-    TEUCHOS_TEST_FOR_EXCEPTION(firstcallDefineResForm_ == false, StatusTestError,
-                               "StatusTestWeightedGenResNorm::defineResForm(): The residual form has already been defined.");
-    firstcallDefineResForm_ = false;
-
-    resnormtype_ = TypeOfNorm;
-
-    return (0);
-}
-
-template <class ScalarType, class MV, class OP>
-int StatusTestWeightedGenResNorm<ScalarType, MV, OP>::defineScaleForm(ScaleType TypeOfScaling, NormType TypeOfNorm,
-                                                                      MagnitudeType ScaleValue)
-{
-    TEUCHOS_TEST_FOR_EXCEPTION(firstcallDefineScaleForm_ == false, StatusTestError,
-                               "StatusTestWeightedGenResNorm::defineScaleForm(): The scaling type has already been defined.");
-    firstcallDefineScaleForm_ = false;
-
-    scaletype_ = TypeOfScaling;
-    scalenormtype_ = TypeOfNorm;
-    scalevalue_ = ScaleValue;
-
-    return (0);
-}
-
-template <class ScalarType, class MV, class OP>
-StatusType StatusTestWeightedGenResNorm<ScalarType, MV, OP>::checkStatus(Iteration<ScalarType, MV, OP> *iSolver)
-{
-    typedef EnsembleTraits<ScalarType> ET;
-    const int ensemble_size = ET::size;
-    MagnitudeType zero = Teuchos::ScalarTraits<MagnitudeType>::zero();
-    const LinearProblem<ScalarType, MV, OP> &lp = iSolver->getProblem();
-    // Compute scaling term (done once for each block that's being solved)
-    if (firstcallCheckStatus_)
-    {
-        StatusType status = firstCallCheckStatusSetup(iSolver);
-        if (status == Failed)
-        {
-            status_ = Failed;
-            return (status_);
-        }
-    }
-    //
-    // This section computes the norm of the residual std::vector
-    //
-    if (curLSNum_ != lp.getLSNumber())
-    {
-        //
-        // We have moved on to the next rhs block
-        //
-        curLSNum_ = lp.getLSNumber();
-        curLSIdx_ = lp.getLSIndex();
-        curBlksz_ = (int)curLSIdx_.size();
-        int validLS = 0;
-        for (int i = 0; i < curBlksz_; ++i)
-        {
-            if (curLSIdx_[i] > -1 && curLSIdx_[i] < numrhs_)
-                validLS++;
-        }
-        curNumRHS_ = validLS;
-        curSoln_ = Teuchos::null;
-        //
-    }
-    else
-    {
-        //
-        // We are in the same rhs block, return if we are converged
-        //
-        if (status_ == Passed)
-        {
-            return status_;
-        }
-    }
-    {
-        //
-        // Request the true residual for this block of right-hand sides.
-        //
-        Teuchos::RCP<MV> cur_update = iSolver->getCurrentUpdate();
-        curSoln_ = lp.updateSolution(cur_update);
-        Teuchos::RCP<MV> cur_res = MVT::Clone(*curSoln_, MVT::GetNumberVecs(*curSoln_));
-        lp.computeCurrResVec(&*cur_res, &*curSoln_);
-        std::vector<MagnitudeType> tmp_resvector(MVT::GetNumberVecs(*cur_res));
-        MvWNorm(*cur_res, *weights_, tmp_resvector, resnormtype_);
-        typename std::vector<int>::iterator p = curLSIdx_.begin();
-        for (int i = 0; p < curLSIdx_.end(); ++p, ++i)
-        {
-            // Check if this index is valid
-            if (*p != -1)
-                resvector_[*p] = tmp_resvector[i];
-        }
-    }
-    //
-    // Compute the new linear system residuals for testing.
-    // (if any of them don't meet the tolerance or are NaN, then we exit with that status)
-    //
-    if (scalevector_.size() > 0)
-    {
-        typename std::vector<int>::iterator p = curLSIdx_.begin();
-        for (; p < curLSIdx_.end(); ++p)
-        {
-            // Check if this index is valid
-            if (*p != -1)
-            {
-                // Scale the std::vector accordingly
-                if (scalevector_[*p] != zero)
-                {
-                    // Don't intentionally divide by zero.
-                    testvector_[*p] = resvector_[*p] / scalevector_[*p] / scalevalue_;
-                }
-                else
-                {
-                    testvector_[*p] = resvector_[*p] / scalevalue_;
-                }
-            }
-        }
-    }
-    else
-    {
-        typename std::vector<int>::iterator p = curLSIdx_.begin();
-        for (; p < curLSIdx_.end(); ++p)
-        {
-            // Check if this index is valid
-            if (*p != -1)
-                testvector_[*p] = resvector_[*p] / scalevalue_;
-        }
-    }
-
-    // Check status of new linear system residuals and see if we have the quorum.
-    int have = 0;
-    ind_.resize(curLSIdx_.size());
-    typename std::vector<int>::iterator p = curLSIdx_.begin();
-    for (; p < curLSIdx_.end(); ++p)
-    {
-        // Check if this index is valid
-        if (*p != -1)
-        {
-            // Check if any of the residuals are larger than the tolerance.
-            bool all_converged = true;
-            for (int ii = 0; ii < ensemble_size; ++ii)
-            {
-                if (ET::coeff(testvector_[*p], ii) > ET::coeff(tolerance_, ii))
-                {
-                    ++ensemble_iterations[ii];
-                    all_converged = false;
-                }
-                else if (!(ET::coeff(testvector_[*p], ii) <= ET::coeff(tolerance_, ii)))
-                {
-                    // Throw an std::exception if a NaN is found.
-                    status_ = Failed;
-                    TEUCHOS_TEST_FOR_EXCEPTION(true, StatusTestError, "StatusTestWeightedGenResNorm::checkStatus(): NaN has been detected.");
-                }
-            }
-            if (all_converged)
-            {
-                ind_[have] = *p;
-                have++;
-            }
-        }
-    }
-    ind_.resize(have);
-    int need = (quorum_ == -1) ? curNumRHS_ : quorum_;
-    status_ = (have >= need) ? Passed : Failed;
-
-    // Return the current status
-    return status_;
-}
-
-template <class ScalarType, class MV, class OP>
-void StatusTestWeightedGenResNorm<ScalarType, MV, OP>::print(std::ostream &os, int indent) const
-{
-    for (int j = 0; j < indent; j++)
-        os << ' ';
-    printStatus(os, status_);
-    os << resFormStr();
-    if (status_ == Undefined)
-        os << ", tol = " << tolerance_ << std::endl;
-    else
-    {
-        os << std::endl;
-        if (showMaxResNormOnly_ && curBlksz_ > 1)
-        {
-            const MagnitudeType maxRelRes = *std::max_element(
-                testvector_.begin() + curLSIdx_[0], testvector_.begin() + curLSIdx_[curBlksz_ - 1]);
-            for (int j = 0; j < indent + 13; j++)
-                os << ' ';
-            os << "max{residual[" << curLSIdx_[0] << "..." << curLSIdx_[curBlksz_ - 1] << "]} = " << maxRelRes
-               << (maxRelRes <= tolerance_ ? " <= " : " > ") << tolerance_ << std::endl;
-        }
-        else
-        {
-            for (int i = 0; i < numrhs_; i++)
-            {
-                for (int j = 0; j < indent + 13; j++)
-                    os << ' ';
-                os << "residual [ " << i << " ] = " << testvector_[i];
-                os << ((testvector_[i] < tolerance_) ? " < " : (testvector_[i] == tolerance_) ? " == " : (testvector_[i] > tolerance_) ? " > " : " ") << tolerance_ << std::endl;
-            }
-        }
-    }
-    os << std::endl;
-}
-
-template <class ScalarType, class MV, class OP>
-void StatusTestWeightedGenResNorm<ScalarType, MV, OP>::printStatus(std::ostream &os, StatusType type) const
-{
-    os << std::left << std::setw(13) << std::setfill('.');
-    switch (type)
-    {
-    case Passed:
-        os << "Converged";
-        break;
-    case Failed:
-        os << "Unconverged";
-        break;
-    case Undefined:
-    default:
-        os << "**";
-        break;
-    }
-    os << std::left << std::setfill(' ');
-    return;
-}
-
-template <class ScalarType, class MV, class OP>
-StatusType StatusTestWeightedGenResNorm<ScalarType, MV, OP>::firstCallCheckStatusSetup(Iteration<ScalarType, MV, OP> *iSolver)
-{
-    int i;
-    MagnitudeType zero = Teuchos::ScalarTraits<MagnitudeType>::zero();
-    MagnitudeType one = Teuchos::ScalarTraits<MagnitudeType>::one();
-    const LinearProblem<ScalarType, MV, OP> &lp = iSolver->getProblem();
-    // Compute scaling term (done once for each block that's being solved)
-    if (firstcallCheckStatus_)
-    {
-        //
-        // Get some current solver information.
-        //
-        firstcallCheckStatus_ = false;
-
-        if (scaletype_ == NormOfRHS)
-        {
-            Teuchos::RCP<const MV> rhs = lp.getRHS();
-            numrhs_ = MVT::GetNumberVecs(*rhs);
-            scalevector_.resize(numrhs_);
-            MvWNorm(*rhs, *weights_, scalevector_, scalenormtype_);
-        }
-        else if (scaletype_ == NormOfInitRes || scaletype_ == NormOfFullInitRes || scaletype_ == NormOfFullScaledInitRes)
-        {
-            Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-            numrhs_ = MVT::GetNumberVecs(*init_res);
-            scalevector_.resize(numrhs_);
-            MvWNorm(*init_res, *weights_, scalevector_, scalenormtype_);
-        }
-        else if (scaletype_ == NormOfPrecInitRes || scaletype_ == NormOfFullPrecInitRes || scaletype_ == NormOfFullScaledPrecInitRes)
-        {
-            Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-            numrhs_ = MVT::GetNumberVecs(*init_res);
-            scalevector_.resize(numrhs_);
-            MvWNorm(*init_res, *weights_, scalevector_, scalenormtype_);
-        }
-        else
-        {
-            numrhs_ = MVT::GetNumberVecs(*(lp.getRHS()));
-        }
-
-        resvector_.resize(numrhs_);
-        testvector_.resize(numrhs_);
-
-        curLSNum_ = lp.getLSNumber();
-        curLSIdx_ = lp.getLSIndex();
-        curBlksz_ = (int)curLSIdx_.size();
-        int validLS = 0;
-        for (i = 0; i < curBlksz_; ++i)
-        {
-            if (curLSIdx_[i] > -1 && curLSIdx_[i] < numrhs_)
-                validLS++;
-        }
-        curNumRHS_ = validLS;
-        //
-        // Initialize the testvector.
-        for (i = 0; i < numrhs_; i++)
-        {
-            testvector_[i] = one;
-        }
-
-        // Return an error if the scaling is zero.
-        if (scalevalue_ == zero)
-        {
-            return Failed;
-        }
-    }
-    return Undefined;
-}
-
-} // end namespace Belos
-
-#endif /* BELOS_STATUS_TEST_RESNORM_H */
diff --git a/katoptron/src/BelosXpetraStatusTestGenResSubNorm_MP_Vector.hpp b/katoptron/src/BelosXpetraStatusTestGenResSubNorm_MP_Vector.hpp
deleted file mode 100644
index c06459d54ffbc7f75b579abf4b2f3fe95d53db5b..0000000000000000000000000000000000000000
--- a/katoptron/src/BelosXpetraStatusTestGenResSubNorm_MP_Vector.hpp
+++ /dev/null
@@ -1,1537 +0,0 @@
-// @HEADER
-//
-// ***********************************************************************
-//
-//        MueLu: A package for multigrid based preconditioning
-//                  Copyright 2012 Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact
-//                    Jonathan Hu       (jhu@sandia.gov)
-//                    Andrey Prokopenko (aprokop@sandia.gov)
-//                    Ray Tuminaro      (rstumin@sandia.gov)
-//                    Tobias Wiesner    (tawiesn@sandia.gov)
-//
-// ***********************************************************************
-//
-// @HEADER
-#ifndef BELOS_XPETRA_STATUS_TEST_GEN_RES_SUB_NORM_MP_VECTORHPP
-#define BELOS_XPETRA_STATUS_TEST_GEN_RES_SUB_NORM_MP_VECTORHPP
-
-#include "Stokhos_config.h"
-
-#ifdef HAVE_STOKHOS_ENSEMBLE_REDUCT
-
-#include "Xpetra_ConfigDefs.hpp"
-
-#include "Xpetra_BlockedCrsMatrix.hpp"
-
-#include "MueLu_Exceptions.hpp"
-
-#include <BelosConfigDefs.hpp>
-#include <BelosTypes.hpp>
-#include <BelosOperatorT.hpp>
-#include <BelosXpetraAdapterOperator.hpp>
-#include <BelosStatusTestGenResSubNorm.hpp>
-#include <BelosXpetraStatusTestGenResSubNorm.hpp>
-#include "EnsembleTraits.h"
-
-namespace Belos
-{
-
-/*! \brief Template specialization of Belos::StatusTestGenResSubNorm class using the
- * Xpetra::MultiVector and Belos::OperatorT MueLu adapter class.
- */
-template <class Storage, class LocalOrdinal, class GlobalOrdinal, class Node>
-class StatusTestGenResSubNorm<typename Teuchos::ScalarTraits<Sacado::MP::Vector<Storage>>::magnitudeType, Xpetra::MultiVector<Sacado::MP::Vector<Storage>, LocalOrdinal, GlobalOrdinal, Node>, Belos::OperatorT<Xpetra::MultiVector<Sacado::MP::Vector<Storage>, LocalOrdinal, GlobalOrdinal, Node>>>
-    : public StatusTestResNorm<typename Teuchos::ScalarTraits<Sacado::MP::Vector<Storage>>::magnitudeType, Xpetra::MultiVector<Sacado::MP::Vector<Storage>, LocalOrdinal, GlobalOrdinal, Node>, Belos::OperatorT<Xpetra::MultiVector<Sacado::MP::Vector<Storage>, LocalOrdinal, GlobalOrdinal, Node>>>
-{
-
-public:
-    // Convenience typedefs
-    typedef Sacado::MP::Vector<Storage> ScalarType;
-
-    typedef Xpetra::MultiVector<ScalarType, LocalOrdinal, GlobalOrdinal, Node> MV;
-    typedef Xpetra::BlockedCrsMatrix<ScalarType, LocalOrdinal, GlobalOrdinal, Node> BCRS;
-    typedef Xpetra::MapExtractor<ScalarType, LocalOrdinal, GlobalOrdinal, Node> ME;
-    typedef Belos::OperatorT<MV> OP;
-
-    typedef Teuchos::ScalarTraits<ScalarType> SCT;
-    typedef typename SCT::magnitudeType MagnitudeType;
-    typedef MultiVecTraits<ScalarType, MV> MVT;
-    typedef OperatorTraits<ScalarType, MV, OP> OT;
-
-    //! @name Constructors/destructors.
-    //@{
-    //! Constructor
-    /*! The constructor takes a single argument specifying the tolerance (\f$\tau\f$).
-    If none of the form definition methods are called, we use \f$\|r\|/\|r^{(0)}\| \le \tau\f$
-    as the stopping criterion, where \f$\|r\|\f$ always uses the true residual and
-    \f$\|r^{(0)}\|\f$ is the corresponding norm of the initial residual.
-    The used norm can be specified by defineResForm and defineScaleForm.
-
-    @param Tolerance: Specifies tolerance \f$\tau\f
-    @param subIdx: index of block row in the n x n block system we want to check the residual of
-    @param quorum: Number of residual (sub-)vectors which are needed to be within the tolerance before check is considered to be passed
-    @param showMaxResNormOnly: for output only
-
-  */
-    StatusTestGenResSubNorm(MagnitudeType Tolerance, size_t subIdx, int quorum = -1, bool showMaxResNormOnly = false)
-        : tolerance_(Tolerance),
-          subIdx_(subIdx),
-          quorum_(quorum),
-          showMaxResNormOnly_(showMaxResNormOnly),
-          resnormtype_(TwoNorm),
-          scaletype_(NormOfInitRes),
-          scalenormtype_(TwoNorm),
-          scalevalue_(Teuchos::ScalarTraits<MagnitudeType>::one()),
-          status_(Undefined),
-          curBlksz_(0),
-          curNumRHS_(0),
-          curLSNum_(0),
-          numrhs_(0),
-          firstcallCheckStatus_(true),
-          firstcallDefineResForm_(true),
-          firstcallDefineScaleForm_(true),
-          mapExtractor_(Teuchos::null),
-          ensemble_iterations(EnsembleTraits<MagnitudeType>::size, 0) {}
-
-    //! Destructor
-    virtual ~StatusTestGenResSubNorm(){};
-    //@}
-
-    //! @name Form and parameter definition methods.
-    //@{
-
-    //! Define form of the residual, its norm and optional weighting std::vector.
-    /*! This method defines the form of \f$\|r\|\f$.  We specify:
-    <ul>
-    <li> The norm to be used on the residual (this may be different than the norm used in
-    DefineScaleForm()).
-    </ul>
-  */
-    int defineResForm(NormType TypeOfNorm)
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(firstcallDefineResForm_ == false, StatusTestError,
-                                   "StatusTestGenResSubNorm::defineResForm(): The residual form has already been defined.");
-        firstcallDefineResForm_ = false;
-
-        resnormtype_ = TypeOfNorm;
-
-        return (0);
-    }
-
-    //! Define form of the scaling, its norm, its optional weighting std::vector, or, alternatively, define an explicit value.
-    /*! This method defines the form of how the residual is scaled (if at all).  It operates in two modes:
-    <ol>
-    <li> User-provided scaling value:
-    <ul>
-    <li> Set argument TypeOfScaling to UserProvided.
-    <li> Set ScaleValue to a non-zero value that the residual norm will be divided by.
-    <li> TypeOfNorm argument will be ignored.
-    <li> Sample use:  Define ScaleValue = \f$\|A\|_{\infty}\f$ where \f$ A \f$ is the matrix
-    of the linear problem.
-    </ul>
-
-    <li> Use a supported Scaling Form:
-    <ul>
-    <li> Define TypeOfScaling to be the norm of the right hand side, the initial residual std::vector,
-    or to none.
-    <li> Define norm to be used on the scaling std::vector (this may be different than the norm used
-    in DefineResForm()).
-    </ul>
-    </ol>
-  */
-    int defineScaleForm(ScaleType TypeOfScaling, NormType TypeOfNorm, MagnitudeType ScaleValue = Teuchos::ScalarTraits<MagnitudeType>::one())
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(firstcallDefineScaleForm_ == false, StatusTestError,
-                                   "StatusTestGenResSubNorm::defineScaleForm(): The scaling type has already been defined.");
-        firstcallDefineScaleForm_ = false;
-
-        scaletype_ = TypeOfScaling;
-        scalenormtype_ = TypeOfNorm;
-        scalevalue_ = ScaleValue;
-
-        return (0);
-    }
-
-    //! Set the value of the tolerance
-    /*! We allow the tolerance to be reset for cases where, in the process of testing the residual,
-    we find that the initial tolerance was too tight or too lax.
-  */
-    int setTolerance(MagnitudeType tolerance)
-    {
-        tolerance_ = tolerance;
-        return (0);
-    }
-
-    //! Set the block index of which we want to check the norm of the sub-residuals
-    /*! It does not really make sense to change/reset the index during the solution process
-   */
-    int setSubIdx(size_t subIdx)
-    {
-        subIdx_ = subIdx;
-        return (0);
-    }
-
-    //! Sets the number of residuals that must pass the convergence test before Passed is returned.
-    //! \note If \c quorum=-1 then all residuals must pass the convergence test before Passed is returned.
-    int setQuorum(int quorum)
-    {
-        quorum_ = quorum;
-        return (0);
-    }
-
-    //! Set whether the only maximum residual norm is displayed when the print() method is called
-    int setShowMaxResNormOnly(bool showMaxResNormOnly)
-    {
-        showMaxResNormOnly_ = showMaxResNormOnly;
-        return (0);
-    }
-
-    //@}
-
-    //! @name Status methods
-    //@{
-    //! Check convergence status: Passed, Failed, or Undefined.
-    /*! This method checks to see if the convergence criteria are met.
-    Depending on how the residual test is constructed this method will return
-    the appropriate status type.
-
-    \return StatusType: Passed, Failed, or Undefined.
-  */
-    StatusType checkStatus(Iteration<MagnitudeType, MV, OP> *iSolver)
-    {
-        typedef EnsembleTraits<MagnitudeType> ET;
-        const int ensemble_size = ET::size;
-        MagnitudeType zero = Teuchos::ScalarTraits<MagnitudeType>::zero();
-        const LinearProblem<MagnitudeType, MV, OP> &lp = iSolver->getProblem();
-        // Compute scaling term (done once for each block that's being solved)
-        if (firstcallCheckStatus_)
-        {
-            StatusType status = firstCallCheckStatusSetup(iSolver);
-            if (status == Failed)
-            {
-                status_ = Failed;
-                return (status_);
-            }
-        }
-
-        //
-        // This section computes the norm of the residual std::vector
-        //
-        if (curLSNum_ != lp.getLSNumber())
-        {
-            //
-            // We have moved on to the next rhs block
-            //
-            curLSNum_ = lp.getLSNumber();
-            curLSIdx_ = lp.getLSIndex();
-            curBlksz_ = (int)curLSIdx_.size();
-            int validLS = 0;
-            for (int i = 0; i < curBlksz_; ++i)
-            {
-                if (curLSIdx_[i] > -1 && curLSIdx_[i] < numrhs_)
-                    validLS++;
-            }
-            curNumRHS_ = validLS;
-            curSoln_ = Teuchos::null;
-            //
-        }
-        else
-        {
-            //
-            // We are in the same rhs block, return if we are converged
-            //
-            if (status_ == Passed)
-            {
-                return status_;
-            }
-        }
-
-        //
-        // Request the true residual for this block of right-hand sides.
-        //
-        Teuchos::RCP<MV> cur_update = iSolver->getCurrentUpdate();
-        curSoln_ = lp.updateSolution(cur_update);
-        Teuchos::RCP<MV> cur_res = MVT::Clone(*curSoln_, MVT::GetNumberVecs(*curSoln_));
-        lp.computeCurrResVec(&*cur_res, &*curSoln_);
-        std::vector<MagnitudeType> tmp_resvector(MVT::GetNumberVecs(*cur_res));
-        MvSubNorm(*cur_res, subIdx_, tmp_resvector, resnormtype_);
-
-        typename std::vector<int>::iterator p = curLSIdx_.begin();
-        for (int i = 0; p < curLSIdx_.end(); ++p, ++i)
-        {
-            // Check if this index is valid
-            if (*p != -1)
-                resvector_[*p] = tmp_resvector[i];
-        }
-
-        //
-        // Compute the new linear system residuals for testing.
-        // (if any of them don't meet the tolerance or are NaN, then we exit with that status)
-        //
-        if (scalevector_.size() > 0)
-        {
-            typename std::vector<int>::iterator pp = curLSIdx_.begin();
-            for (; pp < curLSIdx_.end(); ++pp)
-            {
-                // Check if this index is valid
-                if (*pp != -1)
-                {
-                    // Scale the std::vector accordingly
-                    if (scalevector_[*pp] != zero)
-                    {
-                        // Don't intentionally divide by zero.
-                        testvector_[*pp] = resvector_[*pp] / scalevector_[*pp] / scalevalue_;
-                    }
-                    else
-                    {
-                        testvector_[*pp] = resvector_[*pp] / scalevalue_;
-                    }
-                }
-            }
-        }
-        else
-        {
-            typename std::vector<int>::iterator pp = curLSIdx_.begin();
-            for (; pp < curLSIdx_.end(); ++pp)
-            {
-                // Check if this index is valid
-                if (*pp != -1)
-                    testvector_[*pp] = resvector_[*pp] / scalevalue_;
-            }
-        }
-        // Check status of new linear system residuals and see if we have the quorum.
-        int have = 0;
-        ind_.resize(curLSIdx_.size());
-        typename std::vector<int>::iterator p2 = curLSIdx_.begin();
-        for (; p2 < curLSIdx_.end(); ++p2)
-        {
-            // Check if this index is valid
-            if (*p2 != -1)
-            {
-                // Check if any of the residuals are larger than the tolerance.
-                bool all_converged = true;
-                for (int ii = 0; ii < ensemble_size; ++ii)
-                {
-                    if (ET::coeff(testvector_[*p2], ii) > ET::coeff(tolerance_, ii))
-                    {
-                        ++ensemble_iterations[ii];
-                        all_converged = false;
-                    }
-                    else if (!(ET::coeff(testvector_[*p2], ii) <= ET::coeff(tolerance_, ii)))
-                    {
-                        // Throw an std::exception if the current residual norm is
-                        // NaN.  We know that it's NaN because it is not less than,
-                        // equal to, or greater than the current tolerance.  This is
-                        // only possible if either the residual norm or the current
-                        // tolerance is NaN; we assume the former.  We also mark the
-                        // test as failed, in case you want to catch the exception.
-                        status_ = Failed;
-                        TEUCHOS_TEST_FOR_EXCEPTION(true, StatusTestError, "StatusTestGenResSubNorm::checkStatus(): NaN has been detected.");
-                    }
-                }
-                if (all_converged)
-                {
-                    ind_[have] = *p2;
-                    have++;
-                }
-            }
-        }
-        ind_.resize(have);
-        int need = (quorum_ == -1) ? curNumRHS_ : quorum_;
-        status_ = (have >= need) ? Passed : Failed;
-        // Return the current status
-        return status_;
-    }
-
-    //! Return the result of the most recent CheckStatus call.
-    StatusType getStatus() const { return (status_); };
-    //@}
-
-    //! @name Reset methods
-    //@{
-
-    //! Resets the internal configuration to the initial state.
-    void reset()
-    {
-        status_ = Undefined;
-        curBlksz_ = 0;
-        curLSNum_ = 0;
-        curLSIdx_.resize(0);
-        numrhs_ = 0;
-        ind_.resize(0);
-        firstcallCheckStatus_ = true;
-        curSoln_ = Teuchos::null;
-    }
-
-    //@}
-
-    //! @name Print methods
-    //@{
-
-    //! Output formatted description of stopping test to output stream.
-    void print(std::ostream &os, int indent = 0) const
-    {
-        os.setf(std::ios_base::scientific);
-        for (int j = 0; j < indent; j++)
-            os << ' ';
-        printStatus(os, status_);
-        os << resFormStr();
-        if (status_ == Undefined)
-            os << ", tol = " << tolerance_ << std::endl;
-        else
-        {
-            os << std::endl;
-            if (showMaxResNormOnly_ && curBlksz_ > 1)
-            {
-                const MagnitudeType maxRelRes = *std::max_element(
-                    testvector_.begin() + curLSIdx_[0], testvector_.begin() + curLSIdx_[curBlksz_ - 1]);
-                for (int j = 0; j < indent + 13; j++)
-                    os << ' ';
-                os << "max{residual[" << curLSIdx_[0] << "..." << curLSIdx_[curBlksz_ - 1] << "]} = " << maxRelRes
-                   << (maxRelRes <= tolerance_ ? " <= " : " > ") << tolerance_ << std::endl;
-            }
-            else
-            {
-                for (int i = 0; i < numrhs_; i++)
-                {
-                    for (int j = 0; j < indent + 13; j++)
-                        os << ' ';
-                    os << "residual [ " << i << " ] = " << testvector_[i];
-                    os << ((testvector_[i] < tolerance_) ? " < " : (testvector_[i] == tolerance_) ? " == " : (testvector_[i] > tolerance_) ? " > " : " ") << tolerance_ << std::endl;
-                }
-            }
-        }
-        os << std::endl;
-    }
-
-    //! Print message for each status specific to this stopping test.
-    void printStatus(std::ostream &os, StatusType type) const
-    {
-        os << std::left << std::setw(13) << std::setfill('.');
-        switch (type)
-        {
-        case Passed:
-            os << "Converged";
-            break;
-        case Failed:
-            os << "Unconverged";
-            break;
-        case Undefined:
-        default:
-            os << "**";
-            break;
-        }
-        os << std::left << std::setfill(' ');
-        return;
-    }
-    //@}
-
-    //! @name Methods to access data members.
-    //@{
-
-    //! Returns the current solution estimate that was computed for the most recent residual test.
-    Teuchos::RCP<MV> getSolution() { return curSoln_; }
-
-    //! Returns the number of residuals that must pass the convergence test before Passed is returned.
-    //! \note If \c quorum=-1 then all residuals must pass the convergence test before Passed is returned.
-    int getQuorum() const { return quorum_; }
-
-    //! Returns the index of the block row the norms are calculated for
-    size_t getSubIdx() const { return subIdx_; }
-
-    //! Returns whether the only maximum residual norm is displayed when the print() method is called
-    bool getShowMaxResNormOnly() { return showMaxResNormOnly_; }
-
-    //! Returns the std::vector containing the indices of the residuals that passed the test.
-    std::vector<int> convIndices() { return ind_; }
-
-    //! Returns the value of the tolerance, \f$ \tau \f$, set in the constructor.
-    MagnitudeType getTolerance() const { return (tolerance_); };
-
-    //! Returns the test value, \f$ \frac{\|r\|}{\sigma} \f$, computed in most recent call to CheckStatus.
-    const std::vector<MagnitudeType> *getTestValue() const { return (&testvector_); };
-
-    //! Returns the residual norm value, \f$ \|r\| \f$, computed in most recent call to CheckStatus.
-    const std::vector<MagnitudeType> *getResNormValue() const { return (&resvector_); };
-
-    //! Returns the scaled norm value, \f$ \sigma \f$.
-    const std::vector<MagnitudeType> *getScaledNormValue() const { return (&scalevector_); };
-
-    //! Returns a boolean indicating a loss of accuracy has been detected in computing the residual.
-    //! \note This status test does not check for loss of accuracy, so this method will always return false.
-    bool getLOADetected() const { return false; }
-
-    const std::vector<int> getEnsembleIterations() const { return ensemble_iterations; }
-
-    //@}
-
-    /** @name Misc. */
-    //@{
-
-    /** \brief Call to setup initial scaling std::vector.
-   *
-   * After this function is called <tt>getScaledNormValue()</tt> can be called
-   * to get the scaling std::vector.
-   */
-    StatusType firstCallCheckStatusSetup(Iteration<MagnitudeType, MV, OP> *iSolver)
-    {
-        int i;
-        MagnitudeType zero = Teuchos::ScalarTraits<MagnitudeType>::zero();
-        MagnitudeType one = Teuchos::ScalarTraits<MagnitudeType>::one();
-        const LinearProblem<MagnitudeType, MV, OP> &lp = iSolver->getProblem();
-        // Compute scaling term (done once for each block that's being solved)
-        if (firstcallCheckStatus_)
-        {
-            //
-            // Get some current solver information.
-            //
-            firstcallCheckStatus_ = false;
-
-            // try to access the underlying blocked operator
-            Teuchos::RCP<const OP> Op = lp.getOperator();
-            Teuchos::RCP<const Belos::XpetraOp<ScalarType, LocalOrdinal, GlobalOrdinal, Node>> xOp =
-                Teuchos::rcp_dynamic_cast<const Belos::XpetraOp<ScalarType, LocalOrdinal, GlobalOrdinal, Node>>(Op);
-            TEUCHOS_TEST_FOR_EXCEPTION(xOp.is_null(), MueLu::Exceptions::BadCast, "Bad cast from \'const Belos::OperatorT\' to \'const Belos::XpetraOp\'. The origin type is " << typeid(const OP).name() << ".");
-            Teuchos::RCP<const Xpetra::Operator<ScalarType, LocalOrdinal, GlobalOrdinal, Node>> xIntOp =
-                xOp->getOperator();
-            TEUCHOS_TEST_FOR_EXCEPTION(xIntOp.is_null(), MueLu::Exceptions::BadCast, "Cannot access Xpetra::Operator stored in Belos::XpetraOperator.");
-            Teuchos::RCP<const Xpetra::Matrix<ScalarType, LocalOrdinal, GlobalOrdinal, Node>> xMat =
-                Teuchos::rcp_dynamic_cast<const Xpetra::Matrix<ScalarType, LocalOrdinal, GlobalOrdinal, Node>>(xIntOp);
-            TEUCHOS_TEST_FOR_EXCEPTION(xMat.is_null(), MueLu::Exceptions::RuntimeError, "Cannot access Xpetra::Matrix stored in Belos::XpetraOp. Error.");
-            Teuchos::RCP<const Xpetra::BlockedCrsMatrix<ScalarType, LocalOrdinal, GlobalOrdinal, Node>> bMat = Teuchos::rcp_dynamic_cast<const Xpetra::BlockedCrsMatrix<ScalarType, LocalOrdinal, GlobalOrdinal, Node>>(xMat);
-            TEUCHOS_TEST_FOR_EXCEPTION(bMat.is_null(), MueLu::Exceptions::BadCast, "Bad cast from \'const Xpetra::Matrix\' to \'const Xpetra::BlockedCrsMatrix\'. The origin type is " << typeid(const Xpetra::Matrix<ScalarType, LocalOrdinal, GlobalOrdinal, Node>).name() << ". Note: you need a BlockedCrsMatrix object for the StatusTestGenResSubNorm to work!");
-            mapExtractor_ = bMat->getRangeMapExtractor();
-            TEUCHOS_TEST_FOR_EXCEPTION(mapExtractor_.is_null(), MueLu::Exceptions::RuntimeError, "Could not extract map extractor from BlockedCrsMatrix. Error.");
-            TEUCHOS_TEST_FOR_EXCEPTION(mapExtractor_->NumMaps() <= subIdx_, MueLu::Exceptions::RuntimeError, "The multivector is only split into " << mapExtractor_->NumMaps() << " sub parts. Cannot access sub-block " << subIdx_ << ".");
-
-            // calculate initial norms
-            if (scaletype_ == NormOfRHS)
-            {
-                Teuchos::RCP<const MV> rhs = lp.getRHS();
-                numrhs_ = MVT::GetNumberVecs(*rhs);
-                scalevector_.resize(numrhs_);
-                MvSubNorm(*rhs, subIdx_, scalevector_, scalenormtype_);
-            }
-            else if (scaletype_ == NormOfInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MvSubNorm(*init_res, subIdx_, scalevector_, scalenormtype_);
-            }
-            else if (scaletype_ == NormOfPrecInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MvSubNorm(*init_res, subIdx_, scalevector_, scalenormtype_);
-            }
-            else if (scaletype_ == NormOfFullInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                scalevalue_ = one;
-            }
-            else if (scaletype_ == NormOfFullPrecInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                scalevalue_ = one;
-            }
-            else if (scaletype_ == NormOfFullScaledInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                MvScalingRatio(*init_res, subIdx_, scalevalue_);
-            }
-            else if (scaletype_ == NormOfFullScaledPrecInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                MvScalingRatio(*init_res, subIdx_, scalevalue_);
-            }
-            else
-            {
-                numrhs_ = MVT::GetNumberVecs(*(lp.getRHS()));
-            }
-
-            resvector_.resize(numrhs_);
-            testvector_.resize(numrhs_);
-
-            curLSNum_ = lp.getLSNumber();
-            curLSIdx_ = lp.getLSIndex();
-            curBlksz_ = (int)curLSIdx_.size();
-            int validLS = 0;
-            for (i = 0; i < curBlksz_; ++i)
-            {
-                if (curLSIdx_[i] > -1 && curLSIdx_[i] < numrhs_)
-                    validLS++;
-            }
-            curNumRHS_ = validLS;
-            //
-            // Initialize the testvector.
-            for (i = 0; i < numrhs_; i++)
-            {
-                testvector_[i] = one;
-            }
-
-            // Return an error if the scaling is zero.
-            if (scalevalue_ == zero)
-            {
-                return Failed;
-            }
-        }
-        return Undefined;
-    }
-    //@}
-
-    /** \name Overridden from Teuchos::Describable */
-    //@{
-
-    /** \brief Method to return description of the maximum iteration status test  */
-    std::string description() const
-    {
-        std::ostringstream oss;
-        oss << "Belos::StatusTestGenResSubNorm<>: " << resFormStr();
-        oss << ", tol = " << tolerance_;
-        return oss.str();
-    }
-    //@}
-
-protected:
-private:
-    //! @name Private methods.
-    //@{
-    /** \brief Description of current residual form */
-    std::string resFormStr() const
-    {
-        std::ostringstream oss;
-        oss << "(";
-        oss << ((resnormtype_ == OneNorm) ? "1-Norm" : (resnormtype_ == TwoNorm) ? "2-Norm" : "Inf-Norm");
-        oss << " Exp";
-        oss << " Res Vec [" << subIdx_ << "]) ";
-
-        // If there is no residual scaling, return current string.
-        if (scaletype_ != None)
-        {
-            // Insert division sign.
-            oss << "/ ";
-
-            // Determine output string for scaling, if there is any.
-            if (scaletype_ == UserProvided)
-                oss << " (User Scale)";
-            else
-            {
-                oss << "(";
-                oss << ((scalenormtype_ == OneNorm) ? "1-Norm" : (resnormtype_ == TwoNorm) ? "2-Norm" : "Inf-Norm");
-                if (scaletype_ == NormOfInitRes)
-                    oss << " Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfPrecInitRes)
-                    oss << " Prec Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullInitRes)
-                    oss << " Full Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullPrecInitRes)
-                    oss << " Full Prec Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullScaledInitRes)
-                    oss << " scaled Full Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullScaledPrecInitRes)
-                    oss << " scaled Full Prec Res0 [" << subIdx_ << "]";
-                else
-                    oss << " RHS [" << subIdx_ << "]";
-                oss << ")";
-            }
-        }
-
-        // TODO add a tagging name
-
-        return oss.str();
-    }
-
-    //@}
-
-    //! @name Private helper functions
-    //@{
-
-    // calculate norm of partial multivector
-    void MvSubNorm(const MV &mv, size_t block, std::vector<MagnitudeType> &normVec, NormType type = TwoNorm)
-    {
-
-        Teuchos::RCP<const MV> input = Teuchos::rcpFromRef(mv);
-
-        Teuchos::RCP<const MV> SubVec = mapExtractor_->ExtractVector(input, block);
-        typedef MultiVecTraits<ScalarType, MV> MVT;
-        MVT::MvNorm(*SubVec, normVec, type);
-    }
-
-    // calculate ration of sub-vector length to full vector length (for scalevalue_)
-    void MvScalingRatio(const MV &mv, size_t block, MagnitudeType &lengthRatio)
-    {
-        Teuchos::RCP<const MV> input = Teuchos::rcpFromRef(mv);
-
-        Teuchos::RCP<const MV> SubVec = mapExtractor_->ExtractVector(input, block);
-
-        lengthRatio = Teuchos::as<MagnitudeType>(SubVec->getGlobalLength()) / Teuchos::as<MagnitudeType>(input->getGlobalLength());
-    }
-    //@}
-
-    //! @name Private data members.
-    //@{
-
-    //! Tolerance used to determine convergence
-    MagnitudeType tolerance_;
-
-    //! Index of block row in n x n block system of which we want to check the sub-residuals
-    size_t subIdx_;
-
-    //! Number of residuals that must pass the convergence test before Passed is returned.
-    int quorum_;
-
-    //! Determines if the entries for all of the residuals are shown or just the max.
-    bool showMaxResNormOnly_;
-
-    //! Type of norm to use on residual (OneNorm, TwoNorm, or InfNorm).
-    NormType resnormtype_;
-
-    //! Type of scaling to use (Norm of RHS, Norm of Initial Residual, None or User provided)
-    ScaleType scaletype_;
-
-    //! Type of norm to use on the scaling (OneNorm, TwoNorm, or InfNorm)
-    NormType scalenormtype_;
-
-    //! Scaling value.
-    MagnitudeType scalevalue_;
-
-    //! Scaling std::vector.
-    std::vector<MagnitudeType> scalevector_;
-
-    //! Residual norm std::vector.
-    std::vector<MagnitudeType> resvector_;
-
-    //! Test std::vector = resvector_ / scalevector_
-    std::vector<MagnitudeType> testvector_;
-
-    //! Vector containing the indices for the vectors that passed the test.
-    std::vector<int> ind_;
-
-    //! Most recent solution vector used by this status test.
-    Teuchos::RCP<MV> curSoln_;
-
-    //! Status
-    StatusType status_;
-
-    //! The current blocksize of the linear system being solved.
-    int curBlksz_;
-
-    //! The current number of right-hand sides being solved for.
-    int curNumRHS_;
-
-    //! The indices of the current number of right-hand sides being solved for.
-    std::vector<int> curLSIdx_;
-
-    //! The current number of linear systems that have been loaded into the linear problem.
-    int curLSNum_;
-
-    //! The total number of right-hand sides being solved for.
-    int numrhs_;
-
-    //! Is this the first time CheckStatus is called?
-    bool firstcallCheckStatus_;
-
-    //! Is this the first time DefineResForm is called?
-    bool firstcallDefineResForm_;
-
-    //! Is this the first time DefineScaleForm is called?
-    bool firstcallDefineScaleForm_;
-
-    //! MapExtractor for range space
-    Teuchos::RCP<const ME> mapExtractor_;
-
-    //! The number of iterations at which point each ensemble component converges
-    std::vector<int> ensemble_iterations;
-
-    //@}
-};
-
-} // namespace Belos
-
-#else
-
-#include "Xpetra_ConfigDefs.hpp"
-
-#include "Xpetra_BlockedCrsMatrix.hpp"
-
-#include "MueLu_Exceptions.hpp"
-
-#include <BelosConfigDefs.hpp>
-#include <BelosTypes.hpp>
-#include <BelosOperatorT.hpp>
-#include <BelosXpetraAdapterOperator.hpp>
-#include <BelosStatusTestGenResSubNorm.hpp>
-#include "EnsembleTraits.h"
-
-namespace Belos
-{
-
-/*! \brief Template specialization of Belos::StatusTestGenResSubNorm class using the
- * Xpetra::MultiVector and Belos::OperatorT MueLu adapter class.
- */
-template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
-class StatusTestGenResSubNorm<Scalar, Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>, Belos::OperatorT<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>>
-    : public StatusTestResNorm<Scalar, Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>, Belos::OperatorT<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>>
-{
-
-public:
-    // Convenience typedefs
-    typedef Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> MV;
-    typedef Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> BCRS;
-    typedef Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node> ME;
-    typedef Belos::OperatorT<MV> OP;
-
-    typedef Teuchos::ScalarTraits<Scalar> SCT;
-    typedef typename SCT::magnitudeType MagnitudeType;
-    typedef MultiVecTraits<Scalar, MV> MVT;
-    typedef OperatorTraits<Scalar, MV, OP> OT;
-
-    //! @name Constructors/destructors.
-    //@{
-    //! Constructor
-    /*! The constructor takes a single argument specifying the tolerance (\f$\tau\f$).
-    If none of the form definition methods are called, we use \f$\|r\|/\|r^{(0)}\| \le \tau\f$
-    as the stopping criterion, where \f$\|r\|\f$ always uses the true residual and
-    \f$\|r^{(0)}\|\f$ is the corresponding norm of the initial residual.
-    The used norm can be specified by defineResForm and defineScaleForm.
-    @param Tolerance: Specifies tolerance \f$\tau\f
-    @param subIdx: index of block row in the n x n block system we want to check the residual of
-    @param quorum: Number of residual (sub-)vectors which are needed to be within the tolerance before check is considered to be passed
-    @param showMaxResNormOnly: for output only
-  */
-    StatusTestGenResSubNorm(MagnitudeType Tolerance, size_t subIdx, int quorum = -1, bool showMaxResNormOnly = false)
-        : tolerance_(Tolerance),
-          subIdx_(subIdx),
-          quorum_(quorum),
-          showMaxResNormOnly_(showMaxResNormOnly),
-          resnormtype_(TwoNorm),
-          scaletype_(NormOfInitRes),
-          scalenormtype_(TwoNorm),
-          scalevalue_(Teuchos::ScalarTraits<MagnitudeType>::one()),
-          status_(Undefined),
-          curBlksz_(0),
-          curNumRHS_(0),
-          curLSNum_(0),
-          numrhs_(0),
-          firstcallCheckStatus_(true),
-          firstcallDefineResForm_(true),
-          firstcallDefineScaleForm_(true),
-          mapExtractor_(Teuchos::null),
-          ensemble_iterations(EnsembleTraits<Scalar>::size, 0) {}
-
-    //! Destructor
-    virtual ~StatusTestGenResSubNorm(){};
-    //@}
-
-    //! @name Form and parameter definition methods.
-    //@{
-
-    //! Define form of the residual, its norm and optional weighting std::vector.
-    /*! This method defines the form of \f$\|r\|\f$.  We specify:
-    <ul>
-    <li> The norm to be used on the residual (this may be different than the norm used in
-    DefineScaleForm()).
-    </ul>
-  */
-    int defineResForm(NormType TypeOfNorm)
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(firstcallDefineResForm_ == false, StatusTestError,
-                                   "StatusTestGenResSubNorm::defineResForm(): The residual form has already been defined.");
-        firstcallDefineResForm_ = false;
-
-        resnormtype_ = TypeOfNorm;
-
-        return (0);
-    }
-
-    //! Define form of the scaling, its norm, its optional weighting std::vector, or, alternatively, define an explicit value.
-    /*! This method defines the form of how the residual is scaled (if at all).  It operates in two modes:
-    <ol>
-    <li> User-provided scaling value:
-    <ul>
-    <li> Set argument TypeOfScaling to UserProvided.
-    <li> Set ScaleValue to a non-zero value that the residual norm will be divided by.
-    <li> TypeOfNorm argument will be ignored.
-    <li> Sample use:  Define ScaleValue = \f$\|A\|_{\infty}\f$ where \f$ A \f$ is the matrix
-    of the linear problem.
-    </ul>
-    <li> Use a supported Scaling Form:
-    <ul>
-    <li> Define TypeOfScaling to be the norm of the right hand side, the initial residual std::vector,
-    or to none.
-    <li> Define norm to be used on the scaling std::vector (this may be different than the norm used
-    in DefineResForm()).
-    </ul>
-    </ol>
-  */
-    int defineScaleForm(ScaleType TypeOfScaling, NormType TypeOfNorm, MagnitudeType ScaleValue = Teuchos::ScalarTraits<MagnitudeType>::one())
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(firstcallDefineScaleForm_ == false, StatusTestError,
-                                   "StatusTestGenResSubNorm::defineScaleForm(): The scaling type has already been defined.");
-        firstcallDefineScaleForm_ = false;
-
-        scaletype_ = TypeOfScaling;
-        scalenormtype_ = TypeOfNorm;
-        scalevalue_ = ScaleValue;
-
-        return (0);
-    }
-
-    //! Set the value of the tolerance
-    /*! We allow the tolerance to be reset for cases where, in the process of testing the residual,
-    we find that the initial tolerance was too tight or too lax.
-  */
-    int setTolerance(MagnitudeType tolerance)
-    {
-        tolerance_ = tolerance;
-        return (0);
-    }
-
-    //! Set the block index of which we want to check the norm of the sub-residuals
-    /*! It does not really make sense to change/reset the index during the solution process
-   */
-    int setSubIdx(size_t subIdx)
-    {
-        subIdx_ = subIdx;
-        return (0);
-    }
-
-    //! Sets the number of residuals that must pass the convergence test before Passed is returned.
-    //! \note If \c quorum=-1 then all residuals must pass the convergence test before Passed is returned.
-    int setQuorum(int quorum)
-    {
-        quorum_ = quorum;
-        return (0);
-    }
-
-    //! Set whether the only maximum residual norm is displayed when the print() method is called
-    int setShowMaxResNormOnly(bool showMaxResNormOnly)
-    {
-        showMaxResNormOnly_ = showMaxResNormOnly;
-        return (0);
-    }
-
-    //@}
-
-    //! @name Status methods
-    //@{
-    //! Check convergence status: Passed, Failed, or Undefined.
-    /*! This method checks to see if the convergence criteria are met.
-    Depending on how the residual test is constructed this method will return
-    the appropriate status type.
-    \return StatusType: Passed, Failed, or Undefined.
-  */
-    StatusType checkStatus(Iteration<Scalar, MV, OP> *iSolver)
-    {
-        typedef EnsembleTraits<Scalar> ET;
-        const int ensemble_size = ET::size;
-        MagnitudeType zero = Teuchos::ScalarTraits<MagnitudeType>::zero();
-        const LinearProblem<Scalar, MV, OP> &lp = iSolver->getProblem();
-        // Compute scaling term (done once for each block that's being solved)
-        if (firstcallCheckStatus_)
-        {
-            StatusType status = firstCallCheckStatusSetup(iSolver);
-            if (status == Failed)
-            {
-                status_ = Failed;
-                return (status_);
-            }
-        }
-
-        //
-        // This section computes the norm of the residual std::vector
-        //
-        if (curLSNum_ != lp.getLSNumber())
-        {
-            //
-            // We have moved on to the next rhs block
-            //
-            curLSNum_ = lp.getLSNumber();
-            curLSIdx_ = lp.getLSIndex();
-            curBlksz_ = (int)curLSIdx_.size();
-            int validLS = 0;
-            for (int i = 0; i < curBlksz_; ++i)
-            {
-                if (curLSIdx_[i] > -1 && curLSIdx_[i] < numrhs_)
-                    validLS++;
-            }
-            curNumRHS_ = validLS;
-            curSoln_ = Teuchos::null;
-            //
-        }
-        else
-        {
-            //
-            // We are in the same rhs block, return if we are converged
-            //
-            if (status_ == Passed)
-            {
-                return status_;
-            }
-        }
-
-        //
-        // Request the true residual for this block of right-hand sides.
-        //
-        Teuchos::RCP<MV> cur_update = iSolver->getCurrentUpdate();
-        curSoln_ = lp.updateSolution(cur_update);
-        Teuchos::RCP<MV> cur_res = MVT::Clone(*curSoln_, MVT::GetNumberVecs(*curSoln_));
-        lp.computeCurrResVec(&*cur_res, &*curSoln_);
-        std::vector<MagnitudeType> tmp_resvector(MVT::GetNumberVecs(*cur_res));
-        MvSubNorm(*cur_res, subIdx_, tmp_resvector, resnormtype_);
-
-        typename std::vector<int>::iterator p = curLSIdx_.begin();
-        for (int i = 0; p < curLSIdx_.end(); ++p, ++i)
-        {
-            // Check if this index is valid
-            if (*p != -1)
-                resvector_[*p] = tmp_resvector[i];
-        }
-
-        //
-        // Compute the new linear system residuals for testing.
-        // (if any of them don't meet the tolerance or are NaN, then we exit with that status)
-        //
-        if (scalevector_.size() > 0)
-        {
-            typename std::vector<int>::iterator pp = curLSIdx_.begin();
-            for (; pp < curLSIdx_.end(); ++pp)
-            {
-                // Check if this index is valid
-                if (*pp != -1)
-                {
-                    // Scale the std::vector accordingly
-                    if (scalevector_[*pp] != zero)
-                    {
-                        // Don't intentionally divide by zero.
-                        testvector_[*pp] = resvector_[*pp] / scalevector_[*pp] / scalevalue_;
-                    }
-                    else
-                    {
-                        testvector_[*pp] = resvector_[*pp] / scalevalue_;
-                    }
-                }
-            }
-        }
-        else
-        {
-            typename std::vector<int>::iterator pp = curLSIdx_.begin();
-            for (; pp < curLSIdx_.end(); ++pp)
-            {
-                // Check if this index is valid
-                if (*pp != -1)
-                    testvector_[*pp] = resvector_[*pp] / scalevalue_;
-            }
-        }
-        // Check status of new linear system residuals and see if we have the quorum.
-        int have = 0;
-        ind_.resize(curLSIdx_.size());
-        typename std::vector<int>::iterator p2 = curLSIdx_.begin();
-        for (; p2 < curLSIdx_.end(); ++p2)
-        {
-            // Check if this index is valid
-            if (*p2 != -1)
-            {
-                // Check if any of the residuals are larger than the tolerance.
-                bool all_converged = true;
-                for (int ii = 0; ii < ensemble_size; ++ii)
-                {
-                    if (ET::coeff(testvector_[*p2], ii) > ET::coeff(tolerance_, ii))
-                    {
-                        ++ensemble_iterations[ii];
-                        all_converged = false;
-                    }
-                    else if (!(ET::coeff(testvector_[*p2], ii) <= ET::coeff(tolerance_, ii)))
-                    {
-                        // Throw an std::exception if the current residual norm is
-                        // NaN.  We know that it's NaN because it is not less than,
-                        // equal to, or greater than the current tolerance.  This is
-                        // only possible if either the residual norm or the current
-                        // tolerance is NaN; we assume the former.  We also mark the
-                        // test as failed, in case you want to catch the exception.
-                        status_ = Failed;
-                        TEUCHOS_TEST_FOR_EXCEPTION(true, StatusTestError, "StatusTestGenResSubNorm::checkStatus(): NaN has been detected.");
-                    }
-                }
-                if (all_converged)
-                {
-                    ind_[have] = *p2;
-                    have++;
-                }
-            }
-        }
-        ind_.resize(have);
-        int need = (quorum_ == -1) ? curNumRHS_ : quorum_;
-        status_ = (have >= need) ? Passed : Failed;
-        // Return the current status
-        return status_;
-    }
-
-    //! Return the result of the most recent CheckStatus call.
-    StatusType getStatus() const { return (status_); };
-    //@}
-
-    //! @name Reset methods
-    //@{
-
-    //! Resets the internal configuration to the initial state.
-    void reset()
-    {
-        status_ = Undefined;
-        curBlksz_ = 0;
-        curLSNum_ = 0;
-        curLSIdx_.resize(0);
-        numrhs_ = 0;
-        ind_.resize(0);
-        firstcallCheckStatus_ = true;
-        curSoln_ = Teuchos::null;
-    }
-
-    //@}
-
-    //! @name Print methods
-    //@{
-
-    //! Output formatted description of stopping test to output stream.
-    void print(std::ostream &os, int indent = 0) const
-    {
-        os.setf(std::ios_base::scientific);
-        for (int j = 0; j < indent; j++)
-            os << ' ';
-        printStatus(os, status_);
-        os << resFormStr();
-        if (status_ == Undefined)
-            os << ", tol = " << tolerance_ << std::endl;
-        else
-        {
-            os << std::endl;
-            if (showMaxResNormOnly_ && curBlksz_ > 1)
-            {
-                const MagnitudeType maxRelRes = *std::max_element(
-                    testvector_.begin() + curLSIdx_[0], testvector_.begin() + curLSIdx_[curBlksz_ - 1]);
-                for (int j = 0; j < indent + 13; j++)
-                    os << ' ';
-                os << "max{residual[" << curLSIdx_[0] << "..." << curLSIdx_[curBlksz_ - 1] << "]} = " << maxRelRes
-                   << (maxRelRes <= tolerance_ ? " <= " : " > ") << tolerance_ << std::endl;
-            }
-            else
-            {
-                for (int i = 0; i < numrhs_; i++)
-                {
-                    for (int j = 0; j < indent + 13; j++)
-                        os << ' ';
-                    os << "residual [ " << i << " ] = " << testvector_[i];
-                    os << ((testvector_[i] < tolerance_) ? " < " : (testvector_[i] == tolerance_) ? " == " : (testvector_[i] > tolerance_) ? " > " : " ") << tolerance_ << std::endl;
-                }
-            }
-        }
-        os << std::endl;
-    }
-
-    //! Print message for each status specific to this stopping test.
-    void printStatus(std::ostream &os, StatusType type) const
-    {
-        os << std::left << std::setw(13) << std::setfill('.');
-        switch (type)
-        {
-        case Passed:
-            os << "Converged";
-            break;
-        case Failed:
-            os << "Unconverged";
-            break;
-        case Undefined:
-        default:
-            os << "**";
-            break;
-        }
-        os << std::left << std::setfill(' ');
-        return;
-    }
-    //@}
-
-    //! @name Methods to access data members.
-    //@{
-
-    //! Returns the current solution estimate that was computed for the most recent residual test.
-    Teuchos::RCP<MV> getSolution() { return curSoln_; }
-
-    //! Returns the number of residuals that must pass the convergence test before Passed is returned.
-    //! \note If \c quorum=-1 then all residuals must pass the convergence test before Passed is returned.
-    int getQuorum() const { return quorum_; }
-
-    //! Returns the index of the block row the norms are calculated for
-    size_t getSubIdx() const { return subIdx_; }
-
-    //! Returns whether the only maximum residual norm is displayed when the print() method is called
-    bool getShowMaxResNormOnly() { return showMaxResNormOnly_; }
-
-    //! Returns the std::vector containing the indices of the residuals that passed the test.
-    std::vector<int> convIndices() { return ind_; }
-
-    //! Returns the value of the tolerance, \f$ \tau \f$, set in the constructor.
-    MagnitudeType getTolerance() const { return (tolerance_); };
-
-    //! Returns the test value, \f$ \frac{\|r\|}{\sigma} \f$, computed in most recent call to CheckStatus.
-    const std::vector<MagnitudeType> *getTestValue() const { return (&testvector_); };
-
-    //! Returns the residual norm value, \f$ \|r\| \f$, computed in most recent call to CheckStatus.
-    const std::vector<MagnitudeType> *getResNormValue() const { return (&resvector_); };
-
-    //! Returns the scaled norm value, \f$ \sigma \f$.
-    const std::vector<MagnitudeType> *getScaledNormValue() const { return (&scalevector_); };
-
-    //! Returns a boolean indicating a loss of accuracy has been detected in computing the residual.
-    //! \note This status test does not check for loss of accuracy, so this method will always return false.
-    bool getLOADetected() const { return false; }
-
-    const std::vector<int> getEnsembleIterations() const { return ensemble_iterations; }
-
-    //@}
-
-    /** @name Misc. */
-    //@{
-
-    /** \brief Call to setup initial scaling std::vector.
-   *
-   * After this function is called <tt>getScaledNormValue()</tt> can be called
-   * to get the scaling std::vector.
-   */
-    StatusType firstCallCheckStatusSetup(Iteration<Scalar, MV, OP> *iSolver)
-    {
-        int i;
-        MagnitudeType zero = Teuchos::ScalarTraits<MagnitudeType>::zero();
-        MagnitudeType one = Teuchos::ScalarTraits<MagnitudeType>::one();
-        const LinearProblem<Scalar, MV, OP> &lp = iSolver->getProblem();
-        // Compute scaling term (done once for each block that's being solved)
-        if (firstcallCheckStatus_)
-        {
-            //
-            // Get some current solver information.
-            //
-            firstcallCheckStatus_ = false;
-
-            // try to access the underlying blocked operator
-            Teuchos::RCP<const OP> Op = lp.getOperator();
-            Teuchos::RCP<const Belos::XpetraOp<Scalar, LocalOrdinal, GlobalOrdinal, Node>> xOp =
-                Teuchos::rcp_dynamic_cast<const Belos::XpetraOp<Scalar, LocalOrdinal, GlobalOrdinal, Node>>(Op);
-            TEUCHOS_TEST_FOR_EXCEPTION(xOp.is_null(), MueLu::Exceptions::BadCast, "Bad cast from \'const Belos::OperatorT\' to \'const Belos::XpetraOp\'. The origin type is " << typeid(const OP).name() << ".");
-            Teuchos::RCP<const Xpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node>> xIntOp =
-                xOp->getOperator();
-            TEUCHOS_TEST_FOR_EXCEPTION(xIntOp.is_null(), MueLu::Exceptions::BadCast, "Cannot access Xpetra::Operator stored in Belos::XpetraOperator.");
-            Teuchos::RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>> xMat =
-                Teuchos::rcp_dynamic_cast<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>>(xIntOp);
-            TEUCHOS_TEST_FOR_EXCEPTION(xMat.is_null(), MueLu::Exceptions::RuntimeError, "Cannot access Xpetra::Matrix stored in Belos::XpetraOp. Error.");
-            Teuchos::RCP<const Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>> bMat = Teuchos::rcp_dynamic_cast<const Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>>(xMat);
-            TEUCHOS_TEST_FOR_EXCEPTION(bMat.is_null(), MueLu::Exceptions::BadCast, "Bad cast from \'const Xpetra::Matrix\' to \'const Xpetra::BlockedCrsMatrix\'. The origin type is " << typeid(const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>).name() << ". Note: you need a BlockedCrsMatrix object for the StatusTestGenResSubNorm to work!");
-            mapExtractor_ = bMat->getRangeMapExtractor();
-            TEUCHOS_TEST_FOR_EXCEPTION(mapExtractor_.is_null(), MueLu::Exceptions::RuntimeError, "Could not extract map extractor from BlockedCrsMatrix. Error.");
-            TEUCHOS_TEST_FOR_EXCEPTION(mapExtractor_->NumMaps() <= subIdx_, MueLu::Exceptions::RuntimeError, "The multivector is only split into " << mapExtractor_->NumMaps() << " sub parts. Cannot access sub-block " << subIdx_ << ".");
-
-            // calculate initial norms
-            if (scaletype_ == NormOfRHS)
-            {
-                Teuchos::RCP<const MV> rhs = lp.getRHS();
-                numrhs_ = MVT::GetNumberVecs(*rhs);
-                scalevector_.resize(numrhs_);
-                MvSubNorm(*rhs, subIdx_, scalevector_, scalenormtype_);
-            }
-            else if (scaletype_ == NormOfInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MvSubNorm(*init_res, subIdx_, scalevector_, scalenormtype_);
-            }
-            else if (scaletype_ == NormOfPrecInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MvSubNorm(*init_res, subIdx_, scalevector_, scalenormtype_);
-            }
-            else if (scaletype_ == NormOfFullInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                scalevalue_ = one;
-            }
-            else if (scaletype_ == NormOfFullPrecInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                scalevalue_ = one;
-            }
-            else if (scaletype_ == NormOfFullScaledInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                MvScalingRatio(*init_res, subIdx_, scalevalue_);
-            }
-            else if (scaletype_ == NormOfFullScaledPrecInitRes)
-            {
-                Teuchos::RCP<const MV> init_res = lp.getInitPrecResVec();
-                numrhs_ = MVT::GetNumberVecs(*init_res);
-                scalevector_.resize(numrhs_);
-                MVT::MvNorm(*init_res, scalevector_, scalenormtype_);
-                MvScalingRatio(*init_res, subIdx_, scalevalue_);
-            }
-            else
-            {
-                numrhs_ = MVT::GetNumberVecs(*(lp.getRHS()));
-            }
-
-            resvector_.resize(numrhs_);
-            testvector_.resize(numrhs_);
-
-            curLSNum_ = lp.getLSNumber();
-            curLSIdx_ = lp.getLSIndex();
-            curBlksz_ = (int)curLSIdx_.size();
-            int validLS = 0;
-            for (i = 0; i < curBlksz_; ++i)
-            {
-                if (curLSIdx_[i] > -1 && curLSIdx_[i] < numrhs_)
-                    validLS++;
-            }
-            curNumRHS_ = validLS;
-            //
-            // Initialize the testvector.
-            for (i = 0; i < numrhs_; i++)
-            {
-                testvector_[i] = one;
-            }
-
-            // Return an error if the scaling is zero.
-            if (scalevalue_ == zero)
-            {
-                return Failed;
-            }
-        }
-        return Undefined;
-    }
-    //@}
-
-    /** \name Overridden from Teuchos::Describable */
-    //@{
-
-    /** \brief Method to return description of the maximum iteration status test  */
-    std::string description() const
-    {
-        std::ostringstream oss;
-        oss << "Belos::StatusTestGenResSubNorm<>: " << resFormStr();
-        oss << ", tol = " << tolerance_;
-        return oss.str();
-    }
-    //@}
-
-protected:
-private:
-    //! @name Private methods.
-    //@{
-    /** \brief Description of current residual form */
-    std::string resFormStr() const
-    {
-        std::ostringstream oss;
-        oss << "(";
-        oss << ((resnormtype_ == OneNorm) ? "1-Norm" : (resnormtype_ == TwoNorm) ? "2-Norm" : "Inf-Norm");
-        oss << " Exp";
-        oss << " Res Vec [" << subIdx_ << "]) ";
-
-        // If there is no residual scaling, return current string.
-        if (scaletype_ != None)
-        {
-            // Insert division sign.
-            oss << "/ ";
-
-            // Determine output string for scaling, if there is any.
-            if (scaletype_ == UserProvided)
-                oss << " (User Scale)";
-            else
-            {
-                oss << "(";
-                oss << ((scalenormtype_ == OneNorm) ? "1-Norm" : (resnormtype_ == TwoNorm) ? "2-Norm" : "Inf-Norm");
-                if (scaletype_ == NormOfInitRes)
-                    oss << " Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfPrecInitRes)
-                    oss << " Prec Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullInitRes)
-                    oss << " Full Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullPrecInitRes)
-                    oss << " Full Prec Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullScaledInitRes)
-                    oss << " scaled Full Res0 [" << subIdx_ << "]";
-                else if (scaletype_ == NormOfFullScaledPrecInitRes)
-                    oss << " scaled Full Prec Res0 [" << subIdx_ << "]";
-                else
-                    oss << " RHS [" << subIdx_ << "]";
-                oss << ")";
-            }
-        }
-
-        // TODO add a tagging name
-
-        return oss.str();
-    }
-
-    //@}
-
-    //! @name Private helper functions
-    //@{
-
-    // calculate norm of partial multivector
-    void MvSubNorm(const MV &mv, size_t block, std::vector<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &normVec, NormType type = TwoNorm)
-    {
-
-        Teuchos::RCP<const MV> input = Teuchos::rcpFromRef(mv);
-
-        Teuchos::RCP<const MV> SubVec = mapExtractor_->ExtractVector(input, block);
-        typedef MultiVecTraits<Scalar, MV> MVT;
-        MVT::MvNorm(*SubVec, normVec, type);
-    }
-
-    // calculate ration of sub-vector length to full vector length (for scalevalue_)
-    void MvScalingRatio(const MV &mv, size_t block, MagnitudeType &lengthRatio)
-    {
-        Teuchos::RCP<const MV> input = Teuchos::rcpFromRef(mv);
-
-        Teuchos::RCP<const MV> SubVec = mapExtractor_->ExtractVector(input, block);
-
-        lengthRatio = Teuchos::as<MagnitudeType>(SubVec->getGlobalLength()) / Teuchos::as<MagnitudeType>(input->getGlobalLength());
-    }
-    //@}
-
-    //! @name Private data members.
-    //@{
-
-    //! Tolerance used to determine convergence
-    MagnitudeType tolerance_;
-
-    //! Index of block row in n x n block system of which we want to check the sub-residuals
-    size_t subIdx_;
-
-    //! Number of residuals that must pass the convergence test before Passed is returned.
-    int quorum_;
-
-    //! Determines if the entries for all of the residuals are shown or just the max.
-    bool showMaxResNormOnly_;
-
-    //! Type of norm to use on residual (OneNorm, TwoNorm, or InfNorm).
-    NormType resnormtype_;
-
-    //! Type of scaling to use (Norm of RHS, Norm of Initial Residual, None or User provided)
-    ScaleType scaletype_;
-
-    //! Type of norm to use on the scaling (OneNorm, TwoNorm, or InfNorm)
-    NormType scalenormtype_;
-
-    //! Scaling value.
-    MagnitudeType scalevalue_;
-
-    //! Scaling std::vector.
-    std::vector<MagnitudeType> scalevector_;
-
-    //! Residual norm std::vector.
-    std::vector<MagnitudeType> resvector_;
-
-    //! Test std::vector = resvector_ / scalevector_
-    std::vector<MagnitudeType> testvector_;
-
-    //! Vector containing the indices for the vectors that passed the test.
-    std::vector<int> ind_;
-
-    //! Most recent solution vector used by this status test.
-    Teuchos::RCP<MV> curSoln_;
-
-    //! Status
-    StatusType status_;
-
-    //! The current blocksize of the linear system being solved.
-    int curBlksz_;
-
-    //! The current number of right-hand sides being solved for.
-    int curNumRHS_;
-
-    //! The indices of the current number of right-hand sides being solved for.
-    std::vector<int> curLSIdx_;
-
-    //! The current number of linear systems that have been loaded into the linear problem.
-    int curLSNum_;
-
-    //! The total number of right-hand sides being solved for.
-    int numrhs_;
-
-    //! Is this the first time CheckStatus is called?
-    bool firstcallCheckStatus_;
-
-    //! Is this the first time DefineResForm is called?
-    bool firstcallDefineResForm_;
-
-    //! Is this the first time DefineScaleForm is called?
-    bool firstcallDefineScaleForm_;
-
-    //! MapExtractor for range space
-    Teuchos::RCP<const ME> mapExtractor_;
-
-    //! The number of iterations at which point each ensemble component converges
-    std::vector<int> ensemble_iterations;
-
-    //@}
-};
-
-} // namespace Belos
-
-#endif
-
-#endif /* BELOS_XPETRA_STATUS_TEST_GEN_RES_SUB_NORM_HPP */
diff --git a/katoptron/src/CMakeLists.txt b/katoptron/src/CMakeLists.txt
deleted file mode 100644
index 5c97361a05d53eeabf449e8d7a09b8e27fe6fd51..0000000000000000000000000000000000000000
--- a/katoptron/src/CMakeLists.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-# CMake input file of katoptron.so
-
-FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
-
-#ADD_EXECUTABLE(katoptron2 main.cpp)
-
-ADD_LIBRARY(katoptron SHARED ${SRCS})
-MACRO_DebugPostfix(katoptron)
-TARGET_INCLUDE_DIRECTORIES(katoptron PUBLIC ${PROJECT_SOURCE_DIR}/katoptron/src)
-
-target_compile_definitions(katoptron PUBLIC WAVES_USE_TBOXVTK)
-
-# -- Search for Trilinos
-FIND_PACKAGE(Trilinos REQUIRED)
-
-set (_VERB 0)  # set to 1 for debugging
-IF(_VERB)
-    MESSAGE("\nFound Trilinos!  Here are the details: ")
-    MESSAGE("   Trilinos_DIR = ${Trilinos_DIR}")
-    MESSAGE("   Trilinos_VERSION = ${Trilinos_VERSION}")
-    MESSAGE("   Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
-    MESSAGE("   Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
-    MESSAGE("   Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
-    MESSAGE("   Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
-    MESSAGE("   Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
-    MESSAGE("   Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
-    MESSAGE("   Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
-    MESSAGE("   Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
-    MESSAGE("   Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
-    MESSAGE("   Trilinos_CXX_COMPILER_FLAGS = ${Trilinos_CXX_COMPILER_FLAGS}")
-    MESSAGE("End of Trilinos details\n")
-ENDIF()
-
-# MPI check 
-LIST(FIND Trilinos_TPL_LIST MPI MPI_List_ID)
-IF (MPI_List_ID GREATER -1)
-  MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI ENABLED")
-  SET(MYAPP_MPI TRUE)
-  ADD_DEFINITIONS(-DMYAPP_MPI)
-ELSE()
-  MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI NOT ENABLED")
-  SET(MYAPP_MPI FALSE)
-ENDIF()
-
-# Set optional dependency in MyApp on Epetra package: 
-#   this toggles code within  #ifdef MYAPP_EPETRA 
-LIST(FIND Trilinos_PACKAGE_LIST Epetra Epetra_List_ID)
-IF (Epetra_List_ID GREATER -1)
-  ADD_DEFINITIONS(-DMYAPP_EPETRA)
-  MESSAGE("-- Looking for Epetra: -- found, compiling with -DMYAPP_EPETRA")
-  SET(MYAPP_EPETRA TRUE)
-ELSE()
-  MESSAGE("-- Looking for Epetra: -- not found.")
-  SET(MYAPP_EPETRA FALSE)
-ENDIF()
-
-# --------------------------------------------------------------
-# Finds MPI (including MSMPI)
-# --------------------------------------------------------------
-if(WIN32)  
-    FIND_PATH(MPI_INCLUDE_PATH NAMES  mpi.h HINTS "$ENV{MSMPI_INC}")
-    if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-        set(MS_MPI_ARCH_DIR x64)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB64}")
-    else()
-        set(MS_MPI_ARCH_DIR x86)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB32}")
-    endif()
-else()
-    find_package(MPI REQUIRED)
-    # intel mpi (mpi.h doit etre inclus avant stdio.h)
-    # ou definir ces 2 macros
-    ADD_DEFINITIONS(-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX)
-endif()
-# --------------------------------------------------------------
-
-IF(_VERB)
-MESSAGE("   Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
-ENDIF()
-
-list(REMOVE_ITEM Trilinos_LIBRARIES pytrilinos)
-
-IF(_VERB)
-MESSAGE("   Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
-ENDIF()
-
-INCLUDE_DIRECTORIES (  ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src 
-                       ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
-                       ${Trilinos_INCLUDE_DIRS} 
-                       ${Trilinos_TPL_INCLUDE_DIRS}
-                       ${MPI_INCLUDE_PATH})
-
-LINK_DIRECTORIES (${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
-        
-TARGET_LINK_LIBRARIES(katoptron tbox tboxVtk fwk ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${MPI_LIBRARIES})
-
-INSTALL(TARGETS katoptron DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/katoptron/src/ContactsList.cpp b/katoptron/src/ContactsList.cpp
deleted file mode 100644
index ed239f19b29ea6e5be3856d8a00f360204649e76..0000000000000000000000000000000000000000
--- a/katoptron/src/ContactsList.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-#include "ContactsList.h"
-
-#include "NodesList.h"
-
-#include "wProblem.h"
-#include "wTag.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wMedium.h"
-#include "wDirichlet.h"
-#include "wContact.h"
-
-using namespace katoptron;
-using namespace tbox;
-
-/**
- * @brief ContactsList constructor
- * 
- * This constructor allocates 11 Kokkos::View which store all the required information related to each contact interface, including:
- * <ul>
- *  <li> all the slaves and master nodes and elements IDs,
- *  <li> all the normal of the surfaces,
- *  <li> type of Lagrange multiplier shape functions,
- *  <li> type of the interface (contact, Signorini, sticking contact, mesh tying),
- *  <li> initial status of the Lagrange multipliers and whether they should be updated.
- * </ul>
- * 
- * To do so, we need the information regarding the contact interfaces (stored into the katoptron::Problem object), the information on the 
- * distribution of the nodes (stored into the katoptron::Map object), and the information on the nodes and elements (stored into the 
- * katoptron::NodesList and katoptron::ElementList objects).
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to an ElementList object,
- *  <li> nodesList: an RCP to a NodesList object.
- * </ul>
- */
-ContactsList::ContactsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList, Teuchos::RCP<NodesList> nodesList)
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-    contacts_number = pbl.Contacts.size();
-    local_ordinal_type maxNumSlaveNodesPerContactFace = 0;
-    local_ordinal_type maxNumMasterNodesPerContactFace = 0;
-    local_ordinal_type maxNumSlaveElemsPerContactFace = 0;
-    local_ordinal_type maxNumMasterElemsPerContactFace = 0;
-    local_ordinal_type maxNumSlaveDirichletNodesPerContactFace = 0;
-
-    for (auto i = 0; i < contacts_number; ++i)
-    {
-        std::vector<global_ordinal_type> myContactSlaveNodes;
-        std::vector<global_ordinal_type> myContactSlaveElems;
-        for (auto j = 0; j < pbl.Contacts[i]->slave_elems.size(); ++j)
-        {
-            local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->slave_elems[j]->no - 1);
-            if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3))
-                ;
-            else
-                continue;
-            myContactSlaveElems.push_back(e);
-            for (auto n1 = 0; n1 < elementsList->getElementSize(e); ++n1)
-            {
-                global_ordinal_type i_global = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(e, n1));
-
-                if (std::find(myContactSlaveNodes.begin(), myContactSlaveNodes.end(), i_global) == myContactSlaveNodes.end())
-                    myContactSlaveNodes.push_back(i_global);
-            }
-        }
-
-        int myNumContactSlaveNodes = myContactSlaveNodes.size();
-        int myNumContactSlaveElems = myContactSlaveElems.size();
-
-        int myNumContactSlaveDirichletNodes = pbl.Contacts[i]->slave_dirichlet_nodes.size();
-
-        std::vector<global_ordinal_type> myContactMasterNodes;
-        std::vector<global_ordinal_type> myContactMasterElems;
-        for (auto j = 0; j < pbl.Contacts[i]->master_elems.size(); ++j)
-        {
-            local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->master_elems[j]->no - 1);
-            if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(ElType::LINE2))
-                ;
-            else
-                continue;
-            myContactMasterElems.push_back(e);
-            for (auto n1 = 0; n1 < elementsList->getElementSize(e); ++n1)
-            {
-                global_ordinal_type i_global = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(e, n1));
-                if (std::find(myContactMasterNodes.begin(), myContactMasterNodes.end(), i_global) == myContactMasterNodes.end())
-                    myContactMasterNodes.push_back(i_global);
-            }
-        }
-
-        int myNumContactMasterNodes = myContactMasterNodes.size();
-        int myNumContactMasterElems = myContactMasterElems.size();
-
-        if (maxNumSlaveNodesPerContactFace < myNumContactSlaveNodes)
-            maxNumSlaveNodesPerContactFace = myNumContactSlaveNodes;
-        if (maxNumSlaveElemsPerContactFace < myNumContactSlaveElems)
-            maxNumSlaveElemsPerContactFace = myNumContactSlaveElems;
-
-        if (maxNumSlaveDirichletNodesPerContactFace < myNumContactSlaveDirichletNodes)
-            maxNumSlaveDirichletNodesPerContactFace = myNumContactSlaveDirichletNodes;
-
-        if (maxNumMasterNodesPerContactFace < myNumContactMasterNodes)
-            maxNumMasterNodesPerContactFace = myNumContactMasterNodes;
-        if (maxNumMasterElemsPerContactFace < myNumContactMasterElems)
-            maxNumMasterElemsPerContactFace = myNumContactMasterElems;
-    }
-
-    contacts_slave_nodes_size = 0;
-    contacts_slave_elems_size = 1;
-    contacts_master_nodes_size = 2;
-    contacts_master_elems_size = 3;
-    contacts_slave_normal = 4;
-    contacts_master_normal = 7;
-    contacts_slave_nodes = 10;
-    contacts_slave_elems = contacts_slave_nodes + maxNumSlaveNodesPerContactFace;
-    contacts_master_nodes = contacts_slave_elems + maxNumSlaveElemsPerContactFace;
-    contacts_master_elems = contacts_master_nodes + maxNumMasterNodesPerContactFace;
-
-    size_t numMaxDirichletSlaveNode = 1;
-    for (auto i = 0; i < contacts_number; ++i)
-        if (numMaxDirichletSlaveNode < pbl.Contacts[i]->slave_dirichlet_nodes.size())
-            numMaxDirichletSlaveNode = pbl.Contacts[i]->slave_dirichlet_nodes.size();
-
-    size_t numMaxClosedNode = 1;
-    for (auto i = 0; i < contacts_number; ++i)
-        if (numMaxClosedNode < pbl.Contacts[i]->initially_closed_nodes.size())
-            numMaxClosedNode = pbl.Contacts[i]->initially_closed_nodes.size();
-
-    Kokkos::resize(contacts, contacts_number, contacts_master_elems + maxNumMasterElemsPerContactFace);
-    Kokkos::resize(contacts_normal, contacts_number, 6);
-    Kokkos::resize(shape_function, contacts_number);
-    Kokkos::resize(signorini, contacts_number);
-    Kokkos::resize(initially_open, contacts_number);
-    Kokkos::resize(no_update, contacts_number);
-    Kokkos::resize(sticking, contacts_number);
-    Kokkos::resize(mesh_tying, contacts_number);
-    Kokkos::resize(contacts_scale, contacts_number);
-    Kokkos::resize(contacts_dirichlet, contacts_number, numMaxDirichletSlaveNode + 1);
-    Kokkos::resize(initially_closed_nodes, contacts_number, numMaxClosedNode + 1);
-
-    for (auto i = 0; i < contacts_number; ++i)
-    {
-        contacts_dirichlet(i, 0) = pbl.Contacts[i]->slave_dirichlet_nodes.size();
-        for (auto j = 0; j < contacts_dirichlet(i, 0); ++j)
-            contacts_dirichlet(i, j + 1) = pbl.Contacts[i]->slave_dirichlet_nodes[j];
-    }
-
-    for (auto i = 0; i < contacts_number; ++i)
-    {
-        initially_closed_nodes(i, 0) = pbl.Contacts[i]->initially_closed_nodes.size();
-        for (auto j = 0; j < initially_closed_nodes(i, 0); ++j)
-            initially_closed_nodes(i, j + 1) = pbl.Contacts[i]->initially_closed_nodes[j];
-    }
-
-    for (auto i = 0; i < contacts_number; ++i)
-    {
-        int myContactSlaveNodes_id = 0;
-        int myContactSlaveElems_id = 0;
-
-        std::vector<global_ordinal_type> myContactSlaveNodes;
-
-        for (auto j = 0; j < pbl.Contacts[i]->slave_elems.size(); ++j)
-        {
-            local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->slave_elems[j]->no - 1);
-            if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3))
-                ;
-            else
-                continue;
-            contacts(i, contacts_slave_elems + myContactSlaveElems_id) = e;
-            ++myContactSlaveElems_id;
-            for (auto n1 = 0; n1 < elementsList->getElementSize(e); ++n1)
-            {
-                global_ordinal_type i_global = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(e, n1));
-                if (std::find(myContactSlaveNodes.begin(), myContactSlaveNodes.end(), i_global) == myContactSlaveNodes.end())
-                {
-                    myContactSlaveNodes.push_back(i_global);
-                    ++myContactSlaveNodes_id;
-                }
-            }
-        }
-        for (auto j = 0; j < myContactSlaveNodes.size(); ++j)
-            contacts(i, contacts_slave_nodes + j) = myContactSlaveNodes[j];
-
-        contacts(i, contacts_slave_nodes_size) = myContactSlaveNodes_id;
-        contacts(i, contacts_slave_elems_size) = myContactSlaveElems_id;
-
-        int myContactMasterNodes_id = 0;
-        int myContactMasterElems_id = 0;
-
-        std::vector<global_ordinal_type> myContactMasterNodes;
-
-        for (auto j = 0; j < pbl.Contacts[i]->master_elems.size(); ++j)
-        {
-            local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->master_elems[j]->no - 1);
-            if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(ElType::LINE2))
-                ;
-            else
-                continue;
-            contacts(i, contacts_master_elems + myContactMasterElems_id) = e;
-            ++myContactMasterElems_id;
-            for (auto n1 = 0; n1 < elementsList->getElementSize(e); ++n1)
-            {
-                global_ordinal_type i_global = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(e, n1));
-                if (std::find(myContactMasterNodes.begin(), myContactMasterNodes.end(), i_global) == myContactMasterNodes.end())
-                {
-                    myContactMasterNodes.push_back(i_global);
-                    ++myContactMasterNodes_id;
-                }
-            }
-        }
-
-        for (auto j = 0; j < myContactMasterNodes.size(); ++j)
-            contacts(i, contacts_master_nodes + j) = myContactMasterNodes[j];
-
-        contacts(i, contacts_master_nodes_size) = myContactMasterNodes_id;
-        contacts(i, contacts_master_elems_size) = myContactMasterElems_id;
-    }
-
-    for (auto i = 0; i < contacts_number; ++i)
-    {
-
-        for (auto j = 0; j < 3; ++j)
-        {
-            contacts(i, contacts_slave_normal + j) = pbl.Contacts[i]->slave_normal(j);
-            contacts(i, contacts_master_normal + j) = pbl.Contacts[i]->master_normal(j);
-
-            contacts_normal(i, j) = pbl.Contacts[i]->slave_normal(j);
-            contacts_normal(i, j + 3) = pbl.Contacts[i]->master_normal(j);
-        }
-
-        if (pbl.Contacts[i]->standard_shape_functions)
-            shape_function(i) = 1;
-        else
-            shape_function(i) = 0;
-
-        if (pbl.Contacts[i]->is_Signorini)
-            signorini(i) = 1;
-        else
-            signorini(i) = 0;
-
-        if (pbl.Contacts[i]->mesh_tying)
-            mesh_tying(i) = 1;
-        else
-            mesh_tying(i) = 0;
-
-        if (pbl.Contacts[i]->no_Update)
-            no_update(i) = 1;
-        else
-            no_update(i) = 0;
-
-        if (pbl.Contacts[i]->sticking)
-        {
-            sticking(i) = true;
-            at_least_one_sticking = true;
-        }
-        else
-            sticking(i) = false;
-
-        if (pbl.Contacts[i]->initial_closed)
-            initially_open(i) = 0;
-        else
-            initially_open(i) = 1;
-
-        contacts_scale(i) = pbl.Contacts[i]->scale;
-    }
-}
diff --git a/katoptron/src/ContactsList.h b/katoptron/src/ContactsList.h
deleted file mode 100644
index 4f6bf1f2b51945c32560fa5802f7afd504eaafa7..0000000000000000000000000000000000000000
--- a/katoptron/src/ContactsList.h
+++ /dev/null
@@ -1,500 +0,0 @@
-#ifndef KATOPTRON_CONTACTSLIST_H
-#define KATOPTRON_CONTACTSLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "NodesList.h"
-#include "ElementsList.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store the list of the contact interfaces.
- */
-class ContactsList
-{
-private:
-    bool at_least_one_sticking = false;
-
-    typedef typename Map::local_ordinal_type local_ordinal_type;
-    typedef typename Map::global_ordinal_type global_ordinal_type;
-
-    Kokkos::View<global_ordinal_type **, Kokkos::LayoutRight> contacts;
-    Kokkos::View<global_ordinal_type **, Kokkos::LayoutRight> contacts_dirichlet;
-
-    Kokkos::View<local_ordinal_type *, Kokkos::LayoutRight> shape_function;
-
-    Kokkos::View<local_ordinal_type *, Kokkos::LayoutRight> signorini;
-
-    Kokkos::View<local_ordinal_type *, Kokkos::LayoutRight> initially_open;
-
-    Kokkos::View<local_ordinal_type *, Kokkos::LayoutRight> no_update;
-    Kokkos::View<local_ordinal_type *, Kokkos::LayoutRight> sticking;
-    Kokkos::View<local_ordinal_type *, Kokkos::LayoutRight> mesh_tying;
-
-    Kokkos::View<double *, Kokkos::LayoutRight> contacts_scale;
-
-    Kokkos::View<local_ordinal_type **, Kokkos::LayoutRight> initially_closed_nodes;
-
-    Kokkos::View<double **, Kokkos::LayoutRight> contacts_normal;
-
-    local_ordinal_type contacts_number;
-    local_ordinal_type contacts_slave_nodes_size;
-    local_ordinal_type contacts_slave_elems_size;
-    local_ordinal_type contacts_master_nodes_size;
-    local_ordinal_type contacts_master_elems_size;
-    local_ordinal_type contacts_slave_normal;
-    local_ordinal_type contacts_master_normal;
-    local_ordinal_type contacts_slave_nodes;
-    local_ordinal_type contacts_slave_elems;
-    local_ordinal_type contacts_master_nodes;
-    local_ordinal_type contacts_master_elems;
-
-public:
-    ContactsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList,
-                 Teuchos::RCP<NodesList> nodesList);
-
-    ~ContactsList()
-    {
-        Kokkos::resize(contacts, 0, 0);
-        Kokkos::resize(contacts_normal, 0, 0);
-        Kokkos::resize(shape_function, 0);
-        Kokkos::resize(signorini, 0);
-        Kokkos::resize(initially_open, 0);
-        Kokkos::resize(no_update, 0);
-        Kokkos::resize(sticking, 0);
-        Kokkos::resize(mesh_tying, 0);
-        Kokkos::resize(contacts_scale, 0);
-        Kokkos::resize(contacts_dirichlet, 0, 0);
-        Kokkos::resize(initially_closed_nodes, 0, 0);
-    }
-
-    /**
-    * @brief Return the number of contact interfaces.
-    * 
-    */
-    inline local_ordinal_type getContactNumber() { return contacts_number; }
-
-    /**
-    * @brief Return the number of slave nodes for a
-    * given interface.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline local_ordinal_type getSlaveNodesSize(local_ordinal_type i)
-    {
-        return contacts(i, contacts_slave_nodes_size);
-    }
-
-    /**
-    * @brief Return the number of slave elements for a
-    * given interface.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline local_ordinal_type getSlaveElementsSize(local_ordinal_type i)
-    {
-        return contacts(i, contacts_slave_elems_size);
-    }
-
-    /**
-    * @brief Return the number of master nodes for a
-    * given interface.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline local_ordinal_type getMasterNodesSize(local_ordinal_type i)
-    {
-        return contacts(i, contacts_master_nodes_size);
-    }
-
-    /**
-    * @brief Return the number of master elements for a
-    * given interface.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline local_ordinal_type getMasterElementsSize(local_ordinal_type i)
-    {
-        return contacts(i, contacts_master_elems_size);
-    }
-
-    /**
-    * @brief Return the global ID of the slave node n1 of 
-    * a given interface.
-    * 
-    * Arguments:
-    * <ul>
-    *  <li> i: the interface ID,
-    *  <li> n1: the ID of the node on the current interface.
-    * </ul>
-    */
-    inline global_ordinal_type getSlaveNode(local_ordinal_type i, local_ordinal_type n1)
-    {
-        return contacts(i, contacts_slave_nodes + n1);
-    }
-
-    /**
-    * @brief Return the local ID of the slave element e1 of 
-    * a given interface.
-    * 
-    * Arguments:
-    * <ul>
-    *  <li> i: the interface ID,
-    *  <li> e1: the ID of the element on the current interface.
-    * </ul>
-    */
-    inline local_ordinal_type getSlaveElement(local_ordinal_type i, local_ordinal_type e1)
-    {
-        return contacts(i, contacts_slave_elems + e1);
-    }
-
-    /**
-    * @brief Return the global ID of the master node n1 of 
-    * a given interface.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID,
-    *  <li> n1: the ID of the node on the current interface.
-    * </ul>
-    */
-    inline global_ordinal_type getMasterNode(local_ordinal_type i, local_ordinal_type n1)
-    {
-        return contacts(i, contacts_master_nodes + n1);
-    }
-
-    /**
-    * @brief Return the local ID of the master element e1 of 
-    * a given interface.
-    * 
-    * Arguments:
-    * <ul>
-    *  <li> i: the interface ID,
-    *  <li> e1: the ID of the element on the current interface.
-    * </ul>
-    */
-    inline local_ordinal_type getMasterElement(local_ordinal_type i, local_ordinal_type e1)
-    {
-        return contacts(i, contacts_master_elems + e1);
-    }
-
-    /**
-    * @brief Return the jth component of the normal vector to the slave
-    * side of a given interface.
-    * 
-    * Arguments:
-    * <ul>
-    *  <li> i: the interface ID,
-    *  <li> j: the index of the component of the normal vector.
-    * </ul> 
-    */
-    inline double getSlaveNormal(local_ordinal_type i, local_ordinal_type j)
-    {
-        return contacts_normal(i, j);
-    }
-
-    /**
-    * @brief Return the jth component of the normal vector to the master
-    * side of a given interface.
-    * 
-    * Arguments:
-    * <ul>
-    *  <li> i: the interface ID,
-    *  <li> j: the index of the component of the normal vector.
-    * </ul>
-    */
-    inline double getMasterNormal(local_ordinal_type i, local_ordinal_type j)
-    {
-        return contacts_normal(i, j + 3);
-    }
-
-    /**
-    * @brief Return true if the shape functions of the Lagrange 
-    * multipliers are the standard shape function for a given interface.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline bool isStandardShapeFunction(local_ordinal_type i)
-    {
-        return shape_function(i) == 1;
-    }
-
-    /**
-    * @brief Return true if contact of the given interface is 
-    * initially open.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline bool isInitiallyOpen(local_ordinal_type i)
-    {
-        return initially_open(i) == 1;
-    }
-
-    /**
-    * @brief Return true if contact of the given interface is 
-    * initially close.
-    * 
-    * Argument:
-    * <ul>
-    *  <li> i: the interface ID.
-    * </ul>
-    */
-    inline bool isInitiallyClose(local_ordinal_type i)
-    {
-        return initially_open(i) == 0;
-    }
-
-    /**
-     * @brief Return true if the contact status of the given interface 
-     * should be checked and potentially updated.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline bool isUpdated(local_ordinal_type i)
-    {
-        return no_update(i) == 0;
-    }
-
-    /**
-     * @brief Return true if the contact status of the given interface 
-     * should not be checked.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline bool isNotUpdated(local_ordinal_type i)
-    {
-        return no_update(i) == 1;
-    }
-
-    /**
-     * @brief Return true if the given interface is a sticking contact
-     * interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline bool isSticking(local_ordinal_type i)
-    {
-        return sticking(i);
-    }
-
-    /**
-     * @brief Return true if the given interface is a mesh tying
-     * interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline bool isTying(local_ordinal_type i)
-    {
-        return mesh_tying(i);
-    }
-
-    /**
-     * @brief Return true if at least one contact interface is sticking.
-     */
-    inline bool hasAtLeastOneSticking(void)
-    {
-        return at_least_one_sticking;
-    }
-
-    /**
-     * @brief Return true if the given interface is a Signorini 
-     * contact interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline bool isSignorini(local_ordinal_type i)
-    {
-        return signorini(i) == 1;
-    }
-
-    /**
-     * @brief Return true if the given interface is not a Signorini 
-     * contact interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline bool isNotSignorini(local_ordinal_type i)
-    {
-        return signorini(i) == 0;
-    }
-
-    /**
-     * @brief Return true if at least one contact interface is a
-     * Signorini contact interface.
-     */
-    inline bool isSignorini()
-    {
-        for (local_ordinal_type i = 0; i < contacts_number; ++i)
-            if (isSignorini(i))
-                return true;
-        return false;
-    }
-
-    /**
-     * @brief Return true if all the contact interfaces are not
-     * Signorini contact interfaces.
-     */
-    inline bool isNotSignorini()
-    {
-        for (local_ordinal_type i = 0; i < contacts_number; ++i)
-            if (isSignorini(i))
-                return false;
-        return true;
-    }
-
-    /**
-     * @brief Return the number of Dirichlet nodes on the slave 
-     * side for a given interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline local_ordinal_type slaveDirichletSize(local_ordinal_type i)
-    {
-        return contacts_dirichlet(i, 0);
-    }
-
-    /**
-     * @brief Return the multiplicative scale used to multiply
-     * the normals of a given interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the interface ID.
-     * </ul>
-     */
-    inline double getMortarScale(local_ordinal_type i)
-    {
-        return contacts_scale(i);
-    }
-
-    /**
-     * @brief Return true if the node of global ID j is 
-     * a slave node of the interface i.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the interface ID,
-     *  <li> j: the global ID of the tested node.
-     * </ul>
-     */
-    bool isASlaveNode(local_ordinal_type i, global_ordinal_type j)
-    {
-        local_ordinal_type size = getSlaveNodesSize(i);
-        if (size == 0)
-            return false;
-        for (auto j2 = 0; j2 < size; ++j2)
-            if (j == getSlaveNode(i, j2))
-                return true;
-        return false;
-    }
-
-    /**
-     * @brief Return the interface ID associated to a slave node
-     * of global ID j.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> j: the global ID of the node.
-     * </ul>
-     */
-    local_ordinal_type getInterfaceOfSlaveNode(local_ordinal_type j)
-    {
-        for (local_ordinal_type i = 0; i < contacts_number; ++i)
-            if (isASlaveNode(i, j))
-                return i;
-        return 0;
-    }
-
-    /**
-     * @brief Return true if the slave node of global ID j 
-     * is a Dirichlet node on the interface i.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the interface ID,
-     *  <li> j: the global ID of the node.
-     * </ul>
-     */
-    bool isASlaveDirichletNode(local_ordinal_type i, local_ordinal_type j)
-    {
-        local_ordinal_type size = slaveDirichletSize(i);
-        if (size == 0)
-            return false;
-        for (auto j2 = 0; j2 < size; ++j2)
-            if (j == contacts_dirichlet(i, j2 + 1))
-                return true;
-        return false;
-    }
-
-    /**
-     * @brief Return true if the Lagrange multiplier associated to the
-     * slave node of global ID j on the interface i is initially active (closed contact).
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the interface ID,
-     *  <li> j: the global ID of the node.
-     * </ul>
-     */
-    bool isNodeInitiallyClosed(local_ordinal_type i, local_ordinal_type j)
-    {
-        local_ordinal_type size = initially_closed_nodes(i, 0);
-        if (size == 0)
-            return false;
-        for (auto j2 = 0; j2 < size; ++j2)
-            if (j == initially_closed_nodes(i, j2 + 1))
-                return true;
-        return false;
-    }
-};
-
-}; // namespace katoptron
-
-#endif //KATOPTRON_CONTACTSLIST_H
diff --git a/katoptron/src/DirichletList.h b/katoptron/src/DirichletList.h
deleted file mode 100644
index 8f5627e935e27dee42df851fc3f522fe76cd1005..0000000000000000000000000000000000000000
--- a/katoptron/src/DirichletList.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef KATOPTRON_DIRICHLETLIST_H
-#define KATOPTRON_DIRICHLETLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wDirichlet.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wNode.h"
-
-#include "ElementsList.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-#include "EnsembleTraits.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store the list of the Dirichlet boundary conditions (BC).
- */
-template <typename scalar>
-class DirichletList
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-private:
-    Kokkos::View<global_ordinal_type **, Kokkos::LayoutRight> dirichlet_nodesList;
-    Kokkos::View<scalar ***, Kokkos::LayoutRight> dirichlet_values_list;
-
-    local_ordinal_type dirichlet_number;
-    local_ordinal_type dirichlet_size;
-    local_ordinal_type dirichlet_nodes;
-
-    local_ordinal_type dirichlet_time;
-    local_ordinal_type dirichlet_dofs;
-    local_ordinal_type dirichlet_values;
-
-public:
-    DirichletList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
-
-    /**
-     * @brief Return the number of Dirichlet BC.
-     */
-    inline local_ordinal_type getDirichletNumber() { return dirichlet_number; }
-
-    /**
-     * @brief Return the number of nodes for a
-     * given Dirichlet BC.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the BC ID.
-     * </ul>
-     */
-    inline local_ordinal_type getDirichletSize(local_ordinal_type i)
-    {
-        return dirichlet_nodesList(i, dirichlet_size);
-    }
-
-    /**
-     * @brief Return the global ID of the node n1 of 
-     * a given BC.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the BC ID,
-     *  <li> n1: the ID of the node on the current BC.
-     * </ul>
-     */
-    inline global_ordinal_type getDirichletNode(local_ordinal_type i, local_ordinal_type n1)
-    {
-        return dirichlet_nodesList(i, dirichlet_nodes + n1);
-    }
-
-    /**
-     * @brief Return whether the DOF j is fixed for a given BC.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the BC ID,
-     *  <li> j: the index of the DOF (0-3 if thermomechanical problems).
-     * </ul> 
-     */
-    inline scalar getDirichletDof(local_ordinal_type i, local_ordinal_type j)
-    {
-        return dirichlet_values_list(i, 0, dirichlet_dofs + j);
-    }
-
-    /**
-     * @brief Return the value of the fixed DOF for a given BC.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the BC ID,
-     *  <li> j: the index of the DOF (0-3 if thermomechanical problems).
-     * </ul> 
-     */
-    inline scalar getDirichletValue(local_ordinal_type i, local_ordinal_type j)
-    {
-        return dirichlet_values_list(i, 0, dirichlet_values + j);
-    }
-};
-}; // namespace katoptron
-
-#endif //KATOPTRON_DIRICHLETLIST_H
diff --git a/katoptron/src/DirichletList.hpp b/katoptron/src/DirichletList.hpp
deleted file mode 100644
index c26eabc868c8a2a62407bdfec2a86e539611db2f..0000000000000000000000000000000000000000
--- a/katoptron/src/DirichletList.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-namespace katoptron
-{
-
-/**
- * @brief DirichletList constructor
- *
- * This constructor allocates 2 Kokkos::View which store all the required information related to each Dirichlet BC, including:
- * <ul>
- *  <li> all the Dirichlet nodes,
- *  <li> all the values of the Dirichlet BC.
- * </ul>
- *
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to an ElementList object.
- * </ul>
- */
-template <typename scalar>
-DirichletList<scalar>::DirichletList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-    typedef EnsembleTraits<scalar> ET;
-    const int ensemble_size = ET::size;
-
-    local_ordinal_type numDPN = map->numPrimalDPN;
-    dirichlet_number = pbl.duBCs.size();
-    local_ordinal_type maxNumNodesPerBC = 0;
-
-    std::vector<std::vector<global_ordinal_type>> bcNodes = {};
-
-    for (auto i = 0; i < dirichlet_number; ++i)
-    {
-        std::vector<global_ordinal_type> tmpMyBcNodes = {};
-        std::vector<global_ordinal_type> myBcNodes = {};
-
-        for (auto j = 0; j < pbl.duBCs[i]->nodes.size(); ++j)
-            tmpMyBcNodes.push_back(pbl.duBCs[i]->nodes[j]->row);
-
-        std::sort(tmpMyBcNodes.begin(), tmpMyBcNodes.end());
-
-        if (tmpMyBcNodes.size() >= 1)
-            myBcNodes.push_back(tmpMyBcNodes[0]);
-
-        for (auto ii = 1; ii < tmpMyBcNodes.size(); ++ii)
-            if (tmpMyBcNodes[ii] != tmpMyBcNodes[ii - 1])
-                myBcNodes.push_back(tmpMyBcNodes[ii]);
-
-        bcNodes.push_back(myBcNodes);
-        if (maxNumNodesPerBC < myBcNodes.size())
-            maxNumNodesPerBC = myBcNodes.size();
-    }
-
-    dirichlet_size = 0;
-    dirichlet_nodes = 1;
-    dirichlet_nodesList = Kokkos::View<int **, Kokkos::LayoutRight>("R", dirichlet_number, dirichlet_nodes + maxNumNodesPerBC);
-
-    for (auto i = 0; i < dirichlet_number; ++i)
-    {
-        dirichlet_nodesList(i, dirichlet_size) = bcNodes[i].size();
-        for (auto j = 0; j < bcNodes[i].size(); ++j)
-        {
-            dirichlet_nodesList(i, dirichlet_nodes + j) = bcNodes[i][j];
-        }
-    }
-
-    dirichlet_time = 0;
-    dirichlet_dofs = 1;
-    dirichlet_values = 1 + numDPN;
-    dirichlet_values_list = Kokkos::View<scalar ***, Kokkos::LayoutRight>("R", dirichlet_number, 1, 1 + 2 * numDPN);
-    for (auto i = 0; i < dirichlet_number; ++i)
-    {
-        dirichlet_values_list(i, 0, dirichlet_time) = 0.; //to change latter
-        for (auto j = 0; j < numDPN; ++j)
-            if (pbl.duBCs[i]->which_dof[j])
-                dirichlet_values_list(i, 0, dirichlet_dofs + j) = 1;
-            else
-                dirichlet_values_list(i, 0, dirichlet_dofs + j) = 0;
-
-        for (int j = 0; j < ensemble_size; ++j)
-        {
-            ET::coeff(dirichlet_values_list(i, 0, dirichlet_values + 0), j) = pbl.duBCs[i]->x_values[j];
-            ET::coeff(dirichlet_values_list(i, 0, dirichlet_values + 1), j) = pbl.duBCs[i]->y_values[j];
-            ET::coeff(dirichlet_values_list(i, 0, dirichlet_values + 2), j) = pbl.duBCs[i]->z_values[j];
-            if (numDPN == 4)
-                ET::coeff(dirichlet_values_list(i, 0, dirichlet_values + 3), j) = pbl.duBCs[i]->T_values[j];
-        }
-    }
-}
-}; // namespace katoptron
diff --git a/katoptron/src/DirichletListETI.cpp b/katoptron/src/DirichletListETI.cpp
deleted file mode 100644
index ea0ea71e5c9ebccfdd1cb6381e2122c02009c118..0000000000000000000000000000000000000000
--- a/katoptron/src/DirichletListETI.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "DirichletList.h"
-#include "DirichletList.hpp"
-
-using namespace katoptron;
-
-template class DirichletList<double>;
-template class DirichletList<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>>;
-template class DirichletList<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>>;
-template class DirichletList<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>>;
-template class DirichletList<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>>;
\ No newline at end of file
diff --git a/katoptron/src/DiscreteProblem.h b/katoptron/src/DiscreteProblem.h
deleted file mode 100644
index 54a9c7d4cfd78d49c02cf17c4a0eb6053e501a93..0000000000000000000000000000000000000000
--- a/katoptron/src/DiscreteProblem.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef KATOPTRON_DISCRETEPROBLEM_H
-#define KATOPTRON_DISCRETEPROBLEM_H
-
-#include "katoptron.h"
-#include "Map.h"
-#include "Domain.h"
-#include "Loads.h"
-#include "Algebraic.h"
-#include "ElementMatrices.h"
-#include "ElementVectors.h"
-
-#include <Xpetra_Map.hpp>
-#include <Xpetra_TpetraMap.hpp>
-#include <Xpetra_BlockedMap.hpp>
-#include <Xpetra_BlockedCrsMatrix.hpp>
-#include <Xpetra_BlockedMultiVector.hpp>
-#include <Xpetra_TpetraCrsMatrix.hpp>
-#include <Xpetra_TpetraMultiVector.hpp>
-#include <Xpetra_CrsMatrixWrap.hpp>
-//#include <Xpetra_UseShortNames.hpp>
-
-#include "LinearSolver.h"
-
-#include "Mortar.h"
-
-#include <mpi.h>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store all the information related to the discretized problem:
- * <ul>
- *  <li> the information related to the activity of the Lagrange multipliers,
- *  <li> the discretized domain,
- *  <li> the algebraic information.
- * </ul>
- */
-template <typename scalar>
-class DiscreteProblem
-{
-private:
-    Kokkos::View<scalar *, Kokkos::LayoutRight> old_old_activity;
-    Kokkos::View<scalar *, Kokkos::LayoutRight> old_activity;
-
-public:
-    //
-    // Convenience typedefs
-    //
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-    typedef Map::node_type node_type;
-    typedef Tpetra::Export<local_ordinal_type, global_ordinal_type> export_type;
-
-    typedef Map::tpetra_map_type tpetra_map_type;
-    typedef Map::xpetra_map_type xpetra_map_type;
-    typedef Map::xpetra_tmap_type xpetra_tmap_type;
-    typedef Map::xpetra_bmap_type xpetra_bmap_type;
-
-    typedef typename Vectors<scalar>::tpetra_vector_type tpetra_vector_type;
-    typedef typename Vectors<scalar>::tpetra_mvector_type tpetra_mvector_type;
-    typedef typename Vectors<scalar>::xpetra_bmvector_type xpetra_bmvector_type;
-    typedef typename Vectors<scalar>::xpetra_mvector_type xpetra_mvector_type;
-    typedef typename Vectors<scalar>::xpetra_tmvector_type xpetra_tmvector_type;
-
-    typedef typename Matrices<scalar>::tpetra_crs_type tpetra_crs_type;
-    typedef typename Matrices<scalar>::xpetra_crs_type xpetra_crs_type;
-    typedef typename Matrices<scalar>::xpetra_wcrs_type xpetra_wcrs_type;
-    typedef typename Matrices<scalar>::xpetra_bcrs_type xpetra_bcrs_type;
-    typedef typename Matrices<scalar>::xpetra_tcrs_type xpetra_tcrs_type;
-#ifndef SWIG
-    Teuchos::RCP<Domain<scalar>> domain;
-    Teuchos::RCP<Loads<scalar>> loads;
-    Teuchos::RCP<Algebraic<scalar>> algebraic;
-#endif
-    size_t numPrimalDPN;
-
-    DiscreteProblem(Problem &pbl, size_t _numPrimalDPN,
-                    Teuchos::RCP<Teuchos::ParameterList> randomParams,
-                    Kokkos::View<scalar *, Kokkos::LayoutLeft> m_rv_values);
-
-    ~DiscreteProblem()
-    {
-        std::cout << "~DiscreteProblem()\n";
-    }
-
-#ifndef SWIG
-    void createBlockMatrix(scalar gamma, bool write, bool merge);
-    void createBlockMVector(bool write);
-    void computeMatrices(void);
-    void computeContactMatrices(MPI_Comm comm);
-    void computeLoads(bool scaled = false);
-    Mask<scalar> updateActivity(int active_set_iteration);
-
-#endif
-};
-}; // namespace katoptron
-
-#endif //KATOPTRON_DISCRETEPROBLEM_H
diff --git a/katoptron/src/DiscreteProblem.hpp b/katoptron/src/DiscreteProblem.hpp
deleted file mode 100644
index 3a0332c08711851225803afd5533e46705dff4aa..0000000000000000000000000000000000000000
--- a/katoptron/src/DiscreteProblem.hpp
+++ /dev/null
@@ -1,1424 +0,0 @@
-#include <Xpetra_MatrixFactory.hpp>
-#include <Xpetra_Matrix.hpp>
-#include <Xpetra_MatrixMatrix.hpp>
-#include <Xpetra_CrsMatrixWrap.hpp>
-#include <Xpetra_BlockedCrsMatrix.hpp>
-#include <Xpetra_CrsMatrix.hpp>
-#include <MueLu_Utilities_decl.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief DiscreteProblem constructor
- * 
- * This constructor constructs a katoptron::Map, a katoptron::Domain, a katoptron::Loads, and a katoptron::Algebraic.
- * The last three objects are stored as member data of the katoptron::DiscreteProblem object and include all
- * the information related to the problem to solve. See the documentation of the member data for more information on
- * the purpose of each class.
- * 
- * Arguments:
- * <ul>
- *  <li> A problem object,
- *  <li> An RCP to a ParameterList object which describes the random fields,
- *  <li> A Kokkos View of the values used in the discretization of the random fields.
- * </ul>
- */
-template <typename scalar>
-DiscreteProblem<scalar>::DiscreteProblem(Problem &pbl, size_t _numPrimalDPN,
-                                         Teuchos::RCP<Teuchos::ParameterList> randomParams,
-                                         Kokkos::View<scalar *, Kokkos::LayoutLeft> m_rv_values)
-{
-    numPrimalDPN = _numPrimalDPN;
-
-    LinearSolver::getTimers()["map"].start();
-    Teuchos::RCP<Map> map = Teuchos::rcp(new Map(pbl, numPrimalDPN));
-    LinearSolver::getTimers()["map"].stop();
-    LinearSolver::getTimers()["domain"].start();
-    domain = Teuchos::rcp(new Domain<scalar>(pbl, map, randomParams, m_rv_values));
-    LinearSolver::getTimers()["domain"].stop();
-    LinearSolver::getTimers()["loads"].start();
-    loads = Teuchos::rcp(new Loads<scalar>(pbl, map, domain));
-    LinearSolver::getTimers()["loads"].stop();
-    algebraic = Teuchos::rcp(new Algebraic<scalar>(map, domain));
-}
-
-/**
- * @brief Update the activity of the Lagrange multipliers
- * and return a Mask which stores true for the converged samples.
- * 
- * Argument:
- * <ul>
- *  <li> active_set_iteration: ID of the current active set iteration.
- * </ul>
- */
-template <typename scalar>
-Mask<scalar> DiscreteProblem<scalar>::updateActivity(int active_set_iteration)
-{
-    using Teuchos::Array;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    const size_t myRank = algebraic->map->mapDofs->getComm()->getRank();
-
-    // First, get the displacement solution,
-
-    RCP<tpetra_mvector_type> mx =
-        (Teuchos::rcp_dynamic_cast<xpetra_tmvector_type>(algebraic->vectors->solutionMultiVector))->getTpetra_MultiVector();
-    RCP<tpetra_vector_type> xl = mx->getVectorNonConst(0);
-
-    RCP<tpetra_vector_type> x = rcp(new tpetra_vector_type(algebraic->map->mapDofs, false));
-
-    RCP<xpetra_bmvector_type> blockedSol =
-        rcp(new xpetra_bmvector_type(algebraic->map->blockedMap, algebraic->vectors->solutionMultiVector));
-
-    RCP<tpetra_vector_type> l =
-        (Teuchos::rcp_dynamic_cast<xpetra_tmvector_type>(blockedSol->getMultiVector(1, true)))->getTpetra_MultiVector()->getVectorNonConst(0);
-
-    RCP<tpetra_vector_type> gap = rcp(new tpetra_vector_type(*algebraic->vectors->initialGap, Teuchos::Copy));
-
-    RCP<export_type> exportx = rcp(new export_type(algebraic->map->fullmap, algebraic->map->mapDofs));
-
-    x->doExport(*xl, *exportx, Tpetra::INSERT);
-
-    // Multiply it with B_G and remove initial gap
-
-    // gap = 1 * B_G * x - 1 * gap
-
-    algebraic->matrices->B_G->apply(*x, *gap, Teuchos::NO_TRANS, ((scalar)1.), ((scalar)-1.));
-
-    // sum lambda + c * the previously computed vector
-    double c = 1.;
-    l->update((scalar)c, *gap, (scalar)1.); // l = l + c*gap
-
-    // loop on the local lagrange and create the new activity
-
-    l->template sync<Kokkos::HostSpace>();
-    auto l_2d = l->template getLocalView<Kokkos::HostSpace>();
-
-    Mask<scalar> hasConverged;
-    const size_t ensemble_size = hasConverged.getSize();
-
-    for (size_t l = 0; l < ensemble_size; ++l)
-        hasConverged.set(l, true);
-
-    bool hasConverged_old = false;
-    if (active_set_iteration > 1)
-        hasConverged_old = true;
-
-    algebraic->matrices->B_2->resumeFill();
-    algebraic->matrices->C->resumeFill();
-    algebraic->matrices->Cb->resumeFill();
-
-    const size_t numDPN = algebraic->map->numPrimalDPN;
-
-    size_t numLMPN;
-    if (domain->contactsList->hasAtLeastOneSticking() && numDPN == 4)
-        numLMPN = 4;
-    else if (domain->contactsList->hasAtLeastOneSticking())
-        numLMPN = 3;
-    else if (numDPN == 4)
-        numLMPN = 2;
-    else
-        numLMPN = 1;
-
-    const int numMyLagrangeNum = algebraic->map->mapLagrangeDofs->getNodeNumElements();
-
-    const int numMyMechLagrangeNum = numMyLagrangeNum / numLMPN;
-
-    for (auto local_index = 0; local_index < numMyMechLagrangeNum; ++local_index)
-    {
-        global_ordinal_type lagrange_id = algebraic->map->mapLagrangeDofs->getGlobalElement(local_index);
-        global_ordinal_type node_id = algebraic->map->lm_to_dof[lagrange_id];
-        lagrange_id = lagrange_id * numLMPN;
-        local_ordinal_type interface_id = domain->contactsList->getInterfaceOfSlaveNode(node_id);
-
-        if (domain->contactsList->isNotUpdated(interface_id))
-            continue;
-
-        scalar old_mask = old_activity(local_index);
-        scalar old_old_mask = old_old_activity(local_index);
-        Mask<scalar> current_mask = (l_2d(local_index * numLMPN, 0) >= 0.);
-
-        scalar oneMask, oneNotMask;
-        mask_assign<scalar>(current_mask, oneMask) = {1., 0.};
-        mask_assign<scalar>(current_mask, oneNotMask) = {0., 1.};
-
-        if (active_set_iteration > 1)
-            if (!MaskLogic::AND(oneMask == old_old_mask))
-                hasConverged_old = false;
-
-        hasConverged = hasConverged && (oneMask == old_mask);
-
-        if (!MaskLogic::AND(oneMask == old_mask))
-        {
-            global_ordinal_type lagrange_id = algebraic->map->mapLagrangeDofs->getGlobalElement(local_index);
-
-            lagrange_id = lagrange_id * numLMPN;
-
-            // If the current Lagrange multiplier is active for every sample of the current ensemble,
-            // we can do the update without using the mask entries.
-            if (MaskLogic::AND(current_mask))
-            {
-                Teuchos::ArrayView<const local_ordinal_type> local_indices;
-                Teuchos::ArrayView<const scalar> values;
-
-                if (domain->contactsList->isSticking(interface_id))
-                {
-                    for (size_t j = 0; j < numLMPN; ++j)
-                    {
-                        algebraic->matrices->B->getLocalRowView(local_index * numLMPN + j, local_indices, values);
-
-                        for (auto k = 0; k < local_indices.size(); ++k)
-                        {
-                            global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                            algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + j,
-                                                                          Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                          Teuchos::tuple<scalar>(values[k]));
-                        }
-
-                        algebraic->matrices->C->replaceGlobalValues(lagrange_id + j,
-                                                                    Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                    Teuchos::tuple<scalar>((scalar)0.));
-
-                        algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + j,
-                                                                     Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                     Teuchos::tuple<scalar>((scalar)1.));
-                    }
-                }
-                else
-                {
-                    algebraic->matrices->B->getLocalRowView(local_index * numLMPN, local_indices, values);
-
-                    for (auto k = 0; k < local_indices.size(); ++k)
-                    {
-                        global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                        algebraic->matrices->B_2->replaceGlobalValues(lagrange_id,
-                                                                      Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                      Teuchos::tuple<scalar>(values[k]));
-                    }
-
-                    algebraic->matrices->C->replaceGlobalValues(lagrange_id,
-                                                                Teuchos::tuple<global_ordinal_type>(lagrange_id),
-                                                                Teuchos::tuple<scalar>((scalar)0.));
-
-                    algebraic->matrices->Cb->replaceGlobalValues(lagrange_id,
-                                                                 Teuchos::tuple<global_ordinal_type>(lagrange_id),
-                                                                 Teuchos::tuple<scalar>((scalar)1.));
-
-                    if (numLMPN == 2 || numLMPN == 4)
-                    {
-                        algebraic->matrices->B->getLocalRowView(local_index * numLMPN + numLMPN - 1, local_indices, values);
-
-                        for (auto k = 0; k < local_indices.size(); ++k)
-                        {
-                            global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                            algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                          Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                          Teuchos::tuple<scalar>(values[k]));
-                        }
-
-                        algebraic->matrices->C->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                    Teuchos::tuple<global_ordinal_type>(lagrange_id + numLMPN - 1),
-                                                                    Teuchos::tuple<scalar>((scalar)0.));
-
-                        algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                     Teuchos::tuple<global_ordinal_type>(lagrange_id + numLMPN - 1),
-                                                                     Teuchos::tuple<scalar>((scalar)1.));
-                    }
-                }
-            }
-            // If the current Lagrange multiplier is inactive for every sample of the current ensemble,
-            // we can do the update without using the mask entries.
-            else if (!MaskLogic::AND(current_mask))
-            {
-                Teuchos::ArrayView<const local_ordinal_type> local_indices;
-                Teuchos::ArrayView<const scalar> values;
-
-                if (domain->contactsList->isSticking(interface_id))
-                {
-                    for (size_t j = 0; j < numLMPN; ++j)
-                    {
-                        algebraic->matrices->B->getLocalRowView(local_index * numLMPN + j, local_indices, values);
-
-                        for (auto k = 0; k < local_indices.size(); ++k)
-                        {
-                            global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                            algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + j,
-                                                                          Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                          Teuchos::tuple<scalar>((scalar)0.));
-                        }
-
-                        algebraic->matrices->C->replaceGlobalValues(lagrange_id + j,
-                                                                    Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                    Teuchos::tuple<scalar>((scalar)1.));
-
-                        algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + j,
-                                                                     Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                     Teuchos::tuple<scalar>((scalar)0.));
-                    }
-                }
-                else
-                {
-                    algebraic->matrices->B->getLocalRowView(local_index * numLMPN, local_indices, values);
-
-                    for (auto k = 0; k < local_indices.size(); ++k)
-                    {
-                        global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                        algebraic->matrices->B_2->replaceGlobalValues(lagrange_id,
-                                                                      Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                      Teuchos::tuple<scalar>((scalar)0.));
-                    }
-
-                    algebraic->matrices->C->replaceGlobalValues(lagrange_id,
-                                                                Teuchos::tuple<global_ordinal_type>(lagrange_id),
-                                                                Teuchos::tuple<scalar>((scalar)1.));
-
-                    algebraic->matrices->Cb->replaceGlobalValues(lagrange_id,
-                                                                 Teuchos::tuple<global_ordinal_type>(lagrange_id),
-                                                                 Teuchos::tuple<scalar>((scalar)0.));
-
-                    if (numLMPN == 2 || numLMPN == 4)
-                    {
-                        algebraic->matrices->B->getLocalRowView(local_index * numLMPN + numLMPN - 1, local_indices, values);
-
-                        for (auto k = 0; k < local_indices.size(); ++k)
-                        {
-                            global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                            algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                          Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                          Teuchos::tuple<scalar>((scalar)0.));
-                        }
-
-                        algebraic->matrices->C->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                    Teuchos::tuple<global_ordinal_type>(lagrange_id + numLMPN - 1),
-                                                                    Teuchos::tuple<scalar>((scalar)1.));
-
-                        algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                     Teuchos::tuple<global_ordinal_type>(lagrange_id + numLMPN - 1),
-                                                                     Teuchos::tuple<scalar>((scalar)0.));
-                    }
-                }
-            }
-            // Else, if the activity of the current Lagrange multiplier depends on the samples, we use the mask to do the update.
-            else
-            {
-
-                Teuchos::ArrayView<const local_ordinal_type> local_indices;
-                Teuchos::ArrayView<const scalar> values;
-
-                if (domain->contactsList->isSticking(interface_id))
-                {
-                    for (size_t j = 0; j < numLMPN; ++j)
-                    {
-                        algebraic->matrices->B->getLocalRowView(local_index * numLMPN + j, local_indices, values);
-
-                        for (auto k = 0; k < local_indices.size(); ++k)
-                        {
-                            global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                            algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + j,
-                                                                          Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                          Teuchos::tuple<scalar>(oneMask * values[k]));
-                        }
-
-                        algebraic->matrices->C->replaceGlobalValues(lagrange_id + j,
-                                                                    Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                    Teuchos::tuple<scalar>(oneNotMask));
-
-                        algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + j,
-                                                                     Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                     Teuchos::tuple<scalar>(oneMask));
-                    }
-                }
-                else
-                {
-                    algebraic->matrices->B->getLocalRowView(local_index * numLMPN, local_indices, values);
-
-                    for (auto k = 0; k < local_indices.size(); ++k)
-                    {
-                        global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                        algebraic->matrices->B_2->replaceGlobalValues(lagrange_id,
-                                                                      Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                      Teuchos::tuple<scalar>(oneMask * values[k]));
-                    }
-
-                    algebraic->matrices->C->replaceGlobalValues(lagrange_id,
-                                                                Teuchos::tuple<global_ordinal_type>(lagrange_id),
-                                                                Teuchos::tuple<scalar>(oneNotMask));
-
-                    algebraic->matrices->Cb->replaceGlobalValues(lagrange_id,
-                                                                 Teuchos::tuple<global_ordinal_type>(lagrange_id),
-                                                                 Teuchos::tuple<scalar>(oneMask));
-
-                    if (numLMPN == 2 || numLMPN == 4)
-                    {
-                        algebraic->matrices->B->getLocalRowView(local_index * numLMPN + numLMPN - 1, local_indices, values);
-
-                        for (auto k = 0; k < local_indices.size(); ++k)
-                        {
-                            global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                            algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                          Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                          Teuchos::tuple<scalar>(oneMask * values[k]));
-                        }
-
-                        algebraic->matrices->C->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                    Teuchos::tuple<global_ordinal_type>(lagrange_id + numLMPN - 1),
-                                                                    Teuchos::tuple<scalar>(oneNotMask));
-
-                        algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + numLMPN - 1,
-                                                                     Teuchos::tuple<global_ordinal_type>(lagrange_id + numLMPN - 1),
-                                                                     Teuchos::tuple<scalar>(oneMask));
-                    }
-                }
-            }
-        }
-
-        old_old_activity(local_index) = old_activity(local_index);
-        old_activity(local_index) = oneMask;
-    }
-
-    algebraic->matrices->B_2->fillComplete(algebraic->map->mapDofs, algebraic->map->mapLagrangeDofs);
-    algebraic->matrices->C->fillComplete();
-    algebraic->matrices->Cb->fillComplete();
-
-    RCP<tpetra_vector_type> initialActiveGap(new tpetra_vector_type(algebraic->map->mapLagrangeDofs, true));
-    algebraic->matrices->Cb->apply(*algebraic->vectors->initialGap, *initialActiveGap);
-
-    RCP<xpetra_mvector_type> xg =
-        rcp(new xpetra_tmvector_type(initialActiveGap));
-    algebraic->vectors->rhsBlockedMultiVector->setMultiVector(1, xg, true);
-    algebraic->vectors->rhsMultiVector = algebraic->vectors->rhsBlockedMultiVector->Merge();
-
-    size_t numtasks = algebraic->map->mapDofs->getComm()->getSize();
-
-    double tmp;
-
-    if (myRank == 0)
-    {
-        Mask<scalar> globalHasConverged = hasConverged;
-        bool globalHasConverged_old = hasConverged_old;
-
-        for (size_t i = 1; i < numtasks; ++i)
-        {
-            for (size_t l = 0; l < ensemble_size; ++l)
-            {
-                MPI_Recv(&tmp, 1, MPI_DOUBLE, i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
-                if (tmp < 0.)
-                    globalHasConverged.set(l, false);
-            }
-            MPI_Recv(&tmp, 1, MPI_DOUBLE, i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
-            if (tmp < 0.)
-                globalHasConverged_old = false;
-        }
-        hasConverged = globalHasConverged;
-        hasConverged_old = globalHasConverged_old;
-
-        for (size_t i = 1; i < numtasks; ++i)
-        {
-            for (size_t l = 0; l < ensemble_size; ++l)
-            {
-                tmp = hasConverged.get(l) ? 1. : -1.;
-                MPI_Send(&tmp, 1, MPI_DOUBLE, i, 0, MPI_COMM_WORLD);
-            }
-            tmp = hasConverged_old ? 1. : -1.;
-            MPI_Send(&tmp, 1, MPI_DOUBLE, i, 0, MPI_COMM_WORLD);
-        }
-    }
-    else
-    {
-        for (size_t l = 0; l < ensemble_size; ++l)
-        {
-            tmp = hasConverged.get(l) ? 1. : -1.;
-            MPI_Send(&tmp, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD);
-        }
-        tmp = hasConverged_old ? 1. : -1.;
-        MPI_Send(&tmp, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD);
-        for (size_t l = 0; l < ensemble_size; ++l)
-        {
-            MPI_Recv(&tmp, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
-            hasConverged.set(l, tmp > 0.);
-        }
-        MPI_Recv(&tmp, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
-        hasConverged_old = (tmp > 0.);
-    }
-
-    if (hasConverged_old)
-    {
-        if (myRank == 0)
-        {
-            std::cout << "-----------------------" << std::endl;
-            std::cout << "---Has not converged---" << std::endl;
-            std::cout << "-----------------------" << std::endl;
-        }
-        return true;
-    }
-
-    return hasConverged;
-}
-
-/**
- * @brief Create the block matrix.
- * 
- * Arguments:
- * <ul>
- *  <li> gamma: the value used for the Augmented Lagrangian formulation,
- *  <li> write: a boolean which is used to write matrices on disk or not.
- * </ul>
- */
-template <typename scalar>
-void DiscreteProblem<scalar>::createBlockMatrix(scalar gamma, bool write, bool merge)
-{
-    using Teuchos::Array;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    const std::vector<RCP<const tpetra_map_type>> maps = {algebraic->map->mapDofs, algebraic->map->mapLagrangeDofs};
-
-    const size_t numDofs = algebraic->map->mapDofs->getGlobalNumElements();
-    const size_t numMyDofs = algebraic->map->mapDofs->getNodeNumElements();
-    const size_t numMyDofsWO = algebraic->map->mapDofsWO->getNodeNumElements();
-    Teuchos::ArrayView<const global_ordinal_type> myDofs = algebraic->map->mapDofs->getNodeElementList();
-    Teuchos::ArrayView<const global_ordinal_type> myDofsWO = algebraic->map->mapDofsWO->getNodeElementList();
-
-    const size_t numLagrangeDofs = algebraic->map->mapLagrangeDofs->getGlobalNumElements();
-    const size_t numMyLagrangeDofs = algebraic->map->mapLagrangeDofs->getNodeNumElements();
-    Teuchos::ArrayView<const global_ordinal_type> myLagrangeDofs = algebraic->map->mapLagrangeDofs->getNodeElementList();
-
-    Array<global_ordinal_type> myFullDofs(numMyDofs + numMyLagrangeDofs);
-    for (auto i = 0; i < numMyDofs; ++i)
-        myFullDofs[i] = myDofs[i];
-    for (auto i = 0; i < numMyLagrangeDofs; ++i)
-        myFullDofs[numMyDofs + i] = numDofs + myLagrangeDofs[i];
-
-    Array<global_ordinal_type> myFullDofsWO(numMyDofsWO + numMyLagrangeDofs);
-    for (auto i = 0; i < numMyDofsWO; ++i)
-        myFullDofsWO[i] = myDofsWO[i];
-    for (auto i = 0; i < numMyLagrangeDofs; ++i)
-        myFullDofsWO[numMyDofsWO + i] = numDofs + myLagrangeDofs[i];
-
-    algebraic->map->fullmap =
-        rcp(new tpetra_map_type(numDofs + numLagrangeDofs,
-                                myFullDofs,
-                                algebraic->map->mapDofs->getIndexBase(),
-                                algebraic->map->mapDofs->getComm()));
-    algebraic->map->fullmapWO =
-        rcp(new tpetra_map_type(numDofs + numLagrangeDofs,
-                                myFullDofsWO,
-                                algebraic->map->mapDofs->getIndexBase(),
-                                algebraic->map->mapDofs->getComm()));
-
-    RCP<xpetra_map_type> xfullmap = rcp(new xpetra_tmap_type(algebraic->map->fullmap));
-
-    const size_t myRank = algebraic->map->mapDofs->getComm()->getRank();
-    const size_t numLclIndices = (myRank == 0) ? numDofs + numLagrangeDofs : 0;
-
-    algebraic->map->fullmapOutput =
-        rcp(new tpetra_map_type(numDofs + numLagrangeDofs,
-                                numLclIndices,
-                                algebraic->map->mapDofs->getIndexBase(),
-                                algebraic->map->mapDofs->getComm()));
-
-    std::vector<RCP<const xpetra_map_type>> xsubmaps = {rcp(new xpetra_tmap_type(algebraic->map->mapDofs)), //algebraic->map->thermomecBlockedMap,
-                                                        rcp(new xpetra_tmap_type(algebraic->map->mapLagrangeDofs))};
-
-    algebraic->map->blockedMap =
-        rcp(new xpetra_bmap_type(xfullmap, xsubmaps, true));
-
-    algebraic->matrices->blockedMatrix =
-        rcp(new xpetra_bcrs_type(algebraic->map->blockedMap, algebraic->map->blockedMap, 8));
-
-    //Update B based on the initial activity
-
-    algebraic->matrices->B_2->resumeFill();
-    algebraic->matrices->C->resumeFill();
-    algebraic->matrices->Cb->resumeFill();
-
-    const size_t numDPN = algebraic->map->numPrimalDPN;
-
-    size_t numLMPN;
-    if (domain->contactsList->hasAtLeastOneSticking() && numDPN == 4)
-        numLMPN = 4;
-    else if (domain->contactsList->hasAtLeastOneSticking())
-        numLMPN = 3;
-    else if (numDPN == 4)
-        numLMPN = 2;
-    else
-        numLMPN = 1;
-
-    const int numMyLagrangeNum = algebraic->map->mapLagrangeDofs->getNodeNumElements();
-
-    const int numMyMechLagrangeNum = numMyLagrangeNum / numLMPN;
-
-    old_activity = Kokkos::View<scalar *, Kokkos::LayoutRight>("R", numMyMechLagrangeNum);
-    old_old_activity = Kokkos::View<scalar *, Kokkos::LayoutRight>("R", numMyMechLagrangeNum);
-
-    for (auto local_index = 0; local_index < numMyMechLagrangeNum; ++local_index)
-    {
-        global_ordinal_type lagrange_id = algebraic->map->mapLagrangeDofs->getGlobalElement(local_index);
-        global_ordinal_type node_id = algebraic->map->lm_to_dof[lagrange_id];
-        lagrange_id = lagrange_id * numLMPN;
-        local_ordinal_type interface_id = domain->contactsList->getInterfaceOfSlaveNode(node_id);
-        if (domain->contactsList->isInitiallyOpen(interface_id))
-        {
-            if (domain->contactsList->isNodeInitiallyClosed(interface_id, node_id))
-            {
-                old_activity(local_index) = (scalar)1.;
-                continue;
-            }
-            old_activity(local_index) = (scalar)0.;
-
-            Teuchos::ArrayView<const local_ordinal_type> local_indices;
-            Teuchos::ArrayView<const scalar> values;
-
-            for (size_t j = 0; j < numLMPN; ++j)
-            {
-                algebraic->matrices->B_2->getLocalRowView(local_index * numLMPN + j, local_indices, values);
-
-                for (auto k = 0; k < local_indices.size(); ++k)
-                {
-                    global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                    algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + j,
-                                                                  Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                  Teuchos::tuple<scalar>((scalar)0.));
-                }
-
-                algebraic->matrices->C->replaceGlobalValues(lagrange_id + j,
-                                                            Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                            Teuchos::tuple<scalar>((scalar)1.));
-
-                algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + j,
-                                                             Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                             Teuchos::tuple<scalar>((scalar)0.));
-            }
-        }
-        else
-        {
-            old_activity(local_index) = (scalar)1.;
-            if (domain->contactsList->isSticking(interface_id) == false && domain->contactsList->hasAtLeastOneSticking() == true)
-            {
-                Teuchos::ArrayView<const local_ordinal_type> local_indices;
-                Teuchos::ArrayView<const scalar> values;
-
-                for (size_t j = 1; j < numLMPN; ++j)
-                {
-                    algebraic->matrices->B_2->getLocalRowView(local_index * numLMPN + j, local_indices, values);
-
-                    for (auto k = 0; k < local_indices.size(); ++k)
-                    {
-                        global_ordinal_type column_index = algebraic->matrices->B->getColMap()->getGlobalElement(local_indices[k]);
-
-                        algebraic->matrices->B_2->replaceGlobalValues(lagrange_id + j,
-                                                                      Teuchos::tuple<global_ordinal_type>(column_index),
-                                                                      Teuchos::tuple<scalar>((scalar)0.));
-                    }
-
-                    algebraic->matrices->C->replaceGlobalValues(lagrange_id + j,
-                                                                Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                Teuchos::tuple<scalar>((scalar)1.));
-
-                    algebraic->matrices->Cb->replaceGlobalValues(lagrange_id + j,
-                                                                 Teuchos::tuple<global_ordinal_type>(lagrange_id + j),
-                                                                 Teuchos::tuple<scalar>((scalar)0.));
-                }
-            }
-        }
-    }
-    algebraic->matrices->B_2->fillComplete(algebraic->map->mapDofs, algebraic->map->mapLagrangeDofs);
-    algebraic->matrices->C->fillComplete();
-    algebraic->matrices->Cb->fillComplete();
-
-    algebraic->matrices->xB = rcp(new xpetra_tcrs_type(algebraic->matrices->B_2));
-    algebraic->matrices->xB_T = rcp(new xpetra_tcrs_type(algebraic->matrices->B_T));
-    algebraic->matrices->xC = rcp(new xpetra_tcrs_type(algebraic->matrices->C));
-
-    algebraic->matrices->xwB = rcp(new xpetra_wcrs_type(algebraic->matrices->xB));
-    algebraic->matrices->xwB_T = rcp(new xpetra_wcrs_type(algebraic->matrices->xB_T));
-    algebraic->matrices->xwC = rcp(new xpetra_wcrs_type(algebraic->matrices->xC));
-
-    RCP<Xpetra::Matrix<scalar, local_ordinal_type, global_ordinal_type, node_type>> CTC = Teuchos::null;
-    RCP<Xpetra::Matrix<scalar, local_ordinal_type, global_ordinal_type, node_type>> ApCTC = Teuchos::null;
-    std::string MatrixMatrix_output_file = "MatrixMatrix_out.txt";
-    std::ofstream MatrixMatrix_ofstream(MatrixMatrix_output_file);
-    RCP<Teuchos::FancyOStream> verbOut = Teuchos::getFancyOStream(Teuchos::rcpFromRef(MatrixMatrix_ofstream));
-    CTC =
-        Xpetra::MatrixMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type>::Multiply(*(algebraic->matrices->xwB_T),
-                                                                                                   false,
-                                                                                                   *(algebraic->matrices->xwB),
-                                                                                                   false,
-                                                                                                   *verbOut);
-    RCP<xpetra_bcrs_type> bA = Teuchos::rcp_dynamic_cast<xpetra_bcrs_type>(algebraic->matrices->A);
-
-    if (gamma > 0.)
-    {
-        if (bA != Teuchos::null && merge)
-            Xpetra::MatrixMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type>::TwoMatrixAdd(*CTC,
-                                                                                                           false,
-                                                                                                           gamma,
-                                                                                                           *(bA->Merge()),
-                                                                                                           false,
-                                                                                                           (scalar)1.,
-                                                                                                           ApCTC,
-                                                                                                           *verbOut);
-        else
-            Xpetra::MatrixMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type>::TwoMatrixAdd(*CTC,
-                                                                                                           false,
-                                                                                                           gamma,
-                                                                                                           *(algebraic->matrices->A),
-                                                                                                           false,
-                                                                                                           (scalar)1.,
-                                                                                                           ApCTC,
-                                                                                                           *verbOut);
-    }
-    else
-    {
-        if (bA != Teuchos::null && merge)
-            ApCTC = bA->Merge();
-        else
-            ApCTC = algebraic->matrices->A;
-    }
-
-    algebraic->matrices->blockedMatrix->setMatrix(0, 0, ApCTC);
-    algebraic->matrices->blockedMatrix->setMatrix(0, 1, algebraic->matrices->xwB_T);
-    algebraic->matrices->blockedMatrix->setMatrix(1, 0, algebraic->matrices->xwB);
-    algebraic->matrices->blockedMatrix->setMatrix(1, 1, algebraic->matrices->xwC);
-
-    algebraic->matrices->blockedMatrix->fillComplete();
-    RCP<const xpetra_wcrs_type> tmpOp = Teuchos::rcp_dynamic_cast<const xpetra_wcrs_type>(ApCTC);
-    const RCP<const xpetra_tcrs_type> &tmp_ECrsMtx = Teuchos::rcp_dynamic_cast<const xpetra_tcrs_type>(tmpOp->getCrsMatrix());
-    RCP<const tpetra_crs_type> tpetra_ApCTC = tmp_ECrsMtx->getTpetra_CrsMatrix();
-
-    if (write)
-        Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeSparseFile(std::string("ApCTC_mm.txt"), tpetra_ApCTC);
-}
-
-/**
- * @brief Create the block vectors.
- * 
- * Argument:
- * <ul>
- *  <li> write: a boolean which is used to write vectors on disk or not.
- * </ul>
- */
-template <typename scalar>
-void DiscreteProblem<scalar>::createBlockMVector(bool write)
-{
-    using Teuchos::Array;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    RCP<tpetra_vector_type> intialContactPosition(new tpetra_vector_type(algebraic->map->mapDofs, true));
-    algebraic->vectors->initialGap = rcp(new tpetra_vector_type(algebraic->map->mapLagrangeDofs, true));
-    RCP<tpetra_vector_type> initialActiveGap(new tpetra_vector_type(algebraic->map->mapLagrangeDofs, true));
-
-    algebraic->vectors->lagrange = rcp(new tpetra_vector_type(algebraic->map->mapLagrangeDofs, true));
-
-    {
-        size_t numMyContacts = domain->contactsList->getContactNumber();
-        size_t numPrimalDPN = algebraic->map->numPrimalDPN;
-        size_t numMPrimalDPN = 3;
-        size_t offSet = 0;
-        if (numPrimalDPN == 4)
-            offSet = algebraic->map->mapNodes->getGlobalNumElements();
-
-        for (auto i = 0; i < numMyContacts; ++i)
-        {
-            size_t numMySlaveNodes = domain->contactsList->getSlaveNodesSize(i);
-            for (auto j = 0; j < numMySlaveNodes; ++j)
-            {
-                // get unique node id
-                auto global_nodeid = domain->contactsList->getSlaveNode(i, j);
-                if (algebraic->map->mapNodes->isNodeGlobalElement(global_nodeid))
-                {
-                    auto local_nodeid = algebraic->map->mapNodesWO->getLocalElement(global_nodeid);
-                    for (auto k = 0; k < 3; ++k)
-                    {
-                        scalar tmp = domain->nodesList->nodes(local_nodeid, k) +
-                                     domain->contactsList->getSlaveNormal(i, k) *
-                                         loads->preloadList->getPreloadValue(i);
-                        intialContactPosition->replaceGlobalValue(offSet + global_nodeid * numMPrimalDPN + k, tmp);
-                    }
-                }
-            }
-
-            size_t numMyMasterNodes = domain->contactsList->getMasterNodesSize(i);
-            for (auto j = 0; j < numMyMasterNodes; ++j)
-            {
-                // get unique node id
-                auto global_nodeid = domain->contactsList->getMasterNode(i, j);
-                if (algebraic->map->mapNodes->isNodeGlobalElement(global_nodeid))
-                {
-                    auto local_nodeid = algebraic->map->mapNodesWO->getLocalElement(global_nodeid);
-                    for (auto k = 0; k < 3; ++k)
-                        intialContactPosition->replaceGlobalValue(offSet + global_nodeid * numMPrimalDPN + k,
-                                                                  ((scalar)domain->nodesList->nodes(local_nodeid, k)));
-                }
-            }
-        }
-    }
-
-    algebraic->matrices->B_G->apply(*intialContactPosition, *algebraic->vectors->initialGap, Teuchos::NO_TRANS, ((scalar)-1.));
-
-    algebraic->matrices->Cb->apply(*algebraic->vectors->initialGap, *initialActiveGap);
-
-    // TODO: fix me when there is mesh tying and contact together!
-    if (domain->contactsList->isTying(0))
-        initialActiveGap->scale((scalar)0.);
-
-    if (write)
-        Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("initialActiveGap_mm.txt"), initialActiveGap);
-
-    RCP<xpetra_mvector_type> xb =
-        rcp(new xpetra_tmvector_type(algebraic->vectors->b));
-
-    RCP<xpetra_mvector_type> xg =
-        rcp(new xpetra_tmvector_type(initialActiveGap));
-
-    RCP<xpetra_mvector_type> xx =
-        rcp(new xpetra_tmvector_type(algebraic->vectors->x));
-
-    RCP<xpetra_mvector_type> xlagrange =
-        rcp(new xpetra_tmvector_type(algebraic->vectors->lagrange));
-
-    algebraic->vectors->rhsBlockedMultiVector =
-        rcp(new xpetra_bmvector_type(algebraic->map->blockedMap, 1, true));
-
-    algebraic->vectors->solutionBlockedMultiVector =
-        rcp(new xpetra_bmvector_type(algebraic->map->blockedMap, 1, true));
-
-    algebraic->vectors->rhsBlockedMultiVector->setMultiVector(0, xb, true);
-    algebraic->vectors->rhsBlockedMultiVector->setMultiVector(1, xg, true);
-
-    algebraic->vectors->solutionBlockedMultiVector->setMultiVector(0, xx, true);
-    algebraic->vectors->solutionBlockedMultiVector->setMultiVector(1, xlagrange, true);
-
-    algebraic->vectors->rhsMultiVector = algebraic->vectors->rhsBlockedMultiVector->Merge();
-    algebraic->vectors->solutionMultiVector = algebraic->vectors->solutionBlockedMultiVector->Merge();
-}
-
-/**
- * @brief Compute the contacts matrices.
- * 
- * Argument:
- * <ul>
- *  <li> comm: the used MPI communicator.
- * </ul>
- */
-template <typename scalar>
-void DiscreteProblem<scalar>::computeContactMatrices(MPI_Comm comm)
-{
-    compute_B<scalar>(algebraic->matrices,
-                      domain->elementsList,
-                      domain->nodesList,
-                      domain->contactsList,
-                      algebraic->map, comm);
-}
-
-/**
- * @brief Compute the primal matrix.
- */
-template <typename scalar>
-void DiscreteProblem<scalar>::computeMatrices(void)
-{
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    typedef KokkosSparse::CrsMatrix<scalar, local_ordinal_type, typename tpetra_crs_type::execution_space> local_matrix_type;
-
-    typedef Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> elem_matrix_view_type;
-
-    local_matrix_type local_L, local_K, local_S;
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-    {
-        algebraic->matrices->L->resumeFill();
-        algebraic->matrices->L->setAllToScalar((scalar)0.0);
-
-        local_L = algebraic->matrices->L->getLocalMatrix();
-    }
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-    {
-        algebraic->matrices->K->resumeFill();
-        algebraic->matrices->K->setAllToScalar((scalar)0.0);
-
-        local_K = algebraic->matrices->K->getLocalMatrix();
-    }
-    if (numPrimalDPN == 4)
-    {
-        algebraic->matrices->S->resumeFill();
-        algebraic->matrices->S->setAllToScalar((scalar)0.0);
-
-        local_S = algebraic->matrices->S->getLocalMatrix();
-    }
-
-    auto numMyElems = domain->elementsList->getElementNumber();
-
-    elem_matrix_view_type K, L, S;
-
-#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
-    int pool_size = Kokkos::DefaultExecutionSpace::thread_pool_size();
-#else
-    int pool_size = Kokkos::DefaultExecutionSpace::impl_thread_pool_size();
-#endif
-    int max_element_size = 1;
-
-    for (int i_elem = 0; i_elem < numMyElems; ++i_elem)
-    {
-        if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8))
-        {
-            max_element_size = 8;
-            break;
-        }
-        if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4))
-        {
-            max_element_size = 4;
-            break;
-        }
-    }
-
-    K = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A",
-                                                                                     pool_size,
-                                                                                     3 * max_element_size,
-                                                                                     3 * max_element_size);
-    L = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A",
-                                                                                     pool_size,
-                                                                                     max_element_size,
-                                                                                     max_element_size);
-    S = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A",
-                                                                                     pool_size,
-                                                                                     3 * max_element_size,
-                                                                                     max_element_size);
-
-    ElementMatrices<scalar, static_cast<int>(tbox::ElType::HEX8), 8> *elementMatrices_HEX8 =
-        new ElementMatrices<scalar, static_cast<int>(tbox::ElType::HEX8), 8>(domain, numPrimalDPN, pool_size);
-    ElementMatrices<scalar, static_cast<int>(tbox::ElType::TETRA4), 4> *elementMatrices_TETRA4 =
-        new ElementMatrices<scalar, static_cast<int>(tbox::ElType::TETRA4), 4>(domain, numPrimalDPN, pool_size);
-
-    Kokkos::parallel_for(
-        numMyElems, KOKKOS_LAMBDA(const int i_elem) {
-            bool bContinue = true;
-
-#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
-            int i_thread = Kokkos::DefaultExecutionSpace::thread_pool_rank();
-#else
-            int i_thread = Kokkos::DefaultExecutionSpace::impl_thread_pool_rank();
-#endif
-            const int e_size = domain->elementsList->getElementSize(i_elem);
-
-            auto K_e = subview(K, i_thread, make_pair(0, 3 * e_size), make_pair(0, 3 * e_size));
-            auto L_e = subview(L, i_thread, make_pair(0, e_size), make_pair(0, e_size));
-            auto S_e = subview(S, i_thread, make_pair(0, 3 * e_size), make_pair(0, e_size));
-
-            if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8))
-            {
-                elementMatrices_HEX8->compute(i_elem, i_thread);
-                Kokkos::deep_copy(K_e, elementMatrices_HEX8->getK(i_thread));
-                Kokkos::deep_copy(L_e, elementMatrices_HEX8->getL(i_thread));
-                Kokkos::deep_copy(S_e, elementMatrices_HEX8->getS(i_thread));
-            }
-
-            else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4))
-            {
-                elementMatrices_TETRA4->compute(i_elem, i_thread);
-                Kokkos::deep_copy(K_e, elementMatrices_TETRA4->getK(i_thread));
-                Kokkos::deep_copy(L_e, elementMatrices_TETRA4->getL(i_thread));
-                Kokkos::deep_copy(S_e, elementMatrices_TETRA4->getS(i_thread));
-            }
-            else
-                bContinue = false;
-
-            if (bContinue)
-                for (auto i = 0; i < e_size; ++i)
-                {
-                    local_ordinal_type node_i = domain->elementsList->getElementNode(i_elem, i);
-                    global_ordinal_type global_node_id_i = algebraic->map->mapNodesWO->getGlobalElement(node_i);
-                    // Test if mapNodes ownes global_node_id_i
-                    if (algebraic->map->mapNodes->isNodeGlobalElement(global_node_id_i))
-                    {
-                        local_ordinal_type local_node_id_i = algebraic->map->mapNodes->getLocalElement(global_node_id_i);
-                        for (auto j = 0; j < e_size; ++j)
-                        {
-                            local_ordinal_type node_j = domain->elementsList->getElementNode(i_elem, j);
-
-                            if (numPrimalDPN == 4 || numPrimalDPN == 1)
-                            {
-                                local_ordinal_type cols = node_j;
-                                scalar vals = L_e(i, j);
-
-                                local_L.sumIntoValues(local_node_id_i, &cols, 1, &vals, false, true);
-                            }
-                            if (numPrimalDPN == 4 || numPrimalDPN == 3)
-                            {
-                                for (auto k = 0; k < 3; ++k)
-                                    for (auto l = 0; l < 3; ++l)
-                                    {
-                                        local_ordinal_type cols = 3 * node_j + l;
-                                        scalar vals = K_e(3 * i + k, 3 * j + l);
-                                        local_K.sumIntoValues(3 * local_node_id_i + k, &cols, 1, &vals, false, true);
-                                    }
-                            }
-                            if (numPrimalDPN == 4)
-                            {
-                                for (auto k = 0; k < 3; ++k)
-                                {
-                                    local_ordinal_type cols = node_j;
-                                    scalar vals = S_e(3 * i + k, j);
-                                    local_S.sumIntoValues(3 * local_node_id_i + k, &cols, 1, &vals, false, true);
-                                }
-                            }
-                        }
-                    }
-                }
-        });
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-    {
-        algebraic->matrices->L->fillComplete();
-    }
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-    {
-        algebraic->matrices->K->fillComplete();
-    }
-    if (numPrimalDPN == 4)
-    {
-        algebraic->matrices->S->fillComplete();
-    }
-
-    delete elementMatrices_HEX8;
-    delete elementMatrices_TETRA4;
-
-    if (numPrimalDPN == 4)
-    {
-        RCP<xpetra_bcrs_type> bA = rcp(new xpetra_bcrs_type(algebraic->map->thermomecBlockedMap, algebraic->map->thermomecBlockedMap, 8));
-
-        RCP<xpetra_crs_type> xL = rcp(new xpetra_tcrs_type(algebraic->matrices->L));
-        RCP<xpetra_crs_type> xK = rcp(new xpetra_tcrs_type(algebraic->matrices->K));
-        RCP<xpetra_crs_type> xS = rcp(new xpetra_tcrs_type(algebraic->matrices->S));
-
-        RCP<xpetra_wcrs_type> xwL = rcp(new xpetra_wcrs_type(xL));
-        RCP<xpetra_wcrs_type> xwK = rcp(new xpetra_wcrs_type(xK));
-        RCP<xpetra_wcrs_type> xwS = rcp(new xpetra_wcrs_type(xS));
-
-        bA->setMatrix(0, 0, xwL);
-        bA->setMatrix(1, 0, xwS);
-        bA->setMatrix(1, 1, xwK);
-
-        bA->fillComplete();
-
-        algebraic->matrices->A = bA;
-    }
-    else if (numPrimalDPN == 3)
-    {
-        RCP<xpetra_crs_type> xK = rcp(new xpetra_tcrs_type(algebraic->matrices->K));
-        algebraic->matrices->A = rcp(new xpetra_wcrs_type(xK));
-    }
-    else
-    {
-        RCP<xpetra_crs_type> xL = rcp(new xpetra_tcrs_type(algebraic->matrices->L));
-        algebraic->matrices->A = rcp(new xpetra_wcrs_type(xL));
-    }
-}
-
-/**
- * @brief Compute the rhs.
- * 
- * Argument:
- * <ul>
- *  <li> scaled: a boolean which describes whether the system is scaled or not.
- * </ul>
- */
-template <typename scalar>
-void DiscreteProblem<scalar>::computeLoads(bool scaled)
-{
-
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-    using Teuchos::tuple;
-
-    typedef Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> elem_matrix_view_type;
-
-    elem_matrix_view_type N, N_S;
-
-    auto numMyElems = domain->elementsList->getElementNumber();
-
-#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
-    int pool_size = Kokkos::DefaultExecutionSpace::thread_pool_size();
-#else
-    int pool_size = Kokkos::DefaultExecutionSpace::impl_thread_pool_size();
-#endif
-    int max_element_size = 1;
-    int max_element_size_S = 1;
-
-    for (int i_elem = 0; i_elem < numMyElems; ++i_elem)
-    {
-        if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8))
-        {
-            max_element_size = 8;
-            max_element_size_S = 4;
-            break;
-        }
-        if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4))
-        {
-            max_element_size = 4;
-            max_element_size_S = 3;
-            break;
-        }
-    }
-    N = elem_matrix_view_type("A", pool_size, max_element_size, max_element_size);
-    N_S = elem_matrix_view_type("A", pool_size, max_element_size_S, max_element_size_S);
-
-    ElementVectors<scalar, static_cast<int>(tbox::ElType::TRI3), 3> *elementVectors_TRI3 =
-        new ElementVectors<scalar, static_cast<int>(tbox::ElType::TRI3), 3>(domain, numPrimalDPN, pool_size);
-    ElementVectors<scalar, static_cast<int>(tbox::ElType::QUAD4), 4> *elementVectors_QUAD4 =
-        new ElementVectors<scalar, static_cast<int>(tbox::ElType::QUAD4), 4>(domain, numPrimalDPN, pool_size);
-    ElementVectors<scalar, static_cast<int>(tbox::ElType::TETRA4), 4> *elementVectors_TETRA4 =
-        new ElementVectors<scalar, static_cast<int>(tbox::ElType::TETRA4), 4>(domain, numPrimalDPN, pool_size);
-    ElementVectors<scalar, static_cast<int>(tbox::ElType::HEX8), 8> *elementVectors_HEX8 =
-        new ElementVectors<scalar, static_cast<int>(tbox::ElType::HEX8), 8>(domain, numPrimalDPN, pool_size);
-
-    RCP<tpetra_vector_type> bWO = rcp(new tpetra_vector_type(algebraic->map->mapDofsWO, true));
-
-    auto bWO_view = bWO->getLocalViewHost();
-
-    // ------------------------------------------
-    //
-    //          volumetric heat sources
-    //
-    // ------------------------------------------
-
-    auto numMySources = loads->sourcesList->getSourceNumber();
-
-    for (auto i = 0; i < numMySources; ++i)
-    {
-        auto currentSourceSize = loads->sourcesList->getSourceSize(i);
-        Kokkos::parallel_for(
-            currentSourceSize, KOKKOS_LAMBDA(const int e1) {
-                local_ordinal_type i_elem = loads->sourcesList->getSourceElement(i, e1);
-#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
-                int i_thread = Kokkos::DefaultExecutionSpace::thread_pool_rank();
-#else
-                int i_thread = Kokkos::DefaultExecutionSpace::impl_thread_pool_rank();
-#endif
-                const int e_size = domain->elementsList->getElementSize(i_elem);
-
-                auto N_e = subview(N, i_thread, make_pair(0, e_size), make_pair(0, e_size));
-
-                bool bContinue = true;
-
-                if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8))
-                {
-                    elementVectors_HEX8->compute(i_elem, i_thread);
-                    Kokkos::deep_copy(N_e, elementVectors_HEX8->getN(i_thread));
-                }
-                else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4))
-                {
-                    elementVectors_TETRA4->compute(i_elem, i_thread);
-                    Kokkos::deep_copy(N_e, elementVectors_TETRA4->getN(i_thread));
-                }
-                else
-                    bContinue = false;
-
-                if (bContinue)
-                {
-                    for (auto ii = 0; ii < e_size; ++ii)
-                    {
-                        local_ordinal_type local_i = domain->elementsList->getElementNode(i_elem, ii);
-                        global_ordinal_type global_i = algebraic->map->mapNodesWO->getGlobalElement(local_i);
-
-                        // Test if mapDofs ownes global_i
-                        if (algebraic->map->mapNodes->isNodeGlobalElement(global_i))
-                        {
-                            scalar tmp = 0.;
-
-                            for (auto jj = 0; jj < e_size; ++jj)
-                                tmp += N_e(ii, jj);
-
-                            tmp *= loads->sourcesList->getSourceValue(i);
-
-                            Kokkos::atomic_fetch_add(&bWO_view(local_i, 0), tmp);
-                        }
-                    }
-                }
-            });
-    }
-
-    // ------------------------------------------
-    //
-    //       von Neumann boundary conditions
-    //
-    // ------------------------------------------
-
-    auto numMynBCs = loads->neumannList->getNeumannNumber();
-
-    const size_t numNodes = algebraic->map->mapNodes->getGlobalNumElements();
-    //const size_t numMyNodes = algebraic->map->mapNodes->getNodeNumElements();
-    const size_t numMyNodesWO = algebraic->map->mapNodesWO->getNodeNumElements();
-
-    for (auto i = 0; i < numMynBCs; ++i)
-    {
-        auto currentBCSize = loads->neumannList->getNeumannSize(i);
-        Kokkos::parallel_for(
-            currentBCSize, KOKKOS_LAMBDA(const int e1) {
-                local_ordinal_type i_elem = loads->neumannList->getNeumannElement(i, e1);
-
-#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
-                int i_thread = Kokkos::DefaultExecutionSpace::thread_pool_rank();
-#else
-                int i_thread = Kokkos::DefaultExecutionSpace::impl_thread_pool_rank();
-#endif
-                const int e_size = domain->elementsList->getElementSize(i_elem);
-
-                auto N_e = subview(N_S, i_thread, make_pair(0, e_size), make_pair(0, e_size));
-
-                bool bContinue = true;
-
-                if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TRI3))
-                {
-                    elementVectors_TRI3->compute(i_elem, i_thread);
-                    Kokkos::deep_copy(N_e, elementVectors_TRI3->getN(i_thread));
-                }
-                else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::QUAD4))
-                {
-                    elementVectors_QUAD4->compute(i_elem, i_thread);
-                    Kokkos::deep_copy(N_e, elementVectors_QUAD4->getN(i_thread));
-                }
-                else
-                    bContinue = false;
-
-                if (bContinue)
-                {
-                    for (auto j = 0; j < numPrimalDPN; ++j)
-                    {
-                        scalar which_dof = loads->neumannList->getNeumannDof(i, j);
-                        scalar value = loads->neumannList->getNeumannValue(i, j);
-                        if (which_dof == (scalar)1)
-                        {
-                            for (auto ii = 0; ii < e_size; ++ii)
-                            {
-                                local_ordinal_type local_i;
-                                if (j == 3)
-                                    local_i = domain->elementsList->getElementNode(i_elem, ii);
-                                else
-                                {
-                                    if (numPrimalDPN == 4)
-                                        local_i = numMyNodesWO + 3 * domain->elementsList->getElementNode(i_elem, ii) + j;
-                                    else
-                                        local_i = 3 * domain->elementsList->getElementNode(i_elem, ii) + j;
-                                }
-
-                                scalar tmp = 0.;
-
-                                for (auto jj = 0; jj < e_size; ++jj)
-                                    tmp += N_e(ii, jj);
-
-                                tmp *= value;
-
-                                Kokkos::atomic_fetch_add(&bWO_view(local_i, 0), tmp);
-                            }
-                        }
-                    }
-                }
-            });
-    }
-
-    // ------------------------------------------
-    //
-    //        Dirichlet boundary conditions
-    //
-    // ------------------------------------------
-
-    Tpetra::Export<> exportBWO(algebraic->map->mapDofsWO, algebraic->map->mapDofs);
-    algebraic->vectors->b->doExport(*bWO, exportBWO, Tpetra::ADD);
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-        algebraic->matrices->K->resumeFill();
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-        algebraic->matrices->L->resumeFill();
-    if (numPrimalDPN == 4)
-        algebraic->matrices->S->resumeFill();
-
-    auto numMyBCs = loads->dirichletList->getDirichletNumber();
-    for (auto i = 0; i < numMyBCs; ++i)
-    {
-        auto currentBCSize = loads->dirichletList->getDirichletSize(i);
-        for (int i_node = 0; i_node < currentBCSize; ++i_node)
-        {
-            global_ordinal_type n1 = loads->dirichletList->getDirichletNode(i, i_node);
-
-            if (algebraic->map->mapNodes->isNodeGlobalElement(n1))
-                for (auto j = 0; j < numPrimalDPN; ++j)
-                {
-                    scalar which_dof = loads->dirichletList->getDirichletDof(i, j);
-
-                    if (which_dof == (scalar)1)
-                    {
-                        global_ordinal_type global_index, global_index_0, global_index_r0;
-
-                        bool thermo = false;
-
-                        if (j == 3)
-                        {
-                            global_index_0 = 0;
-                            global_index_r0 = n1;
-
-                            thermo = true;
-                        }
-                        else
-                        {
-                            if (numPrimalDPN == 4)
-                                global_index_0 = numNodes;
-                            else
-                                global_index_0 = 0;
-                            global_index_r0 = 3 * n1 + j;
-                        }
-
-                        global_index = global_index_0 + global_index_r0;
-
-                        Teuchos::Array<global_ordinal_type> global_indices;
-
-                        if (thermo)
-                        {
-                            size_t numColInds = algebraic->graph->L->getNumEntriesInGlobalRow(global_index);
-                            global_indices.resize(numColInds);
-                            algebraic->graph->L->getGlobalRowCopy(global_index, global_indices(), numColInds);
-
-                            // Replace the initialized elements by zero
-                            for (auto k = 0; k < numColInds; ++k)
-                                algebraic->matrices->L->replaceGlobalValues(global_index,
-                                                                            tuple<global_ordinal_type>(global_indices[k]),
-                                                                            tuple<scalar>(scalar(0.0)));
-
-                            // Put one on the diagonal element
-                            algebraic->matrices->L->replaceGlobalValues(global_index,
-                                                                        tuple<global_ordinal_type>(global_index),
-                                                                        tuple<scalar>(scalar(1.0)));
-                        }
-                        else
-                        {
-                            size_t numColInds = algebraic->graph->K->getNumEntriesInGlobalRow(global_index_r0);
-                            global_indices.resize(numColInds);
-                            algebraic->graph->K->getGlobalRowCopy(global_index_r0, global_indices(), numColInds);
-
-                            // Replace the initialized elements by zero
-                            for (auto k = 0; k < numColInds; ++k)
-                                algebraic->matrices->K->replaceGlobalValues(global_index_r0,
-                                                                            tuple<global_ordinal_type>(global_indices[k]),
-                                                                            tuple<scalar>(scalar(0.0)));
-
-                            // Put one on the diagonal element
-                            algebraic->matrices->K->replaceGlobalValues(global_index_r0,
-                                                                        tuple<global_ordinal_type>(global_index_r0),
-                                                                        tuple<scalar>(scalar(1.0)));
-
-                            if (numPrimalDPN == 4)
-                            {
-                                size_t numColInds = algebraic->graph->S->getNumEntriesInGlobalRow(global_index_r0);
-                                global_indices.resize(numColInds);
-                                algebraic->graph->S->getGlobalRowCopy(global_index_r0, global_indices(), numColInds);
-
-                                // Replace the initialized elements by zero
-                                for (auto k = 0; k < numColInds; ++k)
-                                    algebraic->matrices->S->replaceGlobalValues(global_index_r0,
-                                                                                tuple<global_ordinal_type>(global_indices[k]),
-                                                                                tuple<scalar>(scalar(0.0)));
-                            }
-                        }
-
-                        // Put the corresponding value in the right hand side
-                        algebraic->vectors->b->replaceGlobalValue(global_index,
-                                                                  (scalar(loads->dirichletList->getDirichletValue(i, j))));
-                        algebraic->vectors->x->replaceGlobalValue(global_index,
-                                                                  (scalar(loads->dirichletList->getDirichletValue(i, j))));
-                    }
-                }
-        }
-    }
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-        algebraic->matrices->K->fillComplete();
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-        algebraic->matrices->L->fillComplete();
-    if (numPrimalDPN == 4)
-        algebraic->matrices->S->fillComplete();
-
-    /*
-    if (scaled)
-    {
-        tpetra_vector_type diag(algebraic->matrices->A->getRowMap());
-        algebraic->matrices->A->getLocalDiagCopy(diag);
-
-        Teuchos::ArrayRCP<scalar> diag_entries;
-        diag_entries = diag.getDataNonConst();
-        for (size_t i = 0; i < diag_entries.size(); ++i)
-            diag_entries[i] = 1. / diag_entries[i];
-
-        Teuchos::ArrayRCP<scalar> rhs_entries;
-        rhs_entries = algebraic->vectors->b->getDataNonConst();
-        for (size_t i = 0; i < rhs_entries.size(); ++i)
-            rhs_entries[i] = rhs_entries[i] * diag_entries[i];
-
-        algebraic->matrices->A->leftScale(diag);
-
-        if (domain->contactsList->getContactNumber() >= 1)
-            algebraic->matrices->B_T->leftScale(diag);
-    }
-    */
-    // ------------------------------------------
-    //
-    //       weights computation
-    //
-    // ------------------------------------------
-
-    auto numMyWeightRegions = loads->weightsList->getWeightRegionsNumber();
-
-    for (auto i = 0; i < numMyWeightRegions; ++i)
-    {
-        auto currentWeightRegionSize = loads->weightsList->getWeightRegionSize(i);
-        Kokkos::parallel_for(
-            currentWeightRegionSize, KOKKOS_LAMBDA(const int i_node) {
-                global_ordinal_type n1 = loads->weightsList->getNode(i, i_node);
-
-                if (algebraic->map->mapNodes->isNodeGlobalElement(n1))
-                {
-                    for (auto j = 0; j < numPrimalDPN; ++j)
-                    {
-                        if (loads->weightsList->getWeightDof(i, j))
-                        {
-                            global_ordinal_type global_index;
-
-                            if (j == 3)
-                            {
-                                global_index = n1;
-                            }
-                            else
-                            {
-                                if (numPrimalDPN == 4)
-                                    global_index = numNodes + 3 * n1 + j;
-                                else
-                                    global_index = 3 * n1 + j;
-                            }
-
-                            algebraic->vectors->weights->sumIntoGlobalValue(global_index,
-                                                                            (scalar(loads->weightsList->getWeightValue(i, j))),
-                                                                            true);
-                        }
-                    }
-                }
-            });
-    }
-
-    delete elementVectors_TRI3;
-    delete elementVectors_QUAD4;
-    delete elementVectors_TETRA4;
-    delete elementVectors_HEX8;
-}
-}; // namespace katoptron
diff --git a/katoptron/src/DiscreteProblemETI.cpp b/katoptron/src/DiscreteProblemETI.cpp
deleted file mode 100644
index 9cb9118030d559e2d41a1b6b6fbd466c5f807010..0000000000000000000000000000000000000000
--- a/katoptron/src/DiscreteProblemETI.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "DiscreteProblem.h"
-#include "DiscreteProblem.hpp"
-
-using namespace katoptron;
-
-template class DiscreteProblem<double>;
-template class DiscreteProblem<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>>;
-template class DiscreteProblem<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>>;
-template class DiscreteProblem<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>>;
-template class DiscreteProblem<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>>;
\ No newline at end of file
diff --git a/katoptron/src/Domain.h b/katoptron/src/Domain.h
deleted file mode 100644
index 43fdf2f8875d0c73456dc8a2600b365b5f58feed..0000000000000000000000000000000000000000
--- a/katoptron/src/Domain.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef KATOPTRON_DOMAIN_H
-#define KATOPTRON_DOMAIN_H
-
-#include "katoptron.h"
-#include "Map.h"
-#include "ElementsList.h"
-#include "NodesList.h"
-#include "MaterialsList.h"
-#include "ContactsList.h"
-#include "wRandomField.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store all the information related to the discretized domain:
- * <ul>
- *  <li> the list of the local elements,
- *  <li> the list of the nodes,
- *  <li> the list of the materials,
- *  <li> the list of the contact interfaces,
- *  <li> the list of the random fields.
- * </ul>
- */
-template <typename scalar>
-class Domain
-{
-public:
-    Teuchos::RCP<ElementsList> elementsList;
-    Teuchos::RCP<NodesList> nodesList;
-    Teuchos::RCP<MaterialsList<scalar>> materialsList;
-    Teuchos::RCP<ContactsList> contactsList;
-    Teuchos::RCP<RandomField<scalar, Kokkos::DefaultExecutionSpace>> random_field;
-
-    Domain(Problem &pbl,
-           Teuchos::RCP<Map> map,
-           Teuchos::RCP<Teuchos::ParameterList> randomParams,
-           Kokkos::View<scalar *, Kokkos::LayoutLeft> m_rv_values);
-
-    ~Domain()
-    {
-        std::cout << "~Domain()\n";
-    }
-};
-
-/**
- * @brief Domain constructor
- * 
- * This constructor initializes the lists of elements, nodes, materials, contact interfaces, and random fields.
- * 
- * Arguments:
- * <ul>
- *  <li> A problem object,
- *  <li> An RCP to a Map object,
- *  <li> An RCP to a ParameterList object which describes the random fields,
- *  <li> A Kokkos View of the values used in the discretization of the random fields.
- * </ul>
- */
-template <typename scalar>
-Domain<scalar>::Domain(Problem &pbl,
-                       Teuchos::RCP<Map> map,
-                       Teuchos::RCP<Teuchos::ParameterList> randomParams,
-                       Kokkos::View<scalar *, Kokkos::LayoutLeft> m_rv_values)
-{
-    elementsList = Teuchos::rcp(new ElementsList(pbl, map));
-    nodesList = Teuchos::rcp(new NodesList(pbl, map));
-    materialsList = Teuchos::rcp(new MaterialsList<scalar>(pbl, map));
-    contactsList = Teuchos::rcp(new ContactsList(pbl, map, elementsList, nodesList));
-    random_field = Teuchos::rcp(new RandomField<scalar, Kokkos::DefaultExecutionSpace>(randomParams, m_rv_values));
-}
-
-}; // namespace katoptron
-
-#endif //KATOPTRON_DOMAIN_H
diff --git a/katoptron/src/ElementComputation.cpp b/katoptron/src/ElementComputation.cpp
deleted file mode 100644
index 5ffb9b91e70b4c1892b873aef903f231d37d322a..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementComputation.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "ElementComputation.h"
-#include "ElementComputation.hpp"
-using namespace tbox;
-
-template class ElementComputation<double, 2>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, 2>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, 2>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, 2>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, 2>;
-
-template class ElementComputation<double, 3>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, 3>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, 3>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, 3>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, 3>;
-
-template class ElementComputation<double, 4>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, 4>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, 4>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, 4>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, 4>;
-
-template class ElementComputation<double, 5>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, 5>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, 5>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, 5>;
-template class ElementComputation<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, 5>;
\ No newline at end of file
diff --git a/katoptron/src/ElementComputation.h b/katoptron/src/ElementComputation.h
deleted file mode 100644
index 1e069a2b688392c72478551442ad6cf15651db23..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementComputation.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef KATOPTRON_ELEMENTCOMPUTATION_H
-#define KATOPTRON_ELEMENTCOMPUTATION_H
-
-#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp"
-
-#include <Kokkos_Core.hpp>
-#include "Kokkos_ViewFactory.hpp"
-#include "wCacheHex8.h"
-#include "wCacheQuad4.h"
-#include "wCacheTetra4.h"
-#include "wCacheTri3.h"
-#include "tMatrix.h"
-#include "Sacado.hpp"
-#include "Domain.h"
-
-#include "MaterialsList.h"
-#include "Material.h"
-
-#include "Map.h"
-
-#include "wElement.h"
-
-#include "wLazy.h"
-#include "tMatrix.h"
-
-/**
- * @brief Base class for the element computations
- */
-template <typename scalar, int element_type>
-class ElementComputation
-{
-    typedef katoptron::Map::local_ordinal_type local_ordinal_type;
-
-protected:
-    tbox::CacheHex8 &trilinosHex8GetCache();
-    tbox::CacheTetra4 &trilinosTetra4GetCache();
-    tbox::CacheTri3 &trilinosTri3GetCache();
-    tbox::CacheQuad4 &trilinosQuad4GetCache();
-
-    double buildJ(int k, tMatrix<double, 3, 3> &J,
-                  local_ordinal_type e,
-                  const katoptron::ElementsList &elementsList,
-                  const katoptron::NodesList &nodesList);
-};
-
-#endif //KATOPTRON_ELEMENTCOMPUTATION_H
diff --git a/katoptron/src/ElementComputation.hpp b/katoptron/src/ElementComputation.hpp
deleted file mode 100644
index e1062eb1f8fc49349d327e661adf08e1d71e1aa6..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementComputation.hpp
+++ /dev/null
@@ -1,142 +0,0 @@
-
-/**
- * @brief Compute the Jacobian matrix \f$\boldsymbol{J}\f$ of an element.
- */
-template <typename scalar, int element_type>
-double ElementComputation<scalar, element_type>::buildJ(int k,
-                                                        tMatrix<double, 3, 3> &J, local_ordinal_type e,
-                                                        const katoptron::ElementsList &elementsList,
-                                                        const katoptron::NodesList &nodesList)
-{
-    tbox::Cache *cache;
-    size_t element_size;
-
-    if (element_type == static_cast<int>(tbox::ElType::HEX8))
-    {
-        tbox::CacheHex8 &cachehex8 = trilinosHex8GetCache();
-        cache = &cachehex8;
-        element_size = 8;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::TETRA4))
-    {
-        tbox::CacheTetra4 &cachetetra4 = trilinosTetra4GetCache();
-        cache = &cachetetra4;
-        element_size = 4;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::TRI3))
-    {
-        tbox::CacheTri3 &cachetri3 = trilinosTri3GetCache();
-        cache = &cachetri3;
-        element_size = 3;
-
-        tVector<double, 3> tg1, tg2, n;
-
-        int i = 0;
-        for (auto n1 = 0; n1 < element_size; ++n1, ++i)
-        {
-            for (auto j = 0; j < 3; ++j)
-            {
-                tg1(j) += (static_cast<tbox::CacheTri3 *>(cache)->getDsf(k))(0, i) *
-                          nodesList.nodes(elementsList.getElementNode(e, n1), j);
-                tg2(j) += (static_cast<tbox::CacheTri3 *>(cache)->getDsf(k))(1, i) *
-                          nodesList.nodes(elementsList.getElementNode(e, n1), j);
-            }
-        }
-
-        n(0) = tg1(1) * tg2(2) - tg1(2) * tg2(1);
-        n(1) = tg1(2) * tg2(0) - tg1(0) * tg2(2);
-        n(2) = tg1(0) * tg2(1) - tg1(1) * tg2(0);
-        double detJ = sqrt(pow(n(0), 2) + pow(n(1), 2) + pow(n(2), 2));
-        return detJ;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::QUAD4))
-    {
-        tbox::CacheQuad4 &cachequad4 = trilinosQuad4GetCache();
-        cache = &cachequad4;
-        element_size = 4;
-
-        tVector<double, 3> tg1, tg2, n;
-
-        int i = 0;
-        for (auto n1 = 0; n1 < element_size; ++n1, ++i)
-        {
-            for (auto j = 0; j < 3; ++j)
-            {
-                tg1(j) += (static_cast<tbox::CacheQuad4 *>(cache)->getDsf(k))(0, i) *
-                          nodesList.nodes(elementsList.getElementNode(e, n1), j);
-                tg2(j) += (static_cast<tbox::CacheQuad4 *>(cache)->getDsf(k))(1, i) *
-                          nodesList.nodes(elementsList.getElementNode(e, n1), j);
-            }
-        }
-
-        n(0) = tg1(1) * tg2(2) - tg1(2) * tg2(1);
-        n(1) = tg1(2) * tg2(0) - tg1(0) * tg2(2);
-        n(2) = tg1(0) * tg2(1) - tg1(1) * tg2(0);
-        double detJ = sqrt(pow(n(0), 2) + pow(n(1), 2) + pow(n(2), 2));
-        return detJ;
-    }
-
-    tMatrix<double, 3, 3> Jn;
-    J.clean();
-
-    tVector<double, 3> tmp, tmp2;
-
-    int i = 0;
-    for (auto n1 = 0; n1 < elementsList.getElementSize(e); ++n1, ++i)
-    {
-        for (auto j = 0; j < 3; ++j)
-        {
-            tmp(j) = nodesList.nodes(elementsList.getElementNode(e, n1), j);
-            if (element_type == static_cast<int>(tbox::ElType::HEX8))
-                tmp2(j) = (static_cast<tbox::CacheHex8 *>(cache)->getDsf(k))(j, i);
-            else if (element_type == static_cast<int>(tbox::ElType::TETRA4))
-                tmp2(j) = (static_cast<tbox::CacheTetra4 *>(cache)->getDsf(k))(j, i);
-        }
-
-        Jn = tmp2.ddotproduct(tmp);
-        J += Jn;
-    }
-
-    double detJ = J.det();
-    return detJ;
-}
-
-/**
- * @brief Return the tbox cache of the hexahedron elements.
- */
-template <typename scalar, int element_type>
-tbox::CacheHex8 &ElementComputation<scalar, element_type>::trilinosHex8GetCache()
-{
-    static tbox::Lazy<tbox::CacheHex8> cache(2);
-    return cache.get();
-}
-
-/**
- * @brief Return the tbox cache of the tetrahedron elements.
- */
-template <typename scalar, int element_type>
-tbox::CacheTetra4 &ElementComputation<scalar, element_type>::trilinosTetra4GetCache()
-{
-    static tbox::Lazy<tbox::CacheTetra4> cache(2);
-    return cache.get();
-}
-
-/**
- * @brief Return the tbox cache of the triangular elements.
- */
-template <typename scalar, int element_type>
-tbox::CacheTri3 &ElementComputation<scalar, element_type>::trilinosTri3GetCache()
-{
-    static tbox::Lazy<tbox::CacheTri3> cache(2);
-    return cache.get();
-}
-
-/**
- * @brief Return the tbox cache of the quadrangular elements.
- */
-template <typename scalar, int element_type>
-tbox::CacheQuad4 &ElementComputation<scalar, element_type>::trilinosQuad4GetCache()
-{
-    static tbox::Lazy<tbox::CacheQuad4> cache(2);
-    return cache.get();
-}
diff --git a/katoptron/src/ElementMatrices.h b/katoptron/src/ElementMatrices.h
deleted file mode 100644
index ad7b227ba8041505933d410f6e83d5e41f79f7af..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementMatrices.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef KATOPTRON_ELEMENTMATRICES_H
-#define KATOPTRON_ELEMENTMATRICES_H
-
-#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp"
-#include "EnsembleTraits.h"
-
-/*
-#include "Stokhos_Tpetra_MP_Vector.hpp"
-#include "Stokhos_Tpetra_Utilities_MP_Vector.hpp"
-#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp"
-*/
-
-#include <Kokkos_Core.hpp>
-#include "Kokkos_ViewFactory.hpp"
-#include "wCacheHex8.h"
-#include "wCacheQuad4.h"
-#include "wCacheTetra4.h"
-#include "wCacheTri3.h"
-#include "tMatrix.h"
-
-//#include "Sacado_Fad_MP_Vector.hpp"
-//#include "Sacado.hpp"
-#include "Domain.h"
-
-#include "MaterialsList.h"
-#include "Material.h"
-
-#include "wLazy.h"
-#include "tMatrix.h"
-
-#include "ElementComputation.h"
-
-#include "EnsembleTraits.h"
-
-#include <iostream>
-
-/**
- * @brief Class used to compute the element matrices:
- * <ul>
- *  <li> The element stifness matrix \f$\boldsymbol{K}\f$,
- *  <li> The thermal element matrix \f$\boldsymbol{L}\f$,
- *  <li> The coupling element matrix \f$\boldsymbol{S}\f$.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-class ElementMatrices : public ElementComputation<scalar, element_type>
-{
-public:
-    typedef Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> view_type_3D;
-    typedef Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> view_type_2D;
-
-    view_type_3D K, L, S;
-
-    view_type_2D material;
-
-    Teuchos::RCP<katoptron::Domain<scalar>> domain;
-
-    size_t numPrimalDPN;
-
-    ElementMatrices(Teuchos::RCP<katoptron::Domain<scalar>> domain, size_t numPrimalDPN, size_t pool_size);
-    ~ElementMatrices(){};
-
-    void compute(int e, int i_thread);
-    view_type_2D getK(size_t i_thread) const;
-    view_type_2D getL(size_t i_thread) const;
-    view_type_2D getS(size_t i_thread) const;
-};
-
-#endif //KATOPTRON_ELEMENTMATRICES_H
diff --git a/katoptron/src/ElementMatrices.hpp b/katoptron/src/ElementMatrices.hpp
deleted file mode 100644
index 208932ccdbd32fe0bd3ab5bd373f8acefab6317e..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementMatrices.hpp
+++ /dev/null
@@ -1,300 +0,0 @@
-//#define ElementMatrices_DEBUG
-
-/**
- * @brief ElementMatrices constructor
- * 
- * Arguments:
- * <ul>
- *  <li> domain: an RCP to a Domain object,
- *  <li> numPrimalDPN: the number of degrees of freedom per node (without taking into account the Lagrange multipliers),
- *  <li> pool_size: the number of threads that will be used to compute the element matrices.
- * </ul>
- * 
- * The number of used threads is specify to allocate distinct memory for each thread to ensure that the threads
- * do not use the same memory addresses.
- */
-template <typename scalar, int element_type, int element_size>
-ElementMatrices<scalar, element_type, element_size>::ElementMatrices(Teuchos::RCP<katoptron::Domain<scalar>> _domain,
-                                                                     size_t _numPrimalDPN,
-                                                                     size_t pool_size) : domain(_domain), numPrimalDPN(_numPrimalDPN)
-{
-
-    K = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A", pool_size, 3 * element_size, 3 * element_size);
-    L = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A", pool_size, element_size, element_size);
-    S = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A", pool_size, 3 * element_size, element_size);
-
-    material = Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A", pool_size, 3 * element_size);
-}
-
-/**
- * @brief Compute all the matrices and store them as member data.
- * This function must be called before getK, getL, or getS.
- * 
- * The computations have been gathered into one function to reuse reusable data such as Jacobian
- * computations.
- * 
- * Arguments:
- * <ul>
- *  <li> e: the local ID of the element for which the matrices have to be computed,
- *  <li> i_thread: the ID of the thread used to compute the element matrices.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-void ElementMatrices<scalar, element_type, element_size>::compute(int e, int i_thread)
-{
-
-    tbox::Cache *cache;
-
-    /* @todo could probably be refactored into cache = element->getVCache(); */
-    if (element_type == static_cast<int>(tbox::ElType::HEX8))
-    {
-        tbox::CacheHex8 &cachehex8 = this->trilinosHex8GetCache();
-        cache = &cachehex8;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::TETRA4))
-    {
-        tbox::CacheTetra4 &cachetetra4 = this->trilinosTetra4GetCache();
-        cache = &cachetetra4;
-    }
-
-    std::vector<Eigen::Vector3d> gauss_p;
-    std::vector<double> gauss_w;
-    for (size_t a = 0; a < cache->getVGauss().getN(); ++a)
-    {
-        gauss_p.push_back(cache->getVGauss().getP(a));
-        gauss_w.push_back(cache->getVGauss().getW(a));
-    }
-
-    tVector<scalar, element_size * 4> tValues;
-
-    auto K_current = subview(K, i_thread, Kokkos::ALL(), Kokkos::ALL());
-    auto L_current = subview(L, i_thread, Kokkos::ALL(), Kokkos::ALL());
-    auto S_current = subview(S, i_thread, Kokkos::ALL(), Kokkos::ALL());
-
-    Kokkos::deep_copy(K_current, 0);
-    Kokkos::deep_copy(L_current, 0);
-    Kokkos::deep_copy(S_current, 0);
-
-    auto element_material = domain->elementsList->getElementMaterial(e);
-
-    tVector<double, 3> factor1, factor2, dffi, dffj;
-    tVector<scalar, 3> factor3;
-    tMatrix<double, 3, 3> J, Jinv;
-    tMatrix<scalar, 3, 3> TMP1;
-    tMatrix<scalar, 9, 9> H;
-    tVector<double, element_size> ff;
-    scalar E, nu, lambda, G, conductivity, beta;
-    tMatrix<scalar, 3, 3> K_conductivity;
-    tMatrix<scalar, 3, 3> D;
-
-    katoptron::Material<scalar> material = domain->materialsList->getMaterial(element_material, i_thread);
-    if (domain->random_field->isRandom)
-    {
-        double x = 0., y = 0., z = 0.;
-        for (auto j = 0; j < element_size; ++j)
-        {
-            x += domain->nodesList->nodes(domain->elementsList->getElementNode(e, j), 0) / element_size;
-            y += domain->nodesList->nodes(domain->elementsList->getElementNode(e, j), 1) / element_size;
-            z += domain->nodesList->nodes(domain->elementsList->getElementNode(e, j), 2) / element_size;
-        }
-
-        G = domain->random_field->operator()(x, y, z);
-#ifdef ElementMatrices_DEBUG
-        printf("G_0 = %f\n", EnsembleTraits<scalar>::coeff(G, 0));
-#endif
-
-        //E = material.getE();
-        nu = material.getNu();
-        lambda = 2. * G * nu / (1. - 2. * nu);
-        //lambda = (nu*E)/((1+nu)*(1-2*nu));
-    }
-    else
-    {
-        E = material.getE();
-        nu = material.getNu();
-        lambda = (nu * E) / ((1 + nu) * (1 - 2 * nu));
-        G = E / (2 * (1 + nu));
-    }
-
-    // Machine epsilon
-
-    double epsilon = 2e-16;
-    // Looping on gauss points
-    for (auto a = 0; a < gauss_p.size(); ++a)
-    {
-        for (auto j = 0; j < element_size; ++j)
-            if (element_size == 8)
-                ff(j) = (static_cast<tbox::CacheHex8 *>(cache)->getSf(a))(j);
-            else if (element_size == 4)
-                ff(j) = (static_cast<tbox::CacheTetra4 *>(cache)->getSf(a))(j);
-
-        // H matrix
-        H.clean();
-
-        for (auto i = 0; i < 3; ++i)
-            for (auto j = 0; j < 3; ++j)
-                for (auto k = 0; k < 3; ++k)
-                    for (auto l = 0; l < 3; ++l)
-                    {
-                        if (i == j && k == l)
-                            H(i * 3 + j, k * 3 + l) = lambda;
-                        if (i == k && j == l)
-                            H(i * 3 + j, k * 3 + l) = H(i * 3 + j, k * 3 + l) + G;
-                        if (i == l && j == k)
-                            H(i * 3 + j, k * 3 + l) = H(i * 3 + j, k * 3 + l) + G;
-                    }
-
-        conductivity = material.getK();
-        K_conductivity.clean();
-        for (auto i = 0; i < 3; ++i)
-            K_conductivity(i, i) = conductivity;
-
-        beta = material.getBeta();
-        D.clean();
-        for (auto i = 0; i < 3; ++i)
-            D(i, i) = -3 * (lambda + (2. / 3.) * G) * beta;
-
-        double detJ = this->buildJ(a, J, e, *(domain->elementsList), *(domain->nodesList));
-
-#ifdef ElementMatrices_DEBUG
-        printf("detJ = %f\n", detJ);
-#endif
-
-        Jinv = J.inv();
-
-        for (auto i = 0; i < element_size; ++i)
-        {
-
-            for (auto k = 0; k < 3; ++k)
-                if (element_size == 8)
-                    dffi(k) = (static_cast<tbox::CacheHex8 *>(cache)->getDsf(a))(k, i);
-                else if (element_size == 4)
-                    dffi(k) = (static_cast<tbox::CacheTetra4 *>(cache)->getDsf(a))(k, i);
-            factor1 = Jinv * dffi;
-#ifdef ElementMatrices_DEBUG
-            printf("dffi = [%f, %f, %f]\n", dffi(0), dffi(1), dffi(2));
-            printf("factor1 = [%f, %f, %f]\n", factor1(0), factor1(1), factor1(2));
-#endif
-            // K
-            for (auto j = i; j < element_size; ++j)
-            {
-                for (auto k = 0; k < 3; ++k)
-                    if (element_size == 8)
-                        dffj(k) = (static_cast<tbox::CacheHex8 *>(cache)->getDsf(a))(k, j);
-                    else if (element_size == 4)
-                        dffj(k) = (static_cast<tbox::CacheTetra4 *>(cache)->getDsf(a))(k, j);
-                factor2 = Jinv * dffj;
-
-                TMP1.clean();
-                for (auto k = 0; k < 3; ++k)
-                    for (auto m = 0; m < 3; ++m)
-                    {
-                        for (auto l = 0; l < 3; ++l)
-                            for (auto n = 0; n < 3; ++n)
-                                TMP1(l, n) = H(k * 3 + l, m * 3 + n);
-
-                        factor3 = TMP1 * factor2;
-
-                        scalar dotProduct = factor1.dotproduct(factor3);
-#ifdef ElementMatrices_DEBUG
-                        printf("dotProduct_0 = %f\n", EnsembleTraits<scalar>::coeff(dotProduct, 0));
-#endif
-                        K_current(i * 3 + k, j * 3 + m) += dotProduct * gauss_w[a] * detJ;
-                    }
-            }
-
-            // L
-            factor3 = K_conductivity * factor1;
-            for (auto j = i; j < element_size; ++j)
-            {
-                for (auto k = 0; k < 3; ++k)
-                    if (element_size == 8)
-                        dffj(k) = (static_cast<tbox::CacheHex8 *>(cache)->getDsf(a))(k, j);
-                    else if (element_size == 4)
-                        dffj(k) = (static_cast<tbox::CacheTetra4 *>(cache)->getDsf(a))(k, j);
-
-                factor2 = Jinv * dffj;
-                scalar dotProduct = factor3.dotproduct(factor2);
-                L_current(i, j) += dotProduct * gauss_w[a] * detJ;
-            }
-
-            // S
-            factor3 = D * factor1;
-
-            for (auto j = 0; j < element_size; ++j)
-                for (auto k = 0; k < 3; ++k)
-                    S_current(i * 3 + k, j) += factor3(k) * ff(j) * gauss_w[a] * detJ;
-        }
-    }
-
-    for (auto i = 0; i < 3 * element_size; ++i)
-        for (auto j = i; j < 3 * element_size; ++j)
-        {
-            if (fabs(K_current(i, j)) < epsilon)
-                K_current(i, j) = 0;
-            if (i != j)
-                K_current(j, i) = K_current(i, j);
-        }
-
-    for (auto i = 0; i < element_size; ++i)
-        for (auto j = i; j < element_size; ++j)
-        {
-            if (fabs(L_current(i, j)) < epsilon)
-                L_current(i, j) = 0;
-            if (i != j)
-                L_current(j, i) = L_current(i, j);
-        }
-
-    for (auto i = 0; i < 3 * element_size; ++i)
-        for (auto j = 0; j < element_size; ++j)
-            if (fabs(S_current(i, j)) < epsilon)
-                S_current(i, j) = 0;
-}
-
-/**
- * @brief Return the element stifness matrix \f$\boldsymbol{K}\f$ computed
- * by the thread i_thread.
- * 
- * Argument:
- * <ul>
- *  <li> i_thread: the ID of the thread used to compute the element matrices.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> ElementMatrices<scalar, element_type, element_size>::getK(size_t i_thread) const
-{
-    Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> K_current = subview(K, i_thread, Kokkos::ALL(), Kokkos::ALL());
-    return K_current;
-}
-
-/**
- * @brief Return the thermal element matrix \f$\boldsymbol{L}\f$ computed
- * by the thread i_thread.
- * 
- * Argument:
- * <ul>
- *  <li> i_thread: the ID of the thread used to compute the element matrices.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> ElementMatrices<scalar, element_type, element_size>::getL(size_t i_thread) const
-{
-    Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> L_current = subview(L, i_thread, Kokkos::ALL(), Kokkos::ALL());
-    return L_current;
-}
-
-/**
- * @brief Return the coupling element matrix \f$\boldsymbol{S}\f$ computed
- * by the thread i_thread.
- * 
- * Argument:
- * <ul>
- *  <li> i_thread: the ID of the thread used to compute the element matrices.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> ElementMatrices<scalar, element_type, element_size>::getS(size_t i_thread) const
-{
-    Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> S_current = subview(S, i_thread, Kokkos::ALL(), Kokkos::ALL());
-    return S_current;
-}
\ No newline at end of file
diff --git a/katoptron/src/ElementMatricesETI.cpp b/katoptron/src/ElementMatricesETI.cpp
deleted file mode 100644
index 0df65d212a0018323990714d3ecb15df663fd967..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementMatricesETI.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "ElementMatrices.h"
-#include "ElementMatrices.hpp"
-
-template class ElementMatrices<double, 4, 4>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, 4, 4>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, 4, 4>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, 4, 4>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, 4, 4>;
-
-template class ElementMatrices<double, 5, 8>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, 5, 8>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, 5, 8>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, 5, 8>;
-template class ElementMatrices<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, 5, 8>;
diff --git a/katoptron/src/ElementVectors.h b/katoptron/src/ElementVectors.h
deleted file mode 100644
index 3c7474ffb9b479445b258d80e834e6745e5365d8..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementVectors.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef KATOPTRON_ELEMENTVECTORS_H
-#define KATOPTRON_ELEMENTVECTORS_H
-
-#include <Kokkos_Core.hpp>
-#include "Kokkos_ViewFactory.hpp"
-#include "wCacheHex8.h"
-#include "wCacheQuad4.h"
-#include "wCacheTetra4.h"
-#include "wCacheTri3.h"
-#include "tMatrix.h"
-#include "Domain.h"
-#include "Loads.h"
-
-#include "ElementComputation.h"
-
-#include "MaterialsList.h"
-#include "Material.h"
-
-#include "wLazy.h"
-#include "tMatrix.h"
-
-/**
- * @brief Class used to compute the matrix associated to the
- * integration of load on surface \f$\boldsymbol{N}\f$.
- */
-template <typename scalar, int element_type, int element_size>
-class ElementVectors : public ElementComputation<scalar, element_type>
-{
-public:
-    Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> N;
-
-    Teuchos::RCP<katoptron::Domain<scalar>> domain;
-
-    size_t numPrimalDPN;
-
-    ElementVectors(Teuchos::RCP<katoptron::Domain<scalar>> domain, size_t numPrimalDPN, size_t pool_size);
-
-    void compute(int e, int i_thread);
-    Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> getN(size_t i_thread) const;
-};
-
-#endif //KATOPTRON_ELEMENTVECTORS_H
diff --git a/katoptron/src/ElementVectors.hpp b/katoptron/src/ElementVectors.hpp
deleted file mode 100644
index f89101de86bd50b00f9085b2ebf1be71c9072900..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementVectors.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @brief ElementVectors constructor
- * 
- * Arguments:
- * <ul>
- *  <li> domain: an RCP to a Domain object,
- *  <li> numPrimalDPN: the number of degrees of freedom per node (without taking into account the Lagrange multipliers),
- *  <li> pool_size: the number of threads that will be used to compute \f$\boldsymbol{N}\f$.
- * </ul>
- * 
- * The number of used threads is specify to allocate distinct memory for each thread to ensure that the threads
- * do not use the same memory addresses.
- */
-template <typename scalar, int element_type, int element_size>
-ElementVectors<scalar, element_type, element_size>::ElementVectors(Teuchos::RCP<katoptron::Domain<scalar>> _domain,
-                                                                   size_t _numPrimalDPN,
-                                                                   size_t pool_size) : domain(_domain), numPrimalDPN(_numPrimalDPN)
-{
-    N = Kokkos::View<scalar ***, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace>("A", pool_size, element_size, element_size);
-}
-
-/**
- * @brief Compute the \f$\boldsymbol{N}\f$ matrix.
- * Arguments:
- * <ul>
- *  <li> e: the local ID of the element for which \f$\boldsymbol{N}\f$ has to be computed,
- *  <li> i_thread: the ID of the thread used to compute \f$\boldsymbol{N}\f$.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-void ElementVectors<scalar, element_type, element_size>::compute(int e, int i_thread)
-{
-    tbox::Cache *cache;
-
-    std::vector<Eigen::Vector3d> gauss_p;
-    std::vector<double> gauss_w;
-
-    /* @todo could probably be refactored into cache = element->getVCache(); */
-    if (element_type == static_cast<int>(tbox::ElType::HEX8))
-    {
-        tbox::CacheHex8 &cachehex8 = this->trilinosHex8GetCache();
-        cache = &cachehex8;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::TETRA4))
-    {
-        tbox::CacheTetra4 &cachetetra4 = this->trilinosTetra4GetCache();
-        cache = &cachetetra4;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::TRI3))
-    {
-        tbox::CacheTri3 &cachetri3 = this->trilinosTri3GetCache();
-        cache = &cachetri3;
-    }
-    else if (element_type == static_cast<int>(tbox::ElType::QUAD4))
-    {
-        tbox::CacheQuad4 &cachequad4 = this->trilinosQuad4GetCache();
-        cache = &cachequad4;
-    }
-
-    for (size_t a = 0; a < cache->getVGauss().getN(); ++a)
-    {
-        gauss_p.push_back(cache->getVGauss().getP(a));
-        gauss_w.push_back(cache->getVGauss().getW(a));
-    }
-
-    tVector<double, element_size> ff;
-    tMatrix<double, 3, 3> J;
-
-    auto N_current = subview(N, i_thread, Kokkos::ALL(), Kokkos::ALL());
-
-    Kokkos::deep_copy(N_current, 0);
-
-    // Looping on gauss points
-    for (auto a = 0; a < gauss_p.size(); ++a)
-    {
-        for (auto j = 0; j < element_size; ++j)
-            if (element_type == static_cast<int>(tbox::ElType::HEX8))
-                ff(j) = (static_cast<tbox::CacheHex8 *>(cache)->getSf(a))(j);
-            else if (element_type == static_cast<int>(tbox::ElType::TETRA4))
-                ff(j) = (static_cast<tbox::CacheTetra4 *>(cache)->getSf(a))(j);
-            else if (element_type == static_cast<int>(tbox::ElType::TRI3))
-                ff(j) = (static_cast<tbox::CacheTri3 *>(cache)->getSf(a))(j);
-            else if (element_type == static_cast<int>(tbox::ElType::QUAD4))
-                ff(j) = (static_cast<tbox::CacheQuad4 *>(cache)->getSf(a))(j);
-
-        double detJ = this->buildJ(a, J, e, *(domain->elementsList), *(domain->nodesList));
-
-        for (auto i = 0; i < element_size; ++i)
-            for (auto j = 0; j < element_size; ++j)
-                N_current(i, j) += ff(i) * ff(j) * gauss_w[a] * detJ;
-    }
-}
-
-/**
- * @brief Return the \f$\boldsymbol{N}\f$.
- * 
- * Argument:
- * <ul>
- *  <li> i_thread: the ID of the thread used to compute \f$\boldsymbol{N}\f$.
- * </ul> 
- */
-template <typename scalar, int element_type, int element_size>
-Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> ElementVectors<scalar, element_type, element_size>::getN(size_t i_thread) const
-{
-    Kokkos::View<scalar **, Kokkos::LayoutRight, Kokkos::DefaultExecutionSpace> N_current =
-        subview(N, i_thread, Kokkos::ALL(), Kokkos::ALL());
-    return N_current;
-}
\ No newline at end of file
diff --git a/katoptron/src/ElementVectorsETI.cpp b/katoptron/src/ElementVectorsETI.cpp
deleted file mode 100644
index 445a934ba9e1902ed13bad86420cf9bf6212522f..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementVectorsETI.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "ElementVectors.h"
-#include "ElementVectors.hpp"
-using namespace tbox;
-
-template class ElementVectors<double, static_cast<int>(ElType::TRI3), 3>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TRI3), 3>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TRI3), 3>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TRI3), 3>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TRI3), 3>;
-
-template class ElementVectors<double, static_cast<int>(ElType::QUAD4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::QUAD4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::QUAD4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::QUAD4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::QUAD4), 4>;
-
-template class ElementVectors<double, static_cast<int>(ElType::TETRA4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TETRA4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TETRA4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TETRA4), 4>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::TETRA4), 4>;
-
-template class ElementVectors<double, static_cast<int>(ElType::HEX8), 8>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::HEX8), 8>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::HEX8), 8>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::HEX8), 8>;
-template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>,
-                              static_cast<int>(ElType::HEX8), 8>;
diff --git a/katoptron/src/ElementsList.cpp b/katoptron/src/ElementsList.cpp
deleted file mode 100644
index fd78fd7529c5239655013bc7803f592d5c053ee5..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementsList.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "ElementsList.h"
-
-#include "wProblem.h"
-#include "wTag.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wMedium.h"
-
-using namespace katoptron;
-
-/**
- * @brief ElementsList constructor
- * 
- * This constructor allocates 1 Kokkos::View which stores all the required information related to the elements, including:
- * <ul>
- *  <li> all their local node IDs,
- *  <li> their size, type, and material (at most one material per element).
- * </ul>
- *
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object.
- * </ul>
- */
-ElementsList::ElementsList(Problem &pbl, Teuchos::RCP<Map> map)
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-
-    elements_number = map->mapElems->getNodeNumElements();
-
-    local_ordinal_type materials_number = pbl.media.size();
-    elements_type = 0;
-    elements_size = 1;
-    elements_material = 2;
-    elements_owned = 3;
-    elements_nodes = 4;
-
-    elements = Kokkos::View<int **, Kokkos::LayoutRight>("R", elements_number, elements_nodes + 8);
-
-    const int n_procs = map->mapElems->getComm()->getSize();
-    const int rank = map->mapElems->getComm()->getRank();
-
-    int i1 = 0;
-    int i2 = 0;
-    while (i1 < elements_number)
-    {
-        tbox::Element *e = pbl.msh->elems[i2++];
-        if (map->mapElems->isNodeGlobalElement(e->no - 1))
-        {
-            elements(i1, elements_type) = static_cast<int>(e->type());
-            elements(i1, elements_size) = e->nodes.size();
-            for (int j = 0; j < materials_number; ++j)
-                if (e->ptag == (pbl.media[j]->tag))
-                {
-                    elements(i1, elements_material) = j;
-                    break;
-                }
-            for (int j = 0; j < e->nodes.size(); ++j)
-                elements(i1, elements_nodes + j) = map->mapNodesWO->getLocalElement(e->nodes[j]->row);
-            ++i1;
-        }
-    }
-
-    for (int i = 0; i < elements_number; ++i)
-        elements(i, elements_owned) = 0;
-
-    int p_key;
-    if (n_procs != 1)
-        for (auto const &p : pbl.msh->parts)
-            if (p.second->no == (rank + 1))
-                p_key = p.first;
-
-    if (n_procs != 1)
-        for (int i = 0; i < pbl.msh->parts[p_key]->elems.size(); ++i)
-        {
-            local_ordinal_type local_i = map->mapElems->getLocalElement(pbl.msh->parts[p_key]->elems[i]->no - 1);
-            elements(local_i, elements_owned) = 1;
-        }
-
-    else
-        for (int i = 0; i < elements_number; ++i)
-            elements(i, elements_owned) = 1;
-}
diff --git a/katoptron/src/ElementsList.h b/katoptron/src/ElementsList.h
deleted file mode 100644
index 08f902a8bdc35a4cc0f286c1492c4d8d21281b29..0000000000000000000000000000000000000000
--- a/katoptron/src/ElementsList.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef KATOPTRON_ELEMENTLISTS_H
-#define KATOPTRON_ELEMENTLISTS_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to store the element information including:
- * <ul>
- *  <li> The number of local elements,
- *  <li> The type of every elements,
- *  <li> The size of each elements,
- *  <li> The material ID of each elements,
- *  <li> The local node ID of each elements.
- * </ul> 
- */
-class ElementsList
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-
-private:
-    Kokkos::View<int **, Kokkos::LayoutRight> elements;
-
-    local_ordinal_type elements_number;
-    local_ordinal_type elements_type;
-    local_ordinal_type elements_size;
-    local_ordinal_type elements_material;
-    local_ordinal_type elements_owned;
-    local_ordinal_type elements_nodes;
-
-public:
-    ElementsList(Problem &pbl, Teuchos::RCP<Map> map);
-
-    /**
-     * @brief Return the number of local elements i.e. the number
-     * of elements owned by the calling process.
-     */
-    inline local_ordinal_type getElementNumber(void) const { return elements_number; }
-
-    /**
-     * @brief Return the type of the local element of local ID e.
-     * Argument:
-     * <ul>
-     *  <li> e: local ID of the element.
-     * </ul>
-     */
-    inline local_ordinal_type getElementType(const local_ordinal_type e) const
-    {
-        return elements(e, elements_type);
-    }
-
-    /**
-     * @brief Return the size of the local element of local ID e.
-     * Argument:
-     * <ul>
-     *  <li> e: local ID of the element.
-     * </ul>
-     */
-    inline local_ordinal_type getElementSize(const local_ordinal_type e) const
-    {
-        return elements(e, elements_size);
-    }
-
-    /**
-     * @brief Return the material ID of the local element of ID e.
-     * Argument:
-     * <ul>
-     *  <li> e: local ID of the element.
-     * </ul>
-     */
-    inline local_ordinal_type getElementMaterial(const local_ordinal_type e) const
-    {
-        return elements(e, elements_material);
-    }
-
-    /**
-     * @brief Return the local ID of the ith node of the local element of ID e.
-     * Argument:
-     * <ul>
-     *  <li> e: local ID of the element,
-     *  <li> i: element local ID of the node.
-     * </ul>
-     */
-    inline local_ordinal_type getElementNode(const local_ordinal_type e, local_ordinal_type i) const
-    {
-        return elements(e, elements_nodes + i);
-    }
-
-    /**
-     * @brief Return whether local element of ID e is owned by this MPI process (i.e whether it
-     * is not a ghost element).
-     * Argument:
-     * <ul>
-     *  <li> e: local ID of the element.
-     * </ul>
-     */
-    inline local_ordinal_type isLocal(const local_ordinal_type e) const
-    {
-        return elements(e, elements_owned);
-    }
-};
-}; // namespace katoptron
-
-#endif //KATOPTRON_ELEMENTLISTS_H
diff --git a/katoptron/src/EnsembleReduction.h b/katoptron/src/EnsembleReduction.h
deleted file mode 100644
index 9d6f393ead2878200afa418abce2b45732d433c0..0000000000000000000000000000000000000000
--- a/katoptron/src/EnsembleReduction.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef KATOPTRON_ENSEMBLEREDUCTION_H
-#define KATOPTRON_ENSEMBLEREDUCTION_H
-
-#include <Stokhos_config.h>
-
-bool UseEnsembleReduction()
-{
-#ifdef HAVE_STOKHOS_ENSEMBLE_REDUCT
-    return true;
-#else
-    return false;
-#endif
-}
-#endif //KATOPTRON_ENSEMBLEREDUCTION_H
\ No newline at end of file
diff --git a/katoptron/src/EnsembleTraits.h b/katoptron/src/EnsembleTraits.h
deleted file mode 100644
index d107df17884388aca0d6bc1dc9325fd1c9de1ba4..0000000000000000000000000000000000000000
--- a/katoptron/src/EnsembleTraits.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef KATOPTRON_ENSEMBLETRAITS_H
-#define KATOPTRON_ENSEMBLETRAITS_H
-
-#include "Sacado.hpp"
-#include "Stokhos_Tpetra_Utilities_MP_Vector.hpp"
-
-template <typename T>
-struct EnsembleTraits
-{
-    static const int size = 1;
-    typedef T value_type;
-    static const value_type &coeff(const T &x, int i) { return x; }
-    static value_type &coeff(T &x, int i) { return x; }
-};
-
-template <typename S>
-struct EnsembleTraits<Sacado::MP::Vector<S>>
-{
-    static const int size = S::static_size;
-    typedef typename S::value_type value_type;
-    static const value_type &coeff(const Sacado::MP::Vector<S> &x, int i)
-    {
-        return x.fastAccessCoeff(i);
-    }
-    static value_type &coeff(Sacado::MP::Vector<S> &x, int i)
-    {
-        return x.fastAccessCoeff(i);
-    }
-};
-#endif // KATOPTRON_ENSEMBLETRAITS_H
diff --git a/katoptron/src/Graph.cpp b/katoptron/src/Graph.cpp
deleted file mode 100644
index b5859366888f0e6778e36552c3f894d7493b3cb0..0000000000000000000000000000000000000000
--- a/katoptron/src/Graph.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-#include "Graph.h"
-
-#include "wProblem.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-
-#include <utility>
-
-#include <Kokkos_UnorderedMap.hpp>
-#include <Kokkos_Sort.hpp>
-
-#include "Tpetra_CrsMatrix.hpp"
-#include <MatrixMarket_Tpetra.hpp>
-
-#include "LinearSolver.h"
-
-using namespace katoptron;
-
-int min(int a, int b)
-{
-    return (a <= b) ? a : b;
-}
-
-int max(int a, int b)
-{
-    return (a >= b) ? a : b;
-}
-
-/**
- * @brief Graph constructor
- *
- * This constructor computes the sparsity pattern of the primal matrix.
- * 
- * Arguments:
- * <ul>
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to a ElementsList object.
- * </ul>
- */
-Graph::Graph(Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
-{
-    using std::pair;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-    using Teuchos::tuple;
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-    typedef Tpetra::CrsGraph<local_ordinal_type, global_ordinal_type> crs_graph_type;
-    typedef local_ordinal_type LO;
-    typedef global_ordinal_type GO;
-
-    auto numMyElems = elementsList->getElementNumber();
-
-    auto numPrimalDPN = map->numPrimalDPN;
-
-    int numLclNodes = map->mapNodes->getNodeNumElements();
-
-    int numLclRowsK = 3 * numLclNodes;
-    int numLclRowsL = numLclNodes;
-
-    Kokkos::View<size_t *> rowCountsK("row counts", numLclRowsK);
-    Kokkos::View<size_t *> rowCountsS("row counts", numLclRowsK);
-    Kokkos::View<size_t *> rowCountsL("row counts", numLclRowsL);
-
-    const int maxConnections = 30;
-    Kokkos::UnorderedMap<pair<GO, GO>, bool> nodenode(numLclNodes * maxConnections);
-
-    size_t numLclEntries = 0;
-
-    Kokkos::parallel_reduce(
-        numMyElems,
-        KOKKOS_LAMBDA(const LO e, size_t &curNumLclEntries) {
-            const int element_size = elementsList->getElementSize(e);
-
-            for (auto n1 = 0; n1 < element_size; ++n1)
-                for (auto n2 = n1; n2 < element_size; ++n2)
-                {
-                    const LO lclNodeWO1 = elementsList->getElementNode(e, n1);
-                    const LO lclNodeWO2 = elementsList->getElementNode(e, n2);
-
-                    const GO globalTmpNode1 = map->mapNodesWO->getGlobalElement(lclNodeWO1);
-                    const GO globalTmpNode2 = map->mapNodesWO->getGlobalElement(lclNodeWO2);
-
-                    const GO globalNode1 = min(globalTmpNode1, globalTmpNode2);
-                    const GO globalNode2 = max(globalTmpNode1, globalTmpNode2);
-
-                    const pair<GO, GO> key(globalNode1, globalNode2);
-
-                    auto result = nodenode.insert(key);
-
-                    if (result.success())
-                    {
-                        const bool isDiffNodes = (globalNode1 != globalNode2);
-                        const bool isLocalNode1 = map->mapNodes->isNodeGlobalElement(globalNode1);
-                        const bool isLocalNode2 = map->mapNodes->isNodeGlobalElement(globalNode2);
-
-                        const LO lclNode1 = map->mapNodes->getLocalElement(globalNode1);
-                        const LO lclNode2 = map->mapNodes->getLocalElement(globalNode2);
-
-                        if (numPrimalDPN == 4 || numPrimalDPN == 1)
-                        {
-                            if (isLocalNode1)
-                                Kokkos::atomic_fetch_add(&rowCountsL(lclNode1), 1);
-                            if (isDiffNodes && isLocalNode2)
-                                Kokkos::atomic_fetch_add(&rowCountsL(lclNode2), 1);
-                        }
-                        if (numPrimalDPN == 4 || numPrimalDPN == 3)
-                        {
-                            for (auto i = 0; i < 3; ++i)
-                                for (auto j = 0; j < 3; ++j)
-                                {
-                                    const LO lclRow = 3 * lclNode1 + i;
-                                    const LO lclCol = 3 * lclNode2 + j;
-
-                                    if (isLocalNode1)
-                                        Kokkos::atomic_fetch_add(&rowCountsK(lclRow), 1);
-                                    if (isDiffNodes && isLocalNode2)
-                                        Kokkos::atomic_fetch_add(&rowCountsK(lclCol), 1);
-                                }
-                        }
-                        if (numPrimalDPN == 4)
-                        {
-                            if (isLocalNode1)
-                                for (auto i = 0; i < 3; ++i)
-                                {
-                                    const LO lclRow = 3 * lclNode1 + i;
-                                    Kokkos::atomic_fetch_add(&rowCountsS(lclRow), 1);
-                                }
-
-                            if (isDiffNodes && isLocalNode2)
-                                for (auto i = 0; i < 3; ++i)
-                                {
-                                    const LO lclRow = 3 * lclNode2 + i;
-
-                                    Kokkos::atomic_fetch_add(&rowCountsS(lclRow), 1);
-                                }
-                        }
-                    }
-                }
-        },
-        numLclEntries);
-
-    Kokkos::View<size_t *> rowOffsetsK("row offsets", numLclRowsK + 1);
-    Kokkos::View<size_t *> rowOffsetsS("row offsets", numLclRowsK + 1);
-    Kokkos::View<size_t *> rowOffsetsL("row offsets", numLclRowsL + 1);
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-        Kokkos::parallel_scan(
-            numLclRowsL,
-            KOKKOS_LAMBDA(int irow, int &update, bool final) {
-                // parallel scan is a multi-pass parallel pattern
-                // In the ‘final’ pass ‘update’ has the prefix value
-                if (final)
-                    rowOffsetsL(irow) = update;
-                update += rowCountsL(irow);
-                if (final && numLclRowsL == irow + 1)
-                    rowOffsetsL(irow + 1) = update; // total non-zeros
-            });
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-        Kokkos::parallel_scan(
-            numLclRowsK,
-            KOKKOS_LAMBDA(int irow, int &update, bool final) {
-                // parallel scan is a multi-pass parallel pattern
-                // In the ‘final’ pass ‘update’ has the prefix value
-                if (final)
-                    rowOffsetsK(irow) = update;
-                update += rowCountsK(irow);
-                if (final && numLclRowsK == irow + 1)
-                    rowOffsetsK(irow + 1) = update; // total non-zeros
-            });
-
-    if (numPrimalDPN == 4)
-        Kokkos::parallel_scan(
-            numLclRowsK,
-            KOKKOS_LAMBDA(int irow, int &update, bool final) {
-                // parallel scan is a multi-pass parallel pattern
-                // In the ‘final’ pass ‘update’ has the prefix value
-                if (final)
-                    rowOffsetsS(irow) = update;
-                update += rowCountsS(irow);
-                if (final && numLclRowsK == irow + 1)
-                    rowOffsetsS(irow + 1) = update; // total non-zeros
-            });
-
-    Kokkos::deep_copy(rowCountsK, static_cast<size_t>(0));
-    Kokkos::deep_copy(rowCountsS, static_cast<size_t>(0));
-    Kokkos::deep_copy(rowCountsL, static_cast<size_t>(0));
-
-    Kokkos::View<LO *> colIndicesK("column indices", rowOffsetsK(numLclRowsK));
-    Kokkos::View<LO *> colIndicesS("column indices", rowOffsetsS(numLclRowsK));
-    Kokkos::View<LO *> colIndicesL("column indices", rowOffsetsL(numLclRowsL));
-
-    Kokkos::parallel_for(
-        nodenode.capacity(),
-        KOKKOS_LAMBDA(int ientry) {
-            if (nodenode.valid_at(ientry))
-            {
-                const pair<GO, GO> key = nodenode.key_at(ientry);
-                const GO globalNode1 = key.first;
-                const GO globalNode2 = key.second;
-
-                const bool isDiffNodes = (globalNode1 != globalNode2);
-                const bool isLocalNode1 = map->mapNodes->isNodeGlobalElement(globalNode1);
-                const bool isLocalNode2 = map->mapNodes->isNodeGlobalElement(globalNode2);
-
-                const LO lclNode1 = map->mapNodes->getLocalElement(globalNode1);
-                const LO lclNode2 = map->mapNodes->getLocalElement(globalNode2);
-
-                const LO lclNodeWO1 = map->mapNodesWO->getLocalElement(globalNode1);
-                const LO lclNodeWO2 = map->mapNodesWO->getLocalElement(globalNode2);
-
-                if (numPrimalDPN == 4 || numPrimalDPN == 1)
-                {
-
-                    if (isLocalNode1)
-                    {
-                        const LO lclRow = lclNode1;
-                        const LO lclCol = lclNodeWO2;
-
-                        const size_t count = Kokkos::atomic_fetch_add(&rowCountsL(lclRow), 1);
-                        colIndicesL(rowOffsetsL(lclRow) + count) = lclCol;
-                    }
-                    if (isDiffNodes && isLocalNode2)
-                    {
-                        const LO lclRow = lclNode2;
-                        const LO lclCol = lclNodeWO1;
-
-                        const size_t count = Kokkos::atomic_fetch_add(&rowCountsL(lclRow), 1);
-                        colIndicesL(rowOffsetsL(lclRow) + count) = lclCol;
-                    }
-                }
-                if (numPrimalDPN == 4 || numPrimalDPN == 3)
-                {
-                    if (isLocalNode1)
-                    {
-                        for (auto i = 0; i < 3; ++i)
-                            for (auto j = 0; j < 3; ++j)
-                            {
-                                const LO lclRow = 3 * lclNode1 + i;
-                                const LO lclCol = 3 * lclNodeWO2 + j;
-
-                                const size_t count = Kokkos::atomic_fetch_add(&rowCountsK(lclRow), 1);
-                                colIndicesK(rowOffsetsK(lclRow) + count) = lclCol;
-                            }
-                    }
-                    if (isDiffNodes && isLocalNode2)
-                    {
-                        for (auto i = 0; i < 3; ++i)
-                            for (auto j = 0; j < 3; ++j)
-                            {
-                                const LO lclRow = 3 * lclNode2 + i;
-                                const LO lclCol = 3 * lclNodeWO1 + j;
-
-                                const size_t count = Kokkos::atomic_fetch_add(&rowCountsK(lclRow), 1);
-                                colIndicesK(rowOffsetsK(lclRow) + count) = lclCol;
-                            }
-                    }
-                }
-                if (numPrimalDPN == 4)
-                {
-                    if (isLocalNode1)
-                        for (auto i = 0; i < 3; ++i)
-                        {
-                            const LO lclRow = 3 * lclNode1 + i;
-                            const LO lclCol = lclNodeWO2;
-
-                            const size_t count = Kokkos::atomic_fetch_add(&rowCountsS(lclRow), 1);
-                            colIndicesS(rowOffsetsS(lclRow) + count) = lclCol;
-                        }
-                    if (isDiffNodes && isLocalNode2)
-                        for (auto i = 0; i < 3; ++i)
-                        {
-                            const LO lclRow = 3 * lclNode2 + i;
-                            const LO lclCol = lclNodeWO1;
-
-                            const size_t count = Kokkos::atomic_fetch_add(&rowCountsS(lclRow), 1);
-                            colIndicesS(rowOffsetsS(lclRow) + count) = lclCol;
-                        }
-                }
-            }
-        });
-
-    LinearSolver::getTimers()["graph: sort"].start();
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-        Kokkos::parallel_for(
-            numLclRowsL,
-            KOKKOS_LAMBDA(int lclRow) {
-                auto currentColIndices = subview(colIndicesL, Kokkos::make_pair(rowOffsetsL(lclRow), rowOffsetsL(lclRow + 1)));
-                LO *const lclColIndsRaw = currentColIndices.data();
-                std::sort(lclColIndsRaw, lclColIndsRaw + rowOffsetsL(lclRow + 1) - rowOffsetsL(lclRow));
-            });
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-        Kokkos::parallel_for(
-            numLclRowsK,
-            KOKKOS_LAMBDA(int lclRow) {
-                auto currentColIndices = subview(colIndicesK, Kokkos::make_pair(rowOffsetsK(lclRow), rowOffsetsK(lclRow + 1)));
-                LO *const lclColIndsRaw = currentColIndices.data();
-                std::sort(lclColIndsRaw, lclColIndsRaw + rowOffsetsK(lclRow + 1) - rowOffsetsK(lclRow));
-            });
-
-    if (numPrimalDPN == 4)
-        Kokkos::parallel_for(
-            numLclRowsK,
-            KOKKOS_LAMBDA(int lclRow) {
-                auto currentColIndices = subview(colIndicesS, Kokkos::make_pair(rowOffsetsS(lclRow), rowOffsetsS(lclRow + 1)));
-                LO *const lclColIndsRaw = currentColIndices.data();
-                std::sort(lclColIndsRaw, lclColIndsRaw + rowOffsetsS(lclRow + 1) - rowOffsetsS(lclRow));
-            });
-
-    LinearSolver::getTimers()["graph: sort"].stop();
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-    {
-        L = rcp(new crs_graph_type(map->thermoMap, map->thermoMapWO, rowOffsetsL, colIndicesL));
-        L->fillComplete(map->thermoMap, map->thermoMap);
-    }
-
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-    {
-        K = rcp(new crs_graph_type(map->mechaMap, map->mechaMapWO, rowOffsetsK, colIndicesK));
-        K->fillComplete(map->mechaMap, map->mechaMap);
-    }
-
-    if (numPrimalDPN == 4)
-    {
-        S = rcp(new crs_graph_type(map->mechaMap, map->thermoMapWO, rowOffsetsS, colIndicesS));
-        S->fillComplete(map->thermoMap, map->mechaMap);
-
-        Tpetra::MatrixMarket::Writer<Tpetra::CrsMatrix<>>::writeSparseGraphFile(std::string("S_graph.txt"), S);
-    }
-}
diff --git a/katoptron/src/Graph.h b/katoptron/src/Graph.h
deleted file mode 100644
index f3f0fd52b8d349ce0e447c3fed14d5766e794002..0000000000000000000000000000000000000000
--- a/katoptron/src/Graph.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef KATOPTRON_GRAPH_H
-#define KATOPTRON_GRAPH_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "ElementsList.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Tpetra_CrsGraph.hpp>
-
-#include <Teuchos_RCP.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to compute and store the graph of the primal matrices with and without overlaps.
- */
-class Graph
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-    typedef Tpetra::CrsGraph<local_ordinal_type, global_ordinal_type> crs_graph_type;
-
-public:
-    Teuchos::RCP<crs_graph_type> K;
-    Teuchos::RCP<crs_graph_type> S;
-    Teuchos::RCP<crs_graph_type> L;
-
-    Graph(Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
-};
-}; // namespace katoptron
-
-#endif //KATOPTRON_GRAPH_H
diff --git a/katoptron/src/IterativeSolver.cpp b/katoptron/src/IterativeSolver.cpp
deleted file mode 100644
index cf429c7f8fcea0424f0b0b57651fafd5bc476502..0000000000000000000000000000000000000000
--- a/katoptron/src/IterativeSolver.cpp
+++ /dev/null
@@ -1,868 +0,0 @@
-#include "IterativeSolver.h"
-#include "wTimer.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wMedium.h"
-#include "wDirichlet.h"
-#include "wContact.h"
-#include <map>
-#include "wTag.h"
-#include <math.h>
-#include "wHex8.h"
-#include "wQuad4.h"
-#include "wTri3.h"
-#include "wCacheHex8.h"
-#include "wGaussHex8.h"
-#include "wResults.h"
-
-#include "wRandomVariable.h"
-
-//#include "wElemMatrix.h"
-
-#include "wDisplayHook.h"
-
-#include <math.h>
-
-#include <mpi.h>
-
-//#include <tbb/tbb.h>
-//#include <tbb/parallel_for.h>
-//#include <tbb/blocked_range.h>
-//#include <tbb/task_scheduler_init.h>
-//#include <tbb/spin_mutex.h>
-
-#include <cstring>
-#include <sstream>
-#include <iostream>
-#include <locale> // std::locale
-
-// Tpetra
-#include "Stokhos_Tpetra_MP_Vector.hpp"
-#include "Stokhos_Tpetra_Utilities_MP_Vector.hpp"
-#include "Tpetra_ConfigDefs.hpp"
-
-#include "Tpetra_Map.hpp"
-#include "Tpetra_MultiVector.hpp"
-#include "Tpetra_Vector.hpp"
-#include "Tpetra_CrsGraph.hpp"
-#include "Tpetra_CrsMatrix.hpp"
-#include "Stokhos_Tpetra_CG.hpp"
-//#include "Sacado_Fad_MP_Vector.hpp"
-
-#include "Teuchos_XMLParameterListCoreHelpers.hpp"
-#include <Teuchos_Array.hpp>
-#include <Teuchos_GlobalMPISession.hpp>
-#include <Teuchos_oblackholestream.hpp>
-#include <Teuchos_ScalarTraits.hpp>
-#include <Teuchos_RCP.hpp>
-#include "Teuchos_ParameterList.hpp"
-
-#include "Stokhos_Amesos2_MP_Vector.hpp"
-#include "Amesos2_Factory.hpp"
-
-#include "Stokhos_Ifpack2_MP_Vector.hpp"
-#include "Ifpack2_Factory.hpp"
-
-#include "Belos_Tpetra_MP_Vector.hpp"
-#include "BelosStatusTestCombo.hpp"
-
-#include <Xpetra_BlockedCrsMatrix.hpp>
-#include <Xpetra_Matrix.hpp>
-#include <BelosXpetraAdapter.hpp> // => This header defines Belos::XpetraOp
-#include <BelosMueLuAdapter.hpp>  // => This header defines Belos::MueLuOp
-#include <Xpetra_TpetraMultiVector.hpp>
-
-#include <Xpetra_MapExtractorFactory.hpp>
-#include <Xpetra_MatrixUtils.hpp>
-//#include "BelosGmresSolMgr.hpp"
-
-#include "Kokkos_ViewFactory.hpp"
-#include "Kokkos_Vector.hpp"
-
-#include <Epetra_Map.h>
-#include "Epetra_MpiComm.h"
-
-#include "BelosConfigDefs.hpp"
-
-#include "Map.h"
-#include "DiscreteProblem.h"
-
-#include <fstream>
-
-#include <MueLu.hpp>
-
-#include <MueLu_Exceptions.hpp>
-#include <MueLu_Hierarchy.hpp>
-#include <MueLu_MasterList.hpp>
-#include <MueLu_MLParameterListInterpreter.hpp>
-#include <MueLu_ParameterListInterpreter.hpp>
-#include <MueLu_Utilities.hpp>
-#include <MueLu_HierarchyUtils.hpp>
-
-#include <BelosXpetraStatusTestGenResSubNorm_MP_Vector.hpp>
-#include <BelosStatusTestWeightedGenResNorm_MP_Vector.hpp>
-
-#include "ElementMatrices.h"
-
-#include "NodesList.h"
-
-#ifdef max
-#undef max // pour std::numeric_limits<std::streamsize>::max()
-#endif
-
-using namespace katoptron;
-using namespace fwk;
-
-#define HAVE_BELOS_TPETRA_TIMERS
-
-template <typename scalar>
-Teuchos::ParameterList convertParamList(Teuchos::ParameterList &paramList)
-{
-    for (Teuchos::ParameterList::ConstIterator i = paramList.begin(); i != paramList.end(); ++i)
-    {
-        const std::string &name_i = paramList.name(i);
-
-        if (Teuchos::isParameterType<double>(paramList, name_i))
-        {
-            double value = Teuchos::getParameter<double>(paramList, name_i);
-            std::string name_ii = name_i;
-
-            paramList.set<scalar>(name_ii, ((scalar)value));
-        }
-        else if (Teuchos::isParameterType<Teuchos::ParameterList>(paramList, name_i))
-        {
-            Teuchos::ParameterList subparamList = Teuchos::getParameter<Teuchos::ParameterList>(paramList, name_i);
-            subparamList = convertParamList<scalar>(subparamList);
-            paramList.set(name_i, subparamList);
-        }
-    }
-
-    return paramList;
-}
-
-/**
- * @brief Display IterativeSolver information.
- */
-void IterativeSolver::write(std::ostream &out) const
-{
-    out << "katoptron::Solver:\n";
-    out << pbl; // wProblem.h
-}
-
-/**
- * @brief Launch the solver.
- */
-void IterativeSolver::start()
-{
-    std::locale::global(std::locale::classic());
-    {
-        if (minimum_ensemble_size <= 1)
-        {
-            IterativeSolver::tstart<double>();
-        }
-        else if (minimum_ensemble_size <= 8)
-        {
-            typedef Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>> ensemble_scalar;
-            IterativeSolver::tstart<ensemble_scalar>();
-        }
-        else if (minimum_ensemble_size <= 16)
-        {
-            typedef Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>> ensemble_scalar;
-            IterativeSolver::tstart<ensemble_scalar>();
-        }
-        else if (minimum_ensemble_size <= 24)
-        {
-            typedef Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>> ensemble_scalar;
-            IterativeSolver::tstart<ensemble_scalar>();
-        }
-        else if (minimum_ensemble_size <= 32)
-        {
-            typedef Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>> ensemble_scalar;
-            IterativeSolver::tstart<ensemble_scalar>();
-        }
-    }
-}
-
-/**
- * @brief Launch the solver with a templated scalar type.
- */
-template <typename scalar>
-void IterativeSolver::tstart()
-{
-    LinearSolver::getTimers().reset();
-    // ------------------------------------------
-    //
-    //         Trilinos initialization
-    //
-    // ------------------------------------------
-    using std::cerr;
-    using std::cout;
-    using std::endl;
-    using Teuchos::arcp;
-    using Teuchos::Array;
-    using Teuchos::ArrayRCP;
-    using Teuchos::ArrayView;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-    using Teuchos::tuple;
-
-    using Kokkos::ALL;
-    using Kokkos::subview;
-
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-    typedef Map::node_type node_type;
-
-    typedef typename Vectors<scalar>::tpetra_vector_type tpetra_vector_type;
-    typedef typename Vectors<scalar>::tpetra_mvector_type tpetra_mvector_type;
-    typedef typename Vectors<scalar>::xpetra_mvector_type xpetra_mvector_type;
-    typedef typename Vectors<scalar>::xpetra_tmvector_type xpetra_tmvector_type;
-
-    typedef typename Matrices<scalar>::tpetra_crs_type tpetra_crs_type;
-
-    typedef typename Matrices<scalar>::xpetra_bcrs_type xpetra_bcrs_type;
-    typedef typename Matrices<scalar>::xpetra_mat_type xpetra_mat_type;
-
-    typedef Tpetra::Export<local_ordinal_type, global_ordinal_type, node_type> export_type;
-    typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type> import_type;
-
-    typedef MueLu::Hierarchy<scalar, local_ordinal_type, global_ordinal_type, node_type> Hierarchy;
-    typedef MueLu::ParameterListInterpreter<scalar, local_ordinal_type, global_ordinal_type, node_type> ParameterListInterpreter;
-
-    typedef Teuchos::ScalarTraits<scalar> STS;
-    typedef typename STS::magnitudeType magnitude_type;
-
-    Teuchos::oblackholestream blackhole;
-
-    RCP<const Teuchos::Comm<int>> comm = rcp(new Teuchos::MpiComm<int>(pbl.comm));
-
-    const size_t myRank = comm->getRank();
-
-    // Make an output stream (for verbose output) that only prints on
-    // Proc 0 of the communicator.
-    Teuchos::oblackholestream blackHole;
-    std::ostream &out = (myRank == 0) ? std::cout : blackHole;
-
-    // Create some timers used by Belos so we can access them
-    Teuchos::RCP<Teuchos::Time> time_mat_vec =
-        Teuchos::TimeMonitor::getNewTimer("Belos: Operation Op*x");
-    Teuchos::RCP<Teuchos::Time> time_prec_apply =
-        Teuchos::TimeMonitor::getNewTimer("Belos: Operation Prec*x");
-    Teuchos::RCP<Teuchos::Time> time_prec_setup =
-        Teuchos::TimeMonitor::getNewTimer("Total MueLu setup time");
-
-    std::string ortho_strategy = solverList->get("Orthogonalization", "DGKS");
-    std::string belos_ortho_timer_name = "Belos: " + ortho_strategy;
-
-    if (ortho_strategy == "IMGS")
-        belos_ortho_timer_name = belos_ortho_timer_name + "[1]";
-    else
-        belos_ortho_timer_name = belos_ortho_timer_name + "[2]";
-
-    Teuchos::RCP<Teuchos::Time> time_ortho =
-        Teuchos::TimeMonitor::getNewTimer(belos_ortho_timer_name + ": Orthogonalization");
-    Teuchos::RCP<Teuchos::Time> time_ortho_inner =
-        Teuchos::TimeMonitor::getNewTimer(belos_ortho_timer_name + ": Ortho (Inner Product)");
-    Teuchos::RCP<Teuchos::Time> time_ortho_norm =
-        Teuchos::TimeMonitor::getNewTimer(belos_ortho_timer_name + ": Ortho (Norm)");
-    Teuchos::RCP<Teuchos::Time> time_ortho_update =
-        Teuchos::TimeMonitor::getNewTimer(belos_ortho_timer_name + ": Ortho (Update)");
-
-    Teuchos::RCP<Teuchos::Time> time_belos_total =
-        Teuchos::TimeMonitor::getNewTimer("Belos: PseudoBlockGmresSolMgr total solve time");
-
-    bool write_intermediate_files = solverList->get("Write intermediate files", false);
-    bool write_txt_files = solverList->get("Write txt files", false);
-    bool write_vtk_files = solverList->get("Write vtk files", true);
-    {
-        LinearSolver::getTimers()["total"].start();
-        auto msh = pbl.msh;
-
-        auto numNodes = msh->nodes.size();
-
-        RCP<Teuchos::ParameterList> randomParams =
-            rcp(new Teuchos::ParameterList(solverList->get("randomParams", Teuchos::ParameterList())));
-        const int n_rv = pbl.RandomVariables.size();
-
-        typedef Kokkos::View<scalar *, Kokkos::LayoutLeft> RandomVariableView;
-
-        RandomVariableView m_rv_values = RandomVariableView("KL Random Variables", n_rv);
-
-        typedef EnsembleTraits<scalar> ET;
-        const int ensemble_size = ET::size;
-
-        for (int i = 0; i < n_rv; ++i)
-            for (int j = 0; j < ensemble_size; ++j)
-                ET::coeff(m_rv_values(i), j) = (double)pbl.RandomVariables[i]->values[j];
-
-        LinearSolver::getTimers()["dp"].start();
-        Teuchos::RCP<DiscreteProblem<scalar>> discreteProblem =
-            Teuchos::rcp(new DiscreteProblem<scalar>(pbl, numPrimalDPN, randomParams, m_rv_values));
-        LinearSolver::getTimers()["dp"].stop();
-        LinearSolver::getTimers()["computeMatrices"].start();
-
-        const bool contactProblem = (discreteProblem->domain->contactsList->getContactNumber() >= 1);
-
-        if (contactProblem)
-        {
-            LinearSolver::getTimers()["compute contact matrices"].start();
-            discreteProblem->computeContactMatrices(pbl.comm);
-            LinearSolver::getTimers()["compute contact matrices"].stop();
-        }
-        LinearSolver::getTimers()["compute block 00 matrix"].start();
-        discreteProblem->computeMatrices();
-        LinearSolver::getTimers()["compute block 00 matrix"].stop();
-        LinearSolver::getTimers()["computeMatrices"].stop();
-
-        LinearSolver::getTimers()["computeMatrices"].start();
-
-        const bool mergeMatrix = solverList->get("Merge block matrix", true);
-        const bool writeMatrixAndVectors = solverList->get("Write matrix and vectors", false);
-
-        if (writeMatrixAndVectors)
-        {
-            LinearSolver::getTimers()["write"].start();
-            Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeSparseFile(std::string("A_mm.txt"),
-                                                                           discreteProblem->algebraic->matrices->K);
-            if (contactProblem)
-            {
-                Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeSparseFile(std::string("B_mm.txt"),
-                                                                               discreteProblem->algebraic->matrices->B);
-                Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeSparseFile(std::string("B_T_mm.txt"),
-                                                                               discreteProblem->algebraic->matrices->B_T);
-            }
-            LinearSolver::getTimers()["write"].stop();
-        }
-
-        LinearSolver::getTimers()["computeLoads"].start();
-        bool is_scaled = solverList->get("Scaled Block 0", false);
-        discreteProblem->computeLoads(is_scaled);
-        LinearSolver::getTimers()["computeLoads"].stop();
-
-        if (contactProblem)
-        {
-            scalar gamma;
-            if (solverList->isType<std::string>("gamma"))
-            {
-                Teuchos::Array<double> array_gamma_double = Teuchos::getArrayFromStringParameter<double>(*solverList, "gamma");
-                for (int j = 0; j < ensemble_size; ++j)
-                    ET::coeff(gamma, j) = (double)array_gamma_double[j];
-            }
-            else
-                gamma = solverList->get("gamma", 0.);
-            discreteProblem->createBlockMatrix(gamma, writeMatrixAndVectors, mergeMatrix);
-        }
-
-        LinearSolver::getTimers()["computeMatrices"].stop();
-
-        LinearSolver::getTimers()["computeLoads"].start();
-        if (contactProblem)
-        {
-            discreteProblem->createBlockMVector(writeMatrixAndVectors);
-        }
-        LinearSolver::getTimers()["computeLoads"].stop();
-
-        if (writeMatrixAndVectors)
-        {
-            std::string name_1, name_2, name_3;
-            name_1 = "matrix_after_bc.text";
-            name_2 = "matrix_after_bc";
-            name_3 = "vector_after_bc.text";
-
-            LinearSolver::getTimers()["write"].start();
-            Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeSparseFile(std::string("A_mm_after_bc.txt"),
-                                                                           discreteProblem->algebraic->matrices->K);
-            Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("b_mm_after_bc.txt"),
-                                                                          discreteProblem->algebraic->vectors->b);
-            LinearSolver::getTimers()["write"].stop();
-        }
-
-        std::string name_4, defaultName, name_x;
-        defaultName = "none";
-        name_4 = solverList->get("Initial guess", defaultName);
-        name_x = "solution";
-
-        RCP<export_type> exportOutput;
-        RCP<import_type> importOutput;
-        RCP<tpetra_vector_type> xPost, xPost2;
-        if (contactProblem)
-        {
-            importOutput = rcp(new import_type(discreteProblem->algebraic->map->fullmap, discreteProblem->algebraic->map->fullmapWO));
-            exportOutput = rcp(new export_type(discreteProblem->algebraic->map->fullmapWO, discreteProblem->algebraic->map->fullmapOutput));
-            xPost = rcp(new tpetra_vector_type(discreteProblem->algebraic->map->fullmapWO, false));
-            xPost2 = rcp(new tpetra_vector_type(discreteProblem->algebraic->map->fullmapOutput, false));
-        }
-        else
-        {
-            importOutput = rcp(new import_type(discreteProblem->algebraic->map->mapDofs, discreteProblem->algebraic->map->mapDofsWO));
-            exportOutput = rcp(new export_type(discreteProblem->algebraic->map->mapDofsWO, discreteProblem->algebraic->map->mapOutput));
-            xPost = rcp(new tpetra_vector_type(discreteProblem->algebraic->map->mapDofsWO, false));
-            xPost2 = rcp(new tpetra_vector_type(discreteProblem->algebraic->map->mapOutput, false));
-        }
-
-        if (name_4.compare(defaultName) != 0)
-            discreteProblem->algebraic->vectors->x = discreteProblem->algebraic->readVectorFromFile(name_4, myRank);
-
-        RCP<tpetra_vector_type> r(new tpetra_vector_type(discreteProblem->algebraic->map->mapDofs, true));
-
-        discreteProblem->algebraic->matrices->K->apply(*(discreteProblem->algebraic->vectors->x), *r, Teuchos::NO_TRANS, (scalar)-1., (scalar)1.);
-
-        if (writeMatrixAndVectors)
-        {
-            LinearSolver::getTimers()["write"].start();
-            std::string name_5 = "x_0.text";
-            Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string(name_5), discreteProblem->algebraic->vectors->x);
-            std::string name_6 = "r_0.text";
-            Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string(name_6), r);
-            LinearSolver::getTimers()["write"].stop();
-        }
-
-        bool usePrec = solverList->get("Use preconditioner", contactProblem);
-
-        std::string belos_output_file = solverList->get("Output Stream file name belos", "belos_out.txt");
-
-        std::ofstream belos_ofstream(belos_output_file);
-
-        RCP<Teuchos::FancyOStream> verbOut = Teuchos::getFancyOStream(Teuchos::rcpFromRef(belos_ofstream));
-        solverList->set("Output Stream", verbOut->getOStream());
-
-        magnitude_type GMRES_tol = solverList->get("Ensemble Convergence Tolerance", 1E-08);
-        solverList->set("Convergence Tolerance", GMRES_tol);
-
-        active_set_iteration = 0;
-        size_t max_active_set_iteration = solverList->get("Maximum active set iteration", 1);
-
-        bool blockedStatusTest = solverList->get("Use blocked status test", !mergeMatrix);
-        bool blockedStatusTest_x = solverList->get("Use blocked status test: x", blockedStatusTest);
-        bool blockedStatusTest_T = solverList->get("Use blocked status test: T", blockedStatusTest);
-
-        LinearSolver::getTimers()["solver"].start();
-        while (true)
-        {
-            // Solve
-            RCP<tpetra_vector_type> xx;
-
-            const bool blockedMatrix = (numPrimalDPN == 4);
-
-            RCP<xpetra_mat_type> A;
-            if (contactProblem)
-                A = discreteProblem->algebraic->matrices->blockedMatrix;
-            else if (mergeMatrix && blockedMatrix)
-                A = Teuchos::rcp_dynamic_cast<xpetra_bcrs_type>(discreteProblem->algebraic->matrices->A)->Merge();
-            else
-                A = discreteProblem->algebraic->matrices->A;
-
-            typedef xpetra_mvector_type MV;
-            typedef typename tpetra_mvector_type::dot_type belos_scalar;
-            typedef Belos::OperatorT<MV> OP;
-
-            typedef Belos::LinearProblem<belos_scalar, MV, OP> BLinProb;
-            // Turns a Xpetra::Matrix object into a Belos operator
-            RCP<OP> belosOp = rcp(new Belos::XpetraOp<scalar, local_ordinal_type, global_ordinal_type, node_type>(A));
-            RCP<OP> belosPrec;
-
-            if (usePrec)
-            {
-                LinearSolver::getTimers()["preconditioner setup"].start();
-                RCP<xpetra_mvector_type> nullspace1 = Teuchos::null;
-                RCP<xpetra_mvector_type> nullspace2 = Teuchos::null;
-
-                bool useXML = solverList->get("use xml file", false);
-                string xmlFileName = solverList->get("MueLu xml file name", " ");
-                RCP<Teuchos::ParameterList> mueluParams;
-
-                if (useXML || contactProblem)
-                {
-                    bool doIconver = solverList->get("convert MueLu xml file", false);
-
-                    RCP<Teuchos::ParameterList> paramList = Teuchos::getParametersFromXmlFile(xmlFileName);
-
-                    Teuchos::ParameterList paramList2;
-
-                    if (contactProblem)
-                    {
-                        RCP<std::map<local_ordinal_type, local_ordinal_type>> lagr2dof =
-                            Teuchos::rcpFromRef(discreteProblem->algebraic->map->lm_to_dof);
-
-                        RCP<Teuchos::ParameterList> paramsF, paramsI;
-                        paramsF = sublist(paramList, "Factories");
-                        paramsI = sublist(paramsF, "myInterfaceAggs2");
-                        paramsI->set<RCP<std::map<local_ordinal_type, local_ordinal_type>>>("DualNodeID2PrimalNodeID - level 0", lagr2dof);
-                    }
-
-                    if (doIconver)
-                        paramList2 = convertParamList<scalar>(*paramList);
-                    else
-                        paramList2 = (*paramList);
-
-                    mueluParams = rcp(new Teuchos::ParameterList(paramList2));
-                }
-                else
-                    mueluParams = rcp(new Teuchos::ParameterList(solverList->get("mueluParams", Teuchos::ParameterList())));
-
-                ParameterListInterpreter mueLuFactory(*mueluParams, comm);
-                RCP<Hierarchy> H = mueLuFactory.CreateHierarchy();
-                H->GetLevel(0)->Set("A", A);
-
-                H->IsPreconditioner(true);
-                H->SetDefaultVerbLevel(MueLu::Extreme);
-                mueLuFactory.SetupHierarchy(*H);
-                LinearSolver::getTimers()["preconditioner setup"].stop();
-
-                // Turns a MueLu::Hierarchy object into a Belos operator
-                belosPrec = rcp(new Belos::MueLuOp<scalar, local_ordinal_type, global_ordinal_type, node_type>(H));
-            }
-
-            RCP<MV> xMV;
-            RCP<MV> bMV;
-            RCP<MV> weightsMV;
-
-            if (contactProblem)
-            {
-                xMV = discreteProblem->algebraic->vectors->solutionMultiVector;
-                bMV = discreteProblem->algebraic->vectors->rhsMultiVector;
-            }
-            else
-            {
-                xMV = rcp(new xpetra_tmvector_type(discreteProblem->algebraic->vectors->x));
-                bMV = rcp(new xpetra_tmvector_type(discreteProblem->algebraic->vectors->b));
-                weightsMV = rcp(new xpetra_tmvector_type(discreteProblem->algebraic->vectors->weights));
-            }
-
-            RCP<BLinProb> blinproblem = rcp(new BLinProb(belosOp, xMV, bMV));
-
-            if (usePrec)
-                blinproblem->setRightPrec(belosPrec);
-            blinproblem->setProblem();
-            RCP<Teuchos::ParameterList> belosParams = solverList;
-            RCP<Belos::SolverManager<belos_scalar, MV, OP>> blinsolver =
-                rcp(new Belos::PseudoBlockGmresSolMgr<belos_scalar, MV, OP>(blinproblem, belosParams));
-            out << "Belos informations are written in file " << belos_output_file << endl;
-
-            if (writeMatrixAndVectors)
-            {
-                LinearSolver::getTimers()["write"].start();
-                if (contactProblem)
-                {
-                    RCP<tpetra_mvector_type> mxx =
-                        (Teuchos::rcp_dynamic_cast<xpetra_tmvector_type>(discreteProblem->algebraic->vectors->solutionMultiVector))->getTpetra_MultiVector();
-                    RCP<tpetra_mvector_type> mbb =
-                        (Teuchos::rcp_dynamic_cast<xpetra_tmvector_type>(discreteProblem->algebraic->vectors->rhsMultiVector))->getTpetra_MultiVector();
-                    Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("blocked_x_0_mm.txt"), mxx->getVectorNonConst(0));
-                    Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("blocked_b_mm.txt"), mbb->getVectorNonConst(0));
-                }
-                LinearSolver::getTimers()["write"].stop();
-            }
-
-            if (contactProblem && solverList->get("Create Preconditioned Matrix", false))
-            {
-                LinearSolver::getTimers()["create AM^{-1}"].start();
-                typedef xpetra_tmvector_type TMV;
-
-                Teuchos::RCP<const Xpetra::Map<local_ordinal_type, global_ordinal_type, node_type>> merged_map =
-                    discreteProblem->algebraic->vectors->rhsMultiVector->getMap();
-
-                Teuchos::RCP<TMV> MVx1 = Teuchos::rcp(new TMV(merged_map, merged_map->getGlobalNumElements(), true));
-                Teuchos::RCP<TMV> MVx2 = Teuchos::rcp(new TMV(merged_map, merged_map->getGlobalNumElements(), true));
-                Teuchos::RCP<TMV> MVy1 = Teuchos::rcp(new TMV(merged_map, merged_map->getGlobalNumElements(), true));
-                Teuchos::RCP<TMV> MVy2 = Teuchos::rcp(new TMV(merged_map, merged_map->getGlobalNumElements(), true));
-
-                for (size_t local_i = 0; local_i < merged_map->getNodeNumElements(); ++local_i)
-                    MVx1->sumIntoGlobalValue(merged_map->getGlobalElement(local_i), merged_map->getGlobalElement(local_i), ((scalar)1.));
-
-                belosPrec->Apply(*MVx1, *MVx2);
-                belosOp->Apply(*MVx2, *MVy2);
-                belosOp->Apply(*MVx1, *MVy1);
-
-                Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("Applied_Matrix_mm.txt"),
-                                                                              MVy1->getTpetra_MultiVector());
-                Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("Applied_Preconditioner_mm.txt"),
-                                                                              MVx2->getTpetra_MultiVector());
-                Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("Applied_Preconditioned_Matrix_mm.txt"),
-                                                                              MVy2->getTpetra_MultiVector());
-
-                LinearSolver::getTimers()["create AM^{-1}"].stop();
-            }
-
-            if (blockedMatrix && blockedStatusTest)
-            {
-                typedef Belos::StatusTestGenResSubNorm<belos_scalar, MV, OP> blockStatusTestClass;
-                typedef Belos::StatusTestWeightedGenResNorm<belos_scalar, MV, OP> weightedStatusTestClass;
-                typedef Belos::StatusTestCombo<belos_scalar, MV, OP> StatusTestComboClass;
-
-                magnitude_type GMRES_tol_x = solverList->get("Ensemble Convergence Tolerance: x", 1E-08);
-                magnitude_type GMRES_tol_T = solverList->get("Ensemble Convergence Tolerance: T", 1E-08);
-                magnitude_type GMRES_tol_w = solverList->get("Ensemble Convergence Tolerance: weights", 1E-08);
-
-                bool x_rel = solverList->get("Ensemble Convergence Tolerance: x - relative", true);
-                bool x_rel_full_rhs = solverList->get("Ensemble Convergence Tolerance: x - relative full rhs", false);
-                bool T_rel = solverList->get("Ensemble Convergence Tolerance: T - relative", true);
-                bool T_rel_full_rhs = solverList->get("Ensemble Convergence Tolerance: T - relative full rhs", false);
-
-                bool weightStatusTest = solverList->get("Use weighted status test", false);
-                bool w_rel = solverList->get("Ensemble Convergence Tolerance: weights - relative", true);
-
-                RCP<blockStatusTestClass> blockStatusTest_T = Teuchos::rcp(new blockStatusTestClass(GMRES_tol_T, 0));
-                RCP<blockStatusTestClass> blockStatusTest_x = Teuchos::rcp(new blockStatusTestClass(GMRES_tol_x, 1));
-                RCP<weightedStatusTestClass> weightedStatusTest = Teuchos::rcp(new weightedStatusTestClass(GMRES_tol_w, weightsMV));
-
-                if (x_rel && x_rel_full_rhs)
-                    blockStatusTest_x->defineScaleForm(Belos::NormOfFullInitRes, Belos::TwoNorm);
-                else if (!x_rel)
-                    blockStatusTest_x->defineScaleForm(Belos::None, Belos::TwoNorm);
-                if (T_rel && T_rel_full_rhs)
-                    blockStatusTest_T->defineScaleForm(Belos::NormOfFullInitRes, Belos::TwoNorm);
-                else if (!T_rel)
-                    blockStatusTest_T->defineScaleForm(Belos::None, Belos::TwoNorm);
-                if (!w_rel)
-                    weightedStatusTest->defineScaleForm(Belos::None, Belos::TwoNorm);
-
-                RCP<StatusTestComboClass> statusTestCombo = Teuchos::rcp(new StatusTestComboClass(StatusTestComboClass::SEQ));
-
-                if (blockedStatusTest_T)
-                    statusTestCombo->addStatusTest(blockStatusTest_T);
-                if (blockedStatusTest_x)
-                    statusTestCombo->addStatusTest(blockStatusTest_x);
-                if (weightStatusTest)
-                    statusTestCombo->addStatusTest(weightedStatusTest);
-
-                blinsolver->setUserConvStatusTest(statusTestCombo);
-            }
-            out << "--------- Belos start" << endl;
-            blinsolver->solve();
-            out << "--------- Belos stop" << endl;
-
-            if (contactProblem)
-            {
-                RCP<tpetra_mvector_type> mxx =
-                    (Teuchos::rcp_dynamic_cast<xpetra_tmvector_type>(discreteProblem->algebraic->vectors->solutionMultiVector))->getTpetra_MultiVector();
-                xx = mxx->getVectorNonConst(0);
-
-                if (write_intermediate_files)
-                {
-                    LinearSolver::getTimers()["solver"].stop();
-                    LinearSolver::getTimers()["write results"].start();
-
-                    std::string name_5 = "x_sol" + std::to_string(active_set_iteration) + ".txt";
-                    Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string(name_5), xx);
-                    LinearSolver::getTimers()["write results"].stop();
-                    LinearSolver::getTimers()["solver"].start();
-                }
-
-                xPost->doImport(*xx, *importOutput, Tpetra::INSERT);
-            }
-            else
-            {
-                xPost->doImport(*(discreteProblem->algebraic->vectors->x), *importOutput, Tpetra::INSERT);
-            }
-            ++active_set_iteration;
-
-            if (write_intermediate_files)
-            {
-                LinearSolver::getTimers()["solver"].stop();
-                LinearSolver::getTimers()["write results"].start();
-                if (write_txt_files)
-                {
-                    xPost2->doExport(*(xPost), *exportOutput, Tpetra::INSERT);
-                    Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("x_mm.txt"), xPost2);
-                }
-                if (write_vtk_files)
-                {
-                    this->writeResults<scalar>(xPost, numNodes, name_x, active_set_iteration,
-                                               false, false, discreteProblem->algebraic->map,
-                                               discreteProblem->domain->random_field);
-                }
-                LinearSolver::getTimers()["write results"].stop();
-                LinearSolver::getTimers()["solver"].start();
-            }
-
-            Mask<scalar> hasConverged;
-            const size_t ensemble_size = hasConverged.getSize();
-
-            for (size_t l = 0; l < ensemble_size; ++l)
-                hasConverged.set(l, true);
-
-            if (active_set_iteration == max_active_set_iteration)
-            {
-                if (contactProblem)
-                {
-                    LinearSolver::getTimers()["update"].start();
-                    hasConverged = discreteProblem->updateActivity(active_set_iteration);
-                    LinearSolver::getTimers()["update"].stop();
-
-                    if (MaskLogic::AND(hasConverged) == false)
-                    {
-                        out << "---------------------------------------------------------" << std::endl;
-                        out << "---Has not converged before reaching maximum iteration---" << std::endl;
-                        out << "---------------------------------------------------------" << std::endl;
-                    }
-                }
-                break;
-            }
-            else if (contactProblem)
-            {
-                LinearSolver::getTimers()["update"].start();
-                hasConverged = discreteProblem->updateActivity(active_set_iteration);
-                LinearSolver::getTimers()["update"].stop();
-            }
-            if (MaskLogic::AND(hasConverged))
-                break;
-            else
-            {
-#ifndef HAVE_STOKHOS_ENSEMBLE_REDUCT
-                mask_assign(hasConverged, GMRES_tol) = {1., GMRES_tol};
-                solverList->set("Convergence Tolerance", GMRES_tol);
-#else
-                ;
-#endif
-            }
-        }
-
-        LinearSolver::getTimers()["solver"].stop();
-
-        LinearSolver::getTimers()["write results"].start();
-        if (write_txt_files)
-        {
-            xPost2->doExport(*(xPost), *exportOutput, Tpetra::INSERT);
-            Tpetra::MatrixMarket::Writer<tpetra_crs_type>::writeDenseFile(std::string("x_mm.txt"), xPost2);
-        }
-        if (write_vtk_files)
-        {
-            this->writeResults<scalar>(xPost, numNodes, name_x, active_set_iteration, true, false,
-                                       discreteProblem->algebraic->map, discreteProblem->domain->random_field);
-        }
-        LinearSolver::getTimers()["write results"].stop();
-        // ------------------------------------------
-        //
-        //        End of the timers and print
-        //
-        // ------------------------------------------
-        LinearSolver::getTimers()["total"].stop();
-
-        discreteProblem->domain->elementsList = Teuchos::null;
-        discreteProblem->domain->nodesList = Teuchos::null;
-        discreteProblem->domain->materialsList = Teuchos::null;
-        discreteProblem->domain->contactsList = Teuchos::null;
-        discreteProblem->domain->random_field = Teuchos::null;
-        discreteProblem->domain->~Domain();
-        discreteProblem = Teuchos::null;
-
-        double time_mat_vec_sec = time_mat_vec->totalElapsedTime();
-        double time_prec_setup_sec = time_prec_setup->totalElapsedTime();
-        double time_prec_apply_sec = time_prec_apply->totalElapsedTime();
-        double time_ortho_sec = time_ortho->totalElapsedTime();
-
-        double time_belos_total_sec = time_belos_total->totalElapsedTime();
-
-        double time_ortho_inner_sec = time_ortho_inner->totalElapsedTime();
-        double time_ortho_norm_sec = time_ortho_norm->totalElapsedTime();
-        double time_ortho_update_sec = time_ortho_update->totalElapsedTime();
-
-        static clock_t freq = CLOCKS_PER_SEC;
-
-        UnixClockTime zero_time = UnixClockTime(0);
-        UnixClockTime time_mat_vec_time = UnixClockTime(time_mat_vec_sec * static_cast<double>(freq) / 10000);
-        UnixClockTime time_prec_setup_time = UnixClockTime(time_prec_setup_sec * static_cast<double>(freq) / 10000);
-        UnixClockTime time_prec_apply_time = UnixClockTime(time_prec_apply_sec * static_cast<double>(freq) / 10000);
-        UnixClockTime time_ortho_time = UnixClockTime(time_ortho_sec * static_cast<double>(freq) / 10000);
-        UnixClockTime time_ortho_inner_time = UnixClockTime(time_ortho_inner_sec * static_cast<double>(freq) / 10000);
-        UnixClockTime time_ortho_norm_time = UnixClockTime(time_ortho_norm_sec * static_cast<double>(freq) / 10000);
-        UnixClockTime time_ortho_update_time = UnixClockTime(time_ortho_update_sec * static_cast<double>(freq) / 10000);
-
-        UnixClockTime time_belos_total_time = UnixClockTime(time_belos_total_sec * static_cast<double>(freq) / 10000);
-
-        Times time_mat_vec_times, time_prec_setup_times, time_prec_apply_times, time_ortho_times,
-            time_ortho_inner_times, time_ortho_norm_times, time_ortho_update_times;
-        Times zero_times;
-
-        Times time_belos_total_times;
-
-        time_mat_vec_times.setUser(zero_time);
-        time_mat_vec_times.setReal(time_mat_vec_time);
-        time_mat_vec_times.setKernel(zero_time);
-
-        time_prec_setup_times.setUser(zero_time);
-        time_prec_setup_times.setReal(time_prec_setup_time);
-        time_prec_setup_times.setKernel(zero_time);
-
-        time_prec_apply_times.setUser(zero_time);
-        time_prec_apply_times.setReal(time_prec_apply_time);
-        time_prec_apply_times.setKernel(zero_time);
-
-        time_ortho_times.setUser(zero_time);
-        time_ortho_times.setReal(time_ortho_time);
-        time_ortho_times.setKernel(zero_time);
-
-        time_ortho_inner_times.setUser(zero_time);
-        time_ortho_inner_times.setReal(time_ortho_inner_time);
-        time_ortho_inner_times.setKernel(zero_time);
-
-        time_ortho_norm_times.setUser(zero_time);
-        time_ortho_norm_times.setReal(time_ortho_norm_time);
-        time_ortho_norm_times.setKernel(zero_time);
-
-        time_ortho_update_times.setUser(zero_time);
-        time_ortho_update_times.setReal(time_ortho_update_time);
-        time_ortho_update_times.setKernel(zero_time);
-
-        zero_times.setUser(zero_time);
-        zero_times.setReal(zero_time);
-        zero_times.setKernel(zero_time);
-
-        time_belos_total_times.setUser(zero_time);
-        time_belos_total_times.setReal(time_belos_total_time);
-        time_belos_total_times.setKernel(zero_time);
-
-        LinearSolver::getTimers()["time_belos_total"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_belos_total"].setTElaps(time_belos_total_times);
-
-        LinearSolver::getTimers()["time_mat_vec"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_mat_vec"].setTElaps(time_mat_vec_times);
-
-        LinearSolver::getTimers()["time_prec_setup"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_prec_setup"].setTElaps(time_prec_setup_times);
-
-        LinearSolver::getTimers()["time_prec_apply"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_prec_apply"].setTElaps(time_prec_apply_times);
-
-        LinearSolver::getTimers()["time_ortho"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_ortho"].setTElaps(time_ortho_times);
-
-        LinearSolver::getTimers()["time_ortho_inner"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_ortho_inner"].setTElaps(time_ortho_inner_times);
-
-        LinearSolver::getTimers()["time_ortho_norm"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_ortho_norm"].setTElaps(time_ortho_norm_times);
-
-        LinearSolver::getTimers()["time_ortho_update"].setTStart(zero_times);
-        LinearSolver::getTimers()["time_ortho_update"].setTElaps(time_ortho_update_times);
-
-        out << "\n---CPU statistics of proc " << myRank << "---\n";
-        out << LinearSolver::getTimers();
-        out << "---------------------------\n";
-
-        bool print_teuchos_timers = solverList->get("Print Teuchos timers", false);
-        if (print_teuchos_timers)
-        {
-            std::streambuf *psbuf, *backup;
-            std::ofstream filestr;
-            filestr.open("teuchos_timers.txt");
-
-            backup = std::cout.rdbuf(); // back up cout's streambuf
-
-            psbuf = filestr.rdbuf(); // get file's streambuf
-            std::cout.rdbuf(psbuf);  // assign streambuf to cout
-
-            Teuchos::TimeMonitor::summarize();
-
-            std::cout.rdbuf(backup); // restore cout's original streambuf
-
-            filestr.close();
-        }
-
-        Teuchos::TimeMonitor::zeroOutTimers();
-    }
-}
diff --git a/katoptron/src/IterativeSolver.h b/katoptron/src/IterativeSolver.h
deleted file mode 100644
index 57e1df273f3132edb59f444a3b911f0aedea2f8a..0000000000000000000000000000000000000000
--- a/katoptron/src/IterativeSolver.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef KATOPTRON_ITERATIVESOLVER_H
-#define KATOPTRON_ITERATIVESOLVER_H
-
-#include "katoptron.h"
-#include "wObject.h"
-#include "wTimer.h"
-#include "wTimers.h"
-#include "Teuchos_ParameterList.hpp"
-
-#include "LinearSolver.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Solver class where the active set strategy is implemented.
- */
-class KATOPTRON_API IterativeSolver : public LinearSolver
-{
-public:
-    IterativeSolver(Problem &pbl, Teuchos::RCP<Teuchos::ParameterList> solverList,
-                    int numPrimalDPN = 3,
-                    size_t minimum_ensemble_size = 1)
-        : LinearSolver(pbl, solverList, numPrimalDPN, minimum_ensemble_size){};
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-    void start();
-
-private:
-    template <typename scalar>
-    void tstart();
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_ITERATIVESOLVER_H
diff --git a/katoptron/src/Kokkos_Init.h b/katoptron/src/Kokkos_Init.h
deleted file mode 100644
index 70164ab00d9f72ba96b341d37086108ae697f9f9..0000000000000000000000000000000000000000
--- a/katoptron/src/Kokkos_Init.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef KATOPTRON_KOKKOSINIT_H
-#define KATOPTRON_KOKKOSINIT_H
-
-#include <Kokkos_Core.hpp>
-
-void Kokkos_Initialize(int nThreads)
-{
-#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
-    Kokkos::OpenMP::initialize(nThreads);
-#else
-    Kokkos::OpenMP::impl_initialize(nThreads);
-#endif
-}
-
-void Kokkos_Finalize()
-{
-    Kokkos::finalize();
-}
-
-#endif //KATOPTRON_KOKKOSINIT_H
\ No newline at end of file
diff --git a/katoptron/src/LinearSolver.h b/katoptron/src/LinearSolver.h
deleted file mode 100644
index 0fe02a2f7abee9daca881b2a74049d7a73ee7e48..0000000000000000000000000000000000000000
--- a/katoptron/src/LinearSolver.h
+++ /dev/null
@@ -1,162 +0,0 @@
-#ifndef KATOPTRON_LINEARSOLVER_H
-#define KATOPTRON_LINEARSOLVER_H
-
-#include "katoptron.h"
-#include "wObject.h"
-#include "wTimer.h"
-#include "wTimers.h"
-#include "wTag.h"
-#include "wMedium.h"
-#include "wNode.h"
-
-#include "Teuchos_ParameterList.hpp"
-
-#include "wProblem.h"
-#include "wContact.h"
-#include "wMshData.h"
-#include "wDisplayHook.h"
-#include "wElement.h"
-
-// Tpetra
-#include "Stokhos_Tpetra_MP_Vector.hpp"
-#include "Stokhos_Tpetra_Utilities_MP_Vector.hpp"
-#include "Tpetra_ConfigDefs.hpp"
-#include "Tpetra_Map.hpp"
-#include "Tpetra_MultiVector.hpp"
-#include "Tpetra_Vector.hpp"
-#include "Tpetra_CrsGraph.hpp"
-#include "Tpetra_CrsMatrix.hpp"
-#include "Stokhos_Tpetra_CG.hpp"
-
-#include <Teuchos_Array.hpp>
-#include <Teuchos_GlobalMPISession.hpp>
-#include <Teuchos_oblackholestream.hpp>
-#include <Teuchos_ScalarTraits.hpp>
-#include <Teuchos_RCP.hpp>
-#include "Teuchos_ParameterList.hpp"
-
-#include "Stokhos_Amesos2_MP_Vector.hpp"
-#include "Amesos2_Factory.hpp"
-
-#include "Stokhos_Ifpack2_MP_Vector.hpp"
-#include "Ifpack2_Factory.hpp"
-
-#include "Belos_Tpetra_MP_Vector.hpp"
-#include "BelosLinearProblem.hpp"
-#include "BelosPseudoBlockGmresSolMgr.hpp"
-#include "BelosPseudoBlockCGSolMgr.hpp"
-#include "BelosBlockGmresSolMgr.hpp"
-
-#include "Kokkos_ViewFactory.hpp"
-#include "Kokkos_Vector.hpp"
-
-#include <Epetra_Map.h>
-#include "Epetra_MpiComm.h"
-
-#include "BelosConfigDefs.hpp"
-
-#include "wRandomField.h"
-
-#include "wResults.h"
-#include "wLazy.h"
-#include "Map.h"
-
-#include <map>
-
-#include <limits>
-
-#include "EnsembleTraits.h"
-
-#include "ResultsDecl.hpp"
-
-namespace katoptron
-{
-
-/**
- * @brief Solver class which includes utilities such as timers and VTK writers.
- */
-class KATOPTRON_API LinearSolver
-{
-public:
-#ifndef SWIG
-    Problem &pbl;
-#endif
-    Teuchos::RCP<Teuchos::ParameterList> solverList;
-    const int numPrimalDPN;
-    const size_t minimum_ensemble_size;
-    size_t active_set_iteration;
-#ifndef SWIG
-    DisplayHook *dhook;
-
-#endif
-public:
-    /**
-     * @brief LinearSolver constructor
-     *
-     * Arguments:
-     * <ul>
-     *  <li> _pbl: A Problem object,
-     *  <li> _solverList: an RCP to a ParameterList object which describes the solver,
-     *  <li> _numPrimalDPN: the number of degrees of freedom per node (without taking into account the Lagrange multipliers),
-     *  <li> _minimum_ensemble_size: the used ensemble size (1, 8, 16, 24, or 32),
-     * </ul>
-     */
-    LinearSolver(Problem &_pbl, Teuchos::RCP<Teuchos::ParameterList> _solverList,
-                 int _numPrimalDPN,
-                 size_t _minimum_ensemble_size) : pbl(_pbl),
-                                                  solverList(_solverList),
-                                                  numPrimalDPN(_numPrimalDPN),
-                                                  minimum_ensemble_size(_minimum_ensemble_size)
-    {
-        dhook = NULL;
-    }
-
-    virtual ~LinearSolver() {}
-
-    /**
-    * @brief Manage timers.
-    */
-    static fwk::Timers &getTimers()
-    {
-        static fwk::Timers tms;
-        return tms;
-    }
-
-    /**
-     * @brief Set the GUI.
-     */
-    void setGUI(DisplayHook &hook)
-    {
-        dhook = &hook;
-    }
-
-protected:
-    /**
-     * @brief Write results on disk in VTK format.
-     */
-    template <typename scalar>
-    void writeResults(
-        Teuchos::RCP<Tpetra::Vector<scalar, Map::local_ordinal_type, Map::global_ordinal_type>> xPost,
-        size_t numNodes,
-        std::string name,
-        size_t ast,
-        bool final_result,
-        bool write_txt,
-        Teuchos::RCP<Map> map,
-        Teuchos::RCP<RandomField<scalar, Kokkos::DefaultExecutionSpace>> random_field)
-    {
-        LinearSolver::getTimers()["write results"].start();
-
-        typedef Map::local_ordinal_type LocalOrdinal;
-        typedef Map::global_ordinal_type GlobalOrdinal;
-
-        writeResultsVTK<scalar, LocalOrdinal, GlobalOrdinal>(pbl, xPost, map,
-                                                             random_field,
-                                                             name, ast, final_result, write_txt);
-
-        LinearSolver::getTimers()["write results"].stop();
-    }
-};
-} // namespace katoptron
-
-#endif //KATOPTRON_LINEARSOLVER_H
diff --git a/katoptron/src/Loads.h b/katoptron/src/Loads.h
deleted file mode 100644
index aa8ab46d84209cb4fa2a101d7cc4abc4331f5d92..0000000000000000000000000000000000000000
--- a/katoptron/src/Loads.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef KATOPTRON_LOADS_H
-#define KATOPTRON_LOADS_H
-
-#include "katoptron.h"
-#include "Map.h"
-#include "Domain.h"
-#include "DirichletList.h"
-#include "NeumannList.h"
-#include "SourcesList.h"
-#include "ElementsList.h"
-#include "PreloadList.h"
-#include "WeightsList.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Class which includes all the loads, boundary conditions, preloads, and weights.
- */
-template <typename scalar>
-class Loads
-{
-public:
-    Teuchos::RCP<DirichletList<scalar>> dirichletList;
-    Teuchos::RCP<NeumannList<scalar>> neumannList;
-    Teuchos::RCP<SourcesList<scalar>> sourcesList;
-    Teuchos::RCP<PreloadList<scalar>> preloadList;
-    Teuchos::RCP<WeightsList<scalar>> weightsList;
-
-    Loads();
-    Loads(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<Domain<scalar>> domain);
-};
-
-/**
- * @brief Loads constructor
- * 
- * This constructor initializes the lists of Dirichlet BC, Neumann BC, sources, preloads, and weights.
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: A Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> domain: an RCP to a Domain object.
- * </ul>
- */
-template <typename scalar>
-Loads<scalar>::Loads(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<Domain<scalar>> domain)
-{
-    dirichletList = Teuchos::rcp(new DirichletList<scalar>(pbl, map, domain->elementsList));
-    neumannList = Teuchos::rcp(new NeumannList<scalar>(pbl, map, domain->elementsList));
-    sourcesList = Teuchos::rcp(new SourcesList<scalar>(pbl, map, domain->elementsList));
-    preloadList = Teuchos::rcp(new PreloadList<scalar>(pbl, map, domain->elementsList));
-    weightsList = Teuchos::rcp(new WeightsList<scalar>(pbl, map, domain->elementsList));
-}
-
-}; // namespace katoptron
-
-#endif //KATOPTRON_LOADS_H
diff --git a/katoptron/src/Map.cpp b/katoptron/src/Map.cpp
deleted file mode 100644
index 50321d349d9bafebbb1fae746b39b982b26130f8..0000000000000000000000000000000000000000
--- a/katoptron/src/Map.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-#include "Map.h"
-
-#include "wProblem.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wGroup.h"
-#include "wTag.h"
-
-#include <mpi.h>
-
-#include "wContact.h"
-
-#include <Teuchos_Array.hpp>
-
-using namespace katoptron;
-using namespace tbox;
-
-void std_vector_intersection(std::vector<Map::global_ordinal_type> vec1,
-                             std::vector<int> vec2, std::vector<int> &vec3)
-{
-    std::sort(vec2.begin(), vec2.end());
-    for (auto i = 0; i < vec1.size(); ++i)
-    {
-        if (std::find(vec2.begin(), vec2.end(), vec1[i]) != vec2.end())
-            vec3.push_back(vec1[i]);
-    }
-}
-
-/**
- * @brief Map constructor
- * 
- * This constructor initializes the maps used to describe the distributed matrices and vectors.
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: A Problem object,
- *  <li> numPrimalDPN: the number of degrees of freedom per node (without taking into account the Lagrange multipliers).
- * </ul>
- */
-Map::Map(Problem &pbl, size_t _numPrimalDPN)
-{
-    using Teuchos::Array;
-    using Teuchos::ArrayRCP;
-    using Teuchos::ArrayView;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    numPrimalDPN = _numPrimalDPN;
-
-    RCP<const Teuchos::Comm<int>> comm = rcp(new Teuchos::MpiComm<int>(pbl.comm));
-
-    const size_t myRank = comm->getRank();
-    const size_t numtasks = comm->getSize();
-
-    auto msh = pbl.msh;
-
-    const Tpetra::global_size_t numNodes = msh->nodes.size();
-    const Tpetra::global_size_t numPrimalDOFs = numNodes * numPrimalDPN;
-    const Tpetra::global_size_t numThermalDOFs = numNodes;
-    const Tpetra::global_size_t numMechanicalDOFs = numNodes * 3;
-
-    // ------------------------------------------------------------- //
-    //                     Node and elements maps
-    // ------------------------------------------------------------- //
-
-    // Nodes map with overlaps
-    // Create a map which associates to each mpi process the nodes included
-    // in their elements partition. This map has overlaps associated to the
-    // interfaces of the partitions.
-    std::vector<global_ordinal_type> myNodesWO1 = {};
-    std::vector<global_ordinal_type> myNodesWO2 = {};
-    std::vector<global_ordinal_type> tmpMyNodesWO1 = {};
-    std::vector<global_ordinal_type> tmpMyNodesWO2 = {};
-    std::vector<global_ordinal_type> myElems = {};
-
-    if (numtasks == 1)
-    {
-        for (auto e : msh->elems)
-            if (e->type() != ElType::POINT1)
-                myElems.push_back(e->no - 1);
-
-        for (auto n : msh->nodes)
-        {
-            myNodesWO1.push_back(n->row);
-            myNodesWO2.push_back(n->row);
-        }
-    }
-    else
-    {
-        for (auto const &p : msh->parts)
-        {
-            if (p.second->no == (myRank + 1))
-            {
-                for (auto e : p.second->elems)
-                {
-                    if (e->type() == ElType::HEX8 || e->type() == ElType::TETRA4)
-                        for (auto n1 : e->nodes)
-                        {
-                            tmpMyNodesWO1.push_back(n1->row);
-                            tmpMyNodesWO2.push_back(n1->row);
-                        }
-                    if (e->type() != ElType::POINT1)
-                        myElems.push_back(e->no - 1);
-                }
-            }
-            else if (p.second->no == -(myRank + 1))
-            {
-                for (auto e : p.second->elems)
-                {
-                    if (e->type() == ElType::HEX8 || e->type() == ElType::TETRA4)
-                        for (auto n1 : e->nodes)
-                            tmpMyNodesWO1.push_back(n1->row);
-
-                    if (e->type() != ElType::POINT1)
-                        myElems.push_back(e->no - 1);
-                }
-            }
-        }
-
-        std::sort(tmpMyNodesWO1.begin(), tmpMyNodesWO1.end());
-        std::sort(tmpMyNodesWO2.begin(), tmpMyNodesWO2.end());
-        std::sort(myElems.begin(), myElems.end());
-
-        myNodesWO1.push_back(tmpMyNodesWO1[0]);
-
-        for (auto i = 1; i < tmpMyNodesWO1.size(); ++i)
-            if (tmpMyNodesWO1[i] != tmpMyNodesWO1[i - 1])
-                myNodesWO1.push_back(tmpMyNodesWO1[i]);
-
-        myNodesWO2.push_back(tmpMyNodesWO2[0]);
-
-        for (auto i = 1; i < tmpMyNodesWO2.size(); ++i)
-            if (tmpMyNodesWO2[i] != tmpMyNodesWO2[i - 1])
-                myNodesWO2.push_back(tmpMyNodesWO2[i]);
-    }
-
-    mapNodesWO = rcp(new tpetra_map_type(numNodes, myNodesWO1, indexBase, comm));
-    mapElems = rcp(new tpetra_map_type(Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(), myElems, indexBase, comm));
-
-    // Loop on the contact and remove from myNodesWO2 any nodes included in a contact boundary for which the
-    // current mpi process has no contact element.
-    // This prevent Moertel of not finding the nodes.
-    int contacts_number = pbl.Contacts.size();
-    if (numtasks != 1)
-        for (auto i = 0; i < contacts_number; ++i)
-        {
-            {
-                std::vector<int> v3;
-                std_vector_intersection(myNodesWO2, pbl.Contacts[i]->slave_boundary_nodes, v3);
-                for (auto j = 0; j < pbl.Contacts[i]->slave_elems.size(); ++j)
-                    for (auto jj = 0; jj < pbl.Contacts[i]->slave_elems[j]->nodes.size(); ++jj)
-                    {
-                        auto no = pbl.Contacts[i]->slave_elems[j]->nodes[jj]->row;
-
-                        auto p = std::find(v3.begin(), v3.end(), no);
-                        if (p != v3.end())
-                        {
-                            v3.erase(p);
-                        }
-                    }
-
-                for (auto j = 0; j < v3.size(); ++j)
-                {
-                    auto p = std::find(myNodesWO2.begin(), myNodesWO2.end(), v3[j]);
-                    if (p != myNodesWO2.end())
-                    {
-                        myNodesWO2.erase(p);
-                    }
-                }
-            }
-            {
-                std::vector<int> v3;
-                std_vector_intersection(myNodesWO2, pbl.Contacts[i]->master_boundary_nodes, v3);
-
-                for (auto j = 0; j < pbl.Contacts[i]->master_elems.size(); ++j)
-                    for (auto jj = 0; jj < pbl.Contacts[i]->master_elems[j]->nodes.size(); ++jj)
-                    {
-                        auto no = pbl.Contacts[i]->master_elems[j]->nodes[jj]->row;
-                        auto p = std::find(v3.begin(), v3.end(), no);
-                        if (p != v3.end())
-                        {
-                            v3.erase(p);
-                        }
-                    }
-                for (auto j = 0; j < v3.size(); ++j)
-                {
-                    auto p = std::find(myNodesWO2.begin(), myNodesWO2.end(), v3[j]);
-                    if (p != myNodesWO2.end())
-                    {
-                        myNodesWO2.erase(p);
-                    }
-                }
-            }
-        }
-    RCP<const Tpetra::Map<>> mapNodesWO_contact = rcp(new tpetra_map_type(numNodes, myNodesWO2, indexBase, comm));
-
-    // Create a map of nodes without overlaps. Each node is owned by one and
-    // only mpi process.
-    mapNodes = Tpetra::createOneToOne(mapNodesWO_contact);
-
-    // Create a map of the degrees of fredom associated to the nodes of the
-    // previous map.
-    const size_t numMyNodes = mapNodes->getNodeNumElements();
-    const size_t numMyNodesWO = mapNodesWO->getNodeNumElements();
-    Teuchos::ArrayView<const global_ordinal_type> myNodes = mapNodes->getNodeElementList();
-
-    // ------------------------------------------------------------- //
-    //                          Dofs maps
-    // ------------------------------------------------------------- //
-
-    // Create a map of the degrees of fredom associated to the nodes of the
-    // previous map.
-    Array<global_ordinal_type> myDofsWO(numMyNodesWO * numPrimalDPN);
-    Array<global_ordinal_type> myThermalDofsWO(numMyNodesWO);
-    Array<global_ordinal_type> myMechanicalDofsWO(numMyNodesWO * 3);
-
-    for (auto i = 0; i < numMyNodesWO; ++i)
-    {
-        if (numPrimalDPN == 4)
-        {
-            myThermalDofsWO[i] = myNodesWO1[i];
-            myDofsWO[i] = myNodesWO1[i];
-
-            for (auto j = 0; j < 3; ++j)
-            {
-                myDofsWO[numMyNodesWO + 3 * i + j] = 3 * myNodesWO1[i] + j + numNodes;
-                myMechanicalDofsWO[3 * i + j] = 3 * myNodesWO1[i] + j;
-            }
-        }
-        else if (numPrimalDPN == 3)
-        {
-            for (auto j = 0; j < 3; ++j)
-            {
-                myMechanicalDofsWO[3 * i + j] = 3 * myNodesWO1[i] + j;
-                myDofsWO[3 * i + j] = 3 * myNodesWO1[i] + j;
-            }
-        }
-        else if (numPrimalDPN == 1)
-        {
-            myThermalDofsWO[i] = myNodesWO1[i];
-            myDofsWO[i] = myNodesWO1[i];
-        }
-    }
-
-    mapDofsWO = rcp(new tpetra_map_type(numPrimalDOFs, myDofsWO, indexBase, comm));
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-        thermoMapWO = rcp(new tpetra_map_type(numThermalDOFs, myThermalDofsWO, indexBase, comm));
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-        mechaMapWO = rcp(new tpetra_map_type(numMechanicalDOFs, myMechanicalDofsWO, indexBase, comm));
-
-    Array<global_ordinal_type> myDofs(numMyNodes * numPrimalDPN);
-    Array<global_ordinal_type> myThermalDofs(numMyNodes);
-    Array<global_ordinal_type> myMechanicalDofs(numMyNodes * 3);
-    Array<global_ordinal_type> myThermomechanicalDofs(numMyNodes * numPrimalDPN);
-
-    for (auto i = 0; i < numMyNodes; ++i)
-    {
-        if (numPrimalDPN == 4)
-        {
-            myThermalDofs[i] = myNodes[i];
-            myDofs[i] = myNodes[i];
-
-            for (auto j = 0; j < 3; ++j)
-            {
-                myMechanicalDofs[3 * i + j] = 3 * myNodes[i] + j;
-                myDofs[numMyNodes + 3 * i + j] = 3 * myNodes[i] + j + numNodes;
-            }
-        }
-        else if (numPrimalDPN == 3)
-        {
-            for (auto j = 0; j < 3; ++j)
-            {
-                myMechanicalDofs[3 * i + j] = 3 * myNodes[i] + j;
-                myDofs[3 * i + j] = 3 * myNodes[i] + j;
-            }
-        }
-        else if (numPrimalDPN == 1)
-        {
-            myThermalDofs[i] = myNodes[i];
-            myDofs[i] = myNodes[i];
-        }
-    }
-
-    mapDofs = rcp(new tpetra_map_type(numPrimalDOFs, myDofs, indexBase, comm));
-    if (numPrimalDPN == 4 || numPrimalDPN == 1)
-        thermoMap = rcp(new tpetra_map_type(numThermalDOFs, myThermalDofs, indexBase, comm));
-    if (numPrimalDPN == 4 || numPrimalDPN == 3)
-        mechaMap = rcp(new tpetra_map_type(numMechanicalDOFs, myMechanicalDofs, indexBase, comm));
-
-    if (numPrimalDPN == 4)
-    {
-        thermoMap = rcp(new tpetra_map_type(numThermalDOFs, myThermalDofs, indexBase, comm));
-        mechaMap = rcp(new tpetra_map_type(numMechanicalDOFs, myMechanicalDofs, indexBase, comm));
-
-        thermomecFullmap = rcp(new tpetra_map_type(numPrimalDOFs, myThermomechanicalDofs, indexBase, comm));
-        RCP<xpetra_map_type> xthermomecFullmap = rcp(new xpetra_tmap_type(thermomecFullmap));
-        std::vector<RCP<const xpetra_map_type>> xsubmaps = {rcp(new xpetra_tmap_type(thermoMap)),
-                                                            rcp(new xpetra_tmap_type(mechaMap))};
-
-        thermomecBlockedMap = rcp(new xpetra_bmap_type(xthermomecFullmap, xsubmaps, true));
-    }
-    else if (numPrimalDPN == 3)
-    {
-        mechaMap = rcp(new tpetra_map_type(numMechanicalDOFs, myMechanicalDofs, indexBase, comm));
-
-        thermomecFullmap = rcp(new tpetra_map_type(numPrimalDOFs, myThermomechanicalDofs, indexBase, comm));
-        RCP<xpetra_map_type> xthermomecFullmap = rcp(new xpetra_tmap_type(thermomecFullmap));
-        std::vector<RCP<const xpetra_map_type>> xsubmaps = {rcp(new xpetra_tmap_type(mechaMap))};
-
-        thermomecBlockedMap = rcp(new xpetra_bmap_type(xthermomecFullmap, xsubmaps, true));
-    }
-    else
-    {
-        thermoMap = rcp(new tpetra_map_type(numThermalDOFs, myThermalDofs, indexBase, comm));
-
-        thermomecFullmap = rcp(new tpetra_map_type(numPrimalDOFs, myThermomechanicalDofs, indexBase, comm));
-        RCP<xpetra_map_type> xthermomecFullmap = rcp(new xpetra_tmap_type(thermomecFullmap));
-        std::vector<RCP<const xpetra_map_type>> xsubmaps = {rcp(new xpetra_tmap_type(thermoMap))};
-
-        thermomecBlockedMap = rcp(new xpetra_bmap_type(xthermomecFullmap, xsubmaps, true));
-    }
-
-    // Construct a Map that puts all the equations on processor 0 (for outputs).
-    const size_t numLclIndices = (myRank == 0) ? numPrimalDOFs : 0;
-
-    mapOutput = rcp(new tpetra_map_type(numPrimalDOFs, numLclIndices, indexBase, comm));
-}
\ No newline at end of file
diff --git a/katoptron/src/Map.h b/katoptron/src/Map.h
deleted file mode 100644
index 39e95abedbf00ffa9c624ead0cced60768cded11..0000000000000000000000000000000000000000
--- a/katoptron/src/Map.h
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef KATOPTRON_MAP_H
-#define KATOPTRON_MAP_H
-
-#include "katoptron.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-
-#include <Xpetra_Map.hpp>
-#include <Xpetra_TpetraMap.hpp>
-#include <Xpetra_BlockedMap.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which includes all the Trilinos maps (Tpetra maps and Xpetra maps) used
- * in the simulation.
- */
-class Map
-{
-public:
-    //
-    // Convenience typedefs
-    //
-    typedef int local_ordinal_type;
-    typedef int global_ordinal_type;
-    typedef KokkosClassic::DefaultNode::DefaultNodeType node_type;
-    typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> tpetra_map_type;
-    typedef Xpetra::Map<local_ordinal_type, global_ordinal_type, node_type> xpetra_map_type;
-    typedef Xpetra::TpetraMap<local_ordinal_type, global_ordinal_type, node_type> xpetra_tmap_type;
-    typedef Xpetra::BlockedMap<local_ordinal_type, global_ordinal_type, node_type> xpetra_bmap_type;
-
-    Teuchos::RCP<const tpetra_map_type> mapNodesWO;
-    Teuchos::RCP<const tpetra_map_type> mapNodes;
-    Teuchos::RCP<const tpetra_map_type> mapElems;
-    Teuchos::RCP<const tpetra_map_type> mapDofsWO;
-    Teuchos::RCP<const tpetra_map_type> mapDofs;
-    Teuchos::RCP<const tpetra_map_type> mapOutput;
-    Teuchos::RCP<const tpetra_map_type> mapLagrangeDofs;
-    Teuchos::RCP<const tpetra_map_type> fullmap;
-    Teuchos::RCP<const tpetra_map_type> fullmapWO;
-    Teuchos::RCP<const tpetra_map_type> fullmapOutput;
-
-    Teuchos::RCP<const tpetra_map_type> thermoMap;
-    Teuchos::RCP<const tpetra_map_type> mechaMap;
-
-    Teuchos::RCP<const tpetra_map_type> thermoMapWO;
-    Teuchos::RCP<const tpetra_map_type> mechaMapWO;
-
-    Teuchos::RCP<const tpetra_map_type> thermomecFullmap;
-    Teuchos::RCP<const tpetra_map_type> thermomecFullmapWO;
-
-    Teuchos::RCP<const xpetra_bmap_type> thermomecBlockedMap;
-
-    Teuchos::RCP<const xpetra_bmap_type> blockedMap;
-
-    std::map<int, int> lm_to_dof;        //to change
-    std::map<int, int> lm_to_dof_global; //to change
-    std::map<int, int> lagrange_to_dof;
-    std::map<int, int> dof_to_lm;
-
-    const global_ordinal_type indexBase = 0;
-    size_t numPrimalDPN;
-    size_t numDualDPN = 1;
-
-    Map(Problem &pbl, size_t _numPrimalDPN);
-};
-
-}; // namespace katoptron
-
-#endif //KATOPTRON_MAP_H
diff --git a/katoptron/src/Material.h b/katoptron/src/Material.h
deleted file mode 100644
index af6b2b183187542fcddd9942eb1e3910afaae43f..0000000000000000000000000000000000000000
--- a/katoptron/src/Material.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef KATOPTRON_MATERIAL_H
-#define KATOPTRON_MATERIAL_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wMedium.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which includes all constitutive values of a given material.
- */
-template <typename scalar>
-class Material
-{
-private:
-    scalar E;
-    scalar nu;
-    scalar k;
-    scalar beta;
-
-public:
-    Material(scalar _E, scalar _nu, scalar _k, scalar _beta);
-
-    /**
-    * @brief Return \f$E\f$
-    */
-    inline scalar getE() { return E; }
-
-    /**
-    * @brief Return \f$\nu\f$
-    */
-    inline scalar getNu() { return nu; }
-
-    /**
-    * @brief Return \f$k\f$
-    */
-    inline scalar getK() { return k; }
-
-    /**
-    * @brief Return \f$\beta\f$
-    */
-    inline scalar getBeta() { return beta; }
-};
-
-/**
- * @brief Material constructor
- * 
- * This constructor creates a new katoptron::Material which store the constitutive parameters.
- * 
- * Arguments:
- * <ul>
- *  <li> _E: the Young modulus \f$E\f$,
- *  <li> _nu: the Poisson coefficient \f$\nu\f$,
- *  <li> _k: the heat conductivity \f$k\f$,
- *  <li> _beta: the coefficient of thermal expansion \f$\beta\f$.
- * </ul>
- */
-template <typename scalar>
-Material<scalar>::Material(scalar _E, scalar _nu, scalar _k, scalar _beta) : E(_E), nu(_nu), k(_k), beta(_beta)
-{
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_MATERIAL_H
diff --git a/katoptron/src/MaterialsList.h b/katoptron/src/MaterialsList.h
deleted file mode 100644
index 4ca101081873bed2a4bd0fbf76a87c5c00d97645..0000000000000000000000000000000000000000
--- a/katoptron/src/MaterialsList.h
+++ /dev/null
@@ -1,170 +0,0 @@
-#ifndef KATOPTRON_MATERIALSLIST_H
-#define KATOPTRON_MATERIALSLIST_H
-
-#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp"
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wMshData.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wMedium.h"
-
-#include "Material.h"
-
-#include <Kokkos_Core.hpp>
-//#include "Sacado.hpp"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-#include <vector>
-
-#include "EnsembleTraits.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Class which stores the list of the used materials.
- */
-template <typename scalar>
-class MaterialsList
-{
-private:
-    Kokkos::View<scalar ***, Kokkos::LayoutRight> materials;
-
-    Map::local_ordinal_type materials_number;
-
-public:
-    Map::local_ordinal_type materials_T;
-    Map::local_ordinal_type materials_E;
-    Map::local_ordinal_type materials_nu;
-    Map::local_ordinal_type materials_k;
-    Map::local_ordinal_type materials_beta;
-
-    MaterialsList(Problem &pbl, Teuchos::RCP<Map> map);
-
-    Material<scalar> getMaterial(int current_material, int i_thread);
-};
-
-/**
- * @brief MaterialsList constructor
- * 
- * This constructor allocates 1 Kokkos::View which stores all the constitutive parameters of each material.
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: A Problem object,
- *  <li> map: an RCP to a Map object..
- * </ul>
- */
-template <typename scalar>
-MaterialsList<scalar>::MaterialsList(Problem &pbl, Teuchos::RCP<Map> map)
-{
-    materials_number = pbl.media.size();
-
-    materials_T = 0;
-    materials_E = 1;
-    materials_nu = 2;
-    materials_k = 3;
-    materials_beta = 4;
-
-    typedef EnsembleTraits<scalar> ET;
-    const int ensemble_size = ET::size;
-
-    materials = Kokkos::View<scalar ***, Kokkos::LayoutRight>("R", materials_number, 1, 5);
-    for (auto i = 0; i < materials_number; ++i)
-    {
-        materials(i, 0, materials_T) = (scalar)0; // !!! needed to be changed latter on !!!
-        for (int j = 0; j < ensemble_size; ++j)
-        {
-            ET::coeff(materials(i, 0, materials_E), j) = (double)pbl.media[i]->E_vector[j];
-            ET::coeff(materials(i, 0, materials_nu), j) = (double)pbl.media[i]->nu_vector[j];
-            ET::coeff(materials(i, 0, materials_k), j) = (double)pbl.media[i]->k_vector[j];
-            ET::coeff(materials(i, 0, materials_beta), j) = (double)pbl.media[i]->beta_vector[j];
-        }
-        materials(i, 0, materials_k) = (scalar)pbl.media[i]->k;
-        materials(i, 0, materials_beta) = (scalar)pbl.media[i]->beta;
-    }
-}
-
-/**
- * @brief Return a Material
- * 
- * Arguments:
- * <ul>
- *  <li> current_material: current material ID,
- *  <li> i_thread: thread ID.
- * </ul>
- */
-template <typename scalar>
-Material<scalar> MaterialsList<scalar>::getMaterial(int current_material, int i_thread)
-{
-    scalar E;
-    scalar nu;
-    scalar k;
-    scalar beta;
-
-    size_t materials_T = 0;
-
-    typedef EnsembleTraits<scalar> ET;
-    const int ensemble_size = ET::size;
-
-    for (int j = 0; j < ensemble_size; ++j)
-    {
-        typename ET::value_type Tj = 0.;
-
-        size_t index_0 = 0;
-        size_t index_1 = materials.extent(1) - 1;
-
-        if (Tj <= ET::coeff(materials(current_material, index_0, materials_T), j))
-        {
-            ET::coeff(E, j) = ET::coeff(materials(current_material, index_0, 1), j);
-            ET::coeff(nu, j) = ET::coeff(materials(current_material, index_0, 2), j);
-            ET::coeff(k, j) = ET::coeff(materials(current_material, index_0, 3), j);
-            ET::coeff(beta, j) = ET::coeff(materials(current_material, index_0, 4), j);
-        }
-        else if (Tj > ET::coeff(materials(current_material, index_1, materials_T), j))
-        {
-            ET::coeff(E, j) = ET::coeff(materials(current_material, index_1, 1), j);
-            ET::coeff(nu, j) = ET::coeff(materials(current_material, index_1, 2), j);
-            ET::coeff(k, j) = ET::coeff(materials(current_material, index_1, 3), j);
-            ET::coeff(beta, j) = ET::coeff(materials(current_material, index_1, 4), j);
-        }
-        else
-        {
-            while (index_1 != index_0 + 1)
-            {
-                size_t index_c = index_0 + (index_1 - index_0) / 2;
-
-                if (Tj == ET::coeff(materials(current_material, index_c, materials_T), j))
-                {
-                    index_1 = index_c;
-                    index_0 = index_1 - 1;
-                }
-                else if (Tj < ET::coeff(materials(current_material, index_c, materials_T), j))
-                    index_1 = index_c;
-                else
-                    index_0 = index_c;
-            }
-
-            double coeff = (Tj - ET::coeff(materials(current_material, index_0, materials_T), j)) / (ET::coeff(materials(current_material, index_1, materials_T), j) - ET::coeff(materials(current_material, index_0, materials_T), j));
-
-            ET::coeff(E, j) = ET::coeff(materials(current_material, index_0, 1), j) + coeff * (ET::coeff(materials(current_material, index_1, 1), j) - ET::coeff(materials(current_material, index_0, 1), j));
-            ET::coeff(nu, j) = ET::coeff(materials(current_material, index_0, 2), j) + coeff * (ET::coeff(materials(current_material, index_1, 2), j) - ET::coeff(materials(current_material, index_0, 2), j));
-            ET::coeff(k, j) = ET::coeff(materials(current_material, index_0, 3), j) + coeff * (ET::coeff(materials(current_material, index_1, 3), j) - ET::coeff(materials(current_material, index_0, 3), j));
-            ET::coeff(beta, j) = ET::coeff(materials(current_material, index_0, 4), j) + coeff * (ET::coeff(materials(current_material, index_1, 4), j) - ET::coeff(materials(current_material, index_0, 4), j));
-        }
-    }
-
-    Material<scalar> material(E, nu, k, beta);
-    return material;
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_MATERIALSLIST_H
diff --git a/katoptron/src/Matrices.h b/katoptron/src/Matrices.h
deleted file mode 100644
index be2936604b006b5fa743748480fc1ff68d4ee621..0000000000000000000000000000000000000000
--- a/katoptron/src/Matrices.h
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef KATOPTRON_MATRICES_H
-#define KATOPTRON_MATRICES_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "Graph.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Tpetra_CrsGraph.hpp>
-#include <Tpetra_CrsMatrix.hpp>
-#include <Teuchos_RCP.hpp>
-
-#include <Xpetra_BlockedMap.hpp>
-#include <Xpetra_BlockedCrsMatrix.hpp>
-#include <Stokhos_MueLu_MP_Vector.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which includes all the Trilinos matrices (Tpetra matrices and Xpetra matrices) used
- * in the simulation.
- * 
- * In the case of the saddle point matrix arising from the Mortar FEM, the block matrix is stored as follows:
- * \f[ 
- *   \begin{bmatrix} \boldsymbol{A} & \boldsymbol{B}_1 \\ \boldsymbol{B}_2 & \boldsymbol{C} \end{bmatrix}. 
- * \f]
- */
-template <typename scalar>
-class Matrices
-{
-    /*
-    2x2 block matrix:
-    ----------------
-
-    *-----*-----*
-    |  A  | B_1 |
-    *-----*-----*
-    | B_2 |  C  |
-    *-----*-----*
-
-    B includes the values of B_2 if the contact is fully closed.
-    B_T includes the values of B_1 if the contact is fully closed.
-    B_G includes the values of B with the M matrix included regardless if we have a Signorini problem or not.
-    */
-public:
-    //
-    // Convenience typedefs
-    //
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-    typedef Map::node_type node_type;
-    typedef Map::tpetra_map_type tpetra_map_type;
-    typedef Map::xpetra_bmap_type xpetra_bmap_type;
-    typedef Tpetra::CrsGraph<local_ordinal_type, global_ordinal_type, node_type> tpetra_graph_type;
-    typedef Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type> tpetra_crs_type;
-
-    typedef Xpetra::Matrix<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_mat_type;
-    typedef Xpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_crs_type;
-    typedef Xpetra::CrsMatrixWrap<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_wcrs_type;
-    typedef Xpetra::BlockedCrsMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_bcrs_type;
-    typedef Xpetra::TpetraCrsMatrix<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_tcrs_type;
-
-    Teuchos::RCP<tpetra_crs_type> K;
-    Teuchos::RCP<tpetra_crs_type> S;
-    Teuchos::RCP<tpetra_crs_type> L;
-    Teuchos::RCP<tpetra_crs_type> B;
-    Teuchos::RCP<tpetra_crs_type> B_T;
-    Teuchos::RCP<tpetra_crs_type> B_1;
-    Teuchos::RCP<tpetra_crs_type> B_2;
-    Teuchos::RCP<tpetra_crs_type> B_G;
-    Teuchos::RCP<tpetra_crs_type> C;
-    Teuchos::RCP<tpetra_crs_type> Cb;
-
-    Teuchos::RCP<xpetra_crs_type> xA;
-    Teuchos::RCP<xpetra_crs_type> xB;
-    Teuchos::RCP<xpetra_crs_type> xB_T;
-    Teuchos::RCP<xpetra_crs_type> xC;
-
-    Teuchos::RCP<xpetra_wcrs_type> xwA;
-    Teuchos::RCP<xpetra_wcrs_type> xwB;
-    Teuchos::RCP<xpetra_wcrs_type> xwB_T;
-    Teuchos::RCP<xpetra_wcrs_type> xwC;
-
-    Teuchos::RCP<xpetra_bcrs_type> blockedMatrix;
-
-    Teuchos::RCP<xpetra_mat_type> A;
-
-    Matrices(Teuchos::RCP<Graph> graph);
-};
-
-/**
- * @brief Matrices constructor
- * 
- * This constructor allocates the memory for the matrix \f$\boldsymbol{A}\f$.
- * The other matrices and the filling of the entries are done later.
- * 
- * Argument:
- * <ul>
- *  <li> graph: an RCP to a Graph object.
- * </ul>
- */
-template <typename scalar>
-Matrices<scalar>::Matrices(Teuchos::RCP<Graph> graph)
-{
-    if (graph->K != Teuchos::null)
-    {
-        K = Teuchos::rcp(new tpetra_crs_type(graph->K));
-        K->fillComplete();
-    }
-    if (graph->S != Teuchos::null)
-    {
-        S = Teuchos::rcp(new tpetra_crs_type(graph->S));
-        S->fillComplete(graph->S->getDomainMap(), graph->S->getRangeMap());
-    }
-    if (graph->L != Teuchos::null)
-    {
-        L = Teuchos::rcp(new tpetra_crs_type(graph->L));
-        L->fillComplete();
-    }
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_MATRICES_H
diff --git a/katoptron/src/Mortar.cpp b/katoptron/src/Mortar.cpp
deleted file mode 100644
index ae171421e7fb2eb88c991e548a5a1e0a313dc248..0000000000000000000000000000000000000000
--- a/katoptron/src/Mortar.cpp
+++ /dev/null
@@ -1,1059 +0,0 @@
-#include "Mortar.h"
-//#include "wElement.h"
-
-#include <MatrixMarket_Tpetra.hpp>
-
-#include "Epetra_MpiComm.h"
-#include "Epetra_SerialComm.h"
-#include "Teuchos_ParameterList.hpp"
-
-// MOERTEL headers
-#include "mrtr_manager.H"
-#include "mrtr_segment_bilinearquad.H"
-#include "mrtr_segment_bilineartri.H"
-
-/**
- * @brief Compute the Mortar matrices using Moertel and returns a Tpetra CrsMatrix
- * with double scalar type.
- */
-Teuchos::RCP<Tpetra::CrsMatrix<>> compute_B(Teuchos::RCP<katoptron::ElementsList> elementsList,
-                                            Teuchos::RCP<katoptron::NodesList> nodesList,
-                                            Teuchos::RCP<katoptron::ContactsList> contactsList,
-                                            Teuchos::RCP<katoptron::Map> map, MPI_Comm comm, bool SignoriniCheck)
-{
-    Epetra_MpiComm Comm(comm);
-    Teuchos::RCP<const Teuchos::Comm<int>> Tcomm = Teuchos::rcp(new Teuchos::MpiComm<int>(comm));
-
-    typedef katoptron::Map::local_ordinal_type local_ordinal_type;
-    typedef katoptron::Map::global_ordinal_type global_ordinal_type;
-
-    typedef Tpetra::CrsMatrix<> crs_matrix_type;
-
-    const local_ordinal_type numMyContacts = contactsList->getContactNumber();
-
-    // ------------------------------------------------------------- //
-    // create numMyContacts empty MOERTEL::Interface instances
-    // ------------------------------------------------------------- //
-    int printlevel = 0;
-    std::vector<Teuchos::RCP<MOERTEL::Interface>> interfaces(numMyContacts);
-    for (auto i = 0; i < numMyContacts; ++i)
-        interfaces[i] = Teuchos::rcp(new MOERTEL::Interface(i, false, Comm, printlevel));
-
-    // ------------------------------------------------------------- //
-    // Add nodes on both sides of interface to interfaces
-    // loop all nodes in the maps add them
-    // to the interface with unique ids
-    // ------------------------------------------------------------- //
-    for (auto i = 0; i < numMyContacts; ++i)
-    {
-        const local_ordinal_type numMySlaveNodes = contactsList->getSlaveNodesSize(i);
-
-        for (auto j = 0; j < numMySlaveNodes; ++j)
-        {
-            // get unique node id
-            auto global_nodeid = contactsList->getSlaveNode(i, j);
-
-            if (map->mapNodes->isNodeGlobalElement(global_nodeid))
-            {
-                // get node coordinates
-                auto local_nodeid = map->mapNodesWO->getLocalElement(global_nodeid);
-                double coord[3];
-                for (auto k = 0; k < 3; ++k)
-                    coord[k] = nodesList->nodes(local_nodeid, k);
-
-                // create a moertel node
-                MOERTEL::Node node(global_nodeid, coord, 1, &global_nodeid, contactsList->isASlaveDirichletNode(i, global_nodeid), printlevel);
-                // add node to interface i on side j
-                interfaces[i]->AddNode(node, 0);
-            }
-        }
-
-        const local_ordinal_type numMyMasterNodes = contactsList->getMasterNodesSize(i);
-
-        for (auto j = 0; j < numMyMasterNodes; ++j)
-        {
-            // get unique node id
-            auto global_nodeid = contactsList->getMasterNode(i, j);
-
-            if (map->mapNodes->isNodeGlobalElement(global_nodeid))
-            {
-                // get node coordinates
-                auto local_nodeid = map->mapNodesWO->getLocalElement(global_nodeid);
-                double coord[3];
-                for (auto k = 0; k < 3; ++k)
-                    coord[k] = nodesList->nodes(local_nodeid, k);
-
-                // create a moertel node
-                MOERTEL::Node node(global_nodeid, coord, 1, &global_nodeid, false, printlevel);
-                // add node to interface i on side j
-                interfaces[i]->AddNode(node, 1);
-            }
-        }
-    }
-
-    // ------------------------------------------------------------- //
-    // add segments on both sides of the interface to the interface
-    // ------------------------------------------------------------- //
-
-    auto i_index = 0;
-
-    for (auto i = 0; i < numMyContacts; ++i)
-    {
-        const local_ordinal_type numMySlaveElems = contactsList->getSlaveElementsSize(i);
-
-        for (auto j = 0; j < numMySlaveElems; ++j)
-        {
-            auto elem_local_index = contactsList->getSlaveElement(i, j);
-
-            if (elementsList->getElementSize(elem_local_index) == 4)
-            {
-                i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                global_ordinal_type nodeids[4];
-                for (auto k = 0; k < 4; ++k)
-                    nodeids[k] =
-                        map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-
-                MOERTEL::Segment_BiLinearQuad segment(i_index, 4, nodeids, printlevel);
-                interfaces[i]->AddSegment(segment, 0);
-            }
-            else if (elementsList->getElementSize(elem_local_index) == 3)
-            {
-                i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                global_ordinal_type nodeids[3];
-                for (auto k = 0; k < 3; ++k)
-                    nodeids[k] =
-                        map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-                MOERTEL::Segment_BiLinearTri segment(i_index++, 3, nodeids, printlevel);
-                interfaces[i]->AddSegment(segment, 0);
-            }
-        }
-
-        const local_ordinal_type numMyMasterElems = contactsList->getMasterElementsSize(i);
-
-        for (auto j = 0; j < numMyMasterElems; ++j)
-        {
-            auto elem_local_index = contactsList->getMasterElement(i, j);
-
-            if (elementsList->getElementSize(elem_local_index) == 4)
-            {
-                i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                global_ordinal_type nodeids[4];
-                for (auto k = 0; k < 4; ++k)
-                    nodeids[k] =
-                        map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-
-                MOERTEL::Segment_BiLinearQuad segment(i_index, 4, nodeids, printlevel);
-                interfaces[i]->AddSegment(segment, 1);
-            }
-            else if (elementsList->getElementSize(elem_local_index) == 3)
-            {
-                i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                global_ordinal_type nodeids[3];
-                for (auto k = 0; k < 3; ++k)
-                    nodeids[k] =
-                        map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-                MOERTEL::Segment_BiLinearTri segment(i_index++, 3, nodeids, printlevel);
-                interfaces[i]->AddSegment(segment, 1);
-            }
-        }
-    }
-
-    // ------------------------------------------------------------- //
-    // choose the mortar side of the interface (0 or 1)
-    //
-    // ------------------------------------------------------------- //
-    for (auto i = 0; i < numMyContacts; ++i)
-        interfaces[i]->SetMortarSide(1);
-
-    // ------------------------------------------------------------- //
-    // As we do not know the mortar side yet (we decided to le the
-    // package choose it), we can not set a dual trace function (mortar space)
-    // as we don't know the side to set it to
-    // so we just give orders for the function type
-    // ------------------------------------------------------------- //
-    for (auto i = 0; i < numMyContacts; ++i)
-    {
-        if (contactsList->getSlaveElementsSize(i) >= 1)
-        {
-            if (elementsList->getElementSize(contactsList->getSlaveElement(i, 0)) == 4)
-            {
-                if (contactsList->isStandardShapeFunction(i))
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_BiLinearQuad,
-                                                    MOERTEL::Function::func_BiLinearQuad);
-                }
-                else
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_BiLinearQuad,
-                                                    MOERTEL::Function::func_DualBiLinearQuad);
-                }
-            }
-            else if (elementsList->getElementSize(contactsList->getSlaveElement(i, 0)) == 3)
-            {
-                if (contactsList->isStandardShapeFunction(i))
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_LinearTri,
-                                                    MOERTEL::Function::func_LinearTri);
-                }
-                else
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_LinearTri,
-                                                    MOERTEL::Function::func_DualLinearTri);
-                }
-            }
-        }
-
-        else if (contactsList->getMasterElementsSize(i) >= 1)
-        {
-            if (elementsList->getElementSize(contactsList->getMasterElement(i, 0)) == 4)
-            {
-                if (contactsList->isStandardShapeFunction(i))
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_BiLinearQuad,
-                                                    MOERTEL::Function::func_BiLinearQuad);
-                }
-                else
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_BiLinearQuad,
-                                                    MOERTEL::Function::func_DualBiLinearQuad);
-                }
-            }
-            else if (elementsList->getElementSize(contactsList->getMasterElement(i, 0)) == 3)
-            {
-                if (contactsList->isStandardShapeFunction(i))
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_LinearTri,
-                                                    MOERTEL::Function::func_LinearTri);
-                }
-                else
-                {
-                    interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_LinearTri,
-                                                    MOERTEL::Function::func_DualLinearTri);
-                }
-            }
-        }
-    }
-    // ------------------------------------------------------------- //
-    // complete the interfaces
-    // ------------------------------------------------------------- //
-    for (auto i = 0; i < numMyContacts; ++i)
-        if (!interfaces[i]->Complete())
-        {
-            exit(EXIT_FAILURE);
-        }
-    // ------------------------------------------------------------- //
-    // create an empty MOERTEL::Manager for 3D problems
-    // It organizes everything from integration to solution
-    // ------------------------------------------------------------- //
-    MOERTEL::Manager manager(Comm, MOERTEL::Manager::manager_3D, printlevel);
-
-    // ------------------------------------------------------------- //
-    // Add the interfaces to the manager
-    // ------------------------------------------------------------- //
-    for (auto i = 0; i < numMyContacts; ++i)
-        manager.AddInterface(*(interfaces[i]));
-
-    // ------------------------------------------------------------- //
-    // for mortar integration, the mortar manager needs to know about
-    // the rowmap of the original (uncoupled) problem because it will
-    // create coupling matrices D and M matching that rowmap
-    // ------------------------------------------------------------- //
-    Teuchos::ArrayView<const global_ordinal_type> myNodes = map->mapNodes->getNodeElementList();
-
-    int numMyNodes = map->mapNodes->getNodeNumElements();
-    int numNodes = map->mapNodes->getGlobalNumElements();
-
-    int myNodesArray[numMyNodes];
-
-    for (auto i = 0; i < numMyNodes; ++i)
-        myNodesArray[i] = (int)myNodes[i];
-
-    Epetra_Map map00((int)numNodes, (int)numMyNodes, myNodesArray, (int)map->mapNodes->getIndexBase(), Comm);
-    manager.SetProblemMap(&map00);
-
-    // ============================================================= //
-    // choose integration parameters
-    // ============================================================= //
-    Teuchos::ParameterList &moertelparams = manager.Default_Parameters();
-    // this does affect this 3D case only
-    moertelparams.set("exact values at gauss points", true);
-    // 1D interface possible values are 1,2,3,4,5,6,7,8,10 (2 recommended with linear shape functions)
-    moertelparams.set("number gaussian points 1D", 2);
-    // 2D interface possible values are 3,6,12,13,16,19,27 (12 recommended with linear functions)
-    moertelparams.set("number gaussian points 2D", 12);
-
-    // ============================================================= //
-    // Here we are done with the construction phase of the interface
-    // so we can integrate the mortar integrals
-    // (Note we have not yet evaluated the PDE at all!)
-    // ============================================================= //
-
-    bool do_integrate = true;
-    int n_integration = 0;
-    int n_integration_max = 10;
-
-    while (do_integrate)
-    {
-        try
-        {
-            do_integrate = false;
-            ++n_integration;
-            manager.Mortar_Integrate();
-        }
-        catch (...)
-        {
-            do_integrate = true;
-        }
-
-        if (n_integration >= n_integration_max)
-            break;
-    }
-
-    if (n_integration != 1)
-        std::cout << "Has integrate " << n_integration << " times" << std::endl;
-
-    const Epetra_CrsMatrix *D = manager.D();
-    const Epetra_CrsMatrix *M = manager.M();
-
-    std::map<int, int> lm_to_dof = manager.lm_to_dof();
-
-    const size_t numDPN = map->numPrimalDPN;
-    const size_t numMDPN = 3;
-    const bool isThermo = (numDPN == 4);
-    const size_t numMechanicalLagrangeMultipliers = (D->NumGlobalCols() - numNodes);
-
-    size_t numLMPN;
-    if (contactsList->hasAtLeastOneSticking() && isThermo)
-        numLMPN = 4;
-    else if (contactsList->hasAtLeastOneSticking())
-        numLMPN = 3;
-    else if (isThermo)
-        numLMPN = 2;
-    else
-        numLMPN = 1;
-
-    map->numDualDPN = numLMPN;
-
-    const size_t numTotalLagrangeMultipliers = numLMPN * numMechanicalLagrangeMultipliers;
-
-    int indexBase = 0;
-
-    // ---------------
-
-    {
-        Teuchos::ArrayView<const global_ordinal_type> myNodes = map->mapNodes->getNodeElementList();
-
-        std::vector<global_ordinal_type> myLagrangeDofs = {};
-
-        size_t numMyRows = D->NumMyRows();
-        for (auto i = 0; i < numMyRows; ++i)
-        {
-            size_t global_id = D->GRID(i);
-            if (global_id < numNodes)
-                continue;
-            size_t lagrange_id = global_id - numNodes;
-            for (auto j = 0; j < numLMPN; ++j)
-                myLagrangeDofs.push_back(lagrange_id * numLMPN + j);
-        }
-
-        map->mapLagrangeDofs = rcp(new Tpetra::Map<>(numTotalLagrangeMultipliers, myLagrangeDofs, indexBase, Tcomm));
-    }
-
-    // ---------------
-    for (auto i = lm_to_dof.begin(); i != lm_to_dof.end(); ++i)
-        map->lm_to_dof_global[i->first - numNodes] = i->second;
-
-    for (auto i = lm_to_dof.begin(); i != lm_to_dof.end(); ++i)
-        if (map->mapNodes->isNodeGlobalElement(i->second))
-        {
-            map->lm_to_dof[i->first - numNodes] = i->second;
-        }
-
-    for (auto i = map->lm_to_dof.begin(); i != map->lm_to_dof.end(); ++i)
-        map->lagrange_to_dof[i->first - numNodes] = (i->second) * map->numPrimalDPN;
-
-    // As lm_to_dof is one to one, we can create dof_to_lm as follows
-    for (auto i = map->lm_to_dof.begin(); i != map->lm_to_dof.end(); ++i)
-        map->dof_to_lm[i->second] = i->first;
-
-    // ---------------
-
-    // Compute the outward normal
-    typedef Tpetra::MultiVector<double, local_ordinal_type, global_ordinal_type> double_multivector_type;
-
-    Teuchos::RCP<double_multivector_type> normalWO = Teuchos::rcp(new double_multivector_type(map->mapNodesWO, 3 * numMyContacts, true));
-    Teuchos::RCP<double_multivector_type> normalSUM = Teuchos::rcp(new double_multivector_type(map->mapNodes, 3 * numMyContacts, true));
-
-    std::vector<global_ordinal_type> myNodes2 = {};
-
-    for (auto i = 0; i < numNodes; ++i)
-        myNodes2.push_back(i);
-
-    Teuchos::RCP<Tpetra::Map<>> fullNodeMap = rcp(new Tpetra::Map<>(numNodes, myNodes2, indexBase, Tcomm));
-    Teuchos::RCP<double_multivector_type> normal = Teuchos::rcp(new double_multivector_type(fullNodeMap, 3 * numMyContacts, true));
-
-    {
-        for (auto i = 0; i < numMyContacts; ++i)
-        {
-            const local_ordinal_type numMySlaveElems = contactsList->getSlaveElementsSize(i);
-
-            for (auto j = 0; j < numMySlaveElems; ++j)
-            {
-                auto elem_local_index = contactsList->getSlaveElement(i, j);
-
-                if (elementsList->getElementSize(elem_local_index) == 4)
-                {
-                    i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                    global_ordinal_type node_id[4];
-                    double coordinates[4 * 3];
-                    for (auto k = 0; k < 4; ++k)
-                    {
-                        node_id[k] = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            coordinates[k * 3 + l] = nodesList->nodes(local_nodeid, l);
-                    }
-
-                    double vec1[3];
-                    double vec2[3];
-                    double vec3[3];
-                    double current_normal[3];
-                    double current_normal2[3];
-                    double norm1;
-                    double norm2;
-                    double current_area;
-
-                    vec1[0] = coordinates[3] - coordinates[0];
-                    vec1[1] = coordinates[4] - coordinates[1];
-                    vec1[2] = coordinates[5] - coordinates[2];
-
-                    vec2[0] = coordinates[6] - coordinates[0];
-                    vec2[1] = coordinates[7] - coordinates[1];
-                    vec2[2] = coordinates[8] - coordinates[2];
-
-                    vec3[0] = coordinates[9] - coordinates[0];
-                    vec3[1] = coordinates[10] - coordinates[1];
-                    vec3[2] = coordinates[11] - coordinates[2];
-
-                    current_normal[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1];
-                    current_normal[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2];
-                    current_normal[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0];
-
-                    current_normal2[0] = vec2[1] * vec3[2] - vec2[2] * vec3[1];
-                    current_normal2[1] = vec2[2] * vec3[0] - vec2[0] * vec3[2];
-                    current_normal2[2] = vec2[0] * vec3[1] - vec2[1] * vec3[0];
-
-                    norm1 = sqrt(pow(current_normal[0], 2) + pow(current_normal[1], 2) + pow(current_normal[2], 2));
-                    norm2 = sqrt(pow(current_normal2[0], 2) + pow(current_normal2[1], 2) + pow(current_normal2[2], 2));
-
-                    if (norm1 > 0.)
-                    {
-                        current_normal[0] = current_normal[0] / norm1;
-                        current_normal[1] = current_normal[1] / norm1;
-                        current_normal[2] = current_normal[2] / norm1;
-
-                        for (auto l = 0; l < 3; ++l)
-                            if (abs(current_normal[l]) <= 1e-10)
-                                current_normal[l] = 0.;
-                    }
-                    else
-                    {
-                        current_normal[0] = 0.;
-                        current_normal[1] = 0.;
-                        current_normal[2] = 0.;
-                    }
-
-                    current_area = (norm1 + norm2) / 2.;
-
-                    for (auto k = 0; k < 4; ++k)
-                    {
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            normalWO->sumIntoLocalValue(local_nodeid, i * 3 + l, current_area * current_normal[l]);
-                    }
-                }
-                else if (elementsList->getElementSize(elem_local_index) == 3)
-                {
-                    i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                    global_ordinal_type node_id[3];
-                    double coordinates[3 * 3];
-                    for (auto k = 0; k < 3; ++k)
-                    {
-                        node_id[k] = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            coordinates[k * 3 + l] = nodesList->nodes(local_nodeid, l);
-                    }
-
-                    double vec1[3];
-                    double vec2[3];
-                    double current_normal[3];
-                    double norm;
-                    double current_area;
-
-                    vec1[0] = coordinates[3] - coordinates[0];
-                    vec1[1] = coordinates[4] - coordinates[1];
-                    vec1[2] = coordinates[5] - coordinates[2];
-
-                    vec2[0] = coordinates[6] - coordinates[0];
-                    vec2[1] = coordinates[7] - coordinates[1];
-                    vec2[2] = coordinates[8] - coordinates[2];
-
-                    current_normal[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1];
-                    current_normal[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2];
-                    current_normal[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0];
-
-                    norm = sqrt(pow(current_normal[0], 2) + pow(current_normal[1], 2) + pow(current_normal[2], 2));
-
-                    current_area = norm / 2.;
-
-                    if (norm > 0.)
-                    {
-                        current_normal[0] = current_normal[0] / norm;
-                        current_normal[1] = current_normal[1] / norm;
-                        current_normal[2] = current_normal[2] / norm;
-
-                        for (auto l = 0; l < 3; ++l)
-                            if (abs(current_normal[l]) <= 1e-10)
-                                current_normal[l] = 0.;
-                    }
-                    else
-                    {
-                        current_normal[0] = 0.;
-                        current_normal[1] = 0.;
-                        current_normal[2] = 0.;
-                    }
-
-                    for (auto k = 0; k < 3; ++k)
-                    {
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            normalWO->sumIntoLocalValue(local_nodeid, i * 3 + l, current_area * current_normal[l]);
-                    }
-                }
-            }
-
-            const local_ordinal_type numMyMasterElems = contactsList->getMasterElementsSize(i);
-
-            for (auto j = 0; j < numMyMasterElems; ++j)
-            {
-                auto elem_local_index = contactsList->getMasterElement(i, j);
-
-                if (elementsList->getElementSize(elem_local_index) == 4)
-                {
-                    i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                    global_ordinal_type node_id[4];
-                    double coordinates[4 * 3];
-                    for (auto k = 0; k < 4; ++k)
-                    {
-                        node_id[k] = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            coordinates[k * 3 + l] = nodesList->nodes(local_nodeid, l);
-                    }
-
-                    double vec1[3];
-                    double vec2[3];
-                    double vec3[3];
-                    double current_normal[3];
-                    double current_normal2[3];
-                    double norm1;
-                    double norm2;
-                    double current_area;
-
-                    vec1[0] = coordinates[3] - coordinates[0];
-                    vec1[1] = coordinates[4] - coordinates[1];
-                    vec1[2] = coordinates[5] - coordinates[2];
-
-                    vec2[0] = coordinates[6] - coordinates[0];
-                    vec2[1] = coordinates[7] - coordinates[1];
-                    vec2[2] = coordinates[8] - coordinates[2];
-
-                    vec3[0] = coordinates[9] - coordinates[0];
-                    vec3[1] = coordinates[10] - coordinates[1];
-                    vec3[2] = coordinates[11] - coordinates[2];
-
-                    current_normal[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1];
-                    current_normal[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2];
-                    current_normal[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0];
-
-                    current_normal2[0] = vec2[1] * vec3[2] - vec2[2] * vec3[1];
-                    current_normal2[1] = vec2[2] * vec3[0] - vec2[0] * vec3[2];
-                    current_normal2[2] = vec2[0] * vec3[1] - vec2[1] * vec3[0];
-
-                    norm1 = sqrt(pow(current_normal[0], 2) + pow(current_normal[1], 2) + pow(current_normal[2], 2));
-                    norm2 = sqrt(pow(current_normal2[0], 2) + pow(current_normal2[1], 2) + pow(current_normal2[2], 2));
-
-                    if (norm1 > 0.)
-                    {
-                        current_normal[0] = current_normal[0] / norm1;
-                        current_normal[1] = current_normal[1] / norm1;
-                        current_normal[2] = current_normal[2] / norm1;
-
-                        for (auto l = 0; l < 3; ++l)
-                            if (abs(current_normal[l]) <= 1e-10)
-                                current_normal[l] = 0.;
-                    }
-                    else
-                    {
-                        current_normal[0] = 0.;
-                        current_normal[1] = 0.;
-                        current_normal[2] = 0.;
-                    }
-
-                    current_area = (norm1 + norm2) / 2.;
-
-                    for (auto k = 0; k < 4; ++k)
-                    {
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            normalWO->sumIntoLocalValue(local_nodeid, i * 3 + l, current_area * current_normal[l]);
-                    }
-                }
-                else if (elementsList->getElementSize(elem_local_index) == 3)
-                {
-                    i_index = map->mapElems->getGlobalElement(elem_local_index);
-
-                    global_ordinal_type node_id[3];
-                    double coordinates[3 * 3];
-                    for (auto k = 0; k < 3; ++k)
-                    {
-                        node_id[k] = map->mapNodesWO->getGlobalElement(elementsList->getElementNode(elem_local_index, k));
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            coordinates[k * 3 + l] = nodesList->nodes(local_nodeid, l);
-                    }
-
-                    double vec1[3];
-                    double vec2[3];
-                    double current_normal[3];
-                    double norm;
-                    double current_area;
-
-                    vec1[0] = coordinates[3] - coordinates[0];
-                    vec1[1] = coordinates[4] - coordinates[1];
-                    vec1[2] = coordinates[5] - coordinates[2];
-
-                    vec2[0] = coordinates[6] - coordinates[0];
-                    vec2[1] = coordinates[7] - coordinates[1];
-                    vec2[2] = coordinates[8] - coordinates[2];
-
-                    current_normal[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1];
-                    current_normal[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2];
-                    current_normal[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0];
-
-                    norm = sqrt(pow(current_normal[0], 2) + pow(current_normal[1], 2) + pow(current_normal[2], 2));
-
-                    current_area = norm / 2.;
-
-                    if (norm > 0.)
-                    {
-                        current_normal[0] = current_normal[0] / norm;
-                        current_normal[1] = current_normal[1] / norm;
-                        current_normal[2] = current_normal[2] / norm;
-
-                        for (auto l = 0; l < 3; ++l)
-                            if (abs(current_normal[l]) <= 1e-10)
-                                current_normal[l] = 0.;
-                    }
-                    else
-                    {
-                        current_normal[0] = 0.;
-                        current_normal[1] = 0.;
-                        current_normal[2] = 0.;
-                    }
-
-                    for (auto k = 0; k < 3; ++k)
-                    {
-                        auto local_nodeid = map->mapNodesWO->getLocalElement(node_id[k]);
-
-                        for (auto l = 0; l < 3; ++l)
-                            normalWO->sumIntoLocalValue(local_nodeid, i * 3 + l, current_area * current_normal[l]);
-                    }
-                }
-            }
-        }
-    }
-    Tpetra::Export<> export1(map->mapNodesWO, map->mapNodes);
-    Tpetra::Export<> export2(map->mapNodes, normal->getMap());
-    Tpetra::Import<> import1(map->mapNodes, normal->getMap());
-
-    normalSUM->doExport(*normalWO, export1, Tpetra::ADD);
-    normal->doImport(*normalSUM, import1, Tpetra::INSERT);
-
-    normal->template sync<Kokkos::HostSpace>();
-    auto normal_2d = normal->template getLocalView<Kokkos::HostSpace>();
-
-    size_t maxNumEntPerRow = 3 * (D->MaxNumEntries() + M->MaxNumEntries());
-    Teuchos::RCP<crs_matrix_type> B(new crs_matrix_type(map->mapLagrangeDofs, maxNumEntPerRow));
-    {
-        int DNumMyRow = D->NumMyRows();
-        int DMaxNumIndices = D->MaxNumEntries();
-        double *values = new double[DMaxNumIndices];
-        int DNumIndices;
-        int *Indices_int = new int[DMaxNumIndices];
-
-        const Epetra_Map DrowMap = D->RowMap();
-        const Epetra_Map DcolMap = D->ColMap();
-
-        for (size_t i = 0; i < DNumMyRow; ++i)
-        {
-            size_t global_id = D->GRID(i);
-            if (global_id < numNodes)
-                continue;
-
-            D->ExtractGlobalRowCopy(global_id, DMaxNumIndices, DNumIndices, values, Indices_int);
-
-            // find which interface interface_j is related to the current Lagrange multiplier
-            size_t interface_j = 0; // 0 by default
-            if (contactsList->getContactNumber() > 1)
-            {
-                bool doIStop = false;
-                for (auto k = 0; k < DNumIndices; ++k)
-                {
-                    for (auto j = 0; j < numMyContacts; ++j)
-                    {
-                        const local_ordinal_type numMySlaveNodes = contactsList->getSlaveNodesSize(j);
-
-                        for (auto l = 0; l < numMySlaveNodes; ++l)
-                        {
-                            auto global_nodeid = contactsList->getSlaveNode(j, l);
-
-                            if (global_nodeid == Indices_int[k])
-                            {
-                                interface_j = j;
-                                doIStop = true;
-                            }
-                            if (doIStop)
-                                break;
-                        }
-                        if (doIStop)
-                            break;
-                    }
-                    if (doIStop)
-                        break;
-                }
-            }
-
-            global_ordinal_type row = (global_id - numNodes) * numLMPN;
-
-            for (auto k = 0; k < DNumIndices; ++k)
-            {
-                global_ordinal_type col1 = Indices_int[k] * numMDPN;
-                global_ordinal_type col2 = Indices_int[k] * numMDPN + 1;
-                global_ordinal_type col3 = Indices_int[k] * numMDPN + 2;
-
-                if (isThermo)
-                {
-                    col1 += numNodes;
-                    col2 += numNodes;
-                    col3 += numNodes;
-                }
-
-                global_ordinal_type global_node_id = Indices_int[k];
-                local_ordinal_type local_node_id = normal->getMap()->getLocalElement(global_node_id);
-
-                double current_normal[3];
-                current_normal[0] = normal_2d(local_node_id, interface_j * 3 + 0);
-                current_normal[1] = normal_2d(local_node_id, interface_j * 3 + 1);
-                current_normal[2] = normal_2d(local_node_id, interface_j * 3 + 2);
-
-                double norm = sqrt(pow(current_normal[0], 2) + pow(current_normal[1], 2) + pow(current_normal[2], 2));
-
-                if (norm > 0.)
-                {
-                    current_normal[0] = current_normal[0] / norm;
-                    current_normal[1] = current_normal[1] / norm;
-                    current_normal[2] = current_normal[2] / norm;
-                }
-                else
-                {
-                    current_normal[0] = 0.;
-                    current_normal[1] = 0.;
-                    current_normal[2] = 0.;
-                }
-
-                double current_tangential_1[3];
-                double current_tangential_2[3];
-
-                current_tangential_1[0] = 0.;
-                current_tangential_1[1] = 0.;
-                current_tangential_1[2] = 1.;
-
-                current_tangential_2[0] = 0.;
-                current_tangential_2[1] = 0.;
-                current_tangential_2[2] = 0.;
-
-                if (contactsList->hasAtLeastOneSticking())
-                {
-                    double dot_n_z = current_normal[0] * current_tangential_1[0] + current_normal[1] * current_tangential_1[1] + current_normal[2] * current_tangential_1[2];
-
-                    if (acos(abs(dot_n_z)) <= 1e-6 || contactsList->isTying(interface_j))
-                    {
-                        if (contactsList->isTying(interface_j))
-                        {
-                            current_normal[0] = 0.;
-                            current_normal[1] = 0.;
-                            current_normal[2] = 1.;
-                        }
-                        current_tangential_1[0] = 1.;
-                        current_tangential_1[1] = 0.;
-                        current_tangential_1[2] = 0.;
-
-                        current_tangential_2[0] = 0.;
-                        current_tangential_2[1] = 1.;
-                        current_tangential_2[2] = 0.;
-                    }
-                    else
-                    {
-                        current_tangential_1[0] = current_tangential_1[0] - dot_n_z * current_normal[0];
-                        current_tangential_1[1] = current_tangential_1[1] - dot_n_z * current_normal[1];
-                        current_tangential_1[2] = current_tangential_1[2] - dot_n_z * current_normal[2];
-
-                        double norm = sqrt(pow(current_tangential_1[0], 2) + pow(current_tangential_1[1], 2) + pow(current_tangential_1[2], 2));
-
-                        current_tangential_1[0] = current_tangential_1[0] / norm;
-                        current_tangential_1[1] = current_tangential_1[1] / norm;
-                        current_tangential_1[2] = current_tangential_1[2] / norm;
-
-                        current_tangential_2[0] = -(current_normal[1] * current_tangential_1[2] - current_normal[2] * current_tangential_1[1]);
-                        current_tangential_2[1] = -(current_normal[2] * current_tangential_1[0] - current_normal[0] * current_tangential_1[2]);
-                        current_tangential_2[2] = -(current_normal[0] * current_tangential_1[1] - current_normal[1] * current_tangential_1[0]);
-                    }
-                }
-
-                double value1 = values[k] * current_normal[0] * contactsList->getMortarScale(interface_j);
-                double value2 = values[k] * current_normal[1] * contactsList->getMortarScale(interface_j);
-                double value3 = values[k] * current_normal[2] * contactsList->getMortarScale(interface_j);
-
-                B->insertGlobalValues(row,
-                                      Teuchos::tuple<global_ordinal_type>(col1),
-                                      Teuchos::tuple<double>(value1));
-                B->insertGlobalValues(row,
-                                      Teuchos::tuple<global_ordinal_type>(col2),
-                                      Teuchos::tuple<double>(value2));
-                B->insertGlobalValues(row,
-                                      Teuchos::tuple<global_ordinal_type>(col3),
-                                      Teuchos::tuple<double>(value3));
-
-                if (contactsList->isSticking(interface_j))
-                {
-                    value1 = values[k] * current_tangential_1[0] * contactsList->getMortarScale(interface_j);
-                    value2 = values[k] * current_tangential_1[1] * contactsList->getMortarScale(interface_j);
-                    value3 = values[k] * current_tangential_1[2] * contactsList->getMortarScale(interface_j);
-
-                    B->insertGlobalValues(row + 1,
-                                          Teuchos::tuple<global_ordinal_type>(col1),
-                                          Teuchos::tuple<double>(value1));
-                    B->insertGlobalValues(row + 1,
-                                          Teuchos::tuple<global_ordinal_type>(col2),
-                                          Teuchos::tuple<double>(value2));
-                    B->insertGlobalValues(row + 1,
-                                          Teuchos::tuple<global_ordinal_type>(col3),
-                                          Teuchos::tuple<double>(value3));
-
-                    value1 = values[k] * current_tangential_2[0] * contactsList->getMortarScale(interface_j);
-                    value2 = values[k] * current_tangential_2[1] * contactsList->getMortarScale(interface_j);
-                    value3 = values[k] * current_tangential_2[2] * contactsList->getMortarScale(interface_j);
-
-                    B->insertGlobalValues(row + 2,
-                                          Teuchos::tuple<global_ordinal_type>(col1),
-                                          Teuchos::tuple<double>(value1));
-                    B->insertGlobalValues(row + 2,
-                                          Teuchos::tuple<global_ordinal_type>(col2),
-                                          Teuchos::tuple<double>(value2));
-                    B->insertGlobalValues(row + 2,
-                                          Teuchos::tuple<global_ordinal_type>(col3),
-                                          Teuchos::tuple<double>(value3));
-                }
-                if (numDPN == 4)
-                {
-                    global_ordinal_type row2 = row + numLMPN - 1;
-                    global_ordinal_type col4 = Indices_int[k];
-                    B->insertGlobalValues(row2,
-                                          Teuchos::tuple<global_ordinal_type>(col4),
-                                          Teuchos::tuple<double>(values[k]));
-                }
-            }
-
-            if (SignoriniCheck)
-                if (contactsList->isNotSignorini(interface_j) == false)
-                    continue;
-            {
-                int MMaxNumIndices = M->MaxNumEntries();
-                double *values = new double[MMaxNumIndices];
-                int MNumIndices;
-                int *Indices_int = new int[MMaxNumIndices];
-
-                M->ExtractGlobalRowCopy(global_id, MMaxNumIndices, MNumIndices, values, Indices_int);
-
-                for (auto k = 0; k < MNumIndices; ++k)
-                {
-                    global_ordinal_type col1 = Indices_int[k] * numMDPN;
-                    global_ordinal_type col2 = Indices_int[k] * numMDPN + 1;
-                    global_ordinal_type col3 = Indices_int[k] * numMDPN + 2;
-
-                    if (isThermo)
-                    {
-                        col1 += numNodes;
-                        col2 += numNodes;
-                        col3 += numNodes;
-                    }
-
-                    global_ordinal_type global_node_id = Indices_int[k];
-                    local_ordinal_type local_node_id = normal->getMap()->getLocalElement(global_node_id);
-
-                    double current_normal[3];
-                    current_normal[0] = normal_2d(local_node_id, interface_j * 3 + 0);
-                    current_normal[1] = normal_2d(local_node_id, interface_j * 3 + 1);
-                    current_normal[2] = normal_2d(local_node_id, interface_j * 3 + 2);
-
-                    double norm = sqrt(pow(current_normal[0], 2) + pow(current_normal[1], 2) + pow(current_normal[2], 2));
-
-                    if (norm > 0.)
-                    {
-                        current_normal[0] = current_normal[0] / norm;
-                        current_normal[1] = current_normal[1] / norm;
-                        current_normal[2] = current_normal[2] / norm;
-                    }
-                    else
-                    {
-                        current_normal[0] = 0.;
-                        current_normal[1] = 0.;
-                        current_normal[2] = 0.;
-                    }
-
-                    double current_tangential_1[3];
-                    double current_tangential_2[3];
-
-                    current_tangential_1[0] = 0.;
-                    current_tangential_1[1] = 0.;
-                    current_tangential_1[2] = 1.;
-
-                    current_tangential_2[0] = 0.;
-                    current_tangential_2[1] = 0.;
-                    current_tangential_2[2] = 0.;
-
-                    if (contactsList->hasAtLeastOneSticking())
-                    {
-                        current_tangential_1[0] = 0.;
-                        current_tangential_1[1] = 0.;
-                        current_tangential_1[2] = 1.;
-
-                        double dot_n_z = current_normal[0] * current_tangential_1[0] + current_normal[1] * current_tangential_1[1] + current_normal[2] * current_tangential_1[2];
-
-                        if (acos(abs(dot_n_z)) <= 1e-6 || contactsList->isTying(interface_j))
-                        {
-                            if (contactsList->isTying(interface_j))
-                            {
-                                current_normal[0] = 0.;
-                                current_normal[1] = 0.;
-                                current_normal[2] = -1.;
-                            }
-                            current_tangential_1[0] = 1.;
-                            current_tangential_1[1] = 0.;
-                            current_tangential_1[2] = 0.;
-
-                            current_tangential_2[0] = 0.;
-                            current_tangential_2[1] = 1.;
-                            current_tangential_2[2] = 0.;
-                        }
-                        else
-                        {
-                            current_tangential_1[0] = current_tangential_1[0] - dot_n_z * current_normal[0];
-                            current_tangential_1[1] = current_tangential_1[1] - dot_n_z * current_normal[1];
-                            current_tangential_1[2] = current_tangential_1[2] - dot_n_z * current_normal[2];
-
-                            double norm = sqrt(pow(current_tangential_1[0], 2) + pow(current_tangential_1[1], 2) + pow(current_tangential_1[2], 2));
-
-                            current_tangential_1[0] = current_tangential_1[0] / norm;
-                            current_tangential_1[1] = current_tangential_1[1] / norm;
-                            current_tangential_1[2] = current_tangential_1[2] / norm;
-
-                            current_tangential_2[0] = current_normal[1] * current_tangential_1[2] - current_normal[2] * current_tangential_1[1];
-                            current_tangential_2[1] = current_normal[2] * current_tangential_1[0] - current_normal[0] * current_tangential_1[2];
-                            current_tangential_2[2] = current_normal[0] * current_tangential_1[1] - current_normal[1] * current_tangential_1[0];
-                        }
-                    }
-
-                    double value1 = -values[k] * current_normal[0] * contactsList->getMortarScale(interface_j);
-                    double value2 = -values[k] * current_normal[1] * contactsList->getMortarScale(interface_j);
-                    double value3 = -values[k] * current_normal[2] * contactsList->getMortarScale(interface_j);
-
-                    B->insertGlobalValues(row,
-                                          Teuchos::tuple<global_ordinal_type>(col1),
-                                          Teuchos::tuple<double>(value1));
-                    B->insertGlobalValues(row,
-                                          Teuchos::tuple<global_ordinal_type>(col2),
-                                          Teuchos::tuple<double>(value2));
-                    B->insertGlobalValues(row,
-                                          Teuchos::tuple<global_ordinal_type>(col3),
-                                          Teuchos::tuple<double>(value3));
-
-                    if (contactsList->isSticking(interface_j))
-                    {
-                        value1 = values[k] * current_tangential_1[0] * contactsList->getMortarScale(interface_j);
-                        value2 = values[k] * current_tangential_1[1] * contactsList->getMortarScale(interface_j);
-                        value3 = values[k] * current_tangential_1[2] * contactsList->getMortarScale(interface_j);
-
-                        B->insertGlobalValues(row + 1,
-                                              Teuchos::tuple<global_ordinal_type>(col1),
-                                              Teuchos::tuple<double>(value1));
-                        B->insertGlobalValues(row + 1,
-                                              Teuchos::tuple<global_ordinal_type>(col2),
-                                              Teuchos::tuple<double>(value2));
-                        B->insertGlobalValues(row + 1,
-                                              Teuchos::tuple<global_ordinal_type>(col3),
-                                              Teuchos::tuple<double>(value3));
-
-                        value1 = values[k] * current_tangential_2[0] * contactsList->getMortarScale(interface_j);
-                        value2 = values[k] * current_tangential_2[1] * contactsList->getMortarScale(interface_j);
-                        value3 = values[k] * current_tangential_2[2] * contactsList->getMortarScale(interface_j);
-
-                        B->insertGlobalValues(row + 2,
-                                              Teuchos::tuple<global_ordinal_type>(col1),
-                                              Teuchos::tuple<double>(value1));
-                        B->insertGlobalValues(row + 2,
-                                              Teuchos::tuple<global_ordinal_type>(col2),
-                                              Teuchos::tuple<double>(value2));
-                        B->insertGlobalValues(row + 2,
-                                              Teuchos::tuple<global_ordinal_type>(col3),
-                                              Teuchos::tuple<double>(value3));
-                    }
-                    if (numDPN == 4)
-                    {
-                        global_ordinal_type row2 = row + numLMPN - 1;
-                        global_ordinal_type col4 = Indices_int[k];
-                        B->insertGlobalValues(row2,
-                                              Teuchos::tuple<global_ordinal_type>(col4),
-                                              Teuchos::tuple<double>(values[k]));
-                    }
-                }
-
-                delete values;
-                delete Indices_int;
-            }
-        }
-
-        delete values;
-        delete Indices_int;
-    }
-
-    B->fillComplete(map->mapDofs, map->mapLagrangeDofs);
-
-    return B;
-}
diff --git a/katoptron/src/Mortar.h b/katoptron/src/Mortar.h
deleted file mode 100644
index 80540be292b9dc06cd70cfc2bb0156e4ca312206..0000000000000000000000000000000000000000
--- a/katoptron/src/Mortar.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef KATOPTRON_MORTAR_H
-#define KATOPTRON_MORTAR_H
-
-#include "Tpetra_Vector.hpp"
-#include "Kokkos_ViewFactory.hpp"
-#include "Tpetra_Map.hpp"
-#include <mpi.h>
-#include "Tpetra_CrsGraph.hpp"
-#include <Epetra_Map.h>
-
-#include "Tpetra_ConfigDefs.hpp"
-
-#include "Tpetra_Map.hpp"
-#include "Tpetra_MultiVector.hpp"
-#include "Tpetra_Vector.hpp"
-#include "Tpetra_CrsGraph.hpp"
-#include "Tpetra_CrsMatrix.hpp"
-
-#include "ElementsList.h"
-#include "NodesList.h"
-#include "ContactsList.h"
-#include "Map.h"
-#include "Matrices.h"
-
-Teuchos::RCP<Tpetra::CrsMatrix<>> compute_B(Teuchos::RCP<katoptron::ElementsList> elementsList,
-                                            Teuchos::RCP<katoptron::NodesList> nodesList,
-                                            Teuchos::RCP<katoptron::ContactsList> contactsList,
-                                            Teuchos::RCP<katoptron::Map> map, MPI_Comm comm, bool SignoriniCheck);
-
-template <typename scalar>
-void compute_B(Teuchos::RCP<katoptron::Matrices<scalar>> matrices,
-               Teuchos::RCP<katoptron::ElementsList> elementsList,
-               Teuchos::RCP<katoptron::NodesList> nodesList,
-               Teuchos::RCP<katoptron::ContactsList> contactsList,
-               Teuchos::RCP<katoptron::Map> map, MPI_Comm comm)
-{
-    Teuchos::RCP<Tpetra::CrsMatrix<>> B_double = compute_B(elementsList, nodesList, contactsList, map, comm, true);
-    Teuchos::RCP<Tpetra::CrsMatrix<>> B_G_double;
-    if (contactsList->isSignorini())
-        B_G_double = compute_B(elementsList, nodesList, contactsList, map, comm, false);
-    else
-        B_G_double = B_double;
-
-    typedef katoptron::Map::local_ordinal_type local_ordinal_type;
-    typedef katoptron::Map::global_ordinal_type global_ordinal_type;
-
-    size_t maxNumEntPerRow = B_G_double->getNodeMaxNumRowEntries();
-    size_t maxNumEntPerRowT = 200; // Temporary fix
-
-    matrices->B = rcp(new Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type>(map->mapLagrangeDofs, maxNumEntPerRow));
-    matrices->B_2 = rcp(new Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type>(map->mapLagrangeDofs, maxNumEntPerRow));
-    matrices->B_G = rcp(new Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type>(map->mapLagrangeDofs, maxNumEntPerRow));
-    matrices->B_T = rcp(new Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type>(map->mapDofs, maxNumEntPerRowT));
-    matrices->C = rcp(new Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type>(map->mapLagrangeDofs, 1));
-    matrices->Cb = rcp(new Tpetra::CrsMatrix<scalar, local_ordinal_type, global_ordinal_type>(map->mapLagrangeDofs, 1));
-
-    for (auto i = 0; i < map->mapLagrangeDofs->getNodeNumElements(); ++i)
-    {
-        if (map->mapLagrangeDofs->isNodeLocalElement(i))
-        {
-            local_ordinal_type local_index = i;
-            global_ordinal_type global_index = map->mapLagrangeDofs->getGlobalElement(local_index);
-
-            Teuchos::ArrayView<const local_ordinal_type> local_indices;
-            Teuchos::ArrayView<const double> values;
-
-            B_double->getLocalRowView(local_index, local_indices, values);
-
-            for (auto k = 0; k < local_indices.size(); ++k)
-            {
-                global_ordinal_type column_index = B_double->getColMap()->getGlobalElement(local_indices[k]);
-
-                matrices->B->insertGlobalValues(global_index,
-                                                Teuchos::tuple<global_ordinal_type>(column_index),
-                                                Teuchos::tuple<scalar>((scalar)values[k]));
-
-                matrices->B_2->insertGlobalValues(global_index,
-                                                  Teuchos::tuple<global_ordinal_type>(column_index),
-                                                  Teuchos::tuple<scalar>((scalar)values[k]));
-
-                matrices->B_T->insertGlobalValues(column_index,
-                                                  Teuchos::tuple<global_ordinal_type>(global_index),
-                                                  Teuchos::tuple<scalar>((scalar)values[k]));
-            }
-
-            B_G_double->getLocalRowView(local_index, local_indices, values);
-
-            for (auto k = 0; k < local_indices.size(); ++k)
-            {
-                global_ordinal_type column_index = B_G_double->getColMap()->getGlobalElement(local_indices[k]);
-
-                matrices->B_G->insertGlobalValues(global_index,
-                                                  Teuchos::tuple<global_ordinal_type>(column_index),
-                                                  Teuchos::tuple<scalar>((scalar)values[k]));
-            }
-
-            matrices->C->insertGlobalValues(global_index, Teuchos::tuple<global_ordinal_type>(global_index), Teuchos::tuple<scalar>((scalar)0.));
-            matrices->Cb->insertGlobalValues(global_index, Teuchos::tuple<global_ordinal_type>(global_index), Teuchos::tuple<scalar>((scalar)1.));
-        }
-    }
-
-    matrices->B->fillComplete(map->mapDofs, map->mapLagrangeDofs);
-    matrices->B_2->fillComplete(map->mapDofs, map->mapLagrangeDofs);
-    matrices->B_G->fillComplete(map->mapDofs, map->mapLagrangeDofs);
-    matrices->B_T->fillComplete(map->mapLagrangeDofs, map->mapDofs);
-    matrices->C->fillComplete();
-    matrices->Cb->fillComplete();
-};
-#endif //KATOPTRON_MORTAR_H
\ No newline at end of file
diff --git a/katoptron/src/NeumannList.h b/katoptron/src/NeumannList.h
deleted file mode 100644
index 08aaf001da45b3d0a4276cf9461a019171f11aa1..0000000000000000000000000000000000000000
--- a/katoptron/src/NeumannList.h
+++ /dev/null
@@ -1,196 +0,0 @@
-#ifndef KATOPTRON_NEUMANNLIST_H
-#define KATOPTRON_NEUMANNLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wNeumann.h"
-#include "wTag.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-#include "EnsembleTraits.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store the list of the Neumann boundary conditions (BC).
- */
-template <typename scalar>
-class NeumannList
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-private:
-    Kokkos::View<int **, Kokkos::LayoutRight> neumann_elementsList;
-    Kokkos::View<scalar ***, Kokkos::LayoutRight> neumann_values_list;
-
-    local_ordinal_type neumann_number;
-    local_ordinal_type neumann_size;
-    local_ordinal_type neumann_elements;
-
-    local_ordinal_type neumann_time;
-    local_ordinal_type neumann_dofs;
-    local_ordinal_type neumann_values;
-
-public:
-    NeumannList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
-
-    /**
-     * @brief Return the number of Neumann BC.
-     */
-    inline local_ordinal_type getNeumannNumber() { return neumann_number; }
-
-    /**
-     * @brief Return the number of elements for a
-     * given Neumann BC.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the BC ID.
-     * </ul>
-     */
-    inline local_ordinal_type getNeumannSize(local_ordinal_type i)
-    {
-        return neumann_elementsList(i, neumann_size);
-    }
-
-    /**
-     * @brief Return the local ID of the element e1 of 
-     * a given BC.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the BC ID,
-     *  <li> e1: the ID of the element on the current BC.
-     * </ul>
-     */
-    inline local_ordinal_type getNeumannElement(local_ordinal_type i, local_ordinal_type e1)
-    {
-        return neumann_elementsList(i, neumann_elements + e1);
-    }
-
-    /**
-     * @brief Return whether there is a surface
-     * load for the given BC for a given DOF index.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the BC ID,
-     *  <li> j: the index of the DOF (0-3 if thermomechanical problems).
-     * </ul> 
-     */
-    inline scalar getNeumannDof(local_ordinal_type i, local_ordinal_type j)
-    {
-        return neumann_values_list(i, 0, neumann_dofs + j);
-    }
-
-    /**
-     * @brief Return the value of the surface
-     * load for the given BC for a given DOF index.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the BC ID,
-     *  <li> j: the index of the DOF (0-3 if thermomechanical problems).
-     * </ul> 
-     */
-    inline scalar getNeumannValue(local_ordinal_type i, local_ordinal_type j)
-    {
-        return neumann_values_list(i, 0, neumann_values + j);
-    }
-};
-
-/**
- * @brief NeumannList constructor
- * 
- * This constructor allocates 2 Kokkos::View which store all the required information related to each Neumann BC, including:
- * <ul>
- *  <li> all the Neumann elements,
- *  <li> all the values of the Neumann BC.
- * </ul>
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to an ElementList object.
- * </ul>
- */
-template <typename scalar>
-NeumannList<scalar>::NeumannList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
-{
-    typedef local_ordinal_type local_ordinal_type;
-    typedef global_ordinal_type global_ordinal_type;
-
-    typedef EnsembleTraits<scalar> ET;
-    const int ensemble_size = ET::size;
-
-    local_ordinal_type numDPN = map->numPrimalDPN;
-
-    neumann_number = pbl.nBCs.size();
-    local_ordinal_type maxNumElemsPernBC = 0;
-
-    std::vector<std::vector<global_ordinal_type>> nbcElems = {};
-
-    for (auto i = 0; i < neumann_number; ++i)
-    {
-        std::vector<global_ordinal_type> mynBcElems = {};
-        for (auto j = 0; j < pbl.nBCs[i]->tag->elems.size(); ++j)
-        {
-            local_ordinal_type e = map->mapElems->getLocalElement(pbl.nBCs[i]->tag->elems[j]->no - 1);
-
-            if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::QUAD4))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::TRI3))
-                ;
-            else
-                continue;
-
-            mynBcElems.push_back(e);
-        }
-        nbcElems.push_back(mynBcElems);
-        if (maxNumElemsPernBC < mynBcElems.size())
-            maxNumElemsPernBC = mynBcElems.size();
-    }
-
-    neumann_size = 0;
-    neumann_elements = 1;
-    neumann_elementsList = Kokkos::View<int **, Kokkos::LayoutRight>("R", neumann_number, neumann_elements + maxNumElemsPernBC);
-
-    for (auto i = 0; i < neumann_number; ++i)
-    {
-        neumann_elementsList(i, neumann_size) = nbcElems[i].size();
-
-        for (auto j = 0; j < nbcElems[i].size(); ++j)
-            neumann_elementsList(i, neumann_elements + j) = nbcElems[i][j];
-    }
-
-    neumann_time = 0;
-    neumann_dofs = 1;
-    neumann_values = 1 + numDPN;
-    neumann_values_list = Kokkos::View<scalar ***, Kokkos::LayoutRight>("R", neumann_number, 1, 1 + 2 * numDPN);
-    for (auto i = 0; i < neumann_number; ++i)
-    {
-        neumann_values_list(i, 0, neumann_time) = 0.; //to change latter
-        for (auto j = 0; j < numDPN; ++j)
-            if (pbl.nBCs[i]->which_dof[j])
-                neumann_values_list(i, 0, neumann_dofs + j) = 1;
-            else
-                neumann_values_list(i, 0, neumann_dofs + j) = 0;
-
-        for (auto j = 0; j < numDPN; ++j)
-            for (int s = 0; s < ensemble_size; ++s)
-            {
-                ET::coeff(neumann_values_list(i, 0, neumann_values + j), s) = pbl.nBCs[i]->values[j * ensemble_size + s];
-            }
-    }
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_NEUMANNLIST_H
diff --git a/katoptron/src/NodesList.cpp b/katoptron/src/NodesList.cpp
deleted file mode 100644
index 7bd363ba76c5d53571f2bea297a308bc157c4152..0000000000000000000000000000000000000000
--- a/katoptron/src/NodesList.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "NodesList.h"
-
-#include "wProblem.h"
-#include "wMshData.h"
-#include "wNode.h"
-
-using namespace katoptron;
-
-/**
- * @brief NodesList constructor
- * 
- * This constructor allocates 1 Kokkos::View which stores all the nodes positions.
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object.
- * </ul>
- */
-NodesList::NodesList(Problem &pbl, Teuchos::RCP<Map> map)
-{
-    nodes_number = map->mapNodesWO->getNodeNumElements();
-
-    nodes = Kokkos::View<double **, Kokkos::LayoutRight>("R", nodes_number, 3);
-    for (auto i = 0; i < nodes_number; ++i)
-        for (auto j = 0; j < 3; ++j)
-            nodes(i, j) = pbl.msh->nodes[map->mapNodesWO->getGlobalElement(i)]->pos(j);
-}
diff --git a/katoptron/src/NodesList.h b/katoptron/src/NodesList.h
deleted file mode 100644
index 9b2d2cae9310244b84b48a66e411315f9530f985..0000000000000000000000000000000000000000
--- a/katoptron/src/NodesList.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef KATOPTRON_NODESLIST_H
-#define KATOPTRON_NODESLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to store the node information.
- */
-class NodesList
-{
-public:
-    Kokkos::View<double **, Kokkos::LayoutRight> nodes;
-
-    Map::local_ordinal_type nodes_number;
-
-    NodesList(Problem &pbl, Teuchos::RCP<Map> map);
-};
-
-}; // namespace katoptron
-
-#endif //KATOPTRON_NODESLIST_H
diff --git a/katoptron/src/PreloadList.h b/katoptron/src/PreloadList.h
deleted file mode 100644
index 6d86a2798640931882282b04213e61b263bec03e..0000000000000000000000000000000000000000
--- a/katoptron/src/PreloadList.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef KATOPTRON_PRELOADLIST_H
-#define KATOPTRON_PRELOADLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wContact.h"
-#include "wTag.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-#include "EnsembleTraits.h"
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store the list of the preloads.
- */
-template <typename scalar>
-class PreloadList
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-private:
-    Kokkos::View<scalar *, Kokkos::LayoutRight> contacts_dg;
-
-public:
-    PreloadList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
-
-    /**
-     * @brief Return the value of the preload for
-     * a given contact interface.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the contact interface ID.
-     * </ul> 
-     */
-    inline scalar getPreloadValue(local_ordinal_type i)
-    {
-        return contacts_dg(i);
-    }
-};
-
-/**
- * @brief NeumannList constructor
- * 
- * This constructor allocates 1 Kokkos::View which stores all the preload related to each contact interface.
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to an ElementList object.
- * </ul>
- */
-template <typename scalar>
-PreloadList<scalar>::PreloadList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
-{
-    int contacts_number = pbl.Contacts.size();
-
-    typedef EnsembleTraits<scalar> ET;
-    const int ensemble_size = ET::size;
-
-    contacts_dg = Kokkos::View<scalar *, Kokkos::LayoutRight>("R", contacts_number);
-    for (auto i = 0; i < contacts_number; ++i)
-        for (int j = 0; j < ensemble_size; ++j)
-            ET::coeff(contacts_dg(i), j) = pbl.Contacts[i]->dg_vector[j];
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_PRELOADLIST_H
diff --git a/katoptron/src/ResultsDecl.hpp b/katoptron/src/ResultsDecl.hpp
deleted file mode 100644
index 9fac353203749ce64ad6867142c4912a433a5e81..0000000000000000000000000000000000000000
--- a/katoptron/src/ResultsDecl.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef KATOPTRON_RESULTSDECL_HPP
-#define KATOPTRON_RESULTSDECL_HPP
-
-#include "katoptron.h"
-#include "wObject.h"
-#include "wTimer.h"
-#include "wTimers.h"
-#include "wTag.h"
-#include "wMedium.h"
-#include "wNode.h"
-
-#include "Teuchos_ParameterList.hpp"
-
-#include "wProblem.h"
-#include "wContact.h"
-#include "wMshData.h"
-#include "wDisplayHook.h"
-#include "wElement.h"
-
-// Tpetra
-#include "Stokhos_Tpetra_MP_Vector.hpp"
-#include "Stokhos_Tpetra_Utilities_MP_Vector.hpp"
-#include "Tpetra_ConfigDefs.hpp"
-
-#include "Tpetra_Map.hpp"
-#include "Tpetra_MultiVector.hpp"
-#include "Tpetra_Vector.hpp"
-#include "Tpetra_CrsGraph.hpp"
-#include "Tpetra_CrsMatrix.hpp"
-
-#include <Teuchos_Array.hpp>
-#include <Teuchos_GlobalMPISession.hpp>
-#include <Teuchos_oblackholestream.hpp>
-#include <Teuchos_ScalarTraits.hpp>
-#include <Teuchos_RCP.hpp>
-#include "Teuchos_ParameterList.hpp"
-
-#include "Kokkos_ViewFactory.hpp"
-#include "Kokkos_Vector.hpp"
-
-#include "wRandomField.h"
-#include "wResults.h"
-#include "wLazy.h"
-#include "Map.h"
-#include <map>
-#include "EnsembleTraits.h"
-
-/**
- * @brief Function to write results on disk using VTK formats.
- */
-template <class Scalar, class LocalOrdinal, class GlobalOrdinal>
-void writeResultsVTK(
-    const katoptron::Problem &pbl,
-    Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal>> xPost,
-    Teuchos::RCP<katoptron::Map> map,
-    Teuchos::RCP<RandomField<Scalar, Kokkos::DefaultExecutionSpace>> random_field,
-    std::string name,
-    size_t ast,
-    bool final_result,
-    bool write_txt);
-
-#endif //KATOPTRON_RESULTSDECL_HPP
diff --git a/katoptron/src/ResultsDef.hpp b/katoptron/src/ResultsDef.hpp
deleted file mode 100644
index 28b6389b0adc667e1216e8c4201cdf931d7bb1fc..0000000000000000000000000000000000000000
--- a/katoptron/src/ResultsDef.hpp
+++ /dev/null
@@ -1,366 +0,0 @@
-#ifndef KATOPTRON_RESULTSDEF_HPP
-#define KATOPTRON_RESULTSDEF_HPP
-
-#include "ResultsDecl.hpp"
-#include "StressComputation.h"
-
-/* @todo should be removed */
-#ifdef WAVES_USE_TBOXVTK
-#include "tboxVtk.h"
-#include "wVtkExport_KIM2CLEAN.h"
-#endif
-
-template <class Scalar, class LocalOrdinal, class GlobalOrdinal>
-void writeResultsVTK(
-    const katoptron::Problem &pbl,
-    Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal>> xPost,
-    Teuchos::RCP<katoptron::Map> map,
-    Teuchos::RCP<RandomField<Scalar, Kokkos::DefaultExecutionSpace>> random_field,
-    std::string name,
-    size_t ast,
-    bool final_result,
-    bool write_txt)
-{
-    /* @todo [AC] temporary fix for initializing Mem in katoptron */
-    for (auto e : pbl.msh->elems)
-    {
-        if (e->type() == tbox::ElType::HEX8 || e->type() == tbox::ElType::TETRA4) // 3D
-            e->initValues(true);
-        //else // 2D
-        //    e->initValues(false);
-    }
-    /* end temporary fix*/
-
-    // Extraction of types and ensemble format
-
-    xPost->template sync<Kokkos::HostSpace>();
-    auto x_2d = xPost->template getLocalView<Kokkos::HostSpace>();
-    auto X = Kokkos::subview(x_2d, Kokkos::ALL(), 0);
-
-    typedef EnsembleTraits<Scalar> ET;
-
-    const size_t ensemble_size = ET::size;
-
-    typedef decltype(X) X_View;
-    typename Kokkos::FlatArrayType<X_View>::type X_flat = X;
-
-    size_t numPrimalDPN = map->numPrimalDPN;
-
-    // Construction of the maps
-
-    std::map<LocalOrdinal, GlobalOrdinal> nodesWO_LO_to_GO;
-    std::map<GlobalOrdinal, LocalOrdinal> nodesWO_GO_to_LO;
-    std::map<GlobalOrdinal, LocalOrdinal> elements_GO_to_LO;
-    std::vector<GlobalOrdinal> contactElementID;
-    std::map<LocalOrdinal, GlobalOrdinal> lagrange_LO_to_nodes_GO;
-    std::map<GlobalOrdinal, LocalOrdinal> nodes_GO_to_lagrange_LO;
-
-    LocalOrdinal index = 0;
-
-    for (LocalOrdinal i = 0; i < map->mapElems->getNodeNumElements(); ++i)
-    {
-        if (pbl.msh->elems[i]->type() == tbox::ElType::HEX8 || pbl.msh->elems[i]->type() == tbox::ElType::TETRA4)
-        {
-            GlobalOrdinal global_i = map->mapElems->getGlobalElement(i);
-            elements_GO_to_LO[global_i] = index;
-            ++index;
-        }
-    }
-
-    for (LocalOrdinal i = 0; i < map->mapNodesWO->getNodeNumElements(); ++i)
-    {
-        GlobalOrdinal global_i = map->mapNodesWO->getGlobalElement(i);
-        nodesWO_LO_to_GO[i] = global_i;
-        nodesWO_GO_to_LO[global_i] = i;
-    }
-
-    LocalOrdinal numNodes = nodesWO_LO_to_GO.size();
-    LocalOrdinal numMechanicalDualDOFs = map->lagrange_to_dof.size();
-    LocalOrdinal numPrimalDOFs = numPrimalDPN * numNodes;
-
-    std::map<LocalOrdinal, GlobalOrdinal> elems_LO_to_GO;
-    std::map<GlobalOrdinal, LocalOrdinal> elems_GO_to_LO;
-
-    for (GlobalOrdinal i = 0; i < pbl.msh->elems.size(); ++i)
-    {
-        if (pbl.msh->elems[i]->type() == tbox::ElType::HEX8 || pbl.msh->elems[i]->type() == tbox::ElType::TETRA4)
-        {
-            LocalOrdinal local_i = pbl.msh->elems[i]->no - 1;
-            elems_LO_to_GO[local_i] = i;
-            elems_GO_to_LO[i] = local_i;
-        }
-    }
-
-    if (pbl.Contacts.size() >= 1)
-    {
-        std::vector<GlobalOrdinal> tmpcontactElementID;
-        for (size_t i = 0; i < pbl.Contacts.size(); ++i)
-            for (LocalOrdinal j = 0; j < pbl.Contacts[i]->slave_elems.size(); ++j)
-                tmpcontactElementID.push_back(pbl.Contacts[i]->slave_elems[j]->no - 1);
-
-        if (tmpcontactElementID.size() > 1)
-        {
-            std::sort(tmpcontactElementID.begin(), tmpcontactElementID.end());
-
-            if (tmpcontactElementID.size() >= 1)
-            {
-                contactElementID.push_back(tmpcontactElementID[0]);
-                if (tmpcontactElementID.size() > 1)
-                    for (LocalOrdinal i = 1; i < tmpcontactElementID.size(); ++i)
-                        if (tmpcontactElementID[i] != tmpcontactElementID[i - 1])
-                            contactElementID.push_back(tmpcontactElementID[i]);
-            }
-        }
-    }
-
-    // Values in which we are interested
-
-    std::vector<double> displacement_x(numNodes);
-    std::vector<double> displacement_y(numNodes);
-    std::vector<double> displacement_z(numNodes);
-    std::vector<double> shear_modulus_per_node(numNodes);
-
-    std::vector<double> sigma_vm_nodes(numNodes);
-    std::vector<size_t> adjacent_elems(numNodes);
-    std::vector<Eigen::MatrixXd> stress_at_nodes(numNodes);
-    std::vector<Eigen::MatrixXd> strain_at_nodes(numNodes);
-
-    std::vector<Eigen::MatrixXd> stress(pbl.msh->elems.size());
-    std::vector<Eigen::MatrixXd> strain(pbl.msh->elems.size());
-
-    std::vector<double> sigma_vm(pbl.msh->elems.size());
-
-    std::vector<double> G_vector(pbl.msh->elems.size());
-
-    std::vector<Eigen::Vector3d> displacement(numNodes);
-
-    std::vector<double> displacement_u(numNodes);
-    std::vector<double> T(numNodes);
-    std::vector<double> pressure(numMechanicalDualDOFs);
-
-    std::vector<double> h_fluxes(numMechanicalDualDOFs);
-    std::vector<double> t_x(numMechanicalDualDOFs);
-    std::vector<double> t_y(numMechanicalDualDOFs);
-
-    for (auto &k : stress)
-        k = Eigen::Matrix3d::Zero();
-
-    for (auto &k : strain)
-        k = Eigen::Matrix3d::Zero();
-
-    for (auto &k : stress_at_nodes)
-        k = Eigen::Matrix3d::Zero();
-
-    for (auto &k : strain_at_nodes)
-        k = Eigen::Matrix3d::Zero();
-
-    // Fill the result vectors
-
-    for (size_t ell = 0; ell < ensemble_size; ++ell)
-    {
-
-        tbox::Results *results = new tbox::Results();
-        tbox::Results *results_contact = new tbox::Results();
-
-        results->scalars_at_nodes["x"] = &displacement_x;
-        results->scalars_at_nodes["y"] = &displacement_y;
-        results->scalars_at_nodes["z"] = &displacement_z;
-        results->scalars_at_nodes["u"] = &displacement_u;
-        results->scalars_at_nodes["G"] = &shear_modulus_per_node;
-        results->scalars_at_nodes["von Mises"] = &sigma_vm_nodes;
-        results->tensors_at_nodes["sigma"] = &stress_at_nodes;
-        results->tensors_at_nodes["epsilon"] = &strain_at_nodes;
-
-        if (numPrimalDPN == 4)
-            results->scalars_at_nodes["T"] = &T;
-
-        results->tensors_at_elems["sigma"] = &stress;
-        results->tensors_at_elems["epsilon"] = &strain;
-
-        results->scalars_at_elems["von Mises"] = &sigma_vm;
-
-        results->scalars_at_elems["G"] = &G_vector;
-
-        results->vectors_at_nodes["displacement"] = &displacement;
-
-        if (pbl.Contacts.size() > 0)
-        {
-            results_contact->scalars_at_nodes["p"] = &pressure;
-            if (numPrimalDPN == 4)
-                results_contact->scalars_at_nodes["heat fluxes"] = &h_fluxes;
-            if (map->numDualDPN == 3 || map->numDualDPN == 4)
-            {
-                results_contact->scalars_at_nodes["tangential stress 1"] = &t_x;
-                results_contact->scalars_at_nodes["tangential stress 2"] = &t_y;
-            }
-        }
-
-        for (LocalOrdinal i = 0; i < numNodes; ++i)
-        {
-            double dx, dy, dz;
-            if (numPrimalDPN == 4)
-            {
-                dx = X_flat[ensemble_size * (numNodes + 3 * i) + ell];
-                dy = X_flat[ensemble_size * (numNodes + 3 * i + 1) + ell];
-                dz = X_flat[ensemble_size * (numNodes + 3 * i + 2) + ell];
-            }
-            else
-            {
-                dx = X_flat[ensemble_size * (3 * i) + ell];
-                dy = X_flat[ensemble_size * (3 * i + 1) + ell];
-                dz = X_flat[ensemble_size * (3 * i + 2) + ell];
-            }
-
-            displacement_x[i] = dx;
-            displacement_y[i] = dy;
-            displacement_z[i] = dz;
-            displacement_u[i] = sqrt(dx * dx + dy * dy + dz * dz);
-            strain_at_nodes[i].setZero();
-            stress_at_nodes[i].setZero();
-            shear_modulus_per_node[i] = ET::coeff(random_field->operator()(pbl.msh->nodes[nodesWO_LO_to_GO[i]]->pos(0), pbl.msh->nodes[nodesWO_LO_to_GO[i]]->pos(1), pbl.msh->nodes[nodesWO_LO_to_GO[i]]->pos(2)), ell);
-            displacement[i] = Eigen::Vector3d(dx, dy, dz);
-            if (numPrimalDPN == 4 || numPrimalDPN == 1)
-                T[i] = X_flat[ensemble_size * i + ell];
-        }
-        if (pbl.Contacts.size() > 0)
-        {
-            for (LocalOrdinal i = 0; i < numMechanicalDualDOFs; ++i)
-            {
-                int i_node = map->lm_to_dof_global[i];
-                lagrange_LO_to_nodes_GO[i] = i_node;
-                nodes_GO_to_lagrange_LO[i_node] = i;
-                pressure[i] = X_flat[ensemble_size * (i * map->numDualDPN + numPrimalDOFs) + ell];
-            }
-            if (map->numDualDPN == 2 || map->numDualDPN == 4)
-                for (LocalOrdinal i = 0; i < numMechanicalDualDOFs; ++i)
-                    h_fluxes[i] = X_flat[ensemble_size * (i * map->numDualDPN + map->numDualDPN - 1 + numPrimalDOFs) + ell];
-            if (map->numDualDPN == 3 || map->numDualDPN == 4)
-                for (LocalOrdinal i = 0; i < numMechanicalDualDOFs; ++i)
-                {
-                    t_x[i] = X_flat[ensemble_size * (i * map->numDualDPN + 1 + numPrimalDOFs) + ell];
-                    t_y[i] = X_flat[ensemble_size * (i * map->numDualDPN + 2 + numPrimalDOFs) + ell];
-                }
-        }
-
-        for (auto m : pbl.media)
-        {
-            tbox::Tag *current_tag = m->tag;
-
-            double E = ET::coeff(m->E, ell);
-            double nu = ET::coeff(m->nu, ell);
-
-            double lambda = (nu * E) / ((1 + nu) * (1 - 2 * nu));
-            double G = E / (2 * (1 + nu));
-
-            for (LocalOrdinal i_elem = 0; i_elem < current_tag->elems.size(); ++i_elem)
-            {
-                if (random_field->isRandom)
-                {
-                    double x = 0., y = 0., z = 0.;
-                    size_t element_size = current_tag->elems[i_elem]->nodes.size();
-                    for (size_t j = 0; j < element_size; ++j)
-                    {
-                        x += current_tag->elems[i_elem]->nodes[j]->pos(0) / element_size;
-                        y += current_tag->elems[i_elem]->nodes[j]->pos(1) / element_size;
-                        z += current_tag->elems[i_elem]->nodes[j]->pos(2) / element_size;
-                    }
-                    G = ET::coeff(random_field->operator()(x, y, z), ell);
-                }
-                Eigen::MatrixXd H = Eigen::MatrixXd::Zero(9, 9);
-                Eigen::MatrixXd D = Eigen::MatrixXd::Zero(3, 3);
-
-                for (auto i = 0; i < 3; ++i)
-                    for (auto j = 0; j < 3; ++j)
-                        for (auto k = 0; k < 3; ++k)
-                            for (auto l = 0; l < 3; ++l)
-                            {
-                                if (i == j && k == l)
-                                    H(i * 3 + j, k * 3 + l) = lambda;
-                                if (i == k && j == l)
-                                    H(i * 3 + j, k * 3 + l) = H(i * 3 + j, k * 3 + l) + G;
-                                if (i == l && j == k)
-                                    H(i * 3 + j, k * 3 + l) = H(i * 3 + j, k * 3 + l) + G;
-                            }
-                if (numPrimalDPN == 4)
-                {
-                    double kappa = lambda + (2. / 3.) * G;
-                    double beta = ET::coeff(m->beta, ell);
-
-                    for (auto i = 0; i < 3; ++i)
-                        D(i, i) = -3. * kappa * beta;
-                }
-                std::vector<double> x_tmp(8), y_tmp(8), z_tmp(8), T_tmp(8);
-                Eigen::MatrixXd Strain(3, 3);
-                Eigen::MatrixXd Sigma(3, 3);
-
-                auto e = current_tag->elems[i_elem];
-                std::vector<Eigen::MatrixXd> Strain_at_node(e->nodes.size());
-                std::vector<Eigen::MatrixXd> Sigma_at_node(e->nodes.size());
-
-                for (auto &k : Strain_at_node)
-                    k = Eigen::MatrixXd::Zero(3, 3);
-                for (auto &k : Sigma_at_node)
-                    k = Eigen::MatrixXd::Zero(3, 3);
-
-                if (e->type() == tbox::ElType::HEX8 || e->type() == tbox::ElType::TETRA4)
-                {
-                    for (size_t i = 0; i < e->nodes.size(); ++i)
-                    {
-                        int node_i = nodesWO_GO_to_LO[e->nodes[i]->row];
-                        x_tmp[i] = displacement_x[node_i];
-                        y_tmp[i] = displacement_y[node_i];
-                        z_tmp[i] = displacement_z[node_i];
-                        if (numPrimalDPN == 4)
-                            T_tmp[i] = T[node_i];
-                        else
-                            T_tmp[i] = 0.;
-                    }
-
-                    strain_stress_x_y_z(e, Strain, Sigma, H, D, x_tmp, y_tmp, z_tmp, T_tmp, numPrimalDPN == 4);
-
-                    strain[elems_LO_to_GO[e->no - 1]] = Strain;
-                    stress[elems_LO_to_GO[e->no - 1]] = Sigma;
-
-                    G_vector[elems_LO_to_GO[e->no - 1]] = G;
-
-                    sigma_vm[elems_LO_to_GO[e->no - 1]] = sqrt((pow(Sigma(0, 0) - Sigma(1, 1), 2.) + pow(Sigma(1, 1) - Sigma(2, 2), 2.) + pow(Sigma(2, 2) - Sigma(0, 0), 2.) + 6 * (pow(Sigma(0, 1), 2.) + pow(Sigma(1, 2), 2.) + pow(Sigma(2, 0), 2.))) / 2);
-
-                    strain_stress_x_y_z_at_node(e, Strain_at_node, Sigma_at_node, H, D, x_tmp, y_tmp, z_tmp, T_tmp, numPrimalDPN == 4);
-
-                    for (size_t i = 0; i < e->nodes.size(); ++i)
-                    {
-                        LocalOrdinal node_i = nodesWO_GO_to_LO[e->nodes[i]->row];
-                        if (ell == 0)
-                            ++adjacent_elems[node_i]; // Increases the number of adjacent elements by one only for the first sample
-
-                        strain_at_nodes[node_i] += Strain_at_node[i];
-                        stress_at_nodes[node_i] += Sigma_at_node[i];
-                    }
-                }
-            }
-        }
-        for (LocalOrdinal i = 0; i < numNodes; ++i)
-        {
-            strain_at_nodes[i] /= adjacent_elems[i];
-            stress_at_nodes[i] /= adjacent_elems[i];
-
-            Eigen::MatrixXd Sigma = stress_at_nodes[i];
-
-            sigma_vm_nodes[i] = sqrt((pow(Sigma(0, 0) - Sigma(1, 1), 2.) + pow(Sigma(1, 1) - Sigma(2, 2), 2.) + pow(Sigma(2, 2) - Sigma(0, 0), 2.) + 6 * (pow(Sigma(0, 1), 2.) + pow(Sigma(1, 2), 2.) + pow(Sigma(2, 0), 2.))) / 2);
-        }
-
-        /* @todo temporary fix to output Kim's data */
-        // All the post-processing related to katoptron should be done here,
-        // then tbox::MshExport should be used, either by passing tbox::GmshExport or tboxVtk::VtkExport
-
-        tboxVtk::VtkExport_KIM2CLEAN vtkWriter(pbl.msh);
-        vtkWriter.save_MPI(pbl.msh->name + "_ast" + std::to_string(ast) + "_s" + std::to_string(ell) + ".pvtu", *results, nodesWO_LO_to_GO, nodesWO_GO_to_LO, elements_GO_to_LO);
-        if (pbl.Contacts.size() >= 1)
-            vtkWriter.save_MPI(pbl.msh->name + "_ast" + std::to_string(ast) + "_s" + std::to_string(ell) + "_contact.vtu", *results_contact, contactElementID, lagrange_LO_to_nodes_GO, nodes_GO_to_lagrange_LO);
-
-        delete results;
-        delete results_contact;
-    }
-}
-
-#endif //KATOPTRON_RESULTSDEF_HPP
diff --git a/katoptron/src/ResultsETI.cpp b/katoptron/src/ResultsETI.cpp
deleted file mode 100644
index aa362ebfb080ffbc9c4833acddf201a9cde0136e..0000000000000000000000000000000000000000
--- a/katoptron/src/ResultsETI.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "ResultsDecl.hpp"
-#include "ResultsDef.hpp"
-
-typedef katoptron::Map::local_ordinal_type local_ordinal_type;
-typedef katoptron::Map::global_ordinal_type global_ordinal_type;
-
-#define SCALAR double
-
-template void writeResultsVTK<SCALAR, local_ordinal_type, global_ordinal_type>(
-    const katoptron::Problem &,
-    Teuchos::RCP<Tpetra::Vector<SCALAR, local_ordinal_type, global_ordinal_type>>,
-    Teuchos::RCP<katoptron::Map>,
-    Teuchos::RCP<RandomField<SCALAR, Kokkos::DefaultExecutionSpace>>,
-    std::string,
-    size_t,
-    bool,
-    bool);
-
-#undef SCALAR
-
-#define SCALAR Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>
-
-template void writeResultsVTK<SCALAR, local_ordinal_type, global_ordinal_type>(
-    const katoptron::Problem &,
-    Teuchos::RCP<Tpetra::Vector<SCALAR, local_ordinal_type, global_ordinal_type>>,
-    Teuchos::RCP<katoptron::Map>,
-    Teuchos::RCP<RandomField<SCALAR, Kokkos::DefaultExecutionSpace>>,
-    std::string,
-    size_t,
-    bool,
-    bool);
-
-#undef SCALAR
-
-#define SCALAR Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>
-
-template void writeResultsVTK<SCALAR, local_ordinal_type, global_ordinal_type>(
-    const katoptron::Problem &,
-    Teuchos::RCP<Tpetra::Vector<SCALAR, local_ordinal_type, global_ordinal_type>>,
-    Teuchos::RCP<katoptron::Map>,
-    Teuchos::RCP<RandomField<SCALAR, Kokkos::DefaultExecutionSpace>>,
-    std::string,
-    size_t,
-    bool,
-    bool);
-
-#undef SCALAR
-
-#define SCALAR Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>
-
-template void writeResultsVTK<SCALAR, local_ordinal_type, global_ordinal_type>(
-    const katoptron::Problem &,
-    Teuchos::RCP<Tpetra::Vector<SCALAR, local_ordinal_type, global_ordinal_type>>,
-    Teuchos::RCP<katoptron::Map>,
-    Teuchos::RCP<RandomField<SCALAR, Kokkos::DefaultExecutionSpace>>,
-    std::string,
-    size_t,
-    bool,
-    bool);
-
-#undef SCALAR
-
-#define SCALAR Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>
-
-template void writeResultsVTK<SCALAR, local_ordinal_type, global_ordinal_type>(
-    const katoptron::Problem &,
-    Teuchos::RCP<Tpetra::Vector<SCALAR, local_ordinal_type, global_ordinal_type>>,
-    Teuchos::RCP<katoptron::Map>,
-    Teuchos::RCP<RandomField<SCALAR, Kokkos::DefaultExecutionSpace>>,
-    std::string,
-    size_t,
-    bool,
-    bool);
-
-#undef SCALAR
diff --git a/katoptron/src/SourcesList.h b/katoptron/src/SourcesList.h
deleted file mode 100644
index 2c262ff63f1f3919c8f465b9bd3b3ccbb181aa8c..0000000000000000000000000000000000000000
--- a/katoptron/src/SourcesList.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef KATOPTRON_SOURCESLIST_H
-#define KATOPTRON_SOURCESLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wSource.h"
-#include "wTag.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store the list of the volumetric heat sources.
- */
-template <typename scalar>
-class SourcesList
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-private:
-    Kokkos::View<int **, Kokkos::LayoutRight> sources_elementsList;
-    Kokkos::View<scalar ***, Kokkos::LayoutRight> sources_values_list;
-
-    local_ordinal_type sources_number;
-    local_ordinal_type sources_size;
-    local_ordinal_type sources_elements;
-
-    local_ordinal_type sources_time;
-    local_ordinal_type sources_values;
-
-public:
-    SourcesList();
-    SourcesList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
-
-    /**
-     * @brief Return the number of sources.
-     */
-    inline local_ordinal_type getSourceNumber() { return sources_number; }
-
-    /**
-     * @brief Return the number of elements for a
-     * given source.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the source ID.
-     * </ul>
-     */
-    inline local_ordinal_type getSourceSize(local_ordinal_type i)
-    {
-        return sources_elementsList(i, sources_size);
-    }
-
-    /**
-     * @brief Return the local ID of the element e1 of 
-     * a source.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the source ID,
-     *  <li> e1: the ID of the element on the current BC.
-     * </ul>
-     */
-    inline local_ordinal_type getSourceElement(local_ordinal_type i, local_ordinal_type ea)
-    {
-        return sources_elementsList(i, sources_elements + ea);
-    }
-
-    /**
-     * @brief Return the value of the source.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the source ID.
-     * </ul> 
-     */
-    inline scalar getSourceValue(local_ordinal_type i)
-    {
-        return sources_values_list(i, 0, sources_values);
-    }
-};
-
-/**
- * @brief SourcesList constructor
- * 
- * This constructor allocates 2 Kokkos::View which store all the required information related to source, including:
- * <ul>
- *  <li> all the source elements,
- *  <li> all the values of the heat source.
- * </ul>
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to an ElementList object.
- * </ul>
- */
-template <typename scalar>
-SourcesList<scalar>::SourcesList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
-{
-    typedef local_ordinal_type local_ordinal_type;
-    typedef global_ordinal_type global_ordinal_type;
-
-    sources_number = pbl.Sources.size();
-    local_ordinal_type maxNumElemsPerSource = 0;
-
-    std::vector<std::vector<global_ordinal_type>> SourceElems = {};
-
-    for (auto i = 0; i < sources_number; ++i)
-    {
-        std::vector<global_ordinal_type> mySourceElems = {};
-
-        for (auto j = 0; j < pbl.Sources[i]->tag->elems.size(); ++j)
-        {
-            local_ordinal_type e = map->mapElems->getLocalElement(pbl.Sources[i]->tag->elems[j]->no - 1);
-
-            if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::TETRA4))
-                ;
-            else if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::HEX8))
-                ;
-            else
-                continue;
-
-            mySourceElems.push_back(e);
-        }
-
-        SourceElems.push_back(mySourceElems);
-        if (maxNumElemsPerSource < mySourceElems.size())
-            maxNumElemsPerSource = mySourceElems.size();
-    }
-
-    sources_size = 0;
-    sources_elements = 1;
-    sources_elementsList = Kokkos::View<int **, Kokkos::LayoutRight>("R", sources_number, sources_elements + maxNumElemsPerSource);
-
-    for (auto i = 0; i < sources_number; ++i)
-    {
-        sources_elementsList(i, sources_size) = SourceElems[i].size();
-
-        for (auto j = 0; j < SourceElems[i].size(); ++j)
-            sources_elementsList(i, sources_elements + j) = SourceElems[i][j];
-    }
-
-    sources_time = 0;
-    sources_values = 1;
-    sources_values_list = Kokkos::View<scalar ***, Kokkos::LayoutRight>("R", sources_number, 1, 2);
-    for (auto i = 0; i < sources_number; ++i)
-    {
-        sources_values_list(i, 0, sources_time) = 0.; //to change latter
-
-        sources_values_list(i, 0, sources_values) = pbl.Sources[i]->value;
-    }
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_SOURCESLIST_H
diff --git a/katoptron/src/StressComputation.h b/katoptron/src/StressComputation.h
deleted file mode 100644
index ec6c1e817215c04e83e718422b7c4a96f86b1d54..0000000000000000000000000000000000000000
--- a/katoptron/src/StressComputation.h
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef KATOPTRON_STRESSCOMPUTATION_H
-#define KATOPTRON_STRESSCOMPUTATION_H
-
-#include "wHex8.h"
-#include "wSfHex8.h"
-#include "wGaussHex8.h"
-#include "wCacheHex8.h"
-
-#include "wTetra4.h"
-#include "wSfTetra4.h"
-#include "wGaussTetra4.h"
-#include "wCacheTetra4.h"
-
-/**
- * @brief Those functions compute the stress and strain at nodes and in average per element.
- * They are currently implemented using Eigen data structure but should be refactored using Kokkos:view
- * such that it will be possible to use parallel for in the future.
- */
-
-void strain_at_gp(size_t n_n, tbox::Element &el, tbox::Cache &cache, size_t a, const Eigen::MatrixXd &u_e, Eigen::MatrixXd &Strain)
-{
-    Eigen::MatrixXd const &J = el.getJinv(a);
-    Eigen::MatrixXd const &dffi = cache.getDsf(a);
-    Eigen::Matrix3d du_d_Phi = Eigen::Matrix3d::Zero();
-    for (size_t i = 0; i < n_n; ++i)
-    {
-        for (auto k = 0; k < 3; ++k)
-            for (auto j = 0; j < 3; ++j)
-                du_d_Phi(j, k) += dffi(j, i) * u_e(k, i);
-    }
-    Strain += (J * du_d_Phi).transpose() * (J * du_d_Phi) * 0.5;
-}
-
-void compute_stress(size_t n_n, const Eigen::MatrixXd &Strain, Eigen::MatrixXd &Stress, const Eigen::MatrixXd &H, const Eigen::MatrixXd &D, const std::vector<double> &T, bool thermal)
-{
-    Stress = Eigen::Matrix3d::Zero();
-    for (size_t i = 0; i < 3; ++i)
-        for (size_t j = 0; j < 3; ++j)
-            for (size_t k = 0; k < 3; ++k)
-                for (size_t l = 0; l < 3; ++l)
-                    Stress(i, j) += H(i * 3 + j, k * 3 + l) * Strain(k, l);
-
-    if (thermal)
-        for (size_t i = 0; i < 3; ++i)
-            for (size_t j = 0; j < 3; ++j)
-            {
-                double tmp = 0.;
-                for (size_t k = 0; k < n_n; ++k)
-                    tmp += D(i, j) * T[k];
-                tmp /= n_n;
-                Stress(i, j) += tmp;
-            }
-}
-
-void strain_stress_x_y_z(tbox::Element *elem, Eigen::MatrixXd &Strain, Eigen::MatrixXd &Stress, const Eigen::MatrixXd &H, const Eigen::MatrixXd &D, const std::vector<double> &x, const std::vector<double> &y, const std::vector<double> &z, const std::vector<double> &T, bool thermal = false)
-{
-    tbox::Cache &cache = elem->getVCache();
-
-    size_t n_gp = cache.getVGauss().getN();
-    size_t n_n = elem->nodes.size();
-
-    Eigen::MatrixXd u_e(3, n_n);
-
-    for (size_t i = 0; i < n_n; ++i)
-    {
-        u_e(0, i) = x[i];
-        u_e(1, i) = y[i];
-        u_e(2, i) = z[i];
-    }
-
-    Strain = Eigen::Matrix3d::Zero();
-    for (size_t a = 0; a < n_gp; ++a)
-    {
-        strain_at_gp(n_n, *elem, cache, a, u_e, Strain);
-    }
-    Strain /= n_n;
-
-    compute_stress(n_n, Strain, Stress, H, D, T, thermal);
-}
-
-void strain_stress_x_y_z_at_node(tbox::Element *elem, std::vector<Eigen::MatrixXd> &Strain_at_node, std::vector<Eigen::MatrixXd> &Stress_at_node, const Eigen::MatrixXd &H, const Eigen::MatrixXd &D, const std::vector<double> &x, const std::vector<double> &y, const std::vector<double> &z, const std::vector<double> &T, bool thermal = false)
-{
-    tbox::Cache &cache = elem->getVCache();
-
-    size_t n_gp = cache.getVGauss().getN();
-    size_t n_n = elem->nodes.size();
-
-    std::vector<Eigen::MatrixXd> Strain_at_gp(n_gp);
-    std::vector<Eigen::MatrixXd> Stress_at_gp(n_gp);
-    Eigen::MatrixXd u_e(3, n_n);
-    Eigen::MatrixXd Strain(3, 3);
-
-    for (auto &k : Strain_at_gp)
-        k.resize(3, 3);
-    for (auto &k : Stress_at_gp)
-        k.resize(3, 3);
-
-    for (size_t i = 0; i < n_n; ++i)
-    {
-        u_e(0, i) = x[i];
-        u_e(1, i) = y[i];
-        u_e(2, i) = z[i];
-    }
-
-    for (size_t a = 0; a < n_gp; ++a)
-    {
-        Strain = Eigen::Matrix3d::Zero();
-        strain_at_gp(n_n, *elem, cache, a, u_e, Strain);
-        Strain_at_gp[a] = Strain;
-        compute_stress(n_n, Strain, Stress_at_gp[a], H, D, T, thermal);
-    }
-
-    // Extrapolation at node points
-    Eigen::MatrixXd values_at_gp(n_gp, 18);
-    for (size_t i = 0; i < 3; ++i)
-        for (size_t j = 0; j < 3; ++j)
-            for (size_t a = 0; a < n_gp; ++a)
-            {
-                values_at_gp(a, i * 3 + j) = Strain_at_gp[a](i, j);
-                values_at_gp(a, 9 + i * 3 + j) = Stress_at_gp[a](i, j);
-            }
-
-    Eigen::MatrixXd values_at_node = elem->gp2node(values_at_gp);
-    for (size_t k = 0; k < n_n; ++k)
-        for (size_t i = 0; i < 3; ++i)
-            for (size_t j = 0; j < 3; ++j)
-            {
-                Strain_at_node[k](i, j) = values_at_node(k, i * 3 + j);
-                Stress_at_node[k](i, j) = values_at_node(k, 9 + i * 3 + j);
-            }
-}
-
-#endif //KATOPTRON_STRESSCOMPUTATION_H
\ No newline at end of file
diff --git a/katoptron/src/Vectors.h b/katoptron/src/Vectors.h
deleted file mode 100644
index 5a5069f1e8abbe042d526252afb306f740171927..0000000000000000000000000000000000000000
--- a/katoptron/src/Vectors.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef KATOPTRON_VECTORS_H
-#define KATOPTRON_VECTORS_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Xpetra_BlockedMultiVector.hpp>
-#include <Xpetra_MultiVector.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which includes all the Trilinos vectors (Tpetra vectors and Xpetra vectors) used
- * in the simulation.
- */
-template <typename scalar>
-class Vectors
-{
-public:
-    //
-    // Convenience typedefs
-    //
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-    typedef Map::node_type node_type;
-    typedef Map::tpetra_map_type tpetra_map_type;
-    typedef Map::xpetra_bmap_type xpetra_bmap_type;
-
-    typedef Tpetra::Vector<scalar, local_ordinal_type, global_ordinal_type, node_type> tpetra_vector_type;
-    typedef Tpetra::MultiVector<scalar, local_ordinal_type, global_ordinal_type, node_type> tpetra_mvector_type;
-
-    typedef Xpetra::BlockedMultiVector<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_bmvector_type;
-    typedef Xpetra::MultiVector<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_mvector_type;
-    typedef Xpetra::TpetraMultiVector<scalar, local_ordinal_type, global_ordinal_type, node_type> xpetra_tmvector_type;
-
-    Teuchos::RCP<tpetra_vector_type> bWO;
-    Teuchos::RCP<tpetra_vector_type> b;
-
-    Teuchos::RCP<tpetra_vector_type> weights;
-
-    Teuchos::RCP<tpetra_vector_type> x;
-    Teuchos::RCP<tpetra_vector_type> lagrange;
-
-    Teuchos::RCP<tpetra_vector_type> initialGap;
-
-    Teuchos::RCP<xpetra_bmvector_type> rhsBlockedMultiVector;
-    Teuchos::RCP<xpetra_bmvector_type> solutionBlockedMultiVector;
-
-    Teuchos::RCP<xpetra_mvector_type> rhsMultiVector;
-    Teuchos::RCP<xpetra_mvector_type> solutionMultiVector;
-
-    Vectors(Teuchos::RCP<Map> map);
-};
-
-/**
- * @brief Vectors constructor
- * 
- * Argument:
- * <ul>
- *  <li> graph: an RCP to a Map object.
- * </ul>
- */
-template <typename scalar>
-Vectors<scalar>::Vectors(Teuchos::RCP<Map> map)
-{
-    bWO = rcp(new tpetra_vector_type(map->mapDofsWO, true));
-    b = rcp(new tpetra_vector_type(map->mapDofs, true));
-    x = rcp(new tpetra_vector_type(map->mapDofs, true));
-    weights = rcp(new tpetra_vector_type(map->mapDofs, true));
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_VECTORS_H
diff --git a/katoptron/src/WeightsList.h b/katoptron/src/WeightsList.h
deleted file mode 100644
index bf1cbe4d802271266b349d8e37cf8e87680b7243..0000000000000000000000000000000000000000
--- a/katoptron/src/WeightsList.h
+++ /dev/null
@@ -1,200 +0,0 @@
-#ifndef KATOPTRON_WEIGHTSLIST_H
-#define KATOPTRON_WEIGHTSLIST_H
-
-#include "katoptron.h"
-
-#include "Map.h"
-#include "wWeight.h"
-#include "wTag.h"
-
-#include <Tpetra_Map.hpp>
-#include <Tpetra_Vector.hpp>
-#include <Teuchos_RCP.hpp>
-#include <Kokkos_ViewFactory.hpp>
-
-#include "EnsembleTraits.h"
-
-using Teuchos::RCP;
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to store the list of the weights used
- * for the residual computation.
- */
-template <typename scalar>
-class WeightsList
-{
-    typedef Map::local_ordinal_type local_ordinal_type;
-    typedef Map::global_ordinal_type global_ordinal_type;
-
-private:
-    Kokkos::View<int **, Kokkos::LayoutRight> weights_nodesList;
-    Kokkos::View<scalar **, Kokkos::LayoutRight> weights_values_list;
-
-    local_ordinal_type weights_number;
-    local_ordinal_type weights_size;
-    local_ordinal_type weights_nodes;
-
-    local_ordinal_type weights_dofs;
-    local_ordinal_type weights_values;
-
-public:
-    WeightsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
-
-    /**
-     * @brief Return the number of weighted regions.
-     */
-    inline local_ordinal_type getWeightRegionsNumber()
-    {
-        return weights_number;
-    }
-
-    /**
-     * @brief Return the number of nodes for a
-     * given weighted region.
-     * 
-     * Argument:
-     * <ul>
-     *  <li> i: the weighted region ID.
-     * </ul>
-     */
-    inline local_ordinal_type getWeightRegionSize(local_ordinal_type i)
-    {
-        return weights_nodesList(i, weights_size);
-    }
-
-    /**
-     * @brief Return the global ID of the node n1 of 
-     * a given weighted region.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the weighted region ID,
-     *  <li> n1: the ID of the node on the current BC.
-     * </ul>
-     */
-    inline local_ordinal_type getNode(local_ordinal_type i, local_ordinal_type n1)
-    {
-        return weights_nodesList(i, weights_nodes + n1);
-    }
-
-    /**
-     * @brief Return whether the DOF j is weighted for 
-     * a given weighted region.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the weighted region ID,
-     *  <li> j: the index of the DOF (0-3 if thermomechanical problems).
-     * </ul> 
-     */
-    inline bool getWeightDof(local_ordinal_type i, local_ordinal_type j)
-    {
-        return (weights_values_list(i, weights_dofs + j) == scalar(1.));
-    }
-
-    /**
-     * @brief Return the value of weight for the
-     * DOF for a given weighted region.
-     * 
-     * Arguments:
-     * <ul>
-     *  <li> i: the weighted region ID,
-     *  <li> j: the index of the DOF (0-3 if thermomechanical problems).
-     * </ul> 
-     */
-    inline scalar getWeightValue(local_ordinal_type i, local_ordinal_type j)
-    {
-        return weights_values_list(i, weights_values + j);
-    }
-};
-
-/**
- * @brief WeightsList constructor
- *
- * This constructor allocates 2 Kokkos::View which store all the required information related to each weighted region, including:
- * <ul>
- *  <li> all the weighted nodes,
- *  <li> all the values of the weights.
- * </ul>
- *
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> map: an RCP to a Map object,
- *  <li> elementsList: an RCP to an ElementList object.
- * </ul>
- */
-template <typename scalar>
-WeightsList<scalar>::WeightsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
-{
-    typedef EnsembleTraits<scalar> ET;
-    const int ensemble_size = ET::size;
-
-    local_ordinal_type numDPN = map->numPrimalDPN;
-
-    weights_number = pbl.Weights.size();
-    local_ordinal_type maxNumNodesPerWeight = 0;
-
-    std::vector<std::vector<global_ordinal_type>> WeightNodes = {};
-
-    for (auto i = 0; i < weights_number; ++i)
-    {
-        std::vector<global_ordinal_type> tmpMyWeightNodes = {};
-        std::vector<global_ordinal_type> myWeightNodes = {};
-
-        for (auto j = 0; j < pbl.Weights[i]->nodes.size(); ++j)
-            tmpMyWeightNodes.push_back(pbl.Weights[i]->nodes[j]->row);
-
-        std::sort(tmpMyWeightNodes.begin(), tmpMyWeightNodes.end());
-
-        if (tmpMyWeightNodes.size() >= 1)
-            myWeightNodes.push_back(tmpMyWeightNodes[0]);
-
-        for (auto ii = 1; ii < tmpMyWeightNodes.size(); ++ii)
-            if (tmpMyWeightNodes[ii] != tmpMyWeightNodes[ii - 1])
-                myWeightNodes.push_back(tmpMyWeightNodes[ii]);
-
-        WeightNodes.push_back(myWeightNodes);
-        if (maxNumNodesPerWeight < myWeightNodes.size())
-            maxNumNodesPerWeight = myWeightNodes.size();
-    }
-
-    weights_size = 0;
-    weights_nodes = 1;
-    weights_nodesList = Kokkos::View<int **, Kokkos::LayoutRight>("R", weights_number, weights_nodes + maxNumNodesPerWeight);
-
-    for (auto i = 0; i < weights_number; ++i)
-    {
-        weights_nodesList(i, weights_size) = WeightNodes[i].size();
-
-        for (auto j = 0; j < WeightNodes[i].size(); ++j)
-            weights_nodesList(i, weights_nodes + j) = WeightNodes[i][j];
-    }
-
-    weights_dofs = 0;
-    weights_values = weights_dofs + numDPN;
-    weights_values_list = Kokkos::View<scalar **, Kokkos::LayoutRight>("R", weights_number, 2 * numDPN);
-    for (auto i = 0; i < weights_number; ++i)
-    {
-        for (auto j = 0; j < numDPN; ++j)
-            if (pbl.Weights[i]->which_dof[j])
-                weights_values_list(i, weights_dofs + j) = 1;
-            else
-                weights_values_list(i, weights_dofs + j) = 0;
-
-        for (int s = 0; s < ensemble_size; ++s)
-        {
-            ET::coeff(weights_values_list(i, weights_values + 0), s) = pbl.Weights[i]->x_values[s];
-            ET::coeff(weights_values_list(i, weights_values + 1), s) = pbl.Weights[i]->y_values[s];
-            ET::coeff(weights_values_list(i, weights_values + 2), s) = pbl.Weights[i]->z_values[s];
-            if (numDPN == 4)
-                ET::coeff(weights_values_list(i, weights_values + 3), s) = pbl.Weights[i]->T_values[s];
-        }
-    }
-}
-}; // namespace katoptron
-
-#endif //KATOPTRON_WEIGHTSLIST_H
\ No newline at end of file
diff --git a/katoptron/src/katoptron.h b/katoptron/src/katoptron.h
deleted file mode 100644
index b59bf330eda5468dbc00a8e6dfc4ba6c1591828e..0000000000000000000000000000000000000000
--- a/katoptron/src/katoptron.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// global header of the "katoptron" module
-
-#ifndef KATOPTRON_H
-#define KATOPTRON_H
-
-#if defined(WIN32)
-#ifdef tlnos_EXPORTS
-#define KATOPTRON_API __declspec(dllexport)
-#else
-#define KATOPTRON_API __declspec(dllimport)
-#endif
-#else
-#define KATOPTRON_API
-#endif
-
-#include "tbox.h"
-
-/**
- * @brief katoptron namespace
- */
-
-namespace katoptron
-{
-class Problem;
-class Solver;
-class Dirichlet;
-class Neumann;
-class Medium;
-class Contact;
-class Source;
-class RandomVariable;
-class Weight;
-}; // namespace katoptron
-
-class DisplayHook;
-
-#endif //KATOPTRON_H
diff --git a/katoptron/src/tMatrix.h b/katoptron/src/tMatrix.h
deleted file mode 100644
index 333655232f6baa8fb875ae5e76198d4fadf47888..0000000000000000000000000000000000000000
--- a/katoptron/src/tMatrix.h
+++ /dev/null
@@ -1,223 +0,0 @@
-#ifndef KATOPTRON_TMATRIX_H
-#define KATOPTRON_TMATRIX_H
-
-#include "Stokhos_Tpetra_MP_Vector.hpp"
-
-template <class T, int rows>
-class tVector;
-
-template <class T, int rows, int cols>
-class tMatrix
-{
-public:
-    tMatrix()
-    {
-        for (auto i = 0; i < rows; ++i)
-            for (auto j = 0; j < cols; ++j)
-                data[i * cols + j] = (T)0;
-    }
-    T &operator()(int row, int col);
-    tMatrix operator+(tMatrix rhs);
-    void operator+=(tMatrix rhs);
-    T det();       //only for 3x3
-    tMatrix inv(); //only for 3x3
-    tMatrix operator*(tMatrix rhs);
-    tVector<T, rows> operator*(tVector<T, cols> rhs);
-    template <class U>
-    tVector<typename Sacado::Promote<T, U>::type, rows> operator*(tVector<U, cols> rhs);
-    void print();
-    void clean()
-    {
-        for (auto i = 0; i < rows; ++i)
-            for (auto j = 0; j < cols; ++j)
-                data[i * cols + j] = (T)0;
-    }
-
-private:
-    T data[rows * cols];
-    int numRows = rows;
-    int numCols = cols;
-    int getRows() { return numRows; }
-    int getCols() { return numCols; }
-};
-
-template <class T, int rows, int cols>
-template <class U>
-tVector<typename Sacado::Promote<T, U>::type, rows> tMatrix<T, rows, cols>::operator*(tVector<U, cols> rhs)
-{
-    tVector<typename Sacado::Promote<T, U>::type, rows> results;
-    for (auto i = 0; i < rows; ++i)
-        for (auto j = 0; j < cols; ++j)
-            results(i) += data[i * cols + j] * rhs(j);
-    return results;
-}
-
-template <class T, int rows, int cols>
-tMatrix<T, rows, cols> tMatrix<T, rows, cols>::operator+(tMatrix<T, rows, cols> rhs)
-{
-    tMatrix<T, rows, cols> results;
-    for (auto i = 0; i < rows; ++i)
-        for (auto j = 0; j < cols; ++j)
-            results(i, j) = data[i * cols + j] + rhs(i, j);
-    return results;
-}
-
-template <class T, int rows, int cols>
-void tMatrix<T, rows, cols>::operator+=(tMatrix<T, rows, cols> rhs)
-{
-    for (auto i = 0; i < rows; ++i)
-        for (auto j = 0; j < cols; ++j)
-            data[i * cols + j] += rhs(i, j);
-}
-
-template <class T, int rows, int cols>
-tMatrix<T, rows, cols> tMatrix<T, rows, cols>::operator*(tMatrix<T, rows, cols> rhs)
-{
-    tMatrix<T, rows, cols> results;
-    for (auto i = 0; i < rows; ++i)
-        for (auto j = 0; j < rows; ++j)
-            for (auto k = 0; k < rows; ++k)
-                results(i, j) += data[i * cols + k] * rhs(k, j);
-    return results;
-}
-
-template <class T, int rows, int cols>
-T &tMatrix<T, rows, cols>::operator()(int row, int col)
-{
-    return data[row * cols + col];
-}
-
-template <class T, int rows, int cols>
-T tMatrix<T, rows, cols>::det()
-{
-    return data[0 * cols + 0] * (data[1 * cols + 1] * data[2 * cols + 2] - data[1 * cols + 2] * data[2 * cols + 1]) - data[0 * cols + 1] * (data[1 * cols + 0] * data[2 * cols + 2] - data[1 * cols + 2] * data[2 * cols + 0]) + data[0 * cols + 2] * (data[1 * cols + 0] * data[2 * cols + 1] - data[1 * cols + 1] * data[2 * cols + 0]);
-}
-
-template <class T, int rows, int cols>
-tMatrix<T, rows, cols> tMatrix<T, rows, cols>::inv()
-{
-    tMatrix<T, rows, cols> results;
-    T det = this->det();
-    results(0, 0) = (1. / det) * (data[1 * cols + 1] * data[2 * cols + 2] - data[1 * cols + 2] * data[2 * cols + 1]);
-    results(0, 1) = (1. / det) * (data[0 * cols + 2] * data[2 * cols + 1] - data[2 * cols + 2] * data[0 * cols + 1]);
-    results(0, 2) = (1. / det) * (data[0 * cols + 1] * data[1 * cols + 2] - data[1 * cols + 1] * data[0 * cols + 2]);
-
-    results(1, 0) = (1. / det) * (data[1 * cols + 2] * data[2 * cols + 0] - data[2 * cols + 2] * data[1 * cols + 0]);
-    results(1, 1) = (1. / det) * (data[0 * cols + 0] * data[2 * cols + 2] - data[2 * cols + 0] * data[0 * cols + 2]);
-    results(1, 2) = (1. / det) * (data[0 * cols + 2] * data[1 * cols + 0] - data[1 * cols + 2] * data[0 * cols + 0]);
-
-    results(2, 0) = (1. / det) * (data[1 * cols + 0] * data[2 * cols + 1] - data[2 * cols + 0] * data[1 * cols + 1]);
-    results(2, 1) = (1. / det) * (data[0 * cols + 1] * data[2 * cols + 0] - data[2 * cols + 1] * data[0 * cols + 0]);
-    results(2, 2) = (1. / det) * (data[0 * cols + 0] * data[1 * cols + 1] - data[1 * cols + 0] * data[0 * cols + 1]);
-    return results;
-}
-
-template <class T, int rows, int cols>
-tVector<T, rows> tMatrix<T, rows, cols>::operator*(tVector<T, cols> rhs)
-{
-    tVector<T, rows> results;
-    for (auto i = 0; i < rows; ++i)
-        for (auto j = 0; j < cols; ++j)
-            results(i) += data[i * cols + j] * rhs(j);
-    return results;
-}
-
-template <class T, int rows, int cols>
-void tMatrix<T, rows, cols>::print()
-{
-    for (auto i = 0; i < rows; ++i)
-    {
-        for (auto j = 0; j < cols; ++j)
-            std::cout << data[i * cols + j] << " ";
-        std::cout << std::endl;
-    }
-}
-
-template <class T, int rows>
-class tVector
-{
-public:
-    tVector()
-    {
-        for (auto i = 0; i < rows; ++i)
-            data[i] = (T)0;
-    }
-    T &operator()(int row);
-    tVector operator+(tVector rhs);
-    void operator+=(tVector rhs);
-    T dotproduct(tVector rhs);
-    template <class U>
-    typename Sacado::Promote<T, U>::type dotproduct(tVector<U, rows> rhs);
-    tMatrix<T, rows, rows> ddotproduct(tVector rhs);
-    void print();
-    void clean()
-    {
-        for (auto i = 0; i < rows; ++i)
-            data[i] = (T)0;
-    }
-
-private:
-    T data[rows];
-    int numRows = rows;
-    int getRows() { return numRows; }
-};
-
-template <class T, int rows>
-T &tVector<T, rows>::operator()(int row)
-{
-    return data[row];
-}
-
-template <class T, int rows>
-tVector<T, rows> tVector<T, rows>::operator+(tVector<T, rows> rhs)
-{
-    tVector<T, rows> results;
-    for (auto i = 0; i < rows; ++i)
-        results(i) = data[i] + rhs(i);
-    return results;
-}
-
-template <class T, int rows>
-void tVector<T, rows>::operator+=(tVector<T, rows> rhs)
-{
-    for (auto i = 0; i < rows; ++i)
-        data[i] += rhs(i);
-}
-
-template <class T, int rows>
-T tVector<T, rows>::dotproduct(tVector<T, rows> rhs)
-{
-    T result = (T)0;
-    for (auto i = 0; i < rows; ++i)
-        result += data[i] * rhs(i);
-    return result;
-}
-
-template <class T, int rows>
-template <class U>
-typename Sacado::Promote<T, U>::type tVector<T, rows>::dotproduct(tVector<U, rows> rhs)
-{
-    typename Sacado::Promote<T, U>::type result = 0;
-    for (auto i = 0; i < rows; ++i)
-        result += data[i] * rhs(i);
-    return result;
-}
-
-template <class T, int rows>
-tMatrix<T, rows, rows> tVector<T, rows>::ddotproduct(tVector<T, rows> rhs)
-{
-    tMatrix<T, rows, rows> results;
-    for (auto i = 0; i < rows; ++i)
-        for (auto j = 0; j < rows; ++j)
-            results(i, j) = data[i] * rhs(j);
-    return results;
-}
-
-template <class T, int rows>
-void tVector<T, rows>::print()
-{
-    for (auto i = 0; i < rows; ++i)
-        std::cout << data[i] << std::endl;
-}
-
-#endif //KATOPTRON_TMATRIX_H
diff --git a/katoptron/src/wContact.cpp b/katoptron/src/wContact.cpp
deleted file mode 100644
index b6b7881735234ee35ea23c63d2bfbcd8df2e8b59..0000000000000000000000000000000000000000
--- a/katoptron/src/wContact.cpp
+++ /dev/null
@@ -1,443 +0,0 @@
-#include "wContact.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wElement.h"
-#include "wNode.h"
-#include <algorithm>
-
-#include <fstream>
-#include <sstream>
-#include <string>
-
-using namespace katoptron;
-using namespace tbox;
-
-bool searchCode(char const *code, char const *line)
-{
-    return !(strncmp(code, line, strlen(code)));
-}
-
-bool searchCode(char const *code, std::string const line)
-{
-    return !(strncmp(code, line.c_str(), strlen(code)));
-}
-
-bool searchCode(std::string const code, std::string const line)
-{
-    return line.find(code) != std::string::npos;
-}
-
-void readGMSH(std::string const &file_name, std::string const &name, std::vector<int> &nodes)
-{
-    std::cout << file_name << ": start " << std::endl;
-    std::vector<int> nodes_tmp;
-    std::ifstream infile(file_name);
-    int tag = 0;
-    std::string line;
-    bool reading_physical_names = false;
-    while (std::getline(infile, line))
-    {
-        if (reading_physical_names)
-        {
-            if (searchCode("$EndPhysicalNames", line))
-                break;
-
-            if (searchCode(name, line))
-            {
-                std::istringstream line_stream(line);
-                int dim = 0, no = 0;
-                line_stream >> dim >> no;
-                tag = no;
-                std::cout << "tag: " << tag << std::endl;
-                reading_physical_names = false;
-            }
-        }
-        else if (searchCode("$Elements", line))
-        {
-            std::getline(infile, line);
-            std::istringstream line_stream(line);
-            // read number of elements
-            int nbelm = 0;
-
-            line_stream >> nbelm;
-
-            for (int i = 0; i < nbelm; ++i)
-            {
-                std::getline(infile, line);
-                std::istringstream line_stream(line);
-
-                // read number, type and nb of tags
-                int no = 0, type = 0, nbtags = 0;
-                int tmp;
-
-                line_stream >> no >> type >> nbtags;
-                // read/create/link tags
-
-                bool do_I_continue = true;
-                for (int j = 0; j < nbtags; ++j)
-                {
-                    line_stream >> tmp;
-                    if (tag == tmp)
-                        do_I_continue = false;
-                }
-                if (do_I_continue)
-                    continue;
-
-                int n = 0;
-                // read nodes
-                if (type == static_cast<int>(ElType::HEX8)) // 8-node hexa
-                    n = 8;
-                else if (type == static_cast<int>(ElType::QUAD4)) // 4-node quad
-                    n = 4;
-                else if (type == static_cast<int>(ElType::TETRA4)) // 4-node tetra
-                    n = 4;
-                else if (type == static_cast<int>(ElType::LINE2)) // 2-node line
-                    n = 2;
-                else if (type == static_cast<int>(ElType::POINT1)) // 1-node point
-                    n = 1;
-                else if (type == static_cast<int>(ElType::TRI3)) // 3-node triangle
-                    n = 3;
-                else
-                {
-                    continue;
-                }
-                int nn;
-                for (int j = 0; j < n; ++j)
-                {
-                    line_stream >> nn;
-                    nodes_tmp.push_back(nn - 1);
-                }
-            }
-        }
-        else if (searchCode("$EndElements", line))
-        {
-            std::cout << "nodes_tmp.size(): " << nodes_tmp.size() << std::endl;
-            if (nodes_tmp.size() > 0)
-            {
-                std::sort(nodes_tmp.begin(), nodes_tmp.end());
-
-                nodes.push_back(nodes_tmp[0]);
-
-                for (auto i = 1; i < nodes_tmp.size(); ++i)
-                    if (nodes_tmp[i] != nodes_tmp[i - 1])
-                        nodes.push_back(nodes_tmp[i]);
-            }
-            std::cout << "nodes.size(): " << nodes.size() << std::endl;
-            break;
-        }
-        else if (searchCode("$PhysicalNames", line))
-        {
-            reading_physical_names = true;
-        }
-    }
-}
-
-/**
- * @brief Contact constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> no: the ID of the slave surface of the msh,
- *  <li> _Contact_name: the name of new contact interface (does not have to be a nametag of the msh),
- *  <li> _slave_normal: the slave normal,
- *  <li> dg: the initial displacement along the slave normal.
- * </ul>
- */
-Contact::Contact(katoptron::Problem &pbl, int no, std::string _Contact_name, Eigen::Vector3d _slave_normal, double _dg) : Group(pbl.msh, no), Contact_name(_Contact_name), slave_normal(_slave_normal), dg(_dg)
-{
-    dg_vector = {dg};
-    for (auto e : tag->elems)
-        slave_elems.push_back(e);
-}
-
-/**
- * @brief Contact constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the slave surface of the msh,
- *  <li> _Contact_name: the name of new contact interface (does not have to be a nametag of the msh),
- *  <li> _slave_normal: the slave normal,
- *  <li> dg: the initial displacement along the slave normal.
- * </ul>
- */
-Contact::Contact(katoptron::Problem &pbl, std::string const &name, std::string _Contact_name, Eigen::Vector3d _slave_normal, double _dg) : Group(pbl.msh, name), Contact_name(_Contact_name), slave_normal(_slave_normal), dg(_dg)
-{
-    dg_vector = {dg};
-    for (auto e : tag->elems)
-        slave_elems.push_back(e);
-}
-
-/**
- * @brief Contact constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> no: the ID of the slave surface of the msh,
- *  <li> _Contact_name: the name of new contact interface (does not have to be a nametag of the msh),
- *  <li> _slave_normal: the slave normal,
- *  <li> _dg: the initial displacement along the slave normal (value can be different for the different samples).
- * </ul>
- */
-Contact::Contact(katoptron::Problem &pbl, int no, std::string _Contact_name, Eigen::Vector3d _slave_normal, std::vector<double> _dg) : Group(pbl.msh, no), Contact_name(_Contact_name), slave_normal(_slave_normal)
-{
-    dg = _dg[0];
-    dg_vector = _dg;
-
-    for (auto e : tag->elems)
-        slave_elems.push_back(e);
-}
-
-/**
- * @brief Contact constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the slave surface of the msh,
- *  <li> _Contact_name: the name of new contact interface (does not have to be a nametag of the msh),
- *  <li> _slave_normal: the slave normal,
- *  <li> _dg: the initial displacement along the slave normal (value can be different for the different samples).
- * </ul>
- */
-Contact::Contact(katoptron::Problem &pbl, std::string const &name, std::string _Contact_name, Eigen::Vector3d _slave_normal, std::vector<double> _dg) : Group(pbl.msh, name), Contact_name(_Contact_name), slave_normal(_slave_normal)
-{
-    dg = _dg[0];
-    dg_vector = _dg;
-
-    for (auto e : tag->elems)
-        slave_elems.push_back(e);
-}
-
-/**
- * @brief Set the master surface
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> no: the ID of the master surface of the msh,
- *  <li> _master_normal: the master normal.
- * </ul>
- */
-void Contact::setMaster(katoptron::Problem &pbl, int no, Eigen::Vector3d _master_normal)
-{
-    master_normal = _master_normal;
-    Group master_group(pbl.msh, no);
-    Tag *master_tag = master_group.tag;
-    for (auto e : master_tag->elems)
-        master_elems.push_back(e);
-
-    pbl.Contacts.push_back(this);
-}
-
-/**
- * @brief Set the master surface
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the master surface of the msh,
- *  <li> _master_normal: the master normal.
- * </ul>
- */
-void Contact::setMaster(katoptron::Problem &pbl, std::string const &name, Eigen::Vector3d _master_normal)
-{
-    master_normal = _master_normal;
-    Group master_group(pbl.msh, name);
-    Tag *master_tag = master_group.tag;
-    for (auto e : master_tag->elems)
-        master_elems.push_back(e);
-
-    pbl.Contacts.push_back(this);
-}
-
-/**
- * @brief Set slave boundary (optional)
- * 
- * Arguments:
- * <ul>
- *  <li> file_name: name of the msh file to use,
- *  <li> name: the name of the slave boundary of the msh.
- * </ul>
- */
-void Contact::setSlaveBoundary(std::string const &file_name, std::string const &name)
-{
-    readGMSH(file_name, name, slave_boundary_nodes);
-
-    std::cout << "slave_boundary_nodes.size(): " << slave_boundary_nodes.size() << std::endl;
-}
-
-/**
- * @brief Set master boundary (optional)
- * 
- * Arguments:
- * <ul>
- *  <li> file_name: name of the msh file to use,
- *  <li> name: the name of the master boundary of the msh.
- * </ul>
- */
-void Contact::setMasterBoundary(std::string const &file_name, std::string const &name)
-{
-    readGMSH(file_name, name, master_boundary_nodes);
-
-    std::cout << "master_boundary_nodes.size(): " << master_boundary_nodes.size() << std::endl;
-}
-
-/**
- * @brief Set slave Dirichlet boundary (optional)
- * 
- * Arguments:
- * <ul>
- *  <li> file_name: name of the msh file to use,
- *  <li> name: the name of the slave Dirichlet boundary of the msh.
- * </ul>
- */
-void Contact::setSlaveDirichlet(std::string const &file_name, std::string const &name)
-{
-    readGMSH(file_name, name, slave_dirichlet_nodes);
-
-    std::cout << "slave_dirichlet_nodes.size(): " << slave_dirichlet_nodes.size() << std::endl;
-    for (auto i = 0; i < slave_dirichlet_nodes.size(); ++i)
-        std::cout << slave_dirichlet_nodes[i] << std::endl;
-}
-
-/**
- * @brief Set master Dirichlet boundary (optional)
- * 
- * Arguments:
- * <ul>
- *  <li> file_name: name of the msh file to use,
- *  <li> name: the name of the master Dirichlet boundary of the msh.
- * </ul>
- */
-void Contact::setMasterDirichlet(std::string const &file_name, std::string const &name)
-{
-    readGMSH(file_name, name, master_dirichlet_nodes);
-
-    std::cout << "master_dirichlet_nodes.size(): " << master_dirichlet_nodes.size() << std::endl;
-}
-
-/**
- * @brief Activate all the Lagrange multipliers associated to 
- * the current contact interface.
- */
-void Contact::setInitialyClosed()
-{
-    initial_closed = true;
-}
-
-/**
- * @brief Inactivate all the Lagrange multipliers associated to 
- * the current contact interface.
- */
-void Contact::setInitialyOpen()
-{
-    initial_closed = false;
-}
-
-/**
- * @brief Specify to the active set strategy that this interface
- * should not be updated. 
- */
-void Contact::setNoUpdate()
-{
-    no_Update = true;
-}
-
-/**
- * @brief Specify to the active set strategy that this interface
- * should be updated if required.
- */
-void Contact::setUpdate()
-{
-    no_Update = false;
-}
-
-/**
- * @brief Replace this contact interface by a mesh tying interface. 
- */
-void Contact::setMeshTying()
-{
-    mesh_tying = true;
-    sticking = true;
-    no_Update = true;
-}
-
-/**
- * @brief Specify that this interface is sticking. 
- */
-void Contact::setSticking()
-{
-    sticking = true;
-}
-
-/**
- * @brief Specify that this interface is not sticking (default). 
- */
-void Contact::setNoSticking()
-{
-    sticking = false;
-}
-
-/**
- * @brief Specify that the discretization of the Lagrange multipliers 
- * use standard shape functions (default).
- */
-void Contact::setStandardShapeFunctions()
-{
-    standard_shape_functions = true;
-}
-
-/**
- * @brief Specify that the discretization of the Lagrange multipliers 
- * use dual shape functions.
- */
-void Contact::setDualShapeFunctions()
-{
-    standard_shape_functions = false;
-}
-
-/**
- * @brief Specify that this interface is a Signorini contact.
- */
-void Contact::setSignoriniContact()
-{
-    is_Signorini = true;
-}
-
-/**
- * @brief Specify that this interface is a not Signorini contact (default).
- */
-void Contact::setTwoBodyContact()
-{
-    is_Signorini = false;
-}
-
-/**
- * @brief Specify a list of slave nodes where the Lagrange multipliers should
- * be initially closed.
- */
-void Contact::setInitiallyClosedNodes(std::vector<double> _initially_closed_nodes)
-{
-    for (auto i = 0; i < _initially_closed_nodes.size(); ++i)
-        initially_closed_nodes.push_back(((int)_initially_closed_nodes[i]));
-}
-
-/**
- * @brief Specify the scale.
- */
-void Contact::setScale(double a)
-{
-    scale = a;
-}
-
-/**
- * @brief Display information.
- */
-void Contact::write(std::ostream &out) const
-{
-    out << "Contact interface named ''" << Contact_name << "'' on " << *tag << "\n";
-}
\ No newline at end of file
diff --git a/katoptron/src/wContact.h b/katoptron/src/wContact.h
deleted file mode 100644
index 97f2ee3e561f3995a2e5210206df4fc683f12ac6..0000000000000000000000000000000000000000
--- a/katoptron/src/wContact.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef KATOPTRON_CONTACT_H
-#define KATOPTRON_CONTACT_H
-
-#include "katoptron.h"
-#include "wGroup.h"
-#include <vector>
-#include <string>
-#include <Eigen/Dense>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to specify in Python the different contact interfaces.
- */
-class KATOPTRON_API Contact : public tbox::Group
-{
-public:
-    std::string Contact_name;
-    std::vector<tbox::Element *> slave_elems;
-    std::vector<tbox::Element *> master_elems;
-
-    std::vector<int> slave_boundary_nodes;
-    std::vector<int> master_boundary_nodes;
-
-    std::vector<int> slave_dirichlet_nodes;
-    std::vector<int> master_dirichlet_nodes;
-
-    std::vector<int> initially_closed_nodes = {};
-
-    bool initial_closed = true;
-    bool standard_shape_functions = true;
-    bool is_Signorini = false;
-    bool no_Update = false;
-    bool sticking = false;
-    bool mesh_tying = false;
-
-    int nb_Lagrange_multipliers = 1;
-
-    Eigen::Vector3d slave_normal;
-    Eigen::Vector3d master_normal;
-
-    double dg;
-
-    double scale = 1.;
-
-    std::vector<double> dg_vector;
-
-    Contact(Problem &pbl, int no, std::string _Contact_name, Eigen::Vector3d _slave_normal, double dg = 0.);
-    Contact(Problem &pbl, std::string const &name, std::string _Contact_name, Eigen::Vector3d _slave_normal, double dg = 0.);
-    Contact(Problem &pbl, int no, std::string _Contact_name, Eigen::Vector3d _slave_normal, std::vector<double> _dg);
-    Contact(Problem &pbl, std::string const &name, std::string _Contact_name, Eigen::Vector3d _slave_normal, std::vector<double> _dg);
-
-    void setMaster(katoptron::Problem &pbl, int no, Eigen::Vector3d _master_normal);
-    void setMaster(katoptron::Problem &pbl, std::string const &name, Eigen::Vector3d _master_normal);
-
-    void setSlaveBoundary(std::string const &file_name, std::string const &name);
-    void setMasterBoundary(std::string const &file_name, std::string const &name);
-
-    void setSlaveDirichlet(std::string const &file_name, std::string const &name);
-    void setMasterDirichlet(std::string const &file_name, std::string const &name);
-
-    void setInitialyClosed();
-    void setInitialyOpen();
-    void setNoUpdate();
-    void setUpdate();
-    void setMeshTying();
-    void setSticking();
-    void setNoSticking();
-    void setStandardShapeFunctions();
-    void setDualShapeFunctions();
-    void setSignoriniContact();
-    void setTwoBodyContact();
-    void setInitiallyClosedNodes(std::vector<double> _initially_closed_nodes);
-    void setScale(double a);
-
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_CONTACT_H
diff --git a/katoptron/src/wDirichlet.cpp b/katoptron/src/wDirichlet.cpp
deleted file mode 100644
index a9d6c984bcdeec87aeebe524b9c121dd5c802d86..0000000000000000000000000000000000000000
--- a/katoptron/src/wDirichlet.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-#include "wDirichlet.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wElement.h"
-#include "wNode.h"
-#include <algorithm>
-using namespace katoptron;
-using namespace tbox;
-
-/**
- * @brief Dirichlet constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the constrained surface of the msh,
- *  <li> _BC_name: the name of new Dirichlet BC (does not have to be a nametag of the msh),
- *  <li> _which_dof: a vector that specify which degree(s) of freedom are constrained,
- *  <li> _values: a vector that specify the values of the constrained degree(s) of freedom 
- *  if they are constrained (the length of _which_dof and _values must be the same),
- *  <li> ensemble_size: the ensemble size.
- * </ul>
- */
-Dirichlet::Dirichlet(katoptron::Problem &pbl,
-                     std::string const &name,
-                     std::string const &_BC_name,
-                     std::vector<int> _which_dof,
-                     std::vector<double> _values,
-                     size_t ensemble_size) : Group(pbl.msh, name), BC_name(_BC_name), which_dof(_which_dof), values(_values)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    x_values = {};
-    y_values = {};
-    z_values = {};
-    T_values = {};
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        x_values.push_back(values[0]);
-        y_values.push_back(values[1]);
-        z_values.push_back(values[2]);
-        T_values.push_back(values[3]);
-    }
-    pbl.duBCs.push_back(this);
-}
-
-/**
- * @brief Dirichlet constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the constrained surface of the msh,
- *  <li> _BC_name: the name of new Dirichlet BC (does not have to be a nametag of the msh),
- *  <li> x: a int which specify whether the x displacement component is constrained,
- *  <li> v_x: value of the constrained degree of freedom,
- *  <li> y: a int which specify whether the y displacement component is constrained,
- *  <li> v_y: value of the constrained degree of freedom,
- *  <li> z: a int which specify whether the z displacement component is constrained,
- *  <li> v_z: value of the constrained degree of freedom,
- *  <li> T: a int which specify whether the temperature is constrained,
- *  <li> v_T: value of the constrained degree of freedom,
- *  <li> ensemble_size: the ensemble size.
- * </ul>
- */
-Dirichlet::Dirichlet(Problem &pbl,
-                     std::string const &name,
-                     std::string const &_BC_name,
-                     int x,
-                     double v_x,
-                     int y,
-                     double v_y,
-                     int z,
-                     double v_z,
-                     int T,
-                     double v_T,
-                     size_t ensemble_size) : Group(pbl.msh, name), BC_name(_BC_name)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    which_dof = {};
-    which_dof.push_back(x);
-    which_dof.push_back(y);
-    which_dof.push_back(z);
-    which_dof.push_back(T);
-
-    values = {};
-    values.push_back(v_x);
-    values.push_back(v_y);
-    values.push_back(v_z);
-    values.push_back(v_T);
-
-    x_values = {};
-    y_values = {};
-    z_values = {};
-    T_values = {};
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        x_values.push_back(v_x);
-        y_values.push_back(v_y);
-        z_values.push_back(v_z);
-        T_values.push_back(v_T);
-    }
-
-    pbl.duBCs.push_back(this);
-}
-
-/**
- * @brief Dirichlet constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the constrained surface of the msh,
- *  <li> _BC_name: the name of new Dirichlet BC (does not have to be a nametag of the msh),
- *  <li> x: a int which specify whether the x displacement component is constrained,
- *  <li> v_x: vector of values of the constrained degree of freedom (one per sample),
- *  <li> y: a int which specify whether the y displacement component is constrained,
- *  <li> v_y: vector of values of the constrained degree of freedom (one per sample),
- *  <li> z: a int which specify whether the z displacement component is constrained,
- *  <li> v_z: vector of values of the constrained degree of freedom (one per sample),
- *  <li> T: a int which specify whether the temperature is constrained,
- *  <li> v_T: vector of values of the constrained degree of freedom (one per sample).
- * </ul>
- */
-Dirichlet::Dirichlet(Problem &pbl,
-                     std::string const &name,
-                     std::string const &_BC_name,
-                     int x,
-                     std::vector<double> v_x,
-                     int y,
-                     std::vector<double> v_y,
-                     int z,
-                     std::vector<double> v_z,
-                     int T,
-                     std::vector<double> v_T) : Group(pbl.msh, name), BC_name(_BC_name)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    std::cout << v_x[0] << std::endl;
-
-    which_dof = {};
-    which_dof.push_back(x);
-    which_dof.push_back(y);
-    which_dof.push_back(z);
-    which_dof.push_back(T);
-
-    values = {};
-    values.push_back(v_x[0]);
-    values.push_back(v_y[0]);
-    values.push_back(v_z[0]);
-    values.push_back(v_T[0]);
-
-    x_values = {};
-    y_values = {};
-    z_values = {};
-    T_values = {};
-    for (auto i = 0; i < v_x.size(); ++i)
-        x_values.push_back(v_x[i]);
-
-    for (auto i = 0; i < v_y.size(); ++i)
-        y_values.push_back(v_y[i]);
-
-    for (auto i = 0; i < v_z.size(); ++i)
-        z_values.push_back(v_z[i]);
-
-    for (auto i = 0; i < v_T.size(); ++i)
-        T_values.push_back(v_T[i]);
-
-    pbl.duBCs.push_back(this);
-}
-
-/**
- * @brief Display information.
- */
-void Dirichlet::write(std::ostream &out) const
-{
-    out << "Dirichlet BC on " << *tag << "\n";
-    out << "With fixed values of (";
-    for (auto i = 0; i < (which_dof.size() - 1); ++i)
-    {
-        if (which_dof[i] == 1)
-            out << values[i] << ", ";
-        else
-            out << "-, ";
-    }
-
-    if (which_dof[which_dof.size() - 1] == 1)
-        out << values[which_dof.size() - 1] << ")\n";
-    else
-        out << "-)\n";
-
-    out << "a '-' represents an unconstrained dof.\n";
-}
diff --git a/katoptron/src/wDirichlet.h b/katoptron/src/wDirichlet.h
deleted file mode 100644
index bf20ad029fdc270f00b0910c0908e38c91d3fce5..0000000000000000000000000000000000000000
--- a/katoptron/src/wDirichlet.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef KATOPTRON_DIRICHLET_H
-#define KATOPTRON_DIRICHLET_H
-
-#include "katoptron.h"
-#include "wGroup.h"
-#include <vector>
-#include <string>
-
-#include <Teuchos_RCP.hpp>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to specify in Python the different Dirichlet boundary conditions 
- * (both mechanical and thermal).
- */
-class KATOPTRON_API Dirichlet : public tbox::Group
-{
-public:
-    std::string const &BC_name;
-    std::vector<tbox::Node *> nodes;
-    std::vector<int> which_dof;
-    std::vector<double> values;
-
-    std::vector<double> x_values;
-    std::vector<double> y_values;
-    std::vector<double> z_values;
-    std::vector<double> T_values;
-
-    Dirichlet(Problem &pbl,
-              std::string const &name,
-              std::string const &_BC_name,
-              std::vector<int> _which_dof,
-              std::vector<double> _values,
-              size_t ensemble_size = 1);
-
-    Dirichlet(Problem &pbl,
-              std::string const &name,
-              std::string const &_BC_name,
-              int x,
-              double v_x,
-              int y,
-              double v_y,
-              int z,
-              double v_z,
-              int T = 0,
-              double v_T = 0,
-              size_t ensemble_size = 1);
-
-    Dirichlet(Problem &pbl,
-              std::string const &name,
-              std::string const &_BC_name,
-              int x,
-              std::vector<double> v_x,
-              int y,
-              std::vector<double> v_y,
-              int z,
-              std::vector<double> v_z,
-              int T = 0,
-              std::vector<double> v_T = {});
-
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_DIRICHLET_H
diff --git a/katoptron/src/wDisplayHook.cpp b/katoptron/src/wDisplayHook.cpp
deleted file mode 100644
index 40ed53998fcc49f5fa61dbb0491b518cdd44c86c..0000000000000000000000000000000000000000
--- a/katoptron/src/wDisplayHook.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "wDisplayHook.h"
-
-DisplayHook::DisplayHook()
-{
-}
-
-void DisplayHook::display(int nt, double t, std::vector<double> &u)
-{
-    std::cout << "DisplayHook::display()\n";
-}
-
-void DisplayHook::display(int nt,
-                          double t,
-                          std::vector<double> &u_x,
-                          std::vector<double> &u_y,
-                          std::vector<double> &u_z,
-                          std::vector<double> &u_norm)
-{
-    std::cout << "DisplayHook::display()\n";
-}
-
-void DisplayHook::refresh()
-{
-    std::cout << "DisplayHook::refresh()\n";
-}
diff --git a/katoptron/src/wDisplayHook.h b/katoptron/src/wDisplayHook.h
deleted file mode 100644
index 623d746b9cd45e577d19931436a898bca8bb68db..0000000000000000000000000000000000000000
--- a/katoptron/src/wDisplayHook.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef KATOPTRON_DISPLAYHOOK_H
-#define KATOPTRON_DISPLAYHOOK_H
-
-#include "katoptron.h"
-#include "wObject.h"
-#include <vector>
-
-class KATOPTRON_API DisplayHook : public fwk::wObject
-{
-public:
-    DisplayHook();
-    virtual void display(int nt, double t, std::vector<double> &u);
-    virtual void display(int nt,
-                         double t,
-                         std::vector<double> &u_x,
-                         std::vector<double> &u_y,
-                         std::vector<double> &u_z,
-                         std::vector<double> &u_norm);
-    virtual void refresh();
-};
-
-#endif //KATOPTRON_DISPLAYHOOK_H
diff --git a/katoptron/src/wMedium.cpp b/katoptron/src/wMedium.cpp
deleted file mode 100644
index e39d8fd31991a6fe0fe729ca93febfb5bc545921..0000000000000000000000000000000000000000
--- a/katoptron/src/wMedium.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-#include "wMedium.h"
-#include "wProblem.h"
-#include "wTag.h"
-using namespace katoptron;
-using namespace tbox;
-
-/**
- * @brief Medium constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> no: the ID of the body of the msh,
- *  <li> _medium_name: the name of new medium (does not have to be a nametag of the msh),
- *  <li> _E: a vector of values of the Young modulus \f$E\f$ (one per sample),
- *  <li> _nu: a vector of values of the Poisson coefficients \f$\nu\f$ (one per sample),
- *  <li> _k: the heat conductivity \f$k\f$ equal to zero by default,
- *  <li> _beta: the coefficient of thermal expansion \f$\beta\f$ equal to zero by default.
- * </ul>
- */
-Medium::Medium(Problem &pbl,
-               int no,
-               std::string _medium_name,
-               std::vector<double> _E,
-               std::vector<double> _nu,
-               std::vector<double> _k,
-               std::vector<double> _beta) : Group(pbl.msh, no), medium_name(_medium_name)
-{
-    E = _E[0];
-    nu = _nu[0];
-    k = _k[0];
-    beta = _beta[0];
-    E_vector = _E;
-    nu_vector = _nu;
-    k_vector = _k;
-    beta_vector = _beta;
-    pbl.media.push_back(this);
-}
-
-/**
- * @brief Medium constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the body of the msh,
- *  <li> _medium_name: the name of new medium (does not have to be a nametag of the msh),
- *  <li> _E: a vector of values of the Young modulus \f$E\f$ (one per sample),
- *  <li> _nu: a vector of values of the Poisson coefficients \f$\nu\f$ (one per sample),
- *  <li> _k: the heat conductivity \f$k\f$ equal to zero by default,
- *  <li> _beta: the coefficient of thermal expansion \f$\beta\f$ equal to zero by default.
- * </ul>
- */
-Medium::Medium(Problem &pbl,
-               std::string const &name,
-               std::string _medium_name,
-               std::vector<double> _E,
-               std::vector<double> _nu,
-               std::vector<double> _k,
-               std::vector<double> _beta) : Group(pbl.msh, name), medium_name(_medium_name)
-{
-    E = _E[0];
-    nu = _nu[0];
-    k = _k[0];
-    beta = _beta[0];
-    E_vector = _E;
-    nu_vector = _nu;
-    k_vector = _k;
-    beta_vector = _beta;
-    pbl.media.push_back(this);
-}
-
-/**
- * @brief Medium constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> no: the ID of the body of the msh,
- *  <li> _medium_name: the name of new medium (does not have to be a nametag of the msh),
- *  <li> _E: a vector of values of the Young modulus \f$E\f$ (one per sample),
- *  <li> _nu: a vector of values of the Poisson coefficients \f$\nu\f$ (one per sample),
- *  <li> _k: a vector of values of the heat conductivity \f$k\f$ (one per sample),
- *  <li> _beta: a vector of values of the coefficient of thermal expansion \f$\beta\f$ (one per sample).
- * </ul>
- */
-Medium::Medium(Problem &pbl,
-               int no,
-               std::string _medium_name,
-               std::vector<double> _E,
-               std::vector<double> _nu,
-               double _k,
-               double _beta) : Group(pbl.msh, no), medium_name(_medium_name)
-{
-    E = _E[0];
-    nu = _nu[0];
-    k = _k;
-    beta = _beta;
-    E_vector = _E;
-    nu_vector = _nu;
-    std::vector<double> vect_k(E_vector.size(), _k);
-    k_vector = vect_k;
-    std::vector<double> vect_beta(E_vector.size(), _beta);
-    beta_vector = vect_beta;
-    pbl.media.push_back(this);
-}
-
-/**
- * @brief Medium constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the body of the msh,
- *  <li> _medium_name: the name of new medium (does not have to be a nametag of the msh),
- *  <li> _E: a vector of values of the Young modulus \f$E\f$ (one per sample),
- *  <li> _nu: a vector of values of the Poisson coefficients \f$\nu\f$ (one per sample),
- *  <li> _k: a vector of values of the heat conductivity \f$k\f$ (one per sample),
- *  <li> _beta: a vector of values of the coefficient of thermal expansion \f$\beta\f$ (one per sample).
- * </ul>
- */
-Medium::Medium(Problem &pbl,
-               std::string const &name,
-               std::string _medium_name,
-               std::vector<double> _E,
-               std::vector<double> _nu,
-               double _k,
-               double _beta) : Group(pbl.msh, name), medium_name(_medium_name)
-{
-    E = _E[0];
-    nu = _nu[0];
-    k = _k;
-    beta = _beta;
-    E_vector = _E;
-    nu_vector = _nu;
-    std::vector<double> vect_k(E_vector.size(), _k);
-    k_vector = vect_k;
-    std::vector<double> vect_beta(E_vector.size(), _beta);
-    beta_vector = vect_beta;
-    pbl.media.push_back(this);
-}
-
-/**
- * @brief Display information.
- */
-void Medium::write(std::ostream &out) const
-{
-    out << "Medium " << medium_name << " on " << *tag << " with E=" << this->E
-        << ", nu=" << this->nu << ", k=" << this->k << " and beta=" << this->beta;
-}
diff --git a/katoptron/src/wMedium.h b/katoptron/src/wMedium.h
deleted file mode 100644
index ec41f8fa590f9f3787f4446985a8565402ee18eb..0000000000000000000000000000000000000000
--- a/katoptron/src/wMedium.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef KATOPTRON_MEDIUM_H
-#define KATOPTRON_MEDIUM_H
-
-#include "katoptron.h"
-#include "wGroup.h"
-#include <string>
-#include <vector>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to specify in Python the different media.
- */
-class KATOPTRON_API Medium : public tbox::Group
-{
-public:
-    std::string medium_name;
-    double E;
-    double nu;
-    double k;
-    double beta;
-    std::vector<double> E_vector;
-    std::vector<double> nu_vector;
-    std::vector<double> k_vector;
-    std::vector<double> beta_vector;
-
-    Medium(Problem &pbl,
-           int no,
-           std::string _medium_name,
-           std::vector<double> _E,
-           std::vector<double> _nu,
-           double _k = 0.,
-           double _beta = 0.);
-
-    Medium(Problem &pbl,
-           std::string const &name,
-           std::string _medium_name,
-           std::vector<double> _E,
-           std::vector<double> _nu,
-           double _k = 0.,
-           double _beta = 0.);
-
-    Medium(Problem &pbl,
-           int no,
-           std::string _medium_name,
-           std::vector<double> _E,
-           std::vector<double> _nu,
-           std::vector<double> _k,
-           std::vector<double> _beta);
-
-    Medium(Problem &pbl,
-           std::string const &name,
-           std::string _medium_name,
-           std::vector<double> _E,
-           std::vector<double> _nu,
-           std::vector<double> _k,
-           std::vector<double> _beta);
-
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_MEDIUM_H
diff --git a/katoptron/src/wNeumann.cpp b/katoptron/src/wNeumann.cpp
deleted file mode 100644
index 7673235ae29144da7200e77053e54775c00bf0bc..0000000000000000000000000000000000000000
--- a/katoptron/src/wNeumann.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "wNeumann.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wElement.h"
-#include "wNode.h"
-#include <algorithm>
-using namespace katoptron;
-using namespace tbox;
-
-/**
- * @brief Neumann constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the loaded surface of the msh,
- *  <li> _BC_name: the name of new Neumann BC (does not have to be a nametag of the msh),
- *  <li> _which_dof: a vector that specify which degree(s) of freedom are loaded,
- *  <li> _values: a vector that specify the values of the loads.
- * </ul>
- */
-Neumann::Neumann(katoptron::Problem &pbl,
-                 std::string const &name,
-                 std::string const &_BC_name,
-                 std::vector<int> _which_dof,
-                 std::vector<double> _values) : Group(pbl.msh, name), BC_name(_BC_name), which_dof(_which_dof), values(_values)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    pbl.nBCs.push_back(this);
-}
-
-/**
- * @brief Neumann constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the loaded surface of the msh,
- *  <li> _BC_name: the name of new Neumann BC (does not have to be a nametag of the msh),
- *  <li> x: a int which specify whether the x displacement component is loaded,
- *  <li> v_x: value of the load,
- *  <li> y: a int which specify whether the y displacement component is loaded,
- *  <li> v_y: value of the load,
- *  <li> z: a int which specify whether the z displacement component is loaded,
- *  <li> v_z: value of the load,
- *  <li> T: a int which specify whether the temperature is loaded,
- *  <li> v_T: value of the load,
- *  <li> ensemble_size: the ensemble size.
- * </ul>
- */
-Neumann::Neumann(Problem &pbl,
-                 std::string const &name,
-                 std::string const &_BC_name,
-                 int x,
-                 std::vector<double> v_x,
-                 int y,
-                 std::vector<double> v_y,
-                 int z,
-                 std::vector<double> v_z,
-                 int T,
-                 std::vector<double> v_T,
-                 size_t ensemble_size) : Group(pbl.msh, name), BC_name(_BC_name)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    which_dof = {};
-    which_dof.push_back(x);
-    which_dof.push_back(y);
-    which_dof.push_back(z);
-    which_dof.push_back(T);
-
-    values = {};
-    for (auto i = 0; i < ensemble_size; ++i)
-        values.push_back(v_x[i]);
-    for (auto i = 0; i < ensemble_size; ++i)
-        values.push_back(v_y[i]);
-    for (auto i = 0; i < ensemble_size; ++i)
-        values.push_back(v_z[i]);
-    for (auto i = 0; i < ensemble_size; ++i)
-        values.push_back(v_T[i]);
-
-    pbl.nBCs.push_back(this);
-}
-
-/**
- * @brief Display information.
- */
-void Neumann::write(std::ostream &out) const
-{
-    out << "Neumann BC on " << *tag << "\n";
-    out << "With applied load of (";
-    for (auto i = 0; i < (which_dof.size() - 1); ++i)
-    {
-        if (which_dof[i] == 1)
-            out << values[i] << ", ";
-        else
-            out << "0, ";
-    }
-
-    if (which_dof[which_dof.size() - 1] == 1)
-        out << values[which_dof.size() - 1] << ")\n";
-    else
-        out << "0)\n";
-}
diff --git a/katoptron/src/wNeumann.h b/katoptron/src/wNeumann.h
deleted file mode 100644
index 7b7af949ab3beb11b45227bc1c86c30d00072763..0000000000000000000000000000000000000000
--- a/katoptron/src/wNeumann.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef KATOPTRON_NEUMANN_H
-#define KATOPTRON_NEUMANN_H
-
-#include "katoptron.h"
-#include "wGroup.h"
-#include <vector>
-#include <string>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to specify in Python the different Neumann boundary conditions 
- * (both mechanical and thermal).
- */
-class KATOPTRON_API Neumann : public tbox::Group
-{
-public:
-    std::string const &BC_name;
-    std::vector<tbox::Node *> nodes;
-    std::vector<int> which_dof;
-    std::vector<double> values;
-
-    Neumann(Problem &pbl,
-            std::string const &name,
-            std::string const &_BC_name,
-            std::vector<int> _which_dof,
-            std::vector<double> _values);
-
-    Neumann(Problem &pbl,
-            std::string const &name,
-            std::string const &_BC_name,
-            int x,
-            std::vector<double> v_x,
-            int y,
-            std::vector<double> v_y,
-            int z,
-            std::vector<double> v_z,
-            int T,
-            std::vector<double> v_T,
-            size_t ensemble_size);
-
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_NEUMANN_H
diff --git a/katoptron/src/wProblem.cpp b/katoptron/src/wProblem.cpp
deleted file mode 100644
index 420d77313ea3380b6fb286765c987ae2d0282855..0000000000000000000000000000000000000000
--- a/katoptron/src/wProblem.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "wProblem.h"
-#include "wMshData.h"
-
-#include "wDirichlet.h"
-#include "wNeumann.h"
-#include "wSource.h"
-using namespace katoptron;
-using namespace tbox;
-
-/**
- * @brief Problem constructor
- * 
- * Arguments:
- * <ul>
- *  <li> _msh: a shared pointer to the mesh,
- *  <li> _comm: the used MPI communicator.
- * </ul>
- */
-Problem::Problem(std::shared_ptr<MshData> _msh, MPI_Comm _comm) : msh(_msh), comm(_comm)
-{
-}
-
-/**
- * @brief Add a random variable.
- */
-void Problem::add(std::shared_ptr<RandomVariable> r)
-{
-    RandomVariables.push_back(r);
-}
-
-/**
- * @brief Display information.
- */
-void Problem::write(std::ostream &out) const
-{
-    out << "katoptron::Problem:\n";
-    out << " + mesh:\n";
-    out << *msh; //wMshData.h
-
-    out << " + dBC:\n";
-    for (auto b : duBCs)
-        out << *b << '\n';
-    out << " + nBC:\n";
-    for (auto b : nBCs)
-        out << *b << '\n';
-    out << " + Source:\n";
-    for (auto b : Sources)
-        out << *b << '\n';
-}
\ No newline at end of file
diff --git a/katoptron/src/wProblem.h b/katoptron/src/wProblem.h
deleted file mode 100644
index 9fd940b3da9ab7cdcbb763405f6e297dbc8b95f0..0000000000000000000000000000000000000000
--- a/katoptron/src/wProblem.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef KATOPTRON_PROBLEM_H
-#define KATOPTRON_PROBLEM_H
-
-#include "katoptron.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#include <memory>
-
-#include <mpi.h>
-
-namespace katoptron
-{
-
-/**
- * @brief Class which is used to specify in Python the thermomechanical to solve.
- */
-class KATOPTRON_API Problem : public fwk::wSharedObject
-{
-public:
-    std::shared_ptr<tbox::MshData> msh; ///< Mesh structure
-
-    MPI_Comm comm;
-#ifndef SWIG
-    std::vector<Medium *> media = {};    ///< Materials
-    std::vector<Dirichlet *> duBCs = {}; ///< mechanical Dirichlet boundary conditions
-    std::vector<Neumann *> nBCs = {};
-    std::vector<Contact *> Contacts = {};
-    std::vector<Source *> Sources = {};
-    std::vector<std::shared_ptr<RandomVariable>> RandomVariables = {};
-    std::vector<Weight *> Weights = {};
-#endif
-    Problem(std::shared_ptr<tbox::MshData> _msh, MPI_Comm _comm);
-    ~Problem() { std::cout << "~Problem()\n"; }
-
-    void add(std::shared_ptr<RandomVariable> r);
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_PROBLEM_H
diff --git a/katoptron/src/wRandomField.h b/katoptron/src/wRandomField.h
deleted file mode 100644
index cfa85ee2d0fbae1117dc8a8fc8154ba9cd6f1771..0000000000000000000000000000000000000000
--- a/katoptron/src/wRandomField.h
+++ /dev/null
@@ -1,177 +0,0 @@
-#ifndef KATOPTRON_RANDOMFIELD_H
-#define KATOPTRON_RANDOMFIELD_H
-
-#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp"
-#include "Stokhos_KL_ExponentialRandomField.hpp"
-#include "EnsembleTraits.h"
-#include "wSpectralApproach.h"
-
-template <typename Scalar, typename Device>
-class RandomField
-{
-public:
-    typedef Kokkos::View<Scalar *, Kokkos::LayoutLeft, Device> RandomVariableView;
-    typedef typename RandomVariableView::size_type size_type;
-
-    typedef typename Teuchos::ScalarTraits<Scalar>::coordinateType MeshScalar;
-    typedef Stokhos::KL::ExponentialRandomField<MeshScalar, Device> rf_type;
-    typedef Teuchos::ScalarTraits<MeshScalar> MST;
-    typedef typename EnsembleTraits<Scalar>::value_type mean_type;
-
-    bool isRandom = false;
-    bool isExpRandom = true;
-    rf_type m_rf;            // Exponential random field
-    RandomVariableView m_rv; // KL random variables
-    mean_type g;             // Mean
-    mean_type delta;         // Dispersion level
-    mean_type a, b;
-    int num_rv;
-    int ndim = 3; // Dimension of the physical domain
-    Teuchos::RCP<SpectralApproach<Scalar, Device>> sa;
-
-    RandomField(Teuchos::RCP<Teuchos::ParameterList> randomParams, Kokkos::View<Scalar *, Kokkos::LayoutLeft, Device> _m_rv)
-    {
-        isRandom = randomParams->get("Is random", false);
-        if (isRandom)
-        {
-            g = randomParams->get("Mean", MST::one());
-            delta = randomParams->get("Dispersion level", MST::zero());
-            a = log(g / (sqrt(1 + delta * delta)));
-            b = sqrt(log(1 + delta * delta));
-
-            isExpRandom = randomParams->get("Is exp", true);
-            if (isExpRandom)
-            {
-                const MeshScalar BeginX = randomParams->get("Begin X", MST::zero());
-                const MeshScalar BeginY = randomParams->get("Begin Y", MST::zero());
-                const MeshScalar BeginZ = randomParams->get("Begin Z", MST::zero());
-                const MeshScalar EndX = randomParams->get("End X", MST::one());
-                const MeshScalar EndY = randomParams->get("End Y", MST::one());
-                const MeshScalar EndZ = randomParams->get("End Z", MST::one());
-                num_rv = randomParams->get("Number random variables", 0);
-                const MeshScalar correlation_lengthX = randomParams->get("Correlation length X", MST::one());
-                const MeshScalar correlation_lengthY = randomParams->get("Correlation length Y", MST::one());
-                const MeshScalar correlation_lengthZ = randomParams->get("Correlation length Z", MST::one());
-
-                if (correlation_lengthZ == 0)
-                    ndim = 2;
-
-                const int num_KL_X = randomParams->get("Number of KL Terms X", 0);
-                const int num_KL_Y = randomParams->get("Number of KL Terms Y", 0);
-                const int num_KL_Z = randomParams->get("Number of KL Terms Z", 0);
-
-                mean_type eps = randomParams->get("Bound Perturbation Size", 1e-6);
-                mean_type tol = randomParams->get("Nonlinear Solver Tolerance", 1e-10);
-                int max_it = randomParams->get("Maximum Nonlinear Solver Iterations", 100);
-
-                Teuchos::ParameterList solverParams;
-                solverParams.set("Number of KL Terms", num_rv);
-                solverParams.set("Mean", MST::zero());
-                solverParams.set("Standard Deviation", MST::one());
-                solverParams.set("Bound Perturbation Size", eps);
-                solverParams.set("Nonlinear Solver Tolerance", tol);
-                solverParams.set("Maximum Nonlinear Solver Iterations", max_it);
-                Teuchos::Array<MeshScalar> domain_upper(ndim, 1.0),
-                    domain_lower(ndim, 0.0),
-                    correlation_lengths(ndim, correlation_lengthX);
-                Teuchos::Array<int> num_KL_per_dim(ndim, 1.0);
-
-                domain_upper[0] = EndX;
-                domain_upper[1] = EndY;
-                if (ndim == 3)
-                    domain_upper[2] = EndZ;
-
-                domain_lower[0] = BeginX;
-                domain_lower[1] = BeginY;
-                if (ndim == 3)
-                    domain_lower[2] = BeginZ;
-
-                correlation_lengths[0] = correlation_lengthX;
-                correlation_lengths[1] = correlation_lengthY;
-                if (ndim == 3)
-                    correlation_lengths[2] = correlation_lengthZ;
-
-                if (num_KL_X != 0 && num_KL_Y != 0 && num_KL_Z != 0)
-                {
-                    num_KL_per_dim[0] = num_KL_X;
-                    num_KL_per_dim[1] = num_KL_Y;
-                    if (ndim == 3)
-                        num_KL_per_dim[2] = num_KL_Z;
-                    solverParams.set("Number of KL Terms per dimension", num_KL_per_dim);
-                }
-
-                solverParams.set("Domain Upper Bounds", domain_upper);
-                solverParams.set("Domain Lower Bounds", domain_lower);
-                solverParams.set("Correlation Lengths", correlation_lengths);
-
-                m_rf = rf_type(solverParams);
-                m_rv = _m_rv;
-
-                std::ofstream outputfile_solverParams;
-                std::ofstream outputfile_m_rv;
-
-                outputfile_solverParams.open("RandomFieldParams.txt");
-                outputfile_m_rv.open("RandomVariables.txt");
-
-                outputfile_solverParams << solverParams << std::endl;
-
-                for (size_t i = 0; i < m_rv.extent(0); ++i)
-                    outputfile_m_rv << m_rv(i) << std::endl;
-
-                outputfile_solverParams.close();
-                outputfile_m_rv.close();
-            }
-            else
-            {
-                MeshScalar a = randomParams->get("Correlation length", MST::one());
-                MeshScalar r = randomParams->get("Wavenumber cutoff", MST::one());
-                size_t muw = randomParams->get("Wavenumber discretization points", 40);
-                bool gauss = randomParams->get("Gaussian field", true);
-
-                unsigned long seed_Z = randomParams->get("Z seed", 42);
-                unsigned long seed_Phi = randomParams->get("Phi seed", 186);
-
-                size_t wait_Z = randomParams->get("Number Z of previously drawn samples", 0);
-                size_t wait_Phi = randomParams->get("Number Phi of previously drawn samples", 0);
-
-                Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> Z;
-                Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> Phi;
-
-                Z = construct_Z<Scalar, Device>(muw, seed_Z, wait_Z);
-                Phi = construct_Phi<Scalar, Device>(muw, seed_Phi, wait_Phi);
-
-                sa = Teuchos::rcp(new SpectralApproach<Scalar, Device>(Z, Phi, a, r, muw, gauss));
-            }
-        }
-    }
-
-    KOKKOS_INLINE_FUNCTION
-    Scalar operator()(const MeshScalar x, const MeshScalar y, const MeshScalar z) const
-    {
-        if (isRandom)
-        {
-            Scalar Xi = 0.;
-            if (isExpRandom)
-            {
-                if (ndim == 3)
-                {
-                    const MeshScalar point[3] = {x, y, z};
-                    Xi = m_rf.evaluate(point, m_rv);
-                }
-                else
-                {
-                    const MeshScalar point[2] = {x, y};
-                    Xi = m_rf.evaluate(point, m_rv);
-                }
-            }
-            else
-                Xi = sa->operator()(x, y);
-
-            return exp(a + b * Xi);
-        }
-        else
-            return Teuchos::ScalarTraits<Scalar>::one();
-    }
-};
-
-#endif //KATOPTRON_RANDOMFIELD_H
diff --git a/katoptron/src/wRandomVariable.h b/katoptron/src/wRandomVariable.h
deleted file mode 100644
index 5c73febdc8a4c5afe30042995604b8eb8b4493d7..0000000000000000000000000000000000000000
--- a/katoptron/src/wRandomVariable.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef KATOPTRON_RANDOMVARIABLE_H
-#define KATOPTRON_RANDOMVARIABLE_H
-
-#include "katoptron.h"
-#include <vector>
-
-namespace katoptron
-{
-
-/**
- * @brief Class containing the realisations of the random Gaussian variables.
-  */
-class KATOPTRON_API RandomVariable
-{
-public:
-    std::vector<double> values;
-    size_t sizex;
-    size_t sizey;
-    double *arr;
-
-    RandomVariable(std::vector<double> const &_values) : values(_values){};
-};
-} // namespace katoptron
-
-#endif //KATOPTRON_RANDOMVARIABLE_H
diff --git a/katoptron/src/wSource.cpp b/katoptron/src/wSource.cpp
deleted file mode 100644
index 7b2d35b99f72ecaae5f80875166dc5d7ea9f9eba..0000000000000000000000000000000000000000
--- a/katoptron/src/wSource.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "wSource.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wElement.h"
-#include "wNode.h"
-#include <algorithm>
-using namespace katoptron;
-using namespace tbox;
-
-/**
- * @brief Source constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the constrained surface of the msh,
- *  <li> _Source_name: the name of new Source (does not have to be a nametag of the msh),
- *  <li> v_T: value of the volumetric heat source.
- * </ul>
- */
-Source::Source(Problem &pbl,
-               std::string const &name,
-               std::string const &_Source_name,
-               double v_T) : Group(pbl.msh, name), Source_name(_Source_name), value(v_T)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    pbl.Sources.push_back(this);
-}
-
-/**
- * @brief Display information.
- */
-void Source::write(std::ostream &out) const
-{
-    out << "Source on " << *tag << "\n";
-    out << "Value " << value << "\n";
-}
diff --git a/katoptron/src/wSource.h b/katoptron/src/wSource.h
deleted file mode 100644
index 11f74950399b2d9cd9eb677e81a41d0ce71d5d0e..0000000000000000000000000000000000000000
--- a/katoptron/src/wSource.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef KATOPTRON_SOURCE_H
-#define KATOPTRON_SOURCE_H
-
-#include "katoptron.h"
-#include "wGroup.h"
-#include <vector>
-#include <string>
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to specify in Python the different volumetric heat sources.
- */
-class KATOPTRON_API Source : public tbox::Group
-{
-public:
-    std::string const &Source_name;
-    std::vector<tbox::Node *> nodes;
-    double value;
-
-    Source(Problem &pbl,
-           std::string const &name,
-           std::string const &_Source_name,
-           double v_T);
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_SOURCE_H
diff --git a/katoptron/src/wSpectralApproach.h b/katoptron/src/wSpectralApproach.h
deleted file mode 100644
index d52e70beadea2b0ea7c63a3a6ac4901afd4bde53..0000000000000000000000000000000000000000
--- a/katoptron/src/wSpectralApproach.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef KATOPTRON_SPECTRALAPPROACH_H
-#define KATOPTRON_SPECTRALAPPROACH_H
-
-#include "EnsembleTraits.h"
-#include <cmath>
-#include <random>
-
-/**
- * @brief A function which computes a random matrix \f$\boldsymbol{Z}\f$ starting at a given seed.
- * 
- * This matrix is used to generate a random field based on the spectral approach
- */
-template <typename Scalar, typename Device>
-Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> construct_Z(size_t muw, unsigned long seed_Z, size_t wait = 0)
-{
-    Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> Z = Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device>("Z", muw, muw);
-
-    std::default_random_engine generator;
-    generator.seed(seed_Z);
-    std::uniform_real_distribution<double> distribution(0.0, 1.0);
-    // Redraw the data related to the previous samples to start at the good place
-    for (size_t i = 0; i < wait; ++i)
-        distribution(generator);
-
-    for (size_t ell = 0; ell < EnsembleTraits<Scalar>::size; ++ell)
-        for (size_t i = 0; i < muw; ++i)
-            for (size_t j = 0; j < muw; ++j)
-                EnsembleTraits<Scalar>::coeff(Z(i, j), ell) = sqrt(-log(distribution(generator)));
-
-    return Z;
-}
-
-/**
- * @brief A function which computes a random matrix \f$\boldsymbol{\Phi}\f$ starting at a given seed.
- * 
- * This matrix is used to generate a random field based on the spectral approach
- */
-template <typename Scalar, typename Device>
-Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> construct_Phi(size_t muw, unsigned long seed_Phi, size_t wait = 0)
-{
-    Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> Phi = Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device>("Phi", muw, muw);
-
-    std::default_random_engine generator;
-    generator.seed(seed_Phi);
-    std::uniform_real_distribution<double> distribution(0.0, 1.0);
-    // Redraw the data related to the previous samples to start at the good place
-    for (size_t i = 0; i < wait; ++i)
-        distribution(generator);
-
-    for (size_t ell = 0; ell < EnsembleTraits<Scalar>::size; ++ell)
-        for (size_t i = 0; i < muw; ++i)
-            for (size_t j = 0; j < muw; ++j)
-                EnsembleTraits<Scalar>::coeff(Phi(i, j), ell) = 2. * M_PI * distribution(generator);
-
-    return Phi;
-}
-
-/**
- * @brief A class that constructs realization(s) of Gaussian or exponential
- * scalar random field based on the spectral approach.
- */
-template <typename Scalar, typename Device>
-class SpectralApproach
-{
-public:
-    typedef typename Teuchos::ScalarTraits<Scalar>::coordinateType MeshScalar;
-
-    Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> Z;   // Z=sqrt(-log(rand(muw,muw)));
-    Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> Phi; // Phi=2*pi*rand(muw,muw);
-    Kokkos::View<MeshScalar *, Kokkos::LayoutLeft, Device> w;
-    Kokkos::View<MeshScalar *, Kokkos::LayoutLeft, Device> S;
-
-    MeshScalar a, r, Dw;
-    size_t muw;
-
-    SpectralApproach(Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> _Z,
-                     Kokkos::View<Scalar **, Kokkos::LayoutLeft, Device> _Phi,
-                     MeshScalar _a = 20, MeshScalar _r = 8, size_t _muw = 512,
-                     bool Gaussian = true) : Z(_Z), Phi(_Phi), a(_a), r(_r), muw(_muw)
-    {
-        MeshScalar wL = M_PI / a * r;
-        Dw = 2 * wL / muw;
-
-        w = Kokkos::View<MeshScalar *, Kokkos::LayoutLeft, Device>("w", muw);
-        S = Kokkos::View<MeshScalar *, Kokkos::LayoutLeft, Device>("w", muw);
-
-        for (size_t i = 0; i < muw; ++i)
-            w(i) = -wL + (i + 0.5) * Dw;
-
-        if (Gaussian)
-            for (size_t i = 0; i < muw; ++i)
-                S(i) = a / sqrt(2. * M_PI) * exp(-pow(a * w(i), 2) / 2.);
-        else
-            for (size_t i = 0; i < muw; ++i)
-                S(i) = a / (M_PI * (1 + pow(a, 2) * pow(w(i), 2)));
-    }
-
-    KOKKOS_INLINE_FUNCTION
-    Scalar operator()(const MeshScalar x, const MeshScalar y) const
-    {
-        //Teuchos::TimeMonitor LocalTimer (*Random_field_eval);
-
-        Scalar output = 0.;
-
-        for (size_t i = 0; i < muw; ++i)
-            for (size_t j = 0; j < muw; ++j)
-                output += sqrt(S(i) * S(j)) * Z(i, j) * cos(Phi(i, j) + w(i) * x + w(j) * y);
-
-        output *= sqrt(2) * Dw;
-
-        return output;
-    }
-};
-
-#endif //KATOPTRON_SPECTRALAPPROACH_H
diff --git a/katoptron/src/wVtkExport_KIM2CLEAN.cpp b/katoptron/src/wVtkExport_KIM2CLEAN.cpp
deleted file mode 100644
index dcba910be8fa9c39272389c269ecc0bcd7e89152..0000000000000000000000000000000000000000
--- a/katoptron/src/wVtkExport_KIM2CLEAN.cpp
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * 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 "wVtkExport_KIM2CLEAN.h"
-#include "wMshData.h"
-#include "wTag.h"
-#include "wElement.h"
-#include "wNode.h"
-#include "wResults.h"
-
-#include <vtkVersion.h>
-#include <vtkSmartPointer.h>
-#include <vtkTetra.h>
-#include <vtkHexahedron.h>
-#include <vtkCellArray.h>
-#include <vtkXMLUnstructuredGridReader.h>
-
-#include <vtkXMLUnstructuredGridWriter.h>
-#include "vtkXMLPUnstructuredGridWriter.h"
-#include <vtkUnstructuredGrid.h>
-#include <vtkPointData.h>
-#include <vtkDoubleArray.h>
-#include "vtkCellArray.h"
-#include "vtkCellData.h"
-#include <vtkVertexGlyphFilter.h>
-
-#ifdef VTK_HAS_MPI
-#include <mpi.h>
-#include "vtkMPIController.h"
-#endif
-
-using namespace tbox;
-using namespace tboxVtk;
-
-VtkExport_KIM2CLEAN::VtkExport_KIM2CLEAN(std::shared_ptr<MshData> _msh) : msh(_msh)
-{
-}
-
-/**
- * @brief Save results defined at all the slave contact nodes ONLY.
- * Those datas are Lagrange multipliers and can only be scalar or vectors.
- */
-
-void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, std::vector<int> contactElementID, std::map<int, int> lagrange_LO_to_nodes_GO, std::map<int, int> nodes_GO_to_lagrange_LO) const
-{
-#ifdef VTK_HAS_MPI
-    vtkSmartPointer<vtkPoints> points =
-        vtkSmartPointer<vtkPoints>::New();
-
-    points->SetNumberOfPoints(lagrange_LO_to_nodes_GO.size());
-
-    for (int ii = 0; ii < lagrange_LO_to_nodes_GO.size(); ++ii)
-        points->InsertPoint(ii, msh->nodes[lagrange_LO_to_nodes_GO[ii]]->pos(0), msh->nodes[lagrange_LO_to_nodes_GO[ii]]->pos(1), msh->nodes[lagrange_LO_to_nodes_GO[ii]]->pos(2));
-
-    int CellArraySize = 0;
-    int numberOfCells = 0;
-    int numberOfElems = contactElementID.size();
-    bool isQuad = true;
-    for (int ii = 0; ii < numberOfElems; ++ii)
-    {
-        int elemID = contactElementID[ii];
-        if (msh->elems[elemID]->type() == ElType::QUAD4)
-        {
-            CellArraySize += ((msh->elems[elemID]->nodes.size()) + 1);
-            ++numberOfCells;
-        }
-        else if (msh->elems[elemID]->type() == ElType::TRI3)
-        {
-            CellArraySize += ((msh->elems[elemID]->nodes.size()) + 1);
-            ++numberOfCells;
-            isQuad = false;
-        }
-    }
-
-    vtkIdType *vtkCells = NULL;
-    vtkCells = new vtkIdType[CellArraySize];
-
-    int CellOffset = 0;
-    for (int ii = 0; ii < numberOfElems; ++ii)
-    {
-        int elemID = contactElementID[ii];
-        if (msh->elems[elemID]->type() == ElType::QUAD4)
-        {
-            vtkCells[CellOffset++] = msh->elems[elemID]->nodes.size();
-            for (int jj = 0; jj < msh->elems[elemID]->nodes.size(); ++jj)
-                vtkCells[CellOffset++] = nodes_GO_to_lagrange_LO[msh->elems[elemID]->nodes[jj]->row];
-        }
-        else if (msh->elems[elemID]->type() == ElType::TRI3)
-        {
-            vtkCells[CellOffset++] = msh->elems[elemID]->nodes.size();
-            for (int jj = 0; jj < msh->elems[elemID]->nodes.size(); ++jj)
-                vtkCells[CellOffset++] = nodes_GO_to_lagrange_LO[msh->elems[elemID]->nodes[jj]->row];
-        }
-    }
-    vtkSmartPointer<vtkIdTypeArray> Conn = vtkSmartPointer<vtkIdTypeArray>::New();
-    Conn->SetArray(vtkCells, CellArraySize, 1);
-
-    vtkSmartPointer<vtkCellArray> cellArray =
-        vtkSmartPointer<vtkCellArray>::New();
-    cellArray->SetCells(numberOfCells, Conn);
-
-    vtkSmartPointer<vtkUnstructuredGrid> unstructuredGrid =
-        vtkSmartPointer<vtkUnstructuredGrid>::New();
-    unstructuredGrid->SetPoints(points);
-    if (isQuad)
-        unstructuredGrid->SetCells(VTK_QUAD, cellArray);
-    else
-        unstructuredGrid->SetCells(VTK_TRIANGLE, cellArray);
-
-    for (auto &p : r.scalars_at_nodes)
-    {
-        vtkSmartPointer<vtkDoubleArray> scalar =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        scalar->SetNumberOfComponents(1);
-        scalar->SetNumberOfTuples(lagrange_LO_to_nodes_GO.size());
-        scalar->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < lagrange_LO_to_nodes_GO.size(); ++ii)
-        {
-            scalar->SetValue(ii, (*(p.second))[ii]);
-        }
-
-        unstructuredGrid->GetPointData()->AddArray(scalar);
-    }
-    for (auto &p : r.vectors_at_nodes)
-    {
-        vtkSmartPointer<vtkDoubleArray> vector =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        vector->SetNumberOfComponents(3);
-        vector->SetNumberOfTuples(lagrange_LO_to_nodes_GO.size());
-        vector->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < lagrange_LO_to_nodes_GO.size(); ++ii)
-        {
-            Eigen::Vector3d const &v = (*(p.second))[ii];
-            vector->SetTuple3(ii, v(0), v(1), v(2));
-        }
-
-        unstructuredGrid->GetPointData()->AddArray(vector);
-    }
-
-    vtkSmartPointer<vtkXMLUnstructuredGridWriter> writer =
-        vtkSmartPointer<vtkXMLUnstructuredGridWriter>::New();
-    writer->SetFileName(fname.c_str());
-    writer->SetInputData(unstructuredGrid);
-    writer->Write();
-
-    delete[] vtkCells;
-#endif
-}
-
-/**
- * @brief Save results defined at all nodes and 3D elements, those values can scalar, vector or tensors.
- */
-
-void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, std::map<int, int> nodesWO_LO_to_GO, std::map<int, int> nodesWO_GO_to_LO, std::map<int, int> elements_GO_to_LO) const
-{
-#ifdef VTK_HAS_MPI
-
-    int n_procs = 0, rank = 0;
-    MPI_Comm_size(MPI_COMM_WORLD, &n_procs);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    vtkMPIController *controller = vtkMPIController::New();
-    controller->Initialize(0, 0, 1);
-    controller->SetGlobalController(controller);
-
-    vtkSmartPointer<vtkPoints> points =
-        vtkSmartPointer<vtkPoints>::New();
-
-    points->SetNumberOfPoints(nodesWO_LO_to_GO.size());
-
-    for (int ii = 0; ii < nodesWO_LO_to_GO.size(); ++ii)
-        points->InsertPoint(ii, msh->nodes[nodesWO_LO_to_GO[ii]]->pos(0), msh->nodes[nodesWO_LO_to_GO[ii]]->pos(1), msh->nodes[nodesWO_LO_to_GO[ii]]->pos(2));
-
-    int CellArraySize = 0;
-    int numberOfCells = 0;
-    int numberOfElems = msh->elems.size();
-    bool isAHexahedron = true;
-
-    std::map<int, int> elems_GO_to_3D;
-    std::map<int, int> elems_3D_to_LO;
-
-    for (int ii = 0; ii < numberOfElems; ++ii)
-    {
-        if (msh->elems[ii]->type() == ElType::HEX8)
-        {
-            CellArraySize += ((msh->elems[ii]->nodes.size()) + 1);
-
-            elems_GO_to_3D[msh->elems[ii]->no - 1] = numberOfCells;
-            elems_3D_to_LO[numberOfCells] = ii;
-
-            ++numberOfCells;
-        }
-        else if (msh->elems[ii]->type() == ElType::TETRA4)
-        {
-            CellArraySize += ((msh->elems[ii]->nodes.size()) + 1);
-
-            elems_GO_to_3D[msh->elems[ii]->no - 1] = numberOfCells;
-            elems_3D_to_LO[numberOfCells] = ii;
-
-            ++numberOfCells;
-
-            isAHexahedron = false;
-        }
-    }
-
-    vtkIdType *vtkCells = NULL;
-    vtkCells = new vtkIdType[CellArraySize];
-
-    int CellOffset = 0;
-    for (int ii = 0; ii < numberOfElems; ++ii)
-    {
-        if (msh->elems[ii]->type() == ElType::HEX8)
-        {
-            vtkCells[CellOffset++] = msh->elems[ii]->nodes.size();
-            for (int jj = 0; jj < msh->elems[ii]->nodes.size(); ++jj)
-                vtkCells[CellOffset++] = nodesWO_GO_to_LO[msh->elems[ii]->nodes[jj]->row];
-        }
-        else if (msh->elems[ii]->type() == ElType::TETRA4)
-        {
-            vtkCells[CellOffset++] = msh->elems[ii]->nodes.size();
-            for (int jj = 0; jj < msh->elems[ii]->nodes.size(); ++jj)
-                vtkCells[CellOffset++] = nodesWO_GO_to_LO[msh->elems[ii]->nodes[jj]->row];
-        }
-    }
-    vtkSmartPointer<vtkIdTypeArray> Conn = vtkSmartPointer<vtkIdTypeArray>::New();
-    Conn->SetArray(vtkCells, CellArraySize, 1);
-
-    vtkSmartPointer<vtkCellArray> cellArray =
-        vtkSmartPointer<vtkCellArray>::New();
-
-    cellArray->SetCells(numberOfCells, Conn);
-
-    vtkSmartPointer<vtkUnstructuredGrid> unstructuredGrid =
-        vtkSmartPointer<vtkUnstructuredGrid>::New();
-    unstructuredGrid->SetPoints(points);
-    if (isAHexahedron)
-        unstructuredGrid->SetCells(VTK_HEXAHEDRON, cellArray);
-    else
-        unstructuredGrid->SetCells(VTK_TETRA, cellArray);
-
-    for (auto &p : r.scalars_at_nodes)
-    {
-        vtkSmartPointer<vtkDoubleArray> scalar =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        scalar->SetNumberOfComponents(1);
-        scalar->SetNumberOfTuples(nodesWO_LO_to_GO.size());
-        scalar->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < nodesWO_LO_to_GO.size(); ++ii)
-            scalar->SetValue(ii, (*(p.second))[ii]);
-
-        unstructuredGrid->GetPointData()->AddArray(scalar);
-    }
-    for (auto &p : r.vectors_at_nodes)
-    {
-        vtkSmartPointer<vtkDoubleArray> vector =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        vector->SetNumberOfComponents(3);
-        vector->SetNumberOfTuples(nodesWO_LO_to_GO.size());
-        vector->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < nodesWO_LO_to_GO.size(); ++ii)
-        {
-            Eigen::Vector3d const &v = (*(p.second))[ii];
-            vector->SetTuple3(ii, v(0), v(1), v(2));
-        }
-
-        unstructuredGrid->GetPointData()->AddArray(vector);
-    }
-    for (auto &p : r.tensors_at_nodes)
-    {
-        vtkSmartPointer<vtkDoubleArray> tensors =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        tensors->SetNumberOfComponents(9);
-        tensors->SetNumberOfTuples(nodesWO_LO_to_GO.size());
-        tensors->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < nodesWO_LO_to_GO.size(); ++ii)
-        {
-            Eigen::MatrixXd const &v = (*(p.second))[ii];
-            tensors->SetTuple9(ii, v(0, 0), v(0, 1), v(0, 2), v(1, 0), v(1, 1), v(1, 2), v(2, 0), v(2, 1), v(2, 2));
-        }
-
-        unstructuredGrid->GetPointData()->AddArray(tensors);
-    }
-
-    for (auto &p : r.scalars_at_elems)
-    {
-        vtkSmartPointer<vtkDoubleArray> scalar =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        scalar->SetNumberOfComponents(1);
-        scalar->SetNumberOfTuples(numberOfCells);
-        scalar->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < numberOfCells; ++ii)
-        {
-            scalar->SetValue(ii, (*(p.second))[elems_3D_to_LO[ii]]);
-        }
-
-        unstructuredGrid->GetCellData()->AddArray(scalar);
-    }
-    for (auto &p : r.vectors_at_elems)
-    {
-        vtkSmartPointer<vtkDoubleArray> vector =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        vector->SetNumberOfComponents(3);
-        vector->SetNumberOfTuples(numberOfCells);
-        vector->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < numberOfCells; ++ii)
-        {
-            Eigen::Vector3d const &v = (*(p.second))[ii];
-            vector->SetTuple3(ii, v(0), v(1), v(2));
-        }
-
-        unstructuredGrid->GetCellData()->AddArray(vector);
-    }
-    for (auto &p : r.tensors_at_elems)
-    {
-        vtkSmartPointer<vtkDoubleArray> tensors =
-            vtkSmartPointer<vtkDoubleArray>::New();
-
-        tensors->SetNumberOfComponents(9);
-        tensors->SetNumberOfTuples(numberOfCells);
-        tensors->SetName(p.first.c_str());
-
-        for (int ii = 0; ii < numberOfCells; ++ii)
-        {
-            Eigen::MatrixXd const &v = (*(p.second))[elems_3D_to_LO[ii]];
-            tensors->SetTuple9(ii, v(0, 0), v(0, 1), v(0, 2), v(1, 0), v(1, 1), v(1, 2), v(2, 0), v(2, 1), v(2, 2));
-        }
-
-        unstructuredGrid->GetCellData()->AddArray(tensors);
-    }
-
-    vtkSmartPointer<vtkIntArray> elem_proc_id = vtkSmartPointer<vtkIntArray>::New();
-    elem_proc_id->SetName("processor_id");
-    elem_proc_id->SetNumberOfComponents(1);
-    elem_proc_id->SetNumberOfTuples(numberOfCells);
-
-    for (int ii = 0; ii < numberOfCells; ++ii)
-        elem_proc_id->SetValue(ii, rank);
-
-    unstructuredGrid->GetCellData()->AddArray(elem_proc_id);
-
-    vtkSmartPointer<vtkIntArray> volume_id = vtkSmartPointer<vtkIntArray>::New();
-    volume_id->SetName("volume_id");
-    volume_id->SetNumberOfComponents(1);
-    volume_id->SetNumberOfTuples(numberOfElems);
-
-    for (auto &ptag : msh->ptags)
-    {
-        if (ptag.second->dim == 3)
-        {
-            for (int ii = 0; ii < ptag.second->elems.size(); ++ii)
-            {
-                volume_id->SetValue(elems_GO_to_3D[ptag.second->elems[ii]->no - 1], ptag.second->no);
-            }
-        }
-    }
-    unstructuredGrid->GetCellData()->AddArray(volume_id);
-
-    vtkSmartPointer<vtkXMLPUnstructuredGridWriter> writer =
-        vtkSmartPointer<vtkXMLPUnstructuredGridWriter>::New();
-
-    writer->SetGhostLevel(1);
-    writer->SetNumberOfPieces(n_procs);
-    writer->SetStartPiece(rank);
-    writer->SetEndPiece(rank);
-
-    writer->SetFileName(fname.c_str());
-    writer->SetInputData(unstructuredGrid);
-    writer->Write();
-
-    delete[] vtkCells;
-
-    controller->Finalize(1);
-#endif
-}
diff --git a/katoptron/src/wVtkExport_KIM2CLEAN.h b/katoptron/src/wVtkExport_KIM2CLEAN.h
deleted file mode 100644
index 8dbfcbe0e1226df04557c77cb43da41456e8635d..0000000000000000000000000000000000000000
--- a/katoptron/src/wVtkExport_KIM2CLEAN.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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 WVTKEXPORT_KIM2CLEAN_H
-#define WVTKEXPORT_KIM2CLEAN_H
-
-#include "katoptron.h"
-#include <string>
-#include <memory>
-#include <vector>
-#include <map>
-
-#ifndef SWIG
-
-namespace tboxVtk
-{
-
-/**
- * @brief Save routines of Kim
- * @authors Kim Liegeois
- * @todo those functions have to be removed and wVtkExport has to be used instead.
- * However, there are currently two difficulties.
- *  - Each save_MPI function save on different meshes, a contact mesh has to be created and given to one of the
- *    VtkExport.
- *  - wVtkExport do not support MPI for now and some #ifdef VTK_HAS_MPI are currently unwanted in wVtkExport.
- *    At the end of the day, instead of using element[i]->no-1 it will be required to use a map to translate
- *    the global mesh id to local ones, those map will be trivial for one proc cases, and more complex when MPI
- *    is used. This will allow each proc to write only the data that it has computed. Moreover, Vtk MPI initialization
- *    and finalization will have to be used. Those can be done using some unwanted #ifdef VTK_HAS_MPI or using more
- *    elegant strategies or requiring VTK binaries that support MPI.
- */
-class KATOPTRON_API VtkExport_KIM2CLEAN
-{
-public:
-    std::shared_ptr<tbox::MshData> msh;
-
-    VtkExport_KIM2CLEAN(std::shared_ptr<tbox::MshData> _msh);
-    virtual ~VtkExport_KIM2CLEAN() {}
-
-    void save_MPI(std::string const &fname,
-                  tbox::Results const &r,
-                  std::map<int, int> nodeWO_LO_to_GO,
-                  std::map<int, int> nodeWO_GO_to_LO,
-                  std::map<int, int> elements_GO_to_LO) const;
-    void save_MPI(std::string const &fname,
-                  tbox::Results const &r,
-                  std::vector<int> contactElementID,
-                  std::map<int, int> nodeWO_LO_to_GO,
-                  std::map<int, int> nodeWO_GO_to_LO) const;
-};
-
-} // namespace tboxVtk
-
-#endif
-
-#endif //WVTKUTILS_KIMTOCLEAN_H
diff --git a/katoptron/src/wWeight.cpp b/katoptron/src/wWeight.cpp
deleted file mode 100644
index cd5ab844d1e84d34384794c20b1b5c410dd68965..0000000000000000000000000000000000000000
--- a/katoptron/src/wWeight.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-#include "wWeight.h"
-#include "wProblem.h"
-#include "wTag.h"
-#include "wElement.h"
-#include "wNode.h"
-#include <algorithm>
-using namespace katoptron;
-
-/**
- * @brief Weight constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the weighted domain of the msh,
- *  <li> _which_dof: a vector that specify which degree(s) of freedom are weighted,
- *  <li> _values: a vector that specify the values of the weights
- *  (the length of _which_dof and _values must be the same),
- *  <li> ensemble_size: the ensemble size.
- * </ul>
- */
-Weight::Weight(katoptron::Problem &pbl,
-               std::string const &name,
-               std::vector<int> _which_dof,
-               std::vector<double> _values,
-               size_t ensemble_size) : Group(pbl.msh, name), which_dof(_which_dof), values(_values)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    x_values = {};
-    y_values = {};
-    z_values = {};
-    T_values = {};
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        x_values.push_back(values[0]);
-        y_values.push_back(values[1]);
-        z_values.push_back(values[2]);
-        T_values.push_back(values[3]);
-    }
-    pbl.Weights.push_back(this);
-}
-
-/**
- * @brief Weight constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the weighted domain of the msh,
- *  <li> x: a int which specify whether the x displacement component is weighted,
- *  <li> v_x: value of the weight,
- *  <li> y: a int which specify whether the y displacement component is weighted,
- *  <li> v_y: value of the weight,
- *  <li> z: a int which specify whether the z displacement component is weighted,
- *  <li> v_z: value of the weight,
- *  <li> T: a int which specify whether the temperature is constrained,
- *  <li> v_T: value of the weight,
- *  <li> ensemble_size: the ensemble size.
- * </ul>
- */
-Weight::Weight(Problem &pbl,
-               std::string const &name,
-               int x,
-               double v_x,
-               int y,
-               double v_y,
-               int z,
-               double v_z,
-               int T,
-               double v_T,
-               size_t ensemble_size) : Group(pbl.msh, name)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    which_dof = {};
-    which_dof.push_back(x);
-    which_dof.push_back(y);
-    which_dof.push_back(z);
-    which_dof.push_back(T);
-
-    values = {};
-    values.push_back(v_x);
-    values.push_back(v_y);
-    values.push_back(v_z);
-    values.push_back(v_T);
-
-    x_values = {};
-    y_values = {};
-    z_values = {};
-    T_values = {};
-    for (auto i = 0; i < ensemble_size; ++i)
-    {
-        x_values.push_back(v_x);
-        y_values.push_back(v_y);
-        z_values.push_back(v_z);
-        T_values.push_back(v_T);
-    }
-
-    pbl.Weights.push_back(this);
-}
-
-/**
- * @brief Weight constructor
- * 
- * Arguments:
- * <ul>
- *  <li> pbl: a Problem object,
- *  <li> name: the name of the weighted domain of the msh,
- *  <li> x: a int which specify whether the x displacement component is weighted,
- *  <li> v_x: vector of values of the weight (one per sample),
- *  <li> y: a int which specify whether the y displacement component is weighted,
- *  <li> v_y: vector of values of the weight (one per sample),
- *  <li> z: a int which specify whether the z displacement component is weighted,
- *  <li> v_z: vector of values of the weight (one per sample),
- *  <li> T: a int which specify whether the temperature is constrained,
- *  <li> v_T: vector of values of the weight (one per sample),
- *  <li> ensemble_size: the ensemble size.
- * </ul>
- */
-Weight::Weight(Problem &pbl,
-               std::string const &name,
-               int x,
-               std::vector<double> v_x,
-               int y,
-               std::vector<double> v_y,
-               int z,
-               std::vector<double> v_z,
-               int T,
-               std::vector<double> v_T) : Group(pbl.msh, name)
-{
-    for (auto e : tag->elems)
-        for (auto n : e->nodes)
-            nodes.push_back(n);
-
-    which_dof = {};
-    which_dof.push_back(x);
-    which_dof.push_back(y);
-    which_dof.push_back(z);
-    which_dof.push_back(T);
-
-    values = {};
-    values.push_back(v_x[0]);
-    values.push_back(v_y[0]);
-    values.push_back(v_z[0]);
-    values.push_back(v_T[0]);
-
-    x_values = {};
-    y_values = {};
-    z_values = {};
-    T_values = {};
-    for (auto i = 0; i < v_x.size(); ++i)
-        x_values.push_back(v_x[i]);
-
-    for (auto i = 0; i < v_y.size(); ++i)
-        y_values.push_back(v_y[i]);
-
-    for (auto i = 0; i < v_z.size(); ++i)
-        z_values.push_back(v_z[i]);
-
-    for (auto i = 0; i < v_T.size(); ++i)
-        T_values.push_back(v_T[i]);
-
-    pbl.Weights.push_back(this);
-}
-
-/**
- * @brief Display information.
- */
-void Weight::write(std::ostream &out) const
-{
-    out << "Weights on " << *tag << "\n";
-}
diff --git a/katoptron/src/wWeight.h b/katoptron/src/wWeight.h
deleted file mode 100644
index b1009a8406628a324bb967cb39a8e39fb96528f7..0000000000000000000000000000000000000000
--- a/katoptron/src/wWeight.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef KATOPTRON_WEIGHT_H
-#define KATOPTRON_WEIGHT_H
-
-#include "katoptron.h"
-#include "wGroup.h"
-#include <vector>
-#include <string>
-
-#include <Teuchos_RCP.hpp>
-using namespace tbox;
-
-namespace katoptron
-{
-
-/**
- * @brief Class used to specify in Python the different weights used for
- * the computation of the weighted residual of the GMRES.
- */
-class KATOPTRON_API Weight : public Group
-{
-public:
-    std::vector<Node *> nodes;
-    std::vector<int> which_dof;
-    std::vector<double> values;
-
-    std::vector<double> x_values;
-    std::vector<double> y_values;
-    std::vector<double> z_values;
-    std::vector<double> T_values;
-
-    Weight(Problem &pbl,
-           std::string const &name,
-           std::vector<int> _which_dof,
-           std::vector<double> _values,
-           size_t ensemble_size = 1);
-
-    Weight(Problem &pbl,
-           std::string const &name,
-           int x,
-           double v_x,
-           int y,
-           double v_y,
-           int z,
-           double v_z,
-           int T = 0,
-           double v_T = 0,
-           size_t ensemble_size = 1);
-
-    Weight(Problem &pbl,
-           std::string const &name,
-           int x,
-           std::vector<double> v_x,
-           int y,
-           std::vector<double> v_y,
-           int z,
-           std::vector<double> v_z,
-           int T = 0,
-           std::vector<double> v_T = {});
-
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-};
-
-} // namespace katoptron
-
-#endif //KATOPTRON_WEIGHT_H
diff --git a/katoptron/tests/1_cube.geo b/katoptron/tests/1_cube.geo
deleted file mode 100644
index 99d074747f84e1c2f9d51c0f2cba9f92e4798552..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube.geo
+++ /dev/null
@@ -1,39 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-nC1 = 4;
-
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Point("Measure point 1") = {4};
-Physical Point("Measure point 2") = {1};
diff --git a/katoptron/tests/1_cube.py b/katoptron/tests/1_cube.py
deleted file mode 100644
index a5951ffb8dbb0febc79b320483840d06002a717a..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube.py
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '1_cube.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    hf = 1 * np.ones(ensemble_size)
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero,
-              0, zero, 0, zero, 1, hf, ensemble_size)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['smoother: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 1
-    mueluParamsSub2['relaxation: damping factor'] = 0.9
-
-    mueluParams['verbosity'] = "low"
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-
-    solverList['mueluParams'] = mueluParams
-    solverList['Write txt files'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    tag_name = "Measure point 1"
-    which_pos = 0
-    which_dof = 3
-    DOFperNode = 4
-    name_sol = "x_mm.txt"
-
-    pos_1, sol_1 = u.extract(msh, tag_name, DOFperNode,
-                             which_pos, which_dof, ensemble_size, name_sol)
-
-    tag_name = "Measure point 2"
-
-    pos_2, sol_2 = u.extract(msh, tag_name, DOFperNode,
-                             which_pos, which_dof, ensemble_size, name_sol)
-
-    tests = CTests()
-    measured_T_1 = sol_1[0]
-    tests.add(CTest('Temperature 1', measured_T_1, 97.7193, 5e-5))
-
-    measured_T_2 = sol_2[0]
-    tests.add(CTest('Temperature 2', measured_T_2, 10., 5e-5))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/1_cube_conv.py b/katoptron/tests/1_cube_conv.py
deleted file mode 100644
index f853b4f110e076b841c329a45e912d7d1a64ef9b..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube_conv.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-from fwk.testing import *
-from katoptron.readers import read_Belos
-
-
-def model(msh,
-          E,
-          p,
-          ensemble_size):
-    comm, rank, size = m.utilities.import_MPI()
-
-    pbl = m.Problem(msh, comm)
-
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 0.,
-                ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 100
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = False
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    solverList['Write matrix and vectors'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    slv.start()
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    useER = m.UseEnsembleReduction()
-
-    geo_name = '1_cube.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    E_mean = 1.
-    E_min = 0.75
-    E_max = 1.25
-
-    E_min_2 = 0.95
-    E_max_2 = 1.05
-
-    E_min_3 = 1.2
-    E_max_3 = 1.3
-
-    p_mean = 0.1
-    p_min = 0.075
-    p_max = 0.125
-
-    ensemble_size = 8
-    E = np.linspace(E_min, E_max, ensemble_size)
-    p = p_mean * np.ones(ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-    model(msh, E, p, ensemble_size)
-
-    u.Finalize_Kokkos()
-
-    if rank == 0:
-        if useER:
-            iter_indices, residuals = read_Belos(work_dir+'/belos_out.txt', 1)
-
-            tests = CTests()
-            nIterations = iter_indices[-1]
-            nExpectedIterations = 75
-            tests.add(CTest('Number of iterations with ensemble reduction',
-                            nIterations, nExpectedIterations, 0.))
-            tests.run()
-        else:
-            iter_indices, residuals = read_Belos(
-                work_dir+'/belos_out.txt', ensemble_size)
-
-            tests = CTests()
-            nIterations = iter_indices[-1]
-            nExpectedIterations = 35
-            tests.add(CTest('Number of iterations without ensemble reduction',
-                            nIterations, nExpectedIterations, 0.))
-            tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/1_cube_k.py b/katoptron/tests/1_cube_k.py
deleted file mode 100644
index 05105c359dee4b933209f73fdab14d8e572ebf44..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube_k.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '1_cube.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    hf = 1 * np.ones(ensemble_size)
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero,
-              0, zero, 0, zero, 1, hf, ensemble_size)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 2
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['coarse: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "MT Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 1
-    mueluParamsSub2['relaxation: damping factor'] = 0.9
-
-    mueluParams['verbosity'] = "low"
-
-    mueluParams['coarse: params'] = mueluParamsSub2
-
-    solverList['mueluParams'] = mueluParams
-    solverList['Write txt files'] = True
-
-    m.Kokkos_Initialize(2)
-    slv = m.IterativeSolver(
-        pbl, solverList, 4, ensemble_size)
-    slv.start()
-
-    m.Kokkos_Finalize()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/1_cube_rf.py b/katoptron/tests/1_cube_rf.py
deleted file mode 100644
index 310170c5b1f1eae8befaffd80cc63b706fc06fb6..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube_rf.py
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '1_cube.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    hf = 1 * np.ones(ensemble_size)
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    num_random_variables = 10
-
-    rand = np.random.normal(0, 1, 10*ensemble_size)
-
-    for i in range(0, num_random_variables):
-        pbl.add(m.RandomVariable(rand[i*ensemble_size:(i+1)*ensemble_size]))
-
-    randomParams = Teuchos.ParameterList()
-
-    randomParams['Is random'] = True
-    randomParams['Begin X'] = 0.
-    randomParams['Begin Y'] = 0.
-    randomParams['Begin Z'] = 0.
-    randomParams['End X'] = 10.
-    randomParams['End Y'] = 10.
-    randomParams['End Z'] = 10.
-    randomParams['Number random variables'] = num_random_variables
-    randomParams['Correlation length X'] = 1.
-    randomParams['Correlation length Y'] = 2.
-    randomParams['Correlation length Z'] = 1.
-
-    randomParams['Mean'] = (1. / (2.*(1.+0.2)))
-    randomParams['Dispersion level'] = 0.1
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero,
-              0, zero, 0, zero, 1, hf, ensemble_size)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['randomParams'] = randomParams
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['smoother: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 1
-    mueluParamsSub2['relaxation: damping factor'] = 0.9
-
-    mueluParams['verbosity'] = "low"
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-
-    solverList['mueluParams'] = mueluParams
-    solverList['Write txt files'] = True
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    tag_name = "Measure point 1"
-    which_pos = 0
-    which_dof = 3
-    DOFperNode = 4
-    name_sol = "x_mm.txt"
-
-    pos_1, sol_1 = u.extract(msh, tag_name, DOFperNode,
-                             which_pos, which_dof, ensemble_size, name_sol)
-
-    tag_name = "Measure point 2"
-
-    pos_2, sol_2 = u.extract(msh, tag_name, DOFperNode,
-                             which_pos, which_dof, ensemble_size, name_sol)
-
-    tests = CTests()
-    measured_T_1 = sol_1[0]
-    measured_T_2 = sol_2[0]
-    tests.add(CTest('Temperature 1', measured_T_1, 97.7193, 5e-5))
-    tests.add(CTest('Temperature 2', measured_T_2, 10., 5e-5))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/1_cube_tet.geo b/katoptron/tests/1_cube_tet.geo
deleted file mode 100644
index 1b4fe8a1695b0d50844787a01d3695f70e118140..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube_tet.geo
+++ /dev/null
@@ -1,38 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-nC1 = 4;
-
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; //Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Point("Measure point 1") = {4};
-Physical Point("Measure point 2") = {1};
diff --git a/katoptron/tests/1_cube_tet.py b/katoptron/tests/1_cube_tet.py
deleted file mode 100644
index ec36a4ca312060dd9f01028f336cbf335fc1dbae..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube_tet.py
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '1_cube.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    hf = 1 * np.ones(ensemble_size)
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero,
-              0, zero, 0, zero, 1, hf, ensemble_size)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['smoother: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 1
-    mueluParamsSub2['relaxation: damping factor'] = 0.9
-
-    mueluParams['verbosity'] = "low"
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-
-    solverList['mueluParams'] = mueluParams
-    solverList['Write txt files'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    tag_name = "Measure point 1"
-    which_pos = 0
-    which_dof = 3
-    DOFperNode = 4
-    name_sol = "x_mm.txt"
-
-    pos_1, sol_1 = u.extract(msh, tag_name, DOFperNode,
-                             which_pos, which_dof, ensemble_size, name_sol)
-
-    tag_name = "Measure point 2"
-
-    pos_2, sol_2 = u.extract(msh, tag_name, DOFperNode,
-                             which_pos, which_dof, ensemble_size, name_sol)
-
-    tests = CTests()
-    measured_T_1 = sol_1[0]
-    measured_T_2 = sol_2[0]
-    tests.add(CTest('Temperature 1', measured_T_1, 97.7193, 5e-5))
-    tests.add(CTest('Temperature 2', measured_T_2, 10., 5e-5))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/1_cube_tet_block.py b/katoptron/tests/1_cube_tet_block.py
deleted file mode 100644
index 1275b43b197cb26d3a3b938ce61b69ef2358d8c9..0000000000000000000000000000000000000000
--- a/katoptron/tests/1_cube_tet_block.py
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from fwk.testing import *
-import os
-
-
-def test(msh, xml_file_name, rank, nThreads):
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    hf = 1 * np.ones(ensemble_size)
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 10.,
-                ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero, 0, zero, 0, zero, 1, hf,
-              ensemble_size)
-
-    m.Weight(pbl, "Surf 1 2", 1, 1., 1, 1., 1, 1., 1, 2.5, ensemble_size)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 10**(-4)
-
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Merge block matrix'] = False
-    solverList['Use blocked status test'] = True
-    solverList['Use blocked status test: x'] = True
-    solverList['Use blocked status test: T'] = True
-    solverList['Ensemble Convergence Tolerance: x'] = 10**(-7)
-    solverList['Ensemble Convergence Tolerance: T'] = 10**(-7)
-    solverList['Use weighted status test'] = True
-    solverList['Ensemble Convergence Tolerance: weights'] = 10**(-7)
-
-    solverList['Write txt files'] = True
-    solverList['Write matrix and vectors'] = True
-
-    solverList["use xml file"] = True
-    solverList[
-        "MueLu xml file name"] = file_dir + '/../preconditioners/' + xml_file_name
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    slv.start()
-
-    tag_name = "Measure point 1"
-    which_pos = 0
-    which_dof = 3
-    DOFperNode = 4
-    name_sol = "x_mm.txt"
-
-    pos_1, sol_1 = u.extract(msh, tag_name, DOFperNode, which_pos, which_dof,
-                             ensemble_size, name_sol)
-
-    tag_name = "Measure point 2"
-
-    pos_2, sol_2 = u.extract(msh, tag_name, DOFperNode, which_pos, which_dof,
-                             ensemble_size, name_sol)
-
-    tests = CTests()
-    measured_T_1 = sol_1[0]
-    measured_T_2 = sol_2[0]
-    tests.add(CTest('Temperature 1', measured_T_1, 97.7193, 5e-5))
-    tests.add(CTest('Temperature 2', measured_T_2, 10., 5e-5))
-    tests.run()
-
-
-if __name__ == "__main__":
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import numpy as np
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    geo_name = '1_cube_tet.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    nThreads = u.Initialize_Kokkos()
-    directory = '1'
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-    test(msh, 'AMG_BGS_gs_gs.xml', rank, nThreads)
-    os.chdir('..')
-
-    directory = '2'
-    u.mkdir_MPI(directory, comm, rank, size)
-    os.chdir(directory)
-    test(msh, 'blockdirect.xml', rank, nThreads)
-
-    u.Finalize_Kokkos()
diff --git a/katoptron/tests/2_cubes.geo b/katoptron/tests/2_cubes.geo
deleted file mode 100644
index 58dcf0b426c4339af40b34b851fa23faf789c082..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes.geo
+++ /dev/null
@@ -1,77 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-C2 = 9;
-nC1 = 4;
-nC2 = 5;
-
-theta = 0*Pi/4;
-dx = 0;
-dy = 0;
-dz = 0.1;
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Point(5) = { 0,   0, C1+dz, lc};
-Point(6) = { C2,   0, C1+dz, lc};
-Point(7) = { C2, 0, C1+C2+dz, lc};
-Point(8) = { 0, 0, C1+C2+dz, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Line(5) = {5, 6};
-Line(6) = {6, 7};
-Line(7) = {7, 8};
-Line(8) = {8, 5};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-Transfinite Line {5,6,7,8} = nC2+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; Recombine;
-}
-
-Line Loop(13) = {5,6,7,8};
-Plane Surface(14) = {13};
-Transfinite Surface {14};
-Recombine Surface {14};
-
-Rotate {{0,0,1}, {0,0,0}, theta}{Surface{14};}
-
-Extrude {-C2*Sin(theta), C2*Cos(theta), 0}
-{
-  Surface{14}; Layers{nC2}; Recombine;
-}
-
-Translate  {dx,dy,0}  { Volume{2};}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-Physical Volume("Body 2") = {2};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Surface("Surf 2 1") = {-43};
-Physical Surface("Surf 2 2") = {-51};
-
-Physical Point("T measure") = {20};
-
-Mesh.Partitioner = 2;
-Mesh.MetisAlgorithm = 2;
-Mesh.MshFilePartitioned = 0;
diff --git a/katoptron/tests/2_cubes.py b/katoptron/tests/2_cubes.py
deleted file mode 100644
index 6a16393cc477fdd5328d7056dc1f7038c71db751..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Dirichlet(pbl, "Surf 2 2", "Clamped", 1, 0.,
-                1, 0., 1, 2., 1, 20., ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Surf 1 2", "contact", norm)
-    # cont.setInitialyOpen()
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Surf 2 1", norm)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/multigrid_2_lvls_3_1.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_fused.geo b/katoptron/tests/2_cubes_fused.geo
deleted file mode 100644
index bb37ea4b07eec9b878c26b8437ead6b5635128d1..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_fused.geo
+++ /dev/null
@@ -1,72 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-SetFactory("OpenCASCADE");
-
-C1 = 10;
-C2 = 10;
-nC1 = 4;
-nC2 = 4;
-
-theta = 0*Pi/4;
-dx = 0;
-dy = 0;
-dz = 0.;
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Point(5) = { 0,   0, C1+dz, lc};
-Point(6) = { C2,   0, C1+dz, lc};
-Point(7) = { C2, 0, C1+C2+dz, lc};
-Point(8) = { 0, 0, C1+C2+dz, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Line(5) = {5, 6};
-Line(6) = {6, 7};
-Line(7) = {7, 8};
-Line(8) = {8, 5};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-Transfinite Line {5,6,7,8} = nC2+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-//Recombine Surface {12};
-
-Line Loop(13) = {5,6,7,8};
-Plane Surface(14) = {13};
-Transfinite Surface {14};
-//Recombine Surface {14};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; //Recombine;
-}
-
-Extrude {0, C2, 0}
-{
-  Surface{14}; Layers{nC2}; //Recombine;
-}
-
-BooleanFragments{ Volume{1,2}; Delete; }{}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-Physical Volume("Body 2") = {2};
-
-Physical Surface("Surf 1 1") = {1};
-
-Physical Surface("Surf 2 2") = {8};
-
-Physical Point("Pts 1 x") = {1,3};
-Physical Point("Pts 1 y") = {1,2};
diff --git a/katoptron/tests/2_cubes_heat.py b/katoptron/tests/2_cubes_heat.py
deleted file mode 100644
index 979fc56ca058c4c69b11f4c271a0409f8cc48e6c..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_heat.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from fwk.testing import *
-from katoptron.readers import read_Belos
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 10.,
-                ensemble_size)
-    m.Dirichlet(pbl, "Surf 2 2", "Clamped", 1, 0., 1, 0., 1, -2., 1, 20.,
-                ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Surf 1 2", "contact", norm)
-    cont.setInitialyOpen()
-    cont.setMaster(pbl, "Surf 2 1", norm)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/direct_solver.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 3
-
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    tests = CTests()
-    measured_total_CPU_cost = slv.getTimers()["total"].read().getReal().sec()
-
-    non_zero_CPU_cost = (measured_total_CPU_cost > 0.)
-    tests.add(CTest('non zero total CPU cost', non_zero_CPU_cost, True))
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-
-    tag_name = "T measure"
-    which_pos = 0
-    which_dof = 3
-    DOFperNode = 4
-    name_sol = "x_mm.txt"
-
-    pos_1, sol_1 = u.extract(msh, tag_name, DOFperNode, which_pos, which_dof,
-                             ensemble_size, name_sol)
-
-    measured_T_1 = sol_1[0]
-    tests.add(CTest('Temperature 1', measured_T_1, 14.170731, 5e-5))
-
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_no_contact.py b/katoptron/tests/2_cubes_no_contact.py
deleted file mode 100644
index 1d121172f7f3f54d6dd68dd6154c242d40004439..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_no_contact.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Dirichlet(pbl, "Surf 2 2", "Clamped", 1, 0.,
-                1, 0., 1, 2., 1, 20., ensemble_size)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    mueluParams = Teuchos.ParameterList()
-    mueluParams['number of equations'] = 4
-    mueluParams['max levels'] = 1
-    mueluParams['smoother: type'] = "RELAXATION"
-
-    mueluParamsSub2 = Teuchos.ParameterList()
-    mueluParamsSub2['relaxation: type'] = "Symmetric Gauss-Seidel"
-    mueluParamsSub2['relaxation: sweeps'] = 1
-    mueluParamsSub2['relaxation: damping factor'] = 0.9
-
-    mueluParams['verbosity'] = "low"
-
-    mueluParams['smoother: params'] = mueluParamsSub2
-
-    solverList['mueluParams'] = mueluParams
-
-    slv = m.IterativeSolver(pbl, solverList, 4, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch.geo b/katoptron/tests/2_cubes_patch.geo
deleted file mode 100644
index 5e03a0f534b61865ebe85e9be91ca80a813fe663..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch.geo
+++ /dev/null
@@ -1,149 +0,0 @@
-C = 10;
-dC = 2;
-nC1 = 4;
-nC2 = 5;
-
-dz = 0;
-
-lc = 1;
-
-Point(1) = { 0,  0, 0,     lc};
-Point(2) = { C,  0, 0,     lc};
-Point(3) = { C,  0, C,     lc};
-Point(4) = { 0,  0, C-dC,  lc};
-
-Point(5) = { 0,  C, 0,     lc};
-Point(6) = { C,  C, 0,     lc};
-Point(7) = { C,  C, C+dC,  lc};
-Point(8) = { 0,  C, C,     lc};
-
-Point(9)  = { 0,  0, 2*C+dz,     lc};
-Point(10) = { C,  0, 2*C+dz,     lc};
-Point(11) = { C,  0, C+dz,       lc};
-Point(12) = { 0,  0, C-dC+dz,    lc};
-
-Point(13) = { 0,  C, 2*C+dz,     lc};
-Point(14) = { C,  C, 2*C+dz,     lc};
-Point(15) = { C,  C, C+dC+dz,    lc};
-Point(16) = { 0,  C, C+dz,       lc};
-
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Line(5) = {5, 6};
-Line(6) = {6, 7};
-Line(7) = {7, 8};
-Line(8) = {8, 5};
-
-Line(9) = {1, 5};
-Line(10) = {2, 6};
-
-Line(11) = {3, 7};
-Line(12) = {4, 8};
-
-Transfinite Line {1,2,3,4,5,6,7,8,9,10,11,12} = nC1+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Line Loop(13) = {-8,-7,-6,-5};
-Plane Surface(14) = {13};
-Transfinite Surface {14};
-Recombine Surface {14};
-
-Line Loop(15) = {-9,-4,12,8};
-Plane Surface(16) = {15};
-Transfinite Surface {16};
-Recombine Surface {16};
-
-Line Loop(17) = {10,6,-11,-2};
-Plane Surface(18) = {17};
-Transfinite Surface {18};
-Recombine Surface {18};
-
-Line Loop(19) = {9,5,-10,-1};
-Plane Surface(20) = {19};
-Transfinite Surface {20};
-Recombine Surface {20};
-
-Line Loop(21) = {-12,-3,11,7};
-Plane Surface(22) = {21};
-Transfinite Surface {22};
-Recombine Surface {22};
-
-Surface Loop(1) = {22, 16, 20, 14, 18, 12};
-Volume(1) = {1};
-
-Line(23) = {9, 10};
-Line(24) = {10, 11};
-Line(25) = {11, 12};
-Line(26) = {12, 9};
-
-Line(27) = {13, 14};
-Line(28) = {14, 15};
-Line(29) = {15, 16};
-Line(30) = {16, 13};
-
-Line(31) = {9, 13};
-Line(32) = {10, 14};
-
-Line(33) = {11, 15};
-Line(34) = {12, 16};
-
-Transfinite Line {23,24,25,26,27,28,29,30,31,32,33,34} = nC2+1 Using Progression 1;
-
-Line Loop(35) = {-26,-25,-24,-23};
-Plane Surface(36) = {35};
-Transfinite Surface {36};
-Recombine Surface {36};
-
-Line Loop(37) = {27,28,29,30};
-Plane Surface(38) = {37};
-Transfinite Surface {38};
-Recombine Surface {38};
-
-Line Loop(39) = {24,33,-28,-32};
-Plane Surface(40) = {39};
-Transfinite Surface {40};
-Recombine Surface {40};
-
-Line Loop(41) = {-33,25,34,-29};
-Plane Surface(42) = {41};
-Transfinite Surface {42};
-Recombine Surface {42};
-
-Line Loop(43) = {-34,26,31,-30};
-Plane Surface(44) = {43};
-Transfinite Surface {44};
-Recombine Surface {44};
-
-Line Loop(45) = {-31,-27,32,23};
-Plane Surface(46) = {45};
-Transfinite Surface {46};
-Recombine Surface {46};
-
-Surface Loop(2) = {36, 38, 40, 42, 44, 46};
-Volume(2) = {2};
-Recombine Volume {1};
-Recombine Volume {2};
-
-Transfinite Volume{1,2};
-//+
-Physical Volume("Body 1") = {1};
-//+
-Physical Volume("Body 2") = {2};
-//+
-Physical Surface("Clamped") = {20};
-//+
-Physical Surface("Contact 1") = {22};
-//+
-Physical Surface("Contact 2") = {42};
-//+
-Physical Surface("Load") = {46};
-//+
-Physical Point("Clamped xy") = {1};
diff --git a/katoptron/tests/2_cubes_patch.py b/katoptron/tests/2_cubes_patch.py
deleted file mode 100644
index 5d2a8e6b0b3437ec8bd89f80bb36b182273c0221..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch.py
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-
-from katoptron.eigenvalues import *
-from katoptron.convergence import *
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/direct_solver.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-    solverList['Create Preconditioned Matrix'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList, 3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    tests = CTests()
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch_2_lvls.py b/katoptron/tests/2_cubes_patch_2_lvls.py
deleted file mode 100644
index c1c9082d9f538b9fc26ee89ab798a220ba720038..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch_2_lvls.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0.,
-                1, 0., 1, 0., 0, 0., ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0,
-              zero, 1, p, 0, zero, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/SIMPLE_direct_2_lvls.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList,
-                                3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList,
-                                3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch_BraessSarazin.py b/katoptron/tests/2_cubes_patch_BraessSarazin.py
deleted file mode 100644
index a1d6d2061c6952ca394d13df45eed5d39fa9a207..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch_BraessSarazin.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 5000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/BraessSarazin_mtgs.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['gamma'] = 1.
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList, 3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    tests = CTests()
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch_IndefBlockDiagonal.py b/katoptron/tests/2_cubes_patch_IndefBlockDiagonal.py
deleted file mode 100644
index 925d9d81852a5b77746a79f71e4cd90a6276d729..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch_IndefBlockDiagonal.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 5000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/IndefiniteBlockDiagonal_mtgs.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['gamma'] = 1.
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList, 3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    tests = CTests()
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch_SIMPLE.py b/katoptron/tests/2_cubes_patch_SIMPLE.py
deleted file mode 100644
index 95b1aeaaeee844b115483d554d7fdc1fc4117584..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch_SIMPLE.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 5000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['gamma'] = 1.
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/SIMPLE_direct.xml'
-    solverList["Create Preconditioned Matrix"] = True
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['gamma'] = 1.
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList, 3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    tests = CTests()
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch_SIMPLEC.py b/katoptron/tests/2_cubes_patch_SIMPLEC.py
deleted file mode 100644
index b2e47b1b7579a41c2700646e9558babc5942c516..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch_SIMPLEC.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 5000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/SIMPLEC_mtgs.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['gamma'] = 1.
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList, 3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    tests = CTests()
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_patch_Uzawa.py b/katoptron/tests/2_cubes_patch_Uzawa.py
deleted file mode 100644
index 1af732945797e5fbe6a59eca95aebc90e360d127..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_patch_Uzawa.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_patch.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Clamped", "Clamped", 1, 0., 1, 0., 1, 0., 0, 0.,
-                ensemble_size)
-    #m.Dirichlet(pbl, "Clamped xy", "Clamped",1,0.,1,0.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Contact 2", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "Contact 1", norm)
-
-    zero = np.zeros(ensemble_size)
-    p = -0.2 * np.ones(ensemble_size)
-
-    m.Neumann(pbl, "Load", "Load 1", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 5000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + \
-        '/../preconditioners/Uzawa_mtgs.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['gamma'] = 1.
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList, 3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-    iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-    tests = CTests()
-    nIterations = iter_indices[-1]
-    has_converged = (solverList['Maximum Iterations'] > nIterations)
-    tests.add(CTest('Has converged', has_converged, True))
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_sticking.geo b/katoptron/tests/2_cubes_sticking.geo
deleted file mode 100644
index aa71ad54e54a404a0859069bebb55873eb5688ea..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_sticking.geo
+++ /dev/null
@@ -1,72 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-SetFactory("OpenCASCADE");
-
-C1 = 10;
-C2 = 10;
-nC1 = 4;
-nC2 = 4;
-
-theta = 0*Pi/4;
-dx = 0;
-dy = 0;
-dz = 0.;
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Point(5) = { 0,   0, C1+dz, lc};
-Point(6) = { C2,   0, C1+dz, lc};
-Point(7) = { C2, 0, C1+C2+dz, lc};
-Point(8) = { 0, 0, C1+C2+dz, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Line(5) = {5, 6};
-Line(6) = {6, 7};
-Line(7) = {7, 8};
-Line(8) = {8, 5};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-Transfinite Line {5,6,7,8} = nC2+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Line Loop(13) = {5,6,7,8};
-Plane Surface(14) = {13};
-Transfinite Surface {14};
-Recombine Surface {14};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; Recombine;
-}
-
-Extrude {0, C2, 0}
-{
-  Surface{14}; Layers{nC2}; Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-Physical Volume("Body 2") = {2};
-
-Physical Surface("Surf 1 1") = {15};
-Physical Surface("Surf 1 2") = {17};
-
-Physical Surface("Surf 2 1") = {20};
-Physical Surface("Surf 2 2") = {22};
-
-Physical Point("Pts 1 x") = {1,3};
-Physical Point("Pts 1 y") = {1,2};
diff --git a/katoptron/tests/2_cubes_sticking.py b/katoptron/tests/2_cubes_sticking.py
deleted file mode 100644
index 93ed3fbf390e29e65e166b470e23d684fed739b9..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_sticking.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Dirichlet(pbl, "Surf 2 2", "Clamped", 1, 2.,
-                1, 2., 1, -2., 1, 20., ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Surf 1 2", "contact", norm)
-    # cont.setInitialyOpen()
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Surf 2 1", norm)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/direct_solver.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/2_cubes_tet.geo b/katoptron/tests/2_cubes_tet.geo
deleted file mode 100644
index 5bde791cd85ee1633b5749b48a781152ae09f4be..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_tet.geo
+++ /dev/null
@@ -1,75 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-C2 = 10;
-nC1 = 4;
-nC2 = 4;
-
-theta = 0.1*Pi/4;
-dx = 0;
-dy = 0;
-dz = 0.1;
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Point(5) = { 0,   0, C1+dz, lc};
-Point(6) = { C2,   0, C1+dz, lc};
-Point(7) = { C2, 0, C1+C2+dz, lc};
-Point(8) = { 0, 0, C1+C2+dz, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Line(5) = {5, 6};
-Line(6) = {6, 7};
-Line(7) = {7, 8};
-Line(8) = {8, 5};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-Transfinite Line {5,6,7,8} = nC2+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-//Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; //Recombine;
-}
-
-Line Loop(13) = {5,6,7,8};
-Plane Surface(14) = {13};
-Transfinite Surface {14};
-//Recombine Surface {14};
-
-Rotate {{0,0,1}, {0,0,0}, theta}{Surface{14};}
-
-Extrude {-C2*Sin(theta), C2*Cos(theta), 0}
-{
-  Surface{14}; Layers{nC2}; //Recombine;
-}
-
-Translate  {dx,dy,0}  { Volume{2};}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-Physical Volume("Body 2") = {2};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Surface("Surf 2 1") = {-43};
-Physical Surface("Surf 2 2") = {-51};
-
-//Mesh.Partitioner = 2;
-//Mesh.MetisAlgorithm = 2;
-//Mesh.MshFilePartitioned = 0;
diff --git a/katoptron/tests/2_cubes_tet.py b/katoptron/tests/2_cubes_tet.py
deleted file mode 100644
index acb1c29353d4f95d0f1ccd973df704c9b76d2a15..0000000000000000000000000000000000000000
--- a/katoptron/tests/2_cubes_tet.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '2_cubes_tet.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Dirichlet(pbl, "Surf 2 2", "Clamped", 1, 0.,
-                1, 0., 1, 2., 1, 20., ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Surf 1 2", "contact", norm)
-    # cont.setInitialyOpen()
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Surf 2 1", norm)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/multigrid_2_lvls_3_1.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/3_cubes.geo b/katoptron/tests/3_cubes.geo
deleted file mode 100644
index 30d5eecd69c002794cae3151b0549075521bf9c0..0000000000000000000000000000000000000000
--- a/katoptron/tests/3_cubes.geo
+++ /dev/null
@@ -1,107 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-C2 = 9;
-C3 = 10;
-nC1 = 4;
-nC2 = 5;
-nC3 = 6;
-
-theta1 = 0.1*Pi/4;
-theta2 = -0.1*Pi/4;
-
-dx1 = 0;
-dy1 = 0;
-dz1 = 0.1;
-dx2 = 0;
-dy2 = 0;
-dz2 = 0.1;
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Point(5) = { 0,   0, C1+dz1, lc};
-Point(6) = { C2,   0, C1+dz1, lc};
-Point(7) = { C2, 0, C1+C2+dz1, lc};
-Point(8) = { 0, 0, C1+C2+dz1, lc};
-
-Point(9) = { 0,   0, C1+C2+dz1+dz2, lc};
-Point(10) = { C3,   0, C1+C2+dz1+dz2, lc};
-Point(11) = { C3, 0, C1+C2+C3+dz1+dz2, lc};
-Point(12) = { 0, 0, C1+C2+C3+dz1+dz2, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Line(5) = {5, 6};
-Line(6) = {6, 7};
-Line(7) = {7, 8};
-Line(8) = {8, 5};
-
-Line(9) = {9, 10};
-Line(10) = {10, 11};
-Line(11) = {11, 12};
-Line(12) = {12, 9};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-Transfinite Line {5,6,7,8} = nC2+1 Using Progression 1;
-Transfinite Line {9,10,11,12} = nC3+1 Using Progression 1;
-
-Line Loop(13) = {1,2,3,4};
-Plane Surface(14) = {13};
-Transfinite Surface {14};
-Recombine Surface {14};
-
-Extrude {0, C1, 0}
-{
-  Surface{14}; Layers{nC1}; Recombine;
-}
-
-Line Loop(15) = {5,6,7,8};
-Plane Surface(16) = {15};
-Transfinite Surface {16};
-Recombine Surface {16};
-
-Rotate {{0,0,1}, {0,0,0}, theta1}{Surface{16};}
-
-Extrude {-C2*Sin(theta1), C2*Cos(theta1), 0}
-{
-  Surface{16}; Layers{nC2}; Recombine;
-}
-
-Translate  {dx1,dy1,0}  { Volume{2};}
-
-Line Loop(17) = {9,10,11,12};
-Plane Surface(18) = {17};
-Transfinite Surface {18};
-Recombine Surface {18};
-
-Rotate {{0,0,1}, {0,0,0}, theta2}{Surface{18};}
-
-Extrude {-C3*Sin(theta2), C3*Cos(theta2), 0}
-{
-  Surface{18}; Layers{nC3}; Recombine;
-}
-
-Translate  {dx2,dy2,0}  { Volume{3};}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-Physical Volume("Body 2") = {2};
-Physical Volume("Body 3") = {3};
-
-Physical Surface("Surf 1 1") = {-23};
-Physical Surface("Surf 1 2") = {-31};
-
-Physical Surface("Surf 2 1") = {-45};
-Physical Surface("Surf 2 2") = {-53};
-
-Physical Surface("Surf 3 1") = {-67};
-Physical Surface("Surf 3 2") = {-75};
diff --git a/katoptron/tests/3_cubes_partial_sticking.py b/katoptron/tests/3_cubes_partial_sticking.py
deleted file mode 100644
index 7e05beac9a6f8b0b6cca7b2edf613d743a45f8dc..0000000000000000000000000000000000000000
--- a/katoptron/tests/3_cubes_partial_sticking.py
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib.pyplot as plt
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    nThreads = u.Initialize_Kokkos()
-
-    from PyTrilinos import Teuchos
-
-    import shlex
-    import subprocess
-    import os
-    import numpy as np
-
-    geo_name = '3_cubes.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    #E = np.linspace(0.5,1.5,ensemble_size)
-    E = 1. * np.ones(ensemble_size)
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 2", "test", E, nu, k, d)
-    m.Medium(pbl, "Body 3", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0.,
-                 1, 0., 1, 0., 1, 10., ensemble_size)
-    m.Dirichlet(pbl, "Surf 3 2", "Clamped", 1, 2.,
-                 1, 2., 1, -2., 1, 20., ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Surf 1 2", "contact", norm)
-    # cont.setInitialyOpen()
-    # cont.setNoUpdate()
-    # cont.setSticking()
-    cont.setMaster(pbl, "Surf 2 1", norm)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "Surf 2 2", "contact", norm)
-    # cont.setInitialyOpen()
-    cont.setNoUpdate()
-    cont.setSticking()
-    cont.setMaster(pbl, "Surf 3 1", norm)
-
-    dx = np.zeros(ensemble_size)
-    dy = 2. * np.ones(ensemble_size)
-    #dy = np.linspace(0.5,1.5,ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = 10. * np.ones(ensemble_size)
-    #m.Dirichlet(pbl, "Surf 2", "Moved",0,dx,1,dy,0,dz,1,dT)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 1000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/direct_solver.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 5
-
-    #solverList['Print Teuchos timers'] = True
-    solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    if ensemble_size > 1:
-        slv = m.IterativeSolver(pbl, solverList,
-                                3, True, ensemble_size)
-    else:
-        slv = m.IterativeSolver(pbl, solverList,
-                                3, ensemble_size)
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/L_shape.py b/katoptron/tests/L_shape.py
deleted file mode 100644
index 6a80366f5a161067b7b9388bfdd012ca7b00e14d..0000000000000000000000000000000000000000
--- a/katoptron/tests/L_shape.py
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-#import matplotlib.pyplot as plt
-
-import katoptron.utilities as u
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import os
-    import numpy as np
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh = u.fuse_meshes('L_shape_1.geo', 'L_shape_1', 'L_shape_2.geo',
-                        'L_shape_2', 'L_shape_fused', file_dir, work_dir, comm, rank, size)
-
-    ensemble_size = 1
-
-    pbl = m.Problem(msh, comm)
-
-    E = 10. * np.ones(ensemble_size)
-    nu = 0.4 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-    m.Medium(pbl, "body", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "clamping", "Clamped", 1, 0.,
-                1, 0., 1, 0., 0, 0., ensemble_size)
-    #m.Dirichlet(pbl, "load", "Clamped",1,0.,1,2.,1,0.,0,0.,ensemble_size)
-
-    norm = tbox.Vector3d(0, 0, -1)
-    cont = m.Contact(pbl, "outer part boundary 1", "contact", norm)
-    cont.setMeshTying()
-    cont.setMaster(pbl, "inner edge boundary 1", norm)
-    cont1 = m.Contact(pbl, "inner edge boundary 2", "contact", norm)
-    cont1.setMeshTying()
-    cont1.setMaster(pbl, "outer part boundary 2", norm)
-    cont2 = m.Contact(pbl, "outer part boundary 3", "contact", norm)
-    cont2.setMeshTying()
-    cont2.setMaster(pbl, "inner edge boundary 3", norm)
-    cont3 = m.Contact(pbl, "inner edge boundary 4", "contact", norm)
-    cont3.setMeshTying()
-    cont3.setMaster(pbl, "outer part boundary 4", norm)
-    f = -0.002 * np.ones(ensemble_size)
-    zero = np.zeros(ensemble_size)
-
-    m.Neumann(pbl, "load", "load", 0, zero, 1,
-              f, 0, zero, 0, zero, ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 10
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/direct_solver.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    #solverList['Write matrix and vectors'] = True
-    solverList['Write txt files'] = True
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    slv.start()
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/L_shape_1.geo b/katoptron/tests/L_shape_1.geo
deleted file mode 100644
index faef02eac78b1be3d51742ae5ed49b131f03ff21..0000000000000000000000000000000000000000
--- a/katoptron/tests/L_shape_1.geo
+++ /dev/null
@@ -1,95 +0,0 @@
-SetFactory("OpenCASCADE");
-
-LX = 10;
-lx = 2;
-LY = 10;
-ly = 2;
-LZ = 2;
-lix = 1;
-liy = 1;
-
-nlix = 11;
-nliy = 11;
-
-nloiy = 4;
-nloix = 4;
-nloey = 4;
-nloex = 4;
-
-nLX = 8;
-nLY = 8;
-
-nZ1 = 8;
-nZ2 = 5;
-
-lc = 1;
-
-Point(1)  = { lx,    ly, 0.,     lc};
-Point(2)  = { lx+lix,    ly, 0.,     lc};
-Point(3)  = { lx+lix,    ly-liy, 0.,     lc};
-Point(4)  = { lx,    ly-liy, 0.,     lc};
-Point(5)  = { lx-lix,    ly-liy, 0.,     lc};
-Point(6)  = { lx-lix,    ly, 0.,     lc};
-Point(7)  = { lx-lix,    ly+liy, 0.,     lc};
-Point(8)  = { lx,    ly+liy, 0.,     lc};
-//+
-Line(1) = {1, 2};
-//+
-Line(2) = {2, 3};
-//+
-Line(3) = {3, 4};
-//+
-Line(4) = {4, 5};
-//+
-Line(5) = {5, 6};
-//+
-Line(6) = {6, 7};
-//+
-Line(7) = {7, 8};
-//+
-Line(8) = {8, 1};
-//+
-Line(9) = {1, 6};
-//+
-Line(10) = {1, 4};
-//+
-Line Loop(1) = {1, 2, 3, -10};
-//+
-Plane Surface(1) = {1};
-//+
-Line Loop(2) = {10, 4, 5, -9};
-//+
-Plane Surface(2) = {2};
-//+
-Line Loop(3) = {9, 6, 7, 8};
-//+
-Plane Surface(3) = {3};
-//+
-Transfinite Line {7, 9, 4, 3, 1} = nlix Using Progression 1;
-//+
-Transfinite Line {6, 5, 8, 10, 2} = nliy Using Progression 1;
-//+
-Transfinite Surface {2};
-Recombine Surface {2};
-//+
-Transfinite Surface {3};
-Recombine Surface {3};
-//+
-Transfinite Surface {1};
-Recombine Surface {1};
-
-
-Extrude {0, 0, LZ}
-{
-  Surface{1,2,3}; Layers{nZ1}; Recombine;
-}
-
-
-Physical Volume("body") = {1,2,3};
-//+
-Physical Surface("inner edge boundary 1") = {14};
-Physical Surface("inner edge boundary 2") = {13,10};
-Physical Surface("inner edge boundary 3") = {9,6};
-Physical Surface("inner edge boundary 4") = {5};
-//+
-Physical Line("slave Dirichlet") = {24, 19, 14};
diff --git a/katoptron/tests/L_shape_2.geo b/katoptron/tests/L_shape_2.geo
deleted file mode 100644
index 8edb92cd6de18e2b218fed4f5aaed4d13ebffe06..0000000000000000000000000000000000000000
--- a/katoptron/tests/L_shape_2.geo
+++ /dev/null
@@ -1,167 +0,0 @@
-SetFactory("OpenCASCADE");
-
-LX = 10;
-lx = 2;
-LY = 10;
-ly = 2;
-LZ = 2;
-lix = 1;
-liy = 1;
-
-nlix = 10;
-nliy = 10;
-
-nloiy = 4;
-nloix = 4;
-nloey = 4;
-nloex = 4;
-
-nLX = 16;
-nLY = 16;
-
-nZ1 = 8;
-nZ2 = 5;
-
-lc = 1;
-
-dx = 0.;
-
-Point(9)  = { lx+lix+dx,    ly, 0.,     lc};
-Point(10)  = { LX,    ly, 0.,     lc};
-Point(11)  = { LX,    0, 0.,     lc};
-Point(12)  = { lx+lix+dx,    0, 0.,     lc};
-Point(13)  = { 0,    0, 0.,     lc};
-Point(14)  = { 0,    ly-liy-dx, 0.,     lc};
-Point(15)  = { 0,    ly+liy+dx, 0.,     lc};
-Point(16)  = { 0,    LY, 0.,     lc};
-Point(17)  = { lx,   LY, 0.,     lc};
-Point(18)  = { lx,    ly+liy+dx, 0.,     lc};
-Point(19)  = { lx-lix-dx,    ly+liy+dx, 0.,     lc};
-Point(20)  = { lx-lix-dx,    ly-liy-dx, 0.,     lc};
-Point(21)  = { lx+lix+dx,    ly-liy-dx, 0.,     lc};
-
-Point(22)  = { LX,    ly-liy-dx, 0.,     lc};
-Point(23)  = { lx-lix-dx,    0, 0.,     lc};
-Point(24)  = { lx-lix-dx,    LY, 0.,     lc};
-//+
-Line(11) = {21, 9};
-//+
-Line(12) = {21, 12};
-//+
-Line(13) = {11, 22};
-//+
-Line(14) = {22, 10};
-//+
-Line(15) = {23, 20};
-//+
-Line(16) = {13, 14};
-//+
-Line(17) = {18, 17};
-//+
-Line(18) = {24, 19};
-//+
-Line(19) = {15, 16};
-//+
-Line(20) = {18, 19};
-//+
-Line(21) = {19, 15};
-//+
-Line(22) = {15, 14};
-//+
-Line(23) = {14, 20};
-//+
-Line(24) = {20, 19};
-//+
-Line(25) = {13, 23};
-//+
-Line(26) = {23, 12};
-//+
-Line(27) = {21, 20};
-//+
-Line(28) = {9, 10};
-//+
-Line(29) = {22, 21};
-//+
-Line(30) = {12, 11};
-//+
-Line(31) = {24, 17};
-//+
-Line(32) = {24, 16};
-//+
-Line Loop(4) = {19, -32, 18, 21};
-//+
-Plane Surface(4) = {4};
-//+
-Line Loop(5) = {17, -31, 18, -20};
-//+
-Plane Surface(5) = {5};
-//+
-Line Loop(6) = {24, 21, 22, 23};
-//+
-Plane Surface(6) = {6};
-//+
-Line Loop(7) = {16, 23, -15, -25};
-//+
-Plane Surface(7) = {7};
-//+
-Line Loop(8) = {26, -12, 27, -15};
-//+
-Plane Surface(8) = {8};
-//+
-Line Loop(9) = {12, 30, 13, 29};
-//+
-Plane Surface(9) = {9};
-//+
-Line Loop(10) = {11, 28, -14, 29};
-//+
-Plane Surface(10) = {10};
-//+
-Transfinite Line {19, 18, 17} = nLY Using Progression 1;
-//+
-Transfinite Line {28, 29, 30} = nLX Using Progression 1;
-//+
-Transfinite Line {11, 14} = nloiy Using Progression 1;
-//+
-Transfinite Line {13, 12, 15, 16} = nloey Using Progression 1;
-//+
-Transfinite Line {25, 23, 21, 32} = nloex Using Progression 1;
-//+
-Transfinite Line {20, 31} = nloix Using Progression 1;
-//+
-Transfinite Line {27, 26} = 2*nloix Using Progression 1;
-//+
-Transfinite Line {24, 22} = 2*nloiy Using Progression 1;
-
-
-Transfinite Surface {4};
-Transfinite Surface {5};
-Transfinite Surface {6};
-Transfinite Surface {7};
-Transfinite Surface {8};
-Transfinite Surface {9};
-Transfinite Surface {10};
-
-Recombine Surface {4};
-Recombine Surface {5};
-Recombine Surface {6};
-Recombine Surface {7};
-Recombine Surface {8};
-Recombine Surface {9};
-Recombine Surface {10};
-
-
-Extrude {0, 0, LZ}
-{
-  Surface{4,5,6,7,8,9,10}; Layers{nZ2}; Recombine;
-}
-
-Physical Volume("body") = {1,2,3,4,5,6,7};
-//+
-Physical Surface("outer part boundary 1") = {18};
-Physical Surface("outer part boundary 2") = {20};
-Physical Surface("outer part boundary 3") = {30};
-Physical Surface("outer part boundary 4") = {36};
-//+
-Physical Surface("clamping") = {12, 17};
-//+
-Physical Surface("load") = {38, 33};
diff --git a/katoptron/tests/L_shape_curv_1.geo b/katoptron/tests/L_shape_curv_1.geo
deleted file mode 100644
index 3d9aa49eb0c78805bbb1361afb44aaa4bd8803b1..0000000000000000000000000000000000000000
--- a/katoptron/tests/L_shape_curv_1.geo
+++ /dev/null
@@ -1,134 +0,0 @@
-SetFactory("OpenCASCADE");
-
-LX = 10;
-lx = 2;
-LY = 10;
-ly = 2;
-LZ = 2;
-
-nR1 = 5;
-
-R = 0.999;
-R2 = 1.;
-R_in_1 = 0.4;
-R_in_2 = 0.5;
-
-nR = 14;
-nT1 = 9;
-
-nZ1 = 5;
-
-nZ2 = 4;
-nl = 7;
-nLX=5;
-nLY=10;
-nR2=5;
-
-PI = Acos (-1.);
-
-dtheta = 0.001*PI;
-
-lc = 1;
-
-Point(1)  = { lx,    ly, 0.,     lc};
-Point(2)  = { lx+R*Cos(0*PI+dtheta),  ly+R*Sin(0*PI+dtheta), 0.,     lc};
-Point(3)  = { lx+R*Cos(-1*PI/4+dtheta),  ly+R*Sin(-1*PI/4+dtheta), 0.,     lc};
-Point(4)  = { lx+R*Cos(-2*PI/4+dtheta),  ly+R*Sin(-2*PI/4+dtheta), 0.,     lc};
-Point(5)  = { lx+R*Cos(-3*PI/4+dtheta),  ly+R*Sin(-3*PI/4+dtheta), 0.,     lc};
-Point(6)  = { lx+R*Cos(-4*PI/4+dtheta),  ly+R*Sin(-4*PI/4+dtheta), 0.,     lc};
-Point(7)  = { lx+R*Cos(-5*PI/4+dtheta),  ly+R*Sin(-5*PI/4+dtheta), 0.,     lc};
-Point(8)  = { lx+R*Cos(-6*PI/4+dtheta),  ly+R*Sin(-6*PI/4+dtheta), 0.,     lc};
-
-Point(9)   = { lx+R_in_1*Cos(0*PI+dtheta),  ly+R_in_1*Sin(0*PI+dtheta), 0.,     lc};
-Point(10)  = { lx+R_in_2*Cos(-1*PI/4+dtheta),  ly+R_in_2*Sin(-1*PI/4+dtheta), 0.,     lc};
-Point(11)  = { lx+R_in_1*Cos(-2*PI/4+dtheta),  ly+R_in_1*Sin(-2*PI/4+dtheta), 0.,     lc};
-Point(12)  = { lx+R_in_2*Cos(-3*PI/4+dtheta),  ly+R_in_2*Sin(-3*PI/4+dtheta), 0.,     lc};
-Point(13)  = { lx+R_in_1*Cos(-4*PI/4+dtheta),  ly+R_in_1*Sin(-4*PI/4+dtheta), 0.,     lc};
-Point(14)  = { lx+R_in_2*Cos(-5*PI/4+dtheta),  ly+R_in_2*Sin(-5*PI/4+dtheta), 0.,     lc};
-Point(15)  = { lx+R_in_1*Cos(-6*PI/4+dtheta),  ly+R_in_1*Sin(-6*PI/4+dtheta), 0.,     lc};
-
-Circle(101) = {2, 1, 3};
-Circle(102) = {3, 1, 4};
-Circle(103) = {4, 1, 5};
-Circle(104) = {5, 1, 6};
-Circle(105) = {6, 1, 7};
-Circle(106) = {7, 1, 8};
-
-Line(201) = {9, 10};
-Line(202) = {10,11};
-Line(203) = {11,12};
-Line(204) = {12,13};
-Line(205) = {13,14};
-Line(206) = {14,15};
-
-
-Line(151) = {2, 9};
-Line(152) = {3,10};
-Line(153) = {4,11};
-Line(154) = {5,12};
-Line(155) = {6,13};
-Line(156) = {7,14};
-Line(157) = {8,15};
-
-Line(251) = {9, 1};
-Line(252) = {11,1};
-Line(253) = {13,1};
-Line(254) = {15,1};
-
-Transfinite Line {204, 203, 253, 205, 206, 254, 252, 251, 202, 201, 101, 102, 103, 104, 105, 106} = nT1 Using Progression 1;
-Transfinite Line {157, 156, 155, 154, 153, 152, 151} = nR Using Progression 1;
-
-Line Loop(1) = {151, 201, -152, -101};
-Plane Surface(1) = {1};
-Transfinite Surface {1};
-Recombine Surface {1};
-
-Line Loop(2) = {152, 202, -153, -102};
-Plane Surface(2) = {2};
-Transfinite Surface {2};
-Recombine Surface {2};
-
-Line Loop(3) = {153, 203, -154, -103};
-Plane Surface(3) = {3};
-Transfinite Surface {3};
-Recombine Surface {3};
-
-Line Loop(4) = {154, 204, -155, -104};
-Plane Surface(4) = {4};
-Transfinite Surface {4};
-Recombine Surface {4};
-
-Line Loop(5) = {155, 205, -156, -105};
-Plane Surface(5) = {5};
-Transfinite Surface {5};
-Recombine Surface {5};
-
-Line Loop(6) = {156, 206, -157, -106};
-Plane Surface(6) = {6};
-Transfinite Surface {6};
-Recombine Surface {6};
-
-Line Loop(7) = {251, -252, -202, -201};
-Plane Surface(7) = {7};
-Transfinite Surface {7};
-Recombine Surface {7};
-
-Line Loop(8) = {252, -253, -204, -203};
-Plane Surface(8) = {8};
-Transfinite Surface {8};
-Recombine Surface {8};
-
-Line Loop(9) = {254, -253, 205, 206};
-Plane Surface(9) = {9};
-Transfinite Surface {9};
-Recombine Surface {9};
-
-Extrude {0, 0, LZ}
-{
-  Surface{1,2,3,4,5,6,7,8,9}; Layers{nZ1}; Recombine;
-}
-
-Physical Volume("body") = {1,2,3,4,5,6,7,8,9};
-//+
-Physical Surface("inner edge boundary") = {33, 29, 25, 21, 17, 13};
-//Physical Surface("inner edge boundary") = {33};
diff --git a/katoptron/tests/L_shape_curv_2.geo b/katoptron/tests/L_shape_curv_2.geo
deleted file mode 100644
index 68fa8cda95c0ab68dfa47defe34c3339c2ca3f33..0000000000000000000000000000000000000000
--- a/katoptron/tests/L_shape_curv_2.geo
+++ /dev/null
@@ -1,163 +0,0 @@
-SetFactory("OpenCASCADE");
-
-LX = 10;
-lx = 2;
-LY = 10;
-ly = 2;
-LZ = 2;
-
-nR1 = 5;
-
-R = 1.;
-R2 = 1.;
-R_in_1 = 0.4;
-R_in_2 = 0.5;
-
-nR = 14;
-nT1 = 7;
-
-nZ1 = 5;
-
-nZ2 = 4;
-nl = 5;
-nLX=5;
-nLY=10;
-nR2=5;
-
-PI = Acos (-1.);
-
-dtheta = 0.1*PI;
-
-lc = 1;
-Point(1)  = { lx,    ly, 0.,     lc};
-Point(16)  = { 0,      0, 0,     lc};
-Point(17)  = { lx,     0, 0,     lc};
-Point(18)  = { 2*lx,     0, 0,     lc};
-Point(19)  = { LX,     0, 0,     lc};
-Point(20)  = { LX,    ly, 0,     lc};
-Point(21)  = { 2*lx,  ly, 0,     lc};
-Point(22)  = { lx+R2*Cos(0*PI),  ly+R2*Sin(0*PI), 0,     lc};
-Point(23)  = { lx+R2*Cos(-1*PI/4+dtheta),  ly+R2*Sin(-1*PI/4+dtheta), 0,     lc};
-Point(24)  = { lx+R2*Cos(-2*PI/4+dtheta),  ly+R2*Sin(-2*PI/4+dtheta), 0,     lc};
-Point(25)  = { lx+R2*Cos(-3*PI/4+dtheta),  ly+R2*Sin(-3*PI/4+dtheta), 0,     lc};
-Point(26)  = { lx+R2*Cos(-4*PI/4-dtheta),  ly+R2*Sin(-4*PI/4-dtheta), 0,     lc};
-Point(27)  = { lx+R2*Cos(-5*PI/4-dtheta),  ly+R2*Sin(-5*PI/4-dtheta), 0,     lc};
-Point(28)  = { lx+R2*Cos(-6*PI/4),  ly+R2*Sin(-6*PI/4), 0,     lc};
-Point(29)  = { lx,    2*ly, 0,     lc};
-Point(30)  = { lx,    LY, 0,     lc};
-Point(31)  = { 0,    LY, 0,     lc};
-Point(32)  = { 0,    2*ly, 0,     lc};
-Point(33)  = { 0,    ly, 0,     lc};
-
-
-//+
-Line(255) = {16, 17};
-//+
-Line(256) = {17, 18};
-//+
-Line(257) = {18, 19};
-//+
-Line(258) = {19, 20};
-//+
-Line(259) = {20, 21};
-//+
-Line(260) = {16, 33};
-//+
-Line(261) = {33, 32};
-//+
-Line(262) = {32, 31};
-//+
-Line(263) = {31, 30};
-//+
-Line(264) = {30, 29};
-//+
-Line(265) = {17, 24};
-//+
-Line(266) = {16, 25};
-//+
-Line(267) = {18, 23};
-//+
-Line(268) = {22, 21};
-//+
-Line(269) = {26, 33};
-//+
-Line(270) = {27, 32};
-//+
-Line(271) = {28, 29};
-//+
-Circle(272) = {22, 1, 23};
-//+
-Circle(273) = {23, 1, 24};
-//+
-Circle(274) = {24, 1, 25};
-//+
-Circle(275) = {25, 1, 26};
-//+
-Circle(276) = {26, 1, 27};
-//+
-Circle(277) = {27, 1, 28};
-//+
-Line(278) = {18, 21};
-//+
-Line(279) = {29, 32};
-
-Transfinite Line {263, 279, 277, 258, 278, 272, 273, 256, 255, 274, 260, 275, 276, 261} = nl Using Progression 1;
-Transfinite Line {271, 270, 269, 266, 265, 267, 268} = nR2 Using Progression 1;
-Transfinite Line {257, 259} = nLX Using Progression 1;
-Transfinite Line {264, 262} = nLY Using Progression 1;
-
-
-Line Loop(10) = {277, 271, 279, -270};
-Plane Surface(10) = {10};
-
-Transfinite Surface {10};
-Recombine Surface {10};
-
-Line Loop(11) = {276, 270, -261, -269};
-Plane Surface(11) = {11};
-Transfinite Surface {11};
-Recombine Surface {11};
-
-Line Loop(12) = {266, 275, 269, -260};
-Plane Surface(12) = {12};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Line Loop(13) = {266, -274, -265, -255};
-Plane Surface(13) = {13};
-Transfinite Surface {13};
-Recombine Surface {13};
-
-Line Loop(14) = {265, -273, -267, -256};
-Plane Surface(14) = {14};
-Transfinite Surface {14};
-Recombine Surface {14};
-
-Line Loop(15) = {267, -272, 268, -278};
-Plane Surface(15) = {15};
-Transfinite Surface {15};
-Recombine Surface {15};
-
-Line Loop(16) = {278, -259, -258, -257};
-Plane Surface(16) = {16};
-Transfinite Surface {16};
-Recombine Surface {16};
-
-Line Loop(17) = {279, 262, 263, 264};
-Plane Surface(17) = {17};
-Transfinite Surface {17};
-Recombine Surface {17};
-
-Extrude {0, 0, LZ}
-{
-  Surface{10,11,12,13,14,15,16,17}; Layers{nZ2}; Recombine;
-}
-
-Physical Volume("body") = {1,2,3,4,5,6,7,8};
-//+
-Physical Surface("clamping") = {48};
-//+
-Physical Surface("load") = {44};
-//+
-Physical Surface("outer part boundary") = {18, 23, 28, 31, 39, 35};
-//Physical Surface("outer part boundary") = {18};
diff --git a/katoptron/tests/M1_optic_test.py b/katoptron/tests/M1_optic_test.py
deleted file mode 100644
index 156c5c0a40850e6bd4dfe363fa44ccf2ecbebc7a..0000000000000000000000000000000000000000
--- a/katoptron/tests/M1_optic_test.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron.utilities as u
-import numpy as np
-import os
-from fwk.testing import *
-
-
-def rigid_body_mode(dz, theta_x, theta_y, x, y, x_c, y_c):
-    dz_test = np.zeros(x.shape)
-    dz_test = -np.sin(theta_x)*(y-y_c)+np.cos(theta_x)*dz_test
-    dz_test = -np.sin(theta_y)*(x-x_c)+np.cos(theta_y)*dz_test
-    dz_test = dz_test + dz
-    return dz_test
-
-
-def main():
-    file_dir = os.path.dirname(__file__)
-
-    npzfile = np.load(file_dir+'/mirror_data.npz')
-    x = npzfile['x']
-    y = npzfile['y']
-    z = np.zeros(x.shape)
-    tri = npzfile['tri']
-    dz = npzfile['dz']
-
-    dz_1 = 0
-    dz_2 = (0.5 / 1000)
-    dz_3 = (0.87 / 1000)
-    dz_4 = (-2.1 / 1000)
-
-    theta_x_1 = 0
-    theta_x_2 = 0.0015
-    theta_x_3 = -0.0005
-    theta_x_4 = -0.0002
-
-    theta_y_1 = -0.2
-    theta_y_2 = -0.0005
-    theta_y_3 = 0.0015
-    theta_y_4 = 0.0008
-
-    passed_1 = 0
-    passed_2 = 1
-    passed_3 = 1
-    passed_4 = 0
-
-    dz_test_1 = rigid_body_mode(dz_1, theta_x_1, theta_y_1, x, y, 0.069, 0.04)
-    dz_test_2 = rigid_body_mode(dz_2, theta_x_2, theta_y_2, x, y, 0.069, 0.04)
-    dz_test_3 = rigid_body_mode(dz_3, theta_x_3, theta_y_3, x, y, 0.069, 0.04)
-    dz_test_4 = rigid_body_mode(dz_4, theta_x_4, theta_y_4, x, y, 0.069, 0.04)
-
-    optical_coefficients_1, dz_residual_1 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_1, "m", np.array([0.069, 0.04]))
-
-    optical_coefficients_2, dz_residual_2 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_2, "m", np.array([0.069, 0.04]))
-
-    optical_coefficients_3, dz_residual_3 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_3, "m", np.array([0.069, 0.04]))
-
-    optical_coefficients_4, dz_residual_4 = u.compute_RBM_Curvature_Irreg(
-        x, y, z, tri, dz_test_4, "m", np.array([0.069, 0.04]))
-
-    tests = CTests()
-    measured_dz_1 = optical_coefficients_1[0]
-    tests.add(CTest('piston mode test 1', measured_dz_1, dz_1*1000, 0.05))
-    measured_dz_2 = optical_coefficients_2[0]
-    tests.add(CTest('piston mode test 2', measured_dz_2, dz_2*1000, 0.05))
-    measured_dz_3 = optical_coefficients_3[0]
-    tests.add(CTest('piston mode test 3', measured_dz_3, dz_3*1000, 0.05))
-    measured_dz_4 = optical_coefficients_4[0]
-    tests.add(CTest('piston mode test 4', measured_dz_4, dz_4*1000, 0.05))
-
-    measured_ry_1 = optical_coefficients_1[1]
-    tests.add(CTest('y rotation test 1', measured_ry_1, theta_y_1, 0.05))
-    measured_ry_2 = optical_coefficients_2[1]
-    tests.add(CTest('y rotation test 2', measured_ry_2, theta_y_2, 0.05))
-    measured_ry_3 = optical_coefficients_3[1]
-    tests.add(CTest('y rotation test 3', measured_ry_3, theta_y_3, 0.05))
-    measured_ry_4 = optical_coefficients_4[1]
-    tests.add(CTest('y rotation test 4', measured_ry_4, theta_y_4, 0.05))
-
-    measured_rx_1 = optical_coefficients_1[2]
-    tests.add(CTest('x rotation test 1', measured_rx_1, theta_x_1, 0.05))
-    measured_rx_2 = optical_coefficients_2[2]
-    tests.add(CTest('x rotation test 2', measured_rx_2, theta_x_2, 0.05))
-    measured_rx_3 = optical_coefficients_3[2]
-    tests.add(CTest('x rotation test 3', measured_rx_3, theta_x_3, 0.05))
-    measured_rx_4 = optical_coefficients_4[2]
-    tests.add(CTest('x rotation test 4', measured_rx_4, theta_x_4, 0.05))
-
-    measured_cur_1 = optical_coefficients_1[3]
-    tests.add(CTest('curvature change test 1', measured_cur_1, 0., 1e-10))
-    measured_cur_2 = optical_coefficients_2[3]
-    tests.add(CTest('curvature change test 2', measured_cur_2, 0., 1e-10))
-    measured_cur_3 = optical_coefficients_3[3]
-    tests.add(CTest('curvature change test 3', measured_cur_3, 0., 1e-10))
-    measured_cur_4 = optical_coefficients_4[3]
-    tests.add(CTest('curvature change test 4', measured_cur_4, 0., 1e-10))
-
-    measured_irr_1 = optical_coefficients_1[4]
-    tests.add(CTest('irregularity change test 1', measured_irr_1, 0., 1e-10))
-    measured_irr_2 = optical_coefficients_2[4]
-    tests.add(CTest('irregularity change test 2', measured_irr_2, 0., 1e-10))
-    measured_irr_3 = optical_coefficients_3[4]
-    tests.add(CTest('irregularity change test 3', measured_irr_3, 0., 1e-10))
-    measured_irr_4 = optical_coefficients_4[4]
-    tests.add(CTest('irregularity change test 4', measured_irr_4, 0., 1e-10))
-
-    blurred_1 = u.check_optical_tolerance(optical_coefficients_1, 'mm')
-    blurred_2 = u.check_optical_tolerance(optical_coefficients_2, 'mm')
-    blurred_3 = u.check_optical_tolerance(optical_coefficients_3, 'mm')
-    blurred_4 = u.check_optical_tolerance(optical_coefficients_4, 'mm')
-    tests.add(CTest('checl optical tolerance test 1', blurred_1, passed_1))
-    tests.add(CTest('checl optical tolerance test 2', blurred_2, passed_2))
-    tests.add(CTest('checl optical tolerance test 3', blurred_3, passed_3))
-    tests.add(CTest('checl optical tolerance test 4', blurred_4, passed_4))
-
-    tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/beam.geo b/katoptron/tests/beam.geo
deleted file mode 100644
index 71c4c0a7d917856e1d9791929e06c9347b4e036a..0000000000000000000000000000000000000000
--- a/katoptron/tests/beam.geo
+++ /dev/null
@@ -1,114 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-
-//L = 50.;
-//W = 1.;
-//H = 5.;
-//d = 1.;
-
-//L = 50.;
-//W = 5.;
-//H = 5.;
-H_rigid = 1.;
-//d = 1.;
-
-hW = W/2;
-hH = H/2;
-
-//n_L = 60;
-//n_hW = 3;
-//n_hH = 3;
-
-n_L_rigid = 1;
-n_W_rigid = 1;
-n_H_rigid = 1;
-
-
-lc = 1;
-
-delta_H = hH+d;
-
-Point(101) = { 0,  -hW,    d, lc};
-Point(102) = { 0,   0,    d, lc};
-Point(103) = { 0,   hW,    d, lc};
-Point(104) = { L,   hW,    d, lc};
-Point(105) = { L,   0,    d, lc};
-Point(106) = { L,  -hW,    d, lc};
-
-Point(205) = { 0,   -hW, 0, lc};
-Point(206) = { 0,    hW, 0, lc};
-Point(207) = { L,    hW, 0, lc};
-Point(208) = { L,   -hW, 0, lc};
-
-Line(101) = {101, 102};
-Line(102) = {102, 103};
-Line(103) = {103, 104};
-Line(104) = {104, 105};
-Line(105) = {105, 106};
-Line(106) = {106, 101};
-Line(107) = {105, 102};
-
-Line(205) = {205, 206};
-Line(206) = {206, 207};
-Line(207) = {207, 208};
-Line(208) = {208, 205};
-
-Transfinite Line {101,102,104,105} = n_hW+1 Using Progression 1;
-Transfinite Line {103,106,107} = n_L+1 Using Progression 1;
-
-Transfinite Line {205,207} = n_W_rigid+1 Using Progression 1;
-Transfinite Line {206,208} = n_L_rigid+1 Using Progression 1;
-
-Line Loop(101) = {101,-107,105,106};
-Plane Surface(101) = {101};
-Transfinite Surface {101};
-Recombine Surface {101};
-
-Line Loop(102) = {102,103,104,107};
-Plane Surface(102) = {102};
-Transfinite Surface {102};
-Recombine Surface {102};
-
-Line Loop(202) = {-208,-207,-206,-205};
-Plane Surface(202) = {202};
-Transfinite Surface {202};
-Recombine Surface {202};
-
-Extrude {0, 0, hH}
-{
-  Surface{101,102}; Layers{n_hH}; Recombine;
-}
-
-Extrude {0, 0, hH}
-{
-  Surface{230,252}; Layers{n_hH}; Recombine;
-}
-
-Extrude {0, 0, -H_rigid}
-{
-  Surface{202}; Layers{n_H_rigid}; Recombine;
-}
-
-
-
-Physical Volume("Rigid body") = {5};
-Physical Surface("Rigid surface") = {202};
-Physical Surface("Rigid clamped surface") = {309};
-Physical Line("Rigid surface boundary") = {205, 206, 207, 208};
-
-Physical Volume("Beam") = {1,2,3,4};
-Physical Surface("Clamped end") = {217,239,261,283,317};
-Physical Surface("Loaded surface") = {274,296};
-Physical Surface("Beam contact zone") = {101,102};
-Physical Surface("Free end") = {269,247,225,291};
-Physical Line("Beam contact boundary") = {104,105,106,101,102,103};
-Physical Line("Beam contact Dirichlet") = {101,102};
-
-Physical Line("Center of cross section") = {211};
-
-Physical Line("Center of contact surface") = {107};
-
-Mesh.Partitioner = 2;
-Mesh.MetisAlgorithm = 2;
-Mesh.MshFilePartitioned = 0;
diff --git a/katoptron/tests/beam.py b/katoptron/tests/beam.py
deleted file mode 100644
index e2086c7accdb738539b2bcc55e2f97cfd059ddf1..0000000000000000000000000000000000000000
--- a/katoptron/tests/beam.py
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-#import matplotlib2tikz
-# import katoptron.viewer as katv # Error occurs after that
-
-
-def analytical(E, nu, L, W, H, d, p, x):
-
-    EI = ((E * W * H**3) / 12.)
-    q = p * W
-    q_1 = 24*EI*d/L**4
-    q_2 = 72*EI*d/L**4
-    a = (72*EI*d/q)**(0.25)
-
-    print(a)
-
-    print(E)
-    print(nu)
-    print(L)
-    print(W)
-    print(H)
-    print(d)
-    print(p)
-
-    if q < q_1:
-        case_id = 1
-        sol = -((q / (24.*EI)))*(x**4-4.*L*x**3+4.*L**2*x**2)
-    if q >= q_1:
-        case_id = 2
-        sol = -((q / (24.*EI)))*(x**4-2.*L*x**3+L**2*x**2) + \
-            2.*d*x**3/(L**3)-3.*d*x**2/(L**2)
-    if q >= q_2:
-        case_id = 3
-        sol = -((q / (24.*EI))) * \
-            (x**4-((8. / 3.))*a*x**3+2.*a**2*x**2)
-        for i in range(0, len(x)):
-            if x[i] >= a:
-                sol[i] = -d
-
-    print("q")
-    print(q)
-    print(q_1)
-    print(q_2)
-
-    return case_id, sol
-
-
-def analytical_ensemble(E, nu, L, W, H, d, p, x, ensemble_size):
-
-    import numpy as np
-
-    case_id = np.empty([ensemble_size, 1])
-    sol = np.empty([len(x), ensemble_size])
-
-    for i in range(0, ensemble_size):
-        case_id[i], sol[:, i] = analytical(E[i], nu[i], L, W, H, d, p[i], x)
-
-    return case_id, sol
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-    #import matplotlib.pyplot as plt
-
-    DOFperNode = 3
-
-    display = True
-
-    # Mesh
-
-    geo_name = 'beam.geo'
-    mesh_name = 'beam.msh'
-    partitioned_mesh_name = 'beam_k.msh'
-
-    par = {}
-    par['L'] = 50.
-    par['W'] = 5.
-    par['H'] = 5.
-    par['d'] = 1.
-    par['n_L'] = 20
-    par['n_hW'] = 2
-    par['n_hH'] = 2
-
-    ensemble_size = 8
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    pars = {'L': par['L'], 'W': par['W'], 'H': par['H'], 'd': par['d'],
-            'n_L': par['n_L'], 'n_hW': par['n_hW'], 'n_hH': par['n_hH']}
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size, pars)
-
-    for n1 in msh.nodes:
-        n1.row = n1.no-1
-
-    # Problem
-
-    #msh = gmsh.MeshLoader(mesh_name,work_dir).execute()
-
-    pbl = m.Problem(msh, comm)
-
-    E = 21000 * np.ones(ensemble_size)
-    nu = 0.29 * np.ones(ensemble_size)
-    k = 0
-    d = 0
-
-    # for i in range(0,ensemble_size):
-    #    E[i] = 21000+i*5000
-
-    m.Medium(pbl, "Beam", "Mat 1", E, nu, k, d)
-    m.Medium(pbl, "Rigid body", "Mat 1", E, nu, k, d)
-
-    dx = np.zeros(ensemble_size)
-    dy = np.zeros(ensemble_size)
-    dy2 = np.linspace(0, -2., ensemble_size)
-    dz = 0*np.linspace(0, -2., ensemble_size)
-    dz2 = np.zeros(ensemble_size)
-    dT = np.zeros(ensemble_size)
-    m.Dirichlet(pbl, "Rigid clamped surface",
-                "Clamped 1", 1, dx, 1, dy, 1, dz, 0, dT)
-    m.Dirichlet(pbl, "Clamped end", "Clamped 1", 1, dx, 1, dy, 1, dz2, 0, dT)
-    m.Dirichlet(pbl, "Free end", "Clamped 1", 1, 0.,
-                0, 0., 0, 0., 0, 0., ensemble_size)
-
-    #p = 0.82* np.ones(ensemble_size)
-
-    #p = np.linspace(0.1, 0.835, num=ensemble_size)
-    # np.linspace(1.2, 0., num=ensemble_size) # 3.6 * np.ones(ensemble_size) #np.linspace(1.5, 2., num=ensemble_size)
-    p = 0.9 * np.ones(ensemble_size)
-    for i in range(0, ensemble_size):
-        p[i] = 1.7+(7-i)*0.025
-
-    p[0] = 2.5
-
-    zero = np.zeros(ensemble_size)
-
-    m.Neumann(pbl, "Loaded surface", "Load 1", 0, zero,
-              0, zero, 1, -p, 0, zero, ensemble_size)
-
-    norm1 = tbox.Vector3d(0, 0, -1)
-    norm2 = tbox.Vector3d(0, 0, 1)
-    dg = 0*np.linspace(0., 1., num=ensemble_size)
-
-    dg[0] = 0.
-
-    a = 49.5
-    initiallyClosedNodesList = np.array([], dtype=np.float)
-    #tag_name = "Center of cross section"
-    for el in msh.ntags["Beam contact zone"].elems:
-        for n1 in el.nodes:
-            node_id = n1.no-1
-            if msh.nodes[node_id].pos[0] >= a:
-                initiallyClosedNodesList = np.append(
-                    initiallyClosedNodesList, node_id)
-
-    cont1 = m.Contact(pbl, "Beam contact zone", "contact", norm1, dg)
-    #cont1.setSlaveBoundary(work_dir+"/"+partitioned_mesh_name, "Beam contact boundary")
-    #cont1.setMasterBoundary(work_dir+"/"+partitioned_mesh_name, "Rigid surface boundary")
-    cont1.setInitialyOpen()
-    cont1.setInitiallyClosedNodes(initiallyClosedNodesList)
-    cont1.setDualShapeFunctions()
-    cont1.setSlaveDirichlet(
-        work_dir+"/"+partitioned_mesh_name, "Beam contact Dirichlet")
-    cont1.setSignoriniContact()
-    cont1.setMaster(pbl, "Rigid surface", norm2)
-
-    # Solver
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 100000
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList["MueLu xml file name"] = file_dir + '/multigrid_2_lvls_3_1.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 4
-    solverList['Write txt files'] = True
-    slv = m.IterativeSolver(pbl, solverList,
-                            DOFperNode, ensemble_size)
-
-    nThreads = u.Initialize_Kokkos()
-
-    slv.start()
-
-    active_set_iteration = slv.active_set_iteration
-
-    u.Finalize_Kokkos()
-
-    if rank == 0:
-        import fwk.testing as tst
-        tests = tst.CTests()
-        tests.add(tst.CTest('Number of active set iterations',
-                            active_set_iteration, 3))
-        tests.run()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/tests/direct_solver.xml b/katoptron/tests/direct_solver.xml
deleted file mode 100644
index 7375e732f5be4fc58cb238d4c347b7563bad2218..0000000000000000000000000000000000000000
--- a/katoptron/tests/direct_solver.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 4 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 4 }"/>
-    </ParameterList>
-
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-    </ParameterList>
-
-  
-    <!-- BLOCK SMOOTHERS -->
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="1"/>
-        <!--<Parameter name="relaxation: damping factor" type="double" value="0.9"/>-->
-      </ParameterList>
-    </ParameterList>
-
-
-    <!-- block smoother for block A_{00} -->
-
-    <ParameterList name="mySmooFact2">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <Parameter name="overlap" type="int" value="0"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="1"/>
-        <!--<Parameter name="relaxation: damping factor" type="double" value="0.9"/>-->
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use BGS -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="BlockedGaussSeidelSmoother"/>
-      <Parameter name="Sweeps" type="int" value="1"/>
-      <!--<Parameter name="Damping factor" type="double" value="1.0"/> -->
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact2"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-    <Parameter name="max levels" type="int" value="1"/>
-    <Parameter name="verbosity" type="string" value="Extreme"/>
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <!--<Parameter name="CoarseSolver"      type="string"   value="myBlockSmoother"/>-->
-      <Parameter name="A"                 type="string"   value="NoFactory"/>
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/tests/mirror_data.npz b/katoptron/tests/mirror_data.npz
deleted file mode 100644
index 73e77d11b405902a973af9e39464026fb9c34c9d..0000000000000000000000000000000000000000
Binary files a/katoptron/tests/mirror_data.npz and /dev/null differ
diff --git a/katoptron/tests/multigrid_2_lvls_3_1.xml b/katoptron/tests/multigrid_2_lvls_3_1.xml
deleted file mode 100644
index 2d82c0a12dc7d053b0603608908f7c57dcca3664..0000000000000000000000000000000000000000
--- a/katoptron/tests/multigrid_2_lvls_3_1.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-
-  <!-- Factory collection -->
-  <ParameterList name="Factories">
-
-    <!-- Note that ParameterLists must be defined prior to being used -->
-
-    <!-- sub block factories -->
-
-    
-    <!-- BLOCK 1 (for submatrix A_{00}) Navier Stokes 4 DOFs per node -->
-    <ParameterList name="mySubBlockAFactory1">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="0"/>
-      <Parameter name="block col"                 type="int"     value="0"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 3 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 3 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 4 DOFs per node on the coarse levels -->
-    <ParameterList name="myCoarseMap1">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myAggFact1">
-      <Parameter name="factory" type="string" value="UncoupledAggregationFactory"/>
-      <Parameter name="aggregation: min agg size" type="int" value="5"/>
-      <Parameter name="aggregation: max selected neighbors" type="int" value="1"/>
-    </ParameterList>
-    
-    <ParameterList name="myTentativePFact1">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <ParameterList name="myRFact1">
-      <Parameter name="factory" type="string" value="TransPFactory"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- We have to use Nullspace1 here. If "Nullspace1" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors -->
-    <ParameterList name="myNspFact1">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace1"/>
-      <Parameter name="Nullspace1" type="string" value="myTentativePFact1"/>
-    </ParameterList>
-    
-    <!-- BLOCK 2 (for submatrix A_{22}) MAXWELL PART-->
-    <ParameterList name="mySubBlockAFactory2">
-      <Parameter name="factory" type="string" value="SubBlockAFactory"/>
-      <Parameter name="block row"                 type="int"     value="1"/>
-      <Parameter name="block col"                 type="int"     value="1"/>
-      <Parameter name="Range map: Striding info"  type="string"  value="{ 1 }"/>
-      <Parameter name="Domain map: Striding info" type="string"  value="{ 1 }"/>
-    </ParameterList>
-
-    <!-- tell the tenative prolongator that we have 1 DOF per node on the coarse levels -->
-    <!-- We use the factory "CoarseMapFactory" which always creates a standard coarse
-         level map starting with GIDs at 0. This is ok as we use Thyra like numbering
-         for the block operators. To obtain unique GIDs one would use the
-         BlockedCoarseMapFactory (see below) -->
-    <ParameterList name="myCoarseMap2">
-      <Parameter name="factory" type="string" value="CoarseMapFactory"/>
-      <Parameter name="Striding info" type="string" value="{ 3 }"/>
-      <Parameter name="Strided block id" type="int" value="-1"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceMappingFact">
-      <Parameter name="factory"                             type="string" value="InterfaceMappingTransferFactory"/>
-    </ParameterList>
-
-    <ParameterList name="myInterfaceAggs2">
-      <Parameter name="factory" type="string" value="InterfaceAggregationFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/> <!-- use aggregates from velocity block! -->
-      <Parameter name="number of DOFs per dual node" type="int" value="1"/>
-      <Parameter name="DualNodeID2PrimalNodeID" type="string" value="myInterfaceMappingFact" />
-    </ParameterList>
-    
-    <ParameterList name="myInterfaceMappingFactDeps" >
-      <Parameter name="dependency for" type="string" value="myInterfaceMappingFact" />
-      <Parameter name="CoarseDualNodeID2PrimalNodeID" type="string" value="myInterfaceAggs2" />
-    </ParameterList>
-
-    <ParameterList name="myTentativePFact2">
-      <Parameter name="factory" type="string" value="TentativePFactory"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- We have to use Nullspace2 here. If "Nullspace2" is not set the 
-         Factory creates the default null space containing of constant 
-         vectors (here only one constant vector) -->
-    <ParameterList name="myNspFact2">
-      <Parameter name="factory" type="string" value="NullspaceFactory"/>
-      <Parameter name="Fine level nullspace" type="string" value="Nullspace2"/>
-      <Parameter name="Nullspace2" type="string" value="myTentativePFact2"/>
-    </ParameterList>
-
-    <!-- FACTORY MANAGERS -->
-
-    <!-- Multigrid setup for velocity block (A_{00}) -->
-    <ParameterList name="myFirstGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-      <Parameter name="P" type="string" value="myTentativePFact1"/>
-      <Parameter name="R" type="string" value="myRFact1"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>
-
-    <!-- Multigrid setup for pressure block (A_{11}) -->
-    <ParameterList name="mySecondGroup">
-      <Parameter name="group" type="string" value="FactoryManager"/>
-      <Parameter name="A" type="string" value="mySubBlockAFactory2"/>
-      <Parameter name="P" type="string" value="myTentativePFact2"/>
-      <Parameter name="Aggregates" type="string" value="myInterfaceAggs2"/>
-      <Parameter name="Nullspace" type="string" value="myNspFact2"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap2"/>
-    </ParameterList>
-
-    <!-- BLOCK TRANSFER operators -->
-
-    <!-- define block prolongation operator using above blocks -->
-    <ParameterList name="myBlockedPFact">
-      <Parameter name="factory" type="string" value="BlockedPFactory"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-         <Parameter name="group" type="string" value="myFirstGroup"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="group" type="string" value="mySecondGroup"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- define block restriction operator using above blocks -->
-    <!-- The block restriction operator is usually always of type
-         GenericRFactory since we want to be able to combine, e.g.,
-         SmoothedAggregation for block A_{00} with e.g. tentative
-         prolongation for block A_{11} (or any other kind of transfer
-         strategy for the subblocks -->
-    <ParameterList name="myBlockedRFact">
-      <Parameter name="factory" type="string" value="GenericRFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-    </ParameterList>
-
-    <!--<ParameterList name="myTransferCoordinatesFact">
-      <Parameter name="factory"                             type="string" value="CoordinatesTransferFactory"/>
-      <Parameter name="Aggregates" type="string" value="myAggFact1"/>
-      <Parameter name="CoarseMap" type="string" value="myCoarseMap1"/>
-    </ParameterList>-->
-
-    <ParameterList name="myBlockedRAPFact">
-      <Parameter name="factory" type="string" value="BlockedRAPFactory"/>
-      <Parameter name="P" type="string" value="myBlockedPFact"/>
-      <Parameter name="R" type="string" value="myBlockedRFact"/>
-      <ParameterList name="TransferFactories">
-        <!--<Parameter name="For Coordinates"                   type="string" value="myTransferCoordinatesFact"/>-->
-        <Parameter name="DoTransferSpecialMappingForAggregates"                   type="string" value="myInterfaceMappingFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- REBALANCING -->
-    
-    
-    <!-- BLOCK SMOOTHERS -->
-
-
-    <ParameterList name="mySmooFact1">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="1"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Build Schur Complement factory (for being used in SIMPLE type block smoother)-->
-    <ParameterList name="mySchurCompFact">
-      <Parameter name="factory" type="string" value="SchurComplementFactory"/>
-      <Parameter name="omega" type="double" value="1.0"/>
-      <Parameter name="lumping" type="bool" value="true"/>
-    </ParameterList>
-
-    <!-- block smoother for block A_{11} respective the Schur complement operator -->
-    <ParameterList name="mySchurSmooFact">
-      <Parameter name="factory" type="string" value="TrilinosSmoother"/>
-      <Parameter name="type" type="string" value="RELAXATION"/>
-      <ParameterList name="ParameterList">
-        <Parameter name="relaxation: type" type="string" value="Symmetric Gauss-Seidel"/>
-        <Parameter name="relaxation: sweeps" type="int"    value="1"/>
-        <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-      </ParameterList>
-    </ParameterList>
-
-    <!-- Use SIMPLE: -->
-    <!-- User has to define two blocks with each containing a smoother for
-         the corresponding sub-block matrix (see above) -->
-    <ParameterList name="myBlockSmoother">
-      <Parameter name="factory" type="string" value="SimpleSmoother"/>
-      <Parameter name="Sweeps" type="int" value="2"/>
-      <Parameter name="Damping factor" type="double" value="0.9"/>
-      <Parameter name="UseSIMPLEC" type="bool" value="false"/>
-      <!-- factory manager for block 1 -->
-      <ParameterList name="block1">
-        <Parameter name="A" type="string" value="mySubBlockAFactory1"/>
-        <Parameter name="Smoother" type="string" value="mySmooFact1"/>
-      </ParameterList>
-      <!-- factory manager for block 2 -->
-      <ParameterList name="block2">
-        <Parameter name="A" type="string" value="mySchurCompFact"/>
-        <Parameter name="Smoother" type="string" value="mySchurSmooFact"/>
-      </ParameterList>
-    </ParameterList>
-
-    <ParameterList name="myBlockDirectSolver">
-      <Parameter name="factory" type="string" value="BlockedDirectSolver"/>
-    </ParameterList>
-
-  </ParameterList>
-  <!-- end Factories -->
-
-  <!-- Definition of the multigrid preconditioner -->
-  <ParameterList name="Hierarchy">
-
-    <Parameter name="max levels"          type="int"      value="2"/>
-    <Parameter name="coarse: max size"    type="int"      value="2500"/>
-    <Parameter name="verbosity"           type="string"   value="High"/>
-    <Parameter name="aggregation: export visualization data"           type="bool"   value="true"/>
-
-    <ParameterList name="AllLevel">
-      <Parameter name="startLevel"        type="int"      value="0"/>
-      <Parameter name="Smoother"          type="string"   value="myBlockSmoother"/>
-      <Parameter name="CoarseSolver"      type="string"   value="myBlockDirectSolver"/>
-      <Parameter name="P"                 type="string"   value="myBlockedPFact"/>
-      <Parameter name="R"                 type="string"   value="myBlockedRFact"/>
-      <Parameter name="A"                 type="string"   value="myBlockedRAPFact"/>
-      <!--<Parameter name="Coordinates"       type="string"   value="myRebBlockedPFact"/>-->
-    </ParameterList>
-
-  </ParameterList>
-
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/tests/plate.py b/katoptron/tests/plate.py
deleted file mode 100644
index 8e5c971ca8f86c1981809a02371f99762e5facd6..0000000000000000000000000000000000000000
--- a/katoptron/tests/plate.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-from katoptron.CMAME import model
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-
-from fwk.wutils import parseargs
-
-from PyTrilinos import Teuchos
-
-import katoptron.utilities as u
-
-from katoptron.readers import read_Belos
-from fwk.testing import *
-
-
-def main():
-    """
-    This loads the mesh and define the case ids and ensemble sizes
-    """
-    comm, rank, size = m.utilities.import_MPI()
-
-    if size == 1:
-        args = parseargs()
-
-        file_dir = os.path.dirname(__file__)
-        work_dir = os.getcwd()
-
-        # Units in the meshes are in mm
-        msh = u.fuse_meshes('plate_1.geo', 'plate_1_tmp', 'plate_2.geo',
-                            'plate_2_tmp', 'plate_fused',
-                            file_dir + '/../CMAME/mesh', work_dir, comm, rank,
-                            size)
-
-        np.random.seed(42)
-        N = 1
-        num_random_variables = 20
-        randomVariable = np.zeros((N, num_random_variables))
-
-        p = model.get_parameters(0, 0)
-        p['Write txt files'] = True
-        p['MueLu xml template file name'] = '/../preconditioners/SIMPLE_gs_direct_lvl.xml.in'
-
-        ensemble_size = 1
-
-        pm = model.plate_model(ensemble_size, randomVariable, msh, comm,
-                               file_dir, work_dir, p)
-
-        nThreads = u.Initialize_Kokkos()
-        pm.run()
-        u.Finalize_Kokkos()
-
-        iter_indices, residuals = read_Belos(work_dir + '/belos_out.txt', 1)
-
-        tests = CTests()
-        nIterations = iter_indices[-1]
-        tests.add(CTest('Has converged', nIterations, 97, 1e-2))
-        tests.run()
-
-
-if __name__ == "__main__":
-    main()
\ No newline at end of file
diff --git a/katoptron/thesis/test_1/1_cube.geo b/katoptron/thesis/test_1/1_cube.geo
deleted file mode 100644
index 99d074747f84e1c2f9d51c0f2cba9f92e4798552..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_1/1_cube.geo
+++ /dev/null
@@ -1,39 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-nC1 = 4;
-
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Transfinite Line {1,2,3,4} = nC1+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nC1}; Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Point("Measure point 1") = {4};
-Physical Point("Measure point 2") = {1};
diff --git a/katoptron/thesis/test_1/1_cube.py b/katoptron/thesis/test_1/1_cube.py
deleted file mode 100644
index 3610603270972ad26e659af2046d91fae477466b..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_1/1_cube.py
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-
-
-def tar_results(directory, filename, rank):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        for file in glob.glob('*'):
-            if file.endswith(".tar.gz"):
-                print(file + ' is not included')
-            else:
-                tf.add(file)
-        tf.close()
-
-
-def model(msh,
-          E,
-          p,
-          ensemble_size,
-          case_name,
-          zero_initial_guess=True,
-          prec=False):
-    comm, rank, size = m.utilities.import_MPI()
-
-    pbl = m.Problem(msh, comm)
-
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 0.,
-                ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 100
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    if prec:
-        mueluParams = Teuchos.ParameterList()
-        mueluParams['number of equations'] = 3
-        mueluParams['max levels'] = 1
-        mueluParams['coarse: type'] = "RELAXATION"
-
-        mueluParamsSub2 = Teuchos.ParameterList()
-        mueluParamsSub2['relaxation: type'] = "Jacobi"
-        mueluParamsSub2['relaxation: sweeps'] = 1
-        mueluParamsSub2['relaxation: damping factor'] = 1.
-
-        mueluParams['verbosity'] = "low"
-
-        mueluParams['coarse: params'] = mueluParamsSub2
-
-        solverList['mueluParams'] = mueluParams
-        solverList['Use preconditioner'] = True
-    else:
-        solverList['Use preconditioner'] = False
-
-    if not zero_initial_guess:
-        file_dir = os.path.dirname(__file__)
-        solverList['Initial guess'] = file_dir + '/initial_guess.txt'
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write txt files'] = True
-    solverList['Write matrix and vectors'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    if not os.path.exists(case_name):
-        os.makedirs(case_name)
-    os.chdir(case_name)
-
-    if rank == 0:
-        np.savetxt('E.txt', E)
-        np.savetxt('p.txt', p)
-
-    slv.start()
-
-    os.chdir('..')
-
-
-def main():
-    comm, rank, size = u.import_MPI()
-
-    useER = m.UseEnsembleReduction()
-
-    geo_name = '1_cube.geo'
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size)
-
-    E_mean = 1.
-    E_min = 0.75
-    E_max = 1.25
-
-    E_min_2 = 0.95
-    E_max_2 = 1.05
-
-    E_min_3 = 1.2
-    E_max_3 = 1.3
-
-    p_mean = 0.1
-    p_min = 0.075
-    p_max = 0.125
-
-    ensemble_size = 1
-    E = E_mean * np.ones(ensemble_size)
-    p = p_mean * np.ones(ensemble_size)
-    directory_case_id = 'mean'
-
-    nThreads = u.Initialize_Kokkos()
-    model(msh, E, p, ensemble_size, directory_case_id)
-
-    ensemble_sizes = [8, 16, 32]
-
-    for ensemble_size in ensemble_sizes:
-        E = np.linspace(E_min, E_max, ensemble_size)
-        p = p_mean * np.ones(ensemble_size)
-        directory_case_id = 'test_1_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id)
-
-        E = np.linspace(E_min_2, E_max_2, ensemble_size)
-        p = p_mean * np.ones(ensemble_size)
-        directory_case_id = 'test_6_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id)
-
-        E = np.linspace(E_min_3, E_max_3, ensemble_size)
-        p = p_mean * np.ones(ensemble_size)
-        directory_case_id = 'test_7_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id)
-
-        E = E_mean * np.ones(ensemble_size)
-        p = np.linspace(p_min, p_max, ensemble_size)
-        directory_case_id = 'test_2_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id)
-
-        E = np.linspace(E_min, E_max, ensemble_size)
-        p = np.linspace(p_min, p_max, ensemble_size)
-        directory_case_id = 'test_3_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id)
-
-        E = np.linspace(E_min, E_max, ensemble_size)
-        p = np.linspace(p_min, p_max, ensemble_size)
-        directory_case_id = 'test_4_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id, True, True)
-
-        E = np.linspace(E_min, E_max, ensemble_size)
-        p = np.linspace(p_min, p_max, ensemble_size)
-        directory_case_id = 'test_5_s_' + str(ensemble_size)
-
-        model(msh, E, p, ensemble_size, directory_case_id, False, False)
-
-    u.Finalize_Kokkos()
-
-    if useER:
-        tar_results(work_dir, 'all_results_ER', rank)
-    else:
-        tar_results(work_dir, 'all_results_NER', rank)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_1/blake.slurm.sh b/katoptron/thesis/test_1/blake.slurm.sh
deleted file mode 100644
index 43508ca54f77ed629f695b3d1d73e7bba32272a4..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_1/blake.slurm.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_1
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_1.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_1/1_cube.py
diff --git a/katoptron/thesis/test_1/initial_guess.txt b/katoptron/thesis/test_1/initial_guess.txt
deleted file mode 100644
index a3d5bf4d0b180139af309a1953c6f1ffe53b934f..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_1/initial_guess.txt
+++ /dev/null
@@ -1,375 +0,0 @@
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-1.03389366873617355e-01
-1.03389366873706354e-01
-9.88909850986351091e-01
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
-0.00000000000000000e+00
--1.03389366873873748e-01
-1.03389366873748376e-01
-9.88909850986497641e-01
--1.03389366873874095e-01
--1.03389366873748056e-01
-9.88909850986497196e-01
-1.03389366873616564e-01
--1.03389366873706368e-01
-9.88909850986350536e-01
--5.27296546408627456e-02
-1.03300075007310380e-01
-9.86005241933825549e-01
--1.72648546726014513e-13
-1.03165915332760733e-01
-9.83998313600647156e-01
-5.27296546407599667e-02
-1.03300075007326381e-01
-9.86005241933630372e-01
--5.27296546408623015e-02
--1.03300075007309727e-01
-9.86005241933826104e-01
--1.73766147860502091e-13
--1.03165915332760275e-01
-9.83998313600647267e-01
-5.27296546407599598e-02
--1.03300075007326450e-01
-9.86005241933629373e-01
--1.03300075007559222e-01
-5.27296546408203490e-02
-9.86005241933823440e-01
--1.03165915333046532e-01
-3.03730987743003057e-16
-9.83998313600758512e-01
--1.03300075007560152e-01
--5.27296546408204739e-02
-9.86005241933823551e-01
-1.03300075007261086e-01
-5.27296546408151864e-02
-9.86005241933572529e-01
-1.03165915332737959e-01
--1.50785363550943402e-16
-9.83998313600441432e-01
-1.03300075007260045e-01
--5.27296546408148326e-02
-9.86005241933572085e-01
--5.26878113525478114e-02
-5.26878113526379893e-02
-9.83361152577813646e-01
--5.26718377856561157e-02
-4.59250629122190593e-16
-9.81523476744442736e-01
--5.26878113525460490e-02
--5.26878113526386971e-02
-9.83361152577813757e-01
--5.79473484698294784e-13
-5.26718377860720885e-02
-9.81523476743921708e-01
--9.13420568557926768e-13
-1.73058135287993529e-16
-9.79652571577124376e-01
--5.81996096482450406e-13
--5.26718377860717554e-02
-9.81523476743922374e-01
-5.26878113528938263e-02
-5.26878113529958003e-02
-9.83361152577015840e-01
-5.26718377863194739e-02
--7.11399507950741881e-17
-9.81523476743163203e-01
-5.26878113528952974e-02
--5.26878113529944958e-02
-9.83361152577014952e-01
--8.25498591021375377e-02
-8.25498591021505412e-02
-2.71696757483461837e-01
--9.70753326394316052e-02
-9.70753326393827692e-02
-5.02410726903524729e-01
--1.01586615502965605e-01
-1.01586615502849836e-01
-7.41394325273555310e-01
-1.01586615502623739e-01
-1.01586615502625460e-01
-7.41394325273904697e-01
-9.70753326393432869e-02
-9.70753326392596871e-02
-5.02410726904001459e-01
-8.25498591023276773e-02
-8.25498591022339884e-02
-2.71696757483956830e-01
--8.25498591021385231e-02
--8.25498591021505551e-02
-2.71696757483462170e-01
--9.70753326394329930e-02
--9.70753326393827276e-02
-5.02410726903525173e-01
--1.01586615502966812e-01
--1.01586615502849628e-01
-7.41394325273555421e-01
-1.01586615502622532e-01
--1.01586615502625405e-01
-7.41394325273903809e-01
-9.70753326393420934e-02
--9.70753326392593680e-02
-5.02410726904001237e-01
-8.25498591023268447e-02
--8.25498591022338357e-02
-2.71696757483956663e-01
-3.30748424499299962e-02
-8.29264144897700478e-02
-2.48089635635204142e-01
-4.97277796449807838e-02
-9.85915368840958040e-02
-4.91357562219044863e-01
-5.15867656326637405e-02
-1.01848850896934545e-01
-7.36712754118903246e-01
-3.39915264163419894e-13
-8.41148355803972708e-02
-2.46660235067398870e-01
-3.44793504862767467e-13
-9.92705012130368630e-02
-4.85740960262001420e-01
--9.26442092970955842e-14
-1.02210065241999007e-01
-7.33706284948368648e-01
--3.30748424502770866e-02
-8.29264144900013628e-02
-2.48089635634937633e-01
--4.97277796452340604e-02
-9.85915368846882190e-02
-4.91357562219005006e-01
--5.15867656324931825e-02
-1.01848850897280407e-01
-7.36712754118272084e-01
--8.29264144898249206e-02
-3.30748424500673238e-02
-2.48089635634770489e-01
--8.41148355803735398e-02
-1.12038455825991370e-15
-2.46660235067105327e-01
--8.29264144898272382e-02
--3.30748424500678234e-02
-2.48089635634771016e-01
--9.85915368848912788e-02
-4.97277796452564799e-02
-4.91357562219088828e-01
--9.92705012138074966e-02
-1.77847510590181174e-15
-4.85740960262223742e-01
--9.85915368848947760e-02
--4.97277796452573403e-02
-4.91357562219089217e-01
--1.01848850897806736e-01
-5.15867656327469587e-02
-7.36712754118169610e-01
--1.02210065242970882e-01
-1.60844849378749812e-15
-7.33706284947798659e-01
--1.01848850897809526e-01
--5.15867656327476248e-02
-7.36712754118169388e-01
-1.01848850897163098e-01
-5.15867656327591156e-02
-7.36712754118855950e-01
-1.02210065242353931e-01
--1.26226634544528276e-15
-7.33706284948549947e-01
-1.01848850897160420e-01
--5.15867656327581858e-02
-7.36712754118856061e-01
-9.85915368847834067e-02
-4.97277796453790832e-02
-4.91357562219043253e-01
-9.92705012138538484e-02
--1.48995477504196741e-15
-4.85740960262005916e-01
-9.85915368847802009e-02
--4.97277796453780771e-02
-4.91357562219042754e-01
-8.29264144904164197e-02
-3.30748424502912627e-02
-2.48089635635469125e-01
-8.41148355811928566e-02
--8.52956823945958511e-16
-2.46660235067932360e-01
-8.29264144904144351e-02
--3.30748424502907284e-02
-2.48089635635468736e-01
-3.30748424499322097e-02
--8.29264144897712829e-02
-2.48089635635204614e-01
-4.97277796449838785e-02
--9.85915368840976081e-02
-4.91357562219044808e-01
-5.15867656326660096e-02
--1.01848850896935739e-01
-7.36712754118903246e-01
-3.36557671758980498e-13
--8.41148355803970488e-02
-2.46660235067398648e-01
-3.39868792045555024e-13
--9.92705012130363079e-02
-4.85740960262001420e-01
--9.64588056534605612e-14
--1.02210065241998813e-01
-7.33706284948368426e-01
--3.30748424502747482e-02
--8.29264144899998085e-02
-2.48089635634936967e-01
--4.97277796452307505e-02
--9.85915368846858459e-02
-4.91357562219005006e-01
--5.15867656324907956e-02
--1.01848850897278298e-01
-7.36712754118272195e-01
-3.30537858775551557e-02
-3.30537858791016825e-02
-2.24168574765167633e-01
-3.33577827719228476e-02
--2.71054088782021333e-16
-2.22720568574055949e-01
-3.30537858775624624e-02
--3.30537858790991221e-02
-2.24168574765168827e-01
-4.96925794685787528e-02
-4.96925794703856893e-02
-4.80358805864844085e-01
-5.01102262788138339e-02
--1.06469913134349292e-15
-4.74827900883885989e-01
-4.96925794685891473e-02
--4.96925794703812901e-02
-4.80358805864843086e-01
-5.16178568703299506e-02
-5.16178568710437061e-02
-7.32425308234624817e-01
-5.17653261816935217e-02
--1.30296575160951638e-15
-7.29481147248424056e-01
-5.16178568703381455e-02
--5.16178568710397509e-02
-7.32425308234624151e-01
-1.01269713738389127e-12
-3.33577827731780935e-02
-2.22720568573127664e-01
-7.44830245625321753e-13
--3.98111993231309839e-17
-2.21326420342750990e-01
-1.00285227461946099e-12
--3.33577827731781559e-02
-2.22720568573127276e-01
-8.90476060506571976e-13
-5.01102262798669984e-02
-4.74827900884014553e-01
-1.47109838361844396e-13
--3.26513381238924380e-16
-4.69212258129147353e-01
-8.76708436884517458e-13
--5.01102262798666584e-02
-4.74827900884014553e-01
--8.94808599265584483e-13
-5.17653261812182283e-02
-7.29481147247702411e-01
--2.06767959228923246e-12
-1.40470294138712692e-17
-7.26509893878956814e-01
--9.04715419262577115e-13
--5.17653261812177634e-02
-7.29481147247702966e-01
--3.30537858791589423e-02
-3.30537858785096769e-02
-2.24168574764613937e-01
--3.33577827736174296e-02
-6.96497542114492182e-16
-2.22720568572950001e-01
--3.30537858791508030e-02
--3.30537858785124108e-02
-2.24168574764612383e-01
--4.96925794692624490e-02
-4.96925794695352099e-02
-4.80358805865632010e-01
--5.01102262790585895e-02
-1.39022753198995386e-15
-4.74827900884764453e-01
--4.96925794692506945e-02
--4.96925794695394635e-02
-4.80358805865633343e-01
--5.16178568688406211e-02
-5.16178568698689305e-02
-7.32425308232371952e-01
--5.17653261791708452e-02
-1.80179954679740054e-15
-7.29481147245931938e-01
--5.16178568688317740e-02
--5.16178568698726012e-02
-7.32425308232372840e-01
diff --git a/katoptron/thesis/test_1/post_process.py b/katoptron/thesis/test_1/post_process.py
deleted file mode 100644
index 67ff5c3e014498f389c0e9d0e4997240e1bbe54e..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_1/post_process.py
+++ /dev/null
@@ -1,341 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import katoptron.eigenvalues as e
-import katoptron.readers as r
-import katoptron.convergence as c
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-import matplotlib.pyplot as plt
-
-
-def read_mm_vector(filename, ensemble_size):
-    with open(filename, 'r') as my_file:
-        text = my_file.read().splitlines(True)
-        if ensemble_size > 1:
-            for i in range(2, len(text)):
-                text[i] = text[i].replace("[", "")
-                text[i] = text[i].replace("]", "")
-
-    X = np.genfromtxt(text[2:])
-    return X
-
-
-def read_mm_sparse_matrix(filename, ensemble_size):
-    with open(filename, 'r') as my_file:
-        text = my_file.read().splitlines(True)
-        if ensemble_size > 1:
-            for i in range(2, len(text)):
-                text[i] = text[i].replace("[", "")
-                text[i] = text[i].replace("]", "")
-
-    sizes = [375, 375]  # np.genfromtxt(text[1])
-    data = np.genfromtxt(text[2:])
-    A = np.zeros((int(sizes[0]), int(sizes[1]), ensemble_size))
-    for i in range(0, data.shape[0]):
-        A[int(data[i, 0]) - 1, int(data[i, 1]) - 1, :] = data[i, 2:]
-    return A
-
-
-def extract_values(filename, node_id, which_dof, dof_per_node, ensemble_size):
-    output = np.zeros((ensemble_size, ))
-    X = read_mm_vector(filename, ensemble_size)
-    output = X[dof_per_node * node_id + which_dof, :]
-    return output
-
-
-def compare_QoI(base_dir_NER, base_dir_ER, case_ids, ensemble_sizes):
-    node_id = 46
-    which_dof = 2
-    dof_per_node = 3
-
-    for case_id in case_ids:
-        for ensemble_size in ensemble_sizes:
-            if case_id == 2:
-                param_min = 0.075
-                param_max = 0.125
-            elif case_id == 6:
-                param_min = 0.95
-                param_max = 1.05
-            elif case_id == 7:
-                param_min = 1.2
-                param_max = 1.3
-            else:
-                param_min = 0.75
-                param_max = 1.25
-
-            param = np.linspace(param_min, param_max, ensemble_size)
-            solution_file_name = base_dir_NER + 'test_' + str(
-                case_id) + '_s_' + str(ensemble_size) + '/x_mm.txt'
-            output_NER = extract_values(solution_file_name, node_id, which_dof,
-                                        dof_per_node, ensemble_size)
-            solution_file_name = base_dir_ER + 'test_' + str(
-                case_id) + '_s_' + str(ensemble_size) + '/x_mm.txt'
-            output_ER = extract_values(solution_file_name, node_id, which_dof,
-                                       dof_per_node, ensemble_size)
-            plt.figure()
-            plt.plot(output_NER, 'o-')
-            plt.plot(output_ER, 'o-')
-            plt.savefig('QoI_case_' + str(case_id) + '_s_' +
-                        str(ensemble_size) + '.pdf')
-
-            f = open(
-                'QoI_case_' + str(case_id) + '_s_' + str(ensemble_size) +
-                '.txt', 'w')
-            for l in range(0, ensemble_size):
-                print(str(param[l]) + ' ' + str(
-                    output_NER[l]) + ' ' + str(
-                        output_ER[l]) + ' ' + str(output_NER[l] - output_ER[l]), file=f)
-            f.closed
-
-
-def read_Belos(base_dir_NER, base_dir_ER, case_ids, ensemble_sizes):
-    for case_id in case_ids:
-        for ensemble_size in ensemble_sizes:
-            filename_NER = base_dir_NER + 'test_' + str(case_id) + '_s_' + str(
-                ensemble_size) + '/belos_out.txt'
-            iter_indices_NER, residuals_NER = r.read_Belos(
-                filename_NER, ensemble_size)
-
-            filename_ER = base_dir_ER + 'test_' + str(case_id) + '_s_' + str(
-                ensemble_size) + '/belos_out.txt'
-            iter_indices_ER, residuals_ER = r.read_Belos(filename_ER, 1)
-
-            f = open(
-                'Belos_NER_' + str(case_id) + '_s_' + str(ensemble_size) +
-                '.txt', 'w')
-            for i in range(0, len(iter_indices_NER)):
-                tmp = str(i) + ' '
-                for l in range(0, ensemble_size):
-                    tmp = tmp + str(residuals_NER[i, l]) + ' '
-                print(tmp, file=f)
-            f.closed
-
-            f = open(
-                'Belos_ER_' + str(case_id) + '_s_' + str(ensemble_size) +
-                '.txt', 'w')
-            for i in range(0, len(iter_indices_ER)):
-                print(str(i) + ' ' + str(residuals_ER[i]), file=f)
-            f.closed
-
-            plt.figure()
-            plt.semilogy(iter_indices_NER, residuals_NER[:, 0], 'o-')
-            plt.semilogy(iter_indices_ER, residuals_ER, 'o-')
-            plt.savefig('Belos_ER_' + str(case_id) + '_s_' +
-                        str(ensemble_size) + '.pdf')
-
-
-def compute_cum_delta_normal(lambdas,
-                             omegas,
-                             lambda_min=None,
-                             lambda_max=None,
-                             n=200):
-
-    indices = np.argsort(lambdas)
-    lambdas = lambdas[indices]
-    omegas = omegas[indices]
-
-    if lambda_min is None:
-        lambda_min = lambdas[0]
-    if lambda_max is None:
-        lambda_max = lambdas[-1]
-
-    lambda_discrete = np.linspace(lambda_min, lambda_max, n)
-    dlambda = ((lambda_max - lambda_min) / (n - 1))
-
-    cum_delta = np.zeros((n, ))
-    deriv_delta = np.zeros((n, ))
-    cum_delta_omega = np.zeros((n, ))
-    deriv_delta_omega = np.zeros((n, ))
-
-    n_lambdas = len(lambdas)
-
-    first_index = 0
-    second_index = 0
-    for i in range(1, n):
-        for j in range(second_index, n_lambdas):
-            if lambda_discrete[i] < lambdas[j]:
-                second_index = j
-                break
-        cum_delta[i] = cum_delta[i - 1] + second_index - first_index
-        cum_delta_omega[i] = cum_delta_omega[i - 1] + np.sum(
-            omegas[first_index:second_index])
-        deriv_delta[i] = ((second_index - first_index) / dlambda)
-        deriv_delta_omega[i] = (np.sum(
-            omegas[first_index:second_index]) / dlambda)
-        first_index = second_index
-
-    percent_delta = (cum_delta / cum_delta[n - 1])
-    percent_delta_omega = (cum_delta_omega / cum_delta_omega[n - 1])
-
-    return lambda_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega
-
-
-def compute_deltas_omegas(base_dir, case_ids, ensemble_sizes):
-    for case_id in case_ids:
-        for ensemble_size in ensemble_sizes:
-
-            filename_b = base_dir + 'test_' + str(case_id) + '_s_' + str(
-                ensemble_size) + '/b_mm_after_bc.txt'
-            filename_A = base_dir + 'test_' + str(case_id) + '_s_' + str(
-                ensemble_size) + '/A_mm_after_bc.txt'
-
-            b = read_mm_vector(filename_b, ensemble_size)
-            A = read_mm_sparse_matrix(filename_A, ensemble_size)
-
-            for l in range(0, ensemble_size):
-                b_l = b[:, l]
-                A_l = e.get_symmetrical_part(A[:, :, l])
-                deltas, omegas = e.compute_deltas_omegas_normal(A_l, b_l)
-                indices = np.argsort(np.real(deltas))
-                f = open(
-                    'deltas_omegas_' + str(case_id) + '_s_' +
-                    str(ensemble_size) + '_l_' + str(l) + '.txt', 'w')
-                for i in range(0, len(deltas)):
-                    print(str(np.real(deltas[indices[i]])) + ' ' + str(
-                        np.imag(deltas[indices[i]])) + ' ' + str(
-                            omegas[indices[i]]) + ' ' + str(i), file=f)
-                f.closed
-
-                lambda_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta_normal(
-                    np.real(deltas),
-                    omegas,
-                    lambda_min=0.,
-                    lambda_max=12.,
-                    n=300)
-
-                plt.figure()
-                plt.plot(lambda_discrete, cum_delta)
-                plt.savefig('cum_delta_' + str(case_id) + '_s_' +
-                            str(ensemble_size) + '_l_' + str(l) + '.pdf')
-                plt.close()
-                plt.figure()
-                plt.plot(lambda_discrete, deriv_delta)
-                plt.savefig('deriv_delta_' + str(case_id) + '_s_' +
-                            str(ensemble_size) + '_l_' + str(l) + '.pdf')
-                plt.close()
-                plt.figure()
-                plt.plot(lambda_discrete, cum_delta_omega)
-                plt.savefig('cum_delta_omega_' + str(case_id) + '_s_' +
-                            str(ensemble_size) + '_l_' + str(l) + '.pdf')
-                plt.close()
-                plt.figure()
-                plt.plot(lambda_discrete, deriv_delta_omega)
-                plt.savefig('deriv_delta_omega_' + str(case_id) + '_s_' +
-                            str(ensemble_size) + '_l_' + str(l) + '.pdf')
-                plt.close()
-
-                if l == 0:
-                    deltas_total = np.real(deltas)
-                    omegas_total = omegas
-                else:
-                    deltas_total = np.append(deltas_total, np.real(deltas))
-                    omegas_total = np.append(omegas_total, omegas)
-
-            lambda_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta_normal(
-                deltas_total,
-                omegas_total,
-                lambda_min=0.,
-                lambda_max=12.,
-                n=300)
-
-            plt.figure()
-            plt.plot(lambda_discrete, cum_delta)
-            plt.savefig('cum_delta_' + str(case_id) + '_s_' +
-                        str(ensemble_size) + '_all.pdf')
-            plt.close()
-            plt.figure()
-            plt.plot(lambda_discrete, deriv_delta)
-            plt.savefig('deriv_delta_' + str(case_id) + '_s_' +
-                        str(ensemble_size) + '_all.pdf')
-            plt.close()
-            plt.figure()
-            plt.plot(lambda_discrete, cum_delta_omega)
-            plt.savefig('cum_delta_omega_' + str(case_id) + '_s_' +
-                        str(ensemble_size) + '_all.pdf')
-            plt.close()
-            plt.figure()
-            plt.plot(lambda_discrete, deriv_delta_omega)
-            plt.savefig('deriv_delta_omega_' + str(case_id) + '_s_' +
-                        str(ensemble_size) + '_all.pdf')
-            plt.close()
-            '''
-            n_per_l = len(b_l)
-            n_total = n_per_l*ensemble_size
-            b_total = np.zeros((n_total,))
-            A_total = np.zeros((n_total,n_total))
-            for l in range(0,ensemble_size):
-                b_total[n_per_l*l:n_per_l*(l+1)] = b[:,l]
-                A_total[n_per_l*l:n_per_l*(l+1),n_per_l*l:n_per_l*(l+1)] = e.get_symmetrical_part(A[:,:,l])
-            deltas_total, omegas_total = e.compute_deltas_omegas_normal(A_total,b_total)
-
-            lambda_discrete, cum_delta, deriv_delta, cum_delta_omega, deriv_delta_omega, percent_delta, percent_delta_omega = compute_cum_delta_normal(deltas_total,omegas_total, lambda_min=0., lambda_max=12., n = 300  )            
-
-            plt.figure()
-            plt.plot(lambda_discrete, cum_delta)
-            plt.savefig('cum_delta_' + str(case_id) + '_s_' + str(ensemble_size) + '_all_2.pdf')
-            plt.close()
-            plt.figure()
-            plt.plot(lambda_discrete, deriv_delta)
-            plt.savefig('deriv_delta_' + str(case_id) + '_s_' + str(ensemble_size) + '_all_2.pdf')             
-            plt.close()
-            plt.figure()
-            plt.plot(lambda_discrete, cum_delta_omega)
-            plt.savefig('cum_delta_omega_' + str(case_id) + '_s_' + str(ensemble_size) + '_all_2.pdf')                                
-            plt.close()
-            plt.figure()
-            plt.plot(lambda_discrete, deriv_delta_omega)
-            plt.savefig('deriv_delta_omega_' + str(case_id) + '_s_' + str(ensemble_size) + '_all_2.pdf')             
-            plt.close() 
-            '''
-
-
-def compute_convergence(base_dir, case_ids, ensemble_sizes, k_max):
-    for case_id in case_ids:
-        for ensemble_size in ensemble_sizes:
-            for l in range(0, ensemble_size):
-                data = np.genfromtxt('deltas_omegas_' + str(case_id) + '_s_' +
-                                     str(ensemble_size) + '_l_' + str(l) +
-                                     '.txt')
-                deltas = data[:, 0]
-                omegas = data[:, 2]
-
-                n = len(deltas)
-
-                convergence = c.compute_convergence_serial_normal(k_max,
-                                                                  n,
-                                                                  omegas,
-                                                                  deltas,
-                                                                  verbose=True)
-
-
-def main():
-    base_dir_NER = '/Volumes/HD_SONY/Thesis/Test_1/all_results_NER_thesis1/'
-    base_dir_ER = '/Volumes/HD_SONY/Thesis/Test_1/all_results_ER_thesis1/'
-
-    case_ids = [1, 2, 3, 4, 5, 6, 7]
-    ensemble_sizes = [8, 16, 32]
-
-    compare_QoI(base_dir_NER, base_dir_ER, case_ids, ensemble_sizes)
-    read_Belos(base_dir_NER, base_dir_ER, case_ids, ensemble_sizes)
-    #compute_deltas_omegas(base_dir_NER, case_ids, ensemble_sizes)
-
-    k_max = 3
-    case_ids = [1]
-    ensemble_sizes = [8]
-
-    #compute_convergence(base_dir_NER, case_ids, ensemble_sizes, k_max)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_2/1_cube.geo b/katoptron/thesis/test_2/1_cube.geo
deleted file mode 100644
index f3bd653dc53caf13979ed4c07cc1a4d9847530d4..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_2/1_cube.geo
+++ /dev/null
@@ -1,42 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-//nCx = 3;
-//nCy = 4;
-//nCz = 5;
-
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Transfinite Line {1,3} = nCx+1 Using Progression 1;
-Transfinite Line {2,4} = nCz+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nCy}; Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Point("Measure point 1") = {4};
-Physical Point("Measure point 2") = {1};
diff --git a/katoptron/thesis/test_2/1_cube.py b/katoptron/thesis/test_2/1_cube.py
deleted file mode 100644
index a5fcf8369d5d0b7a2ee2d744ea248fb4b1c45099..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_2/1_cube.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-
-
-def tar_results(directory, filename, rank):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        for file in glob.glob('*'):
-            if file.endswith(".tar.gz"):
-                print(file + ' is not included')
-            else:
-                tf.add(file)
-        tf.close()
-
-
-def model(msh, E, p, ensemble_size, case_name, max_iter, use_Prec=False):
-    comm, rank, size = m.utilities.import_MPI()
-    file_dir = os.path.dirname(__file__)
-
-    pbl = m.Problem(msh, comm)
-
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 0.,
-                ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 0.  # 10**(-8)
-    solverList['Maximum Iterations'] = int(max_iter)
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = use_Prec
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write vtk files'] = False
-
-    if use_Prec:
-        solverList['convert MueLu xml file'] = True
-        solverList["use xml file"] = True
-        solverList["MueLu xml file name"] = file_dir + '/prec.xml'
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    u.mkdir_MPI(case_name, comm, rank, size)
-    os.chdir(case_name)
-
-    if rank == 0:
-        f = open('msh_size.txt', 'w')
-        print(len(msh.nodes), file=f)
-        f.closed
-
-        np.savetxt('E.txt', E)
-        np.savetxt('p.txt', p)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    os.chdir('..')
-
-
-def read_msh(nCx, nCy, nCz, file_dir, work_dir, i=0, load=True):
-    comm, rank, size = m.utilities.import_MPI()
-
-    geo_name = '1_cube.geo'
-    mesh_name = '1_cube.msh'
-    mesh_2_name = str('1_cube_'+str(i)+'.msh')
-
-    pars = {'nCx': nCx, 'nCy': nCy, 'nCz': nCz}
-
-    if load:
-        msh = gmsh.MeshLoader(mesh_2_name, work_dir).execute()
-    else:
-        old_name = str(work_dir+'/'+mesh_name)
-        new_name = str(work_dir+'/'+mesh_2_name)
-        msh = gmsh.MeshLoader(geo_name, file_dir).execute(**pars)
-        os.rename(old_name, new_name)
-
-    return msh
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    E_mean = 1.
-    p_mean = 0.1
-
-    ensemble_sizes = [1, 8, 16, 24, 32]
-
-    nCx = 9
-    nCy = 9
-
-    N = 100
-    N_i = 10
-    tmp = np.logspace(1, 5, N, endpoint=True, dtype=int)
-    nCzs = tmp - 1
-    max_iter = 100
-
-    # Compute all the meshes BEFORE initialing Kokkos.
-
-    for i in range(0, N_i):
-        nCz = nCzs[i]
-        msh = read_msh(nCx, nCy, nCz, file_dir, work_dir, i, False)
-
-    # Now that all the meshes are computed, we can initialize Kokkos.
-    nThreads = u.Initialize_Kokkos()
-    for i in range(0, N_i):
-        nCz = nCzs[i]
-        msh = read_msh(nCx, nCy, nCz, file_dir, work_dir, i, True)
-        for ensemble_size in ensemble_sizes:
-            E = E_mean * np.ones(ensemble_size)
-            p = p_mean * np.ones(ensemble_size)
-
-            directory_case_id = str('test_' +
-                                           str(i) + '_s_' + str(ensemble_size) + '_no_prec_m_' + str(max_iter))
-            model(msh, E, p, ensemble_size, directory_case_id,
-                  max_iter, use_Prec=False)
-            directory_case_id = str('test_' +
-                                           str(i) + '_s_' + str(ensemble_size) + '_prec_m_' + str(max_iter))
-            model(msh, E, p, ensemble_size, directory_case_id,
-                  max_iter, use_Prec=True)
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_2/blake.slurm.sh b/katoptron/thesis/test_2/blake.slurm.sh
deleted file mode 100644
index 7f64a62eaeb01c0d1cc3e80f8b87f315726041a9..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_2/blake.slurm.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_2
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_2.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_2/1_cube.py
\ No newline at end of file
diff --git a/katoptron/thesis/test_2/post_process.py b/katoptron/thesis/test_2/post_process.py
deleted file mode 100644
index e6aa56bd58ccbaf8dad52aca5de84b99730f298b..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_2/post_process.py
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import katoptron.eigenvalues as e
-import katoptron.readers as r
-import katoptron.convergence as c
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-from katoptron.speedup import *
-
-
-def CPU_time_all_cases(base_dir, n_cases, ensemble_sizes,
-                       querylines, use_waves_timers, use_teuchos_timers, m,
-                       use_prec=False):
-
-    CPUs = np.zeros((n_cases, len(ensemble_sizes), len(querylines)))
-    msh_size = np.zeros((n_cases,))
-
-    for i in range(0, n_cases):
-        msh_size[i] = np.loadtxt(
-            base_dir + 'test_'+str(i)+'_s_1_no_prec_m_' + str(m) + '/msh_size.txt')
-        for j in range(0, len(ensemble_sizes)):
-            ensemble_size = ensemble_sizes[j]
-
-            input_MC_file_dir = base_dir + 'test_' + \
-                str(i)+'_s_'+str(ensemble_size)
-
-            if use_prec:
-                input_MC_file_dir = input_MC_file_dir + \
-                    '_prec_m_' + str(m) + '/'
-            else:
-                input_MC_file_dir = input_MC_file_dir + \
-                    '_no_prec_m_' + str(m) + '/'
-
-            for k in use_waves_timers:
-                CPUs[i, j, int(k)] = read_timers(
-                    input_MC_file_dir + 'timers.txt', [querylines[int(k)]])[0]
-            for k in use_teuchos_timers:
-                CPUs[i, j, int(k)] = read_teuchos_timers(
-                    input_MC_file_dir + 'teuchos_timers.txt',
-                    [querylines[int(k)]])[0]
-
-    return CPUs, msh_size
-
-
-def plot_CPU_and_speedup(CPUs, msh_size, ensemble_sizes, index, querylines):
-    plt.figure()
-    for i in range(0, len(ensemble_sizes)):
-        plt.loglog(3*msh_size, CPUs[:, i, index], '*-')
-
-    plt.ylabel('CPU time [sec]')
-    plt.xlabel('# dofs')
-    plt.title(querylines[index])
-    plt.grid(True, which="both")
-    tmp_name = querylines[index].replace(": ", "_")
-    tmp_name = tmp_name.replace(" ", "_")
-    plt.savefig(tmp_name+'_CPU.png')
-
-    np.savetxt(tmp_name+'_CPU.txt', CPUs[:, :, index])
-
-    mc_all = np.zeros((len(ensemble_sizes), 2))
-    for i in range(0, len(ensemble_sizes)):
-        logX = np.log(3*msh_size)
-        logY = np.log(CPUs[:, i, index])
-        m, c = np.polyfit(logX, logY, 1)
-        mc_all[i, 0] = m
-        mc_all[i, 1] = c
-
-    np.savetxt(tmp_name+'_CPU_mc.txt', mc_all)
-
-    plt.figure()
-    for i in range(1, len(ensemble_sizes)):
-        plt.loglog(
-            3*msh_size, (ensemble_sizes[i]*CPUs[:, 0, index] / CPUs[:, i, index]), '*-')
-
-    x = 3*np.array([msh_size[0], msh_size[-1]])
-    y = np.array([1., 1.])
-    plt.grid(True, which="both")
-
-    plt.ylabel('Speed-up')
-    plt.xlabel('# dofs')
-    plt.title(querylines[index])
-    plt.savefig(tmp_name+'_speedup.png')
-    for i in range(1, len(ensemble_sizes)):
-        np.savetxt(tmp_name+'_speedup_'+str(
-            ensemble_sizes[i])+'.txt', (ensemble_sizes[i]*CPUs[:, 0, index] / CPUs[:, i, index]))
-
-
-def main():
-    base_dir = '/Users/kimliegeois/Desktop/results/'
-    n_cases = 50
-
-    ensemble_sizes = [1, 8, 16, 24, 32]
-
-    querylines = [
-        'total', 'write results', 'computeMatrices',
-        'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'Belos: PseudoBlockGmresSolMgr total solve time'
-    ]
-    use_waves_timers = np.array([0, 1, 2], dtype=int)
-    use_teuchos_timers = np.array(
-        [3, 4, 5, 6, 7, 8, 9],
-        dtype=int)
-
-    m = 100
-
-    CPUs, msh_size = CPU_time_all_cases(base_dir, n_cases, ensemble_sizes,
-                                        querylines, use_waves_timers, use_teuchos_timers, m,
-                                        use_prec=False)
-
-    CPUs[:, :, 0] = CPUs[:, :, 0] - CPUs[:, :, 1]
-
-    np.savetxt('N_dofs.txt', 3*msh_size)
-    #print CPUs
-    #print msh_size
-
-    for i in range(0, 10):
-        plot_CPU_and_speedup(CPUs, msh_size, ensemble_sizes, i, querylines)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_2/prec.xml b/katoptron/thesis/test_2/prec.xml
deleted file mode 100644
index 7fcef90cbfcbb994e980439167e31c4e5d441a8f..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_2/prec.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="5"/>
-  <Parameter name="smoother: type" type="string" value="RELAXATION"/>
-  <ParameterList name="smoother: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-    <!-- <Parameter name="relaxation: backward mode" type="bool" value="true"/> -->
-  </ParameterList>
-  <Parameter name="coarse: type" type="string" value="Klu"/>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-  <Parameter name="tentative: calculate qr" type="bool" value="false"/>
-  <Parameter name="number of equations"   type="int"  value="3"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/thesis/test_2/prec_1.xml b/katoptron/thesis/test_2/prec_1.xml
deleted file mode 100644
index b2bd91f1eda70e1a3617aa725ae9d1a75ff0720a..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_2/prec_1.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="1"/>
-  <Parameter name="coarse: type" type="string" value="RELAXATION"/>
-  <ParameterList name="coarse: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>    
-  </ParameterList>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="number of equations"   type="int"  value="3"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/thesis/test_3/beam.geo b/katoptron/thesis/test_3/beam.geo
deleted file mode 100644
index 71c4c0a7d917856e1d9791929e06c9347b4e036a..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_3/beam.geo
+++ /dev/null
@@ -1,114 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-
-//L = 50.;
-//W = 1.;
-//H = 5.;
-//d = 1.;
-
-//L = 50.;
-//W = 5.;
-//H = 5.;
-H_rigid = 1.;
-//d = 1.;
-
-hW = W/2;
-hH = H/2;
-
-//n_L = 60;
-//n_hW = 3;
-//n_hH = 3;
-
-n_L_rigid = 1;
-n_W_rigid = 1;
-n_H_rigid = 1;
-
-
-lc = 1;
-
-delta_H = hH+d;
-
-Point(101) = { 0,  -hW,    d, lc};
-Point(102) = { 0,   0,    d, lc};
-Point(103) = { 0,   hW,    d, lc};
-Point(104) = { L,   hW,    d, lc};
-Point(105) = { L,   0,    d, lc};
-Point(106) = { L,  -hW,    d, lc};
-
-Point(205) = { 0,   -hW, 0, lc};
-Point(206) = { 0,    hW, 0, lc};
-Point(207) = { L,    hW, 0, lc};
-Point(208) = { L,   -hW, 0, lc};
-
-Line(101) = {101, 102};
-Line(102) = {102, 103};
-Line(103) = {103, 104};
-Line(104) = {104, 105};
-Line(105) = {105, 106};
-Line(106) = {106, 101};
-Line(107) = {105, 102};
-
-Line(205) = {205, 206};
-Line(206) = {206, 207};
-Line(207) = {207, 208};
-Line(208) = {208, 205};
-
-Transfinite Line {101,102,104,105} = n_hW+1 Using Progression 1;
-Transfinite Line {103,106,107} = n_L+1 Using Progression 1;
-
-Transfinite Line {205,207} = n_W_rigid+1 Using Progression 1;
-Transfinite Line {206,208} = n_L_rigid+1 Using Progression 1;
-
-Line Loop(101) = {101,-107,105,106};
-Plane Surface(101) = {101};
-Transfinite Surface {101};
-Recombine Surface {101};
-
-Line Loop(102) = {102,103,104,107};
-Plane Surface(102) = {102};
-Transfinite Surface {102};
-Recombine Surface {102};
-
-Line Loop(202) = {-208,-207,-206,-205};
-Plane Surface(202) = {202};
-Transfinite Surface {202};
-Recombine Surface {202};
-
-Extrude {0, 0, hH}
-{
-  Surface{101,102}; Layers{n_hH}; Recombine;
-}
-
-Extrude {0, 0, hH}
-{
-  Surface{230,252}; Layers{n_hH}; Recombine;
-}
-
-Extrude {0, 0, -H_rigid}
-{
-  Surface{202}; Layers{n_H_rigid}; Recombine;
-}
-
-
-
-Physical Volume("Rigid body") = {5};
-Physical Surface("Rigid surface") = {202};
-Physical Surface("Rigid clamped surface") = {309};
-Physical Line("Rigid surface boundary") = {205, 206, 207, 208};
-
-Physical Volume("Beam") = {1,2,3,4};
-Physical Surface("Clamped end") = {217,239,261,283,317};
-Physical Surface("Loaded surface") = {274,296};
-Physical Surface("Beam contact zone") = {101,102};
-Physical Surface("Free end") = {269,247,225,291};
-Physical Line("Beam contact boundary") = {104,105,106,101,102,103};
-Physical Line("Beam contact Dirichlet") = {101,102};
-
-Physical Line("Center of cross section") = {211};
-
-Physical Line("Center of contact surface") = {107};
-
-Mesh.Partitioner = 2;
-Mesh.MetisAlgorithm = 2;
-Mesh.MshFilePartitioned = 0;
diff --git a/katoptron/thesis/test_3/beam.py b/katoptron/thesis/test_3/beam.py
deleted file mode 100644
index cd5bb997cf8d4b79b0cd3ea88a885f8e8fcf93a1..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_3/beam.py
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-from katoptron.Juelich.UQ.halton import *
-
-
-def tar_results(directory, filename, rank):
-    os.chdir(directory)
-    if rank == 0:
-        tf = tarfile.open(filename + ".tar.gz", mode="w:gz")
-        for file in glob.glob('*'):
-            if file.endswith(".tar.gz"):
-                print(file + ' is not included')
-            else:
-                tf.add(file)
-        tf.close()
-
-
-def model(msh, E, p, ensemble_size, work_dir):
-    comm, rank, size = m.utilities.import_MPI()
-
-    partitioned_mesh_name = 'beam_k.msh'
-    file_dir = os.path.dirname(__file__)
-    current_dir = os.getcwd()
-
-    pbl = m.Problem(msh, comm)
-
-    nu = 0.29 * np.ones(ensemble_size)
-    k = 0
-    d = 0
-
-    m.Medium(pbl, "Beam", "Mat 1", E, nu, k, d)
-    m.Medium(pbl, "Rigid body", "Mat 1", E, nu, k, d)
-
-    dx = np.zeros(ensemble_size)
-    dy = np.zeros(ensemble_size)
-    dz = np.zeros(ensemble_size)
-    dT = np.zeros(ensemble_size)
-    zero = np.zeros(ensemble_size)
-    m.Dirichlet(pbl, "Rigid clamped surface",
-                "Clamped 1", 1, dx, 1, dy, 1, dz, 0, dT)
-    m.Dirichlet(pbl, "Clamped end", "Clamped 1", 1, dx, 1, dy, 1, dz, 0, dT)
-    m.Dirichlet(pbl, "Free end", "Clamped 1", 1, 0.,
-                0, 0., 0, 0., 0, 0., ensemble_size)
-
-    m.Neumann(pbl, "Loaded surface", "Load 1", 0, zero,
-              0, zero, 1, -p, 0, zero, ensemble_size)
-
-    norm1 = tbox.Vector3d(0, 0, -1)
-    norm2 = tbox.Vector3d(0, 0, 1)
-    dg = np.zeros(ensemble_size)
-
-    a = 49.95
-    initiallyClosedNodesList = np.array([], dtype=np.float)
-    for el in msh.ntags["Beam contact zone"].elems:
-        for n1 in el.nodes:
-            node_id = n1.no-1
-            if msh.nodes[node_id].pos[0] >= a:
-                initiallyClosedNodesList = np.append(
-                    initiallyClosedNodesList, node_id)
-
-    cont1 = m.Contact(pbl, "Beam contact zone", "contact", norm1, dg)
-    cont1.setInitialyOpen()
-    cont1.setInitiallyClosedNodes(initiallyClosedNodesList)
-    cont1.setDualShapeFunctions()
-    cont1.setSlaveDirichlet(
-        work_dir+"/"+partitioned_mesh_name, "Beam contact Dirichlet")
-    cont1.setSignoriniContact()
-    cont1.setMaster(pbl, "Rigid surface", norm2)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Convergence Tolerance'] = 10**(-8)
-    solverList['Maximum Iterations'] = 500
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    muelu_xml_in = file_dir + '/../../preconditioners/SIMPLE_gs_direct_lvl_MT.xml.in'
-    old_strings = ['$BLOCK_00_STRIDING_INFO', '$BLOCK_11_STRIDING_INFO',
-                   '$BLOCK_00_GS_sweeps', '$BLOCK_00_GS_damping',
-                   '$SCHUR_omega', '$SimpleSmoother_damping', "$N_LVLS", "$N_SIZES", "$EXPORT_DATA", "$SimpleSmoother_sweeps"]
-    new_strings = ['3', '1', '3', '0.8', '0.8', '1', '2', '18', "true", '1']
-
-    u.replace_strings(muelu_xml_in, current_dir +
-                      '/SIMPLE_MG.xml', old_strings, new_strings)
-
-    solverList["MueLu xml file name"] = current_dir+'/SIMPLE_MG.xml'
-    solverList["convert MueLu xml file"] = True
-
-    solverList['Use preconditioner'] = True
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 10
-    solverList['Write txt files'] = True
-    solverList['Print Teuchos timers'] = True
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    if rank == 0:
-        np.savetxt('E.txt', E)
-        np.savetxt('p.txt', p)
-
-    slv.start()
-
-    f = open('timers.txt', 'w')
-    print(slv.getTimers(), file=f)
-    f.closed
-
-
-def evaluate_all_ensembles(ensemble_sizes, N, msh, comm, rank, size,
-                           file_dir, work_dir, E_vec, p_vec):
-    """
-    This function loop over the ensemble sizes,
-    and the ensembles
-    """
-    for ensemble_size in ensemble_sizes:
-        directory = str(ensemble_size)
-        u.mkdir_MPI(directory, comm, rank, size)
-        os.chdir(directory)
-
-        N_ensemble = N // ensemble_size
-
-        ensemble_index_min = 0
-        for ensemble_index in range(ensemble_index_min, N_ensemble):
-            directory = str(ensemble_index)
-            u.mkdir_MPI(directory, comm, rank, size)
-            os.chdir(directory)
-
-            ensemble_index_start = ensemble_index * ensemble_size
-            ensemble_index_end = ensemble_index_start + ensemble_size
-
-            E = E_vec[ensemble_index_start:ensemble_index_end]
-
-            p = p_vec[ensemble_index_start:ensemble_index_end]
-
-            model(msh, E, p, ensemble_size, work_dir)
-
-            os.chdir('..')
-        os.chdir('..')
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    geo_name = 'beam.geo'
-
-    larger_mesh = True
-
-    par = {}
-    par['L'] = 50.
-    par['W'] = 5.
-    par['H'] = 5.
-    par['d'] = 1.
-    if larger_mesh:
-        par['n_L'] = 200
-        par['n_hW'] = 5
-        par['n_hH'] = 5
-    else:
-        par['n_L'] = 60
-        par['n_hW'] = 3
-        par['n_hH'] = 3
-
-    import shlex
-    import subprocess
-    import os
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    pars = {'L': par['L'], 'W': par['W'], 'H': par['H'], 'd': par['d'],
-            'n_L': par['n_L'], 'n_hW': par['n_hW'], 'n_hH': par['n_hH']}
-
-    msh, mesh_name, partitioned_mesh_name = u.read_mesh_MPI(
-        geo_name, file_dir, work_dir, comm, rank, size, pars)
-
-    for n1 in msh.nodes:
-        n1.row = n1.no-1
-
-    N = 640
-    p_min = 0.5
-    p_max = 2.5
-    E_min = 20500
-    E_max = 21500
-
-    n_rand = 2
-    halton_points = np.zeros((n_rand, N))
-    E_vec = np.zeros((N, ))
-    p_vec = np.zeros((N, ))
-    for i in range(0, N):
-        halton_points[:, i] = halton(i, n_rand)
-
-    E_vec = E_min + halton_points[0, :] * (E_max-E_min)
-    p_vec = p_min + halton_points[1, :] * (p_max-p_min)
-
-    grouped = False
-
-    if grouped:
-        order = np.loadtxt(file_dir+'/ordering.txt', dtype=int)
-        E_vec = E_vec[order[0:N]]
-        p_vec = p_vec[order[0:N]]
-
-    if rank == 0:
-        np.savetxt('E_vec.txt', E_vec)
-        np.savetxt('p_vec.txt', p_vec)
-
-    ensemble_sizes = [1, 8, 16, 32]
-
-    nThreads = u.Initialize_Kokkos()
-    evaluate_all_ensembles(ensemble_sizes, N, msh, comm, rank, size,
-                           file_dir, work_dir, E_vec, p_vec)
-
-    u.Finalize_Kokkos()
-
-    tar_results(work_dir, 'all_results', rank)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_3/blake.slurm.sh b/katoptron/thesis/test_3/blake.slurm.sh
deleted file mode 100644
index bbc346f3217cd155e8a60ba9baffc6a9e32ed67a..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_3/blake.slurm.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_3
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_3.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_3/beam.py
diff --git a/katoptron/thesis/test_3/ordering.txt b/katoptron/thesis/test_3/ordering.txt
deleted file mode 100644
index 7680c69939af659e75ff9f3d47b6afaa8f2161ad..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_3/ordering.txt
+++ /dev/null
@@ -1,640 +0,0 @@
-318
-561
-453
-210
-588
-264
-129
-372
-615
-48
-426
-399
-534
-75
-108
-27
-486
-351
-405
-0
-81
-513
-567
-270
-243
-189
-162
-324
-339
-285
-222
-177
-123
-501
-384
-393
-609
-555
-204
-582
-42
-96
-258
-231
-420
-528
-366
-69
-447
-216
-345
-552
-228
-291
-183
-237
-102
-21
-390
-156
-249
-87
-411
-621
-573
-6
-252
-519
-255
-408
-219
-18
-387
-435
-504
-279
-84
-30
-480
-261
-543
-9
-381
-516
-273
-111
-90
-597
-570
-192
-297
-558
-327
-549
-354
-360
-612
-144
-153
-468
-441
-57
-207
-489
-432
-225
-594
-414
-288
-531
-540
-171
-99
-378
-165
-126
-1
-495
-135
-217
-63
-396
-45
-36
-198
-333
-379
-423
-622
-450
-492
-306
-639
-117
-91
-3
-522
-72
-330
-234
-315
-369
-342
-180
-603
-246
-352
-630
-477
-406
-253
-465
-415
-244
-55
-33
-60
-54
-459
-195
-585
-109
-568
-136
-576
-240
-595
-28
-433
-186
-82
-168
-298
-145
-357
-325
-510
-159
-114
-213
-600
-312
-163
-15
-469
-546
-564
-303
-271
-537
-636
-166
-348
-51
-429
-618
-19
-105
-343
-505
-375
-591
-321
-294
-474
-24
-280
-267
-559
-451
-181
-150
-64
-127
-139
-604
-226
-517
-442
-154
-388
-193
-31
-73
-550
-85
-478
-613
-328
-262
-274
-235
-100
-247
-46
-424
-586
-301
-490
-571
-397
-316
-4
-463
-355
-532
-289
-208
-370
-409
-502
-466
-444
-633
-471
-507
-309
-120
-525
-66
-138
-147
-201
-579
-462
-300
-336
-12
-627
-282
-417
-174
-498
-39
-363
-624
-93
-141
-190
-276
-514
-541
-438
-460
-487
-37
-456
-334
-483
-118
-172
-496
-631
-67
-10
-523
-78
-132
-577
-307
-121
-199
-361
-445
-229
-202
-220
-402
-94
-103
-607
-499
-337
-598
-391
-580
-526
-13
-175
-436
-40
-634
-22
-283
-553
-382
-544
-475
-196
-256
-58
-625
-148
-25
-373
-151
-340
-385
-178
-205
-346
-49
-589
-112
-304
-418
-295
-265
-508
-211
-412
-637
-130
-70
-124
-601
-349
-535
-16
-43
-367
-319
-421
-520
-400
-142
-628
-157
-472
-439
-493
-292
-187
-115
-511
-169
-7
-97
-529
-583
-610
-61
-394
-616
-574
-238
-547
-250
-259
-268
-286
-88
-313
-79
-331
-562
-556
-481
-430
-454
-133
-76
-184
-223
-173
-619
-605
-232
-92
-106
-164
-29
-448
-443
-623
-434
-38
-326
-380
-218
-277
-119
-461
-322
-335
-160
-542
-353
-2
-191
-515
-254
-551
-376
-484
-272
-65
-299
-488
-137
-110
-263
-497
-569
-11
-227
-281
-362
-572
-596
-389
-248
-221
-578
-518
-56
-606
-310
-427
-407
-358
-364
-34
-83
-524
-241
-457
-245
-52
-565
-214
-422
-470
-587
-592
-566
-538
-32
-479
-98
-403
-77
-512
-410
-305
-485
-317
-416
-395
-224
-236
-629
-179
-161
-320
-530
-278
-20
-260
-212
-548
-233
-206
-188
-113
-44
-50
-431
-155
-341
-458
-374
-68
-128
-602
-134
-8
-182
-392
-125
-503
-71
-89
-116
-332
-329
-449
-74
-557
-17
-59
-107
-170
-560
-563
-365
-452
-359
-428
-62
-371
-143
-131
-239
-266
-302
-269
-167
-47
-611
-95
-467
-308
-608
-455
-200
-533
-86
-536
-287
-494
-632
-209
-590
-626
-5
-575
-614
-581
-617
-176
-185
-401
-41
-293
-290
-506
-491
-527
-437
-311
-35
-104
-545
-419
-635
-344
-338
-413
-14
-23
-158
-425
-398
-140
-251
-257
-356
-203
-230
-554
-599
-194
-101
-275
-383
-593
-404
-539
-377
-368
-476
-314
-482
-584
-26
-80
-53
-323
-296
-350
-521
-440
-242
-500
-620
-152
-215
-638
-122
-197
-386
-509
-446
-347
-473
-284
-149
-146
-464
diff --git a/katoptron/thesis/test_3/post_process.py b/katoptron/thesis/test_3/post_process.py
deleted file mode 100644
index f8a356faa4fe30e7cefbb5a680369585c5c12be8..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_3/post_process.py
+++ /dev/null
@@ -1,485 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-import katoptron.eigenvalues as e
-import katoptron.readers as r
-import katoptron.convergence as c
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import axes3d
-from katoptron.speedup import *
-
-
-def read_mm_vector(filename, ensemble_size):
-    with open(filename, 'r') as my_file:
-        text = my_file.read().splitlines(True)
-        if ensemble_size > 1:
-            for i in range(2, len(text)):
-                text[i] = text[i].replace("[", "")
-                text[i] = text[i].replace("]", "")
-
-    X = np.genfromtxt(text[2:])
-    return X
-
-
-def extract_values(filename, node_id, which_dof, dof_per_node, ensemble_size):
-    output = np.zeros((ensemble_size, ))
-    X = read_mm_vector(filename, ensemble_size)
-    output = X[dof_per_node * node_id + which_dof, :]
-    return output
-
-
-def write_tex(n_samples, iter, filename):
-    f = open(filename, 'w')
-    print('\\addplot [c1, mark=*, mark size=2pt, mark options={solid}, only marks]', file=f)
-    print('table [row sep=crcr] {%', file=f)
-    for i in range(0, n_samples):
-        print(str(i) + ' ' + str(iter[0][i]) + '\\\\', file=f)
-    print('};', file=f)
-    print('\\label{pgfplots:noEP}', file=f)
-    ensemble_size = 8
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        print('\\addplot [line width=2pt, c2]', file=f)
-        print('table [row sep=crcr] {%', file=f)
-        print(str(ensemble_size * i) + ' ' + str(
-            iter[1][ensemble_size * i]) + '\\\\', file=f)
-        print(str(ensemble_size *
-                  (i + 1)) + ' ' + str(iter[1][ensemble_size *
-                                               (i + 1) - 1]) + '\\\\', file=f)
-        print('};', file=f)
-    print('\\label{pgfplots:s8}', file=f)
-    ensemble_size = 16
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        print('\\addplot [line width=1.5pt, c3]', file=f)
-        print('table [row sep=crcr] {%', file=f)
-        print(str(ensemble_size * i) + ' ' + str(
-            iter[2][ensemble_size * i]) + '\\\\', file=f)
-        print(str(ensemble_size *
-                  (i + 1)) + ' ' + str(iter[2][ensemble_size *
-                                               (i + 1) - 1]) + '\\\\', file=f)
-        print('};', file=f)
-    print('\\label{pgfplots:s16}', file=f)
-    ensemble_size = 32
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        print('\\addplot [line width=1.pt, c4]', file=f)
-        print('table [row sep=crcr] {%', file=f)
-        print(str(ensemble_size * i) + ' ' + str(
-            iter[3][ensemble_size * i]) + '\\\\', file=f)
-        print(str(ensemble_size *
-                  (i + 1)) + ' ' + str(iter[3][ensemble_size *
-                                               (i + 1) - 1]) + '\\\\', file=f)
-        print('};', file=f)
-    print('\\label{pgfplots:s32}', file=f)
-    f.closed
-
-
-def CPU_time_per_one_case(base_dir,
-                          n_samples,
-                          ensemble_sizes,
-                          quantiles,
-                          querylines,
-                          use_waves_timers,
-                          use_teuchos_timers,
-                          per_iteration,
-                          filename_CPU,
-                          filename_speed_up,
-                          per_ensemble=True):
-
-    timers = read_timers_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                            base_dir, querylines,
-                                            use_waves_timers,
-                                            use_teuchos_timers)
-
-    f = open(filename_CPU, 'w')
-    print(timers.shape, file=f)
-
-    for i in range(0, timers.shape[2]):
-        print(querylines[i], file=f)
-        string = ''
-        for e in range(0, timers.shape[0]):
-            if per_ensemble:
-                current_timer = (np.sum(timers[e, :, i]) / n_samples)
-            else:
-                current_timer = (np.sum(
-                    timers[e, :, i]) / (n_samples * ensemble_sizes[e]))
-            string = string + str(round(current_timer, 3)) + ' & '
-        print(string, file=f)
-        print(' ', file=f)
-    f.closed
-
-    f = open(filename_speed_up, 'w')
-    print(timers.shape, file=f)
-
-    for i in range(0, timers.shape[2]):
-        print(querylines[i], file=f)
-        string = ''
-        for e in range(0, timers.shape[0]):
-            if e == 0:
-                current_timer_s1 = np.sum(timers[0, :, i])
-            current_timer = (np.sum(timers[e, :, i]) / ensemble_sizes[e])
-            string = string + str(round((current_timer_s1 / current_timer),
-                                        3)) + ' & '
-        print(string, file=f)
-        print(' ', file=f)
-    f.closed
-
-
-def load_qoi(base_dir, N, ensemble_size):
-    node_id = 68
-    #node_id = 227
-    which_dof = 2
-    dof_per_node = 3
-
-    qoi = np.zeros((N, ))
-    N_ensemble = N // ensemble_size
-
-    ensemble_index_min = 0
-    for ensemble_index in range(ensemble_index_min, N_ensemble):
-        solution_file_name = base_dir + '/' + str(ensemble_size) + '/' + str(
-            ensemble_index) + '/x_mm.txt'
-        output = extract_values(solution_file_name, node_id, which_dof,
-                                dof_per_node, ensemble_size)
-
-        ensemble_index_start = ensemble_index * ensemble_size
-        ensemble_index_end = ensemble_index_start + ensemble_size
-
-        qoi[ensemble_index_start:ensemble_index_end] = output
-
-    return qoi
-
-
-def speedup(base_dir,
-            n_samples,
-            ensemble_sizes,
-            quantiles,
-            querylines,
-            use_waves_timers,
-            use_teuchos_timers,
-            per_iteration,
-            ensemble_reduction=False):
-    import matplotlib.pyplot as plt
-
-    if ensemble_reduction:
-        case_id = 'ER'
-    else:
-        case_id = 'NER'
-
-    speedup = compute_speedup(n_samples,
-                              ensemble_sizes,
-                              base_dir,
-                              querylines,
-                              per_iteration,
-                              quantiles,
-                              use_waves_timers,
-                              use_teuchos_timers,
-                              reduction=ensemble_reduction,
-                              remove_write=True)
-
-    plot_speedup(speedup, ensemble_sizes, np.arange(0, len(querylines)),
-                 'beam_' + case_id, querylines, per_iteration)
-    plt.savefig('beam_' + case_id + '.png', dpi=400)
-
-    save_speedup(speedup, ensemble_sizes, querylines, 'beam_' + case_id)
-
-    R = compute_R(n_samples, ensemble_sizes, base_dir, quantiles,
-                  ensemble_reduction)
-    save_R(R, 'beam_R_' + case_id)
-
-
-def speedup_ensemble_reduction(base_dir_ER, base_dir_NER, n_samples):
-    ensemble_sizes = [1, 8, 16, 32]
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: DGKS[2]: Ortho (Inner Product)',
-        'Belos: DGKS[2]: Ortho (Norm)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0'
-    ]
-    use_waves_timers = np.array([0, 7, 8], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True
-    ]
-
-    speedup(base_dir_NER, n_samples, ensemble_sizes, quantiles, querylines,
-            use_waves_timers, use_teuchos_timers, per_iteration, False)
-    speedup(base_dir_ER, n_samples, ensemble_sizes, quantiles, querylines,
-            use_waves_timers, use_teuchos_timers, per_iteration, True)
-
-    querylines = [
-        'domain', 'Belos: Operation Op*x', 'Belos: Operation Prec*x',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: PseudoBlockGmresSolMgr total solve time',
-        'MueLu: Hierarchy: Setup (total)', 'Belos: DGKS[2]: Ortho (Update)',
-        'total', 'write results', 'MueLu: Hierarchy: Solve (level=0)',
-        'MueLu: Hierarchy: Solve (level=1)',
-        'MueLu: Hierarchy: Solve : smoothing (level=0)',
-        'MueLu: Hierarchy: Solve : prolongation (level=0)',
-        'MueLu: Hierarchy: Solve : residual calculation (level=0)',
-        'MueLu: Hierarchy: Solve : restriction (level=0)',
-        'MueLu: SIMPLE: Apply: Update step - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Solve block 00 - level 0',
-        'MueLu: SIMPLE: Apply: Prediction step: Compute RHS - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Solve block 11 - level 0',
-        'MueLu: SIMPLE: Apply: Correction step: Compute RHS - level 0',
-        'compute contact matrices', 'compute block 00 matrix', 'dp',
-        'computeMatrices'
-    ]
-    use_waves_timers = np.array([0, 7, 8, 20, 21, 22, 23], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
-        dtype=int)
-    per_iteration = [
-        False, True, True, False, False, False, False, False, False, True,
-        True, True, True, True, True, True, True, True, True, True, False
-    ]
-
-    CPU_time_per_one_case(base_dir_NER, n_samples, ensemble_sizes, quantiles,
-                          querylines, use_waves_timers, use_teuchos_timers,
-                          per_iteration, 'average_CPU_NER.txt',
-                          'average_speed_up_NER.txt')
-
-    CPU_time_per_one_case(base_dir_ER, n_samples, ensemble_sizes, quantiles,
-                          querylines, use_waves_timers, use_teuchos_timers,
-                          per_iteration, 'average_CPU_ER.txt',
-                          'average_speed_up_ER.txt')
-
-
-def plot_iter_all_ensemble_sizes(n_samples, iter, print_all=True):
-    import matplotlib.pyplot as plt
-    plt.figure()
-    plt.plot(list(range(0, n_samples)),
-             iter[0][:], 'bo', markersize=8, zorder=1)
-    ensemble_size = 8
-    for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-        plt.plot(list(range(ensemble_size * i, ensemble_size * (i + 1))),
-                 iter[1][ensemble_size * i:ensemble_size * (i + 1)],
-                 '-ro',
-                 linewidth=3,
-                 markersize=6,
-                 zorder=2)
-    if print_all:
-        ensemble_size = 16
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            plt.plot(list(range(ensemble_size * i, ensemble_size * (i + 1))),
-                     iter[2][ensemble_size * i:ensemble_size * (i + 1)],
-                     '-go',
-                     linewidth=2,
-                     markersize=4,
-                     zorder=2)
-        ensemble_size = 32
-        for i in range(0, int(np.ceil(n_samples * 1. / ensemble_size))):
-            plt.plot(list(range(ensemble_size * i, ensemble_size * (i + 1))),
-                     iter[3][ensemble_size * i:ensemble_size * (i + 1)],
-                     '-ko',
-                     linewidth=1,
-                     markersize=2,
-                     zorder=3)
-    plt.xlabel('sample')
-    plt.ylabel('Number of iterations to converge')
-
-
-def plot_iter_all(base_dir_ER, base_dir_NER, ensemble_sizes, n_samples):
-
-    iter_NER = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                            base_dir_NER, False)
-    iter_ER = read_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                           base_dir_ER, True)
-    plot_iter_all_ensemble_sizes(n_samples, iter_NER)
-    write_tex(n_samples, iter_NER, 'NER_conv.tex')
-    np.savetxt('NER_conv.txt', iter_NER)
-    np.savetxt('ordering_1.txt',
-               np.argsort(iter_NER[0, :]).astype(int),
-               fmt='%i')
-    np.savetxt('ordering_2.txt',
-               np.argsort(iter_NER[0][:]).astype(int),
-               fmt='%i')
-    plot_iter_all_ensemble_sizes(n_samples, iter_ER)
-    write_tex(n_samples, iter_ER, 'ER_conv.tex')
-    np.savetxt('ER_conv.txt', iter_ER)
-
-    order = np.argsort(iter_NER[0, :])
-
-    tmp = iter_NER[0][order]
-
-    plt.figure()
-    plt.plot(iter_NER[0][:])
-    plt.savefig('no_order_1.png', dpi=400)
-
-    iter_NER[0][:] = tmp
-
-    plt.figure()
-    plt.plot(tmp)
-    plt.savefig('order_1.png', dpi=400)
-
-    tmp = iter_ER[0][order]
-
-    plt.figure()
-    plt.plot(iter_ER[0][:])
-    plt.savefig('no_order_2.png', dpi=400)
-
-    iter_ER[0][:] = tmp
-
-    write_tex(n_samples, iter_NER, 'NER_conv_2.tex')
-    write_tex(n_samples, iter_ER, 'ER_conv_2.tex')
-
-    plt.figure()
-    plt.plot(tmp)
-    plt.savefig('order_2.png', dpi=400)
-
-
-def plot_AS_iter_all(base_dir_ER, base_dir_NER, ensemble_sizes, n_samples):
-
-    iter_NER = read_AS_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                               base_dir_NER, False)
-    iter_ER = read_AS_iter_all_ensemble_sizes(n_samples, ensemble_sizes,
-                                              base_dir_ER, True)
-    plot_iter_all_ensemble_sizes(n_samples, iter_NER)
-    write_tex(n_samples, iter_NER, 'AS_NER_conv.tex')
-    np.savetxt('AS_NER_conv.txt', iter_NER)
-    np.savetxt('AS_ordering_1.txt',
-               np.argsort(iter_NER[0, :]).astype(int),
-               fmt='%i')
-    np.savetxt('AS_ordering_2.txt',
-               np.argsort(iter_NER[0][:]).astype(int),
-               fmt='%i')
-    plot_iter_all_ensemble_sizes(n_samples, iter_ER)
-    write_tex(n_samples, iter_ER, 'AS_ER_conv.tex')
-    np.savetxt('AS_ER_conv.txt', iter_ER)
-
-    order = np.argsort(iter_NER[0, :])
-
-    tmp = iter_NER[0][order]
-
-    plt.figure()
-    plt.plot(iter_NER[0][:])
-    plt.savefig('AS_no_order_1.png', dpi=400)
-
-    iter_NER[0][:] = tmp
-
-    plt.figure()
-    plt.plot(tmp)
-    plt.savefig('AS_order_1.png', dpi=400)
-
-    tmp = iter_ER[0][order]
-
-    plt.figure()
-    plt.plot(iter_ER[0][:])
-    plt.savefig('AS_no_order_2.png', dpi=400)
-
-    iter_ER[0][:] = tmp
-
-    write_tex(n_samples, iter_NER, 'AS_NER_conv_2.tex')
-    write_tex(n_samples, iter_ER, 'AS_ER_conv_2.tex')
-
-    plt.figure()
-    plt.plot(tmp)
-    plt.savefig('AS_order_2.png', dpi=400)
-
-
-def all_post_process(grouped):
-    if grouped:
-        base_dir_NER = '/Volumes/HD_SONY/Thesis/Test_3/all_results_NER_grouped_2'
-        base_dir_ER = '/Volumes/HD_SONY/Thesis/Test_3/all_results_ER_grouped_2'
-        directory = 'grouped'
-    else:
-        base_dir_NER = '/Volumes/HD_SONY/Thesis/Test_3/all_results_NER_beam'
-        base_dir_ER = '/Volumes/HD_SONY/Thesis/Test_3/all_results_ER_beam'
-        directory = 'not_grouped'
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    N = 640
-    ensemble_sizes = [1, 8, 16, 32]
-
-    #compare_QoI(base_dir_NER, base_dir_ER, N, ensemble_sizes)
-    speedup_ensemble_reduction(base_dir_ER, base_dir_NER, N)
-
-    E = np.loadtxt(base_dir_NER + '/E_vec.txt')
-    p = np.loadtxt(base_dir_NER + '/p_vec.txt')
-
-    qoi_NER_8 = load_qoi(base_dir_NER, N, 8)
-    qoi_NER_16 = load_qoi(base_dir_NER, N, 16)
-    qoi_NER_32 = load_qoi(base_dir_NER, N, 32)
-
-    qoi_ER_8 = load_qoi(base_dir_ER, N, 8)
-    qoi_ER_16 = load_qoi(base_dir_ER, N, 16)
-    qoi_ER_32 = load_qoi(base_dir_ER, N, 32)
-
-    np.savetxt('qoi_NER_8.tex', qoi_NER_8)
-    '''
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')    
-    ax.scatter(E,p,qoi_ER_8)
-
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')    
-    ax.scatter(E,p,qoi_ER_16)   
-
-    fig = plt.figure()
-    ax = fig.gca(projection='3d')    
-    ax.scatter(E,p,qoi_ER_32)        
-    '''
-
-    plot_iter_all(base_dir_ER, base_dir_NER, ensemble_sizes, N)
-    plot_AS_iter_all(base_dir_ER, base_dir_NER, ensemble_sizes, N)
-
-    plt.figure()
-    for i in range(0, 8):
-        iter_indices, residuals = read_Belos(
-            base_dir_NER + '/1/' + str(i) + '/belos_out.txt', 1)
-        plt.semilogy(residuals)
-
-    x = np.array([0, 180])
-    y = np.array([1e-6, 1e-6])
-    plt.semilogy(x, y, 'k--')
-
-    plt.figure()
-    iter_indices, residuals = read_Belos(base_dir_NER + '/8/0/belos_out.txt',
-                                         8)
-    for i in range(0, 8):
-        plt.semilogy(residuals[:, i])
-
-    plt.semilogy(x, y, 'k--')
-
-    plt.figure()
-    iter_indices, residuals = read_Belos(base_dir_ER + '/8/0/belos_out.txt', 1)
-    plt.semilogy(residuals)
-    plt.semilogy(x, y, 'k--')
-    os.chdir('..')
-
-
-def main():
-    all_post_process(False)
-    all_post_process(True)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_4/1_cube.geo b/katoptron/thesis/test_4/1_cube.geo
deleted file mode 100644
index f3bd653dc53caf13979ed4c07cc1a4d9847530d4..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/1_cube.geo
+++ /dev/null
@@ -1,42 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-//nCx = 3;
-//nCy = 4;
-//nCz = 5;
-
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Transfinite Line {1,3} = nCx+1 Using Progression 1;
-Transfinite Line {2,4} = nCz+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nCy}; Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Point("Measure point 1") = {4};
-Physical Point("Measure point 2") = {1};
diff --git a/katoptron/thesis/test_4/1_cube.py b/katoptron/thesis/test_4/1_cube.py
deleted file mode 100644
index f3a7b39a291e4e759471538ea165119ceb3d28d6..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/1_cube.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-
-
-def model(msh, E, p, ensemble_size, case_name, max_iter, use_Prec=False):
-    comm, rank, size = m.utilities.import_MPI()
-    file_dir = os.path.dirname(__file__)
-
-    pbl = m.Problem(msh, comm)
-
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 0.,
-                ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 0.  # 10**(-8)
-    solverList['Maximum Iterations'] = int(max_iter)
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = use_Prec
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write vtk files'] = False
-
-    if use_Prec:
-        solverList['convert MueLu xml file'] = True
-        solverList["use xml file"] = True
-        solverList["MueLu xml file name"] = file_dir + '/prec_1.xml'
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    u.mkdir_MPI(case_name, comm, rank, size)
-    os.chdir(case_name)
-
-    if rank == 0:
-        f = open('msh_size.txt', 'w')
-        print(len(msh.nodes), file=f)
-        f.closed
-
-        np.savetxt('E.txt', E)
-        np.savetxt('p.txt', p)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    os.chdir('..')
-
-
-def read_msh(i=1):
-    comm, rank, size = m.utilities.import_MPI()
-
-    mesh_name = str('1_cube_' + str(i) + '.msh')
-
-    file_dir = os.path.dirname(__file__)
-    work_dir = os.getcwd()
-
-    if size != 1:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute(myrank=rank)
-    else:
-        msh = gmsh.MeshLoader(mesh_name, work_dir).execute()
-
-    return msh
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    args = parseargs()
-
-    os.chdir('MPI_' + str(size))
-    work_dir = os.getcwd()
-
-    E_mean = 1.
-    p_mean = 0.1
-
-    ensemble_sizes = [1, 8, 16, 32]
-
-    nCx = 9
-    nCy = 9
-
-    N = 100
-    tmp = np.logspace(1, 5, N, endpoint=True, dtype=int)
-    nCzs = tmp - 1
-
-    i = np.loadtxt(work_dir + '/i.txt', dtype=int)
-    max_iter = np.loadtxt(work_dir + '/m.txt', dtype=int)
-    nCz = nCzs[i]
-    msh = read_msh(i)
-    nThreads = u.Initialize_Kokkos()
-    for ensemble_size in ensemble_sizes:
-        E = E_mean * np.ones(ensemble_size)
-        p = p_mean * np.ones(ensemble_size)
-
-        directory_case_id = 'test_' + str(i) + '_s_' + str(
-            ensemble_size) + '_no_prec_m_' + str(max_iter)
-        model(msh,
-              E,
-              p,
-              ensemble_size,
-              directory_case_id,
-              max_iter,
-              use_Prec=False)
-        directory_case_id = 'test_' + str(i) + '_s_' + str(
-            ensemble_size) + '_prec_m_' + str(max_iter)
-        model(msh,
-              E,
-              p,
-              ensemble_size,
-              directory_case_id,
-              max_iter,
-              use_Prec=True)
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_4/blake.slurm.sh b/katoptron/thesis/test_4/blake.slurm.sh
deleted file mode 100644
index 0a9ac5cf7fa3f1e1e6a5f44080e95ade37d6539b..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/blake.slurm.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_4
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_4.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-n_MPI=1
-
-i_min=1
-i_max=201
-
-m_1=10
-m_2=100
-m_3=200
-
-nCx=100
-nCy=100
-
-base_dir=$(pwd)
-geo_file=${base_dir}/katoptron/thesis/test_4/1_cube.geo
-workspace_dir_0=${base_dir}/workspace/katoptron_thesis_test_4_1_cube
-workspace_dir=${workspace_dir_0}/MPI_${n_MPI}
-
-if [ ! -d ${workspace_dir_0} ] 
-then
-    mkdir ${workspace_dir_0}
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -d ${workspace_dir} ] 
-then    
-    mkdir ${workspace_dir}
-fi
-
-for (( i = $i_min; i < $i_max; ++i )); do
-  nCz=$(( 5*i ))
-  msh_file=${workspace_dir}/1_cube_${i}.msh
-  gmsh -3 ${geo_file} -setnumber nCx ${nCx} -setnumber nCy ${nCy} -setnumber nCz ${nCz} -o ${msh_file} -part ${n_MPI} -format msh22
-  echo $i &> ${workspace_dir}/i.txt
-  echo $m_1 &> ${workspace_dir}/m.txt
-  mpirun -np ${n_MPI} python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_2 &> ${workspace_dir}/m.txt
-  mpirun -np ${n_MPI} python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_3 &> ${workspace_dir}/m.txt
-  mpirun -np ${n_MPI} python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py    
-done
\ No newline at end of file
diff --git a/katoptron/thesis/test_4/blake_N_1.slurm.sh b/katoptron/thesis/test_4/blake_N_1.slurm.sh
deleted file mode 100644
index 337bfeeb70ebe41e0a58a614f5721e4c73eb9220..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/blake_N_1.slurm.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_4
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_4.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-n_MPI=2
-
-i_min=1
-i_max=201
-
-m_1=10
-m_2=100
-m_3=200
-
-nCx=100
-nCy=100
-
-base_dir=$(pwd)
-geo_file=${base_dir}/katoptron/thesis/test_4/1_cube.geo
-workspace_dir_0=${base_dir}/workspace/katoptron_thesis_test_4_1_cube
-workspace_dir=${workspace_dir_0}/MPI_${n_MPI}
-
-if [ ! -d ${workspace_dir_0} ] 
-then
-    mkdir ${workspace_dir_0}
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -d ${workspace_dir} ] 
-then    
-    mkdir ${workspace_dir}
-fi
-
-for (( i = $i_min; i < $i_max; ++i )); do
-  nCz=$(( 5*i ))
-  msh_file=${workspace_dir}/1_cube_${i}.msh
-  gmsh -3 ${geo_file} -setnumber nCx ${nCx} -setnumber nCy ${nCy} -setnumber nCz ${nCz} -o ${msh_file} -part ${n_MPI} -format msh22
-  echo $i &> ${workspace_dir}/i.txt
-  echo $m_1 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_2 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_3 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-done
diff --git a/katoptron/thesis/test_4/blake_N_2.slurm.sh b/katoptron/thesis/test_4/blake_N_2.slurm.sh
deleted file mode 100644
index 96d5b76524a2aefb5004d37ad35557943de7b472..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/blake_N_2.slurm.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_4
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 2
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_4.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-n_MPI=4
-
-i_min=1
-i_max=201
-
-m_1=10
-m_2=100
-m_3=200
-
-nCx=100
-nCy=100
-
-base_dir=$(pwd)
-geo_file=${base_dir}/katoptron/thesis/test_4/1_cube.geo
-workspace_dir_0=${base_dir}/workspace/katoptron_thesis_test_4_1_cube
-workspace_dir=${workspace_dir_0}/MPI_${n_MPI}
-
-if [ ! -d ${workspace_dir_0} ] 
-then
-    mkdir ${workspace_dir_0}
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -d ${workspace_dir} ] 
-then    
-    mkdir ${workspace_dir}
-fi
-
-for (( i = $i_min; i < $i_max; ++i )); do
-  nCz=$(( 5*i ))
-  msh_file=${workspace_dir}/1_cube_${i}.msh
-  gmsh -3 ${geo_file} -setnumber nCx ${nCx} -setnumber nCy ${nCy} -setnumber nCz ${nCz} -o ${msh_file} -part ${n_MPI} -format msh22
-  echo $i &> ${workspace_dir}/i.txt
-  echo $m_1 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_2 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_3 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py  
-done
diff --git a/katoptron/thesis/test_4/blake_N_4.slurm.sh b/katoptron/thesis/test_4/blake_N_4.slurm.sh
deleted file mode 100644
index ae301ecc46cb470853d21d55d3bab3e125aab310..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/blake_N_4.slurm.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_4
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 4
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_4.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-n_MPI=8
-
-i_min=1
-i_max=201
-
-m_1=10
-m_2=100
-m_3=200
-
-nCx=100
-nCy=100
-
-base_dir=$(pwd)
-geo_file=${base_dir}/katoptron/thesis/test_4/1_cube.geo
-workspace_dir_0=${base_dir}/workspace/katoptron_thesis_test_4_1_cube
-workspace_dir=${workspace_dir_0}/MPI_${n_MPI}
-
-if [ ! -d ${workspace_dir_0} ] 
-then
-    mkdir ${workspace_dir_0}
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -d ${workspace_dir} ] 
-then    
-    mkdir ${workspace_dir}
-fi
-
-for (( i = $i_min; i < $i_max; ++i )); do
-  nCz=$(( 5*i ))
-  msh_file=${workspace_dir}/1_cube_${i}.msh
-  gmsh -3 ${geo_file} -setnumber nCx ${nCx} -setnumber nCy ${nCy} -setnumber nCz ${nCz} -o ${msh_file} -part ${n_MPI} -format msh22
-  echo $i &> ${workspace_dir}/i.txt
-  echo $m_1 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_2 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_3 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-done
diff --git a/katoptron/thesis/test_4/blake_N_8.slurm.sh b/katoptron/thesis/test_4/blake_N_8.slurm.sh
deleted file mode 100644
index c361eec1dfc54321b7643bb9d7c7a85bd7abebab..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/blake_N_8.slurm.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_4
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 8
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_4.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-export MKL_NUM_THREADS=${OMP_NUM_THREADS}
-
-n_MPI=16
-
-i_min=1
-i_max=201
-
-m_1=10
-m_2=100
-m_3=200
-
-nCx=100
-nCy=100
-
-base_dir=$(pwd)
-geo_file=${base_dir}/katoptron/thesis/test_4/1_cube.geo
-workspace_dir_0=${base_dir}/workspace/katoptron_thesis_test_4_1_cube
-workspace_dir=${workspace_dir_0}/MPI_${n_MPI}
-
-if [ ! -d ${workspace_dir_0} ] 
-then
-    mkdir ${workspace_dir_0}
-    mkdir ${workspace_dir}
-fi
-
-if [ ! -d ${workspace_dir} ] 
-then    
-    mkdir ${workspace_dir}
-fi
-
-for (( i = $i_min; i < $i_max; ++i )); do
-  nCz=$(( 5*i ))
-  msh_file=${workspace_dir}/1_cube_${i}.msh
-  gmsh -3 ${geo_file} -setnumber nCx ${nCx} -setnumber nCy ${nCy} -setnumber nCz ${nCz} -o ${msh_file} -part ${n_MPI} -format msh22
-  echo $i &> ${workspace_dir}/i.txt
-  echo $m_1 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_2 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-  echo $m_3 &> ${workspace_dir}/m.txt
-  mpirun -npersocket 1 python run.py -k ${OMP_NUM_THREADS} katoptron/thesis/test_4/1_cube.py
-done
diff --git a/katoptron/thesis/test_4/prec.xml b/katoptron/thesis/test_4/prec.xml
deleted file mode 100644
index 7fcef90cbfcbb994e980439167e31c4e5d441a8f..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/prec.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="5"/>
-  <Parameter name="smoother: type" type="string" value="RELAXATION"/>
-  <ParameterList name="smoother: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-    <!-- <Parameter name="relaxation: backward mode" type="bool" value="true"/> -->
-  </ParameterList>
-  <Parameter name="coarse: type" type="string" value="Klu"/>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-  <Parameter name="tentative: calculate qr" type="bool" value="false"/>
-  <Parameter name="number of equations"   type="int"  value="3"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/thesis/test_4/prec_1.xml b/katoptron/thesis/test_4/prec_1.xml
deleted file mode 100644
index b2bd91f1eda70e1a3617aa725ae9d1a75ff0720a..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_4/prec_1.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="1"/>
-  <Parameter name="coarse: type" type="string" value="RELAXATION"/>
-  <ParameterList name="coarse: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>    
-  </ParameterList>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="number of equations"   type="int"  value="3"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/thesis/test_5/1_bar.py b/katoptron/thesis/test_5/1_bar.py
deleted file mode 100644
index f33abe96dbbc51e12d9f611d1660f1f97fd816e8..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_5/1_bar.py
+++ /dev/null
@@ -1,220 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from scipy.sparse.linalg import spsolve
-from scipy.sparse.linalg import eigs
-from scipy.linalg import eig
-from scipy.sparse import spdiags
-import numpy as np
-import matplotlib.pyplot as plt
-import katoptron.convergence as c
-
-
-def build_K(n, L, E, A, sym=True):
-    h = (L / (n - 1))
-    diag_data = A * E * ((1 / h**2)) * 2. * np.ones((n, ))
-    diag_data[0] = 1.
-    diag_data[-1] = A * E * ((1 / h**2)) * 1.
-    off_data_1 = A * E * ((1 / h**2)) * (-1) * np.ones((n, ))
-    if sym:
-        off_data_1[0:1] = 0.
-    off_data_2 = A * E * ((1 / h**2)) * (-1) * np.ones((n, ))
-    off_data_2[0:2] = 0.
-
-    data = np.array([diag_data, off_data_1, off_data_2])
-    diags = np.array([0, -1, 1])
-    K = spdiags(data, diags, n, n).tocsr()
-    return K
-
-
-def analytical_eigenfunctions(n, L, E, A, n_eigenfunctions=5):
-    if n < n_eigenfunctions + 1:
-        n_eigenfunctions = n - 1
-    values = np.zeros((n, ))
-    vecs = np.zeros((n, n_eigenfunctions))
-
-    h = (L / (n - 1))
-    x = np.linspace(0, L, n)
-
-    c = np.arange(0, n_eigenfunctions, 1) + 0.5
-    values = A * E * (c * 3.14 / L)**2
-
-    for i in range(0, n_eigenfunctions):
-        vecs[:, i] = np.sin((c[i] * np.pi * x / L))
-        norm = np.linalg.norm(vecs[:, i])
-        vecs[:, i] /= norm
-    return values, vecs
-
-
-def numerical_eigenfunctions(n, L, E, A, n_eigenfunctions=5):
-    if n < n_eigenfunctions + 1:
-        n_eigenfunctions = n - 1
-    K = build_K(n, L, E, A)
-
-    vals, vecs = eig(K.toarray())
-    return np.real(vals[0:n_eigenfunctions]), vecs[:, 0:n_eigenfunctions]
-
-
-def omegas_lambdas_nf(n, L, nE, A, nf):
-    N = len(nE)
-    norm = 0.
-    for i in range(0, N):
-        norm += np.linalg.norm(nf[i])**2
-    norm = np.sqrt(norm)
-    lambdas_all = np.array([])
-    omegas_all = np.array([])
-    for i in range(0, N):
-        nf_tmp = (nf[i] / norm)
-        lambdas, vecs = analytical_eigenfunctions(n, L, nE[i], A, n - 1)
-        print(vecs)
-        c = np.dot(vecs.T, nf_tmp)
-
-        omegas = np.zeros((len(c), ))
-        for i in range(0, len(omegas)):
-            omegas[i] = np.linalg.norm(c[i])**2
-
-        lambdas_all = np.append(lambdas_all, lambdas)
-        omegas_all = np.append(omegas_all, omegas)
-
-    indices = np.argsort(lambdas_all)
-    lambdas = lambdas_all[indices]
-    omegas = omegas_all[indices]
-
-    return lambdas, omegas
-
-
-def omegas_lambdas_f(n, L, E, A, f):
-    lambdas, vecs = analytical_eigenfunctions(n, L, E, A, n - 1)
-    norm = np.linalg.norm(f)
-    f_tmp = (f / norm)
-    c = np.dot(vecs.T, f_tmp)
-
-    omegas = np.zeros((len(c), ))
-    for i in range(0, len(omegas)):
-        omegas[i] = np.linalg.norm(c[i])**2
-
-    return lambdas, omegas
-
-
-def build_f(n, L, lF, F):
-    h = (L / (n - 1))
-    iF = int(np.round((lF / h)) + 1)
-    f = np.zeros((n, ))
-    f[iF] = (F / h)
-    return f
-
-
-def solve_Kf(n, L, lF, F, E, A):
-    sym = True
-
-    K = build_K(n, L, E, A, sym)
-    f = build_f(n, L, lF, F)
-
-    u = spsolve(K, f)
-    return u
-
-
-def write_on_disk(name, res):
-    i_max = len(res)
-    for i in range(0, i_max):
-        if res[i] == 0.:
-            i_max = i + 1
-            break
-    tmp = np.zeros((i_max, 2))
-    tmp[:, 1] = res[0:i_max]
-    tmp[:, 0] = np.arange(0, i_max)
-    np.savetxt(name, tmp)
-
-
-def main():
-    n = 7
-    L = 1.
-    E_1 = 1.
-    E_2 = 1.5
-    A = 1.
-    F = 1.
-
-    x = np.linspace(0, L, n)
-
-    f_1 = build_f(n, L, 0.5, F)
-    f_2 = build_f(n, L, 0.8, F)
-
-    print(f_1)
-    print(f_2)
-
-    lambdas_11, omegas_11 = omegas_lambdas_f(n, L, E_1, A, f_1)
-    lambdas_12, omegas_12 = omegas_lambdas_f(n, L, E_1, A, f_2)
-
-    lambdas_21, omegas_21 = omegas_lambdas_f(n, L, E_2, A, f_1)
-    lambdas_22, omegas_22 = omegas_lambdas_f(n, L, E_2, A, f_2)
-
-    residual_11 = c.compute_convergence_serial_normal(20, n - 1, omegas_11,
-                                                      lambdas_11)
-    residual_12 = c.compute_convergence_serial_normal(20, n - 1, omegas_12,
-                                                      lambdas_12)
-    residual_21 = c.compute_convergence_serial_normal(20, n - 1, omegas_21,
-                                                      lambdas_21)
-    residual_22 = c.compute_convergence_serial_normal(20, n - 1, omegas_22,
-                                                      lambdas_22)
-
-    lambdas_1, omegas_1 = omegas_lambdas_nf(n, L, [E_1, E_1], A, [f_1, f_2])
-    lambdas_2, omegas_2 = omegas_lambdas_nf(n, L, [E_2, E_2], A, [f_1, f_2])
-    lambdas_3, omegas_3 = omegas_lambdas_nf(n, L, [E_1, E_2], A, [f_1, f_1])
-    lambdas_4, omegas_4 = omegas_lambdas_nf(n, L, [E_1, E_2], A, [f_2, f_2])
-    lambdas_5, omegas_5 = omegas_lambdas_nf(n, L, [E_1, E_2], A, [f_1, f_2])
-
-    residual_1 = c.compute_convergence_serial_normal(20, 2 * (n - 1), omegas_1,
-                                                     lambdas_1)
-    residual_2 = c.compute_convergence_serial_normal(20, 2 * (n - 1), omegas_2,
-                                                     lambdas_2)
-    residual_3 = c.compute_convergence_serial_normal(20, 2 * (n - 1), omegas_3,
-                                                     lambdas_3)
-    residual_4 = c.compute_convergence_serial_normal(20, 2 * (n - 1), omegas_4,
-                                                     lambdas_4)
-    residual_5 = c.compute_convergence_serial_normal(20, 2 * (n - 1), omegas_5,
-                                                     lambdas_5)
-
-    write_on_disk('res_11.txt', residual_11)
-    write_on_disk('res_12.txt', residual_12)
-    write_on_disk('res_21.txt', residual_21)
-    write_on_disk('res_22.txt', residual_22)
-    write_on_disk('res_1.txt', residual_1)
-    write_on_disk('res_2.txt', residual_2)
-    write_on_disk('res_3.txt', residual_3)
-    write_on_disk('res_4.txt', residual_4)
-    write_on_disk('res_5.txt', residual_5)
-
-    plt.figure()
-    plt.semilogy(residual_11)
-    plt.semilogy(residual_22)
-    plt.semilogy(residual_1)
-    '''
-    plt.figure()
-    plt.subplot(221)
-    plt.plot(lambdas_11, '-*')
-    plt.subplot(222)
-    plt.plot(lambdas_12, '-*')
-    plt.subplot(223)
-    plt.plot(lambdas_21, '-*')
-    plt.subplot(224)
-    plt.plot(lambdas_22, '-*')
-    plt.figure()
-    plt.subplot(221)
-    plt.plot(omegas_11, '-*')
-    plt.subplot(222)
-    plt.plot(omegas_12, '-*')
-    plt.subplot(223)
-    plt.plot(omegas_21, '-*')
-    plt.subplot(224)
-    plt.plot(omegas_22, '-*')
-
-    plt.figure()
-    plt.plot(lambdas_44, '-*')
-    plt.figure()
-    plt.plot(omegas_44, '-*')
-    '''
-    plt.show()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_5/laplacian.py b/katoptron/thesis/test_5/laplacian.py
deleted file mode 100644
index d64a9e21e63e10c13bedd6ee21b93f2d3c2040e0..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_5/laplacian.py
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-from scipy.sparse.linalg import spsolve
-from scipy.sparse.linalg import eigs
-from scipy.linalg import eig
-from scipy.sparse import spdiags
-import numpy as np
-import matplotlib.pyplot as plt
-import katoptron.convergence as c
-
-
-def analytical_eigenvectors(n, kappa):
-    values = np.zeros((n, ))
-    vecs = np.zeros((n, n))
-
-    h = 1. / (n + 1)
-
-    k = np.arange(1, n + 1, 1)
-    values = 2 * kappa * (1 - np.cos(k * h * np.pi))
-
-    for i in range(0, n):
-        vecs[i, :] = np.sin((i + 1) * k * h * np.pi)
-
-    for i in range(0, n):
-        norm = np.linalg.norm(vecs[:, i])
-        vecs[:, i] /= norm
-    return values, vecs
-
-
-def omegas_lambdas_nf(n, nkappa, nf):
-    N = len(nkappa)
-    norm = 0.
-    for i in range(0, N):
-        norm += np.linalg.norm(nf[i])**2
-    norm = np.sqrt(norm)
-    lambdas_all = np.array([])
-    omegas_all = np.array([])
-    for i in range(0, N):
-        nf_tmp = (nf[i] / norm)
-        lambdas, vecs = analytical_eigenvectors(n, nkappa[i])
-        c = np.dot(vecs.T, nf_tmp)
-
-        omegas = np.zeros((len(c), ))
-        for i in range(0, len(omegas)):
-            omegas[i] = np.linalg.norm(c[i])**2
-
-        lambdas_all = np.append(lambdas_all, lambdas)
-        omegas_all = np.append(omegas_all, omegas)
-
-    indices = np.argsort(lambdas_all)
-    lambdas = lambdas_all[indices]
-    omegas = omegas_all[indices]
-
-    return lambdas, omegas
-
-
-def omegas_lambdas_f(n, kappa, f):
-    lambdas, vecs = analytical_eigenvectors(n, kappa)
-    norm = np.linalg.norm(f)
-    f_tmp = (f / norm)
-    c = np.dot(vecs.T, f_tmp)
-
-    omegas = np.zeros((len(c), ))
-    for i in range(0, len(omegas)):
-        omegas[i] = np.linalg.norm(c[i])**2
-
-    return lambdas, omegas
-
-
-def write_on_disk(name, res):
-    i_max = len(res)
-    for i in range(0, i_max):
-        if res[i] == 0.:
-            i_max = i + 1
-            break
-    tmp = np.zeros((i_max, 2))
-    tmp[:, 1] = res[0:i_max]
-    tmp[:, 0] = np.arange(0, i_max)
-    np.savetxt(name, tmp)
-
-
-def main():
-    n = 6
-    kappa_1 = 1.
-    kappa_2 = 1.5
-
-    f_1 = np.zeros((n, ))
-    f_2 = np.zeros((n, ))
-
-    f_1[3] = 1.
-    f_2[-1] = 1.
-
-    print(f_1)
-    print(f_2)
-
-    lambdas_11, omegas_11 = omegas_lambdas_f(n, kappa_1, f_1)
-    lambdas_12, omegas_12 = omegas_lambdas_f(n, kappa_1, f_2)
-
-    lambdas_21, omegas_21 = omegas_lambdas_f(n, kappa_2, f_1)
-    lambdas_22, omegas_22 = omegas_lambdas_f(n, kappa_2, f_2)
-
-    print(np.round(lambdas_11, 3))
-    print(np.round(omegas_11, 3))
-
-    print(np.round(lambdas_12, 3))
-    print(np.round(omegas_12, 3))
-
-    print(np.round(lambdas_21, 3))
-    print(np.round(omegas_21, 3))
-
-    print(np.round(lambdas_22, 3))
-    print(np.round(omegas_22, 3))
-
-    residual_11 = c.compute_convergence_serial_normal(20, n, omegas_11,
-                                                      lambdas_11)
-    residual_12 = c.compute_convergence_serial_normal(20, n, omegas_12,
-                                                      lambdas_12)
-    residual_21 = c.compute_convergence_serial_normal(20, n, omegas_21,
-                                                      lambdas_21)
-    residual_22 = c.compute_convergence_serial_normal(20, n, omegas_22,
-                                                      lambdas_22)
-
-    lambdas_1, omegas_1 = omegas_lambdas_nf(n, [kappa_1, kappa_1], [f_1, f_2])
-    lambdas_2, omegas_2 = omegas_lambdas_nf(n, [kappa_2, kappa_2], [f_1, f_2])
-    lambdas_3, omegas_3 = omegas_lambdas_nf(n, [kappa_1, kappa_2], [f_1, f_1])
-    lambdas_4, omegas_4 = omegas_lambdas_nf(n, [kappa_1, kappa_2], [f_2, f_2])
-    lambdas_5, omegas_5 = omegas_lambdas_nf(n, [kappa_1, kappa_2], [f_1, f_2])
-
-    residual_1 = c.compute_convergence_serial_normal(20, 2 * n, omegas_1,
-                                                     lambdas_1)
-    residual_2 = c.compute_convergence_serial_normal(20, 2 * n, omegas_2,
-                                                     lambdas_2)
-    residual_3 = c.compute_convergence_serial_normal(20, 2 * n, omegas_3,
-                                                     lambdas_3)
-    residual_4 = c.compute_convergence_serial_normal(20, 2 * n, omegas_4,
-                                                     lambdas_4)
-    residual_5 = c.compute_convergence_serial_normal(20, 2 * n, omegas_5,
-                                                     lambdas_5)
-
-    write_on_disk('res_11.txt', residual_11)
-    write_on_disk('res_12.txt', residual_12)
-    write_on_disk('res_21.txt', residual_21)
-    write_on_disk('res_22.txt', residual_22)
-    write_on_disk('res_1.txt', residual_1)
-    write_on_disk('res_2.txt', residual_2)
-    write_on_disk('res_3.txt', residual_3)
-    write_on_disk('res_4.txt', residual_4)
-    write_on_disk('res_5.txt', residual_5)
-
-    print(np.round(lambdas_1, 3))
-    print(np.round(omegas_1, 3))
-    print(np.round(lambdas_2, 3))
-    print(np.round(omegas_2, 3))
-    print(np.round(lambdas_3, 3))
-    print(np.round(omegas_3, 3))
-    print(np.round(lambdas_4, 3))
-    print(np.round(omegas_4, 3))
-    print(np.round(lambdas_5, 3))
-    print(np.round(omegas_5, 3))
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_6/1_cube.geo b/katoptron/thesis/test_6/1_cube.geo
deleted file mode 100644
index f3bd653dc53caf13979ed4c07cc1a4d9847530d4..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_6/1_cube.geo
+++ /dev/null
@@ -1,42 +0,0 @@
-// $Id$
-// fichier de donnees gmsh
-
-C1 = 10;
-//nCx = 3;
-//nCy = 4;
-//nCz = 5;
-
-lc = 1;
-
-Point(1) = { 0,   0, 0, lc};
-Point(2) = { C1,   0, 0, lc};
-Point(3) = { C1, 0, C1, lc};
-Point(4) = { 0, 0, C1, lc};
-
-Line(1) = {1, 2};
-Line(2) = {2, 3};
-Line(3) = {3, 4};
-Line(4) = {4, 1};
-
-Transfinite Line {1,3} = nCx+1 Using Progression 1;
-Transfinite Line {2,4} = nCz+1 Using Progression 1;
-
-Line Loop(11) = {1,2,3,4};
-Plane Surface(12) = {11};
-Transfinite Surface {12};
-Recombine Surface {12};
-
-Extrude {0, C1, 0}
-{
-  Surface{12}; Layers{nCy}; Recombine;
-}
-
-// physical entities
-
-Physical Volume("Body 1") = {1};
-
-Physical Surface("Surf 1 1") = {-21};
-Physical Surface("Surf 1 2") = {-29};
-
-Physical Point("Measure point 1") = {4};
-Physical Point("Measure point 2") = {1};
diff --git a/katoptron/thesis/test_6/1_cube.py b/katoptron/thesis/test_6/1_cube.py
deleted file mode 100644
index 32062406b3fafe7eb91589004a73af152201feb3..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_6/1_cube.py
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import threading
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import katoptron.utilities as u
-from PyTrilinos import Teuchos
-import shlex
-import subprocess
-import os
-import numpy as np
-import tarfile
-import glob
-from fwk.wutils import parseargs
-
-
-def model(msh,
-          E,
-          p,
-          ensemble_size,
-          case_name,
-          work_dir,
-          max_iter,
-          comm,
-          use_Prec=False):
-    rank = comm.rank
-    siz = comm.size
-    file_dir = os.path.dirname(__file__)
-
-    pbl = m.Problem(msh, comm)
-
-    nu = 0.2 * np.ones(ensemble_size)
-    k = 0.114
-    d = 0.
-
-    zero = np.zeros(ensemble_size)
-    m.Medium(pbl, "Body 1", "test", E, nu, k, d)
-
-    m.Dirichlet(pbl, "Surf 1 1", "Clamped", 1, 0., 1, 0., 1, 0., 1, 0.,
-                ensemble_size)
-    m.Neumann(pbl, "Surf 1 2", "heat fluxes", 0, zero, 0, zero, 1, p, 0, zero,
-              ensemble_size)
-
-    solverList = Teuchos.ParameterList()
-    solverList['Ensemble Convergence Tolerance'] = 0.  # 10**(-8)
-    solverList['Maximum Iterations'] = max_iter
-    solverList['Verbosity'] = 33
-    solverList['Flexible Gmres'] = False
-    solverList['Output Style'] = 1
-    solverList['Output Frequency'] = 1
-
-    solverList['Use preconditioner'] = use_Prec
-
-    solverList['type'] = "BlockGmres"
-    solverList['Maximum active set iteration'] = 1
-
-    solverList['Print Teuchos timers'] = True
-    solverList['Write vtk files'] = False
-
-    if use_Prec:
-        solverList['convert MueLu xml file'] = True
-        solverList["use xml file"] = True
-        solverList["MueLu xml file name"] = file_dir + '/prec.xml'
-
-    slv = m.IterativeSolver(pbl, solverList, 3, ensemble_size)
-
-    if not os.path.exists(case_name):
-        os.makedirs(case_name)
-    os.chdir(case_name)
-
-    if rank == 0:
-        f = open('msh_size.txt', 'w')
-        print(len(msh.nodes), file=f)
-        f.closed
-
-        np.savetxt('E.txt', E)
-        np.savetxt('p.txt', p)
-
-    slv.start()
-
-    if rank == 0:
-        f = open('timers.txt', 'w')
-        print(slv.getTimers(), file=f)
-        f.closed
-
-    os.chdir(work_dir)
-
-
-def one_model(test_id, ensemble_size, rank, work_dir, msh, E, p, k, max_iter,
-              comm):
-    directory_case_id = work_dir + '/test_' + str(test_id) + '_s_' + str(
-        ensemble_size) + '_rank_' + str(rank)
-    model(msh,
-          E,
-          p,
-          ensemble_size,
-          directory_case_id,
-          work_dir,
-          k,
-          max_iter,
-          comm,
-          use_Prec=True)
-
-
-def main():
-    comm, rank, size = m.utilities.import_MPI()
-
-    group_size = 1
-    color = int(np.floor((rank / group_size)))
-    key = rank
-
-    newcomm = comm.Split(color, key)
-
-    args = parseargs()
-    work_dir = os.getcwd()
-
-    msh_name = '1_cube.msh'
-
-    E_mean = 1.
-    p_mean = 0.1
-
-    ensemble_size = int(os.getenv('ensemble_size', 1))
-    test_id = int(os.getenv('test_id', 1))
-    max_iter = int(os.getenv('max_iter', 100))
-
-    msh = gmsh.MeshLoader(msh_name, work_dir).execute()
-
-    E = E_mean * np.ones(ensemble_size)
-    p = p_mean * np.ones(ensemble_size)
-
-    directory_case_id = 'test_' + str(test_id) + '_s_' + str(
-        ensemble_size) + '_rank_' + str(rank)
-
-    nThreads = u.Initialize_Kokkos()
-    model(msh,
-          E,
-          p,
-          ensemble_size,
-          directory_case_id,
-          work_dir,
-          max_iter,
-          newcomm,
-          use_Prec=True)
-
-    u.Finalize_Kokkos()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/thesis/test_6/blake.slurm.sh b/katoptron/thesis/test_6/blake.slurm.sh
deleted file mode 100644
index 803f3cf1a9564fcb38c93c7e91d17f9bb4db9c16..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_6/blake.slurm.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-# Submission script for Blake
-#SBATCH --job-name=test_6
-#SBATCH --time=41:00:00 # hh:mm:ss
-#
-#SBATCH -N 1
-#SBATCH -p blake
-#
-#SBATCH --comment=test
-#SBATCH --output=workspace/test_6.%j.out
-
-. ~/.bash_profile $SLURM_SUBMIT_HOST
-
-export MKL_DYNAMIC=TRUE
-export OMP_DYNAMIC=FALSE
-export OMP_NUM_THREADS=24
-export KMP_HW_SUBSET=24c,1t
-export KMP_AFFINITY=compact
-
-base_dir=$(pwd)
-geo_file=${base_dir}/katoptron/thesis/test_6/1_cube.geo
-msh_file=${base_dir}/workspace/katoptron_thesis_test_6_1_cube/1_cube.msh
-
-if [ ! -d ${base_dir}/workspace/katoptron_thesis_test_6_1_cube ] 
-then
-    mkdir ${base_dir}/workspace/katoptron_thesis_test_6_1_cube
-fi
-
-workspace/thesis_tests_test_6_1_cube
-
-gmsh -3 -format msh2 -setnumber nCx 49 -setnumber nCy 49 -setnumber nCz 49 -o ${msh_file} ${geo_file} -format msh22
-
-export max_iter=200
-
-export test_id=1
-export ensemble_size=1
-export MKL_NUM_THREADS=1
-export OMP_NUM_THREADS=1
-python run.py -k 1 katoptron/thesis/test_6/1_cube.py
-
-export test_id=2
-export ensemble_size=1
-export MKL_NUM_THREADS=24
-export OMP_NUM_THREADS=24
-python run.py -k 24 katoptron/thesis/test_6/1_cube.py
-
-export test_id=3
-export ensemble_size=8
-export MKL_NUM_THREADS=24
-export OMP_NUM_THREADS=24
-python run.py -k 24 katoptron/thesis/test_6/1_cube.py
-
-export test_id=4
-export ensemble_size=1
-export MKL_NUM_THREADS=1
-export OMP_NUM_THREADS=1
-#mpirun -npersocket 1 python run.py -k 1 katoptron/thesis/test_6/1_cube.py
-#mpirun --report-bindings --bind-to core --map-by ppr:24:socket:pe=1 python run.py -k 1 katoptron/thesis/test_6/1_cube.py &> log.txt
-mpirun --bind-to core --map-by ppr:24:socket:pe=1 python run.py -k 1 katoptron/thesis/test_6/1_cube.py
diff --git a/katoptron/thesis/test_6/prec.xml b/katoptron/thesis/test_6/prec.xml
deleted file mode 100644
index 7fcef90cbfcbb994e980439167e31c4e5d441a8f..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_6/prec.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="5"/>
-  <Parameter name="smoother: type" type="string" value="RELAXATION"/>
-  <ParameterList name="smoother: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>
-    <!-- <Parameter name="relaxation: backward mode" type="bool" value="true"/> -->
-  </ParameterList>
-  <Parameter name="coarse: type" type="string" value="Klu"/>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>
-  <Parameter name="tentative: calculate qr" type="bool" value="false"/>
-  <Parameter name="number of equations"   type="int"  value="3"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/thesis/test_6/prec_1.xml b/katoptron/thesis/test_6/prec_1.xml
deleted file mode 100644
index b2bd91f1eda70e1a3617aa725ae9d1a75ff0720a..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_6/prec_1.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- Define MueLu preconditioner -->
-<!-- Note: if you use Tpetra you may have to change it to MueLu-Tpetra -->
-<!--       here and above where you set the preconditioner -->
-<ParameterList name="MueLu">
-  <Parameter name="max levels"   type="int"  value="1"/>
-  <Parameter name="coarse: type" type="string" value="RELAXATION"/>
-  <ParameterList name="coarse: params">
-    <Parameter name="relaxation: type" type="string" value="MT Gauss-Seidel"/>
-    <Parameter name="relaxation: sweeps" type="int" value="5"/>
-    <Parameter name="relaxation: damping factor" type="double" value="0.9"/>    
-  </ParameterList>
-  <Parameter name="verbosity" type="string" value="extreme"/>
-  <Parameter name="number of equations"   type="int"  value="3"/>
-</ParameterList>
-<!-- end "MueLu" -->
-	      
diff --git a/katoptron/thesis/test_6/speedup.py b/katoptron/thesis/test_6/speedup.py
deleted file mode 100644
index 6e1bbaf1ff4ffa81e5df75b750fd019095bacb9f..0000000000000000000000000000000000000000
--- a/katoptron/thesis/test_6/speedup.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-
-
-
-from katoptron.speedup import *
-import matplotlib.pyplot as plt
-import os
-
-
-def read_timers_all(file_base_dir, querylines, use_waves_timers,
-                    use_teuchos_timers):
-
-    timers = np.zeros((len(querylines), ))
-
-    for k in use_waves_timers:
-        timers[int(k)] = read_timers(file_base_dir + 'timers.txt',
-                                     [querylines[int(k)]])[0]
-    for k in use_teuchos_timers:
-        timers[int(k)] = read_teuchos_timers(
-            file_base_dir + 'teuchos_timers.txt', [querylines[int(k)]])[0]
-
-    return timers
-
-
-def CPU_time_per_one_case(base_dir,
-                          quantiles,
-                          querylines,
-                          use_waves_timers,
-                          use_teuchos_timers,
-                          filename_CPU,
-                          filename_speed_up,
-                          total_id,
-                          write_id,
-                          block_id,
-                          mult=1.):
-
-    timers = read_timers_all(base_dir, querylines, use_waves_timers,
-                             use_teuchos_timers)
-
-    current_timer = timers*mult
-
-    f = open(filename_CPU, 'w')
-    print(timers.shape, file=f)
-
-    for i in range(0, len(timers)):
-        print(querylines[i], file=f)
-        string = ''
-        if i == total_id:
-            current_timer[i] -= timers[write_id]
-            current_timer[i] -= timers[block_id]
-
-        string = string + str(round(current_timer[i], 3)) + ' & '
-        print(string, file=f)
-        print(' ', file=f)
-    f.closed
-
-    return current_timer
-
-
-def analysis_one_case(directory,
-                      base_dir,
-                      quantiles,
-                      querylines,
-                      use_waves_timers,
-                      use_teuchos_timers,
-                      mult=1.):
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    os.chdir(directory)
-
-    current_timer = CPU_time_per_one_case(base_dir,
-                                          quantiles,
-                                          querylines,
-                                          use_waves_timers,
-                                          use_teuchos_timers,
-                                          'average_CPU.txt',
-                                          'average_speed_up.txt',
-                                          7,
-                                          8,
-                                          9,
-                                          mult=mult)
-
-    os.chdir('..')
-    return current_timer
-
-
-def main():
-    import matplotlib.pyplot as plt
-
-    file_dir = os.path.dirname(__file__)
-
-    quantiles = [0, 0.33, 0.5, 0.66, 1.]
-
-    querylines = [
-        'computeMatrices',
-        'MueLu: Hierarchy: Setup (total)',
-        'Belos: DGKS[2]: Orthogonalization',
-        'Belos: Operation Op*x',
-        'Belos: Operation Prec*x',
-        'MueLu: Hierarchy: Solve : coarse (level=0)',
-        'Belos: PseudoBlockGmresSolMgr total solve time',
-        'total',
-        'write results',
-        'create the block matrix'
-    ]
-    use_waves_timers = np.array([0, 7, 8, 9], dtype=int)
-    use_teuchos_timers = np.array(
-        [1, 2, 3, 4, 5, 6],
-        dtype=int)
-
-    base_dir = file_dir + \
-        '/../../../workspace/katoptron_thesis_test_6_1_cube/test_1_s_1_rank_0/'
-    mult = 24
-
-    directory = 'option_1'
-    current_timer_1 = analysis_one_case(directory, base_dir,
-                                        quantiles, querylines, use_waves_timers,
-                                        use_teuchos_timers, mult=mult)
-
-    base_dir = file_dir + \
-        '/../../../workspace/katoptron_thesis_test_6_1_cube/test_2_s_1_rank_0/'
-    mult = 24
-
-    directory = 'option_2'
-    current_timer_2 = analysis_one_case(directory, base_dir,
-                                        quantiles, querylines, use_waves_timers,
-                                        use_teuchos_timers, mult=mult)
-
-    base_dir = file_dir + \
-        '/../../../workspace/katoptron_thesis_test_6_1_cube/test_4_s_1_rank_0/'
-    mult = 1
-
-    directory = 'option_3'
-    current_timer_3 = analysis_one_case(directory, base_dir,
-                                        quantiles, querylines, use_waves_timers,
-                                        use_teuchos_timers, mult=mult)
-
-    base_dir = file_dir + \
-        '/../../../workspace/katoptron_thesis_test_6_1_cube/test_3_s_8_rank_0/'
-    mult = 3
-
-    directory = 'option_4'
-    current_timer_4 = analysis_one_case(directory, base_dir,
-                                        quantiles, querylines, use_waves_timers,
-                                        use_teuchos_timers, mult=mult)
-
-    tmp = np.zeros((len(current_timer_1), 4))
-    tmp[:, 0] = current_timer_1
-    tmp[:, 1] = current_timer_2
-    tmp[:, 2] = current_timer_3
-    tmp[:, 3] = current_timer_4
-
-    np.savetxt('all.txt', tmp, fmt='%1.3f')
-
-    tmp_2 = np.copy(tmp)
-
-    tmp_2[:, 0] /= tmp_2[:, 1]
-    tmp_2[:, 2] /= tmp_2[:, 1]
-    tmp_2[:, 3] /= tmp_2[:, 1]
-    tmp_2[:, 1] /= tmp_2[:, 1]
-
-    speed_up = 1./tmp_2
-
-    np.savetxt('speed_up.txt', speed_up, fmt='%1.3f')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/katoptron/utilities.py b/katoptron/utilities.py
deleted file mode 100644
index fce0a04b0127805505586c7e1842f9db58550950..0000000000000000000000000000000000000000
--- a/katoptron/utilities.py
+++ /dev/null
@@ -1,786 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-
-import katoptron as m
-import tbox
-import tbox.gmsh as gmsh
-import shlex
-import subprocess
-import os
-import numpy as np
-from katoptron.eigenvalues import *
-
-
-def get_gmsh_version():
-    tmp = subprocess.check_output(["gmsh", "--version"],
-                                  stderr=subprocess.STDOUT)
-    tmp2 = tmp.decode().split('.')
-    return int(tmp2[0]), int(tmp2[1]), int(tmp2[2])
-
-
-def import_MPI():
-    try:
-        import mpi4py.MPI as mpi
-        comm = mpi.COMM_WORLD
-        rank = comm.rank
-        size = comm.size
-        name = mpi.Get_processor_name()
-        status = mpi.Status()
-        print('info: MPI found')
-    except:
-        comm = None
-        rank = 0
-        size = 1
-        name = "noname"
-        print('info: MPI not found => MPI disabled')
-    return comm, rank, size
-
-
-def Initialize_Kokkos():
-    from fwk.wutils import parseargs
-    args = parseargs()
-
-    m.Kokkos_Initialize(args.k)
-    return args.k
-
-
-def Finalize_Kokkos():
-    m.Kokkos_Finalize()
-
-
-def mkdir_MPI(directory, comm, rank, size):
-    # Create a new directory if rank == 0
-    if rank == 0:
-        if not os.path.exists(directory):
-            os.makedirs(directory)
-
-    comm.Barrier()
-
-
-def read_mesh_MPI(geo_name, file_dir, work_dir, comm, rank, size, params=None):
-    base_name = geo_name.partition(".")[0]
-    geo_type = geo_name.partition(".")[2]
-
-    mesh_name = base_name + '.msh'
-    partitioned_mesh_name = str(base_name + '_' + str(size) + '.msh')
-
-    if geo_type == "geo" and rank == 0:
-        if params is not None:
-            gmsh.MeshLoader(geo_name, file_dir).execute(**params)
-        else:
-            gmsh.MeshLoader(geo_name, file_dir).execute()
-
-    if size > 1:
-        comm.Barrier()
-
-    msh_dir = work_dir
-    if geo_type == "msh":
-        msh_dir = file_dir
-
-    if size == 1:
-        msh = gmsh.MeshLoader(mesh_name, msh_dir).execute()
-    else:
-        if rank == 0:
-            # Get gmsh version:
-            gmsh_major_version, gmsh_minor_version, gmsh_patch_version = get_gmsh_version()
-
-            command_line = 'gmsh -3 ' + msh_dir + '/' + mesh_name + ' -o ' + \
-                work_dir + '/' + partitioned_mesh_name + \
-                ' -part ' + str(size) + ' -format msh22'
-
-            # If gmsh is newer than gmsh 4, we have to specify that we want the ghost elements.
-            if gmsh_major_version >= 4:
-                command_line += ' -part_ghosts'
-            print(command_line)
-            tmp = shlex.split(command_line)
-            fileout = open('gmsh.log', 'w')
-            p = subprocess.Popen(tmp,
-                                 stdin=subprocess.PIPE,
-                                 stdout=fileout,
-                                 stderr=fileout,
-                                 env=os.environ,
-                                 shell=False,
-                                 close_fds=True)
-            retcode = p.wait()
-
-        comm.Barrier()
-
-        msh = gmsh.MeshLoader(partitioned_mesh_name,
-                              work_dir).execute(myrank=rank)
-
-    return msh, mesh_name, partitioned_mesh_name
-
-
-def read_mesh_to_fuse(filename,
-                      filename_output,
-                      file_dir,
-                      work_dir,
-                      comm,
-                      rank,
-                      size,
-                      index_nodes=0,
-                      index_elements=0,
-                      index_tags=0):
-    msh, mesh_name, partitioned_mesh_name = read_mesh_MPI(
-        filename, file_dir, work_dir, comm, rank, size)
-
-    gmshWriter = tbox.GmshExport(msh)
-    n_nodes = index_nodes + len(msh.nodes)
-    if index_nodes != 0:
-        for n in msh.nodes:
-            n.no = n.no + index_nodes
-    n_elems = index_elements + len(msh.elems)
-    if index_elements != 0:
-        for e in msh.elems:
-            e.no = e.no + index_elements
-    n_ptags = index_tags + len(msh.ptags)
-    if index_tags != 0:
-        for p in msh.ptags:
-            if msh.ptags[p].no > 1:
-                msh.ptags[p].no = msh.ptags[p].no + index_tags
-    gmshWriter.save(filename_output)
-
-    return n_nodes, n_elems, n_ptags
-
-
-def fuse_meshes(filename1, filename12, filename2, filename22, filename_output,
-                file_dir, work_dir, comm, rank, size):
-
-    if rank == 0:
-        n_nodes, n_elems, n_ptags = read_mesh_to_fuse(filename1, filename12,
-                                                      file_dir, work_dir, None,
-                                                      0, 1)
-        n_nodes, n_elems, n_ptags = read_mesh_to_fuse(filename2, filename22,
-                                                      file_dir, work_dir, None,
-                                                      0, 1, n_nodes, n_elems,
-                                                      n_ptags)
-
-        command_line = 'gmsh -3 ' + work_dir + '/' + filename12 + '.msh' + ' ' + work_dir + \
-            '/' + filename22 + '.msh' + ' -o ' + work_dir + '/' + \
-            filename_output + '.msh' + ' -format msh22'
-        tmp = shlex.split(command_line)
-        fileout = open('gmsh.log', 'w')
-        p = subprocess.Popen(tmp,
-                             stdin=subprocess.PIPE,
-                             stdout=fileout,
-                             stderr=fileout,
-                             env=os.environ,
-                             shell=False,
-                             close_fds=True)
-        retcode = p.wait()
-
-    if size > 1:
-        partitioned_mesh_name = str(filename_output + '_' + str(size) +
-                                           '.msh')
-        if rank == 0:
-            command_line = 'gmsh -3 ' + work_dir + '/' + filename_output + '.msh' + ' -o ' + work_dir + '/' + \
-                partitioned_mesh_name + ' -part ' + \
-                str(size) + ' -format msh22'
-            tmp = shlex.split(command_line)
-            fileout = open('gmsh.log', 'w')
-            p = subprocess.Popen(tmp,
-                                 stdin=subprocess.PIPE,
-                                 stdout=fileout,
-                                 stderr=fileout,
-                                 env=os.environ,
-                                 shell=False,
-                                 close_fds=True)
-            retcode = p.wait()
-        comm.Barrier()
-        msh = gmsh.MeshLoader(partitioned_mesh_name,
-                              work_dir).execute(myrank=rank)
-    else:
-        msh = gmsh.MeshLoader(filename_output + '.msh', work_dir).execute()
-
-    return msh
-
-
-def replace_strings(file_in, file_out, old_strings, new_strings):
-    with open(file_in, 'r') as file:
-        filedata = file.read()
-
-    for i in range(0, len(old_strings)):
-        filedata = filedata.replace(old_strings[i], new_strings[i])
-
-    with open(file_out, 'w') as file:
-        file.write(filedata)
-
-
-def print_nodes(msh, tag_names, rank):
-
-    for tag_name in tag_names:
-        print('Rank ' + str(rank) + ' Name tag: ' + tag_name + ' Elements: ' +
-              str(len(msh.ntags[tag_name].elems)))
-        for el in msh.ntags[tag_name].elems:
-            print(el)
-        print('Nodes: ')
-        print('{0:2s}   {1:3s}'.format('no', 'row'))
-        for el in msh.ntags[tag_name].elems:
-            for n1 in el.nodes:
-                print('{0:2d}   {1:3d}'.format(n1.no, n1.row))
-
-
-def extract(msh,
-            tag_name,
-            DOFperNode,
-            which_pos,
-            which_dof,
-            ensemble_size,
-            name_sol="x_mm.txt",
-            lot_of_data=False):
-    import numpy as np
-
-    nodeslist = []
-    #tag_name = "Center of cross section"
-    for el in msh.ntags[tag_name].elems:
-        for n1 in el.nodes:
-            nodeslist.append(n1.no)
-
-    nodes = list(set(nodeslist))
-
-    x = np.empty(np.shape(nodes))
-    x_sorted = np.empty(np.shape(nodes))
-    nodes_sorted = np.empty(np.shape(nodes), dtype=int)
-    sol = np.empty([len(nodes), ensemble_size])
-    for i in range(0, len(x)):
-        pos = msh.nodes[int(nodes[i])-1].pos
-        x[i] = pos[which_pos]
-
-    indices = np.argsort(x)
-    for i in range(0, len(x)):
-        x_sorted[i] = x[indices[i]]
-        nodes_sorted[i] = nodes[indices[i]]
-
-    with open(name_sol) as fp:
-        for i, line in enumerate(fp):
-            if i == 1:
-                tmp = np.array(line.split())
-                break
-    ndofs = tmp[0]
-
-    x = x_sorted
-    nodes = nodes_sorted
-
-    if which_dof == 3:
-        indices = nodes - 1
-    elif DOFperNode == 4:
-        indices = (ndofs / 4) + 3 * (nodes - 1) + int(which_dof)
-    else:
-        indices = 3 * (nodes - 1) + int(which_dof)
-
-    if lot_of_data:
-        sol_all = m.eigenvalues.read_mm(name_sol, is_sparse=False)
-        if ensemble_size == 1:
-            sol = sol_all[indices]
-        else:
-            sol = sol_all[indices, :]
-
-    else:
-        with open(name_sol) as fp:
-            for i, line in enumerate(fp):
-                for j in range(0, len(indices)):
-                    if i - 2 == indices[j]:
-                        sol[j, :] = np.array(line.split())
-
-    return x, sol
-
-
-def extract_2D(msh, tag_name, DOFperNode, which_dof, ensemble_size, name_sol):
-    # work only with triangel 2D now
-    comm, rank, size = import_MPI()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    nodeslist = []
-    #tag_name = "Center of cross section"
-    for el in msh.ntags[tag_name].elems:
-        for n1 in el.nodes:
-            nodeslist.append(n1.no - 1)
-    nodes = np.array(nodeslist)
-    nodes = np.sort(nodes)
-
-    i = 1
-    while i < len(nodes):
-        if nodes[i] == nodes[i - 1]:
-            nodes = np.delete(nodes, i)
-        else:
-            i = i + 1
-
-    nnodes = len(msh.nodes)
-    global_to_local = -1 * np.ones((nnodes, ), dtype='int32')
-
-    for i in range(0, len(nodes)):
-        global_to_local[nodes[i]] = i
-
-    ntri = len(msh.ntags[tag_name].elems)
-    tri = np.zeros((ntri, 3), dtype='uint32')
-
-    for i in range(0, ntri):
-        tri[i, 0] = global_to_local[msh.ntags[tag_name].elems[i].nodes[0].no -
-                                    1]
-        tri[i, 1] = global_to_local[msh.ntags[tag_name].elems[i].nodes[1].no -
-                                    1]
-        tri[i, 2] = global_to_local[msh.ntags[tag_name].elems[i].nodes[2].no -
-                                    1]
-
-    x = np.empty(np.shape(nodes))
-    y = np.empty(np.shape(nodes))
-    z = np.empty(np.shape(nodes))
-
-    sol = np.empty(np.shape(nodes))
-
-    x_sorted = np.empty(np.shape(nodes))
-    nodes_sorted = np.empty(np.shape(nodes))
-
-    #sol = np.empty([len(nodes), ensemble_size])
-
-    for i in range(0, len(x)):
-        pos = msh.nodes[nodes[i]].pos
-        x[i] = pos[0]
-        y[i] = pos[1]
-        z[i] = pos[2]
-
-    from scipy import io
-
-    #sol = x
-    if ensemble_size == 1:
-        sol_full = io.mmread(name_sol)
-    for j in range(0, len(x)):
-        sol[j] = sol_full[DOFperNode * (nodes[j]) + which_dof]
-
-    return x, y, z, tri, sol
-
-
-def extract_2D_all(msh, tag_name, DOFperNode, ensemble_size, name_sol):
-    # work only with triangel 2D now
-    comm, rank, size = import_MPI()
-
-    from PyTrilinos import Teuchos
-    import numpy as np
-
-    nodeslist = []
-    for el in msh.ntags[tag_name].elems:
-        for n1 in el.nodes:
-            nodeslist.append(n1.no - 1)
-    nodes = np.array(nodeslist)
-    nodes = np.sort(nodes)
-
-    ntri = len(msh.ntags[tag_name].elems)
-    tri = np.zeros((ntri, 3), dtype='uint32')
-
-    for i in range(0, ntri):
-        tri[i, 0] = msh.ntags[tag_name].elems[i].nodes[0].no - 1
-        tri[i, 1] = msh.ntags[tag_name].elems[i].nodes[1].no - 1
-        tri[i, 2] = msh.ntags[tag_name].elems[i].nodes[2].no - 1
-
-    i = 0
-    while i < len(nodes):
-        if nodes[i] == nodes[i - 1]:
-            nodes = np.delete(nodes, i)
-        else:
-            i = i + 1
-
-    x = np.empty(np.shape(nodes))
-    y = np.empty(np.shape(nodes))
-    z = np.empty(np.shape(nodes))
-
-    x_sorted = np.empty(np.shape(nodes))
-    nodes_sorted = np.empty(np.shape(nodes))
-
-    sol = np.empty([len(nodes), DOFperNode])
-
-    for i in range(0, len(x)):
-        pos = msh.nodes[nodes[i]].pos
-        x[i] = pos[0]
-        y[i] = pos[1]
-        z[i] = pos[2]
-
-    from scipy import io
-
-    if ensemble_size == 1:
-        sol_full = io.mmread(name_sol)
-    for j in range(0, len(x)):
-        for k in range(0, DOFperNode):
-            sol[j, k] = sol_full[DOFperNode * (nodes[j]) + k]
-
-    return x, y, z, tri, sol
-
-
-def compute_cross_and_theta(vec1, vec2):
-    from numpy import linalg as LA
-
-    norm1 = LA.norm(vec1)
-    norm2 = LA.norm(vec2)
-    cross = np.cross(vec1, vec2)
-    dot = np.dot(vec1, vec2)
-    theta = np.arccos((dot / (norm1 * norm2)))
-
-    return cross, theta
-
-
-def rotation_matrix(axis, theta):
-    """
-    Return the rotation matrix associated with counterclockwise rotation about
-    the given axis by theta radians.
-    """
-    axis = np.asarray(axis)
-    axis = (axis / np.sqrt(np.dot(axis, axis)))
-    a = np.cos((theta / 2.0))
-    b, c, d = -axis * np.sin((theta / 2.0))
-    aa, bb, cc, dd = a * a, b * b, c * c, d * d
-    bc, ad, ac, ab, bd, cd = b * c, a * d, a * c, a * b, b * d, c * d
-    return np.array([[aa + bb - cc - dd, 2 * (bc + ad), 2 * (bd - ac)],
-                     [2 * (bc - ad), aa + cc - bb - dd, 2 * (cd + ab)],
-                     [2 * (bd + ac), 2 * (cd - ab), aa + dd - bb - cc]])
-
-
-def extract_2D_all_rotated(msh, tag_name, DOFperNode, ensemble_size, name_sol,
-                           axis_nodes_id):
-
-    x, y, z, tri, sol = extract_2D_all(msh, tag_name, DOFperNode,
-                                       ensemble_size, name_sol)
-
-    x_r = np.empty(np.shape(x))
-    y_r = np.empty(np.shape(x))
-    z_r = np.empty(np.shape(x))
-    sol_r = np.empty(np.shape(sol))
-
-    pos_OX_1 = msh.nodes[axis_nodes_id[0]].pos
-    pos_OX_2 = msh.nodes[axis_nodes_id[1]].pos
-
-    vec_OX = np.array([pos_OX_2[0]-pos_OX_1[0], pos_OX_2[1] -
-                       pos_OX_1[1], pos_OX_2[2]-pos_OX_1[2]])
-
-    OX_ref = np.array([1, 0, 0])
-    OY_ref = np.array([0, 1, 0])
-
-    cross_prod_OX, theta_X = compute_cross_and_theta(vec_OX, OX_ref)
-    rot_X = rotation_matrix(cross_prod_OX, theta_X)
-
-    for i in range(0, len(x)):
-        tmp = np.dot(rot_X, [x[i], y[i], z[i]])
-        x_r[i] = tmp[0]
-        y_r[i] = tmp[1]
-        z_r[i] = tmp[2]
-
-        tmp = np.dot(rot_X, [sol[i, 0], sol[i, 1], sol[i, 2]])
-
-        sol_r[i, 0] = tmp[0]
-        sol_r[i, 1] = tmp[1]
-        sol_r[i, 2] = tmp[2]
-
-    sol_r[:, 3] = sol[:, 3]
-
-    if cross_prod_OX[1] != 0:
-        '''
-        vec_OY = np.dot(rot_X, vec_OY)
-        print vec_OY
-        vec_OY[0] = 0
-        print vec_OY
-        cross_prod_OY, theta_Y = compute_cross_and_theta(vec_OY, OY_ref)
-        '''
-        cross_prod_OY = np.array([1, 0, 0])
-        max_i_z = np.argmax(z_r)
-        min_i_z = np.argmin(z_r)
-
-        dz = z_r[max_i_z] - z_r[min_i_z]
-        dy = y_r[max_i_z] - y_r[min_i_z]
-
-        theta_Y = np.arctan((-dz / dy))
-
-        rot_Y = rotation_matrix(cross_prod_OY, theta_Y)
-
-        for i in range(0, len(x)):
-            tmp = np.dot(rot_Y, [x_r[i], y_r[i], z_r[i]])
-            x_r[i] = tmp[0]
-            y_r[i] = tmp[1]
-            z_r[i] = tmp[2]
-
-            tmp = np.dot(rot_Y, [sol_r[i, 0], sol_r[i, 1], sol_r[i, 2]])
-
-            sol_r[i, 0] = tmp[0]
-            sol_r[i, 1] = tmp[1]
-            sol_r[i, 2] = tmp[2]
-
-    return x_r, y_r, z_r, tri, sol_r
-
-
-def compute_Zernike(x, y, z, tri, dz, n_Zernike, center_pos):
-    from numpy import linalg as LA
-
-    n_nodes = len(x)
-    n_tri = np.size(tri, 0)
-
-    Zernike_coeff = np.zeros((n_Zernike, ))
-
-    Zernike_functions = np.zeros((n_nodes, n_Zernike))
-
-    rho = np.empty(np.shape(x))
-    theta = np.empty(np.shape(x))
-
-    for i in range(0, len(x)):
-        rho[i] = LA.norm(np.array([x[i], y[i]]) - center_pos)
-        if x[i] >= center_pos[0] and y[i] >= center_pos[1]:
-            theta[i] = np.arctan(
-                ((y[i] - center_pos[1]) / (x[i] - center_pos[0])))
-        elif y[i] >= center_pos[1] or x[i] < center_pos[0]:
-            theta[i] = np.arctan(
-                ((y[i] - center_pos[1]) /
-                        (x[i] - center_pos[0]))) + np.pi
-        else:
-            theta[i] = np.arctan(
-                ((y[i] - center_pos[1]) /
-                        (x[i] - center_pos[0]))) + 2 * np.pi
-
-    max_rho = max(rho)
-    rho = (rho / max_rho)
-
-    if n_Zernike >= 1:
-        Zernike_functions[:, 0] = 1.
-    if n_Zernike >= 2:
-        v_max = np.amax(2 * rho * np.cos(theta))
-        Zernike_functions[:, 1] = 2 * rho * np.cos(theta) / v_max
-    if n_Zernike >= 3:
-        v_max = np.amax(2 * rho * np.sin(theta))
-        Zernike_functions[:, 2] = 2 * rho * np.sin(theta) / v_max
-    if n_Zernike >= 4:
-        v_max = np.amax(np.sqrt(3) * (2 * np.power(rho, 2) - 1))
-        Zernike_functions[:, 3] = np.sqrt(3) * (2 * np.power(rho, 2) -
-                                                1) / v_max
-    if n_Zernike >= 5:
-        Zernike_functions[:, 4] = np.sqrt(6) * np.power(rho, 2) * np.sin(
-            2 * theta)
-    if n_Zernike >= 6:
-        Zernike_functions[:, 5] = np.sqrt(6) * np.power(rho, 2) * np.cos(
-            2 * theta)
-    if n_Zernike >= 7:
-        Zernike_functions[:, 6] = np.sqrt(8) * (3 * np.power(rho, 3) -
-                                                2 * rho) * np.sin(theta)
-    if n_Zernike >= 8:
-        Zernike_functions[:, 7] = np.sqrt(8) * (3 * np.power(rho, 3) -
-                                                2 * rho) * np.cos(theta)
-    if n_Zernike >= 9:
-        Zernike_functions[:, 8] = np.sqrt(8) * np.power(rho, 3) * np.sin(
-            3 * theta)
-    if n_Zernike >= 10:
-        Zernike_functions[:, 9] = np.sqrt(8) * np.power(rho, 3) * np.cos(
-            3 * theta)
-
-    W = np.zeros((n_nodes, n_nodes))
-
-    for i in range(0, n_tri):
-        cross = np.cross(
-            np.array([
-                x[tri[i, 1]] - x[tri[i, 0]], y[tri[i, 1]] - y[tri[i, 0]],
-                z[tri[i, 1]] - z[tri[i, 0]]
-            ]),
-            np.array([
-                x[tri[i, 2]] - x[tri[i, 0]], y[tri[i, 2]] - y[tri[i, 0]],
-                z[tri[i, 2]] - z[tri[i, 0]]
-            ]))
-        area = (LA.norm(cross) / 6)  # area per node of the triangle
-
-        for j in range(0, 3):
-            W[tri[i, j], tri[i, j]] = W[tri[i, j], tri[i, j]] + area
-
-    TMP_Z = np.dot(np.transpose(Zernike_functions), W)
-    rhs_Z = np.dot(TMP_Z, dz)
-
-    A_Z = np.dot(TMP_Z, Zernike_functions)
-
-    Zernike_coeff = np.linalg.solve(A_Z, rhs_Z)
-
-    return Zernike_coeff, Zernike_functions, theta, rho
-
-
-def compute_RBM_Curvature_Irreg(x, y, z, tri, dz, unit, center_pos):
-    from numpy import linalg as LA
-
-    n_nodes = len(x)
-    n_tri = np.size(tri, 0)
-
-    RBM_Curvature_Irreg_coeff = np.zeros((4, ))
-
-    RBM_Curvature_Irreg_functions = np.zeros((n_nodes, 4))
-
-    if unit == "m":
-        x = x * 1000
-        y = y * 1000
-        z = z * 1000
-        dz = dz * 1000
-        center_pos = center_pos * 1000
-
-    Zernike_coeff, Zernike_functions, theta, rho = compute_Zernike(
-        x, y, z, tri, dz, 4, center_pos)
-    dz_residual = dz - Zernike_coeff[
-        0] * Zernike_functions[:, 0] - Zernike_coeff[
-            1] * Zernike_functions[:, 1] - Zernike_coeff[
-                2] * Zernike_functions[:, 2] - Zernike_coeff[
-                    3] * Zernike_functions[:, 3]
-
-    optical_coefficients = np.zeros((5, 1)).flatten()
-    # piston  [mm]
-    optical_coefficients[0] = Zernike_coeff[0]
-    index = np.argmax(Zernike_functions[:, 1])
-    optical_coefficients[1] = np.arctan(
-        -Zernike_coeff[1] *
-        ((Zernike_functions[index, 1] /
-                 (x[index] - center_pos[0]))))  # rot y   [rad]
-    index = np.argmax(Zernike_functions[:, 2])
-    optical_coefficients[2] = np.arctan(
-        -Zernike_coeff[2] *
-        ((Zernike_functions[index, 2] /
-                 (y[index] - center_pos[1]))))  # rot x   [rad]
-    optical_coefficients[3] = Zernike_coeff[3] * \
-        (np.amax(Zernike_functions[:, 3])-np.amin(Zernike_functions[:, 3]))
-    optical_coefficients[4] = np.amax(dz_residual) - np.amin(dz_residual)
-
-    return optical_coefficients, dz_residual
-
-
-def compute_RBM_Curvature_Irreg_Sequential(x, y, z, tri, dz, unit, center_pos):
-    from numpy import linalg as LA
-
-    n_nodes = len(x)
-    n_tri = np.size(tri, 0)
-
-    RBM_Curvature_Irreg_coeff = np.zeros((4, ))
-
-    RBM_Curvature_Irreg_functions = np.zeros((n_nodes, 4))
-
-    if unit == "m":
-        x = x * 1000
-        y = y * 1000
-        z = z * 1000
-        dz = dz * 1000
-        center_pos = center_pos * 1000
-
-    rho = np.empty(np.shape(x))
-
-    for i in range(0, len(x)):
-        rho[i] = LA.norm(np.array([x[i], y[i]]) - center_pos)
-
-    RBM_Curvature_Irreg_functions[:, 0] = 1.
-    RBM_Curvature_Irreg_functions[:, 1] = y - center_pos[1]
-    RBM_Curvature_Irreg_functions[:, 2] = x - center_pos[0]
-    RBM_Curvature_Irreg_functions[:, 3] = np.power(rho, 2)
-
-    W = np.zeros((n_nodes, n_nodes))
-
-    print("mean dz")
-    print(np.mean(dz))
-
-    for i in range(0, n_tri):
-        cross = np.cross(
-            np.array([
-                x[tri[i, 1]] - x[tri[i, 0]], y[tri[i, 1]] - y[tri[i, 0]],
-                z[tri[i, 1]] - z[tri[i, 0]]
-            ]),
-            np.array([
-                x[tri[i, 2]] - x[tri[i, 0]], y[tri[i, 2]] - y[tri[i, 0]],
-                z[tri[i, 2]] - z[tri[i, 0]]
-            ]))
-        area = (LA.norm(cross) / 6)  # area per node of the triangle
-
-        for j in range(0, 3):
-            W[tri[i, j], tri[i, j]] = W[tri[i, j], tri[i, j]] + area
-
-    for i in range(0, 4):
-        TMP_Z = np.dot(np.transpose(RBM_Curvature_Irreg_functions[:, i]), W)
-        rhs_Z = np.dot(TMP_Z, dz)
-
-        A_Z = np.dot(TMP_Z, RBM_Curvature_Irreg_functions[:, i])
-
-        RBM_Curvature_Irreg_coeff[i] = (rhs_Z / A_Z)
-        dz = dz - RBM_Curvature_Irreg_coeff[i] * \
-            RBM_Curvature_Irreg_functions[:, i]
-
-    optical_coefficients = np.zeros((5, ))
-    optical_coefficients[0] = RBM_Curvature_Irreg_coeff[0]  # piston
-    optical_coefficients[1] = np.arctan(RBM_Curvature_Irreg_coeff[1])
-    optical_coefficients[2] = np.arctan(RBM_Curvature_Irreg_coeff[2])
-    optical_coefficients[3] = RBM_Curvature_Irreg_coeff[3] * \
-        np.amax(RBM_Curvature_Irreg_functions[:, 3])
-    optical_coefficients[4] = np.amax(dz) - np.amin(dz)
-
-    print("optical_coefficients")
-    print(optical_coefficients)
-
-    return RBM_Curvature_Irreg_coeff, RBM_Curvature_Irreg_functions, dz
-
-
-def check_optical_tolerance(optical_tolerance, unit):
-    passed = 1
-    max_angle = 0.00175
-    if unit == "mm":
-        max_fringe = 0.0316
-        max_translation = 2
-    elif unit == "m":
-        max_fringe = 0.0000316
-        max_translation = 0.002
-
-    if np.absolute(optical_tolerance[0]) >= max_translation:
-        print("translation")
-        passed = 0
-
-    if np.absolute(optical_tolerance[1]) >= max_angle:
-        print("rotation x")
-        passed = 0
-
-    if np.absolute(optical_tolerance[2]) >= max_angle:
-        print("rotation y")
-        passed = 0
-
-    if optical_tolerance[3] >= max_fringe:
-        print("curvature")
-        passed = 0
-
-    if optical_tolerance[4] >= max_fringe:
-        print("irregularity")
-        passed = 0
-
-    return passed
-
-
-def check_optical_tolerance_Zernike(Zernike_coeff, Zernike_functions, dz,
-                                    unit):
-
-    passed = 1
-    max_angle = 0.00175
-    if unit == "mm":
-        max_fringe = 0.0316
-        max_translation = 2
-    elif unit == "m":
-        max_fringe = 0.0000316
-        max_translation = 0.002
-
-    if np.absolute(Zernike_coeff[0]) >= max_translation:
-        print("translation")
-        passed = 0
-
-    if np.absolute(Zernike_coeff[1]) >= max_angle:
-        print("rotation x")
-        passed = 0
-
-    if np.absolute(Zernike_coeff[2]) >= max_angle:
-        print("rotation y")
-        passed = 0
-
-    tmp = np.dot(Zernike_coeff[3], Zernike_functions[:, 3])
-
-    if np.absolute(max(tmp) - min(tmp)) >= max_fringe:
-        print("curvature")
-        passed = 0
-
-    tmp = dz - np.dot(Zernike_coeff[0], Zernike_functions[:, 0]) - np.dot(Zernike_coeff[1], Zernike_functions[:, 1]) - \
-        np.dot(Zernike_coeff[2], Zernike_functions[:, 2]) - \
-        np.dot(Zernike_coeff[3], Zernike_functions[:, 3])
-
-    if np.absolute(max(tmp) - min(tmp)) >= max_fringe:
-        print(max(tmp))
-        print(min(tmp))
-        print("irregularity")
-        passed = 0
-
-    return passed
diff --git a/katoptron/viewer.py b/katoptron/viewer.py
deleted file mode 100644
index 13211f6e8a99ffe0df592aa44375b07cb0eeb5c6..0000000000000000000000000000000000000000
--- a/katoptron/viewer.py
+++ /dev/null
@@ -1,689 +0,0 @@
-# -*- coding: utf-8; -*-
-
-import sys
-import katoptron as m
-import tbox as tb
-import vtk
-from PyQt4 import QtCore, QtGui
-from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
-
-
-class MeshViewer(QtGui.QWidget, m.DisplayHook):
-
-    app = QtGui.QApplication(sys.argv)
-
-    """
-    Qt GUI for visu. the output
-    """
-
-    def __init__(self, pbl, slv, msh, elev=-90., azim=0.):
-        # super(MeshViewer, self).__init__() # a eclaircir... marche p�
-        m.DisplayHook.__init__(self)
-        QtGui.QWidget.__init__(self)
-
-        slv.setGUI(self)
-
-        self.ensemble_size = slv.minimum_ensemble_size
-
-        self.msh = msh
-        self.solver = slv
-
-        self.running = 'init'
-        self.vmin = 0.0
-        self.vmax = 0.0
-
-        self.elev = elev
-        self.azim = azim
-
-        print(" ")
-        print("starting MeshViewer init...")
-
-        self.__setupGUI()
-        self.__setupVTK()
-
-        self.app.connect(self.app, QtCore.SIGNAL(
-            "lastWindowClosed()"), self.app, QtCore.SLOT("quit()"))
-        self.show()
-        # [Linux] faire ca le plus tard possible (apres self.show!!)
-        self.vtkwidget.Initialize()
-        print("MeshViewer ready.")
-
-    def closeEvent(self, event):
-        # self.scheme.stopit=True
-        self.running = 'running'  # sort de "while self.running=='pause'"
-        print("GUI killed!")
-        QtGui.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(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
-                                                       QtGui.QSizePolicy.Expanding))
-        self.vtkwidget.setMinimumSize(QtCore.QSize(300, 300))
-        self.vtkwidget.setSizePolicy(
-            QtGui.QSizePolicy.Expanding, QtGui.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 = QtGui.QHBoxLayout()
-        self.setLayout(hbox)
-        hbox.addWidget(self.vtkwidget)
-
-        pan = QtGui.QFrame()
-        pan.setMaximumSize(QtCore.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 = QtGui.QVBoxLayout()
-        pan.setLayout(vbox)
-
-        self.startBut = QtGui.QPushButton(self.tr("Start"))
-        #self.connect(self.startBut, QtCore.SIGNAL("clicked()"), self.disableStart)
-        self.connect(self.startBut, QtCore.SIGNAL("clicked()"), self.startSlot)
-        vbox.addWidget(self.startBut)
-
-        groupBox = QtGui.QGroupBox("Range")
-        gbox = QtGui.QGridLayout()
-        label = QtGui.QLabel("min")
-        gbox.addWidget(label, 0, 0)
-        self.vminlinedt = QtGui.QLineEdit('%f' % self.vmin)
-        self.connect(self.vminlinedt, QtCore.SIGNAL(
-            "editingFinished()"), self.updateTCoords)
-
-        gbox.addWidget(self.vminlinedt, 0, 1)
-        label = QtGui.QLabel("max")
-        gbox.addWidget(label, 1, 0)
-        self.vmaxlinedt = QtGui.QLineEdit('%f' % self.vmax)
-        self.connect(self.vmaxlinedt, QtCore.SIGNAL(
-            "editingFinished()"), self.updateTCoords)
-        gbox.addWidget(self.vmaxlinedt, 1, 1)
-        groupBox.setLayout(gbox)
-        vbox.addWidget(groupBox)
-
-        groupBox = QtGui.QGroupBox("Samples")
-        self.samplesList = QtGui.QListWidget()
-        for i in range(self.ensemble_size):
-            item = QtGui.QListWidgetItem("Sample %i" % i)
-            self.samplesList.addItem(item)
-        gbox = QtGui.QVBoxLayout()
-        groupBox.setLayout(gbox)
-        gbox.addWidget(self.samplesList)
-        self.samplesList.currentItemChanged.connect(self.on_item_changed)
-        self.samplesList.itemClicked.connect(self.Clicked)
-        vbox.addWidget(groupBox)
-
-        groupBox = QtGui.QGroupBox("Infos")
-        self.steplabel = QtGui.QLabel("Active set iteration #")
-        #self.timelabel = QtGui.QLabel("Time step = 0")
-        gbox = QtGui.QVBoxLayout()
-        groupBox.setLayout(gbox)
-        gbox.addWidget(self.steplabel)
-        # gbox.addWidget(self.timelabel)
-        vbox.addWidget(groupBox)
-
-        verbchk = QtGui.QCheckBox("verbose")
-        self.connect(verbchk, QtCore.SIGNAL(
-            "stateChanged(int)"), self.verboseSlot)
-        vbox.addWidget(verbchk)
-
-        vbox.addStretch(1)
-
-    def verboseSlot(self, state):
-        self.scheme.verbose = state
-        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.solver.start()
-            # for j in range(0,101):
-            #    self.updatePos2(j)
-            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(QtCore.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 1:
-            elev = self.elev
-            cam1.Elevation(elev)
-            if elev > 90:
-                cam1.SetViewUp(0, -1, 0)
-            else:
-                cam1.SetViewUp(0, 1, 0)
-            cam1.Azimuth(self.azim)
-        # 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)
-
-        # 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 on_item_changed(self, curr, prev):
-        str_list = str(curr.text())
-        for s in str_list.split():
-            if s.isdigit():
-                nt = int(s)
-                self.display_sample(nt, 0)
-
-    def Clicked(self, item):
-        str_list = str(item.text())
-        for s in str_list.split():
-            if s.isdigit():
-                nt = int(s)
-                self.display_sample(nt, 0)
-
-    def display_sample(self, nt, t):
-        if None == self.polydata.GetPointData().GetArray("Values "+str(nt)):
-            print("Please, before selecting solution to display, run the simulation.")
-        else:
-            pos_x = self.polydata.GetPointData().GetArray("Positions x "+str(nt))
-            pos_y = self.polydata.GetPointData().GetArray("Positions y "+str(nt))
-            pos_z = self.polydata.GetPointData().GetArray("Positions z "+str(nt))
-
-            values = self.polydata.GetPointData().GetArray("Values "+str(nt))
-
-            current_min = self.vmin
-            current_max = self.vmax
-            for i in range(self.msh.nodes.size()):
-                self.points.SetPoint(i, pos_x.GetValue(
-                    i), pos_y.GetValue(i), pos_z.GetValue(i))
-                value = values.GetValue(i)
-                self.scalars.SetValue(i, value)
-                if value < current_min:
-                    current_min = value
-                elif value > current_max:
-                    current_max = value
-
-            # mesh
-            self.renderer.RemoveViewProp(self.mesh.actor)
-            self.mesh = Mesh(self.ugrid)
-            self.renderer.AddActor(self.mesh.actor)
-
-            # grid
-            self.renderer.RemoveViewProp(self.grid.actor)
-            self.grid = Grid(self.ugrid)
-            self.renderer.AddViewProp(self.grid.actor)
-
-            self.vmin = current_min
-            self.vmax = current_max
-            current_max = self.scalars.GetRange()
-
-            self.mesh.updateTcoords(self.vmin, self.vmax)
-
-            # scalarbar
-            self.renderer.RemoveViewProp(self.scalarbar.actor)
-            self.scalarbar = ScalarBar(self.mesh.lut)
-            self.renderer.AddViewProp(self.scalarbar.actor)
-
-            self.render()
-
-    def display(self, nt, ast, u_x, u_y, u_z, u_norm):
-        """ C++ => python callback
-        """
-        self.steplabel.setText("Active set iteration # "+str(int(ast)))
-
-        if True:  # None == self.polydata.GetPointData().GetArray("Values "+str(nt)):
-
-            pos_x = vtk.vtkDoubleArray()
-            pos_y = vtk.vtkDoubleArray()
-            pos_z = vtk.vtkDoubleArray()
-
-            values = vtk.vtkDoubleArray()
-
-            pos_x.SetName("Positions x "+str(nt))
-            pos_y.SetName("Positions y "+str(nt))
-            pos_z.SetName("Positions z "+str(nt))
-
-            values.SetName("Values "+str(nt))
-
-            current_min = self.vmin
-            current_max = self.vmax
-            for i in range(self.msh.nodes.size()):
-                p = self.msh.nodes[i].pos
-                self.points.SetPoint(
-                    i, p[0]+u_x[i], p[1]+u_y[i], p[2]+u_z[i])
-
-                pos_x.InsertNextValue(p[0]+u_x[i])
-                pos_y.InsertNextValue(p[1]+u_y[i])
-                pos_z.InsertNextValue(p[2]+u_z[i])
-                values.InsertNextValue(u_norm[i])
-
-                self.polydata.GetPointData().AddArray(pos_x)
-                self.polydata.GetPointData().AddArray(pos_y)
-                self.polydata.GetPointData().AddArray(pos_z)
-
-                self.polydata.GetPointData().AddArray(values)
-
-                value = u_norm[i]
-                self.scalars.SetValue(i, value)
-                if value < current_min:
-                    current_min = value
-                elif value > current_max:
-                    current_max = value
-
-        else:
-            pos_x = self.polydata.GetPointData().GetArray("Positions x "+str(nt))
-            pos_y = self.polydata.GetPointData().GetArray("Positions y "+str(nt))
-            pos_z = self.polydata.GetPointData().GetArray("Positions z "+str(nt))
-
-            values = self.polydata.GetPointData().GetArray("Values "+str(nt))
-
-            current_min = self.vmin
-            current_max = self.vmax
-            for i in range(self.msh.nodes.size()):
-                self.points.SetPoint(i, pos_x.GetValue(
-                    i), pos_y.GetValue(i), pos_z.GetValue(i))
-                value = values.GetValue(i)
-                self.scalars.SetValue(i, value)
-                if value < current_min:
-                    current_min = value
-                elif value > current_max:
-                    current_max = value
-
-        # mesh
-        self.renderer.RemoveViewProp(self.mesh.actor)
-        self.mesh = Mesh(self.ugrid)
-        self.renderer.AddActor(self.mesh.actor)
-
-        # grid
-        self.renderer.RemoveViewProp(self.grid.actor)
-        self.grid = Grid(self.ugrid)
-        self.renderer.AddViewProp(self.grid.actor)
-
-        self.vmin = current_min
-        self.vmax = current_max
-        current_max = self.scalars.GetRange()
-
-        self.mesh.updateTcoords(self.vmin, self.vmax)
-
-        # scalarbar
-        self.renderer.RemoveViewProp(self.scalarbar.actor)
-        self.scalarbar = ScalarBar(self.mesh.lut)
-        self.renderer.AddViewProp(self.scalarbar.actor)
-
-        self.render()
-
-    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.polydata = vtk.vtkPolyData()
-
-        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)
-
-        for i in range(self.msh.elems.size()):
-            e = self.msh.elems[i]
-            n = e.nodes
-            # hexa
-            if e.type() == tb.EL_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)
-            # tetra
-            elif e.type() == tb.EL_TETRA4:
-                tetra = vtk.vtkTetra()
-                ids = tetra.GetPointIds()
-                for j in range(4):
-                    ids.SetId(j, n[j].no-1)
-                self.ugrid.InsertNextCell(tetra.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())
-        # if vtk.VTK_MAJOR_VERSION <= 5:
-        #    writer.SetInput(self.ugrid)
-        # else:
-        writer.SetInputData(self.ugrid)
-        writer.SetFileName(name)
-        writer.Write()
-
-    def write(self, name='mesh.vtk'):
-        writer = vtk.vtkUnstructuredGridWriter()
-        writer.SetFileName(name)
-        writer.SetFileTypeToASCII()
-        if vtk.VTK_MAJOR_VERSION <= 5:
-            writer.SetInput(self.ugrid)
-        else:
-            writer.SetInputData(self.ugrid)
-        writer.Write()
-
-    def updatePos(self):
-        #print self.points.GetPoint(1)
-        #print self.scalars.GetValue(1)
-
-        current_min = 1000
-        current_max = -1000
-        for i in range(self.msh.nodes.size()):
-            p = self.msh.nodes[i].pos
-            self.points.SetPoint(i, p[0]+p[2], p[1], p[2])
-            value = p[0]
-            self.scalars.SetValue(i, value)
-            if value < current_min:
-                current_min = value
-            elif value > current_max:
-                current_max = value
-        #print self.points.GetPoint(1)
-        #print self.scalars.GetValue(1)
-        #print self.ugrid.GetPoint(1)
-
-        # mesh
-        self.mesh = Mesh(self.ugrid)
-        self.renderer.AddActor(self.mesh.actor)
-
-        # grid
-        self.grid = Grid(self.ugrid)
-        self.renderer.AddViewProp(self.grid.actor)
-
-        self.vmin = current_min
-        self.vmax = current_max
-        current_max = self.scalars.GetRange()
-
-        print(self.vmin)
-        print(self.vmax)
-
-        self.mesh.updateTcoords(self.vmin, self.vmax)
-
-        # scalarbar
-        self.renderer.RemoveViewProp(self.scalarbar.actor)
-        self.scalarbar = ScalarBar(self.mesh.lut)
-        self.renderer.AddViewProp(self.scalarbar.actor)
-
-        self.render()
-
-    def updatePos2(self, j):
-        import numpy as np
-
-        current_min = self.vmin
-        current_max = self.vmax
-        for i in range(self.msh.nodes.size()):
-            p = self.msh.nodes[i].pos
-            value = 100*np.sin(2*np.pi*j/25)*np.sin(0.5*np.pi*p[0]/500)
-            self.points.SetPoint(i, p[0], p[1], p[2]+value)
-            self.scalars.SetValue(i, value)
-            if value < current_min:
-                current_min = value
-            elif value > current_max:
-                current_max = value
-
-        # mesh
-        self.renderer.RemoveViewProp(self.mesh.actor)
-        self.mesh = Mesh(self.ugrid)
-        self.renderer.AddActor(self.mesh.actor)
-
-        # grid
-        self.renderer.RemoveViewProp(self.grid.actor)
-        self.grid = Grid(self.ugrid)
-        self.renderer.AddViewProp(self.grid.actor)
-
-        self.vmin = current_min
-        self.vmax = current_max
-        current_max = self.scalars.GetRange()
-
-        self.mesh.updateTcoords(self.vmin, self.vmax)
-
-        # scalarbar
-        self.renderer.RemoveViewProp(self.scalarbar.actor)
-        self.scalarbar = ScalarBar(self.mesh.lut)
-        self.renderer.AddViewProp(self.scalarbar.actor)
-
-        self.render()
-
-
-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())
-        if vtk.VTK_MAJOR_VERSION <= 5:
-            self.mapper.SetInput(ugrid)
-        else:
-            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.667, 0.)
-        # valeurs bidons -> pas d'infl sur la texture
-        self.lut.SetTableRange(0.0, 1.0)
-        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):
-        tprop = vtk.vtkTextProperty()
-        tprop.SetColor(0, 0, 0)
-        tprop.SetFontFamilyToTimes()
-
-        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.SetLabelTextProperty(tprop)
-
-
-class Grid:
-    def __init__(self, ugrid):
-        # compatibility vtk 5/6 => use a trivial producer
-        #self.producer = vtk.vtkTrivialProducer()
-        # self.producer.SetOutput(ugrid)   # le double producer (dans Mesh/Grid) ne marche pas sous Qt 4 => faire un objet dataset
-
-        self.mapper = vtk.vtkDataSetMapper()
-        if vtk.VTK_MAJOR_VERSION <= 7:
-            self.mapper.ImmediateModeRenderingOff()
-        self.mapper.SetResolveCoincidentTopologyToPolygonOffset()
-        self.mapper.ScalarVisibilityOff()
-        # self.mapper.SetInputConnection(self.producer.GetOutputPort())
-        if vtk.VTK_MAJOR_VERSION <= 5:
-            self.mapper.SetInput(ugrid)
-        else:
-            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)
diff --git a/run.py b/run.py
deleted file mode 100755
index e2ca260b01b589c1efcd3c7b7b233f166cae5f6e..0000000000000000000000000000000000000000
--- a/run.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/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/scripts/devenv-mingw.bat b/scripts/devenv-mingw.bat
deleted file mode 100644
index cb5b9e6e2e04657346cb0bbc0b9a737e657af95a..0000000000000000000000000000000000000000
--- a/scripts/devenv-mingw.bat
+++ /dev/null
@@ -1,29 +0,0 @@
-@echo off
-
-echo setting MinGW environment
-
-set INCLUDE=c:\local\include
-set INCLUDE=%INCLUDE%;C:\local\OpenBLAS-v0.2.14-Win32\include
-set INCLUDE=%INCLUDE%;C:\local\zlib-1.2.8\include
-set INCLUDE=%INCLUDE%;C:\local\MUMPS\include
-
-::set LIB=c:\local\lib
-
-
-set PATH=c:\MinGW\bin
-set PATH=%PATH%;C:\MinGW\msys\1.0\bin
-set PATH=%PATH%;C:\local\tbb43_20150424oss\build\windows_ia32_gcc_mingw4.8.1_debug
-set PATH=%PATH%;C:\local\tbb43_20150424oss\build\windows_ia32_gcc_mingw4.8.1_release
-set PATH=%PATH%;C:\local\gmsh-2.9.3-Windows
-set PATH=%PATH%;C:\local\swigwin-2.0.12
-set PATH=%PATH%;C:\local\OpenBLAS-v0.2.14-Win32\bin
-set PATH=%PATH%;C:\local\qt-4.8.7\bin
-set PATH=%PATH%;C:\Python27
-set PATH=%PATH%;C:\local\vtk-5.10.1\bin
-set PATH=%PATH%;C:\local\zlib-1.2.8\bin
-set PATH=%PATH%;c:\local\bin
-set PATH=%PATH%;c:\local\MUMPS\bin
-set PATH=%PATH%;C:\Program Files\CMake\bin
-set PATH=%PATH%;C:\Program Files\TortoiseSVN\bin
-
-%comspec%
diff --git a/scripts/devenv-vs2019.bat b/scripts/devenv-vs2019.bat
deleted file mode 100644
index c408817817c2930161336ce05b9e9768b2600663..0000000000000000000000000000000000000000
--- a/scripts/devenv-vs2019.bat
+++ /dev/null
@@ -1,10 +0,0 @@
-@echo off
-:: command line for MSVC build (Visual Studio 2019)
-
-set PATH=%PATH%;%MYLOCAL%\swig
-set INCLUDE=%MYLOCAL%\include;%MYLOCAL%\MUMPS\include;%MYLOCAL%\eigen
-set LIB=%MYLOCAL%\MUMPS\lib
-
-call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\bin\mklvars.bat" intel64 vs2019
-call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\tbbvars.bat" intel64 vs2019
-%comspec% /K ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" amd64"
diff --git a/tlnos/CMakeLists.txt b/tlnos/CMakeLists.txt
deleted file mode 100644
index 0ba56acac439366df5a09cf198dab7af3e6b3038..0000000000000000000000000000000000000000
--- a/tlnos/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-ADD_SUBDIRECTORY( src )
-ADD_SUBDIRECTORY( _src )
-
-MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests)
-
-
diff --git a/tlnos/__init__.py b/tlnos/__init__.py
deleted file mode 100644
index 099551fb8a96edb8b6ff9e11fc6ed0e597731600..0000000000000000000000000000000000000000
--- a/tlnos/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- coding: utf-8 -*-
-# tlnos MODULE initialization file
-
-import fwk
-import tbox
-from tlnosw import *
diff --git a/tlnos/_src/CMakeLists.txt b/tlnos/_src/CMakeLists.txt
deleted file mode 100644
index 32cc07907a3c58c362d3fd32967ebbcbc793b670..0000000000000000000000000000000000000000
--- a/tlnos/_src/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# CMake input file of the SWIG wrapper around "tlnosw.so"
-
-INCLUDE(${SWIG_USE_FILE})
-
-INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-
-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}/tlnos/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(tlnosw python ${ISRCS} ${SRCS})
-else()
-    SWIG_ADD_LIBRARY(tlnosw LANGUAGE python SOURCES ${ISRCS} ${SRCS})
-endif()
-MACRO_DebugPostfix(_tlnosw)
-
-# -- Search for Trilinos
-FIND_PACKAGE(Trilinos REQUIRED)
-
-INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/tlnos/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src 
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src
-                     ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src 
-                     ${Trilinos_INCLUDE_DIRS} 
-                     ${Trilinos_TPL_INCLUDE_DIRS}
-                     ${MPI_INCLUDE_PATH})
-
-SWIG_LINK_LIBRARIES(tlnosw 
-                    tlnos tbox fwk ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${PYTHON_LIBRARIES}
-)
-
-INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/tlnosw.py DESTINATION ${CMAKE_INSTALL_PREFIX})
-INSTALL(TARGETS _tlnosw DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/tlnos/_src/tlnosw.i b/tlnos/_src/tlnosw.i
deleted file mode 100644
index abba5b89965d6a58bbdc1290753db307c8c5b853..0000000000000000000000000000000000000000
--- a/tlnos/_src/tlnosw.i
+++ /dev/null
@@ -1,53 +0,0 @@
-// SWIG input file of the 'tlnos' module
-
-%feature("autodoc","1");
-
-%module(docstring=
-"'tlnosw' module: tests of Trilinos library
-(c) ULg - A&M",
-directors="1",
-threads="1"
-) tlnosw
-%{
-
-#include <string>
-#include <sstream>
-#include <typeinfo>
-#include "tlnos.h"
-
-#include "wExample1.h"
-#include "wExample2.h"
-//#include "wExample3.h"
-#include "wExample4.h"
-#include "wExample5.h"
-#include "wExample6.h"
-//#include "wExample7.h"
-#include "wExample8.h"
-#include "wExample9.h"
-#include "wExample10.h"
-
-#include "fwkw.h"
-#include "tboxw.h"
-
-%}
-
-%include "fwkw.swg"
-
-// ----------- MODULES UTILISES ------------
-%import "fwkw.i"
-%import "tboxw.i"
-
-// ----------- TLNOS CLASSES ----------------
-%include "tlnos.h"
-
-
-%include "wExample1.h"
-%include "wExample2.h"
-//%include "wExample3.h"
-%include "wExample4.h"
-%include "wExample5.h"
-%include "wExample6.h"
-//%include "wExample7.h"
-%include "wExample8.h"
-%include "wExample9.h"
-%include "wExample10.h"
diff --git a/tlnos/broken/example3.py b/tlnos/broken/example3.py
deleted file mode 100755
index d887609b8980b9d9350aa3cf604b45c8e0b1f1a6..0000000000000000000000000000000000000000
--- a/tlnos/broken/example3.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example3()   
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/broken/example5.py b/tlnos/broken/example5.py
deleted file mode 100755
index 69d6d7cb7214826449060903b0b71052abc7e04c..0000000000000000000000000000000000000000
--- a/tlnos/broken/example5.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example5()   # [RB] missing file "TwoSquares.grid"
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/broken/example6.py b/tlnos/broken/example6.py
deleted file mode 100755
index 8816b0ce870d3d8d8c847827efd8a2519b85fe43..0000000000000000000000000000000000000000
--- a/tlnos/broken/example6.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example6()     # [RB] missing file "TwoSquares.grid" 
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/broken/example7.py b/tlnos/broken/example7.py
deleted file mode 100755
index c011606a5aa1c34e09cadfda9d370b49a972b970..0000000000000000000000000000000000000000
--- a/tlnos/broken/example7.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example7()   
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/broken/example8.py b/tlnos/broken/example8.py
deleted file mode 100755
index f1f175e0dc036cbca2a3ee858ca4b5fd0bcab36e..0000000000000000000000000000000000000000
--- a/tlnos/broken/example8.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example8()    # [RB] missing file "TwoSquaresDirichlet.grid" 
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/broken/example9.py b/tlnos/broken/example9.py
deleted file mode 100755
index dbb9b08e8b56d10afd2e65b7edee15129c96d88e..0000000000000000000000000000000000000000
--- a/tlnos/broken/example9.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example9()     # [RB] missing file "TwoSquaresDirichlet.grid" 
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/src/CMakeLists.txt b/tlnos/src/CMakeLists.txt
deleted file mode 100644
index ca02962e161cbea0ed0d69edf8e680e23934e5ad..0000000000000000000000000000000000000000
--- a/tlnos/src/CMakeLists.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-# CMake input file of tlnos.so
-
-FILE(GLOB SRCS *.h *.cpp *.inl *.hpp)
-ADD_LIBRARY(tlnos SHARED ${SRCS})
-MACRO_DebugPostfix(tlnos)
-
-# -- Search for Trilinos
-FIND_PACKAGE(Trilinos REQUIRED)
-
-set (_VERB 1)  # set to 1 for debugging
-IF(_VERB)
-    MESSAGE("\nFound Trilinos!  Here are the details: ")
-    MESSAGE("   Trilinos_DIR = ${Trilinos_DIR}")
-    MESSAGE("   Trilinos_VERSION = ${Trilinos_VERSION}")
-    MESSAGE("   Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
-    MESSAGE("   Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
-    MESSAGE("   Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
-    MESSAGE("   Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
-    MESSAGE("   Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
-    MESSAGE("   Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
-    MESSAGE("   Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
-    MESSAGE("   Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
-    MESSAGE("   Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
-    MESSAGE("End of Trilinos details\n")
-ENDIF()
-
-# MPI check 
-LIST(FIND Trilinos_TPL_LIST MPI MPI_List_ID)
-IF (MPI_List_ID GREATER -1)
-  MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI ENABLED")
-  SET(MYAPP_MPI TRUE)
-  ADD_DEFINITIONS(-DMYAPP_MPI)
-ELSE()
-  MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI NOT ENABLED")
-  SET(MYAPP_MPI FALSE)
-ENDIF()
-
-# Set optional dependency in MyApp on Epetra package: 
-#   this toggles code within  #ifdef MYAPP_EPETRA 
-LIST(FIND Trilinos_PACKAGE_LIST Epetra Epetra_List_ID)
-IF (Epetra_List_ID GREATER -1)
-  ADD_DEFINITIONS(-DMYAPP_EPETRA)
-  MESSAGE("-- Looking for Epetra: -- found, compiling with -DMYAPP_EPETRA")
-  SET(MYAPP_EPETRA TRUE)
-ELSE()
-  MESSAGE("-- Looking for Epetra: -- not found.")
-  SET(MYAPP_EPETRA FALSE)
-ENDIF()
-
-# --------------------------------------------------------------
-# Finds MPI (including MSMPI)
-# --------------------------------------------------------------
-if(WIN32)  
-    FIND_PATH(MPI_INCLUDE_PATH NAMES  mpi.h HINTS "$ENV{MSMPI_INC}")
-    if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-        set(MS_MPI_ARCH_DIR x64)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB64}")
-    else()
-        set(MS_MPI_ARCH_DIR x86)
-        find_library(MPI_LIBRARIES msmpi PATHS "$ENV{MSMPI_LIB32}")
-    endif()
-else()
-    find_package(MPI REQUIRED)
-    # intel mpi (mpi.h doit etre inclus avant stdio.h)
-    # ou definir ces 2 macros
-    ADD_DEFINITIONS(-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX)
-endif()
-# --------------------------------------------------------------
-
-INCLUDE_DIRECTORIES (  ${PROJECT_SOURCE_DIR}/tbox/src  
-                       ${PROJECT_SOURCE_DIR}/fwk/src
-                       ${Trilinos_INCLUDE_DIRS} 
-                       ${Trilinos_TPL_INCLUDE_DIRS}
-                       ${MPI_INCLUDE_PATH})
-
-LINK_DIRECTORIES (${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
-        
-TARGET_LINK_LIBRARIES(tlnos tbox fwk ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${MPI_LIBRARIES})
-
-INSTALL(TARGETS tlnos DESTINATION ${CMAKE_INSTALL_PREFIX})
diff --git a/tlnos/src/Example_BCStrategy_Dirichlet_Constant.hpp b/tlnos/src/Example_BCStrategy_Dirichlet_Constant.hpp
deleted file mode 100644
index dded2612a22c54747b8be0c289673053772b2b77..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_BCStrategy_Dirichlet_Constant.hpp
+++ /dev/null
@@ -1,81 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __Example_BC_Dirichlet_Constant_hpp__
-#define __Example_BC_Dirichlet_Constant_hpp__
-
-#include <vector>
-#include <string>
-
-#include "Teuchos_RCP.hpp"
-#include "Panzer_BCStrategy_Dirichlet_DefaultImpl.hpp"
-#include "Panzer_Traits.hpp"
-#include "Panzer_PureBasis.hpp"
-#include "Phalanx_FieldManager.hpp"
-
-namespace Example
-{
-
-template <typename EvalT>
-class BCStrategy_Dirichlet_Constant : public panzer::BCStrategy_Dirichlet_DefaultImpl<EvalT>
-{
-public:
-    BCStrategy_Dirichlet_Constant(const panzer::BC &bc, const Teuchos::RCP<panzer::GlobalData> &global_data);
-
-    void setup(const panzer::PhysicsBlock &side_pb,
-               const Teuchos::ParameterList &user_data);
-
-    void buildAndRegisterEvaluators(PHX::FieldManager<panzer::Traits> &fm,
-                                    const panzer::PhysicsBlock &pb,
-                                    const panzer::ClosureModelFactory_TemplateManager<panzer::Traits> &factory,
-                                    const Teuchos::ParameterList &models,
-                                    const Teuchos::ParameterList &user_data) const;
-
-    std::string residual_name;
-    Teuchos::RCP<panzer::PureBasis> basis;
-};
-
-} // namespace Example
-
-#include "Example_BCStrategy_Dirichlet_Constant_impl.hpp"
-
-#endif
diff --git a/tlnos/src/Example_BCStrategy_Dirichlet_Constant_impl.hpp b/tlnos/src/Example_BCStrategy_Dirichlet_Constant_impl.hpp
deleted file mode 100644
index 7a8207e3fa571ff7cf64befabd3a55158e1b86b1..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_BCStrategy_Dirichlet_Constant_impl.hpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#include "Teuchos_ParameterList.hpp"
-#include "Teuchos_RCP.hpp"
-#include "Teuchos_Assert.hpp"
-#include "Phalanx_DataLayout_MDALayout.hpp"
-#include "Phalanx_FieldManager.hpp"
-#include "Panzer_PhysicsBlock.hpp"
-
-#include "Panzer_PureBasis.hpp"
-
-// Evaluators
-#include "Panzer_Constant.hpp"
-
-#include "Phalanx_MDField.hpp"
-#include "Phalanx_DataLayout.hpp"
-#include "Phalanx_DataLayout_MDALayout.hpp"
-
-// ***********************************************************************
-template <typename EvalT>
-Example::BCStrategy_Dirichlet_Constant<EvalT>::
-    BCStrategy_Dirichlet_Constant(const panzer::BC &bc, const Teuchos::RCP<panzer::GlobalData> &global_data) : panzer::BCStrategy_Dirichlet_DefaultImpl<EvalT>(bc, global_data)
-{
-    TEUCHOS_ASSERT(this->m_bc.strategy() == "Constant");
-}
-
-// ***********************************************************************
-template <typename EvalT>
-void Example::BCStrategy_Dirichlet_Constant<EvalT>::
-    setup(const panzer::PhysicsBlock &side_pb,
-          const Teuchos::ParameterList &user_data)
-{
-    using std::pair;
-    using std::string;
-    using std::vector;
-    using Teuchos::RCP;
-
-    // need the dof value to form the residual
-    this->required_dof_names.push_back(this->m_bc.equationSetName());
-
-    // unique residual name
-    this->residual_name = "Residual_" + this->m_bc.identifier();
-
-    // map residual to dof
-    this->residual_to_dof_names_map[residual_name] = this->m_bc.equationSetName();
-
-    // map residual to target field
-    this->residual_to_target_field_map[residual_name] = "Constant_" + this->m_bc.equationSetName();
-
-    // find the basis for this dof
-    const vector<pair<string, RCP<panzer::PureBasis>>> &dofs = side_pb.getProvidedDOFs();
-
-    for (vector<pair<string, RCP<panzer::PureBasis>>>::const_iterator dof_it =
-             dofs.begin();
-         dof_it != dofs.end(); ++dof_it)
-    {
-        if (dof_it->first == this->m_bc.equationSetName())
-            this->basis = dof_it->second;
-    }
-
-    TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(this->basis), std::runtime_error,
-                               "Error the name \"" << this->m_bc.equationSetName()
-                                                   << "\" is not a valid DOF for the boundary condition:\n"
-                                                   << this->m_bc << "\n");
-}
-
-// ***********************************************************************
-template <typename EvalT>
-void Example::BCStrategy_Dirichlet_Constant<EvalT>::
-    buildAndRegisterEvaluators(PHX::FieldManager<panzer::Traits> &fm,
-                               const panzer::PhysicsBlock &pb,
-                               const panzer::ClosureModelFactory_TemplateManager<panzer::Traits> &factory,
-                               const Teuchos::ParameterList &models,
-                               const Teuchos::ParameterList &user_data) const
-{
-    using Teuchos::ParameterList;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    // provide a constant target value to map into residual
-    {
-        ParameterList p("BC Constant Dirichlet");
-        p.set("Name", "Constant_" + this->m_bc.equationSetName());
-        p.set("Data Layout", basis->functional);
-        p.set("Value", this->m_bc.params()->template get<double>("Value"));
-
-        RCP<PHX::Evaluator<panzer::Traits>> op =
-            rcp(new panzer::Constant<EvalT, panzer::Traits>(p));
-
-        this->template registerEvaluator<EvalT>(fm, op);
-    }
-}
diff --git a/tlnos/src/Example_BCStrategy_Factory.hpp b/tlnos/src/Example_BCStrategy_Factory.hpp
deleted file mode 100644
index 3cf912be87ccdbb6741febedb0fd182fbd81b18b..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_BCStrategy_Factory.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __Example_BCStrategyFactory_hpp__
-#define __Example_BCStrategyFactory_hpp__
-
-#include "Teuchos_RCP.hpp"
-#include "Panzer_Traits.hpp"
-#include "Panzer_BCStrategy_TemplateManager.hpp"
-#include "Panzer_BCStrategy_Factory.hpp"
-#include "Panzer_BCStrategy_Factory_Defines.hpp"
-
-// Add my bcstrategies here
-#include "Example_BCStrategy_Dirichlet_Constant.hpp"
-
-namespace Example
-{
-
-PANZER_DECLARE_BCSTRATEGY_TEMPLATE_BUILDER("Constant",
-                                           BCStrategy_Dirichlet_Constant,
-                                           BCStrategy_Dirichlet_Constant)
-
-struct BCStrategyFactory : public panzer::BCStrategyFactory
-{
-
-    Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits>>
-    buildBCStrategy(const panzer::BC &bc, const Teuchos::RCP<panzer::GlobalData> &global_data) const
-    {
-
-        Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits>> bcs_tm =
-            Teuchos::rcp(new panzer::BCStrategy_TemplateManager<panzer::Traits>);
-
-        bool found = false;
-
-        PANZER_BUILD_BCSTRATEGY_OBJECTS("Constant",
-                                        Example::BCStrategy_Dirichlet_Constant,
-                                        BCStrategy_Dirichlet_Constant)
-
-        TEUCHOS_TEST_FOR_EXCEPTION(!found, std::logic_error,
-                                   "Error - the BC Strategy called \"" << bc.strategy() << "\" is not a valid identifier in the BCStrategyFactory.  Either add a "
-                                                                                           "valid implementation to your factory or fix your input file.  The "
-                                                                                           "relevant boundary condition is:\n\n"
-                                                                       << bc << std::endl);
-
-        return bcs_tm;
-    }
-};
-
-} // namespace Example
-
-#endif
diff --git a/tlnos/src/Example_ClosureModel_Factory.hpp b/tlnos/src/Example_ClosureModel_Factory.hpp
deleted file mode 100644
index 9a8d7e51dec6c7fafda06d41792bb29f0ea0dbd9..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_ClosureModel_Factory.hpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __Example_ClosureModelFactory_hpp__
-#define __Example_ClosureModelFactory_hpp__
-
-#include "Panzer_ClosureModel_Factory.hpp"
-
-namespace panzer
-{
-class InputEquationSet;
-}
-
-namespace Example
-{
-
-template <typename EvalT>
-class ModelFactory : public panzer::ClosureModelFactory<EvalT>
-{
-
-public:
-    Teuchos::RCP<std::vector<Teuchos::RCP<PHX::Evaluator<panzer::Traits>>>>
-    buildClosureModels(const std::string &model_id,
-                       const Teuchos::ParameterList &models,
-                       const panzer::FieldLayoutLibrary &fl,
-                       const Teuchos::RCP<panzer::IntegrationRule> &ir,
-                       const Teuchos::ParameterList &default_params,
-                       const Teuchos::ParameterList &user_data,
-                       const Teuchos::RCP<panzer::GlobalData> &global_data,
-                       PHX::FieldManager<panzer::Traits> &fm) const;
-};
-
-} // namespace Example
-
-#include "Example_ClosureModel_Factory_impl.hpp"
-
-#endif
diff --git a/tlnos/src/Example_ClosureModel_Factory_TemplateBuilder.hpp b/tlnos/src/Example_ClosureModel_Factory_TemplateBuilder.hpp
deleted file mode 100644
index 8b039db50b9db934743c3781fbc28617b55524c1..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_ClosureModel_Factory_TemplateBuilder.hpp
+++ /dev/null
@@ -1,66 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __Example_ClosureModel_Factory_TemplateBuilder_hpp__
-#define __Example_ClosureModel_Factory_TemplateBuilder_hpp__
-
-#include <string>
-#include "Sacado_mpl_apply.hpp"
-#include "Teuchos_RCP.hpp"
-#include "Example_ClosureModel_Factory.hpp"
-
-namespace Example
-{
-
-class ClosureModelFactory_TemplateBuilder
-{
-public:
-    template <typename EvalT>
-    Teuchos::RCP<panzer::ClosureModelFactoryBase> build() const
-    {
-        return Teuchos::rcp(static_cast<panzer::ClosureModelFactoryBase *>(new Example::ModelFactory<EvalT>));
-    }
-};
-
-} // namespace Example
-
-#endif
diff --git a/tlnos/src/Example_ClosureModel_Factory_impl.hpp b/tlnos/src/Example_ClosureModel_Factory_impl.hpp
deleted file mode 100644
index 8965ef16d067772943976d996544567d927285e0..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_ClosureModel_Factory_impl.hpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __Example_ClosureModelFactoryT_hpp__
-#define __Example_ClosureModelFactoryT_hpp__
-
-#include <iostream>
-#include <sstream>
-#include <typeinfo>
-#include "Panzer_IntegrationRule.hpp"
-#include "Panzer_BasisIRLayout.hpp"
-#include "Panzer_Integrator_Scalar.hpp"
-#include "Phalanx_FieldTag_Tag.hpp"
-#include "Teuchos_ParameterEntry.hpp"
-#include "Teuchos_TypeNameTraits.hpp"
-
-// ********************************************************************
-// ********************************************************************
-template <typename EvalT>
-Teuchos::RCP<std::vector<Teuchos::RCP<PHX::Evaluator<panzer::Traits>>>>
-Example::ModelFactory<EvalT>::
-    buildClosureModels(const std::string &model_id,
-                       const Teuchos::ParameterList &models,
-                       const panzer::FieldLayoutLibrary &fl,
-                       const Teuchos::RCP<panzer::IntegrationRule> &ir,
-                       const Teuchos::ParameterList &default_params,
-                       const Teuchos::ParameterList &user_data,
-                       const Teuchos::RCP<panzer::GlobalData> &global_data,
-                       PHX::FieldManager<panzer::Traits> &fm) const
-{
-    using PHX::Evaluator;
-    using std::string;
-    using std::vector;
-    using Teuchos::ParameterList;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    RCP<vector<RCP<Evaluator<panzer::Traits>>>> evaluators =
-        rcp(new vector<RCP<Evaluator<panzer::Traits>>>);
-
-    if (!models.isSublist(model_id))
-    {
-        models.print(std::cout);
-        std::stringstream msg;
-        msg << "Falied to find requested model, \"" << model_id
-            << "\", for equation set:\n"
-            << std::endl;
-        TEUCHOS_TEST_FOR_EXCEPTION(!models.isSublist(model_id), std::logic_error, msg.str());
-    }
-
-    std::vector<Teuchos::RCP<const panzer::PureBasis>> bases;
-    fl.uniqueBases(bases);
-
-    const ParameterList &my_models = models.sublist(model_id);
-
-    for (ParameterList::ConstIterator model_it = my_models.begin();
-         model_it != my_models.end(); ++model_it)
-    {
-
-        bool found = false;
-
-        const std::string key = model_it->first;
-        ParameterList input;
-        const Teuchos::ParameterEntry &entry = model_it->second;
-        const ParameterList &plist = Teuchos::getValue<Teuchos::ParameterList>(entry);
-
-        if (plist.isType<double>("Value"))
-        {
-            { // at IP
-                input.set("Name", key);
-                input.set("Value", plist.get<double>("Value"));
-                input.set("Data Layout", ir->dl_scalar);
-                RCP<Evaluator<panzer::Traits>> e =
-                    rcp(new panzer::Constant<EvalT, panzer::Traits>(input));
-                evaluators->push_back(e);
-            }
-
-            for (std::vector<Teuchos::RCP<const panzer::PureBasis>>::const_iterator basis_itr = bases.begin();
-                 basis_itr != bases.end(); ++basis_itr)
-            { // at BASIS
-                input.set("Name", key);
-                input.set("Value", plist.get<double>("Value"));
-                Teuchos::RCP<const panzer::BasisIRLayout> basis = basisIRLayout(*basis_itr, *ir);
-                input.set("Data Layout", basis->functional);
-                RCP<Evaluator<panzer::Traits>> e =
-                    rcp(new panzer::Constant<EvalT, panzer::Traits>(input));
-                evaluators->push_back(e);
-            }
-            found = true;
-        }
-
-        if (!found)
-        {
-            std::stringstream msg;
-            msg << "ClosureModelFactory failed to build evaluator for key \"" << key
-                << "\"\nin model \"" << model_id
-                << "\".  Please correct the type or add support to the \nfactory." << std::endl;
-            TEUCHOS_TEST_FOR_EXCEPTION(!found, std::logic_error, msg.str());
-        }
-    }
-
-    return evaluators;
-}
-
-#endif
diff --git a/tlnos/src/Example_EquationSetFactory.hpp b/tlnos/src/Example_EquationSetFactory.hpp
deleted file mode 100644
index f06c01d195c9392d83cfde6b3c96e20ed8753b69..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_EquationSetFactory.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __PoissonExample_EquationSetFactory_hpp__
-#define __PoissonExample_EquationSetFactory_hpp__
-
-#include "Panzer_EquationSet_Factory.hpp"
-#include "Panzer_EquationSet_Factory_Defines.hpp"
-#include "Panzer_CellData.hpp"
-
-// Add my equation sets here
-#include "Example_PoissonEquationSet.hpp"
-
-namespace Example
-{
-
-// A macro that defines a class to make construction of the equation sets easier
-//   - The equation set is constructed over a list of automatic differention types
-PANZER_DECLARE_EQSET_TEMPLATE_BUILDER("Poisson", PoissonEquationSet, PoissonEquationSet)
-
-// A user written factory that creates each equation set.  The key member here
-// is buildEquationSet
-class EquationSetFactory : public panzer::EquationSetFactory
-{
-public:
-    Teuchos::RCP<panzer::EquationSet_TemplateManager<panzer::Traits>>
-    buildEquationSet(const Teuchos::RCP<Teuchos::ParameterList> &params,
-                     const int &default_integration_order,
-                     const panzer::CellData &cell_data,
-                     const Teuchos::RCP<panzer::GlobalData> &global_data,
-                     const bool build_transient_support) const
-    {
-        Teuchos::RCP<panzer::EquationSet_TemplateManager<panzer::Traits>> eq_set =
-            Teuchos::rcp(new panzer::EquationSet_TemplateManager<panzer::Traits>);
-
-        bool found = false; // this is used by PANZER_BUILD_EQSET_OBJECTS
-
-        // macro checks if(ies.name=="Poisson") then an EquationSet_Energy object is constructed
-        PANZER_BUILD_EQSET_OBJECTS("Poisson", PoissonEquationSet, PoissonEquationSet)
-
-        // make sure your equation set has been found
-        if (!found)
-        {
-            std::string msg = "Error - the \"Equation Set\" called \"" + params->get<std::string>("Type") +
-                              "\" is not a valid equation set identifier. Please supply the correct factory.\n";
-            TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, msg);
-        }
-
-        return eq_set;
-    }
-};
-
-} // namespace Example
-
-#endif
diff --git a/tlnos/src/Example_PoissonEquationSet.hpp b/tlnos/src/Example_PoissonEquationSet.hpp
deleted file mode 100644
index f3cfbe59447c0c6ecfe959002fe3cf4fae6720e9..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_PoissonEquationSet.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef __PoissonExample_EquationSet_Energy_hpp__
-#define __PoissonExample_EquationSet_Energy_hpp__
-
-#include <vector>
-#include <string>
-
-#include "Teuchos_RCP.hpp"
-#include "Panzer_EquationSet_DefaultImpl.hpp"
-#include "Panzer_Traits.hpp"
-#include "Phalanx_FieldManager.hpp"
-
-namespace Example
-{
-
-/** The equation set serves two roles. The first is to let the panzer library
-  * know which fields this equation set defines and their names. It registers
-  * the evaluators required for a particular equation set. The level of the
-  * granularity is largely up to a user. For instance this could be the momentum
-  * or continuity equation in Navier-Stokes, or it could simply be the Navier-Stokes
-  * equations. 
-  *
-  * Generally, this inherits from the panzer::EquationSet_DefaultImpl which takes
-  * care of adding the gather (extract basis coefficients from solution vector) and 
-  * scatter (using element matrices and vectors distribute and sum their values
-  * to a global linear system) evaluators. These use data members that must be set by
-  * the user.
-  */
-template <typename EvalT>
-class PoissonEquationSet : public panzer::EquationSet_DefaultImpl<EvalT>
-{
-public:
-    /** In the constructor you set all the fields provided by this
-     * equation set. 
-     */
-    PoissonEquationSet(const Teuchos::RCP<Teuchos::ParameterList> &params,
-                       const int &default_integration_order,
-                       const panzer::CellData &cell_data,
-                       const Teuchos::RCP<panzer::GlobalData> &global_data,
-                       const bool build_transient_support);
-
-    /** The specific evaluators are registered with the field manager argument.
-     */
-    void buildAndRegisterEquationSetEvaluators(PHX::FieldManager<panzer::Traits> &fm,
-                                               const panzer::FieldLibrary &field_library,
-                                               const Teuchos::ParameterList &user_data) const;
-};
-
-} // namespace Example
-
-#include "Example_PoissonEquationSet_impl.hpp"
-
-#endif
diff --git a/tlnos/src/Example_PoissonEquationSet_impl.hpp b/tlnos/src/Example_PoissonEquationSet_impl.hpp
deleted file mode 100644
index 8990248e61c259aa17e439fe9c4e3a43c1e46416..0000000000000000000000000000000000000000
--- a/tlnos/src/Example_PoissonEquationSet_impl.hpp
+++ /dev/null
@@ -1,213 +0,0 @@
-// @HEADER
-// ***********************************************************************
-//
-//           Panzer: A partial differential equation assembly
-//       engine for strongly coupled complex multiphysics systems
-//                 Copyright (2011) Sandia Corporation
-//
-// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
-// the U.S. Government retains certain rights in this software.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
-// Eric C. Cyr (eccyr@sandia.gov)
-// ***********************************************************************
-// @HEADER
-
-#ifndef USER_APP_EQUATIONSET_ENERGY_T_HPP
-#define USER_APP_EQUATIONSET_ENERGY_T_HPP
-
-#include "Teuchos_ParameterList.hpp"
-#include "Teuchos_StandardParameterEntryValidators.hpp"
-#include "Teuchos_RCP.hpp"
-#include "Teuchos_Assert.hpp"
-#include "Phalanx_DataLayout_MDALayout.hpp"
-#include "Phalanx_FieldManager.hpp"
-
-#include "Panzer_IntegrationRule.hpp"
-#include "Panzer_BasisIRLayout.hpp"
-
-// include evaluators here
-#include "Panzer_Integrator_BasisTimesScalar.hpp"
-#include "Panzer_Integrator_GradBasisDotVector.hpp"
-#include "Panzer_ScalarToVector.hpp"
-#include "Panzer_Sum.hpp"
-#include "Panzer_Constant.hpp"
-
-// ***********************************************************************
-template <typename EvalT>
-Example::PoissonEquationSet<EvalT>::
-    PoissonEquationSet(const Teuchos::RCP<Teuchos::ParameterList> &params,
-                       const int &default_integration_order,
-                       const panzer::CellData &cell_data,
-                       const Teuchos::RCP<panzer::GlobalData> &global_data,
-                       const bool build_transient_support) : panzer::EquationSet_DefaultImpl<EvalT>(params, default_integration_order, cell_data, global_data, build_transient_support)
-{
-    // ********************
-    // Validate and parse parameter list
-    // ********************
-    {
-        Teuchos::ParameterList valid_parameters;
-        this->setDefaultValidParameters(valid_parameters);
-
-        valid_parameters.set("Model ID", "", "Closure model id associated with this equaiton set");
-        valid_parameters.set("Basis Type", "HGrad", "Type of Basis to use");
-        valid_parameters.set("Basis Order", 1, "Order of the basis");
-        valid_parameters.set("Integration Order", -1, "Order of the integration rule");
-
-        params->validateParametersAndSetDefaults(valid_parameters);
-    }
-
-    std::string basis_type = params->get<std::string>("Basis Type");
-    int basis_order = params->get<int>("Basis Order");
-    int integration_order = params->get<int>("Integration Order");
-    std::string model_id = params->get<std::string>("Model ID");
-
-    // ********************
-    // Panzer uses strings to match fields. In this section we define the
-    // name of the fields provided by this equation set. This is a bit strange
-    // in that this is not the fields necessarily required by this equation set.
-    // For instance for the momentum equations in Navier-Stokes only the velocity
-    // fields are added, the pressure field is added by continuity.
-    //
-    // In this case "TEMPERATURE" is the lone field.  We also name the gradient
-    // for this field. These names automatically generate evaluators for "TEMPERATURE"
-    // and "GRAD_TEMPERATURE" gathering the basis coefficients of "TEMPERATURE" and
-    // the values of the TEMPERATURE and GRAD_TEMPERATURE fields at quadrature points.
-    //
-    // After all the equation set evaluators are added to a given field manager, the
-    // panzer code adds in appropriate scatter evaluators to distribute the
-    // entries into the residual and the Jacobian operator. These operators will be
-    // "required" by the field manager and will serve as roots of evaluation tree.
-    // The leaves of this tree will include the gather evaluators whose job it is to
-    // gather the solution from a vector.
-    // ********************
-
-    // ********************
-    // Assemble DOF names and Residual names
-    // ********************
-
-    this->addDOF("TEMPERATURE", basis_type, basis_order, integration_order);
-    this->addDOFGrad("TEMPERATURE");
-    if (this->buildTransientSupport())
-        this->addDOFTimeDerivative("TEMPERATURE");
-
-    // ********************
-    // Build Basis Functions and Integration Rules
-    // ********************
-
-    this->addClosureModel(model_id);
-
-    this->setupDOFs();
-}
-
-// ***********************************************************************
-template <typename EvalT>
-void Example::PoissonEquationSet<EvalT>::
-    buildAndRegisterEquationSetEvaluators(PHX::FieldManager<panzer::Traits> &fm,
-                                          const panzer::FieldLibrary &fl,
-                                          const Teuchos::ParameterList &user_data) const
-{
-    using Teuchos::ParameterList;
-    using Teuchos::RCP;
-    using Teuchos::rcp;
-
-    Teuchos::RCP<panzer::IntegrationRule> ir = this->getIntRuleForDOF("TEMPERATURE");
-    Teuchos::RCP<panzer::BasisIRLayout> basis = this->getBasisIRLayoutForDOF("TEMPERATURE");
-
-    // ********************
-    // Energy Equation
-    // ********************
-
-    // Transient Operator: Assembles \int \dot{T} v
-    if (this->buildTransientSupport())
-    {
-        ParameterList p("Transient Residual");
-        p.set("Residual Name", "RESIDUAL_TEMPERATURE_TRANSIENT_OP"); // we are defining the name of this operator
-        p.set("Value Name", "DXDT_TEMPERATURE");                     // this field is constructed by the panzer library
-        p.set("Basis", basis);
-        p.set("IR", ir);
-        p.set("Multiplier", 1.0);
-
-        RCP<PHX::Evaluator<panzer::Traits>> op =
-            rcp(new panzer::Integrator_BasisTimesScalar<EvalT, panzer::Traits>(p));
-
-        this->template registerEvaluator<EvalT>(fm, op);
-    }
-
-    // Diffusion Operator: Assembles \int \nabla T \cdot \nabla v
-    {
-        double thermal_conductivity = 1.0;
-
-        ParameterList p("Diffusion Residual");
-        p.set("Residual Name", "RESIDUAL_TEMPERATURE_DIFFUSION_OP");
-        p.set("Flux Name", "GRAD_TEMPERATURE"); // this field is constructed by the panzer library
-        p.set("Basis", basis);
-        p.set("IR", ir);
-        p.set("Multiplier", thermal_conductivity);
-
-        RCP<PHX::Evaluator<panzer::Traits>> op =
-            rcp(new panzer::Integrator_GradBasisDotVector<EvalT, panzer::Traits>(p));
-
-        this->template registerEvaluator<EvalT>(fm, op);
-    }
-
-    // Source Operator
-    {
-        ParameterList p("Source Residual");
-        p.set("Residual Name", "RESIDUAL_TEMPERATURE_SOURCE_OP");
-        p.set("Value Name", "SOURCE_TEMPERATURE"); // this field must be provided by the closure model factory
-                                                   // and specified by the user
-        p.set("Basis", basis);
-        p.set("IR", ir);
-        p.set("Multiplier", -1.0);
-
-        RCP<PHX::Evaluator<panzer::Traits>> op =
-            rcp(new panzer::Integrator_BasisTimesScalar<EvalT, panzer::Traits>(p));
-
-        this->template registerEvaluator<EvalT>(fm, op);
-    }
-
-    // Use a sum operator to form the overall residual for the equation
-    {
-        std::vector<std::string> sum_names;
-
-        // these are the names of the residual values to sum together
-        sum_names.push_back("RESIDUAL_TEMPERATURE_DIFFUSION_OP");
-        sum_names.push_back("RESIDUAL_TEMPERATURE_SOURCE_OP");
-        if (this->buildTransientSupport())
-            sum_names.push_back("RESIDUAL_TEMPERATURE_TRANSIENT_OP");
-
-        this->buildAndRegisterResidualSummationEvalautor(fm, "TEMPERATURE", sum_names);
-    }
-}
-
-// ***********************************************************************
-
-#endif
diff --git a/tlnos/src/ExodusInterface.h b/tlnos/src/ExodusInterface.h
deleted file mode 100644
index e0847ac7a1489b092fae83722cd51e7a1d5771eb..0000000000000000000000000000000000000000
--- a/tlnos/src/ExodusInterface.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-#@HEADER
-# ************************************************************************
-#
-#                          Moertel FE Package
-#                 Copyright (2006) Sandia Corporation
-#
-# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-# license for use of this work by or on behalf of the U.S. Government.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the Corporation nor the names of the
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Questions? Contact Glen Hansen (gahanse@sandia.gov)
-#
-# ************************************************************************
-#@HEADER
-*/
-
-#ifndef MOERTEL_EXODUS_H
-#define MOERTEL_EXODUS_H
-
-#include <iostream>
-#include <iomanip>
-#include "Epetra_Map.h"
-#include "Epetra_MultiVector.h"
-#include "Epetra_Import.h"
-#include "Galeri_AbstractGrid.h"
-
-// Exodus stuff
-
-#include "exodusII.h"
-
-using namespace std;
-
-class ExodusInterface
-{
-
-public:
-    ExodusInterface(Epetra_Comm &Comm) : Comm_(Comm) {}
-
-    ~ExodusInterface() {}
-
-    const Epetra_Comm &Comm() const
-    {
-        return (Comm_);
-    }
-
-    void Write(const Galeri::FiniteElements::AbstractGrid &data, const string &BaseName,
-               const Epetra_MultiVector &Field)
-    {
-
-        int comp_ws = sizeof(double); // = 8
-        int io_ws = sizeof(double);   // = 8
-
-        string FileName = BaseName + ".exo";
-        int ex_id = ex_create(FileName.c_str(), EX_CLOBBER, &comp_ws, &io_ws);
-
-        int num_dim = data.NumDimensions();
-        int num_nodes = data.NumGlobalVertices();
-        int num_elem = data.NumGlobalElements();
-        int num_elem_blk = 1;
-        int num_node_sets = 0;
-        int num_side_sets = 0;
-
-        int ex_err = ex_put_init(ex_id, FileName.c_str(), num_dim,
-                                 num_nodes, num_elem, num_elem_blk,
-                                 num_node_sets, num_side_sets);
-
-        vector<double> coord(3);
-        vector<int> vertices(data.NumVerticesPerElement());
-
-        const Epetra_Map &RowMap = data.RowMap();
-        //    const Epetra_Map& VertexMap = data.VertexMap();
-
-        std::vector<double> x(data.NumMyVertices());
-        std::vector<double> y(data.NumMyVertices());
-        std::vector<double> z(data.NumMyVertices());
-
-        for (int i = 0; i < data.NumMyVertices(); ++i)
-        {
-            data.VertexCoord(i, &coord[0]);
-            x[i] = coord[0];
-            y[i] = coord[1];
-            z[i] = coord[2];
-        }
-
-        int n = 0;
-        if (Field.Comm().MyPID() == 0)
-            n = RowMap.NumGlobalElements();
-
-        Epetra_Map SingleProcMap(-1, n, 0, Field.Comm());
-        Epetra_MultiVector SingleProcField(SingleProcMap, 1);
-
-        Epetra_Import FieldImporter(SingleProcMap, RowMap);
-        SingleProcField.Import(Field, FieldImporter, Insert);
-
-        if (Comm().MyPID() == 0)
-        {
-            switch (data.NumDimensions())
-            {
-            case 2:
-            {
-                const char *coord_names[] = {"x", "y"};
-                ex_err = ex_put_coord_names(ex_id, (char **)coord_names);
-                ex_err = ex_put_coord(ex_id, &x[0], &y[0], NULL);
-            }
-            break;
-            case 3:
-            {
-                const char *coord_names[] = {"x", "y", "z"};
-                ex_err = ex_put_coord_names(ex_id, (char **)coord_names);
-                ex_err = ex_put_coord(ex_id, &x[0], &y[0], &z[0]);
-            }
-            break;
-            default:
-                throw(-1);
-            }
-        }
-        Comm().Barrier();
-
-        for (int ProcID = 0; ProcID < Comm().NumProc(); ++ProcID)
-        {
-
-            if (Comm().MyPID() == ProcID)
-            {
-
-                if (ProcID == 0)
-                {
-                    string type = data.ElementType();
-
-                    if (type == "GALERI_TRIANGLE")
-                    {
-                        const char *elem_type = "TRIANGLE";
-                        ex_err = ex_put_elem_block(ex_id, 1, (char *)elem_type, data.NumGlobalElements(), 3, 0);
-                    }
-                    else if (type == "GALERI_QUAD")
-                    {
-                        const char *elem_type = "QUAD4";
-                        ex_err = ex_put_elem_block(ex_id, 1, (char *)elem_type, data.NumGlobalElements(), 4, 0);
-                    }
-                    else if (type == "GALERI_TET")
-                    {
-                        const char *elem_type = "TETRA";
-                        ex_err = ex_put_elem_block(ex_id, 1, (char *)elem_type, data.NumGlobalElements(), 4, 0);
-                    }
-                    else if (type == "GALERI_HEX")
-                    {
-                        const char *elem_type = "HEX";
-                        ex_err = ex_put_elem_block(ex_id, 1, (char *)elem_type, data.NumGlobalElements(), 8, 0);
-                    }
-                    else
-                    {
-                        cerr << "Incorrect element type (" << type << ")" << endl;
-                        throw(-1);
-                    }
-                }
-
-                std::vector<int> connect_tmp(data.NumMyElements() * data.NumVerticesPerElement());
-                int cnt = 0;
-
-                for (int i = 0; i < data.NumMyElements(); ++i)
-                {
-                    data.ElementVertices(i, &vertices[0]);
-                    for (int j = 0; j < data.NumVerticesPerElement(); ++j)
-                        connect_tmp[cnt++] = data.VertexMap().GID(vertices[j]) + 1;
-                }
-
-                ex_err = ex_put_elem_conn(ex_id, 1, &connect_tmp[0]);
-            }
-
-            /* Write the field data out
-	
-		ex_err = ex_put_nodal_var(int exodus_file_id, int time_step, 
-		 int nodal_var_index, // which field set is being written
-		 int num_nodes, // number of nodes worth of data
-		 void *nodal_var_vals  // the data
-		);
-	*/
-
-            int num_nodal_fields = 1;
-            std::vector<double> field(data.NumMyVertices());
-
-            ex_err = ex_put_var_param(ex_id, "N", num_nodal_fields);
-
-            const char *var_names[] = {"u"};
-            ex_err = ex_put_var_names(ex_id, "N", num_nodal_fields, (char **)var_names);
-
-            //	  for(int i = 0; i < data.NumMyVertices(); i++)
-            //			  field[i] = SingleProcField[0][i];
-            for (int i = 0; i < data.NumMyVertices(); i++)
-                field[i] = Field[0][i];
-
-            ex_err = ex_put_nodal_var(ex_id, 1, 1, data.NumMyVertices(), &field[0]);
-
-            ex_err = ex_close(ex_id);
-
-            Comm().Barrier();
-
-        } // for Procs, write elements
-    }
-
-private:
-    const Epetra_Comm &Comm_;
-};
-
-#endif
diff --git a/tlnos/src/TOOLS/PDE_FEM.hpp b/tlnos/src/TOOLS/PDE_FEM.hpp
deleted file mode 100644
index 362d5338a4ad1a9ba7db64915b927471051b221d..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/PDE_FEM.hpp
+++ /dev/null
@@ -1,1055 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  data.hpp
-    \brief Generates and manages data for the Poisson example, including
-           all mesh and discretization data, matrices, etc.
-*/
-
-#ifndef ROL_PDEOPT_PDE_FEM_H
-#define ROL_PDEOPT_PDE_FEM_H
-
-#include "Teuchos_GlobalMPISession.hpp"
-#include "Teuchos_TimeMonitor.hpp"
-
-#include "Tpetra_DefaultPlatform.hpp"
-#include "Tpetra_MultiVector.hpp"
-#include "Tpetra_Vector.hpp"
-#include "Tpetra_CrsGraph.hpp"
-#include "Tpetra_CrsMatrix.hpp"
-#include "Tpetra_Version.hpp"
-#include "Tpetra_RowMatrixTransposer.hpp"
-#include "MatrixMarket_Tpetra.hpp"
-
-#include "Intrepid_HGRAD_QUAD_C2_FEM.hpp"
-#include "Intrepid_HGRAD_QUAD_C1_FEM.hpp"
-#include "Intrepid_DefaultCubatureFactory.hpp"
-#include "Intrepid_FunctionSpaceTools.hpp"
-#include "Intrepid_CellTools.hpp"
-
-#include "Amesos2.hpp"
-#include "./dofmanager.hpp"
-
-template <class Real>
-class PDE_FEM
-{
-
-protected:
-    Teuchos::RCP<MeshManager<Real>> meshMgr_;
-    Teuchos::RCP<DofManager<Real>> dofMgr_;
-    std::vector<Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>>> basisPtrs_;
-    Teuchos::RCP<Intrepid::DofCoordsInterface<Intrepid::FieldContainer<Real>>> coord_iface_;
-    Intrepid::FieldContainer<int> cellDofs_;
-
-    Teuchos::RCP<Teuchos::ParameterList> parlist_;
-    Teuchos::RCP<const Teuchos::Comm<int>> commPtr_;
-    Teuchos::RCP<std::ostream> outStream_;
-
-    int numLocalDofs_;
-    Intrepid::FieldContainer<int> ctn_;
-    Intrepid::FieldContainer<int> cte_;
-
-    int myRank_;
-    int numProcs_;
-
-    Real alpha_;
-    int basisOrder_;
-
-    Teuchos::RCP<const Tpetra::Map<>> myCellMap_;
-    Teuchos::RCP<const Tpetra::Map<>> myOverlapMap_;
-    Teuchos::RCP<const Tpetra::Map<>> myUniqueMap_;
-    Teuchos::RCP<Tpetra::CrsGraph<>> matGraph_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matA_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matA_dirichlet_;
-    //  Teuchos::RCP<Tpetra::CrsMatrix<> >    matA_dirichlet_trans_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matM_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matM_dirichlet_;
-    //  Teuchos::RCP<Tpetra::CrsMatrix<> >    matM_dirichlet_trans_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecUd_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecF_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecF_overlap_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecF_dirichlet_;
-
-    Teuchos::Array<Real> myCellMeasure_;
-    Teuchos::Array<int> myCellIds_;
-    // Elements on Boundary
-    std::vector<Teuchos::Array<int>> myBoundaryCellIds_;
-    // DBC
-    Teuchos::Array<int> myDirichletDofs_;
-    // BC Sides
-    std::vector<int> my_dbc_;
-    std::vector<int> my_nbc_;
-
-    //Point load on Bundary!
-    std::vector<int> myPointLoadDofs_;
-    std::vector<Real> myPointLoadVals_;
-
-    Teuchos::RCP<Amesos2::Solver<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>> solverA_;
-    //  Teuchos::RCP<Amesos2::Solver< Tpetra::CrsMatrix<>, Tpetra::MultiVector<> > > solverA_trans_;
-
-    shards::CellTopology cellType_;
-
-    int sideDim_;
-    int spaceDim_;
-    int numNodesPerCell_;
-    int numCubPoints_;
-    int lfs_;
-
-    int totalNumCells_;
-    int totalNumDofs_;
-    int numCells_;
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cubPoints_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cubWeights_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellNodes_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellJac_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellJacInv_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellJacDet_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellWeightedMeasure_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valReference_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradReference_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valPhysicalWeighted_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradPhysicalWeighted_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradgradMats_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valvalMats_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cubPointsPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dataF_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> datavalVecF_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dofPoints_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dofPointsPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dataUd_;
-
-    bool verbose_;
-
-protected:
-public:
-    // constructor
-    PDE_FEM() {}
-    // destructor
-    virtual ~PDE_FEM() {}
-
-    virtual void Initialize(const Teuchos::RCP<const Teuchos::Comm<int>> &comm,
-                            const Teuchos::RCP<Teuchos::ParameterList> &parlist,
-                            const Teuchos::RCP<std::ostream> &outStream)
-    {
-        commPtr_ = comm;
-        parlist_ = parlist;
-        outStream_ = outStream;
-        myRank_ = comm->getRank();
-        numProcs_ = comm->getSize();
-
-        verbose_ = parlist->sublist("PDE FEM").get("Verbose Output", false);
-        if (verbose_)
-        {
-            *outStream_ << "Total number of processors: " << numProcs_ << std::endl;
-        }
-
-        basisOrder_ = parlist->sublist("PDE FEM").get<int>("Order of FE Discretization");
-    }
-
-    void SetDiscretization(const Teuchos::RCP<MeshManager<Real>> &meshMgr,
-                           const std::vector<Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>>> &basisPtrs)
-    {
-        meshMgr_ = meshMgr;
-        totalNumCells_ = meshMgr_->getNumCells();
-
-        basisPtrs_ = basisPtrs;
-
-        // Retrieve some basic cell information.
-        cellType_ = (basisPtrs_[0])->getBaseCellTopology(); // get the cell type from any basis
-        spaceDim_ = cellType_.getDimension();               // retrieve spatial dimension
-        numNodesPerCell_ = cellType_.getNodeCount();        // retrieve number of nodes per cell
-
-        sideDim_ = spaceDim_ - 1;
-
-        coord_iface_ = Teuchos::rcp_dynamic_cast<Intrepid::DofCoordsInterface<Intrepid::FieldContainer<Real>>>(basisPtrs_[0]);
-        dofMgr_ = Teuchos::rcp(new DofManager<Real>(meshMgr_, basisPtrs_));
-    }
-
-    virtual void SetParallelStructure(void)
-    {
-        int cellSplit = parlist_->sublist("Geometry").get<int>("Partition type");
-        /****************************************************/
-        /*** Build parallel communication infrastructure. ***/
-        /****************************************************/
-        // Partition the cells in the mesh.  We use a basic quasi-equinumerous partitioning,
-        // where the remainder, if any, is assigned to the last processor.
-        Teuchos::Array<int> myGlobIds_;
-        Teuchos::Array<int> cellOffsets_(numProcs_, 0);
-        int cellsPerProc = totalNumCells_ / numProcs_;
-        numCells_ = cellsPerProc;
-        switch (cellSplit)
-        {
-        case 0:
-            if (myRank_ == 0)
-            { // remainder in the first
-                numCells_ += totalNumCells_ % numProcs_;
-            }
-            for (int i = 1; i < numProcs_; ++i)
-            {
-                cellOffsets_[i] = cellOffsets_[i - 1] + cellsPerProc + (static_cast<int>(i == 1)) * (totalNumCells_ % numProcs_);
-            }
-            break;
-        case 1:
-            if (myRank_ == numProcs_ - 1)
-            { // remainder in the last
-                numCells_ += totalNumCells_ % numProcs_;
-            }
-            for (int i = 1; i < numProcs_; ++i)
-            {
-                cellOffsets_[i] = cellOffsets_[i - 1] + cellsPerProc;
-            }
-            break;
-        case 2:
-            if (myRank_ < (totalNumCells_ % numProcs_))
-            { // spread remainder, starting from the first
-                numCells_++;
-            }
-            for (int i = 1; i < numProcs_; ++i)
-            {
-                cellOffsets_[i] = cellOffsets_[i - 1] + cellsPerProc + (static_cast<int>(i - 1 < (totalNumCells_ % numProcs_)));
-            }
-            break;
-        }
-
-        cellDofs_ = *(dofMgr_->getCellDofs());
-        numLocalDofs_ = cellDofs_.dimension(1);
-        if (verbose_)
-        {
-            *outStream_ << "Cell offsets across processors: " << cellOffsets_
-                        << std::endl;
-        }
-        for (int i = 0; i < numCells_; ++i)
-        {
-            myCellIds_.push_back(cellOffsets_[myRank_] + i);
-            for (int j = 0; j < numLocalDofs_; ++j)
-            {
-                myGlobIds_.push_back(cellDofs_(cellOffsets_[myRank_] + i, j));
-            }
-        }
-        std::sort(myGlobIds_.begin(), myGlobIds_.end());
-        myGlobIds_.erase(std::unique(myGlobIds_.begin(), myGlobIds_.end()), myGlobIds_.end());
-
-        // Build maps.
-        myOverlapMap_ = Teuchos::rcp(new Tpetra::Map<>(Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(),
-                                                       myGlobIds_, 0, commPtr_));
-        //std::cout << std::endl << myOverlapMap_->getNodeElementList()<<std::endl;
-        /** One can also use the non-member function:
-        myOverlapMap_ = Tpetra::createNonContigMap<int,int>(myGlobIds_, commPtr_);
-        to build the overlap map.
-    **/
-        myUniqueMap_ = Tpetra::createOneToOne<int, int>(myOverlapMap_);
-        //std::cout << std::endl << myUniqueMap_->getNodeElementList() << std::endl;
-        myCellMap_ = Teuchos::rcp(new Tpetra::Map<>(Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(),
-                                                    this->myCellIds_, 0, this->commPtr_));
-    }
-
-    virtual void SetUpLocalIntrepidArrays(void)
-    {
-        /****************************************************/
-        /*** Set up local discretization data and arrays. ***/
-        /****************************************************/
-        // Cubature data.
-        Intrepid::DefaultCubatureFactory<Real> cubFactory;                                        // create cubature factory
-        int cubDegree = 4;                                                                        // set cubature degree, e.g., 2
-        Teuchos::RCP<Intrepid::Cubature<Real>> cellCub = cubFactory.create(cellType_, cubDegree); // create default cubature
-        numCubPoints_ = cellCub->getNumPoints();                                                  // retrieve number of cubature points
-
-        lfs_ = dofMgr_->getLocalFieldSize(0);
-        // Discretization data.
-        cubPoints_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPoints_, spaceDim_));
-        cubWeights_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPoints_));
-        cubPointsPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_, spaceDim_));
-        dofPoints_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs_, spaceDim_));
-        dofPointsPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs_, spaceDim_));
-        cellNodes_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numNodesPerCell_, spaceDim_));
-        cellJac_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_, spaceDim_, spaceDim_));
-        cellJacInv_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_, spaceDim_, spaceDim_));
-        cellJacDet_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_));
-        cellWeightedMeasure_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_));
-        valReference_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs_, numCubPoints_));
-        gradReference_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs_, numCubPoints_, spaceDim_));
-        valPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs_, numCubPoints_));
-        gradPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs_, numCubPoints_, spaceDim_));
-        valPhysicalWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs_, numCubPoints_));
-        gradPhysicalWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs_, numCubPoints_, spaceDim_));
-
-        // Geometric definition of the cells in the mesh, based on the cell-to-node map and the domain partition.
-        Intrepid::FieldContainer<Real> &nodes = *meshMgr_->getNodes();
-        ctn_ = *meshMgr_->getCellToNodeMap();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numNodesPerCell_; ++j)
-            {
-                for (int k = 0; k < spaceDim_; ++k)
-                {
-                    (*cellNodes_)(i, j, k) = nodes(ctn_(myCellIds_[i], j), k);
-                }
-            }
-        }
-
-        //Compute Intrepid Arrays
-        cellCub->getCubature(*cubPoints_, *cubWeights_);                                   // retrieve cubature points and weights
-        (*basisPtrs_[0]).getValues(*gradReference_, *cubPoints_, Intrepid::OPERATOR_GRAD); // evaluate grad operator at cubature points
-        (*basisPtrs_[0]).getValues(*valReference_, *cubPoints_, Intrepid::OPERATOR_VALUE); // evaluate value operator at cubature points
-
-        Intrepid::CellTools<Real>::setJacobian(*cellJac_, *cubPoints_, *cellNodes_, cellType_); // compute cell Jacobians
-        Intrepid::CellTools<Real>::setJacobianInv(*cellJacInv_, *cellJac_);                     // compute inverses of cell Jacobians
-        Intrepid::CellTools<Real>::setJacobianDet(*cellJacDet_, *cellJac_);                     // compute determinants of cell Jacobians
-
-        Intrepid::FunctionSpaceTools::computeCellMeasure<Real>(*cellWeightedMeasure_, // compute weighted cell measure
-                                                               *cellJacDet_,
-                                                               *cubWeights_);
-
-        Intrepid::FunctionSpaceTools::HGRADtransformGRAD<Real>(*gradPhysical_, // transform reference gradients into physical space
-                                                               *cellJacInv_,
-                                                               *gradReference_);
-        Intrepid::FunctionSpaceTools::multiplyMeasure<Real>(*gradPhysicalWeighted_, // multiply with weighted measure
-                                                            *cellWeightedMeasure_,
-                                                            *gradPhysical_);
-
-        Intrepid::FunctionSpaceTools::HGRADtransformVALUE<Real>(*valPhysical_, // transform reference values into physical space
-                                                                *valReference_);
-        Intrepid::FunctionSpaceTools::multiplyMeasure<Real>(*valPhysicalWeighted_, // multiply with weighted measure
-                                                            *cellWeightedMeasure_,
-                                                            *valPhysical_);
-        Intrepid::CellTools<Real>::mapToPhysicalFrame(*cubPointsPhysical_, // map reference cubature points to physical space
-                                                      *cubPoints_,
-                                                      *cellNodes_,
-                                                      cellType_);
-
-        ComputeCellTotalMeasures();
-    }
-
-    virtual void ComputeCellTotalMeasures(void)
-    {
-        for (int i = 0; i < numCells_; ++i)
-        {
-            Real temp = 0.0;
-            for (int j = 0; j < numCubPoints_; ++j)
-            {
-                temp += (*cellWeightedMeasure_)(i, j);
-            }
-            myCellMeasure_.push_back(temp);
-        }
-        std::cout << "First cell total measure: " << myCellMeasure_[0] << std::endl;
-    }
-
-    virtual void ComputeLocalSystemMats(void) {}
-
-    virtual void ComputeLocalForceVec(void) {}
-
-    virtual void SetUpTrueDataOnNodes(void) {}
-
-    virtual void AssembleSystemMats(void)
-    {
-        /****************************************/
-        /*** Assemble global data structures. ***/
-        /****************************************/
-        // Assemble graph.
-        matGraph_ = Teuchos::rcp(new Tpetra::CrsGraph<>(myUniqueMap_, 0));
-        Teuchos::ArrayRCP<const int> cellDofsArrayRCP = cellDofs_.getData();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs_; ++j)
-            {
-                matGraph_->insertGlobalIndices(cellDofs_(myCellIds_[i], j), cellDofsArrayRCP(myCellIds_[i] * numLocalDofs_, numLocalDofs_));
-            }
-        }
-        matGraph_->fillComplete();
-        // Assemble matrices.
-        // Stiffness matrix A.
-        matA_ = Teuchos::rcp(new Tpetra::CrsMatrix<>(matGraph_));
-        int numLocalMatEntries = numLocalDofs_ * numLocalDofs_;
-        Teuchos::ArrayRCP<const Real> gradgradArrayRCP = gradgradMats_->getData();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs_; ++j)
-            {
-                matA_->sumIntoGlobalValues(cellDofs_(myCellIds_[i], j),
-                                           cellDofsArrayRCP(myCellIds_[i] * numLocalDofs_, numLocalDofs_),
-                                           gradgradArrayRCP(i * numLocalMatEntries + j * numLocalDofs_, numLocalDofs_));
-            }
-        }
-        matA_->fillComplete();
-        // Mass matrix M.
-        matM_ = Teuchos::rcp(new Tpetra::CrsMatrix<>(matGraph_));
-        Teuchos::ArrayRCP<const Real> valvalArrayRCP = valvalMats_->getData();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs_; ++j)
-            {
-                matM_->sumIntoGlobalValues(cellDofs_(myCellIds_[i], j),
-                                           cellDofsArrayRCP(myCellIds_[i] * numLocalDofs_, numLocalDofs_),
-                                           valvalArrayRCP(i * numLocalMatEntries + j * numLocalDofs_, numLocalDofs_));
-            }
-        }
-        matM_->fillComplete();
-    }
-
-    virtual void AssembleRHSVector(void)
-    {
-        // Assemble vectors.
-        // vecF_ requires assembly using vecF_overlap_ and redistribution
-        vecF_ = Teuchos::rcp(new Tpetra::MultiVector<>(matA_->getRangeMap(), 1, true));
-        vecF_overlap_ = Teuchos::rcp(new Tpetra::MultiVector<>(myOverlapMap_, 1, true));
-        // assembly on the overlap map
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs_; ++j)
-            {
-                vecF_overlap_->sumIntoGlobalValue(cellDofs_(myCellIds_[i], j),
-                                                  0,
-                                                  (*datavalVecF_)[i * numLocalDofs_ + j]);
-            }
-        }
-
-        //Assemble the point loads!
-        for (unsigned i = 0; i < myPointLoadDofs_.size(); ++i)
-        {
-            vecF_overlap_->sumIntoGlobalValue(myPointLoadDofs_[i],
-                                              0,
-                                              myPointLoadVals_[i]);
-        }
-
-        // change map
-        Tpetra::Export<> exporter(vecF_overlap_->getMap(), vecF_->getMap()); // redistribution
-        vecF_->doExport(*vecF_overlap_, exporter, Tpetra::ADD);              // from the overlap map to the unique map
-    }
-
-    virtual void AssembleDataVector(void)
-    {
-        // vecUd_ does not require assembly
-        vecUd_ = Teuchos::rcp(new Tpetra::MultiVector<>(matA_->getDomainMap(), 1, true));
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs_; ++j)
-            {
-                if (vecUd_->getMap()->isNodeGlobalElement(cellDofs_(myCellIds_[i], j)))
-                {
-                    vecUd_->replaceGlobalValue(cellDofs_(myCellIds_[i], j),
-                                               0,
-                                               (*dataUd_)[i * numLocalDofs_ + j]);
-                }
-            }
-        }
-    }
-
-    // find the local index of a global cell
-    virtual int find_local_index(int globalCell)
-    {
-        return myCellMap_->getLocalElement(globalCell);
-        /*
-	for(int i=0; i<numCells_; i++)
-	{
-		if(myCellIds_[i] == globalCell)
-			return i;
-	}
-	return -1;
-*/
-    }
-
-    // check to see if a globaldof is on dirichlet boundary
-    virtual bool check_myGlobalDof_on_boundary(int globalDof)
-    {
-        if (std::binary_search(myDirichletDofs_.begin(), myDirichletDofs_.end(), globalDof))
-        {
-            return true;
-        }
-        return false;
-    }
-
-    //create myBoundaryCellIds_ and myDirichletDofs_
-    virtual void SetUpMyDBCInfo(bool ifUseCoordsToSpecifyBC, std::vector<int> dbc_side)
-    {
-        if (ifUseCoordsToSpecifyBC)
-        {
-            my_dbc_.resize(4);
-            my_dbc_ = {0, 1, 2, 3};
-        }
-        else
-        {
-            my_dbc_ = dbc_side;
-        }
-        //Print to check my BC info
-        if (verbose_)
-        {
-            *outStream_ << "My dbc numbers: ";
-            for (unsigned i = 0; i < my_dbc_.size(); ++i)
-            {
-                *outStream_ << my_dbc_[i];
-            }
-            *outStream_ << std::endl;
-        }
-        //
-        Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> dirichletSideSets = meshMgr_->getSideSets();
-        std::vector<std::vector<Intrepid::FieldContainer<int>>> &dss = *dirichletSideSets;
-        Teuchos::Array<int> mySortedCellIds_(myCellIds_);
-        std::sort(mySortedCellIds_.begin(), mySortedCellIds_.end());
-        mySortedCellIds_.erase(std::unique(mySortedCellIds_.begin(), mySortedCellIds_.end()), mySortedCellIds_.end());
-
-        myBoundaryCellIds_.resize(dss[0].size());
-        for (int i = 0; i < static_cast<int>(dss[0].size()); ++i)
-        {
-            for (int j = 0; j < dss[0][i].dimension(0); ++j)
-            {
-                if (std::binary_search(mySortedCellIds_.begin(), mySortedCellIds_.end(), dss[0][i](j)))
-                {
-                    myBoundaryCellIds_[i].push_back(dss[0][i](j));
-                }
-            }
-        }
-
-        cte_ = *(meshMgr_->getCellToEdgeMap());
-        Intrepid::FieldContainer<int> &nodeDofs = *(dofMgr_->getNodeDofs());
-        //Intrepid::FieldContainer<int>  &edgeDofs = *(dofMgr_->getEdgeDofs());
-        std::vector<std::vector<int>> dofTags = (basisPtrs_[0])->getAllDofTags();
-        int numDofsPerNode = 0;
-        int numDofsPerEdge = 0;
-        for (int j = 0; j < (basisPtrs_[0])->getCardinality(); ++j)
-        {
-            if (dofTags[j][0] == 0)
-            {
-                numDofsPerNode = dofTags[j][3];
-            }
-            if (dofTags[j][0] == 1)
-            {
-                numDofsPerEdge = dofTags[j][3];
-            }
-        }
-        // vector field
-        int nfields = basisPtrs_.size();
-        numDofsPerNode = numDofsPerNode * nfields;
-        numDofsPerEdge = numDofsPerEdge * nfields;
-
-        Intrepid::FieldContainer<Real> &nodes = *meshMgr_->getNodes();
-        int n_dbc = my_dbc_.size();
-        for (int i = 0; i < static_cast<int>(myBoundaryCellIds_.size()); ++i)
-        {
-            bool isdbc = false;
-            for (int i_dbc = 0; i_dbc < n_dbc; i_dbc++)
-            {
-                if (i == my_dbc_[i_dbc])
-                {
-                    isdbc = true;
-                    break;
-                }
-            }
-            if (!isdbc)
-                continue;
-
-            for (int j = 0; j < myBoundaryCellIds_[i].size(); ++j)
-            {
-                /*	
-	int ifDBCCell = check_DBC_By_Coords(myBoundaryCellIds_[i][j], i);
-	if(ifDBCCell < 1)
-		continue;
-*/
-                std::vector<Real> x(spaceDim_);
-                const CellTopologyData *ctd = cellType_.getCellTopologyData();
-                Teuchos::ArrayView<unsigned> locNodes(const_cast<unsigned *>(ctd->subcell[spaceDim_ - 1][i].node), cellType_.getVertexCount(spaceDim_ - 1, i));
-                for (int l = 0; l < static_cast<int>(cellType_.getVertexCount(spaceDim_ - 1, i)); ++l)
-                {
-                    x[0] = nodes(ctn_(myBoundaryCellIds_[i][j], locNodes[l]), 0);
-                    x[1] = nodes(ctn_(myBoundaryCellIds_[i][j], locNodes[l]), 1);
-                    // use coordinates to check if a DOF is DBC DOF
-                    int ifDBCNode = check_DBC_Coords_Range(x);
-                    if (ifDBCNode < 0)
-                    {
-                        continue;
-                    }
-                    else if (ifDBCNode == 0)
-                    {
-                        if (verbose_)
-                        {
-                            *outStream_ << "DBC node: "
-                                        << ctn_(myBoundaryCellIds_[i][j], locNodes[l])
-                                        << ", fixing X direction" << std::endl;
-                        }
-                        myDirichletDofs_.push_back(nodeDofs(ctn_(myBoundaryCellIds_[i][j], locNodes[l]), 0));
-                    }
-                    else if (ifDBCNode == 1 && numDofsPerNode >= 2)
-                    {
-                        if (verbose_)
-                        {
-                            *outStream_ << "DBC node: "
-                                        << ctn_(myBoundaryCellIds_[i][j], locNodes[l])
-                                        << ", fixing Y direction" << std::endl;
-                        }
-                        myDirichletDofs_.push_back(nodeDofs(ctn_(myBoundaryCellIds_[i][j], locNodes[l]), 1));
-                    }
-                    else
-                    {
-                        if (verbose_)
-                        {
-                            *outStream_ << "DBC node: "
-                                        << ctn_(myBoundaryCellIds_[i][j], locNodes[l])
-                                        << ", fixing ALL direction" << std::endl;
-                        }
-                        for (int k = 0; k < numDofsPerNode; ++k)
-                        {
-                            myDirichletDofs_.push_back(nodeDofs(ctn_(myBoundaryCellIds_[i][j], locNodes[l]), k));
-                        }
-                    }
-                }
-                // edge dofs are NOT in use
-                /*
-        for (int k=0; k<numDofsPerEdge; ++k) {
-           myDirichletDofs_.push_back(edgeDofs(cte_(myBoundaryCellIds_[i][j], i), k));
-        }
-	*/
-            }
-        }
-        std::sort(myDirichletDofs_.begin(), myDirichletDofs_.end());
-        myDirichletDofs_.erase(std::unique(myDirichletDofs_.begin(), myDirichletDofs_.end()), myDirichletDofs_.end());
-    }
-
-    virtual int check_DBC_Coords_Range(const std::vector<Real> &x) const
-    {
-        // return value :
-        // -1: not a DBC node
-        //  0: x direction fixed
-        //  1: y direction fixed
-        //  5: both x, y direction are fixed
-        return 5;
-    }
-    //
-    //
-    //
-    virtual void process_loading_information(const Teuchos::RCP<Teuchos::ParameterList> &parlist) {}
-    //
-    //note that the point load is only allowed to applied on the boundary, not inside the body! 2D only
-    virtual void check_and_Apply_PointLoad_By_Coords(int globalCellNum, int pointload_bc)
-    {
-        Intrepid::FieldContainer<Real> &nodes = *meshMgr_->getNodes();
-        const CellTopologyData *ctd = cellType_.getCellTopologyData();
-        Teuchos::ArrayView<unsigned> locNodes(const_cast<unsigned *>(ctd->subcell[spaceDim_ - 1][pointload_bc].node), cellType_.getVertexCount(spaceDim_ - 1, pointload_bc));
-        std::vector<Real> x1(spaceDim_);
-        std::vector<Real> x2(spaceDim_);
-        std::vector<int> localNodeNum(2);
-        x1[0] = nodes(ctn_(globalCellNum, locNodes[0]), 0);
-        x1[1] = nodes(ctn_(globalCellNum, locNodes[0]), 1);
-        x2[0] = nodes(ctn_(globalCellNum, locNodes[1]), 0);
-        x2[1] = nodes(ctn_(globalCellNum, locNodes[1]), 1);
-        ApplyPointLoad(pointload_bc, globalCellNum, localNodeNum, x1, x2);
-    }
-
-    virtual void ApplyPointLoad(const int pointload_bc,
-                                const int globalCellNum,
-                                const std::vector<int> &localNodeNum,
-                                const std::vector<Real> &coord1,
-                                const std::vector<Real> &coord2)
-    {
-        //Intrepid::FieldContainer<int>  &nodeDofs = *(dofMgr_->getNodeDofs());
-        //bool isLoadPosContainedInCurrentSegment = false;
-        //int whichNodeIsCloserToPos = -1;
-        return;
-    }
-    //
-    //
-    //
-    virtual void EnforceDBC(void)
-    {
-        // Apply Dirichlet conditions.
-        // zero out row and column, make matrix symmetric
-        Teuchos::RCP<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
-        matA_dirichlet_ = matA_->clone(node);
-        matM_dirichlet_ = matM_->clone(node);
-        vecF_dirichlet_ = Teuchos::rcp(new Tpetra::MultiVector<>(matA_->getRangeMap(), 1, true));
-        Tpetra::deep_copy(*vecF_dirichlet_, *vecF_);
-
-        matA_dirichlet_->resumeFill();
-        matM_dirichlet_->resumeFill();
-
-        int gDof;
-        for (int i = 0; i < numCells_; i++)
-        {
-            for (int j = 0; j < numLocalDofs_; j++)
-            {
-                gDof = cellDofs_(myCellIds_[i], j);
-                if (myUniqueMap_->isNodeGlobalElement(gDof) && check_myGlobalDof_on_boundary(gDof))
-                {
-                    size_t numRowEntries = matA_dirichlet_->getNumEntriesInGlobalRow(gDof);
-                    Teuchos::Array<int> indices(numRowEntries, 0);
-                    Teuchos::Array<Real> values(numRowEntries, 0);
-                    Teuchos::Array<Real> canonicalValues(numRowEntries, 0);
-                    Teuchos::Array<Real> zeroValues(numRowEntries, 0);
-                    matA_dirichlet_->getGlobalRowCopy(gDof, indices, values, numRowEntries);
-                    matM_dirichlet_->getGlobalRowCopy(gDof, indices, values, numRowEntries);
-                    for (int k = 0; k < indices.size(); k++)
-                    {
-                        if (indices[k] == gDof)
-                        {
-                            canonicalValues[k] = 1.0;
-                        }
-                    }
-                    matA_dirichlet_->replaceGlobalValues(gDof, indices, canonicalValues);
-                    matM_dirichlet_->replaceGlobalValues(gDof, indices, zeroValues);
-                    vecF_dirichlet_->replaceGlobalValue(gDof, 0, 0);
-                }
-
-                if (!check_myGlobalDof_on_boundary(gDof))
-                {
-                    size_t numDBCDofs = myDirichletDofs_.size();
-                    Teuchos::Array<int> indices(numDBCDofs, 0);
-                    Teuchos::Array<Real> zeroValues(numDBCDofs, 0);
-                    for (int k = 0; k < indices.size(); k++)
-                    {
-                        indices[k] = myDirichletDofs_[k];
-                    }
-                    matA_dirichlet_->replaceGlobalValues(gDof, indices, zeroValues);
-                    matM_dirichlet_->replaceGlobalValues(gDof, indices, zeroValues);
-                }
-            }
-        }
-        matA_dirichlet_->fillComplete();
-        matM_dirichlet_->fillComplete();
-    }
-
-    virtual void MatrixRemoveDBC(void)
-    {
-        // Apply Dirichlet conditions.
-        // zero out row and column, make matrix symmetric
-        Teuchos::RCP<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
-        matA_dirichlet_ = matA_->clone(node);
-        matM_dirichlet_ = matM_->clone(node);
-
-        matA_dirichlet_->resumeFill();
-        matM_dirichlet_->resumeFill();
-
-        int gDof;
-        for (int i = 0; i < numCells_; i++)
-        {
-            for (int j = 0; j < numLocalDofs_; j++)
-            {
-                gDof = cellDofs_(myCellIds_[i], j);
-                if (myUniqueMap_->isNodeGlobalElement(gDof) && check_myGlobalDof_on_boundary(gDof))
-                {
-                    size_t numRowEntries = matA_dirichlet_->getNumEntriesInGlobalRow(gDof);
-                    Teuchos::Array<int> indices(numRowEntries, 0);
-                    Teuchos::Array<Real> values(numRowEntries, 0);
-                    Teuchos::Array<Real> canonicalValues(numRowEntries, 0);
-                    Teuchos::Array<Real> zeroValues(numRowEntries, 0);
-                    matA_dirichlet_->getGlobalRowCopy(gDof, indices, values, numRowEntries);
-                    matM_dirichlet_->getGlobalRowCopy(gDof, indices, values, numRowEntries);
-                    for (int k = 0; k < indices.size(); k++)
-                    {
-                        if (indices[k] == gDof)
-                        {
-                            canonicalValues[k] = 1.0;
-                        }
-                    }
-                    matA_dirichlet_->replaceGlobalValues(gDof, indices, canonicalValues);
-                    matM_dirichlet_->replaceGlobalValues(gDof, indices, zeroValues);
-                }
-
-                if (!check_myGlobalDof_on_boundary(gDof))
-                {
-                    size_t numDBCDofs = myDirichletDofs_.size();
-                    Teuchos::Array<int> indices(numDBCDofs, 0);
-                    Teuchos::Array<Real> zeroValues(numDBCDofs, 0);
-                    for (int k = 0; k < indices.size(); k++)
-                    {
-                        indices[k] = myDirichletDofs_[k];
-                    }
-                    matA_dirichlet_->replaceGlobalValues(gDof, indices, zeroValues);
-                    matM_dirichlet_->replaceGlobalValues(gDof, indices, zeroValues);
-                }
-            }
-        }
-        matA_dirichlet_->fillComplete();
-        matM_dirichlet_->fillComplete();
-    }
-
-    virtual void VectorRemoveDBC(void)
-    {
-        // Apply Dirichlet conditions.
-        vecF_dirichlet_ = Teuchos::rcp(new Tpetra::MultiVector<>(matA_->getRangeMap(), 1, true));
-        Tpetra::deep_copy(*vecF_dirichlet_, *vecF_);
-
-        int gDof(0);
-        for (int i = 0; i < numCells_; i++)
-        {
-            for (int j = 0; j < numLocalDofs_; j++)
-            {
-                gDof = cellDofs_(myCellIds_[i], j);
-                if (myUniqueMap_->isNodeGlobalElement(gDof) && check_myGlobalDof_on_boundary(gDof))
-                {
-                    vecF_dirichlet_->replaceGlobalValue(gDof, 0, 0);
-                }
-            }
-        }
-    }
-    /*
-  virtual void GenerateTransposedMats() {
-    // Create matrix transposes.
-    Tpetra::RowMatrixTransposer<> transposerA(matA_dirichlet_);
-    Tpetra::RowMatrixTransposer<> transposerM(matM_dirichlet_);
-    matA_dirichlet_trans_ = transposerA.createTranspose();
-    matM_dirichlet_trans_ = transposerM.createTranspose();
-  }
-*/
-
-    virtual void ConstructSolvers(void)
-    {
-        // Construct solver using Amesos2 factory.
-        try
-        {
-            solverA_ = Amesos2::create<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>("KLU2", matA_dirichlet_);
-        }
-        catch (std::invalid_argument e)
-        {
-            std::cout << e.what() << std::endl;
-        }
-        solverA_->numericFactorization();
-    }
-
-    /*
-  virtual void ConstructAdjointSolvers() {
-    // Construct solver using Amesos2 factory.
-    try{
-      solverA_trans_ = Amesos2::create< Tpetra::CrsMatrix<>,Tpetra::MultiVector<> >("KLU2", matA_dirichlet_trans_);
-    } catch (std::invalid_argument e) {
-      std::cout << e.what() << std::endl;
-    }
-    solverA_trans_->numericFactorization();
-  }
-*/
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatA(const bool &transpose = false) const
-    {
-        if (transpose)
-        {
-            //return matA_dirichlet_trans_;
-            return matA_dirichlet_;
-        }
-        else
-        {
-            return matA_dirichlet_;
-        }
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatB(const bool &transpose = false) const
-    {
-        if (transpose)
-        {
-            //return matM_dirichlet_trans_;
-            return matM_dirichlet_;
-        }
-        else
-        {
-            return matM_dirichlet_;
-        }
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatM() const
-    {
-        return matM_;
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatR() const
-    {
-        return matM_;
-    }
-
-    Teuchos::RCP<Tpetra::MultiVector<>> getVecUd() const
-    {
-        return vecUd_;
-    }
-
-    Teuchos::RCP<Tpetra::MultiVector<>> getVecF() const
-    {
-        return vecF_dirichlet_;
-    }
-
-    Teuchos::RCP<Amesos2::Solver<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>> getSolver(const bool &transpose = false) const
-    {
-        if (transpose)
-        {
-            //return solverA_trans_;
-            return solverA_;
-        }
-        else
-        {
-            return solverA_;
-        }
-    }
-
-    virtual Real funcTarget(const Real &x1, const Real &x2) const { return 0.0; }
-
-    void printMeshData(std::ostream &outStream) const
-    {
-
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> nodesPtr = meshMgr_->getNodes();
-        Teuchos::RCP<Intrepid::FieldContainer<int>> cellToNodeMapPtr = meshMgr_->getCellToNodeMap();
-        Intrepid::FieldContainer<Real> &nodes = *nodesPtr;
-        Intrepid::FieldContainer<int> &cellToNodeMap = *cellToNodeMapPtr;
-        outStream << "Number of nodes = " << meshMgr_->getNumNodes() << std::endl;
-        outStream << "Number of cells = " << meshMgr_->getNumCells() << std::endl;
-        outStream << "Number of edges = " << meshMgr_->getNumEdges() << std::endl;
-        // Print mesh to file.
-        if ((myRank_ == 0))
-        {
-            std::ofstream meshfile;
-            meshfile.open("cell_to_node_quad.txt");
-            for (int i = 0; i < cellToNodeMap.dimension(0); ++i)
-            {
-                for (int j = 0; j < cellToNodeMap.dimension(1); ++j)
-                {
-                    meshfile << cellToNodeMap(i, j) << "  ";
-                }
-                meshfile << std::endl;
-            }
-            meshfile.close();
-
-            meshfile.open("cell_to_node_tri.txt");
-            for (int i = 0; i < cellToNodeMap.dimension(0); ++i)
-            {
-                for (int j = 0; j < 3; ++j)
-                {
-                    meshfile << cellToNodeMap(i, j) << "  ";
-                }
-                meshfile << std::endl;
-                for (int j = 2; j < 5; ++j)
-                {
-                    meshfile << cellToNodeMap(i, j % 4) << "  ";
-                }
-                meshfile << std::endl;
-            }
-            meshfile.close();
-
-            meshfile.open("nodes.txt");
-            meshfile.precision(16);
-            for (int i = 0; i < nodes.dimension(0); ++i)
-            {
-                for (int j = 0; j < nodes.dimension(1); ++j)
-                {
-                    meshfile << std::scientific << nodes(i, j) << "  ";
-                }
-                meshfile << std::endl;
-            }
-            meshfile.close();
-            /* This somewhat clunky output is for gnuplot.
-      meshfile.open("mesh.txt");
-      for (int i=0; i<cellToNodeMap.dimension(0); ++i) {
-        meshfile << nodes(cellToNodeMap(i,0), 0) << "  " << nodes(cellToNodeMap(i,0), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,1), 0) << "  " << nodes(cellToNodeMap(i,1), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,2), 0) << "  " << nodes(cellToNodeMap(i,2), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,3), 0) << "  " << nodes(cellToNodeMap(i,3), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,0), 0) << "  " << nodes(cellToNodeMap(i,0), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,1), 0) << "  " << nodes(cellToNodeMap(i,1), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,2), 0) << "  " << nodes(cellToNodeMap(i,2), 1) << std::endl;
-      }
-      meshfile.close();
-      */
-        } //myRank 0 print
-    }     // prinf function end
-
-    void outputTpetraData() const
-    {
-        Tpetra::MatrixMarket::Writer<Tpetra::CrsMatrix<>> matWriter;
-        matWriter.writeSparseFile("stiffness_mat", matA_);
-        matWriter.writeSparseFile("dirichlet_mat", matA_dirichlet_);
-        matWriter.writeSparseFile("mass_mat", matM_);
-        matWriter.writeDenseFile("Ud_vec", vecUd_);
-    }
-
-    void outputTpetraVector(const Teuchos::RCP<const Tpetra::MultiVector<>> &vec,
-                            const std::string &filename) const
-    {
-        Tpetra::MatrixMarket::Writer<Tpetra::CrsMatrix<>> vecWriter;
-        vecWriter.writeDenseFile(filename, vec);
-    }
-
-    // ACCESSOR FUNCTIONS
-    Teuchos::RCP<MeshManager<Real>> &GetMeshManager(void)
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(meshMgr_ == Teuchos::null, std::logic_error,
-                                   ">>> (PDE_FEM::GetMeshManager): MeshManager not initialized!");
-        return meshMgr_;
-    }
-
-    Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>> &GetBasisPtr(const int ind)
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(ind > spaceDim_ - 1 || ind < 0, std::logic_error,
-                                   ">>> (PDE_FEM::GetBasisPtr): ind out of bounds!");
-        TEUCHOS_TEST_FOR_EXCEPTION(basisPtrs_.size() == 0, std::logic_error,
-                                   ">>> (PDE_FEM::GetBasisPtr): BasisPntrs not initialized!");
-        return basisPtrs_[ind];
-    }
-
-    int GetBasisOrder(void) const
-    {
-        return basisOrder_;
-    }
-
-    int GetSpaceDim(void) const
-    {
-        return spaceDim_;
-    }
-
-    int GetNumCells(void) const
-    {
-        return numCells_;
-    }
-
-    int GetNumLocalDofs(void) const
-    {
-        return numLocalDofs_;
-    }
-
-    int GetNumCubPoints(void) const
-    {
-        return numCubPoints_;
-    }
-
-    int GetLocalFieldSize(void) const
-    {
-        return lfs_;
-    }
-
-}; // class PDE_FEM
-
-#endif
diff --git a/tlnos/src/TOOLS/bfsc_dof_mesh.hpp b/tlnos/src/TOOLS/bfsc_dof_mesh.hpp
deleted file mode 100644
index 29089d28664b6968c9f497f884b887cbfb76ebdd..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/bfsc_dof_mesh.hpp
+++ /dev/null
@@ -1,554 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  DofManager.hpp
-    \brief Sets up data structures for the indexing of the global degrees
-           of freedom (Dof's).
-*/
-
-#include "Teuchos_ParameterList.hpp"
-#include "Intrepid_FieldContainer.hpp"
-
-template <class Real>
-class DofManager
-{
-
-    typedef Intrepid::FieldContainer<Real> FCR;
-    typedef Intrepid::FieldContainer<int> FCI;
-
-    enum FieldType
-    {
-        VELX,
-        VELY,
-        PRES
-    };
-
-    /* Backward-facing step geometry.
- 
-  ***************************************************
-  *        *           *                            *
-  *   3    *     4     *             5              *
-  *        *           *                            *
-  ********** * * * * * * * * * * * * * * * * * * * **
-           *     1     *             2              *
-           *           *                            *
-           ******************************************
-*/
-
-private:
-    Real channelH_; // channel height (height of regions 1+4)
-    Real channelW_; // channel width (width of regions 3+4+5)
-    Real stepH_;    // step height (height of region 1)
-    Real stepW_;    // step width (width of region 3)
-    Real observeW_; // width of observation region (width of region 1)
-
-    int nx1_;
-    int nx2_;
-    int nx3_;
-    int nx4_;
-    int nx5_;
-    int ny1_;
-    int ny2_;
-    int ny3_;
-    int ny4_;
-    int ny5_;
-
-    int ref_;
-
-    int numCells_;
-    int numNodes_;
-    int numEdges_;
-    int numMeshEntities_;
-
-    FCR meshNodes_;
-    FCI meshCellToNodeMap_;
-    FCI meshCellToEdgeMap_;
-
-    int numDofs_;
-    int numPres_;
-    int numVelX_;
-    int numVelY_;
-    int numLocalDofs_;
-    int numLocalPres_;
-    int numLocalVelX_;
-    int numLocalVelY_;
-
-    FCI dofArray_;
-    FCI cellDofs_;
-    FCI cellPres_;
-    FCI cellVelX_;
-    FCI cellVelY_;
-
-public:
-    DofManager(Teuchos::ParameterList &parlist)
-    {
-        // Geometry data.
-        channelH_ = parlist.sublist("Navier Stokes").get("Channel height", 1.0);
-        channelW_ = parlist.sublist("Navier Stokes").get("Channel width", 8.0);
-        stepH_ = parlist.sublist("Navier Stokes").get("Step height", 0.5);
-        stepW_ = parlist.sublist("Navier Stokes").get("Step width", 1.0);
-        observeW_ = parlist.sublist("Navier Stokes").get("Observation width", 3.0);
-        // Mesh data.
-        ref_ = parlist.sublist("Navier Stokes").get("Refinement level", 1);
-        nx1_ = parlist.sublist("Navier Stokes").get("Observation region NX", 4 * ref_);
-        ny1_ = parlist.sublist("Navier Stokes").get("Observation region NY", 5 * ref_);
-        nx2_ = parlist.sublist("Navier Stokes").get("Laminar flow region NX", 2 * ref_);
-        ny2_ = ny1_;
-        nx3_ = parlist.sublist("Navier Stokes").get("Inflow region NX", 1 * ref_);
-        ny3_ = parlist.sublist("Navier Stokes").get("Inflow region NY", 2 * ref_);
-        nx4_ = nx1_;
-        ny4_ = ny3_;
-        nx5_ = nx2_;
-        ny5_ = ny3_;
-        numCells_ = (nx1_ + nx2_) * ny1_ + (nx3_ + nx1_ + nx2_) * ny3_;
-        numNodes_ = (nx1_ + nx2_ + 1) * ny1_ + (nx3_ + nx1_ + nx2_ + 1) * (ny3_ + 1);
-        numEdges_ = (2 * (nx1_ + nx2_) + 1) * ny1_ + (2 * (nx3_ + nx1_ + nx2_) + 1) * ny3_ + (nx3_ + nx1_ + nx2_);
-        numMeshEntities_ = numCells_ + numNodes_ + numEdges_;
-        // Mesh and Dof data structures.
-        numLocalPres_ = 4;
-        numLocalVelX_ = 9;
-        numLocalVelY_ = 9;
-        numLocalDofs_ = numLocalPres_ + numLocalVelX_ + numLocalVelY_;
-        computeMeshNodes(meshNodes_);
-        computeMeshCellToNodeMap(meshCellToNodeMap_);
-        computeMeshCellToEdgeMap(meshCellToEdgeMap_);
-        computeDofArray(dofArray_, numDofs_);
-        computeCellDofs(cellDofs_, dofArray_, meshCellToNodeMap_, meshCellToEdgeMap_);
-        computeCellPres(cellPres_, cellDofs_);
-        computeCellVelX(cellVelX_, cellDofs_);
-        computeCellVelY(cellVelY_, cellDofs_);
-    }
-
-    void computeMeshNodes(FCR &nodes) const
-    {
-
-        Real dy1 = stepH_ / ny1_;
-        Real dy3 = (channelH_ - stepH_) / ny3_;
-        Real dx1 = observeW_ / nx1_;
-        Real dx2 = (channelW_ - stepW_ - observeW_) / nx2_;
-        Real dx3 = stepW_ / nx3_;
-        int nodeCt = 0;
-        nodes.resize(numNodes_, 2);
-
-        // bottom region
-        for (int j = 0; j < ny1_; ++j)
-        {
-            for (int i = 0; i <= nx1_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + i * dx1;
-                nodes(nodeCt, 1) = j * dy1;
-                ++nodeCt;
-            }
-            for (int i = 0; i < nx2_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + observeW_ + (i + 1) * dx2;
-                nodes(nodeCt, 1) = j * dy1;
-                ++nodeCt;
-            }
-        }
-
-        // top region
-        for (int j = 0; j <= ny3_; ++j)
-        {
-            for (int i = 0; i <= nx3_; ++i)
-            {
-                nodes(nodeCt, 0) = i * dx3;
-                nodes(nodeCt, 1) = stepH_ + j * dy3;
-                ++nodeCt;
-            }
-            for (int i = 0; i < nx1_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + (i + 1) * dx1;
-                nodes(nodeCt, 1) = stepH_ + j * dy3;
-                ++nodeCt;
-            }
-            for (int i = 0; i < nx2_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + observeW_ + (i + 1) * dx2;
-                nodes(nodeCt, 1) = stepH_ + j * dy3;
-                ++nodeCt;
-            }
-        }
-
-    } // computeMeshNodes
-
-    void computeMeshCellToNodeMap(FCI &ctn)
-    {
-
-        int cellCt = 0;
-        ctn.resize(numCells_, 4);
-
-        // bottom region
-        for (int j = 0; j < ny1_ - 1; ++j)
-        {
-            for (int i = 0; i < nx1_ + nx2_; ++i)
-            {
-                ctn(cellCt, 0) = j * (nx1_ + nx2_ + 1) + i;
-                ctn(cellCt, 1) = j * (nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 2) = (j + 1) * (nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 3) = (j + 1) * (nx1_ + nx2_ + 1) + i;
-                ++cellCt;
-            }
-        }
-
-        // transition region
-        for (int i = 0; i < nx1_ + nx2_; ++i)
-        {
-            ctn(cellCt, 0) = (ny1_ - 1) * (nx1_ + nx2_ + 1) + i;
-            ctn(cellCt, 1) = (ny1_ - 1) * (nx1_ + nx2_ + 1) + (i + 1);
-            ctn(cellCt, 2) = ny1_ * (nx1_ + nx2_ + 1) + nx3_ + (i + 1);
-            ctn(cellCt, 3) = ny1_ * (nx1_ + nx2_ + 1) + nx3_ + i;
-            ++cellCt;
-        }
-
-        // top region
-        for (int j = 0; j < ny3_; ++j)
-        {
-            for (int i = 0; i < nx3_ + nx1_ + nx2_; ++i)
-            {
-                ctn(cellCt, 0) = ny1_ * (nx1_ + nx2_ + 1) + j * (nx3_ + nx1_ + nx2_ + 1) + i;
-                ctn(cellCt, 1) = ny1_ * (nx1_ + nx2_ + 1) + j * (nx3_ + nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 2) = ny1_ * (nx1_ + nx2_ + 1) + (j + 1) * (nx3_ + nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 3) = ny1_ * (nx1_ + nx2_ + 1) + (j + 1) * (nx3_ + nx1_ + nx2_ + 1) + i;
-                ++cellCt;
-            }
-        }
-
-    } // computeMeshCellToNodeMap
-
-    void computeMeshCellToEdgeMap(FCI &cte)
-    {
-
-        int cellCt = 0;
-        cte.resize(numCells_, 4);
-
-        // bottom region
-        for (int j = 0; j < ny1_ - 1; ++j)
-        {
-            for (int i = 0; i < nx1_ + nx2_; ++i)
-            {
-                cte(cellCt, 0) = j * (2 * (nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 1) = j * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + (i + 1);
-                cte(cellCt, 2) = (j + 1) * (2 * (nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 3) = j * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + i;
-                ++cellCt;
-            }
-        }
-
-        // transition region
-        for (int i = 0; i < nx1_ + nx2_; ++i)
-        {
-            cte(cellCt, 0) = (ny1_ - 1) * (2 * (nx1_ + nx2_) + 1) + i;
-            cte(cellCt, 1) = (ny1_ - 1) * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + (i + 1);
-            cte(cellCt, 2) = ny1_ * (2 * (nx1_ + nx2_) + 1) + nx3_ + i;
-            cte(cellCt, 3) = (ny1_ - 1) * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + i;
-            ++cellCt;
-        }
-
-        // top region
-        for (int j = 0; j < ny3_; ++j)
-        {
-            for (int i = 0; i < nx3_ + nx1_ + nx2_; ++i)
-            {
-                cte(cellCt, 0) = ny1_ * (2 * (nx1_ + nx2_) + 1) + j * (2 * (nx3_ + nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 1) = ny1_ * (2 * (nx1_ + nx2_) + 1) + j * (2 * (nx3_ + nx1_ + nx2_) + 1) + (nx3_ + nx1_ + nx2_) + (i + 1);
-                cte(cellCt, 2) = ny1_ * (2 * (nx1_ + nx2_) + 1) + (j + 1) * (2 * (nx3_ + nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 3) = ny1_ * (2 * (nx1_ + nx2_) + 1) + j * (2 * (nx3_ + nx1_ + nx2_) + 1) + (nx3_ + nx1_ + nx2_) + i;
-                ++cellCt;
-            }
-        }
-
-    } // computeMeshCellToEdgeMap
-
-    void computeDofArray(FCI &dof, int &numDofs, const int &globOrder = 1)
-    {
-
-        dof.resize(numMeshEntities_, 3);
-        int dofCt = -1;
-
-        if (globOrder == 1)
-        {
-            //
-            // This is the independent node id --> edge id --> cell id ordering:
-            //
-            //     VelX VelY Pres
-            //     --------------
-            // n1  1    1    1
-            // n2  1    1    1
-            // ...
-            // e1  1    1    0
-            // e2  1    1    0
-            // ...
-            // c1  1    1    0
-            // c2  1    1    0
-            // ...
-            //
-            for (int i = 0; i < numNodes_; ++i)
-            {
-                // dof(i, 1) --> 1 Velocity X
-                // dof(i, 1) --> 1 Velocity Y
-                // dof(i, 2) --> 1 Pressure
-                dof(i, 0) = ++dofCt; // VelX
-                dof(i, 1) = ++dofCt; // VelY
-                dof(i, 2) = ++dofCt; // Pres
-            }
-            for (int i = numNodes_; i < numNodes_ + numEdges_; ++i)
-            {
-                // dof(i, 1) --> 1 Velocity X
-                // dof(i, 1) --> 1 Velocity Y
-                // dof(i, 2) --> 0 Pressure
-                dof(i, 0) = ++dofCt; // VelX
-                dof(i, 1) = ++dofCt; // VelY
-                dof(i, 2) = -1;
-            }
-            for (int i = numNodes_ + numEdges_; i < numMeshEntities_; ++i)
-            {
-                // dof(i, 1) --> 1 Velocity X
-                // dof(i, 1) --> 1 Velocity Y
-                // dof(i, 2) --> 0 Pressure
-                dof(i, 0) = ++dofCt; // VelX
-                dof(i, 1) = ++dofCt; // VelY
-                dof(i, 2) = -1;
-            }
-        }
-        else if (globOrder == 2)
-        {
-            //
-            // This is the cell-driven cell node id --> cell edge id --> cell id ordering:
-            //
-            //         VelX VelY Pres
-            //         --------------
-            // cell 1
-            // n1      1    1    1
-            // n2      1    1    1
-            // ...
-            // e1      1    1    0
-            // e2      1    1    0
-            // ...
-            // c1      1    1    0
-            // c2      1    1    0
-            // ...
-            // cell 2
-            // ...
-            // (unique ids only, of course)
-            //
-            // TO BE IMPLEMENTED!!!
-        }
-        numDofs = dofCt + 1;
-    } // computeDofArray
-
-    void computeCellDofs(FCI &cdofs, const FCI &dofs, const FCI &ctn, const FCI &cte)
-    {
-
-        cdofs.resize(numCells_, numLocalDofs_);
-
-        for (int i = 0; i < numCells_; ++i)
-        {
-            int ct = -1;
-            int gid0 = ctn(i, 0);
-            int gid1 = ctn(i, 1);
-            int gid2 = ctn(i, 2);
-            int gid3 = ctn(i, 3);
-            int gid4 = numNodes_ + cte(i, 0);
-            int gid5 = numNodes_ + cte(i, 1);
-            int gid6 = numNodes_ + cte(i, 2);
-            int gid7 = numNodes_ + cte(i, 3);
-            int gid8 = numNodes_ + numEdges_ + i;
-            cdofs(i, ++ct) = dofs(gid0, 0);
-            cdofs(i, ++ct) = dofs(gid0, 1);
-            cdofs(i, ++ct) = dofs(gid0, 2);
-            cdofs(i, ++ct) = dofs(gid1, 0);
-            cdofs(i, ++ct) = dofs(gid1, 1);
-            cdofs(i, ++ct) = dofs(gid1, 2);
-            cdofs(i, ++ct) = dofs(gid2, 0);
-            cdofs(i, ++ct) = dofs(gid2, 1);
-            cdofs(i, ++ct) = dofs(gid2, 2);
-            cdofs(i, ++ct) = dofs(gid3, 0);
-            cdofs(i, ++ct) = dofs(gid3, 1);
-            cdofs(i, ++ct) = dofs(gid3, 2);
-            cdofs(i, ++ct) = dofs(gid4, 0);
-            cdofs(i, ++ct) = dofs(gid4, 1);
-            cdofs(i, ++ct) = dofs(gid5, 0);
-            cdofs(i, ++ct) = dofs(gid5, 1);
-            cdofs(i, ++ct) = dofs(gid6, 0);
-            cdofs(i, ++ct) = dofs(gid6, 1);
-            cdofs(i, ++ct) = dofs(gid7, 0);
-            cdofs(i, ++ct) = dofs(gid7, 1);
-            cdofs(i, ++ct) = dofs(gid8, 0);
-            cdofs(i, ++ct) = dofs(gid8, 1);
-        }
-    } // computeCellDofs
-
-    void computeCellPres(FCI &cpres, const FCI &cdofs)
-    {
-        cpres.resize(numCells_, numLocalPres_);
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalPres_; ++j)
-            {
-                cpres(i, j) = cdofs(i, j * 3 + 2);
-            }
-        }
-    } // computeCellPres
-
-    void computeCellVelX(FCI &cvelx, const FCI &cdofs)
-    {
-        cvelx.resize(numCells_, numLocalVelX_);
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalPres_; ++j)
-            {
-                cvelx(i, j) = cdofs(i, j * 3);
-            }
-            for (int k = 0; k < numLocalVelX_ - numLocalPres_; ++k)
-            {
-                cvelx(i, k + numLocalPres_) = cdofs(i, 4 * 3 + k * 2);
-            }
-        }
-    } // computeCellVelX
-
-    void computeCellVelY(FCI &cvely, const FCI &cdofs)
-    {
-        cvely.resize(numCells_, numLocalVelY_);
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalPres_; ++j)
-            {
-                cvely(i, j) = cdofs(i, j * 3 + 1);
-            }
-            for (int k = 0; k < numLocalVelY_ - numLocalPres_; ++k)
-            {
-                cvely(i, k + numLocalPres_) = cdofs(i, 4 * 3 + k * 2 + 1);
-            }
-        }
-    } // computeCellVelY
-
-    std::vector<int> &getCellDofs(const int &cid, const FieldType &ft) const
-    {
-        std::vector<int> dofVec;
-        int nPres = 4;
-        int nVelX = 9;
-        int nVelY = 9;
-        switch (ft)
-        {
-        case VELX:
-            break;
-
-        case VELY:
-            break;
-
-        case PRES:
-            for (int i = 0; i < nPres; ++i)
-            {
-                dofVec.push_back(cellDofs_(cid));
-            }
-            break;
-        }
-        return dofVec;
-    } // getDofArray
-
-    void setRefinementLevel(const int &refLevel)
-    {
-        ref_ = refLevel;
-    } // setRefinementLevel
-
-    int getNumCells() const
-    {
-        return numCells_;
-    } // getNumCells
-
-    int getNumNodes() const
-    {
-        return numNodes_;
-    } // getNumNodes
-
-    int getNumEdges() const
-    {
-        return numEdges_;
-    } // getNumEdges
-
-    const FCR &getMeshNodes() const
-    {
-        return meshNodes_;
-    } // getMeshNodes
-
-    const FCI &getMeshCellToNodeMap() const
-    {
-        return meshCellToNodeMap_;
-    } // getMeshCellToNodeMap
-
-    const FCI &getMeshCellToEdgeMap() const
-    {
-        return meshCellToEdgeMap_;
-    } // getMeshCellToEdgeMap
-
-    int getNumDofs() const
-    {
-        return numDofs_;
-    } // getNumDofs
-
-    const FCI &getDofArray() const
-    {
-        return dofArray_;
-    } // getDofArray
-
-    const FCI &getCellDofs() const
-    {
-        return cellDofs_;
-    } // getCellDofs
-
-    const FCI &getCellPres() const
-    {
-        return cellPres_;
-    } // getCellPres
-
-    const FCI &getCellVelX() const
-    {
-        return cellVelX_;
-    } // getCellVelX
-
-    const FCI &getCellVelY() const
-    {
-        return cellVelY_;
-    } // getCellVelY
-};
diff --git a/tlnos/src/TOOLS/dofmanager.hpp b/tlnos/src/TOOLS/dofmanager.hpp
deleted file mode 100644
index 6fb62a8967444bfbb884299f7b82bf55c830be90..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/dofmanager.hpp
+++ /dev/null
@@ -1,419 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  dofmanager.hpp
-    \brief Given a mesh with connectivity information, sets up data
-           structures for the indexing of the global degrees of
-           freedom (Dofs).
-*/
-
-#ifndef DOFMANAGER_HPP
-#define DOFMANAGER_HPP
-
-#include "Teuchos_ParameterList.hpp"
-#include "Intrepid_FieldContainer.hpp"
-#include "Intrepid_Basis.hpp"
-#include "meshmanager.hpp"
-
-template <class Real>
-class DofManager
-{
-
-private:
-    Teuchos::RCP<MeshManager<Real>> meshManager_;
-    std::vector<Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>>> intrepidBasis_;
-
-    int numCells_; // number of mesh cells
-    int numNodes_; // number of mesh nodes
-    int numEdges_; // number of mesh edges
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToNodeMap_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToEdgeMap_;
-
-    // Local dof information.
-    int numBases_;                               // number of bases (fields)
-    int numLocalNodes_;                          // number of nodes in the basic cell topology
-    int numLocalEdges_;                          // number of edges in the basic cell topology
-    int numLocalFaces_;                          // number of faces in the basic cell topology
-    int numLocalNodeDofs_;                       // number of local (single-cell) node dofs for all bases
-    int numLocalEdgeDofs_;                       // number of local (single-cell) edge dofs for all bases
-    int numLocalFaceDofs_;                       // number of local (single-cell) face dofs for all bases
-    int numLocalDofs_;                           // total number of local (single-cell) face dofs for all bases
-    std::vector<int> numDofsPerNode_;            // number of dofs per node in a cell (assumed constant), per basis
-    std::vector<int> numDofsPerEdge_;            // number of dofs per edge in a cell (assumed constant), per basis
-    std::vector<int> numDofsPerFace_;            // number of dofs per face in a cell (assumed constant), per basis
-    std::vector<std::vector<int>> fieldPattern_; // local indexing of fields into the array [0,1,...,numLocalDofs-1];
-                                                 // contains [number of bases] index vectors, where each index vector
-                                                 // is of size [basis cardinality]
-    // Global dof information.
-    int numNodeDofs_; // number of global node dofs
-    int numEdgeDofs_; // number of global edge dofs
-    int numFaceDofs_; // number of global face dofs
-    int numDofs_;     // total number of global dofs
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> nodeDofs_; // global node dofs, of size [numNodes_ x numLocalNodeDofs_]
-    Teuchos::RCP<Intrepid::FieldContainer<int>> edgeDofs_; // global edge dofs, of size [numEdges_ x numLocalEdgeDofs_]
-    Teuchos::RCP<Intrepid::FieldContainer<int>> faceDofs_; // global face dofs, of size [numFaces_ x numLocalFaceDofs_]
-    Teuchos::RCP<Intrepid::FieldContainer<int>> cellDofs_; // global cell dofs, of size [numCells_ x numLocalDofs_];
-                                                           // ordered by subcell (node, then edge, then face) and basis index
-
-    std::vector<Teuchos::RCP<Intrepid::FieldContainer<int>>> fieldDofs_; // global cell dofs, indexed by field/basis, of size [numCells_ x basis cardinality];
-                                                                         // ordered by subcell (node, then edge, then face)
-
-public:
-    DofManager(Teuchos::RCP<MeshManager<Real>> &meshManager,
-               std::vector<Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>>> &intrepidBasis)
-    {
-
-        meshManager_ = meshManager;
-        intrepidBasis_ = intrepidBasis;
-        numCells_ = meshManager_->getNumCells();
-        numNodes_ = meshManager_->getNumNodes();
-        numEdges_ = meshManager_->getNumEdges();
-
-        // Mesh data structures.
-        meshCellToNodeMap_ = meshManager_->getCellToNodeMap();
-        meshCellToEdgeMap_ = meshManager_->getCellToEdgeMap();
-
-        // Local degree-of-freedom footprint.
-        numBases_ = static_cast<int>(intrepidBasis_.size());
-        numDofsPerNode_.resize(numBases_, 0);
-        numDofsPerEdge_.resize(numBases_, 0);
-        numDofsPerFace_.resize(numBases_, 0);
-        numLocalDofs_ = 0;
-        for (int i = 0; i < numBases_; ++i)
-        {
-            std::vector<std::vector<int>> dofTags = (intrepidBasis_[i])->getAllDofTags();
-            for (int j = 0; j < (intrepidBasis_[i])->getCardinality(); j++)
-            {
-                if (dofTags[j][0] == 0)
-                {
-                    numDofsPerNode_[i] = dofTags[j][3];
-                }
-                else if (dofTags[j][0] == 1)
-                {
-                    numDofsPerEdge_[i] = dofTags[j][3];
-                }
-                else if (dofTags[j][0] == 2)
-                {
-                    numDofsPerFace_[i] = dofTags[j][3];
-                }
-            }
-            numLocalDofs_ += (intrepidBasis_[i])->getCardinality();
-        }
-        numLocalNodeDofs_ = 0;
-        numLocalEdgeDofs_ = 0;
-        numLocalFaceDofs_ = 0;
-        for (int i = 0; i < numBases_; ++i)
-        {
-            numLocalNodeDofs_ += numDofsPerNode_[i];
-            numLocalEdgeDofs_ += numDofsPerEdge_[i];
-            numLocalFaceDofs_ += numDofsPerFace_[i];
-        }
-        numLocalNodes_ = static_cast<int>((intrepidBasis_[0])->getBaseCellTopology().getVertexCount());
-        numLocalEdges_ = static_cast<int>((intrepidBasis_[0])->getBaseCellTopology().getEdgeCount());
-        numLocalFaces_ = 1;
-        computeFieldPattern();
-
-        // Global data structures.
-        computeDofArrays();
-        computeCellDofs();
-        computeFieldDofs();
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getNodeDofs() const
-    {
-        return nodeDofs_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getEdgeDofs() const
-    {
-        return edgeDofs_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getFaceDofs() const
-    {
-        return faceDofs_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellDofs() const
-    {
-        return cellDofs_;
-    }
-
-    std::vector<Teuchos::RCP<Intrepid::FieldContainer<int>>> getFieldDofs() const
-    {
-        return fieldDofs_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getFieldDofs(const int &fieldNumber) const
-    {
-        return fieldDofs_[fieldNumber];
-    }
-
-    int getNumNodeDofs() const
-    {
-        return numNodeDofs_;
-    }
-
-    int getNumEdgeDofs() const
-    {
-        return numEdgeDofs_;
-    }
-
-    int getNumFaceDofs() const
-    {
-        return numFaceDofs_;
-    }
-
-    int getNumDofs() const
-    {
-        return numDofs_;
-    }
-
-    int getNumFields() const
-    {
-        return numBases_;
-    }
-
-    int getLocalFieldSize(const int &fieldNumber) const
-    {
-        return (intrepidBasis_[fieldNumber])->getCardinality();
-    }
-
-    std::vector<std::vector<int>> getFieldPattern() const
-    {
-        return fieldPattern_;
-    }
-
-    std::vector<int> getFieldPattern(const int &fieldNumber) const
-    {
-        return fieldPattern_[fieldNumber];
-    }
-
-private:
-    void computeDofArrays()
-    {
-
-        nodeDofs_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numNodes_, numLocalNodeDofs_));
-        edgeDofs_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numEdges_, numLocalEdgeDofs_));
-        faceDofs_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, numLocalFaceDofs_));
-
-        Intrepid::FieldContainer<int> &nodeDofs = *nodeDofs_;
-        Intrepid::FieldContainer<int> &edgeDofs = *edgeDofs_;
-        Intrepid::FieldContainer<int> &faceDofs = *faceDofs_;
-
-        int dofCt = -1;
-
-        //
-        // This is the independent node id --> edge id --> cell id ordering.
-        // For example, for a Q2-Q2-Q1 basis (Taylor-Hood), we would have:
-        //
-        //     Q2   Q2   Q1
-        //     --------------
-        // n1  1    1    1
-        // n2  1    1    1
-        // ...
-        // e1  1    1    0
-        // e2  1    1    0
-        // ...
-        // c1  1    1    0
-        // c2  1    1    0
-        // ...
-        //
-
-        // count node dofs
-        for (int i = 0; i < numNodes_; ++i)
-        {
-            int locNodeCt = -1;
-            for (int j = 0; j < numBases_; ++j)
-            {
-                for (int k = 0; k < numDofsPerNode_[j]; ++k)
-                {
-                    nodeDofs(i, ++locNodeCt) = ++dofCt;
-                }
-            }
-        }
-        numNodeDofs_ = dofCt + 1;
-
-        // count edge dofs
-        for (int i = 0; i < numEdges_; ++i)
-        {
-            int locEdgeCt = -1;
-            for (int j = 0; j < numBases_; ++j)
-            {
-                for (int k = 0; k < numDofsPerEdge_[j]; ++k)
-                {
-                    edgeDofs(i, ++locEdgeCt) = ++dofCt;
-                }
-            }
-        }
-        numEdgeDofs_ = dofCt + 1 - numNodeDofs_;
-
-        // count face dofs
-        for (int i = 0; i < numCells_; ++i)
-        {
-            int locFaceCt = -1;
-            for (int j = 0; j < numBases_; ++j)
-            {
-                for (int k = 0; k < numDofsPerFace_[j]; ++k)
-                {
-                    faceDofs(i, ++locFaceCt) = ++dofCt;
-                }
-            }
-        }
-        numFaceDofs_ = dofCt + 1 - numNodeDofs_ - numEdgeDofs_;
-
-        numDofs_ = numNodeDofs_ + numEdgeDofs_ + numFaceDofs_;
-
-    } // computeDofArrays
-
-    void computeCellDofs()
-    {
-
-        cellDofs_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, numLocalDofs_));
-
-        // Grab object references, for easier indexing.
-        Intrepid::FieldContainer<int> &cdofs = *cellDofs_;
-        Intrepid::FieldContainer<int> &nodeDofs = *nodeDofs_;
-        Intrepid::FieldContainer<int> &edgeDofs = *edgeDofs_;
-        Intrepid::FieldContainer<int> &faceDofs = *faceDofs_;
-        Intrepid::FieldContainer<int> &ctn = *meshCellToNodeMap_;
-        Intrepid::FieldContainer<int> &cte = *meshCellToEdgeMap_;
-
-        for (int i = 0; i < numCells_; ++i)
-        {
-            int ct = -1;
-            for (int j = 0; j < numLocalNodes_; ++j)
-            {
-                for (int k = 0; k < numLocalNodeDofs_; ++k)
-                {
-                    cdofs(i, ++ct) = nodeDofs(ctn(i, j), k);
-                }
-            }
-            for (int j = 0; j < numLocalEdges_; ++j)
-            {
-                for (int k = 0; k < numLocalEdgeDofs_; ++k)
-                {
-                    cdofs(i, ++ct) = edgeDofs(cte(i, j), k);
-                }
-            }
-            for (int j = 0; j < numLocalFaces_; ++j)
-            {
-                for (int k = 0; k < numLocalFaceDofs_; ++k)
-                {
-                    cdofs(i, ++ct) = faceDofs(i, k);
-                }
-            }
-        }
-    } // computeCellDofs
-
-    void computeFieldPattern()
-    {
-
-        fieldPattern_.resize(numBases_);
-
-        int dofCt = -1;
-
-        // count node dofs
-        for (int i = 0; i < numLocalNodes_; ++i)
-        {
-            for (int j = 0; j < numBases_; ++j)
-            {
-                for (int k = 0; k < numDofsPerNode_[j]; ++k)
-                {
-                    fieldPattern_[j].push_back(++dofCt);
-                }
-            }
-        }
-
-        // count edge dofs
-        for (int i = 0; i < numLocalEdges_; ++i)
-        {
-            for (int j = 0; j < numBases_; ++j)
-            {
-                for (int k = 0; k < numDofsPerEdge_[j]; ++k)
-                {
-                    fieldPattern_[j].push_back(++dofCt);
-                }
-            }
-        }
-
-        // count face dofs
-        for (int i = 0; i < numLocalFaces_; ++i)
-        {
-            for (int j = 0; j < numBases_; ++j)
-            {
-                for (int k = 0; k < numDofsPerFace_[j]; ++k)
-                {
-                    fieldPattern_[j].push_back(++dofCt);
-                }
-            }
-        }
-
-    } // computeFieldPattern
-
-    void computeFieldDofs()
-    {
-
-        fieldDofs_.resize(numBases_);
-
-        Intrepid::FieldContainer<int> &cdofs = *cellDofs_;
-
-        for (int fieldNum = 0; fieldNum < numBases_; ++fieldNum)
-        {
-            int basisCard = intrepidBasis_[fieldNum]->getCardinality();
-            fieldDofs_[fieldNum] = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, basisCard));
-            Intrepid::FieldContainer<int> &fdofs = *(fieldDofs_[fieldNum]);
-            for (int i = 0; i < numCells_; ++i)
-            {
-                for (int j = 0; j < basisCard; ++j)
-                {
-                    fdofs(i, j) = cdofs(i, fieldPattern_[fieldNum][j]);
-                }
-            }
-        }
-    } // computeFieldDofs
-};
-
-#endif
diff --git a/tlnos/src/TOOLS/elasticity.hpp b/tlnos/src/TOOLS/elasticity.hpp
deleted file mode 100644
index 47c7c4f4f988c8496cd4111a0a06b2a1053aa813..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/elasticity.hpp
+++ /dev/null
@@ -1,947 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-#ifndef ROL_PDEOPT_ELASTICITY_H
-#define ROL_PDEOPT_ELASTICITY_H
-
-#include "Intrepid_DefaultCubatureFactory.hpp"
-#include "Intrepid_HGRAD_QUAD_C2_FEM.hpp"
-#include "Intrepid_HGRAD_QUAD_C1_FEM.hpp"
-#include "../TOOLS/PDE_FEM.hpp"
-#include "../TOOLS/materials.hpp"
-
-#include "ROL_Types.hpp"
-
-template <class Real>
-class Elasticity : public PDE_FEM<Real>
-{
-protected:
-    Real E_;
-    Real poissonR_;
-    bool planeStrain_;
-
-    // dbc cases
-    int DBC_Case_;
-    // parametrized loads
-    std::vector<Real> param_;
-    // geometry and loads information
-    Real xmin_;
-    Real ymin_;
-    Real xmax_;
-    Real ymax_;
-    // body force
-    Real bodyforce_Magnitude_;
-    Real bodyforce_Angle_;
-    // traction
-    int traction_Side_;
-    Real traction_Magnitude_;
-    Real traction_Angle_;
-    // point load
-    Real pointload_loc_x_;
-    Real pointload_loc_y_;
-    Real pointload_Magnitude_;
-    Real pointload_Angle_;
-    std::vector<int> my_pointload_bc_;
-    //
-
-    std::vector<Teuchos::RCP<Material<Real>>> material_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> BMat_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> BMatWeighted_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> CBMat_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> NMat_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> NMatWeighted_;
-    int materialTensorDim_;
-
-    // for boundary integration of traction force
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> NMatWeighted_Side;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cub_points_side;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cub_weights_side;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cub_points_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cub_points_side_physical;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> jacobian_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> jacobian_det_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> weighted_measure_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> value_of_basis_at_cub_points_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> transformed_value_of_basis_at_cub_points_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> weighted_transformed_value_of_basis_at_cub_points_side_refcell;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> tractions;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> tractions_on_dofs;
-
-    bool verbose_;
-
-    Real DegreesToRadians(const Real deg) const
-    {
-        return deg * static_cast<Real>(M_PI) / static_cast<Real>(180);
-    }
-
-    void PrintLoadingInformation(void)
-    {
-        if (verbose_)
-        {
-            *this->outStream_ << std::endl
-                              << std::string(80, '-') << std::endl;
-            *this->outStream_ << std::string(20, ' ') << "LOADING INFORMATION" << std::endl;
-            *this->outStream_ << std::string(80, '-') << std::endl;
-            *this->outStream_ << "  Volumetric Force Magnitude: " << param_[0] << std::endl;
-            *this->outStream_ << "  Volumetric Force Angle:     " << param_[1] << std::endl;
-            *this->outStream_ << "  Traction Side:              " << traction_Side_ << std::endl;
-            *this->outStream_ << "  Traction Force Magnitude:   " << param_[2] << std::endl;
-            *this->outStream_ << "  Traction Force Angle:       " << param_[3] << std::endl;
-            *this->outStream_ << "  Point Force Location:       "
-                              << "(" << pointload_loc_x_
-                              << ", " << pointload_loc_y_ << ")" << std::endl;
-            *this->outStream_ << "  Point Force Magnitude:      " << param_[4] << std::endl;
-            *this->outStream_ << "  Point Force Angle:          " << param_[5] << std::endl;
-            *this->outStream_ << std::string(80, '-') << std::endl
-                              << std::endl;
-        }
-    }
-    //
-public:
-    Elasticity() {}
-    virtual ~Elasticity() {}
-
-    virtual void Initialize(const Teuchos::RCP<const Teuchos::Comm<int>> &comm,
-                            const Teuchos::RCP<Teuchos::ParameterList> &parlist,
-                            const Teuchos::RCP<std::ostream> &outStream)
-    {
-        /****************************************************************************/
-        /*** Initialize the base PDE_FEM class. *************************************/
-        /****************************************************************************/
-        PDE_FEM<Real>::Initialize(comm, parlist, outStream);
-
-        /****************************************************************************/
-        /*** Grab the elasticity information. ***************************************/
-        /****************************************************************************/
-        Teuchos::ParameterList &Elist = parlist->sublist("Elasticity");
-        planeStrain_ = Elist.get<bool>("Plane Strain");
-        E_ = Elist.get<Real>("Young's Modulus");
-        poissonR_ = Elist.get<Real>("Poisson Ratio");
-        Teuchos::ParameterList &Glist = parlist->sublist("Geometry");
-        xmin_ = Glist.get<Real>("X0");
-        ymin_ = Glist.get<Real>("Y0");
-        xmax_ = Glist.get<Real>("Width");
-        ymax_ = Glist.get<Real>("Height");
-        // DBC cases
-        DBC_Case_ = Elist.get<int>("DBC Case");
-
-        /****************************************************************************/
-        /*** Initialize mesh / finite element fields / degree-of-freedom manager. ***/
-        /****************************************************************************/
-        Teuchos::ParameterList &Plist = parlist->sublist("PDE FEM");
-        verbose_ = Plist.get("Verbose Output", false);
-        int basisOrder = Plist.get<int>("Order of FE Discretization");
-        Teuchos::RCP<MeshManager<Real>> meshMgr = Teuchos::rcp(new MeshManager_Rectangle<Real>(*parlist));
-        int spaceDim = 2;
-        std::vector<Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>>> basisPtrs(spaceDim, Teuchos::null);
-        for (int k = 0; k < spaceDim; ++k)
-        {
-            if (basisOrder == 1)
-            {
-                basisPtrs[k] = Teuchos::rcp(new Intrepid::Basis_HGRAD_QUAD_C1_FEM<Real, Intrepid::FieldContainer<Real>>);
-            }
-            else if (basisOrder == 2)
-            {
-                basisPtrs[k] = Teuchos::rcp(new Intrepid::Basis_HGRAD_QUAD_C2_FEM<Real, Intrepid::FieldContainer<Real>>);
-            }
-            else
-            {
-                TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
-                                           ">>> (Elasticity::Initialize): Basis Order is out of bounds!");
-            }
-        }
-        PDE_FEM<Real>::SetDiscretization(meshMgr, basisPtrs);
-        PDE_FEM<Real>::printMeshData(*outStream);
-    }
-
-    // for rectangular domain
-    virtual void process_loading_information(const Teuchos::RCP<Teuchos::ParameterList> &parlist)
-    {
-        Teuchos::ParameterList &Elist = parlist->sublist("Elasticity");
-        bodyforce_Magnitude_ = Elist.get<Real>("Bodyforce Magnitude");
-        bodyforce_Angle_ = Elist.get<Real>("Bodyforce Angle");
-        traction_Side_ = Elist.get<int>("Traction Side");
-        traction_Magnitude_ = Elist.get<Real>("Traction Magnitude");
-        traction_Angle_ = Elist.get<Real>("Traction Angle");
-        pointload_loc_x_ = Elist.get<Real>("Pointload Location X");
-        pointload_loc_y_ = Elist.get<Real>("Pointload Location Y");
-        pointload_Magnitude_ = Elist.get<Real>("Pointload Magnitude");
-        pointload_Angle_ = Elist.get<Real>("Pointload Angle");
-
-        param_.clear();
-        param_.resize(6);
-        param_[0] = bodyforce_Magnitude_;
-        param_[1] = bodyforce_Angle_;
-        param_[2] = traction_Magnitude_;
-        param_[3] = traction_Angle_;
-        param_[4] = pointload_Magnitude_;
-        param_[5] = pointload_Angle_;
-
-        PrintLoadingInformation();
-
-        this->my_nbc_.push_back(traction_Side_);
-
-        // calculate the distance of the point load to the boundary
-        // and move it to the closesd boundary point only works for
-        // rectangular domain first make sure the point load is in
-        // the domain
-        TEUCHOS_TEST_FOR_EXCEPTION(pointload_loc_x_ < xmin_, std::invalid_argument,
-                                   ">>> (elasticity::process_loading_information): x location of point load is less than xmin!");
-        TEUCHOS_TEST_FOR_EXCEPTION(pointload_loc_x_ > xmax_, std::invalid_argument,
-                                   ">>> (elasticity::process_loading_information): x location of point load is greater than xmax!");
-        TEUCHOS_TEST_FOR_EXCEPTION(pointload_loc_y_ < ymin_, std::invalid_argument,
-                                   ">>> (elasticity::process_loading_information): y location of point load is less than ymin!");
-        TEUCHOS_TEST_FOR_EXCEPTION(pointload_loc_y_ > ymax_, std::invalid_argument,
-                                   ">>> (elasticity::process_loading_information): y location of point load is greater than ymax!");
-        //
-        Real distx1 = std::abs(pointload_loc_x_ - xmin_);
-        Real distx2 = std::abs(pointload_loc_x_ - xmax_);
-        Real movx = std::min(distx1, distx2);
-        Real disty1 = std::abs(pointload_loc_y_ - ymin_);
-        Real disty2 = std::abs(pointload_loc_y_ - ymax_);
-        Real movy = std::min(disty1, disty2);
-        // slight perturbation
-        // pointload will be moved to the closest boundary node eventually
-        // perturbation trick to avoid parrallel issues
-        Real eps = 1e-8 * (std::min((xmax_ - xmin_), (ymax_ - ymin_)));
-        if (movx <= movy && distx1 <= distx2)
-        {
-            // mov load to the left boundary
-            pointload_loc_x_ = xmin_ + eps;
-            my_pointload_bc_.push_back(3);
-            // perturb y
-            if (disty1 <= disty2)
-            {
-                pointload_loc_y_ = pointload_loc_y_ + eps;
-            }
-            else
-            {
-                pointload_loc_y_ = pointload_loc_y_ - eps;
-            }
-        }
-        else if (movx <= movy && distx1 > distx2)
-        {
-            // mov load to the right boundary
-            pointload_loc_x_ = xmax_ - eps;
-            my_pointload_bc_.push_back(1);
-            //perturb y
-            if (disty1 <= disty2)
-            {
-                pointload_loc_y_ = pointload_loc_y_ + eps;
-            }
-            else
-            {
-                pointload_loc_y_ = pointload_loc_y_ - eps;
-            }
-        }
-        else if (movx > movy && disty1 <= disty2)
-        {
-            // mov load to the bottom boundary
-            pointload_loc_y_ = ymin_ + eps;
-            my_pointload_bc_.push_back(0);
-            // perturb x
-            if (distx1 <= distx2)
-            {
-                pointload_loc_x_ = pointload_loc_x_ + eps;
-            }
-            else
-            {
-                pointload_loc_x_ = pointload_loc_x_ - eps;
-            }
-        }
-        else
-        {
-            // mov load to the top boundary
-            pointload_loc_y_ = ymax_ - eps;
-            my_pointload_bc_.push_back(2);
-            // perturb x
-            if (distx1 <= distx2)
-            {
-                pointload_loc_x_ = pointload_loc_x_ + eps;
-            }
-            else
-            {
-                pointload_loc_x_ = pointload_loc_x_ - eps;
-            }
-        }
-
-        // print to check
-        if (verbose_)
-        {
-            *this->outStream_ << "Load processing finished." << std::endl;
-            *this->outStream_ << "My nbc numbers: ";
-            for (unsigned i = 0; i < this->my_nbc_.size(); i++)
-            {
-                *this->outStream_ << this->my_nbc_[i];
-            }
-            *this->outStream_ << std::endl;
-            *this->outStream_ << "My pbc numbers: ";
-            for (unsigned i = 0; i < my_pointload_bc_.size(); i++)
-            {
-                *this->outStream_ << my_pointload_bc_[i];
-            }
-            *this->outStream_ << std::endl;
-            *this->outStream_ << "My pointload location: " << pointload_loc_x_
-                              << ", " << pointload_loc_y_ << std::endl;
-        }
-    }
-
-    virtual void CreateMaterial(void)
-    {
-        int numCells = PDE_FEM<Real>::GetNumCells();
-        int spaceDim = PDE_FEM<Real>::GetSpaceDim();
-        for (int i = 0; i < numCells; ++i)
-        {
-            Teuchos::RCP<Material<Real>> CellMaterial = Teuchos::rcp(new Material<Real>());
-            CellMaterial->InitializeMaterial(spaceDim, planeStrain_, E_, poissonR_);
-            materialTensorDim_ = CellMaterial->GetMaterialTensorDim();
-            material_.push_back(CellMaterial);
-        }
-    }
-
-    virtual void ComputeLocalSystemMats(void)
-    {
-        int spaceDim = PDE_FEM<Real>::GetSpaceDim();
-        int numCells = PDE_FEM<Real>::GetNumCells();
-        int numCubPoints = PDE_FEM<Real>::GetNumCubPoints();
-        int lfs = PDE_FEM<Real>::GetLocalFieldSize();
-        int full_lfs = lfs * spaceDim;
-
-        this->gradgradMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, full_lfs));
-        this->valvalMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, full_lfs));
-
-        // construct mats
-        CreateMaterial();
-
-        BMat_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, numCubPoints, materialTensorDim_));
-        BMatWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, numCubPoints, materialTensorDim_));
-        CBMat_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, numCubPoints, materialTensorDim_));
-        NMat_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, numCubPoints, spaceDim));
-        NMatWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs, numCubPoints, spaceDim));
-        Construct_N_B_mats();
-        Construct_CBmats();
-
-        // compute local grad.grad (stiffness) matrices
-        Intrepid::FunctionSpaceTools::integrate<Real>(*this->gradgradMats_,
-                                                      *CBMat_,
-                                                      *BMatWeighted_,
-                                                      Intrepid::COMP_CPP);
-        // compute local val.val (mass) matrices
-        Intrepid::FunctionSpaceTools::integrate<Real>(*this->valvalMats_,
-                                                      *NMat_,
-                                                      *NMatWeighted_,
-                                                      Intrepid::COMP_CPP);
-    }
-
-    // new
-    // constructing Nmat on side
-    void Construct_Nmat_on_Side(int numCub)
-    {
-        int spaceDim = PDE_FEM<Real>::GetSpaceDim();
-        int lfs = PDE_FEM<Real>::GetLocalFieldSize();
-        int full_lfs = lfs * spaceDim;
-        NMatWeighted_Side = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, full_lfs, numCub, spaceDim));
-        NMatWeighted_Side->initialize(0.0);
-
-        if (spaceDim == 2)
-        {
-            for (int j = 0; j < numCub; ++j)
-            {
-                for (int k = 0; k < lfs; ++k)
-                {
-                    (*NMatWeighted_Side)(0, k * spaceDim + 0, j, 0) = (*weighted_transformed_value_of_basis_at_cub_points_side_refcell)(0, k, j);
-                    (*NMatWeighted_Side)(0, k * spaceDim + 1, j, 1) = (*weighted_transformed_value_of_basis_at_cub_points_side_refcell)(0, k, j);
-                }
-            }
-        }
-
-        if (spaceDim == 3)
-        {
-            for (int j = 0; j < numCub; ++j)
-            {
-                for (int k = 0; k < lfs; ++k)
-                {
-                    (*NMatWeighted_Side)(0, k * spaceDim + 0, j, 0) = (*weighted_transformed_value_of_basis_at_cub_points_side_refcell)(0, k, j);
-                    (*NMatWeighted_Side)(0, k * spaceDim + 1, j, 1) = (*weighted_transformed_value_of_basis_at_cub_points_side_refcell)(0, k, j);
-                    (*NMatWeighted_Side)(0, k * spaceDim + 2, j, 2) = (*weighted_transformed_value_of_basis_at_cub_points_side_refcell)(0, k, j);
-                }
-            }
-        }
-    }
-
-    // adding point load to right hand side vector
-    virtual void AddPointLoadToRHS(void)
-    {
-        int n_pbc = my_pointload_bc_.size();
-        for (int i = 0; i < n_pbc; ++i)
-        {
-            int pbc_num = my_pointload_bc_[i];
-            for (int j = 0; j < this->myBoundaryCellIds_[pbc_num].size(); ++j)
-            {
-                int myGlobalCellId = this->myBoundaryCellIds_[pbc_num][j];
-                // apply possible point loads
-                this->check_and_Apply_PointLoad_By_Coords(myGlobalCellId, pbc_num);
-            }
-        }
-    }
-
-    // adding traction boundary data into right hand side vector
-    virtual void ModifyLocalForceVecWithSideTractions(void)
-    {
-
-        int cellDim = PDE_FEM<Real>::GetSpaceDim();
-        int lfs = PDE_FEM<Real>::GetLocalFieldSize(); //number of dof each dimension
-        int full_lfs = lfs * cellDim;
-        int numNodesPerCell = this->numNodesPerCell_;
-
-        shards::CellTopology sideType(shards::getCellTopologyData<shards::Line<>>());
-        int cubDegree = 10;
-        Intrepid::DefaultCubatureFactory<Real> cubFactory; // create cubature factory
-        Teuchos::RCP<Intrepid::Cubature<Real>> sideCub = cubFactory.create(sideType, cubDegree);
-        int numCubPointsSide = sideCub->getNumPoints();
-        if (verbose_)
-        {
-            *this->outStream_ << "numCubPointsSide: " << numCubPointsSide << std::endl;
-        }
-
-        int sideDim = this->sideDim_;
-        int n_nbc = this->my_nbc_.size();
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> thiscellNodes;
-        thiscellNodes = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, numNodesPerCell, cellDim));
-        Intrepid::FieldContainer<Real> &nodes = *(this->meshMgr_)->getNodes();
-
-        if (verbose_)
-        {
-            *this->outStream_ << "n_nbc: " << n_nbc << std::endl;
-        }
-        for (int i = 0; i < n_nbc; i++)
-        {
-            int nbc_num = this->my_nbc_[i];
-            //std::cout << "nbc_num: " << nbc_num << std::endl;
-            for (int j = 0; j < this->myBoundaryCellIds_[nbc_num].size(); ++j)
-            {
-                int myGlobalCellId = this->myBoundaryCellIds_[nbc_num][j];
-                //*this->outStream_ << "myGlobalCellId: " << myGlobalCellId << std::endl;
-
-                // apply traction
-                for (int m = 0; m < numNodesPerCell; ++m)
-                {
-                    for (int n = 0; n < cellDim; ++n)
-                    {
-                        (*thiscellNodes)(0, m, n) = nodes(this->ctn_(myGlobalCellId, m), n);
-                    }
-                }
-                //std::cout << "first node coords: " << (*thiscellNodes)(0, 0, 0)
-                //          << ", " << (*thiscellNodes)(0, 0, 1) << std::endl;
-                cub_points_side = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPointsSide, sideDim));
-                cub_weights_side = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPointsSide));
-                cub_points_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPointsSide, cellDim));
-                cub_points_side_physical = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, numCubPointsSide, cellDim));
-                jacobian_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, numCubPointsSide, cellDim, cellDim));
-                jacobian_det_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, numCubPointsSide));
-                weighted_measure_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, numCubPointsSide));
-                value_of_basis_at_cub_points_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs, numCubPointsSide));
-                transformed_value_of_basis_at_cub_points_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, lfs, numCubPointsSide));
-                weighted_transformed_value_of_basis_at_cub_points_side_refcell = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, lfs, numCubPointsSide));
-                tractions = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, numCubPointsSide, cellDim));
-                tractions_on_dofs = Teuchos::rcp(new Intrepid::FieldContainer<Real>(1, full_lfs));
-
-                // compute traction b.c. contributions and adjust rhs
-                sideCub->getCubature(*cub_points_side, *cub_weights_side);
-
-                // compute geometric cell information
-                Intrepid::CellTools<Real>::mapToReferenceSubcell(*cub_points_side_refcell,
-                                                                 *cub_points_side,
-                                                                 sideDim,
-                                                                 nbc_num,
-                                                                 this->cellType_);
-
-                Intrepid::CellTools<Real>::setJacobian(*jacobian_side_refcell,
-                                                       *cub_points_side_refcell,
-                                                       *thiscellNodes,
-                                                       this->cellType_);
-
-                Intrepid::CellTools<Real>::setJacobianDet(*jacobian_det_side_refcell,
-                                                          *jacobian_side_refcell);
-
-                // compute weighted edge measure
-                Intrepid::FunctionSpaceTools::computeEdgeMeasure<Real>(*weighted_measure_side_refcell,
-                                                                       *jacobian_side_refcell,
-                                                                       *cub_weights_side,
-                                                                       nbc_num,
-                                                                       this->cellType_);
-
-                // tabulate values of basis functions at side cubature points, in the reference parent cell domain
-                (*this->basisPtrs_[0]).getValues(*value_of_basis_at_cub_points_side_refcell, *cub_points_side_refcell, Intrepid::OPERATOR_VALUE);
-                // transform
-                Intrepid::FunctionSpaceTools::HGRADtransformVALUE<Real>(
-                    *transformed_value_of_basis_at_cub_points_side_refcell,
-                    *value_of_basis_at_cub_points_side_refcell);
-
-                // multiply with weighted measure
-                Intrepid::FunctionSpaceTools::multiplyMeasure<Real>(
-                    *weighted_transformed_value_of_basis_at_cub_points_side_refcell,
-                    *weighted_measure_side_refcell,
-                    *transformed_value_of_basis_at_cub_points_side_refcell);
-
-                Construct_Nmat_on_Side(numCubPointsSide);
-
-                // compute Neumann data
-                // map side cubature points in reference parent cell domain to physical space
-                Intrepid::CellTools<Real>::mapToPhysicalFrame(*cub_points_side_physical,
-                                                              *cub_points_side_refcell,
-                                                              *thiscellNodes,
-                                                              this->cellType_);
-                //std::cout << "cub_points_side_physical:" << (*cub_points_side_physical)(0,0,0)
-                //          << ", " << (*cub_points_side_physical)(0,0,1) << std::endl;
-                // now compute data
-                std::vector<Real> x(cellDim), F(cellDim);
-                for (int m = 0; m < numCubPointsSide; ++m)
-                {
-                    for (int n = 0; n < cellDim; ++n)
-                    {
-                        x[n] = (*cub_points_side_physical)(0, m, n);
-                    }
-                    funcRHS_NBC(F, x);
-                    for (int n = 0; n < cellDim; ++n)
-                    {
-                        (*tractions)(0, m, n) = F[n];
-                    }
-                }
-                Intrepid::FunctionSpaceTools::integrate<Real>(*tractions_on_dofs,
-                                                              *tractions,
-                                                              *NMatWeighted_Side,
-                                                              Intrepid::COMP_CPP);
-
-                // adjust RHS
-                for (int m = 0; m < full_lfs; ++m)
-                {
-                    (*this->datavalVecF_)(this->find_local_index(myGlobalCellId), m) += (*tractions_on_dofs)(0, m);
-                }
-
-                //check tractions on dofs
-                //*this->outStream_<<"tractions_on_dofs: ";
-                //for(int m=0; m<full_lfs; ++m)
-                //  *this->outStream_<<(*tractions_on_dofs)(0, m)<<", ";
-                //*this->outStream_<<std::endl;
-            }
-        }
-    }
-
-    virtual void ComputeLocalForceVec(void)
-    {
-        int spaceDim = PDE_FEM<Real>::GetSpaceDim();
-        int numCells = PDE_FEM<Real>::GetNumCells();
-        int numCubPoints = PDE_FEM<Real>::GetNumCubPoints();
-        int lfs = PDE_FEM<Real>::GetLocalFieldSize();
-        int full_lfs = lfs * spaceDim;
-        this->dataF_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, numCubPoints, spaceDim));
-        this->datavalVecF_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells, full_lfs));
-
-        std::vector<Real> x(spaceDim), F(spaceDim);
-        for (int i = 0; i < numCells; ++i)
-        { // evaluate functions at these points
-            for (int j = 0; j < numCubPoints; ++j)
-            {
-                for (int k = 0; k < spaceDim; ++k)
-                {
-                    x[k] = (*this->cubPointsPhysical_)(i, j, k);
-                }
-                funcRHS_BodyForce(F, x);
-                for (int k = 0; k < spaceDim; ++k)
-                {
-                    (*this->dataF_)(i, j, k) = F[k];
-                }
-            }
-        }
-        Intrepid::FunctionSpaceTools::integrate<Real>(*this->datavalVecF_, // compute local data.val vectors for RHS F
-                                                      *this->dataF_,
-                                                      *NMatWeighted_,
-                                                      Intrepid::COMP_CPP);
-
-        // new
-        if (verbose_)
-        {
-            *this->outStream_ << "Modifying local force vectors using boundary tractions" << std::endl;
-        }
-        ModifyLocalForceVecWithSideTractions();
-        AddPointLoadToRHS();
-        if (verbose_)
-        {
-            *this->outStream_ << "Modifying Done!" << std::endl;
-        }
-    }
-
-    virtual void updateF(const std::vector<Real> &param)
-    {
-        //Real diff = std::sqrt(std::pow(param_[0]-param[0],2)
-        //                    + std::pow(param_[1]-param[1],2)
-        //                    + std::pow(param_[2]-param[2],2)
-        //                    + std::pow(param_[3]-param[3],2)
-        //                    + std::pow(param_[4]-param[4],2)
-        //                    + std::pow(param_[5]-param[5],2));
-        //if (diff > ROL::ROL_EPSILON<Real>()) {
-        param_ = param;
-
-        ComputeLocalForceVec();
-        PDE_FEM<Real>::AssembleRHSVector();
-        PDE_FEM<Real>::VectorRemoveDBC();
-
-        PrintLoadingInformation();
-        //}
-    }
-
-    void Construct_N_B_mats(void)
-    {
-        //std::cout<<"Computing N and B mats."<<std::endl;
-        BMat_->initialize(0.0);
-        NMat_->initialize(0.0);
-        BMatWeighted_->initialize(0.0);
-        NMatWeighted_->initialize(0.0);
-
-        if (this->spaceDim_ == 2)
-        {
-            for (int i = 0; i < this->numCells_; ++i)
-            { // evaluate functions at these points
-                for (int j = 0; j < this->numCubPoints_; ++j)
-                {
-                    for (int k = 0; k < this->lfs_; ++k)
-                    {
-                        (*NMat_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->valPhysical_)(i, k, j);
-                        (*NMat_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->valPhysical_)(i, k, j);
-                        (*NMatWeighted_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->valPhysicalWeighted_)(i, k, j);
-                        (*NMatWeighted_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->valPhysicalWeighted_)(i, k, j);
-
-                        (*BMat_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->gradPhysical_)(i, k, j, 0);
-                        (*BMat_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->gradPhysical_)(i, k, j, 1);
-                        (*BMat_)(i, k * this->spaceDim_ + 0, j, 2) = (*this->gradPhysical_)(i, k, j, 1);
-                        (*BMat_)(i, k * this->spaceDim_ + 1, j, 2) = (*this->gradPhysical_)(i, k, j, 0);
-
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->gradPhysicalWeighted_)(i, k, j, 0);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->gradPhysicalWeighted_)(i, k, j, 1);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 0, j, 2) = (*this->gradPhysicalWeighted_)(i, k, j, 1);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 1, j, 2) = (*this->gradPhysicalWeighted_)(i, k, j, 0);
-                    }
-                }
-            }
-        }
-
-        if (this->spaceDim_ == 3)
-        {
-            for (int i = 0; i < this->numCells_; ++i)
-            { // evaluate functions at these points
-                for (int j = 0; j < this->numCubPoints_; ++j)
-                {
-                    for (int k = 0; k < this->lfs_; ++k)
-                    {
-                        (*NMat_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->valPhysical_)(i, k, j);
-                        (*NMat_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->valPhysical_)(i, k, j);
-                        (*NMat_)(i, k * this->spaceDim_ + 2, j, 2) = (*this->valPhysical_)(i, k, j);
-                        (*NMatWeighted_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->valPhysicalWeighted_)(i, k, j);
-                        (*NMatWeighted_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->valPhysicalWeighted_)(i, k, j);
-                        (*NMatWeighted_)(i, k * this->spaceDim_ + 2, j, 2) = (*this->valPhysicalWeighted_)(i, k, j);
-
-                        (*BMat_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->gradPhysical_)(i, k, j, 0);
-                        (*BMat_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->gradPhysical_)(i, k, j, 1);
-                        (*BMat_)(i, k * this->spaceDim_ + 2, j, 2) = (*this->gradPhysical_)(i, k, j, 2);
-                        (*BMat_)(i, k * this->spaceDim_ + 1, j, 3) = (*this->gradPhysical_)(i, k, j, 2);
-                        (*BMat_)(i, k * this->spaceDim_ + 2, j, 3) = (*this->gradPhysical_)(i, k, j, 1);
-                        (*BMat_)(i, k * this->spaceDim_ + 0, j, 4) = (*this->gradPhysical_)(i, k, j, 2);
-                        (*BMat_)(i, k * this->spaceDim_ + 2, j, 4) = (*this->gradPhysical_)(i, k, j, 0);
-                        (*BMat_)(i, k * this->spaceDim_ + 0, j, 5) = (*this->gradPhysical_)(i, k, j, 1);
-                        (*BMat_)(i, k * this->spaceDim_ + 1, j, 5) = (*this->gradPhysical_)(i, k, j, 0);
-
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 0, j, 0) = (*this->gradPhysicalWeighted_)(i, k, j, 0);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 1, j, 1) = (*this->gradPhysicalWeighted_)(i, k, j, 1);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 2, j, 2) = (*this->gradPhysicalWeighted_)(i, k, j, 2);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 1, j, 3) = (*this->gradPhysicalWeighted_)(i, k, j, 2);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 2, j, 3) = (*this->gradPhysicalWeighted_)(i, k, j, 1);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 0, j, 4) = (*this->gradPhysicalWeighted_)(i, k, j, 2);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 2, j, 4) = (*this->gradPhysicalWeighted_)(i, k, j, 0);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 0, j, 5) = (*this->gradPhysicalWeighted_)(i, k, j, 1);
-                        (*BMatWeighted_)(i, k * this->spaceDim_ + 1, j, 5) = (*this->gradPhysicalWeighted_)(i, k, j, 0);
-                    }
-                }
-            }
-        }
-    }
-
-    // test matrices
-    virtual void test_mats(void)
-    {
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_Jaco_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_Grad_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_N_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_B_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_K_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_M_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_F_Vec;
-
-        test_Jaco_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->spaceDim_, this->spaceDim_));
-        test_Grad_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->lfs_, this->spaceDim_));
-        test_N_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->spaceDim_));
-        test_B_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, materialTensorDim_));
-        test_K_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->numLocalDofs_));
-        test_M_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->numLocalDofs_));
-        test_F_Vec = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, 1));
-
-        for (int i = 0; i < this->spaceDim_; i++)
-        {
-            for (int j = 0; j < this->spaceDim_; j++)
-            {
-                (*test_Jaco_Mat)(i, j) = (*this->cellJac_)(0, 0, i, j);
-            }
-        }
-        for (int i = 0; i < this->numLocalDofs_; i++)
-        {
-            for (int j = 0; j < this->spaceDim_; j++)
-            {
-                if (i < this->lfs_)
-                {
-                    (*test_Grad_Mat)(i, j) = (*this->gradReference_)(i, 0, j);
-                }
-                (*test_N_Mat)(i, j) = (*NMat_)(0, i, 0, j);
-            }
-            for (int j = 0; j < materialTensorDim_; j++)
-            {
-                (*test_B_Mat)(i, j) = (*BMat_)(0, i, 0, j);
-            }
-            for (int j = 0; j < this->numLocalDofs_; j++)
-            {
-                (*test_K_Mat)(i, j) = (*this->gradgradMats_)(0, i, j);
-                (*test_M_Mat)(i, j) = (*this->valvalMats_)(0, i, j);
-            }
-            (*test_F_Vec)(i, 0) = (*this->datavalVecF_)(0, i);
-        }
-        std::cout << *test_Jaco_Mat << std::endl;
-        std::cout << *test_Grad_Mat << std::endl;
-        std::cout << *test_N_Mat << std::endl;
-        std::cout << *test_B_Mat << std::endl;
-        std::cout << *test_K_Mat << std::endl;
-        std::cout << *test_M_Mat << std::endl;
-        std::cout << *test_F_Vec << std::endl;
-    }
-
-    virtual void Construct_CBmats(void)
-    {
-        //std::cout<<"Computing CB mats."<<std::endl;
-        CBMat_->initialize(0.0);
-        for (int i = 0; i < this->numCells_; ++i)
-        {
-            Teuchos::RCP<Intrepid::FieldContainer<Real>> materialMat = material_[i]->GetMaterialTensor();
-            for (int j = 0; j < this->numCubPoints_; ++j)
-            {
-                for (int m = 0; m < this->lfs_ * this->spaceDim_; m++)
-                {
-                    for (int n = 0; n < materialTensorDim_; n++)
-                    {
-                        for (int k = 0; k < materialTensorDim_; k++)
-                        {
-                            (*CBMat_)(i, m, j, n) += (*BMat_)(i, m, j, k) * (*materialMat)(k, n);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    // load functions, can be parametrized
-    // modification for stochastic loads should be made here
-    virtual void funcRHS_BodyForce(std::vector<Real> &F,
-                                   const std::vector<Real> &x) const
-    {
-        Real theta = DegreesToRadians(param_[1]);
-        F.clear();
-        F.resize(this->spaceDim_);
-        F[0] = param_[0] * std::cos(theta);
-        F[1] = param_[0] * std::sin(theta);
-    }
-
-    virtual void funcRHS_NBC(std::vector<Real> &F,
-                             const std::vector<Real> &x) const
-    {
-        Real theta = DegreesToRadians(param_[3]);
-        F.clear();
-        F.resize(this->spaceDim_);
-        F[0] = param_[2] * std::cos(theta);
-        F[1] = param_[2] * std::sin(theta);
-    }
-
-    virtual void funcRHS_PtLoad(std::vector<Real> &F) const
-    {
-        Real theta = DegreesToRadians(param_[5]);
-        F.clear();
-        F.resize(this->spaceDim_);
-        F[0] = param_[4] * std::cos(theta);
-        F[1] = param_[4] * std::sin(theta);
-    }
-    //
-    //
-
-    virtual void ApplyPointLoad(const int pointload_bc,
-                                const int globalCellNum,
-                                const std::vector<int> &localNodeNum,
-                                const std::vector<Real> &coord1,
-                                const std::vector<Real> &coord2)
-    {
-        Teuchos::RCP<Intrepid::FieldContainer<int>> nodeDofs = this->dofMgr_->getNodeDofs();
-        bool isLoadPosContainedInCurrentSegment = false;
-        int whichNodeIsCloser = -1;
-        // if update F, provides parametrized computation of F[0] and F[1]
-        std::vector<Real> F;
-        funcRHS_PtLoad(F);
-        //
-        Real x11 = coord1[0], x12 = coord1[1];
-        Real x21 = coord2[0], x22 = coord2[1];
-        Real fx = pointload_loc_x_;
-        Real fy = pointload_loc_y_;
-        int pbc_num = pointload_bc;
-
-        if (pbc_num == 0 || pbc_num == 2)
-        {
-            if (((x11 - fx) * (x21 - fx) < 0) && ((x12 - fy) * (x22 - fy) > 0))
-            {
-                isLoadPosContainedInCurrentSegment = true;
-                if (std::abs(x11 - fx) <= std::abs(x21 - fx))
-                {
-                    whichNodeIsCloser = 1;
-                }
-                else
-                {
-                    whichNodeIsCloser = 2;
-                }
-            }
-        }
-        if (pbc_num == 1 || pbc_num == 3)
-        {
-            if (((x11 - fx) * (x21 - fx) > 0) && ((x12 - fy) * (x22 - fy) < 0))
-            {
-                isLoadPosContainedInCurrentSegment = true;
-                if (std::abs(x12 - fy) <= std::abs(x22 - fy))
-                {
-                    whichNodeIsCloser = 1;
-                }
-                else
-                {
-                    whichNodeIsCloser = 2;
-                }
-            }
-        }
-        if (isLoadPosContainedInCurrentSegment)
-        {
-            int ctn = this->ctn_(globalCellNum, localNodeNum[whichNodeIsCloser - 1]);
-            this->myPointLoadDofs_.resize(2);
-            this->myPointLoadVals_.resize(2);
-            this->myPointLoadDofs_[0] = (*nodeDofs)(ctn, 0);
-            this->myPointLoadDofs_[1] = (*nodeDofs)(ctn, 1);
-            this->myPointLoadVals_[0] = F[0];
-            this->myPointLoadVals_[1] = F[1];
-            // print to check
-            if (verbose_)
-            {
-                *this->outStream_ << "Point load applied, at cell: " << globalCellNum << std::endl;
-                *this->outStream_ << "Point load values: " << F[0] << ", " << F[1] << std::endl;
-                if (whichNodeIsCloser == 1)
-                {
-                    *this->outStream_ << "Point load position: " << x11 << ", " << x12 << std::endl;
-                }
-                else
-                {
-                    *this->outStream_ << "Point load position: " << x21 << ", " << x22 << std::endl;
-                }
-            }
-        }
-    }
-    // ApplyPointLoad
-
-    // DBC cases, add more to extend
-    virtual int check_DBC_Coords_Range(const std::vector<Real> &x) const
-    {
-        // return value :
-        // -1: not a DBC node
-        //  0: x direction fixed
-        //  1: y direction fixed
-        //  5: both x, y direction are fixed
-        //
-        Real x1 = x[0], x2 = x[1], eps(1e-6);
-        switch (DBC_Case_)
-        {
-        case 0:
-        { // Fix bottom two corners, left corner x, y, right corner only y
-            if ((x2 < ymin_ + eps) && (x1 < xmin_ + eps))
-                return 5;
-            if ((x2 < ymin_ + eps) && (x1 > xmax_ - eps))
-                return 1;
-            break;
-        }
-        case 1:
-        { // Fix bottom two corners, both x, y
-            if ((x2 < ymin_ + eps) &&
-                ((x1 < xmin_ + eps) || (x1 > xmax_ - eps)))
-                return 5;
-            break;
-        }
-        case 2:
-        { // Fix left boundary, both x, y
-            if (x1 < xmin_ + eps)
-                return 5;
-            break;
-        }
-        case 3:
-        { // Fix bottom boundary, both x, y
-            if (x2 < ymin_ + eps)
-                return 5;
-            break;
-        }
-        case 4:
-        { // Fix ALL boundary, both x, y
-            return 5;
-            break;
-        }
-        }
-        return -1;
-    }
-
-}; // class Elasticity
-
-#endif
diff --git a/tlnos/src/TOOLS/elasticitySIMP.hpp b/tlnos/src/TOOLS/elasticitySIMP.hpp
deleted file mode 100644
index dd3f5f1db0717e9897a42ddc87eb6f2be3564f92..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/elasticitySIMP.hpp
+++ /dev/null
@@ -1,296 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-#ifndef ROL_PDEOPT_ELASTICITYSIMP_H
-#define ROL_PDEOPT_ELASTICITYSIMP_H
-
-#include "Intrepid_HGRAD_QUAD_C2_FEM.hpp"
-#include "Intrepid_HGRAD_QUAD_C1_FEM.hpp"
-#include "../TOOLS/elasticity.hpp"
-#include "../TOOLS/materials.hpp"
-
-template <class Real>
-class ElasticitySIMP : public Elasticity<Real>
-{
-protected:
-    Real initDensity_;
-    Real minDensity_;
-    int powerP_;
-
-    std::vector<Teuchos::RCP<Material_SIMP<Real>>> SIMPmaterial_;
-    Teuchos::RCP<Tpetra::MultiVector<>> myDensity_;
-    Teuchos::RCP<Tpetra::MultiVector<>> myCellArea_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> CBMat0_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradgradMats0_;
-
-public:
-    ElasticitySIMP() {}
-    ~ElasticitySIMP() {}
-
-    virtual void ElasticitySIMP_Initialize(const Teuchos::RCP<const Teuchos::Comm<int>> &comm,
-                                           const Teuchos::RCP<Teuchos::ParameterList> &parlist,
-                                           const Teuchos::RCP<std::ostream> &outStream)
-    {
-        this->Initialize(comm, parlist, outStream);
-        // new material parameters
-        Teuchos::ParameterList &list = this->parlist_->sublist("ElasticitySIMP");
-        powerP_ = list.get<int>("SIMP Power");
-        initDensity_ = list.get<Real>("Initial Density");
-        minDensity_ = list.get<Real>("Minimum Density");
-    }
-
-    virtual void SetSIMPParallelStructure()
-    {
-        PDE_FEM<Real>::SetParallelStructure();
-        this->myCellMap_ = Teuchos::rcp(new Tpetra::Map<>(Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(),
-                                                          this->myCellIds_, 0, this->commPtr_));
-    }
-
-    Teuchos::RCP<const Tpetra::Map<>> getDomainMapA() const
-    {
-        return this->matA_->getDomainMap();
-    }
-
-    Teuchos::RCP<const Tpetra::Map<>> getCellMap() const
-    {
-        return this->myCellMap_;
-    }
-
-    Teuchos::RCP<Tpetra::MultiVector<>> getMaterialDensity() const
-    {
-        return myDensity_;
-    }
-
-    // return cell measures
-    Teuchos::RCP<Tpetra::MultiVector<>> getCellAreas()
-    {
-        myCellArea_ = Teuchos::rcp(new Tpetra::MultiVector<>(this->myCellMap_, 1, true));
-        for (int i = 0; i < this->numCells_; i++)
-        {
-            myCellArea_->replaceGlobalValue(this->myCellIds_[i], 0, this->myCellMeasure_[i]);
-        }
-        return myCellArea_;
-    }
-    //
-    void ApplyBCToVec(const Teuchos::RCP<Tpetra::MultiVector<>> &u)
-    {
-        Real zero(0.0);
-        // u is myOverlapMap_
-        for (int i = 0; i < this->myDirichletDofs_.size(); ++i)
-        {
-            if (this->myOverlapMap_->isNodeGlobalElement(this->myDirichletDofs_[i]))
-                u->replaceGlobalValue(this->myDirichletDofs_[i], 0, zero);
-        }
-    }
-
-    void resetMaterialDensity(const Real val)
-    {
-        myDensity_ = Teuchos::rcp(new Tpetra::MultiVector<>(this->myCellMap_, 1, true));
-        myDensity_->putScalar(val);
-        renewMaterialVector();
-    }
-
-    void updateMaterialDensity(const Teuchos::RCP<const Tpetra::MultiVector<>> &newDensity)
-    {
-        myDensity_ = Teuchos::rcp(new Tpetra::MultiVector<>(this->myCellMap_, 1, true));
-        Tpetra::deep_copy(*myDensity_, *newDensity);
-        renewMaterialVector();
-    }
-
-    void renewMaterialVector()
-    {
-        Teuchos::ArrayRCP<const Real> densData = myDensity_->get1dView();
-        for (int i = 0; i < this->numCells_; i++)
-        {
-            Real dens = densData[myDensity_->getMap()->getLocalElement(this->myCellIds_[i])];
-            SIMPmaterial_[i]->setDensity(dens);
-        }
-    }
-
-    virtual void CreateMaterial()
-    {
-        for (int i = 0; i < this->numCells_; i++)
-        {
-            Teuchos::RCP<Material_SIMP<Real>> CellMaterial = Teuchos::rcp(new Material_SIMP<Real>());
-            CellMaterial->InitializeSIMP(this->spaceDim_, this->planeStrain_, this->E_,
-                                         this->poissonR_, initDensity_, powerP_, minDensity_);
-            this->materialTensorDim_ = CellMaterial->GetMaterialTensorDim();
-            SIMPmaterial_.push_back(CellMaterial);
-        }
-        resetMaterialDensity(initDensity_);
-    }
-
-    virtual void ComputeLocalSystemMats(bool ifInitial)
-    {
-        int full_lfs = this->lfs_ * this->spaceDim_;
-        if (!ifInitial)
-        {
-            renewMaterialVector();
-            this->gradgradMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, full_lfs));
-            Construct_CBmats(ifInitial);
-            Intrepid::FunctionSpaceTools::integrate<Real>(*this->gradgradMats_, // compute local grad.grad (stiffness) matrices
-                                                          *this->CBMat_,
-                                                          *this->BMatWeighted_,
-                                                          Intrepid::COMP_CPP);
-            return;
-        }
-        CreateMaterial();
-        this->gradgradMats0_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, full_lfs));
-        this->gradgradMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, full_lfs));
-        this->valvalMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, full_lfs));
-
-        this->BMat_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, this->numCubPoints_, this->materialTensorDim_));
-        this->BMatWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, this->numCubPoints_, this->materialTensorDim_));
-        CBMat0_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, this->numCubPoints_, this->materialTensorDim_));
-        this->CBMat_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, this->numCubPoints_, this->materialTensorDim_));
-        this->NMat_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, this->numCubPoints_, this->spaceDim_));
-        this->NMatWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numCells_, full_lfs, this->numCubPoints_, this->spaceDim_));
-        this->Construct_N_B_mats();
-        Construct_CBmats(ifInitial);
-        Intrepid::FunctionSpaceTools::integrate<Real>(*this->gradgradMats0_, // compute local grad.grad (stiffness) matrices
-                                                      *CBMat0_,
-                                                      *this->BMatWeighted_,
-                                                      Intrepid::COMP_CPP);
-        Intrepid::FunctionSpaceTools::integrate<Real>(*this->gradgradMats_, // compute local grad.grad (stiffness) matrices
-                                                      *this->CBMat_,
-                                                      *this->BMatWeighted_,
-                                                      Intrepid::COMP_CPP);
-        Intrepid::FunctionSpaceTools::integrate<Real>(*this->valvalMats_, // compute local val.val (mass) matrices
-                                                      *this->NMat_,
-                                                      *this->NMatWeighted_,
-                                                      Intrepid::COMP_CPP);
-    }
-
-    // test matrices
-    virtual void test_mats()
-    {
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_Jaco_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_Grad_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_N_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_B_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_K0_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_K_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_M_Mat;
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> test_F_Vec;
-
-        test_Jaco_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->spaceDim_, this->spaceDim_));
-        test_Grad_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->lfs_, this->spaceDim_));
-        test_N_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->spaceDim_));
-        test_B_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->materialTensorDim_));
-        test_K0_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->numLocalDofs_));
-        test_K_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->numLocalDofs_));
-        test_M_Mat = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, this->numLocalDofs_));
-        test_F_Vec = Teuchos::rcp(new Intrepid::FieldContainer<Real>(this->numLocalDofs_, 1));
-
-        for (int i = 0; i < this->spaceDim_; i++)
-        {
-            for (int j = 0; j < this->spaceDim_; j++)
-            {
-                (*test_Jaco_Mat)(i, j) = (*this->cellJac_)(0, 0, i, j);
-            }
-        }
-        for (int i = 0; i < this->numLocalDofs_; i++)
-        {
-            for (int j = 0; j < this->spaceDim_; j++)
-            {
-                if (i < this->lfs_)
-                    (*test_Grad_Mat)(i, j) = (*this->gradReference_)(i, 0, j);
-
-                (*test_N_Mat)(i, j) = (*this->NMat_)(0, i, 0, j);
-            }
-            for (int j = 0; j < this->materialTensorDim_; j++)
-            {
-                (*test_B_Mat)(i, j) = (*this->BMat_)(0, i, 0, j);
-            }
-            for (int j = 0; j < this->numLocalDofs_; j++)
-            {
-                (*test_K0_Mat)(i, j) = (*this->gradgradMats0_)(0, i, j);
-                (*test_K_Mat)(i, j) = (*this->gradgradMats_)(0, i, j);
-                (*test_M_Mat)(i, j) = (*this->valvalMats_)(0, i, j);
-            }
-            (*test_F_Vec)(i, 0) = (*this->datavalVecF_)(0, i);
-        }
-        std::cout << *(SIMPmaterial_[0]->GetMaterialTensor()) << std::endl;
-        std::cout << *test_Jaco_Mat << std::endl;
-        std::cout << *test_Grad_Mat << std::endl;
-        std::cout << *test_N_Mat << std::endl;
-        std::cout << *test_B_Mat << std::endl;
-        std::cout << *test_M_Mat << std::endl;
-        std::cout << *test_F_Vec << std::endl;
-        std::cout << *test_K0_Mat << std::endl;
-        std::cout << *test_K_Mat << std::endl;
-    }
-
-    void Construct_CBmats(const bool ifInitial)
-    {
-        if (ifInitial)
-            CBMat0_->initialize(0.0);
-
-        this->CBMat_->initialize(0.0);
-        Real SIMPScale;
-        for (int i = 0; i < this->numCells_; ++i)
-        {
-
-            SIMPScale = SIMPmaterial_[i]->getSIMPScaleFactor();
-            Teuchos::RCP<Intrepid::FieldContainer<Real>> materialMat = SIMPmaterial_[i]->GetMaterialTensor();
-            for (int j = 0; j < this->numCubPoints_; ++j)
-            {
-                for (int m = 0; m < this->lfs_ * this->spaceDim_; m++)
-                {
-                    for (int n = 0; n < this->materialTensorDim_; n++)
-                    {
-                        for (int k = 0; k < this->materialTensorDim_; k++)
-                        {
-                            if (ifInitial)
-                                (*CBMat0_)(i, m, j, n) += (*this->BMat_)(i, m, j, k) * (*materialMat)(k, n);
-                            (*this->CBMat_)(i, m, j, n) += SIMPScale * (*this->BMat_)(i, m, j, k) * (*materialMat)(k, n);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-}; // class ElasticitySIMPData
-
-#endif
diff --git a/tlnos/src/TOOLS/materials.hpp b/tlnos/src/TOOLS/materials.hpp
deleted file mode 100644
index 2b8aeba77b6a24b9fd245681506a4f3c22d3bf5c..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/materials.hpp
+++ /dev/null
@@ -1,252 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  materials.hpp
-*/
-
-#ifndef MATERIALS_HPP
-#define MATERIALS_HPP
-
-#include "Intrepid_FieldContainer.hpp"
-
-/** \class  Materials
-*/
-
-template <class Real>
-class Material
-{
-private:
-    int dim_;
-    int tensorMatSize_;
-
-    bool planeStrain_;
-    Real modulus_;
-    Real poissonRatio_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> materialTensor_;
-
-public:
-    Material() {}
-    virtual ~Material() {}
-
-    virtual void InitializeMaterial(const int dim, const bool planeStrain,
-                                    const Real modulus, const Real poissonRatio)
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(dim > 3 || dim < 1, std::invalid_argument,
-                                   ">>> ERROR (InitializeMaterial): dim less than one or greater than three!");
-        dim_ = dim;
-        planeStrain_ = planeStrain;
-        modulus_ = modulus;
-        poissonRatio_ = poissonRatio;
-        if (dim_ == 1)
-        {
-            tensorMatSize_ = 1;
-        }
-        else if (dim_ == 2)
-        {
-            tensorMatSize_ = 3;
-        }
-        else
-        {
-            tensorMatSize_ = 6;
-        }
-
-        ComputeMaterialTensor();
-    }
-
-    void ComputeMaterialTensor(void)
-    {
-        materialTensor_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(tensorMatSize_, tensorMatSize_));
-        materialTensor_->initialize(0.0);
-        if (dim_ == 1)
-        {
-            (*materialTensor_)(0, 0) = modulus_;
-        }
-        else if (dim_ == 2 && !planeStrain_)
-        {
-            Real one(1), half(0.5);
-            Real factor1 = modulus_ / (one - poissonRatio_ * poissonRatio_);
-            (*materialTensor_)(0, 0) = factor1;
-            (*materialTensor_)(0, 1) = factor1 * poissonRatio_;
-            (*materialTensor_)(1, 0) = factor1 * poissonRatio_;
-            (*materialTensor_)(1, 1) = factor1;
-            (*materialTensor_)(2, 2) = factor1 * half * (one - poissonRatio_);
-        }
-        else if (dim_ == 2 && planeStrain_)
-        {
-            Real one(1), two(2), half(0.5);
-            Real factor2 = modulus_ / (one + poissonRatio_) / (one - two * poissonRatio_);
-            (*materialTensor_)(0, 0) = factor2 * (one - poissonRatio_);
-            (*materialTensor_)(0, 1) = factor2 * poissonRatio_;
-            (*materialTensor_)(1, 0) = factor2 * poissonRatio_;
-            (*materialTensor_)(1, 1) = factor2 * (one - poissonRatio_);
-            (*materialTensor_)(2, 2) = factor2 * half * (one - two * poissonRatio_);
-        }
-        else
-        {
-            Real one(1), two(2), half(0.5);
-            Real lam = modulus_ * poissonRatio_ / (one + poissonRatio_) / (one - two * poissonRatio_);
-            Real mu = half * modulus_ / (one + poissonRatio_);
-            (*materialTensor_)(0, 0) = lam + two * mu;
-            (*materialTensor_)(0, 1) = lam;
-            (*materialTensor_)(0, 2) = lam;
-            (*materialTensor_)(1, 0) = lam;
-            (*materialTensor_)(1, 1) = lam + two * mu;
-            (*materialTensor_)(1, 2) = lam;
-            (*materialTensor_)(2, 0) = lam;
-            (*materialTensor_)(2, 1) = lam;
-            (*materialTensor_)(2, 2) = lam + two * mu;
-            (*materialTensor_)(3, 3) = mu;
-            (*materialTensor_)(4, 4) = mu;
-            (*materialTensor_)(5, 5) = mu;
-        }
-    }
-
-    const Teuchos::RCP<Intrepid::FieldContainer<Real>> GetMaterialTensor(void) const
-    {
-        return materialTensor_;
-    }
-
-    int GetMaterialTensorDim(void) const
-    {
-        return tensorMatSize_;
-    }
-
-    Real GetYoungsModulus(void) const
-    {
-        return modulus_;
-    }
-
-    Real GetPoissonRatio(void) const
-    {
-        return poissonRatio_;
-    }
-
-    Real GetBulkModulus(void) const {}
-
-    Real GetShearModulus(void) const
-    {
-        Real half(0.5), one(1);
-        return half * modulus_ / (one + poissonRatio_);
-    }
-
-    void CheckMaterialTensor(void)
-    {
-        std::cout << *materialTensor_ << std::endl;
-    }
-};
-
-// new class for topology optimization
-template <class Real>
-class Material_SIMP : public Material<Real>
-{
-private:
-    Real density_;
-    int powerP_;
-    Real minDensity_;
-
-public:
-    virtual void InitializeSIMP(const int dim, const bool planeStrain,
-                                const Real modulus, const Real poissonRatio,
-                                const Real density, const int powerP, const Real minDensity)
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(powerP < 1, std::invalid_argument,
-                                   ">>> ERROR (InitializeSIMP): SIMP power is less than one!");
-        Material<Real>::InitializeMaterial(dim, planeStrain, modulus, poissonRatio);
-        density_ = density;
-        powerP_ = powerP;
-        minDensity_ = minDensity;
-    }
-
-    Real getSIMPScaleFactor(void) const
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(powerP_ < 1, std::invalid_argument,
-                                   ">>> ERROR (getSIMPScaleFactor): SIMP power is less than one!");
-        Real one(1);
-        return minDensity_ + (one - minDensity_) * std::pow(density_, powerP_);
-    }
-
-    Real getSIMPFirstDerivativeScaleFactor(void) const
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(powerP_ < 1, std::invalid_argument,
-                                   ">>> ERROR (getSIMPFirstDerivativeScaleFactor): SIMP power is less than one!");
-        Real one(1);
-        return (one - minDensity_) * powerP_ * (std::pow(density_, powerP_ - 1));
-    }
-
-    Real getSIMPSecondDerivativeScaleFactor(void) const
-    {
-        TEUCHOS_TEST_FOR_EXCEPTION(powerP_ < 1, std::invalid_argument,
-                                   ">>> ERROR (getSIMPSecondDerivativeScaleFactor): SIMP power is less than one!");
-        Real one(1), scale(0);
-        if (powerP_ > 1)
-        {
-            scale = (one - minDensity_) * powerP_ * (powerP_ - 1) * (std::pow(density_, powerP_ - 2));
-        }
-        return scale;
-    }
-
-    void setDensity(const Real dens)
-    {
-        density_ = dens;
-    }
-
-    // the following function is not in use
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> computeScaledMaterialTensor(const Real scale) const
-    {
-        Real zero(0);
-        int TMS = Material<Real>::getMaterialTensorDim();
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> scaledMaterialTensor = Teuchos::rcp(new Intrepid::FieldContainer<Real>(TMS, TMS));
-        scaledMaterialTensor->initialize(zero);
-
-        for (int i = 0; i < TMS; i++)
-        {
-            for (int j = 0; j < TMS; j++)
-            {
-                (*scaledMaterialTensor)(i, j) = scale * (*Material<Real>::gerMaterialTensor())(i, j);
-            }
-        }
-        return scaledMaterialTensor;
-    }
-};
-
-#endif
diff --git a/tlnos/src/TOOLS/meshmanager.hpp b/tlnos/src/TOOLS/meshmanager.hpp
deleted file mode 100644
index 1ce27a78a485cae668142d03f56736945eeafbb4..0000000000000000000000000000000000000000
--- a/tlnos/src/TOOLS/meshmanager.hpp
+++ /dev/null
@@ -1,711 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  meshmanager.hpp
-    \brief Defines the MeshManger classes.
-*/
-
-#ifndef MESHMANAGER_HPP
-#define MESHMANAGER_HPP
-
-#include "Teuchos_ParameterList.hpp"
-#include "Intrepid_FieldContainer.hpp"
-
-/** \class  MeshManager
-    \brief  This is the pure virtual parent class for mesh construction
-            and management; it enables the generation of a few select
-            meshes and the setup of data structures for computing
-            cell/subcell adjacencies, for example, the cell-to-node
-            adjacency map and the cell-to-edge adjacency map.
-*/
-template <class Real>
-class MeshManager
-{
-
-public:
-    /** \brief  Destructor
-   */
-    virtual ~MeshManager() {}
-
-    /** \brief Returns node coordinates.
-             Format: number_of_nodes x 2 (Real)
-                     (node_index)  x, y coordinates
-  */
-    virtual Teuchos::RCP<Intrepid::FieldContainer<Real>> getNodes() const = 0;
-
-    /** \brief Returns cell to node adjacencies.
-             Format: number_of_cells x number_of_nodes_per_cell (int)
-                     (cell_index)  node_index1  node_index2  ...
-  */
-    virtual Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToNodeMap() const = 0;
-
-    /** \brief Returns cell to edge adjacencies.
-             Format: number_of_cells x number_of_edges_per_cell (int)
-                     (cell_index)  edge_index1  edge_index2  ...
-  */
-    virtual Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToEdgeMap() const = 0;
-
-    /** \brief Returns sideset information.
-             Format: The std::vector components are indexed by the local side number (0, 1, 2, ...);
-                     the FieldConTainer is a 1D array of cell indices.
-             Input:  Sideset number.  Its meaning is context-dependent.
-  */
-    virtual Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> getSideSets() const = 0;
-
-    /** \brief Returns number of cells.
-  */
-    virtual int getNumCells() const = 0;
-
-    /** \brief Returns number of nodes.
-  */
-    virtual int getNumNodes() const = 0;
-
-    /** \brief Returns number of edges.
-  */
-    virtual int getNumEdges() const = 0;
-
-}; // MeshManager
-
-/** \class  MeshManager_BackwardFacingStepChannel
-    \brief  Mesh construction and mesh management for the
-            backward-facing step channel geometry, on
-            quadrilateral grids.
-*/
-template <class Real>
-class MeshManager_BackwardFacingStepChannel : public MeshManager<Real>
-{
-
-    /* Backward-facing step geometry.
- 
-  ***************************************************
-  *        *           *                            *
-  *   3    *     4     *             5              *
-  *        *           *                            *
-  ********** * * * * * * * * * * * * * * * * * * * **
-           *     1     *             2              *
-           *           *                            *
-           ******************************************
-
-*/
-
-private:
-    Real channelH_; // channel height (height of regions 1+4)
-    Real channelW_; // channel width (width of regions 3+4+5)
-    Real stepH_;    // step height (height of region 1)
-    Real stepW_;    // step width (width of region 3)
-    Real observeW_; // width of observation region (width of region 1)
-
-    int ref_; // mesh refinement level
-
-    int nx1_;
-    int nx2_;
-    int nx3_;
-    int nx4_;
-    int nx5_;
-    int ny1_;
-    int ny2_;
-    int ny3_;
-    int ny4_;
-    int ny5_;
-
-    int numCells_;
-    int numNodes_;
-    int numEdges_;
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> meshNodes_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToNodeMap_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToEdgeMap_;
-
-public:
-    MeshManager_BackwardFacingStepChannel(Teuchos::ParameterList &parlist)
-    {
-        // Geometry data.
-        channelH_ = parlist.sublist("Geometry").get("Channel height", 1.0);
-        channelW_ = parlist.sublist("Geometry").get("Channel width", 8.0);
-        stepH_ = parlist.sublist("Geometry").get("Step height", 0.5);
-        stepW_ = parlist.sublist("Geometry").get("Step width", 1.0);
-        observeW_ = parlist.sublist("Geometry").get("Observation width", 3.0);
-        // Mesh data.
-        ref_ = parlist.sublist("Geometry").get("Refinement level", 1);
-        nx1_ = parlist.sublist("Geometry").get("Observation region NX", 4 * ref_);
-        ny1_ = parlist.sublist("Geometry").get("Observation region NY", 5 * ref_);
-        nx2_ = parlist.sublist("Geometry").get("Laminar flow region NX", 2 * ref_);
-        ny2_ = ny1_;
-        nx3_ = parlist.sublist("Geometry").get("Inflow region NX", 1 * ref_);
-        ny3_ = parlist.sublist("Geometry").get("Inflow region NY", 2 * ref_);
-        nx4_ = nx1_;
-        ny4_ = ny3_;
-        nx5_ = nx2_;
-        ny5_ = ny3_;
-        numCells_ = (nx1_ + nx2_) * ny1_ + (nx3_ + nx1_ + nx2_) * ny3_;
-        numNodes_ = (nx1_ + nx2_ + 1) * ny1_ + (nx3_ + nx1_ + nx2_ + 1) * (ny3_ + 1);
-        numEdges_ = (2 * (nx1_ + nx2_) + 1) * ny1_ + (2 * (nx3_ + nx1_ + nx2_) + 1) * ny3_ + (nx3_ + nx1_ + nx2_);
-        // Compute mesh data structures.
-        computeNodes();
-        computeCellToNodeMap();
-        computeCellToEdgeMap();
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> getNodes() const
-    {
-        return meshNodes_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToNodeMap() const
-    {
-        return meshCellToNodeMap_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToEdgeMap() const
-    {
-        return meshCellToEdgeMap_;
-    }
-
-    int getNumCells() const
-    {
-        return numCells_;
-    } // getNumCells
-
-    int getNumNodes() const
-    {
-        return numNodes_;
-    } // getNumNodes
-
-    int getNumEdges() const
-    {
-        return numEdges_;
-    } // getNumEdges
-
-private:
-    void computeNodes()
-    {
-
-        meshNodes_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numNodes_, 2));
-        Intrepid::FieldContainer<Real> &nodes = *meshNodes_;
-
-        Real dy1 = stepH_ / ny1_;
-        Real dy3 = (channelH_ - stepH_) / ny3_;
-        Real dx1 = observeW_ / nx1_;
-        Real dx2 = (channelW_ - stepW_ - observeW_) / nx2_;
-        Real dx3 = stepW_ / nx3_;
-        int nodeCt = 0;
-
-        // bottom region
-        for (int j = 0; j < ny1_; ++j)
-        {
-            for (int i = 0; i <= nx1_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + i * dx1;
-                nodes(nodeCt, 1) = j * dy1;
-                ++nodeCt;
-            }
-            for (int i = 0; i < nx2_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + observeW_ + (i + 1) * dx2;
-                nodes(nodeCt, 1) = j * dy1;
-                ++nodeCt;
-            }
-        }
-
-        // top region
-        for (int j = 0; j <= ny3_; ++j)
-        {
-            for (int i = 0; i <= nx3_; ++i)
-            {
-                nodes(nodeCt, 0) = i * dx3;
-                nodes(nodeCt, 1) = stepH_ + j * dy3;
-                ++nodeCt;
-            }
-            for (int i = 0; i < nx1_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + (i + 1) * dx1;
-                nodes(nodeCt, 1) = stepH_ + j * dy3;
-                ++nodeCt;
-            }
-            for (int i = 0; i < nx2_; ++i)
-            {
-                nodes(nodeCt, 0) = stepW_ + observeW_ + (i + 1) * dx2;
-                nodes(nodeCt, 1) = stepH_ + j * dy3;
-                ++nodeCt;
-            }
-        }
-
-    } // computeNodes
-
-    void computeCellToNodeMap()
-    {
-
-        meshCellToNodeMap_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, 4));
-        Intrepid::FieldContainer<int> &ctn = *meshCellToNodeMap_;
-
-        int cellCt = 0;
-
-        // bottom region
-        for (int j = 0; j < ny1_ - 1; ++j)
-        {
-            for (int i = 0; i < nx1_ + nx2_; ++i)
-            {
-                ctn(cellCt, 0) = j * (nx1_ + nx2_ + 1) + i;
-                ctn(cellCt, 1) = j * (nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 2) = (j + 1) * (nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 3) = (j + 1) * (nx1_ + nx2_ + 1) + i;
-                ++cellCt;
-            }
-        }
-
-        // transition region
-        for (int i = 0; i < nx1_ + nx2_; ++i)
-        {
-            ctn(cellCt, 0) = (ny1_ - 1) * (nx1_ + nx2_ + 1) + i;
-            ctn(cellCt, 1) = (ny1_ - 1) * (nx1_ + nx2_ + 1) + (i + 1);
-            ctn(cellCt, 2) = ny1_ * (nx1_ + nx2_ + 1) + nx3_ + (i + 1);
-            ctn(cellCt, 3) = ny1_ * (nx1_ + nx2_ + 1) + nx3_ + i;
-            ++cellCt;
-        }
-
-        // top region
-        for (int j = 0; j < ny3_; ++j)
-        {
-            for (int i = 0; i < nx3_ + nx1_ + nx2_; ++i)
-            {
-                ctn(cellCt, 0) = ny1_ * (nx1_ + nx2_ + 1) + j * (nx3_ + nx1_ + nx2_ + 1) + i;
-                ctn(cellCt, 1) = ny1_ * (nx1_ + nx2_ + 1) + j * (nx3_ + nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 2) = ny1_ * (nx1_ + nx2_ + 1) + (j + 1) * (nx3_ + nx1_ + nx2_ + 1) + (i + 1);
-                ctn(cellCt, 3) = ny1_ * (nx1_ + nx2_ + 1) + (j + 1) * (nx3_ + nx1_ + nx2_ + 1) + i;
-                ++cellCt;
-            }
-        }
-
-    } // computeCellToNodeMap
-
-    void computeCellToEdgeMap()
-    {
-
-        meshCellToEdgeMap_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, 4));
-        Intrepid::FieldContainer<int> &cte = *meshCellToEdgeMap_;
-
-        int cellCt = 0;
-
-        // bottom region
-        for (int j = 0; j < ny1_ - 1; ++j)
-        {
-            for (int i = 0; i < nx1_ + nx2_; ++i)
-            {
-                cte(cellCt, 0) = j * (2 * (nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 1) = j * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + (i + 1);
-                cte(cellCt, 2) = (j + 1) * (2 * (nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 3) = j * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + i;
-                ++cellCt;
-            }
-        }
-
-        // transition region
-        for (int i = 0; i < nx1_ + nx2_; ++i)
-        {
-            cte(cellCt, 0) = (ny1_ - 1) * (2 * (nx1_ + nx2_) + 1) + i;
-            cte(cellCt, 1) = (ny1_ - 1) * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + (i + 1);
-            cte(cellCt, 2) = ny1_ * (2 * (nx1_ + nx2_) + 1) + nx3_ + i;
-            cte(cellCt, 3) = (ny1_ - 1) * (2 * (nx1_ + nx2_) + 1) + (nx1_ + nx2_) + i;
-            ++cellCt;
-        }
-
-        // top region
-        for (int j = 0; j < ny3_; ++j)
-        {
-            for (int i = 0; i < nx3_ + nx1_ + nx2_; ++i)
-            {
-                cte(cellCt, 0) = ny1_ * (2 * (nx1_ + nx2_) + 1) + j * (2 * (nx3_ + nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 1) = ny1_ * (2 * (nx1_ + nx2_) + 1) + j * (2 * (nx3_ + nx1_ + nx2_) + 1) + (nx3_ + nx1_ + nx2_) + (i + 1);
-                cte(cellCt, 2) = ny1_ * (2 * (nx1_ + nx2_) + 1) + (j + 1) * (2 * (nx3_ + nx1_ + nx2_) + 1) + i;
-                cte(cellCt, 3) = ny1_ * (2 * (nx1_ + nx2_) + 1) + j * (2 * (nx3_ + nx1_ + nx2_) + 1) + (nx3_ + nx1_ + nx2_) + i;
-                ++cellCt;
-            }
-        }
-
-    } // computeCellToEdgeMap
-
-    void setRefinementLevel(const int &refLevel)
-    {
-        ref_ = refLevel;
-        computeNodes();
-        computeCellToNodeMap();
-        computeCellToEdgeMap();
-    } // setRefinementLevel
-
-}; // MeshManager_BackwardFacingStepChannel
-
-/** \class  MeshManager_Rectangle
-    \brief  Mesh construction and mesh management for the
-            backward-facing step channel geometry, on
-            quadrilateral grids.
-*/
-template <class Real>
-class MeshManager_Rectangle : public MeshManager<Real>
-{
-
-    /* Rectangle geometry.
- 
-      ***********************
-      *                     *   :
-      *                     *   |
-      *                     * height
-      *                     *   |
-      *                     *   :
-      *                     *
-      ***********************
-  (X0,Y0)   :--width--:
-
-*/
-
-private:
-    Real width_;  // rectangle height
-    Real height_; // rectangle width
-    Real X0_;     // x coordinate of bottom left corner
-    Real Y0_;     // y coordinate of bottom left corner
-
-    int nx_;
-    int ny_;
-
-    int numCells_;
-    int numNodes_;
-    int numEdges_;
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> meshNodes_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToNodeMap_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToEdgeMap_;
-
-    Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> meshSideSets_;
-
-public:
-    MeshManager_Rectangle(Teuchos::ParameterList &parlist)
-    {
-        // Geometry data.
-        width_ = parlist.sublist("Geometry").get("Width", 3.0);
-        height_ = parlist.sublist("Geometry").get("Height", 1.0);
-        X0_ = parlist.sublist("Geometry").get("X0", 0.0);
-        Y0_ = parlist.sublist("Geometry").get("Y0", 0.0);
-        // Mesh data.
-        nx_ = parlist.sublist("Geometry").get("NX", 3);
-        ny_ = parlist.sublist("Geometry").get("NY", 1);
-        numCells_ = nx_ * ny_;
-        numNodes_ = (nx_ + 1) * (ny_ + 1);
-        numEdges_ = (nx_ + 1) * ny_ + (ny_ + 1) * nx_;
-        // Compute and store mesh data structures.
-        computeNodes();
-        computeCellToNodeMap();
-        computeCellToEdgeMap();
-        computeSideSets();
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> getNodes() const
-    {
-        return meshNodes_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToNodeMap() const
-    {
-        return meshCellToNodeMap_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToEdgeMap() const
-    {
-        return meshCellToEdgeMap_;
-    }
-
-    Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> getSideSets() const
-    {
-        return meshSideSets_;
-    }
-
-    int getNumCells() const
-    {
-        return numCells_;
-    } // getNumCells
-
-    int getNumNodes() const
-    {
-        return numNodes_;
-    } // getNumNodes
-
-    int getNumEdges() const
-    {
-        return numEdges_;
-    } // getNumEdges
-
-private:
-    void computeNodes()
-    {
-
-        meshNodes_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numNodes_, 2));
-        Intrepid::FieldContainer<Real> &nodes = *meshNodes_;
-
-        Real dx = width_ / nx_;
-        Real dy = height_ / ny_;
-        int nodeCt = 0;
-
-        for (int j = 0; j <= ny_; ++j)
-        {
-            Real ycoord = Y0_ + j * dy;
-            for (int i = 0; i <= nx_; ++i)
-            {
-                nodes(nodeCt, 0) = X0_ + i * dx;
-                nodes(nodeCt, 1) = ycoord;
-                ++nodeCt;
-            }
-        }
-
-    } // computeNodes
-
-    void computeCellToNodeMap()
-    {
-
-        meshCellToNodeMap_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, 4));
-        Intrepid::FieldContainer<int> &ctn = *meshCellToNodeMap_;
-
-        int cellCt = 0;
-
-        for (int j = 0; j < ny_; ++j)
-        {
-            for (int i = 0; i < nx_; ++i)
-            {
-                ctn(cellCt, 0) = j * (nx_ + 1) + i;
-                ctn(cellCt, 1) = j * (nx_ + 1) + (i + 1);
-                ctn(cellCt, 2) = (j + 1) * (nx_ + 1) + (i + 1);
-                ctn(cellCt, 3) = (j + 1) * (nx_ + 1) + i;
-                ++cellCt;
-            }
-        }
-
-    } // computeCellToNodeMap
-
-    void computeCellToEdgeMap()
-    {
-
-        meshCellToEdgeMap_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, 4));
-        Intrepid::FieldContainer<int> &cte = *meshCellToEdgeMap_;
-
-        int cellCt = 0;
-
-        for (int j = 0; j < ny_; ++j)
-        {
-            for (int i = 0; i < nx_; ++i)
-            {
-                cte(cellCt, 0) = j * (2 * nx_ + 1) + i;
-                cte(cellCt, 1) = j * (2 * nx_ + 1) + nx_ + (i + 1);
-                cte(cellCt, 2) = (j + 1) * (2 * nx_ + 1) + i;
-                cte(cellCt, 3) = j * (2 * nx_ + 1) + nx_ + i;
-                ++cellCt;
-            }
-        }
-
-    } // computeCellToEdgeMap
-
-    void computeSideSets()
-    {
-
-        meshSideSets_ = Teuchos::rcp(new std::vector<std::vector<Intrepid::FieldContainer<int>>>(1));
-        int numSides = 4;
-        (*meshSideSets_)[0].resize(numSides);
-        (*meshSideSets_)[0][0].resize(nx_);
-        (*meshSideSets_)[0][1].resize(ny_);
-        (*meshSideSets_)[0][2].resize(nx_);
-        (*meshSideSets_)[0][3].resize(ny_);
-
-        for (int i = 0; i < nx_; ++i)
-        {
-            (*meshSideSets_)[0][0](i) = i;
-        }
-        for (int i = 0; i < ny_; ++i)
-        {
-            (*meshSideSets_)[0][1](i) = (i + 1) * nx_ - 1;
-        }
-        for (int i = 0; i < nx_; ++i)
-        {
-            (*meshSideSets_)[0][2](i) = i + nx_ * (ny_ - 1);
-        }
-        for (int i = 0; i < ny_; ++i)
-        {
-            (*meshSideSets_)[0][3](i) = i * nx_;
-        }
-
-    } // computeSideSets
-
-}; // MeshManager_Rectangle
-
-template <class Real>
-class MeshManager_Interval : public MeshManager<Real>
-{
-
-    /* Interval geometry [X0,X0+width] */
-
-private:
-    Real width_; // Interval width
-    Real X0_;    // x coordinate left corner
-
-    int nx_;
-
-    int numCells_;
-    int numNodes_;
-    int numEdges_;
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> meshNodes_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToNodeMap_;
-    Teuchos::RCP<Intrepid::FieldContainer<int>> meshCellToEdgeMap_;
-
-    Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> meshSideSets_;
-
-public:
-    MeshManager_Interval(Teuchos::ParameterList &parlist)
-    {
-
-        // Geometry data
-        width_ = parlist.sublist("Geometry").get("Width", 1.0);
-        X0_ = parlist.sublist("Geometry").get("X0", 0.0);
-
-        // Mesh data
-        nx_ = parlist.sublist("Geometry").get("NX", 10);
-
-        numCells_ = nx_;
-        numNodes_ = nx_ + 1;
-        numEdges_ = 2;
-
-        // Compute and store mesh data structures
-        computeNodes();
-        computeCellToNodeMap();
-        computeCellToEdgeMap();
-        computeSideSets();
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> getNodes() const
-    {
-        return meshNodes_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToNodeMap() const
-    {
-        return meshCellToNodeMap_;
-    }
-
-    Teuchos::RCP<Intrepid::FieldContainer<int>> getCellToEdgeMap() const
-    {
-        return meshCellToEdgeMap_;
-    }
-
-    Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> getSideSets() const
-    {
-        return meshSideSets_;
-    }
-
-    int getNumCells() const
-    {
-        return numCells_;
-    }
-
-    int getNumNodes() const
-    {
-        return numNodes_;
-    } // getNumNodes
-
-    int getNumEdges() const
-    {
-        return numEdges_;
-    } // getNumEdges
-
-private:
-    void computeNodes()
-    {
-
-        meshNodes_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numNodes_, 1));
-        Intrepid::FieldContainer<Real> &nodes = *meshNodes_;
-
-        Real dx = width_ / nx_;
-
-        for (int i = 0; i < nx_; ++i)
-        {
-            nodes(i, 0) = X0_ + i * dx;
-        }
-    } // computeNodes
-
-    void computeCellToNodeMap()
-    {
-
-        meshCellToNodeMap_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, 2));
-        Intrepid::FieldContainer<int> &ctn = *meshCellToNodeMap_;
-
-        for (int i = 0; i < nx_; ++i)
-        {
-            ctn(i, 0) = i;
-            ctn(i, 1) = i + 1;
-        }
-    } // computeCellToNodeMap
-
-    void computeCellToEdgeMap()
-    {
-
-        meshCellToEdgeMap_ = Teuchos::rcp(new Intrepid::FieldContainer<int>(numCells_, 1));
-        Intrepid::FieldContainer<int> &cte = *meshCellToEdgeMap_;
-
-        for (int i = 0; i < nx_; ++i)
-        {
-            cte(i, 0) = i;
-        }
-    }
-
-    void computeSideSets()
-    {
-
-        using Intrepid::FieldContainer;
-        using std::vector;
-
-        meshSideSets_ = Teuchos::rcp(new vector<vector<FieldContainer<int>>>(1));
-        int numSides = 2;
-
-        (*meshSideSets_)[0].resize(numSides);
-        (*meshSideSets_)[0][0](0) = 0;
-        (*meshSideSets_)[0][1](0) = numCells_ + 1;
-
-    } // computeSideSets
-
-}; // MeshManager_Interval
-
-#endif
diff --git a/tlnos/src/constraint.hpp b/tlnos/src/constraint.hpp
deleted file mode 100644
index 538c89fb57623fa67fe831b9015f21d2373f6cdf..0000000000000000000000000000000000000000
--- a/tlnos/src/constraint.hpp
+++ /dev/null
@@ -1,218 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  constraint.hpp
-    \brief Defines the SimOpt constraint for the 'poisson' example.
-*/
-
-#ifndef ROL_PDEOPT_POISSON_CONSTRAINT_H
-#define ROL_PDEOPT_POISSON_CONSTRAINT_H
-
-#include "ROL_EqualityConstraint_SimOpt.hpp"
-#include "ROL_TpetraMultiVector.hpp"
-#include "Amesos2.hpp"
-#include "data.hpp"
-
-template <class Real>
-class EqualityConstraint_PDEOPT_Poisson : public ROL::EqualityConstraint_SimOpt<Real>
-{
-private:
-    Teuchos::RCP<PoissonData<Real>> data_;
-
-public:
-    EqualityConstraint_PDEOPT_Poisson(const Teuchos::RCP<PoissonData<Real>> &data,
-                                      const Teuchos::RCP<Teuchos::ParameterList> &parlist)
-    {
-        data_ = data;
-    }
-
-    using ROL::EqualityConstraint_SimOpt<Real>::value;
-    void value(ROL::Vector<Real> &c, const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> cp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(c)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> up =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(u)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> zp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(z)).getVector();
-
-        Real one(1);
-
-        // A*u
-        data_->getMatA()->apply(*up, *cp);
-
-        // B*z + A*u
-        data_->getMatB()->apply(*zp, *cp, Teuchos::NO_TRANS, one, one);
-
-        // A*u + B*z - f
-        cp->update(-one, *(data_->getVecF()), one);
-    }
-
-    void applyJacobian_1(ROL::Vector<Real> &jv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
-                         const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> jvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(jv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        // A*v
-        data_->getMatA()->apply(*vp, *jvp);
-    }
-
-    void applyJacobian_2(ROL::Vector<Real> &jv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
-                         const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> jvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(jv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        // B*v
-        data_->getMatB()->apply(*vp, *jvp);
-    }
-
-    void applyAdjointJacobian_1(ROL::Vector<Real> &ajv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
-                                const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> ajvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(ajv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        // A'*v
-        bool transpose = true;
-        data_->getMatA(transpose)->apply(*vp, *ajvp);
-    }
-
-    void applyAdjointJacobian_2(ROL::Vector<Real> &ajv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
-                                const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> ajvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(ajv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        // B'*v
-        bool transpose = true;
-        data_->getMatB(transpose)->apply(*vp, *ajvp);
-    }
-
-    void applyAdjointHessian_11(ROL::Vector<Real> &ahwv, const ROL::Vector<Real> &w, const ROL::Vector<Real> &v,
-                                const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        ahwv.zero();
-    }
-
-    void applyAdjointHessian_12(ROL::Vector<Real> &ahwv, const ROL::Vector<Real> &w, const ROL::Vector<Real> &v,
-                                const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        ahwv.zero();
-    }
-
-    void applyAdjointHessian_21(ROL::Vector<Real> &ahwv, const ROL::Vector<Real> &w, const ROL::Vector<Real> &v,
-                                const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        ahwv.zero();
-    }
-
-    void applyAdjointHessian_22(ROL::Vector<Real> &ahwv, const ROL::Vector<Real> &w, const ROL::Vector<Real> &v,
-                                const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        ahwv.zero();
-    }
-
-    void applyInverseJacobian_1(ROL::Vector<Real> &ijv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
-                                const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> ijvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(ijv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        data_->getSolver()->setX(ijvp);
-        data_->getSolver()->setB(vp);
-        data_->getSolver()->solve();
-
-        /*    
-    // Construct solver using Amesos2 factory.
-    Teuchos::RCP<Amesos2::Solver< Tpetra::CrsMatrix<>, Tpetra::MultiVector<> > > solver;
-    try{
-      solver = Amesos2::create< Tpetra::CrsMatrix<>,Tpetra::MultiVector<> >("KLU2", data_->getMatA(), ijvp, vp);
-    } catch (std::invalid_argument e) {
-      std::cout << e.what() << std::endl;
-    }
-    solver->numericFactorization();
-    solver->solve();
-    */
-    }
-
-    void applyInverseAdjointJacobian_1(ROL::Vector<Real> &iajv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
-                                       const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> iajvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(iajv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        bool transpose = true;
-        data_->getSolver(transpose)->setX(iajvp);
-        data_->getSolver(transpose)->setB(vp);
-        data_->getSolver(transpose)->solve();
-
-        /*
-    bool transpose = true;
-    // Construct solver using Amesos2 factory.
-    Teuchos::RCP<Amesos2::Solver< Tpetra::CrsMatrix<>, Tpetra::MultiVector<> > > solver;
-    try{
-      solver = Amesos2::create< Tpetra::CrsMatrix<>,Tpetra::MultiVector<> >("KLU2", data_->getMatA(transpose), iajvp, vp);
-    } catch (std::invalid_argument e) {
-      std::cout << e.what() << std::endl;
-    }
-    solver->numericFactorization();
-    solver->solve();
-    */
-    }
-};
-
-#endif
diff --git a/tlnos/src/data.hpp b/tlnos/src/data.hpp
deleted file mode 100644
index b1c080a0a90d570407ad88a1a4ff4a1cdfe52a85..0000000000000000000000000000000000000000
--- a/tlnos/src/data.hpp
+++ /dev/null
@@ -1,843 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  data.hpp
-    \brief Generates and manages data for the Poisson example, including
-           all mesh and discretization data, matrices, etc.
-*/
-
-#ifndef ROL_PDEOPT_POISSON_DATA_H
-#define ROL_PDEOPT_POISSON_DATA_H
-
-#include "Teuchos_GlobalMPISession.hpp"
-#include "Teuchos_TimeMonitor.hpp"
-
-#include "Tpetra_DefaultPlatform.hpp"
-#include "Tpetra_MultiVector.hpp"
-#include "Tpetra_Vector.hpp"
-#include "Tpetra_CrsGraph.hpp"
-#include "Tpetra_CrsMatrix.hpp"
-#include "Tpetra_Version.hpp"
-#include "Tpetra_RowMatrixTransposer.hpp"
-#include "MatrixMarket_Tpetra.hpp"
-
-#include "Intrepid_HGRAD_QUAD_C2_FEM.hpp"
-#include "Intrepid_HGRAD_QUAD_C1_FEM.hpp"
-#include "Intrepid_DefaultCubatureFactory.hpp"
-#include "Intrepid_FunctionSpaceTools.hpp"
-#include "Intrepid_CellTools.hpp"
-
-#include "Amesos2.hpp"
-
-#include "TOOLS/dofmanager.hpp"
-
-template <class Real>
-class PoissonData
-{
-
-private:
-    Teuchos::RCP<MeshManager<Real>> meshMgr_;
-    Teuchos::RCP<DofManager<Real>> dofMgr_;
-    std::vector<Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>>> basisPtrs_;
-
-    Teuchos::RCP<const Teuchos::Comm<int>> commPtr_;
-    int myRank_;
-    int numProcs_;
-
-    Real alpha_;
-    int basisOrder_;
-
-    Teuchos::RCP<const Tpetra::Map<>> myOverlapMap_;
-    Teuchos::RCP<const Tpetra::Map<>> myUniqueMap_;
-    Teuchos::RCP<Tpetra::CrsGraph<>> matGraph_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matA_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matA_dirichlet_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matA_dirichlet_trans_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matM_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matM_dirichlet_;
-    Teuchos::RCP<Tpetra::CrsMatrix<>> matM_dirichlet_trans_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecUd_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecF_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecF_overlap_;
-    Teuchos::RCP<Tpetra::MultiVector<>> vecF_dirichlet_;
-
-    Teuchos::Array<int> myCellIds_;
-
-    Teuchos::RCP<Amesos2::Solver<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>> solverA_;
-    Teuchos::RCP<Amesos2::Solver<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>> solverA_trans_;
-
-    shards::CellTopology cellType_;
-    int spaceDim_;
-    int numNodesPerCell_;
-    int numCubPoints_;
-
-    int totalNumCells_;
-    int totalNumDofs_;
-    int numCells_;
-
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cubPoints_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cubWeights_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellNodes_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellJac_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellJacInv_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellJacDet_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cellWeightedMeasure_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valReference_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradReference_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valPhysicalWeighted_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradPhysicalWeighted_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> gradgradMats_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> valvalMats_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> cubPointsPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dataF_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> datavalVecF_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dofPoints_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dofPointsPhysical_;
-    Teuchos::RCP<Intrepid::FieldContainer<Real>> dataUd_;
-
-public:
-    PoissonData(const Teuchos::RCP<const Teuchos::Comm<int>> &comm,
-                const Teuchos::RCP<Teuchos::ParameterList> &parlist,
-                const Teuchos::RCP<std::ostream> &outStream)
-    {
-
-        /************************************/
-        /*** Retrieve communication data. ***/
-        /************************************/
-        commPtr_ = comm;
-        myRank_ = commPtr_->getRank();
-        numProcs_ = commPtr_->getSize();
-        *outStream << "Total number of processors: " << numProcs_ << std::endl;
-        /************************************/
-        /************************************/
-
-        /*************************************/
-        /*** Retrieve parameter list data. ***/
-        /*************************************/
-        alpha_ = parlist->sublist("Problem").get("Penalty", 1e-2);
-        basisOrder_ = parlist->sublist("Problem").get("Order of FE discretization", 1);
-        int cellSplit = parlist->sublist("Geometry").get("Partition type", 1);
-        /*************************************/
-        /*************************************/
-
-        /****************************************************************************/
-        /*** Initialize mesh / finite element fields / degree-of-freedom manager. ***/
-        /****************************************************************************/
-
-        // Mesh manager.
-        meshMgr_ = Teuchos::rcp(new MeshManager_Rectangle<Real>(*parlist));
-        printMeshData(*outStream);
-        // Finite element fields.
-        Teuchos::RCP<Intrepid::Basis<Real, Intrepid::FieldContainer<Real>>> basisPtr;
-        if (basisOrder_ == 1)
-        {
-            basisPtr = Teuchos::rcp(new Intrepid::Basis_HGRAD_QUAD_C1_FEM<Real, Intrepid::FieldContainer<Real>>);
-        }
-        else if (basisOrder_ == 2)
-        {
-            basisPtr = Teuchos::rcp(new Intrepid::Basis_HGRAD_QUAD_C2_FEM<Real, Intrepid::FieldContainer<Real>>);
-        }
-        basisPtrs_.resize(1, Teuchos::null);
-        basisPtrs_[0] = basisPtr;
-        // DOF coordinate interface.
-        Teuchos::RCP<Intrepid::DofCoordsInterface<Intrepid::FieldContainer<Real>>> coord_iface =
-            Teuchos::rcp_dynamic_cast<Intrepid::DofCoordsInterface<Intrepid::FieldContainer<Real>>>(basisPtrs_[0]);
-        // Degree-of-freedom manager.
-        dofMgr_ = Teuchos::rcp(new DofManager<Real>(meshMgr_, basisPtrs_));
-        // Retrieve total number of cells in the mesh.
-        totalNumCells_ = meshMgr_->getNumCells();
-        // Retrieve total number of degrees of freedom in the mesh.
-        totalNumDofs_ = dofMgr_->getNumDofs();
-
-        /****************************************************************************/
-        /****************************************************************************/
-
-        /****************************************************/
-        /*** Build parallel communication infrastructure. ***/
-        /****************************************************/
-
-        // Partition the cells in the mesh.  We use a basic quasi-equinumerous partitioning,
-        // where the remainder, if any, is assigned to the last processor.
-        Teuchos::Array<int> myGlobIds_;
-        Teuchos::Array<int> cellOffsets_(numProcs_, 0);
-        int cellsPerProc = totalNumCells_ / numProcs_;
-        numCells_ = cellsPerProc;
-        switch (cellSplit)
-        {
-        case 0:
-            if (myRank_ == 0)
-            { // remainder in the first
-                numCells_ += totalNumCells_ % numProcs_;
-            }
-            for (int i = 1; i < numProcs_; ++i)
-            {
-                cellOffsets_[i] = cellOffsets_[i - 1] + cellsPerProc + (static_cast<int>(i == 1)) * (totalNumCells_ % numProcs_);
-            }
-            break;
-        case 1:
-            if (myRank_ == numProcs_ - 1)
-            { // remainder in the last
-                numCells_ += totalNumCells_ % numProcs_;
-            }
-            for (int i = 1; i < numProcs_; ++i)
-            {
-                cellOffsets_[i] = cellOffsets_[i - 1] + cellsPerProc;
-            }
-            break;
-        case 2:
-            if (myRank_ < (totalNumCells_ % numProcs_))
-            { // spread remainder, starting from the first
-                numCells_++;
-            }
-            for (int i = 1; i < numProcs_; ++i)
-            {
-                cellOffsets_[i] = cellOffsets_[i - 1] + cellsPerProc + (static_cast<int>(i - 1 < (totalNumCells_ % numProcs_)));
-            }
-            break;
-        }
-        Intrepid::FieldContainer<int> &cellDofs = *(dofMgr_->getCellDofs());
-        int numLocalDofs = cellDofs.dimension(1);
-        *outStream << "Cell offsets across processors: " << cellOffsets_ << std::endl;
-        for (int i = 0; i < numCells_; ++i)
-        {
-            myCellIds_.push_back(cellOffsets_[myRank_] + i);
-            for (int j = 0; j < numLocalDofs; ++j)
-            {
-                myGlobIds_.push_back(cellDofs(cellOffsets_[myRank_] + i, j));
-            }
-        }
-        std::sort(myGlobIds_.begin(), myGlobIds_.end());
-        myGlobIds_.erase(std::unique(myGlobIds_.begin(), myGlobIds_.end()), myGlobIds_.end());
-
-        // Build maps.
-        myOverlapMap_ = Teuchos::rcp(new Tpetra::Map<>(Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(),
-                                                       myGlobIds_, 0, comm));
-        //std::cout << std::endl << myOverlapMap_->getNodeElementList();
-        /** One can also use the non-member function:
-          myOverlapMap_ = Tpetra::createNonContigMap<int,int>(myGlobIds_, comm);
-        to build the overlap map.
-    **/
-        myUniqueMap_ = Tpetra::createOneToOne<int, int>(myOverlapMap_);
-        //std::cout << std::endl << myUniqueMap_->getNodeElementList() << std::endl;
-
-        /****************************************************/
-        /****************************************************/
-
-        /****************************************************/
-        /*** Set up local discretization data and arrays. ***/
-        /****************************************************/
-
-        // Retrieve some basic cell information.
-        cellType_ = (basisPtrs_[0])->getBaseCellTopology(); // get the cell type from any basis
-        spaceDim_ = cellType_.getDimension();               // retrieve spatial dimension
-        numNodesPerCell_ = cellType_.getNodeCount();        // retrieve number of nodes per cell
-
-        // Cubature data.
-        Intrepid::DefaultCubatureFactory<Real> cubFactory;                                        // create cubature factory
-        int cubDegree = 4;                                                                        // set cubature degree, e.g., 2
-        Teuchos::RCP<Intrepid::Cubature<Real>> cellCub = cubFactory.create(cellType_, cubDegree); // create default cubature
-        numCubPoints_ = cellCub->getNumPoints();                                                  // retrieve number of cubature points
-
-        int lfs = dofMgr_->getLocalFieldSize(0);
-
-        // Discretization data.
-        cubPoints_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPoints_, spaceDim_));
-        cubWeights_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCubPoints_));
-        cubPointsPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_, spaceDim_));
-        dofPoints_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs, spaceDim_));
-        dofPointsPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, spaceDim_));
-        cellNodes_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numNodesPerCell_, spaceDim_));
-        cellJac_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_, spaceDim_, spaceDim_));
-        cellJacInv_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_, spaceDim_, spaceDim_));
-        cellJacDet_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_));
-        cellWeightedMeasure_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_));
-        valReference_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs, numCubPoints_));
-        gradReference_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(lfs, numCubPoints_, spaceDim_));
-        valPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, numCubPoints_));
-        gradPhysical_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, numCubPoints_, spaceDim_));
-        valPhysicalWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, numCubPoints_));
-        gradPhysicalWeighted_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, numCubPoints_, spaceDim_));
-        gradgradMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, lfs));
-        valvalMats_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs, lfs));
-        dataF_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, numCubPoints_));
-        datavalVecF_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs));
-        dataUd_ = Teuchos::rcp(new Intrepid::FieldContainer<Real>(numCells_, lfs));
-
-        // Geometric definition of the cells in the mesh, based on the cell-to-node map and the domain partition.
-        Intrepid::FieldContainer<Real> &nodes = *meshMgr_->getNodes();
-        Intrepid::FieldContainer<int> &ctn = *meshMgr_->getCellToNodeMap();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numNodesPerCell_; ++j)
-            {
-                for (int k = 0; k < spaceDim_; ++k)
-                {
-                    (*cellNodes_)(i, j, k) = nodes(ctn(myCellIds_[i], j), k);
-                }
-            }
-        }
-
-        /****************************************************/
-        /****************************************************/
-
-        /****************************************************************/
-        /*** Assemble cellwise contributions to vectors and matrices. ***/
-        /****************************************************************/
-
-        cellCub->getCubature(*cubPoints_, *cubWeights_);                                   // retrieve cubature points and weights
-        (*basisPtrs_[0]).getValues(*gradReference_, *cubPoints_, Intrepid::OPERATOR_GRAD); // evaluate grad operator at cubature points
-        (*basisPtrs_[0]).getValues(*valReference_, *cubPoints_, Intrepid::OPERATOR_VALUE); // evaluate value operator at cubature points
-
-        Intrepid::CellTools<Real>::setJacobian(*cellJac_, *cubPoints_, *cellNodes_, cellType_); // compute cell Jacobians
-        Intrepid::CellTools<Real>::setJacobianInv(*cellJacInv_, *cellJac_);                     // compute inverses of cell Jacobians
-        Intrepid::CellTools<Real>::setJacobianDet(*cellJacDet_, *cellJac_);                     // compute determinants of cell Jacobians
-
-        Intrepid::FunctionSpaceTools::computeCellMeasure<Real>(*cellWeightedMeasure_, // compute weighted cell measure
-                                                               *cellJacDet_,
-                                                               *cubWeights_);
-
-        Intrepid::FunctionSpaceTools::HGRADtransformGRAD<Real>(*gradPhysical_, // transform reference gradients into physical space
-                                                               *cellJacInv_,
-                                                               *gradReference_);
-        Intrepid::FunctionSpaceTools::multiplyMeasure<Real>(*gradPhysicalWeighted_, // multiply with weighted measure
-                                                            *cellWeightedMeasure_,
-                                                            *gradPhysical_);
-        Intrepid::FunctionSpaceTools::integrate<Real>(*gradgradMats_, // compute local grad.grad (stiffness) matrices
-                                                      *gradPhysical_,
-                                                      *gradPhysicalWeighted_,
-                                                      Intrepid::COMP_CPP);
-
-        Intrepid::FunctionSpaceTools::HGRADtransformVALUE<Real>(*valPhysical_, // transform reference values into physical space
-                                                                *valReference_);
-        Intrepid::FunctionSpaceTools::multiplyMeasure<Real>(*valPhysicalWeighted_, // multiply with weighted measure
-                                                            *cellWeightedMeasure_,
-                                                            *valPhysical_);
-        Intrepid::FunctionSpaceTools::integrate<Real>(*valvalMats_, // compute local val.val (mass) matrices
-                                                      *valPhysical_,
-                                                      *valPhysicalWeighted_,
-                                                      Intrepid::COMP_CPP);
-
-        Intrepid::CellTools<Real>::mapToPhysicalFrame(*cubPointsPhysical_, // map reference cubature points to physical space
-                                                      *cubPoints_,
-                                                      *cellNodes_,
-                                                      cellType_);
-        for (int i = 0; i < numCells_; ++i)
-        { // evaluate functions at these points
-            for (int j = 0; j < numCubPoints_; ++j)
-            {
-                (*dataF_)(i, j) = funcRHS((*cubPointsPhysical_)(i, j, 0), (*cubPointsPhysical_)(i, j, 1));
-            }
-        }
-        Intrepid::FunctionSpaceTools::integrate<Real>(*datavalVecF_, // compute local data.val vectors for RHS F
-                                                      *dataF_,
-                                                      *valPhysicalWeighted_,
-                                                      Intrepid::COMP_CPP);
-
-        coord_iface->getDofCoords(*dofPoints_);                            // get coordinates of DOFs in reference cell
-        Intrepid::CellTools<Real>::mapToPhysicalFrame(*dofPointsPhysical_, // map reference DOF locations to physical space
-                                                      *dofPoints_,
-                                                      *cellNodes_,
-                                                      cellType_);
-        for (int i = 0; i < numCells_; ++i)
-        { // evaluate functions at these points
-            for (int j = 0; j < lfs; ++j)
-            {
-                (*dataUd_)(i, j) = funcTarget((*dofPointsPhysical_)(i, j, 0), (*dofPointsPhysical_)(i, j, 1));
-            }
-        }
-
-        /****************************************************************/
-        /****************************************************************/
-
-        /****************************************/
-        /*** Assemble global data structures. ***/
-        /****************************************/
-
-        // Assemble graph.
-        matGraph_ = Teuchos::rcp(new Tpetra::CrsGraph<>(myUniqueMap_, 0));
-        Teuchos::ArrayRCP<const int> cellDofsArrayRCP = cellDofs.getData();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs; ++j)
-            {
-                matGraph_->insertGlobalIndices(cellDofs(myCellIds_[i], j), cellDofsArrayRCP(myCellIds_[i] * numLocalDofs, numLocalDofs));
-            }
-        }
-        matGraph_->fillComplete();
-
-        // Assemble matrices.
-        // Stiffness matrix A.
-        matA_ = Tpetra::rcp(new Tpetra::CrsMatrix<>(matGraph_));
-        int numLocalMatEntries = numLocalDofs * numLocalDofs;
-        Teuchos::ArrayRCP<const Real> gradgradArrayRCP = gradgradMats_->getData();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs; ++j)
-            {
-                matA_->sumIntoGlobalValues(cellDofs(myCellIds_[i], j),
-                                           cellDofsArrayRCP(myCellIds_[i] * numLocalDofs, numLocalDofs),
-                                           gradgradArrayRCP(i * numLocalMatEntries + j * numLocalDofs, numLocalDofs));
-            }
-        }
-        matA_->fillComplete();
-
-        // Mass matrix M.
-        matM_ = Tpetra::rcp(new Tpetra::CrsMatrix<>(matGraph_));
-        Teuchos::ArrayRCP<const Real> valvalArrayRCP = valvalMats_->getData();
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs; ++j)
-            {
-                matM_->sumIntoGlobalValues(cellDofs(myCellIds_[i], j),
-                                           cellDofsArrayRCP(myCellIds_[i] * numLocalDofs, numLocalDofs),
-                                           valvalArrayRCP(i * numLocalMatEntries + j * numLocalDofs, numLocalDofs));
-            }
-        }
-        matM_->fillComplete();
-
-        // Assemble vectors.
-        // vecF_ requires assembly using vecF_overlap_ and redistribution
-        vecF_ = Tpetra::rcp(new Tpetra::MultiVector<>(matA_->getRangeMap(), 1, true));
-        vecF_overlap_ = Tpetra::rcp(new Tpetra::MultiVector<>(myOverlapMap_, 1, true));
-        for (int i = 0; i < numCells_; ++i)
-        { // assembly on the overlap map
-            for (int j = 0; j < numLocalDofs; ++j)
-            {
-                vecF_overlap_->sumIntoGlobalValue(cellDofs(myCellIds_[i], j),
-                                                  0,
-                                                  (*datavalVecF_)[i * numLocalDofs + j]);
-            }
-        }
-        Tpetra::Export<> exporter(vecF_overlap_->getMap(), vecF_->getMap()); // redistribution:
-        vecF_->doExport(*vecF_overlap_, exporter, Tpetra::ADD);              // from the overlap map to the unique map
-        // vecUd_ does not require assembly
-        vecUd_ = Tpetra::rcp(new Tpetra::MultiVector<>(matA_->getDomainMap(), 1, true));
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < numLocalDofs; ++j)
-            {
-                if (vecUd_->getMap()->isNodeGlobalElement(cellDofs(myCellIds_[i], j)))
-                {
-                    vecUd_->replaceGlobalValue(cellDofs(myCellIds_[i], j),
-                                               0,
-                                               (*dataUd_)[i * numLocalDofs + j]);
-                }
-            }
-        }
-
-        // Apply Dirichlet conditions.
-        // Stiffness matrix with Dirichlet conditions:
-        //  AD = [ A11  A12 ]  where A = [ A11 A12 ]
-        //       [  0    I  ]            [ A21 A22 ]
-        // Mass matrix with Dirichlet conditions:
-        //  MD = [ M11  M12 ]  where M = [ M11 M12 ]
-        //       [  0    0  ]            [ M21 M22 ]
-        // Vector F with Dirichlet conditions G:
-        //  FD = [ F1 ]  where F = [ F1 ]
-        //       [ G  ]            [ F2 ]
-        Teuchos::RCP<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
-        matA_dirichlet_ = matA_->clone(node);
-        matM_dirichlet_ = matM_->clone(node);
-        vecF_dirichlet_ = Tpetra::rcp(new Tpetra::MultiVector<>(matA_->getRangeMap(), 1, true));
-        Tpetra::deep_copy(*vecF_dirichlet_, *vecF_);
-        Teuchos::RCP<std::vector<std::vector<Intrepid::FieldContainer<int>>>> dirichletSideSets = meshMgr_->getSideSets();
-        std::vector<std::vector<Intrepid::FieldContainer<int>>> &dss = *dirichletSideSets;
-        Teuchos::Array<int> mySortedCellIds_(myCellIds_);
-        std::sort(mySortedCellIds_.begin(), mySortedCellIds_.end());
-        mySortedCellIds_.erase(std::unique(mySortedCellIds_.begin(), mySortedCellIds_.end()), mySortedCellIds_.end());
-        std::vector<Teuchos::Array<int>> myDirichletCellIds_(dss[0].size());
-        for (int i = 0; i < static_cast<int>(dss[0].size()); ++i)
-        {
-            for (int j = 0; j < dss[0][i].dimension(0); ++j)
-            {
-                if (std::binary_search(mySortedCellIds_.begin(), mySortedCellIds_.end(), dss[0][i](j)))
-                {
-                    myDirichletCellIds_[i].push_back(dss[0][i](j));
-                }
-            }
-        }
-        Intrepid::FieldContainer<int> &cte = *(meshMgr_->getCellToEdgeMap());
-        Intrepid::FieldContainer<int> &nodeDofs = *(dofMgr_->getNodeDofs());
-        Intrepid::FieldContainer<int> &edgeDofs = *(dofMgr_->getEdgeDofs());
-        std::vector<std::vector<int>> dofTags = (basisPtrs_[0])->getAllDofTags();
-        int numDofsPerNode = 0;
-        int numDofsPerEdge = 0;
-        for (int j = 0; j < (basisPtrs_[0])->getCardinality(); ++j)
-        {
-            if (dofTags[j][0] == 0)
-            {
-                numDofsPerNode = dofTags[j][3];
-            }
-            if (dofTags[j][0] == 1)
-            {
-                numDofsPerEdge = dofTags[j][3];
-            }
-        }
-        Teuchos::Array<int> myDirichletDofs_;
-        for (int i = 0; i < static_cast<int>(myDirichletCellIds_.size()); ++i)
-        {
-            for (int j = 0; j < myDirichletCellIds_[i].size(); ++j)
-            {
-                for (int k = 0; k < numDofsPerNode; ++k)
-                {
-                    const CellTopologyData *ctd = cellType_.getCellTopologyData();
-                    Teuchos::ArrayView<unsigned> locNodes(const_cast<unsigned *>(ctd->subcell[spaceDim_ - 1][i].node), cellType_.getVertexCount(spaceDim_ - 1, i));
-                    for (int l = 0; l < static_cast<int>(cellType_.getVertexCount(spaceDim_ - 1, i)); ++l)
-                    {
-                        myDirichletDofs_.push_back(nodeDofs(ctn(myDirichletCellIds_[i][j], locNodes[l]), k));
-                    }
-                }
-                for (int k = 0; k < numDofsPerEdge; ++k)
-                {
-                    myDirichletDofs_.push_back(edgeDofs(cte(myDirichletCellIds_[i][j], i), k));
-                }
-            }
-        }
-        std::sort(myDirichletDofs_.begin(), myDirichletDofs_.end());
-        myDirichletDofs_.erase(std::unique(myDirichletDofs_.begin(), myDirichletDofs_.end()), myDirichletDofs_.end());
-        matA_dirichlet_->resumeFill();
-        matM_dirichlet_->resumeFill();
-        for (int i = 0; i < myDirichletDofs_.size(); ++i)
-        {
-            if (myUniqueMap_->isNodeGlobalElement(myDirichletDofs_[i]))
-            {
-                size_t numRowEntries = matA_dirichlet_->getNumEntriesInGlobalRow(myDirichletDofs_[i]);
-                Teuchos::Array<int> indices(numRowEntries, 0);
-                Teuchos::Array<Real> values(numRowEntries, 0);
-                Teuchos::Array<Real> canonicalValues(numRowEntries, 0);
-                Teuchos::Array<Real> zeroValues(numRowEntries, 0);
-                matA_dirichlet_->getGlobalRowCopy(myDirichletDofs_[i], indices, values, numRowEntries);
-                matM_dirichlet_->getGlobalRowCopy(myDirichletDofs_[i], indices, values, numRowEntries);
-                for (int j = 0; j < indices.size(); ++j)
-                {
-                    if (myDirichletDofs_[i] == indices[j])
-                    {
-                        canonicalValues[j] = 1.0;
-                    }
-                }
-                matA_dirichlet_->replaceGlobalValues(myDirichletDofs_[i], indices, canonicalValues);
-                matM_dirichlet_->replaceGlobalValues(myDirichletDofs_[i], indices, zeroValues);
-                vecF_dirichlet_->replaceGlobalValue(myDirichletDofs_[i], 0, 0);
-            }
-        }
-        matA_dirichlet_->fillComplete();
-        matM_dirichlet_->fillComplete();
-
-        // Create matrix transposes.
-        Tpetra::RowMatrixTransposer<> transposerA(matA_dirichlet_);
-        Tpetra::RowMatrixTransposer<> transposerM(matM_dirichlet_);
-        matA_dirichlet_trans_ = transposerA.createTranspose();
-        matM_dirichlet_trans_ = transposerM.createTranspose();
-
-        /*********************************/
-        /*** Construct solver objects. ***/
-        /*********************************/
-
-        // Construct solver using Amesos2 factory.
-        try
-        {
-            solverA_ = Amesos2::create<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>("KLU2", matA_dirichlet_);
-        }
-        catch (std::invalid_argument e)
-        {
-            std::cout << e.what() << std::endl;
-        }
-        try
-        {
-            solverA_trans_ = Amesos2::create<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>("KLU2", matA_dirichlet_trans_);
-        }
-        catch (std::invalid_argument e)
-        {
-            std::cout << e.what() << std::endl;
-        }
-        solverA_->numericFactorization();
-        solverA_trans_->numericFactorization();
-
-        /****************************************/
-        /****************************************/
-
-        //outputTpetraData();
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatA(const bool &transpose = false) const
-    {
-        if (transpose)
-        {
-            return matA_dirichlet_trans_;
-        }
-        else
-        {
-            return matA_dirichlet_;
-        }
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatB(const bool &transpose = false) const
-    {
-        if (transpose)
-        {
-            return matM_dirichlet_trans_;
-        }
-        else
-        {
-            return matM_dirichlet_;
-        }
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatM() const
-    {
-        return matM_;
-    }
-
-    Teuchos::RCP<Tpetra::CrsMatrix<>> getMatR() const
-    {
-        return matM_;
-    }
-
-    Teuchos::RCP<Tpetra::MultiVector<>> getVecUd() const
-    {
-        return vecUd_;
-    }
-
-    Teuchos::RCP<Tpetra::MultiVector<>> getVecF() const
-    {
-        return vecF_dirichlet_;
-    }
-
-    Teuchos::RCP<Amesos2::Solver<Tpetra::CrsMatrix<>, Tpetra::MultiVector<>>> getSolver(const bool &transpose = false) const
-    {
-        if (transpose)
-        {
-            return solverA_trans_;
-        }
-        else
-        {
-            return solverA_;
-        }
-    }
-
-    Real funcRHS(const Real &x1, const Real &x2) const
-    {
-        return 2.0 * M_PI * M_PI * std::sin(M_PI * x1) * std::sin(M_PI * x2) + (1.0 / (alpha_ * 128.0 * M_PI * M_PI)) * std::sin(8.0 * M_PI * x1) * std::sin(8.0 * M_PI * x2);
-    }
-
-    Real funcTarget(const Real &x1, const Real &x2) const
-    {
-        return std::sin(M_PI * x1) * std::sin(M_PI * x2) - std::sin(8.0 * M_PI * x1) * std::sin(8.0 * M_PI * x2);
-    }
-
-    Real funcStateSolution(const Real &x1, const Real &x2) const
-    {
-        return std::sin(M_PI * x1) * std::sin(M_PI * x2);
-    }
-
-    Real computeStateError(const Teuchos::RCP<const Tpetra::MultiVector<>> &soln) const
-    {
-
-        Teuchos::RCP<Tpetra::MultiVector<>> soln_overlap =
-            Tpetra::rcp(new Tpetra::MultiVector<>(vecF_overlap_->getMap(), 1, true));
-        Tpetra::Import<> importer(vecUd_->getMap(), soln_overlap->getMap()); // redistribution:
-        soln_overlap->doImport(*soln, importer, Tpetra::REPLACE);            // from the unique map to the overlap map
-
-        Intrepid::DefaultCubatureFactory<Real> cubFactory;                                     // create cubature factory
-        int cubDeg = 6;                                                                        // set cubature degree, e.g., 6
-        Teuchos::RCP<Intrepid::Cubature<Real>> cellCub = cubFactory.create(cellType_, cubDeg); // create cubature for error computation
-        int numCubPts = cellCub->getNumPoints();                                               // retrieve number of cubature points
-        int lfs = dofMgr_->getLocalFieldSize(0);
-        Intrepid::FieldContainer<Real> cubPts(numCubPts, spaceDim_);
-        Intrepid::FieldContainer<Real> cubWts(numCubPts);
-        Intrepid::FieldContainer<Real> cubPtsPhys(numCells_, numCubPts, spaceDim_);
-        Intrepid::FieldContainer<Real> jac(numCells_, numCubPts, spaceDim_, spaceDim_);
-        Intrepid::FieldContainer<Real> jacDet(numCells_, numCubPts);
-        Intrepid::FieldContainer<Real> valRef(lfs, numCubPts);
-        Intrepid::FieldContainer<Real> valPhys(numCells_, lfs, numCubPts);
-        Intrepid::FieldContainer<Real> wtMeas(numCells_, numCubPts);
-        Intrepid::FieldContainer<Real> inCoeffs(numCells_, lfs);
-        Intrepid::FieldContainer<Real> funcVals(numCells_, numCubPts);
-        Intrepid::FieldContainer<Real> funcValsWt(numCells_, numCubPts);
-        Intrepid::FieldContainer<Real> normSquaredError(numCells_);
-
-        cellCub->getCubature(cubPts, cubWts);                                 // retrieve cubature points and weights
-        (*basisPtrs_[0]).getValues(valRef, cubPts, Intrepid::OPERATOR_VALUE); // evaluate value operator at cubature points
-
-        Intrepid::CellTools<Real>::setJacobian(jac, cubPts, *cellNodes_, cellType_); // compute cell Jacobians
-        Intrepid::CellTools<Real>::setJacobianDet(jacDet, jac);                      // compute determinants of cell Jacobians
-
-        Intrepid::FunctionSpaceTools::HGRADtransformVALUE<Real>(valPhys, // transform reference values into physical space
-                                                                valRef);
-
-        Intrepid::FunctionSpaceTools::computeCellMeasure<Real>(wtMeas, // compute weighted cell measure
-                                                               jacDet,
-                                                               cubWts);
-
-        Intrepid::CellTools<Real>::mapToPhysicalFrame(cubPtsPhys, // map reference cubature points to physical space
-                                                      cubPts,
-                                                      *cellNodes_,
-                                                      cellType_);
-
-        Intrepid::FieldContainer<int> &cellDofs = *(dofMgr_->getCellDofs());
-        Teuchos::ArrayRCP<const Real> soln_data = soln_overlap->get1dView(); // populate inCoeffs
-        for (int i = 0; i < numCells_; ++i)
-        {
-            for (int j = 0; j < lfs; ++j)
-            {
-                inCoeffs(i, j) = soln_data[soln_overlap->getMap()->getLocalElement(cellDofs(myCellIds_[i], j))];
-            }
-        }
-
-        Intrepid::FunctionSpaceTools::evaluate<Real>(funcVals, inCoeffs, valPhys);
-
-        for (int i = 0; i < numCells_; ++i)
-        { // compute error
-            for (int j = 0; j < numCubPts; ++j)
-            {
-                funcVals(i, j) -= funcStateSolution(cubPtsPhys(i, j, 0), cubPtsPhys(i, j, 1));
-            }
-        }
-
-        Intrepid::FunctionSpaceTools::scalarMultiplyDataData<Real>(funcValsWt, // multiply with weighted measure
-                                                                   wtMeas,
-                                                                   funcVals);
-
-        Intrepid::FunctionSpaceTools::integrate<Real>(normSquaredError, // compute norm squared of local error
-                                                      funcVals,
-                                                      funcValsWt,
-                                                      Intrepid::COMP_CPP);
-
-        Real localErrorSum(0);
-        Real globalErrorSum(0);
-        for (int i = 0; i < numCells_; ++i)
-        {
-            localErrorSum += normSquaredError(i);
-        }
-        Teuchos::RCP<const Teuchos::Comm<int>> comm = soln_overlap->getMap()->getComm();
-        Teuchos::reduceAll<int, Real>(*comm, Teuchos::REDUCE_SUM, 1, &localErrorSum, &globalErrorSum);
-
-        return globalErrorSum;
-    }
-
-    void printMeshData(std::ostream &outStream) const
-    {
-        Teuchos::RCP<Intrepid::FieldContainer<Real>> nodesPtr = meshMgr_->getNodes();
-        Teuchos::RCP<Intrepid::FieldContainer<int>> cellToNodeMapPtr = meshMgr_->getCellToNodeMap();
-        Intrepid::FieldContainer<Real> &nodes = *nodesPtr;
-        Intrepid::FieldContainer<int> &cellToNodeMap = *cellToNodeMapPtr;
-        outStream << "Number of nodes = " << meshMgr_->getNumNodes() << std::endl;
-        outStream << "Number of cells = " << meshMgr_->getNumCells() << std::endl;
-        outStream << "Number of edges = " << meshMgr_->getNumEdges() << std::endl;
-        // Print mesh to file.
-        if ((myRank_ == 0))
-        {
-            std::ofstream meshfile;
-            meshfile.open("cell_to_node_quad.txt");
-            for (int i = 0; i < cellToNodeMap.dimension(0); ++i)
-            {
-                for (int j = 0; j < cellToNodeMap.dimension(1); ++j)
-                {
-                    meshfile << cellToNodeMap(i, j) << "  ";
-                }
-                meshfile << std::endl;
-            }
-            meshfile.close();
-            meshfile.open("cell_to_node_tri.txt");
-            for (int i = 0; i < cellToNodeMap.dimension(0); ++i)
-            {
-                for (int j = 0; j < 3; ++j)
-                {
-                    meshfile << cellToNodeMap(i, j) << "  ";
-                }
-                meshfile << std::endl;
-                for (int j = 2; j < 5; ++j)
-                {
-                    meshfile << cellToNodeMap(i, j % 4) << "  ";
-                }
-                meshfile << std::endl;
-            }
-            meshfile.close();
-            meshfile.open("nodes.txt");
-            meshfile.precision(16);
-            for (int i = 0; i < nodes.dimension(0); ++i)
-            {
-                for (int j = 0; j < nodes.dimension(1); ++j)
-                {
-                    meshfile << std::scientific << nodes(i, j) << "  ";
-                }
-                meshfile << std::endl;
-            }
-            meshfile.close();
-            /* This somewhat clunky output is for gnuplot.
-      meshfile.open("mesh.txt");
-      for (int i=0; i<cellToNodeMap.dimension(0); ++i) {
-        meshfile << nodes(cellToNodeMap(i,0), 0) << "  " << nodes(cellToNodeMap(i,0), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,1), 0) << "  " << nodes(cellToNodeMap(i,1), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,2), 0) << "  " << nodes(cellToNodeMap(i,2), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,3), 0) << "  " << nodes(cellToNodeMap(i,3), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,0), 0) << "  " << nodes(cellToNodeMap(i,0), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,1), 0) << "  " << nodes(cellToNodeMap(i,1), 1) << std::endl;
-        meshfile << nodes(cellToNodeMap(i,2), 0) << "  " << nodes(cellToNodeMap(i,2), 1) << std::endl;
-      }
-      meshfile.close();
-      */
-        }
-    }
-
-    void outputTpetraData() const
-    {
-        Tpetra::MatrixMarket::Writer<Tpetra::CrsMatrix<>> matWriter;
-        matWriter.writeSparseFile("stiffness_mat", matA_);
-        matWriter.writeSparseFile("dirichlet_mat", matA_dirichlet_);
-        matWriter.writeSparseFile("mass_mat", matM_);
-        matWriter.writeDenseFile("Ud_vec", vecUd_);
-    }
-
-    void outputTpetraVector(const Teuchos::RCP<const Tpetra::MultiVector<>> &vec,
-                            const std::string &filename) const
-    {
-        Tpetra::MatrixMarket::Writer<Tpetra::CrsMatrix<>> vecWriter;
-        vecWriter.writeDenseFile(filename, vec);
-    }
-
-}; // class PoissonData
-
-#endif
diff --git a/tlnos/src/objective.hpp b/tlnos/src/objective.hpp
deleted file mode 100644
index 42c4e5b5ff3e577dd7bde4062ab45a6017fc73ec..0000000000000000000000000000000000000000
--- a/tlnos/src/objective.hpp
+++ /dev/null
@@ -1,177 +0,0 @@
-// @HEADER
-// ************************************************************************
-//
-//               Rapid Optimization Library (ROL) Package
-//                 Copyright (2014) Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions? Contact lead developers:
-//              Drew Kouri   (dpkouri@sandia.gov) and
-//              Denis Ridzal (dridzal@sandia.gov)
-//
-// ************************************************************************
-// @HEADER
-
-/*! \file  objective.hpp
-    \brief Defines the SimOpt objective function for the 'poisson' example.
-*/
-
-#ifndef ROL_PDEOPT_POISSON_OBJECTIVE_H
-#define ROL_PDEOPT_POISSON_OBJECTIVE_H
-
-#include "ROL_Objective_SimOpt.hpp"
-#include "ROL_TpetraMultiVector.hpp"
-#include "data.hpp"
-
-template <class Real>
-class Objective_PDEOPT_Poisson : public ROL::Objective_SimOpt<Real>
-{
-private:
-    Teuchos::RCP<PoissonData<Real>> data_;
-    Real alpha_;
-
-public:
-    Objective_PDEOPT_Poisson(const Teuchos::RCP<PoissonData<Real>> &data,
-                             const Teuchos::RCP<Teuchos::ParameterList> &parlist)
-    {
-        data_ = data;
-        alpha_ = parlist->sublist("Problem").get("Penalty parameter", 1e-2);
-    }
-
-    Real value(const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<const Tpetra::MultiVector<>> up =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(u)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> zp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(z)).getVector();
-
-        Teuchos::Array<Real> dotvalU(1, 0);
-        Teuchos::Array<Real> dotvalZ(1, 0);
-
-        // Set difference vector diffp to up.
-        Teuchos::RCP<Tpetra::MultiVector<>> diffp =
-            Teuchos::rcp(new Tpetra::MultiVector<>(*up, Teuchos::Copy));
-        // Temporary matvec vector.
-        Teuchos::RCP<Tpetra::MultiVector<>> matvecp =
-            Teuchos::rcp(new Tpetra::MultiVector<>(*up, Teuchos::Copy));
-
-        // (u-ud)
-        diffp->update(-1.0, *(data_->getVecUd()), 1.0);
-        // M*(u-ud)
-        data_->getMatM()->apply(*diffp, *matvecp);
-        // (u-ud)'*M*(u-ud)
-        diffp->dot(*matvecp, dotvalU);
-
-        // R*z
-        data_->getMatR()->apply(*zp, *matvecp);
-        // z'*R*z
-        zp->dot(*matvecp, dotvalZ);
-
-        // 1/2 * (u-ud)'*M*(u-ud) + alpha/2 * z'*R*z
-        return (0.5 * dotvalU[0] + 0.5 * alpha_ * dotvalZ[0]);
-    }
-
-    void gradient_1(ROL::Vector<Real> &g, const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> gp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(g)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> up =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(u)).getVector();
-
-        // Set difference vector diffp to up.
-        Teuchos::RCP<Tpetra::MultiVector<>> diffp =
-            Teuchos::rcp(new Tpetra::MultiVector<>(*up, Teuchos::Copy));
-        // (u-ud)
-        diffp->update(-1.0, *(data_->getVecUd()), 1.0);
-        // M*(u-ud)
-        data_->getMatM()->apply(*diffp, *gp);
-    }
-
-    void gradient_2(ROL::Vector<Real> &g, const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> gp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(g)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> zp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(z)).getVector();
-
-        // alpha * R*z
-        data_->getMatR()->apply(*zp, *gp);
-        gp->scale(alpha_);
-    }
-
-    void hessVec_11(ROL::Vector<Real> &hv, const ROL::Vector<Real> &v,
-                    const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> hvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(hv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        // M*v
-        data_->getMatM()->apply(*vp, *hvp);
-    }
-
-    void hessVec_12(ROL::Vector<Real> &hv, const ROL::Vector<Real> &v,
-                    const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> hvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(hv)).getVector();
-
-        // zero
-        hvp->scale(0);
-    }
-
-    void hessVec_21(ROL::Vector<Real> &hv, const ROL::Vector<Real> &v,
-                    const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> hvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(hv)).getVector();
-
-        // zero
-        hvp->scale(0);
-    }
-
-    void hessVec_22(ROL::Vector<Real> &hv, const ROL::Vector<Real> &v,
-                    const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol)
-    {
-        Teuchos::RCP<Tpetra::MultiVector<>> hvp =
-            (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real>>(hv)).getVector();
-        Teuchos::RCP<const Tpetra::MultiVector<>> vp =
-            (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real>>(v)).getVector();
-
-        // alpha * R*v
-        data_->getMatR()->apply(*vp, *hvp);
-        hvp->scale(alpha_);
-    }
-};
-
-#endif
diff --git a/tlnos/src/tlnos.h b/tlnos/src/tlnos.h
deleted file mode 100644
index 208f1e938df4ec5f175067cea53d217cc3f65662..0000000000000000000000000000000000000000
--- a/tlnos/src/tlnos.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// global header of the "tlnos" module
-
-#ifndef TLNOS_H
-#define TLNOS_H
-
-#if defined(WIN32)
-#ifdef tlnos_EXPORTS
-#define TLNOS_API __declspec(dllexport)
-#else
-#define TLNOS_API __declspec(dllimport)
-#endif
-#else
-#define TLNOS_API
-#endif
-
-#include "tbox.h"
-
-/**
- * @brief this namespace avoids conflicts with similar names in other modules
- */
-
-namespace tlnos
-{
-class Example1;
-class Example2;
-class Example3;
-class Example4;
-class Example5;
-class Example6;
-class Example7;
-class Example8;
-class Example9;
-class Example10;
-}; // namespace tlnos
-
-#endif //TLNOS_H
diff --git a/tlnos/src/wExample1.cpp b/tlnos/src/wExample1.cpp
deleted file mode 100644
index 34bae2df1af02d41d4298438a99abc32d73c006b..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample1.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "wExample1.h"
-
-#ifdef MYAPP_MPI
-#include "Teuchos_DefaultMpiComm.hpp"
-#else
-#include "Teuchos_DefaultSerialComm.hpp"
-#endif
-
-#ifdef MYAPP_EPETRA
-#include "Epetra_SerialDenseVector.h"
-#endif
-
-using namespace tlnos;
-
-Example1::Example1()
-{
-}
-
-int Example1::src_file(std::string const &infile, Teuchos::Comm<int> &comm)
-{
-    Teuchos::ParameterList p;
-    Teuchos::Ptr<Teuchos::ParameterList> pref(&p);
-    Teuchos::updateParametersFromXmlFileAndBroadcast(infile, pref, comm);
-
-    std::cout << "\nProcessor " << comm.getRank()
-              << "  has param list : \n"
-              << p << std::endl;
-
-    return 0;
-}
-
-void Example1::write(std::ostream &out) const
-{
-    out << "tlnos::Example1:\n";
-}
-
-int Example1::execute(std::string const &infile)
-{
-    /*
-    int *argc = new int(1);// mem leak volontaire
-    // ATTENTION: argv doit rester alloué pdt toute la durée de vie d'appli!
-    char **argv = new char*[2];// mem leak volontaire
-    argv[0] = new char[6]; strcpy(argv[0], "MyApp"); // mem leak volontaire
-    argv[1] = new char[1]; strcpy(argv[1], ""); // mem leak volontaire
-    */
-    int status = 0;
-
-    // Initialize MPI and timer
-    //Teuchos::GlobalMPISession mpiSession(argc,&argv); // [RB] does not work anymore... (MPI already initialised?)
-    Teuchos::GlobalMPISession mpiSession(); // [RB] from https://trilinos.org/pipermail/trilinos-users/2016-July/005597.html
-
-    // Use of flag set in CMakeLists.txt by how Trilinos was configured
-#ifdef MYAPP_MPI
-    Teuchos::MpiComm<int> comm =
-        Teuchos::MpiComm<int>(Teuchos::opaqueWrapper((MPI_Comm)MPI_COMM_WORLD));
-#else
-    Teuchos::SerialComm<int> comm = Teuchos::SerialComm<int>();
-#endif
-
-    try
-    {
-        // Function from another file
-        status = src_file(infile, comm);
-
-        // Flag set in CMakeLists.txt that detects if Epetra was enabled in Trilinos
-#ifdef MYAPP_EPETRA
-        const int len = 10;
-        Epetra_SerialDenseVector vec(len);
-        if (vec.Length() != len)
-            status += 1000;
-        std::cout << "\nEpetra called for vec of length " << len << std::endl;
-#endif
-    }
-
-    catch (std::exception &e)
-    {
-        std::cout << e.what() << std::endl;
-        status = 10;
-    }
-    catch (std::string &s)
-    {
-        std::cout << s << std::endl;
-        status = 20;
-    }
-    catch (char *s)
-    {
-        std::cout << s << std::endl;
-        status = 30;
-    }
-    catch (...)
-    {
-        std::cout << "Caught unknown exception!" << std::endl;
-        status = 40;
-    }
-
-    // Status=0 signals to ctest that the test passed.
-    return status;
-}
diff --git a/tlnos/src/wExample1.h b/tlnos/src/wExample1.h
deleted file mode 100644
index 8d066618afe65bc44495441e6c8c2c4fc5f1631d..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample1.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef WEXAMPLE1_H
-#define WEXAMPLE1_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example1 : public fwk::wObject
-{
-public:
-    Example1();
-    int execute(std::string const &infile);
-
-#ifndef SWIG
-    virtual void write(std::ostream &out) const;
-#endif
-
-private:
-    int src_file(std::string const &infile, Teuchos::Comm<int> &comm);
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE1_H
diff --git a/tlnos/src/wExample10.cpp b/tlnos/src/wExample10.cpp
deleted file mode 100644
index 92aaf7e9df50a49a90f7a075b88e4990c7b40fea..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample10.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "wExample10.h"
-
-#include "Epetra_SerialDenseVector.h"
-#include "Epetra_SerialDenseMatrix.h"
-
-#include "Tpetra_Vector.hpp"
-
-using namespace tlnos;
-
-Example10::Example10()
-{
-}
-
-int Example10::execute()
-{
-
-    int NumRowsA = 2, NumColsA = 2;
-    int NumRowsB = 2, NumColsB = 1;
-    Epetra_SerialDenseMatrix A, B;
-    A.Shape(NumRowsA, NumColsA);
-    B.Shape(NumRowsB, NumColsB);
-    A(0, 0) = 1.;
-    A(1, 1) = 2.;
-
-    B(0, 0) = 2.5;
-    B(1, 0) = 2.;
-    Epetra_SerialDenseMatrix AtimesB;
-
-    AtimesB.Shape(NumRowsA, NumColsB);
-    double alpha = 1.0, beta = 1.0;
-    AtimesB.Multiply('N', 'N', alpha, A, B, beta);
-    std::cout << A;
-    std::cout << B;
-    std::cout << AtimesB;
-    return 0;
-}
diff --git a/tlnos/src/wExample10.h b/tlnos/src/wExample10.h
deleted file mode 100644
index 0f8a7c189875ee76f6e281e8172e38f97346a111..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample10.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE10_H
-#define WEXAMPLE10_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example10 : public fwk::wObject
-{
-public:
-    Example10();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE10_H
diff --git a/tlnos/src/wExample2.cpp b/tlnos/src/wExample2.cpp
deleted file mode 100644
index eb0287047ab27cbc849845acb5c04de8f1dbaa4f..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample2.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "wExample2.h"
-
-#include "Epetra_SerialDenseVector.h"
-#include "Epetra_SerialDenseMatrix.h"
-
-#include "Tpetra_Vector.hpp"
-
-using namespace tlnos;
-
-Example2::Example2()
-{
-}
-
-int Example2::execute()
-{
-
-    int NumRowsA = 2, NumColsA = 2;
-    int NumRowsB = 2, NumColsB = 1;
-    Epetra_SerialDenseMatrix A, B;
-    A.Shape(NumRowsA, NumColsA);
-    B.Shape(NumRowsB, NumColsB);
-    A(0, 0) = 1.;
-    A(1, 1) = 2.;
-
-    B(0, 0) = 2.5;
-    B(1, 0) = 2.;
-    Epetra_SerialDenseMatrix AtimesB;
-
-    AtimesB.Shape(NumRowsA, NumColsB);
-    double alpha = 1.0, beta = 1.0;
-    AtimesB.Multiply('N', 'N', alpha, A, B, beta);
-    std::cout << A;
-    std::cout << B;
-    std::cout << AtimesB;
-    return 0;
-}
diff --git a/tlnos/src/wExample2.h b/tlnos/src/wExample2.h
deleted file mode 100644
index e12584cadf7a79cb9a07f1a0c4b4d9e0765f8330..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample2.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE2_H
-#define WEXAMPLE2_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example2 : public fwk::wObject
-{
-public:
-    Example2();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE2_H
diff --git a/tlnos/src/wExample3.cpp.disabled b/tlnos/src/wExample3.cpp.disabled
deleted file mode 100644
index 344f9a925ce4afd86f4ba190113a330c669bf4fc..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample3.cpp.disabled
+++ /dev/null
@@ -1,373 +0,0 @@
-#include "wExample3.h"
-
-//
-// Simple example of solving the following nonlinear system of
-// equations
-//
-// x(0)^2 + x(1)^2 -1 = 0 
-//      x(1) - x(0)^2 = 0
-//
-// using NOX (Trilinos' Nonlinear Object-Oriented Solutions package).
-// For more details and documentation, see the NOX web site:
-//
-// http://trilinos.sandia.gov/packages/nox/
-//
-// NOTE: Due to the very small dimension of the problem, it should be
-// run with only one MPI process.  We enforce this below by creating a
-// subcommunicator containing only MPI Proc 0, and running the problem
-// on that communicator, quieting all the others.
-//
-#include <iostream>
-
-#include "Epetra_ConfigDefs.h"
-#ifdef HAVE_MPI
-#  include "mpi.h"
-#  include "Epetra_MpiComm.h"
-#else
-#  include "Epetra_SerialComm.h"
-#endif 
-
-
-
-#include "Epetra_Map.h"
-#include "Epetra_Vector.h"
-#include "Epetra_RowMatrix.h"
-#include "Epetra_CrsMatrix.h"
-
-
-#include "NOX.H"
-#include "NOX_Epetra_Interface_Required.H"
-#include "NOX_Epetra_Interface_Jacobian.H"
-#include "NOX_Epetra_LinearSystem_AztecOO.H"
-#include "NOX_Epetra_Group.H"
-
-// ==========================================================================
-// SimpleProblemInterface, the problem interface in this example,
-// defines the interface between NOX and our nonlinear problem to
-// solve.
-// ==========================================================================
-class SimpleProblemInterface : 
-  public NOX::Epetra::Interface::Required,
-  public NOX::Epetra::Interface::Jacobian
-{
-public:
-
-  // The constructor accepts an initial guess and the exact solution
-  // vector (which we know because we created the example).  We make
-  // deep copies of each.
-  SimpleProblemInterface (Epetra_Vector& InitialGuess, 
-                          Epetra_Vector& ExactSolution) :
-    InitialGuess_ (new Epetra_Vector (InitialGuess)),
-    ExactSolution_ (new Epetra_Vector (ExactSolution))
-  {}
-
-  // Destructor.
-  ~SimpleProblemInterface() {}
-
-  // Compute f := F(x), where x is the input vector and f the output
-  // vector.
-  bool 
-  computeF (const Epetra_Vector & x, 
-        Epetra_Vector & f,
-        NOX::Epetra::Interface::Required::FillType F)
-  {
-    f[0] = x[0]*x[0] + x[1]*x[1] - 1.0;
-    f[1] = x[1] - x[0]*x[0];
-
-    return true;
-  };
-
-  bool 
-  computeJacobian(const Epetra_Vector & x, Epetra_Operator & Jac)
-  {
-    Epetra_CrsMatrix* J = dynamic_cast<Epetra_CrsMatrix*>(&Jac);
-
-    if (J == NULL) {
-      std::ostringstream os;
-      os << "*** Problem_Interface::computeJacobian() - The supplied "
-     << "Epetra_Operator object is NOT an Epetra_CrsMatrix! ***";
-      throw std::runtime_error (os.str());
-    }
-
-    std::vector<int> indices(2);
-    std::vector<double> values(2);
-
-    indices[0] = 0; 
-    indices[1] = 1;
-
-    // Row 0
-    values[0] = 2.0 * x[0];
-    values[1] = 2.0 * x[1];
-    J->ReplaceGlobalValues (0, 2, &values[0], &indices[0]);
-
-    // Row 1
-    values[0] = - 2.0 * x[0];
-    values[1] = 1.0;
-    J->ReplaceGlobalValues (1, 2, &values[0], &indices[0]);
-
-    return true;
-  }
-
-  bool 
-  computePrecMatrix (const Epetra_Vector & x, 
-             Epetra_RowMatrix & M) 
-  {
-    throw std::runtime_error ("*** SimpleProblemInterface does not implement "
-                  "computing an explicit preconditioner from an "
-                  "Epetra_RowMatrix ***");
-  }  
-
-  bool 
-  computePreconditioner (const Epetra_Vector & x, 
-             Epetra_Operator & O)
-  {
-    throw std::runtime_error ("*** SimpleProblemInterface does not implement "
-                  "computing an explicit preconditioner from an "
-                  "Epetra_Operator ***");
-  }  
-
-private:
-  Teuchos::RCP<Epetra_Vector> InitialGuess_;
-  Teuchos::RCP<Epetra_Vector> ExactSolution_;
-};
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace tlnos;
-
-Example3::Example3()
-{
-}
-
-
-int
-Example3::execute() 
-{
-  using Teuchos::ParameterList;
-  using Teuchos::parameterList;
-  using Teuchos::RCP;
-  using Teuchos::rcp;
-  using std::cout;
-  using std::endl;
-
-
-#ifdef HAVE_MPI
-  int  argc = 1;
-  MPI_Init(&argc, NULL);
-  Epetra_MpiComm CommWorld (MPI_COMM_WORLD);
-#else
-  Epetra_SerialComm CommWorld;
-#endif
-
-
-  // The example problem is so small that we must run it on only one
-  // process.  However, people might run this example code in MPI with
-  // any number of processes.  We handle this by using a communicator
-  // containing only one MPI process, and quieting all processes but
-  // Proc 0 (with respect to MPI_COMM_WORLD).
-  if (CommWorld.MyPID() == 0)
-    {
-#ifdef HAVE_MPI
-      Epetra_MpiComm Comm (MPI_COMM_SELF);
-#else
-      Epetra_SerialComm Comm;
-#endif
-
-      // Linear map for the 2 global elements.
-      Epetra_Map Map (2, 0, Comm);
-
-      // Build up initial guess and exact solution vectors.
-      Epetra_Vector ExactSolution (Map);
-      ExactSolution[0] = sqrt (0.5 * (sqrt (5.0) - 1));
-      ExactSolution[1] = 0.5 * (sqrt (5.0) - 1);
-
-      Epetra_Vector InitialGuess (Map);
-      InitialGuess[0] = 0.5;
-      InitialGuess[1] = 0.5;
-
-      // Set up the problem interface.  Your application will define
-      // its own problem interface.  SimpleProblemInterface is our
-      // example interface, which you can use as a model.
-      // 
-      // Our SimpleProblemInterface makes a deep copy of the initial
-      // guess and exact solution vectors.
-      RCP<SimpleProblemInterface> interface = 
-    rcp (new SimpleProblemInterface (InitialGuess, ExactSolution));
-
-      // Create the top-level parameter list to control NOX.
-      //
-      // "parameterList" (lowercase initial "p") is a "nonmember
-      // constructor" that returns an RCP<ParameterList> with the
-      // given name.
-      RCP<ParameterList> params = parameterList ("NOX");
-
-      // Tell the nonlinear solver to use line search.
-      params->set ("Nonlinear Solver", "Line Search Based");
-
-      //
-      // Set the printing parameters in the "Printing" sublist.
-      //
-      ParameterList& printParams = params->sublist ("Printing");
-      printParams.set ("MyPID", Comm.MyPID ()); 
-      printParams.set ("Output Precision", 3);
-      printParams.set ("Output Processor", 0);
-
-      // Set verbose=true to see a whole lot of intermediate status
-      // output, during both linear and nonlinear iterations.
-      const bool verbose = false;
-      if (verbose) {
-        printParams.set ("Output Information", 
-                 NOX::Utils::OuterIteration + 
-                 NOX::Utils::OuterIterationStatusTest + 
-                 NOX::Utils::InnerIteration +
-                 NOX::Utils::Parameters + 
-                 NOX::Utils::Details + 
-                 NOX::Utils::Warning);
-          } else {
-        printParams.set ("Output Information", NOX::Utils::Warning);
-      }
-
-      //
-      // Set the nonlinear solver parameters.
-      //
-
-      // Line search parameters.
-      ParameterList& searchParams = params->sublist ("Line Search");
-      searchParams.set ("Method", "Full Step");
-
-      // Parameters for picking the search direction.
-      ParameterList& dirParams = params->sublist ("Direction");
-      // Use Newton's method to pick the search direction.
-      dirParams.set ("Method", "Newton");
-
-      // Parameters for Newton's method.
-      ParameterList& newtonParams = dirParams.sublist ("Newton");
-      newtonParams.set ("Forcing Term Method", "Constant");
-
-      //
-      // Newton's method invokes a linear solver repeatedly.
-      // Set the parameters for the linear solver.
-      //
-      ParameterList& lsParams = newtonParams.sublist ("Linear Solver");
-
-      // Use Aztec's implementation of GMRES, with at most 800
-      // iterations, a residual tolerance of 1.0e-4, with output every
-      // 50 iterations, and Aztec's native ILU preconditioner.
-      lsParams.set ("Aztec Solver", "GMRES");  
-      lsParams.set ("Max Iterations", 800);  
-      lsParams.set ("Tolerance", 1e-4);
-      lsParams.set ("Output Frequency", 50);    
-      lsParams.set ("Aztec Preconditioner", "ilu"); 
-
-      //
-      // Build the Jacobian matrix.
-      //
-      RCP<Epetra_CrsMatrix> A = rcp (new Epetra_CrsMatrix (Copy, Map, 2));
-      {
-    std::vector<int> indices(2);
-    std::vector<double> values(2);
-
-    indices[0]=0; 
-    indices[1]=1;
-
-    values[0] = 2.0 * InitialGuess[0];
-    values[1] = 2.0 * InitialGuess[1];
-    A.get()->InsertGlobalValues (0, 2, &values[0], &indices[0]);
-
-    values[0] = -2.0 * InitialGuess[0];
-    values[1] = 1.0;
-    A.get()->InsertGlobalValues (1, 2, &values[0], &indices[0]);
-
-    A.get()->FillComplete();
-      }  
-
-      // Our SimpleProblemInterface implements both Required and
-      // Jacobian, so we can use the same object for each.
-      RCP<NOX::Epetra::Interface::Required> iReq = interface;
-      RCP<NOX::Epetra::Interface::Jacobian> iJac = interface;
-
-      RCP<NOX::Epetra::LinearSystemAztecOO> linSys = 
-    rcp (new NOX::Epetra::LinearSystemAztecOO (printParams, lsParams,
-                           iReq, iJac, A, InitialGuess));
-
-      // Need a NOX::Epetra::Vector for constructor.
-      NOX::Epetra::Vector noxInitGuess (InitialGuess, NOX::DeepCopy);
-      RCP<NOX::Epetra::Group> group = 
-    rcp (new NOX::Epetra::Group (printParams, iReq, noxInitGuess, linSys));
-
-      //
-      // Set up NOX's iteration stopping criteria ("status tests").
-      //
-
-      // ||F(X)||_2 / N < 1.0e-4, where N is the length of F(X).
-      //
-      // NormF has many options for setting up absolute vs. relative
-      // (scaled by the norm of the initial guess) tolerances, scaling
-      // or not scaling by the length of F(X), and choosing a
-      // different norm (we use the 2-norm here).
-      RCP<NOX::StatusTest::NormF> testNormF = 
-    rcp (new NOX::StatusTest::NormF (1.0e-4));
-
-      // At most 20 (nonlinear) iterations.
-      RCP<NOX::StatusTest::MaxIters> testMaxIters = 
-    rcp (new NOX::StatusTest::MaxIters (20));
-
-      // Combine the above two stopping criteria (normwise
-      // convergence, and maximum number of nonlinear iterations).
-      // The result tells NOX to stop if at least one of them is
-      // satisfied.
-      RCP<NOX::StatusTest::Combo> combo = 
-    rcp (new NOX::StatusTest::Combo (NOX::StatusTest::Combo::OR, 
-                     testNormF, testMaxIters));
-
-      // Create the NOX nonlinear solver.
-      RCP<NOX::Solver::Generic> solver = 
-    NOX::Solver::buildSolver (group, combo, params);
-
-      // Solve the nonlinear system.
-      NOX::StatusTest::StatusType status = solver->solve();
-
-      // Print the result.
-      //
-      // For this particular example, Comm contains only one MPI
-      // process.  However, we check for Comm.MyPID() == 0 here just
-      // so that the example is fully general.  (If you're solving a
-      // larger nonlinear problem, you could safely use the code
-      // below.)
-      if (Comm.MyPID() == 0) {
-    cout << endl << "-- Parameter List From Solver --" << endl;
-    solver->getList ().print (cout);
-      }
-
-      // Get the Epetra_Vector with the final solution from the solver.
-      const NOX::Epetra::Group& finalGroup = 
-    dynamic_cast<const NOX::Epetra::Group&>(solver->getSolutionGroup());
-
-      const Epetra_Vector& finalSolution = 
-    dynamic_cast<const NOX::Epetra::Vector&> (finalGroup.getX ()).getEpetraVector ();
-
-      if (Comm.MyPID() == 0) {
-    cout << "Computed solution: " << endl;
-      }
-      // Epetra objects know how to print themselves politely when
-      // their operator<<(std::ostream&) is invoked on all MPI
-      // process(es) in the communicator to which they are associated.
-      cout << finalSolution;
-
-      if (Comm.MyPID() == 0) {
-    cout << "Exact solution: " << endl;
-      }
-      cout << ExactSolution;
-    }
-
-  // Remember how we quieted all MPI processes but Proc 0 above?
-  // Now we're back in MPI_COMM_WORLD again.
-#ifdef HAVE_MPI
-  // Make sure that everybody is done before calling MPI_Finalize().
-  MPI_Barrier (MPI_COMM_WORLD);
-  MPI_Finalize();
-#endif
-  return EXIT_SUCCESS;
-}
diff --git a/tlnos/src/wExample3.h.disabled b/tlnos/src/wExample3.h.disabled
deleted file mode 100644
index 8129728db244657bef2ca86649e5283111b7899f..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample3.h.disabled
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE3_H
-#define WEXAMPLE3_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos {
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example3 : public fwk::wObject
-{
-public:
-    Example3();
-    int execute(); 
-    
-};
-
-}
-
-#endif //WEXAMPLE3_H
diff --git a/tlnos/src/wExample4.cpp b/tlnos/src/wExample4.cpp
deleted file mode 100644
index b5daac2acb1e3ca9c126f44c43002f134343c6a5..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample4.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-#include "wExample4.h"
-
-// @HEADER
-// ************************************************************************
-//
-//           Galeri: Finite Element and Matrix Generation Package
-//                 Copyright (2006) ETHZ/Sandia Corporation
-//
-// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-// license for use of this work by or on behalf of the U.S. Government.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. Neither the name of the Corporation nor the names of the
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Questions about Galeri? Contact Marzio Sala (marzio.sala _AT_ gmail.com)
-//
-// ************************************************************************
-// @HEADER
-
-#include "Galeri_ConfigDefs.h"
-#include "Galeri_Utils.h"
-#include "Galeri_FiniteElements.h"
-#ifdef HAVE_MPI
-#include "mpi.h"
-#include "Epetra_MpiComm.h"
-#else
-#include "Epetra_SerialComm.h"
-#endif
-
-#ifdef MOERTEL_HAVE_EXODUS
-#include "ExodusInterface.h" // NOT COMPILED BY KIM!
-#endif
-
-// ==========================================================
-// This file solves the scalar elliptic problem
-//
-//   - \mu \nabla u + \sigma u = f    on \Omega
-//                           u = g    on \partial \Omega
-//
-// where \Omega is a 3D cube, divided into hexahedra.
-// `f' is specified by function `Force()', the Dirichlet boundary condition
-// by function `BoundaryValue()', and the value of \mu and
-// \sigma can be changed in the functions Diffusion() and
-// Source(). The code solves the corresponding linear system
-// using AztecOO with ML preconditioner, and writes the
-// solution into a MEDIT-compatible format. Then, it computes
-// the L2 and H1 norms of the solution and the error.
-//
-// \author Marzio Sala, ETHZ/COLAB
-//
-// \date Last updated on 15-Sep-05
-// ==========================================================
-
-double Diffusion4(const double &x, const double &y, const double &z)
-{
-    return (1.0);
-}
-
-double Source4(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-double Force4(const double &x, const double &y, const double &z)
-{
-    return (-6.0);
-}
-
-// Specifies the boundary condition.
-double BoundaryValue4(const double &x, const double &y,
-                      const double &z, const int &PatchID)
-{
-    return (x * x + y * y + z * z);
-}
-
-// Specifies the boundary condition.
-int BoundaryType4(const int &PatchID)
-{
-    return (Galeri::FiniteElements::GALERI_DIRICHLET);
-}
-
-// Returns the value of the exact solution and its first
-// derivatives with respect to x, y and z.
-int ExactSolution(double x, double y, double z, double *res)
-{
-    res[0] = x * x + y * y + z * z;
-    res[1] = 2 * x;
-    res[2] = 2 * y;
-    res[3] = 2 * z;
-
-    return (0);
-}
-
-using namespace Galeri;
-using namespace Galeri::FiniteElements;
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace std;
-using namespace tlnos;
-
-Example4::Example4()
-{
-}
-
-int Example4::execute()
-{
-#ifdef HAVE_MPI
-    //int  argc = 1;
-    //MPI_Init(&argc, NULL); // [RB] already initialised
-    Epetra_MpiComm Comm(MPI_COMM_WORLD);
-#else
-    Epetra_SerialComm Comm;
-#endif
-
-    try
-    {
-
-        // ============================================================ //
-        // Prepares the computational domain. For simplicity,           //
-        // the computation domain has (nx * NumProcs, ny, nz) elements, //
-        // and it is partitioned into (NumProcs, 1, 1) subdomains.      //
-        // If you want to change the grid element, remember to modify   //
-        // the quadrature in GalerkinVariational<T>. Now T is set to    //
-        // HexQuadrature.                                               //
-        // ============================================================ //
-
-        int nx = 4 * Comm.NumProc();
-        int ny = 4;
-        int nz = 4;
-        int mx = Comm.NumProc(), my = 1, mz = 1;
-
-        HexCubeGrid Grid(Comm, nx, ny, nz, mx, my, mz);
-
-        cout << "------------------------" << endl;
-        // Extracts the information from the Grid using AbstractGrid
-        // methods. First, some general information.
-
-        cout << "Number of dimensions = " << Grid.NumDimensions() << endl;
-        cout << "Number of vertices per element = " << Grid.NumVerticesPerElement() << endl;
-        cout << "Number of faces per element = " << Grid.NumFacesPerElement() << endl;
-        cout << "Number of vertices per face = " << Grid.NumVerticesPerFace() << endl;
-        cout << "Element type = " << Grid.ElementType() << endl;
-
-        cout << "Number of elements: global = " << Grid.NumGlobalElements();
-        cout << ", on proc 0 = " << Grid.NumMyElements() << endl;
-        cout << "Number of vertices: global = " << Grid.NumGlobalVertices();
-        cout << ", on proc 0 = " << Grid.NumMyVertices() << endl;
-        cout << "Number of boundary faces: "
-                "on proc 0 = "
-             << Grid.NumMyBoundaryFaces() << endl;
-
-        cout << "------------------------" << endl;
-
-        // ======================================================== //
-        // Prepares the linear system. This requires the definition //
-        // of a quadrature formula compatible with the grid, a      //
-        // variational formulation, and a problem object which take //
-        // care of filling matrix and right-hand side.              //
-        // ======================================================== //
-
-        Epetra_CrsMatrix A(Copy, Grid.RowMap(), 0);
-        Epetra_Vector LHS(Grid.RowMap());
-        Epetra_Vector RHS(Grid.RowMap());
-
-        int NumQuadratureNodes = 1;
-
-        GalerkinVariational<HexQuadrature>
-            Laplacian(NumQuadratureNodes, Diffusion4, Source4, Force4,
-                      BoundaryValue4, BoundaryType4);
-
-        LinearProblem FiniteElementProblem(Grid, Laplacian, A, LHS, RHS);
-        FiniteElementProblem.Compute();
-
-        // =================================================== //
-        // The solution must be computed here by solving the   //
-        // linear system A * LHS = RHS.                        //
-        //
-        // NOTE: Solve() IS A SIMPLE FUNCTION BASED ON LAPACK, //
-        // THEREFORE THE MATRIX IS CONVERTED TO DENSE FORMAT.  //
-        // IT WORKS IN SERIAL ONLY.                            //
-        // EVEN MEDIUM-SIZED MATRICES MAY REQUIRE A LOT OF     //
-        // MEMORY AND CPU-TIME! USERS SHOULD CONSIDER INSTEAD  //
-        // AZTECOO, ML, IFPACK OR OTHER SOLVERS.               //
-        // =================================================== //
-
-        Solve(&A, &LHS, &RHS);
-
-        cout << "----------------------" << endl;
-        cout << A << endl;
-        cout << "----------------------" << endl;
-        cout << LHS << endl;
-        cout << "----------------------" << endl;
-        cout << RHS << endl;
-        cout << "----------------------" << endl;
-
-        // ========================= //
-        // After the solution:       //
-        // - computation of the norm //
-        // - output using MEDIT      //
-        // ========================= //
-
-        FiniteElementProblem.ComputeNorms(LHS, ExactSolution);
-
-//MEDITInterface MEDIT(Comm);
-//MEDIT.Write(Grid, "Laplacian3D", LHS);
-
-// ==================    //
-// Output using ExodusII //
-// ==================    //
-#ifdef MOERTEL_HAVE_EXODUS
-        // NOT COMPILED BY KIM
-        ExodusInterface exodus(Comm);
-        exodus.Write(Grid, "Laplacian3D", LHS);
-#endif
-
-        // We need to define a vector to plot, in this case constant
-        //Epetra_Vector Vector(Grid.RowMap());
-        //MEDIT.Write(Grid, "grid", Vector);
-    }
-    catch (Exception &rhs)
-    {
-        if (Comm.MyPID() == 0)
-            rhs.Print();
-    }
-    catch (int e)
-    {
-        cerr << "Caught exception, value = " << e << endl;
-    }
-    catch (...)
-    {
-        cerr << "Caught generic exception" << endl;
-    }
-
-#ifdef HAVE_MPI
-    MPI_Finalize();
-#endif
-
-    return (0);
-}
diff --git a/tlnos/src/wExample4.h b/tlnos/src/wExample4.h
deleted file mode 100644
index 531107944f8adf0b50a49a18d4d4393f755186ac..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample4.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE4_H
-#define WEXAMPLE4_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example4 : public fwk::wObject
-{
-public:
-    Example4();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE4_H
diff --git a/tlnos/src/wExample5.cpp b/tlnos/src/wExample5.cpp
deleted file mode 100644
index 22eebbf34e18e3100d1c7aa2eb89faf9c70b5e86..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample5.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-#include "wExample5.h"
-/*
- #@HEADER
- # ************************************************************************
- #
- #                          Moertel FE Package
- #                 Copyright (2006) Sandia Corporation
- #
- # Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
- # license for use of this work by or on behalf of the U.S. Government.
- #
- # Redistribution and use in source and binary forms, with or without
- # modification, are permitted provided that the following conditions are
- # met:
- #
- # 1. Redistributions of source code must retain the above copyright
- # notice, this list of conditions and the following disclaimer.
- #
- # 2. Redistributions in binary form must reproduce the above copyright
- # notice, this list of conditions and the following disclaimer in the
- # documentation and/or other materials provided with the distribution.
- #
- # 3. Neither the name of the Corporation nor the names of the
- # contributors may be used to endorse or promote products derived from
- # this software without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
- # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
- # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- #
- # Questions? Contact Glen Hansen (gahanse@sandia.gov)
- #
- # ************************************************************************
- #@HEADER
- */
-/*!
- * \file TwoSquares.cpp
- *
- * \brief Simple serial example showing Moertel usage and solver interfaces
- *
- * \date Last update do Doxygen: 20-March-06
- *
- */
-#ifdef HAVE_MPI
-#include "mpi.h"
-#include "Epetra_MpiComm.h"
-#else
-#include "Epetra_SerialComm.h"
-#endif
-
-// MOERTEL headers
-#include "mrtr_manager.H"
-#include "mrtr_segment_linear1D.H"
-
-// Galeri headers
-#include "Galeri_Utils.h"
-#include "Galeri_FiniteElements.h"
-
-#ifdef MOERTEL_HAVE_EXODUS
-#include "ExodusInterface.h"
-#endif
-using namespace Galeri;
-using namespace Galeri::FiniteElements;
-
-// ==========================================================
-// This file solves the scalar problem
-//
-//   - \mu \nabla u + \sigma u = f    on \Omega
-//                           u = g    on \partial \Omega
-//
-// where \Omega is a 2D rectangle, divided into triangles.
-// The input grid should be generated using similar
-// conventions of file galeri/data/TwoSquares.m:
-// - the bc ID of 10 and 20 are for the mortar interface
-// - the bc ID of 0 is for the external domain.
-// ==========================================================
-
-double Diffusion5(const double &x, const double &y, const double &z)
-{
-    return (1.0);
-}
-
-double Source5(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-double Force5(const double &x, const double &y, const double &z)
-{
-    if (y < 0.8)
-        return (1.0);
-    else
-        return (0.0);
-}
-
-// Specifies the boundary condition.
-int BoundaryType5(const int &Patch)
-{
-    if (Patch == 10 || Patch == 20)
-        return (GALERI_DO_NOTHING);
-    else
-        return (GALERI_DIRICHLET);
-}
-
-// Specifies the boundary condition.
-double BoundaryValue5(const double &x, const double &y,
-                      const double &z, const int &Patch)
-{
-    if (x == -1.0 || x == 1.0)
-        return (0.0);
-    else if (Patch == 10 || Patch == 20)
-        return (1.0);
-    else
-        return (0.0);
-}
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace tlnos;
-
-Example5::Example5()
-{
-}
-
-int Example5::execute()
-{
-#ifdef HAVE_MPI
-    /* 
-    static int  argc = 1;
-    char **argv = new char*[2];// mem leak volontaire
-    argv[0] = new char[8]; strcpy(argv[0], "myprog"); // mem leak volontaire
-    argv[1] = new char[1]; strcpy(argv[1], ""); // mem leak volontaire
-    
-    MPI_Init(&argc,&argv);
-    */
-    Epetra_MpiComm Comm(MPI_COMM_WORLD);
-#else
-    Epetra_SerialComm Comm;
-#endif
-
-    int status = 0; // return status
-
-    try
-    {
-
-        // this example is in serial only
-        if (Comm.NumProc() > 1)
-            exit(0);
-
-        // read grid from file, see also TwoSquares.m used to generate the grids
-        /*
-         %  +------+
-         %  |  S2  |
-         %  +------+ <- edge has tag 20 and 9 elements
-         %  +------+ <- edge has tag 10 and 10 elements
-         %  |  S1  |
-         %  +------+
-         %
-         % where S1 = (-1,1) x (-1,1) and S2 = (-1, 1) x (1, 3).
-         */
-
-        FileGrid Grid(Comm, "TwoSquares.grid"); // [RB] missing file!!
-
-        // create a list of all nodes that are linked to a face
-        // with tag 10 and tag 20
-        map<int, int> nodes10;
-        map<int, int> nodes20;
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag == 10)
-            {
-                nodes10[nodeids[0]] = nodeids[0];
-                nodes10[nodeids[1]] = nodeids[1];
-            }
-            else if (tag == 20)
-            {
-                nodes20[nodeids[0]] = nodeids[0];
-                nodes20[nodeids[1]] = nodeids[1];
-            }
-            else
-                continue;
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Interface, in this example just one
-        // ------------------------------------------------------------- //
-        int printlevel = 0; // ( moertel takes values 0 - 10 )
-        //int printlevel = 9; // ( moertel takes values 0 - 10 )
-        MOERTEL::Interface interface(0, true, Comm, printlevel);
-
-        // ------------------------------------------------------------- //
-        // Add nodes on both sides of interface to interface
-        // loop all nodes in the maps nodes10 and nodes20 and add them
-        // to the interface with unique ids
-        // tag 10 will become interface side 0
-        // tag 20 will become interface side 1
-        // ------------------------------------------------------------- //
-        map<int, int>::iterator curr;
-        // do tag==10 or interface side 0
-        for (curr = nodes10.begin(); curr != nodes10.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue5(coord[0], coord[1], coord[2], 10);
-            bool dboundary = false;
-            if (bou == 0.0)
-                dboundary = true;
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 0
-            interface.AddNode(node, 0);
-        }
-        nodes10.clear();
-
-        // do tag==20 or interface side 1
-        for (curr = nodes20.begin(); curr != nodes20.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue5(coord[0], coord[1], coord[2], 20);
-            bool dboundary = false;
-            if (bou == 0.0)
-                dboundary = true;
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 1
-            interface.AddNode(node, 1);
-        }
-        nodes20.clear();
-
-        // ------------------------------------------------------------- //
-        // add segments on both sides of the interface to the interface
-        // ------------------------------------------------------------- //
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag != 10 && tag != 20)
-                continue;
-            // create a segment (galeri calls it a face)
-            MOERTEL::Segment_Linear1D segment(i, 2, nodeids, printlevel);
-
-            // add it to the interface on side 0
-            if (tag == 10)
-                interface.AddSegment(segment, 0);
-            // add it to the interface on side 1
-            else if (tag == 20)
-                interface.AddSegment(segment, 1);
-        }
-
-        // ------------------------------------------------------------- //
-        // choose the mortar side of the interface (0 or 1)
-        // here: let the package choose it (-2)
-        // ------------------------------------------------------------- //
-        interface.SetMortarSide(-2);
-
-        // ------------------------------------------------------------- //
-        // As we do not know the mortar side yet (we decided to le the
-        // package choose it), we can not set a dual trace function (mortar space)
-        // as we don't know the side to set it to
-        // so we just give orders for the function type
-        // ------------------------------------------------------------- //
-        interface.SetFunctionTypes(MOERTEL::Function::func_Linear1D,      // primal trace space
-                                   MOERTEL::Function::func_DualLinear1D); // dual mortar space (recommended)
-        //MOERTEL::Function::func_Linear1D);    // mortar space (not recommended)
-
-        // ------------------------------------------------------------- //
-        // complete the interface
-        // ------------------------------------------------------------- //
-        if (!interface.Complete())
-        {
-            cout << "Interface completion returned false\n";
-            exit(EXIT_FAILURE);
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Manager for 2D problems
-        // It organizes everything from integration to solution
-        // ------------------------------------------------------------- //
-        MOERTEL::Manager manager(Comm, printlevel);
-        manager.SetDimension(MOERTEL::Manager::manager_2D);
-
-        // ------------------------------------------------------------- //
-        // Add the interface to the manager
-        // ------------------------------------------------------------- //
-        manager.AddInterface(interface);
-
-        // ------------------------------------------------------------- //
-        // for mortar integration, the mortar manager needs to know about
-        // the rowmap of the original (uncoupled) problem because it will
-        // create coupling matrices D and M matching that rowmap
-        // ------------------------------------------------------------- //
-        manager.SetProblemMap(&Grid.RowMap());
-
-        // ============================================================= //
-        // choose integration parameters
-        // ============================================================= //
-        Teuchos::ParameterList &moertelparams = manager.Default_Parameters();
-        // this does not affect this 2D case
-        moertelparams.set("exact values at gauss points", true);
-        // 1D interface possible values are 1,2,3,4,5,6,7,8,10 (2 recommended with linear shape functions)
-        moertelparams.set("number gaussian points 1D", 2);
-        // 2D interface possible values are 3,6,12,13,16,19,27
-        moertelparams.set("number gaussian points 2D", 27);
-
-        // ============================================================= //
-        // Here we are done with the construction phase of the interface
-        // so we can integrate the mortar integrals
-        // (Note we have not yet evaluated the PDE at all!)
-        // ============================================================= //
-        manager.Mortar_Integrate();
-
-        // print interface information
-        // (Manager, Interface, Segment, Node implement the << operator)
-        if (printlevel)
-            cout << manager;
-
-        // ======================================================== //
-        // Prepares the linear system. This requires the definition //
-        // of a quadrature formula compatible with the grid, a      //
-        // variational formulation, and a problem object which take //
-        // care of filling matrix and right-hand side.              //
-        // NOTE:
-        // we are doing this AFTER we did all the mortar stuff to
-        // show that the mortar integration is actually PDE-independent
-        // ======================================================== //
-        Epetra_CrsMatrix A(Copy, Grid.RowMap(), 0);
-        Epetra_Vector LHS(Grid.RowMap(), true);
-        Epetra_Vector RHS(Grid.RowMap());
-
-        int NumQuadratureNodes = 3;
-
-        GalerkinVariational<TriangleQuadrature>
-            Laplace2D(NumQuadratureNodes, Diffusion5, Source5, Force5,
-                      BoundaryValue5, BoundaryType5);
-
-        LinearProblem FiniteElementProblem(Grid, Laplace2D, A, LHS, RHS);
-        FiniteElementProblem.Compute();
-
-        // ============================================================= //
-        // this is Galeri's dense solve method if you'd like to see how
-        // the uncoupled solution looks like
-        // ============================================================= //
-        Solve(&A, &LHS, &RHS);
-
-        // ============================================================= //
-        // Since we now have all the pieces together, let's use the
-        // MOERTEL interface to other Trilinos packages to solve the
-        // problem
-        // ============================================================= //
-
-        // ------------------------------------------------------------- //
-        // Create a Teuchos::ParameterList to hold solver arguments and also
-        // to hold arguments for connected packages AztecOO, ML and Amesos
-        // ------------------------------------------------------------- //
-        Teuchos::ParameterList list;
-
-        // ------------------------------------------------------------- //
-        // Choose which type of system of equations to generate
-        // Note that only when using DUAL mortar spaces an spd system
-        // can be generated
-        // ------------------------------------------------------------- //
-        //list.set("System","SaddleSystem");
-        list.set("System", "SPDSystem");
-
-        // ------------------------------------------------------------- //
-        // choose solver, currently there is a choice of Amesos and ML/AztecOO
-        // Note that if "SaddleSystem" was chosen as system of equations
-        // ML/AztecOO doesn't work
-        // ------------------------------------------------------------- //
-        list.set("Solver", "Amesos");
-        //list.set("Solver","ML/Aztec");
-
-        // ------------------------------------------------------------- //
-        // create sublists for packages Amesos, ML, AztecOO. they will be
-        // passed on to the individual package that is used
-        // ------------------------------------------------------------- //
-
-        // Amesos parameters:
-        Teuchos::ParameterList &amesosparams = list.sublist("Amesos");
-        amesosparams.set("Solver", "Amesos_Klu");
-        amesosparams.set("PrintTiming", true);
-        amesosparams.set("PrintStatus", true);
-        amesosparams.set("UseTranspose", true);
-
-        // AztecOO parameters
-        Teuchos::ParameterList &aztecparams = list.sublist("Aztec");
-        aztecparams.set("AZ_solver", "AZ_cg");
-        // This will involve ML as preconditioner
-        // See the AztecOO manual for other options
-        aztecparams.set("AZ_precond", "AZ_user_precond");
-        aztecparams.set("AZ_max_iter", 1200);
-        aztecparams.set("AZ_output", 100);
-        aztecparams.set("AZ_tol", 1.0e-7);
-        aztecparams.set("AZ_scaling", "AZ_none");
-
-        // ML parameters
-        // As Moertel comes with his own special mortar multigrid hierachy
-        // based on ML's smoothed aggregation, not all ML parameters are recognized
-        // It basically recognizes everything that recognized by ML's MLAPI
-        // (ML Application Programming Interface), see MLAPI documentation
-        Teuchos::ParameterList &mlparams = list.sublist("ML");
-        ML_Epetra::SetDefaults("SA", mlparams);
-        mlparams.set("output", 10);
-        mlparams.set("print unused", 1 - 2);
-        mlparams.set("increasing or decreasing", "increasing");
-        mlparams.set("PDE equations", 1);
-        mlparams.set("max levels", 10);
-        mlparams.set("coarse: max size", 80);
-        mlparams.set("aggregation: type", "Uncoupled");
-        mlparams.set("aggregation: damping factor", 1.33);
-
-        // original   : The unmodified ML (smoothed) aggregation prolongator
-        // mod_simple : ( R * (I-B*W^T) )^T
-        // mod_middle : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T
-        // mod_full   : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T + ( R B*W^T*P * R * B*W^T )^T
-        mlparams.set("prolongator: type", "mod_middle");
-
-        // solvers/smoothers currently recognized by the MLAPI_InverseOperator are
-        // Ifpack:
-        //         "Jacobi" "Gauss-Seidel" "symmetric Gauss-Seidel"
-        //         "ILU" "ILUT" "IC" "ICT" "LU" "Amesos" "Amesos-KLU"
-        //         and accompanying parameters
-        // ML:
-        //         "MLS" "ML MLS" "ML symmetric Gauss-Seidel"
-        //         "ML Gauss-Seidel"
-        //         and accompanying parameters
-        mlparams.set("coarse: type", "Amesos-KLU");
-        mlparams.set("smoother: type", "symmetric Gauss-Seidel");
-        mlparams.set("smoother: MLS polynomial order", 3);
-        mlparams.set("relaxation: min diagonal value", 0.1);
-        mlparams.set("smoother: damping factor", 0.67);
-        mlparams.set("smoother: sweeps", 1);
-        mlparams.set("smoother: pre or post", "both");
-        // the ns for Laplace is the constant
-        int dimnullspace = 1;
-        int nummyrows = manager.ProblemMap()->NumMyElements();
-        int dimnsp = dimnullspace * nummyrows;
-        double *nsp = new double[dimnsp];
-        for (int i = 0; i < dimnsp; ++i)
-            nsp[i] = 1.;
-        mlparams.set("null space: type", "pre-computed");
-        mlparams.set("null space: add default vectors", false);
-        mlparams.set("null space: dimension", dimnullspace);
-        mlparams.set("null space: vectors", nsp);
-
-        // ------------------------------------------------------------- //
-        // Pass input matrix to Moertel,
-        // Moertel does NOT take ownership of A!
-        // ------------------------------------------------------------- //
-        manager.SetInputMatrix(&A, false);
-
-        std::cout << list;
-
-        // ============================================================= //
-        // Solve
-        // ============================================================= //
-        //manager.Solve(list,LHS,RHS);
-
-        // ------------------------------------------------------------- //
-        // One can reset the solver, change parameters and/or matrix (with the
-        // same rowmap) and solve again if needed.
-        // If no ResetSolver() is called, the same matrix and preconditioner
-        // will be used to solve for multiple rhs
-        // ------------------------------------------------------------- //
-        //manager.ResetSolver();
-        //LHS.PutScalar(0.0);
-        //manager.SetInputMatrix(&A,false);
-        //manager.Solve(list,LHS,RHS);
-
-#ifdef MOERTEL_HAVE_EXODUS
-
-        // ==================    //
-        // Output using ExodusII //
-        // ==================    //
-        ExodusInterface exodus(Comm);
-        exodus.Write(Grid, "output", LHS);
-
-        std::cout << "Exodus is used for output" << std::endl;
-
-#endif
-    }
-    catch (int e)
-    {
-        cerr << "Caught exception, value = " << e << endl;
-        status = 1;
-    }
-    catch (Galeri::Exception &rhs)
-    {
-
-        cerr << "Caught Galeri exception: ";
-        rhs.Print();
-        status = 1;
-    }
-    catch (...)
-    {
-        cerr << "Caught generic exception" << endl;
-        status = 1;
-    }
-
-#ifdef HAVE_MPI
-    MPI_Finalize();
-#endif
-
-    if (status == 0)
-        std::cout << "\nTest passed!" << endl;
-    else
-        std::cout << "\nTest Failed!" << endl;
-
-    // Final return value (0 = successfull, non-zero = failure)
-
-    return status;
-}
diff --git a/tlnos/src/wExample5.h b/tlnos/src/wExample5.h
deleted file mode 100644
index 7c53b738555e13034d159673a02079b94e66b435..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample5.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE5_H
-#define WEXAMPLE5_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example5 : public fwk::wObject
-{
-public:
-    Example5();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE5_H
diff --git a/tlnos/src/wExample6.cpp b/tlnos/src/wExample6.cpp
deleted file mode 100644
index 1788410efe053b087afa122a3c29b33d047fa849..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample6.cpp
+++ /dev/null
@@ -1,533 +0,0 @@
-#include "wExample6.h"
-/*
-#@HEADER
-# ************************************************************************
-#
-#                          Moertel FE Package
-#                 Copyright (2006) Sandia Corporation
-#
-# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-# license for use of this work by or on behalf of the U.S. Government.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the Corporation nor the names of the
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Questions? Contact Glen Hansen (gahanse@sandia.gov)
-#
-# ************************************************************************
-#@HEADER
-*/
-/*!
- * \file TwoSquares.cpp
- *
- * \brief Simple serial example showing Moertel usage and solver interfaces
- *
- * \date Last update do Doxygen: 20-March-06
- *
- */
-#ifdef HAVE_MPI
-#include "mpi.h"
-#include "Epetra_MpiComm.h"
-#else
-#include "Epetra_SerialComm.h"
-#endif
-
-// MOERTEL headers
-#include "mrtr_manager.H"
-#include "mrtr_segment_linear1D.H"
-
-// Galeri headers
-#include "Galeri_Utils.h"
-#include "Galeri_FiniteElements.h"
-
-#ifdef MOERTEL_HAVE_EXODUS
-#include "ExodusInterface.h"
-#endif
-
-using namespace Galeri;
-using namespace Galeri::FiniteElements;
-
-// ==========================================================
-// This file solves the scalar problem
-//
-//   - \mu \nabla u + \sigma u = f    on \Omega
-//                           u = g    on \partial \Omega
-//
-// where \Omega is a 2D rectangle, divided into triangles.
-// The input grid should be generated using similar
-// conventions of file galeri/data/TwoSquares.m:
-// - the bc ID of 10 and 20 are for the mortar interface
-// - the bc ID of 0 is for the external domain.
-// ==========================================================
-
-double Diffusion(const double &x, const double &y, const double &z)
-{
-    return (1.0);
-}
-
-double Source(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-double Force(const double &x, const double &y, const double &z)
-{
-    if (y < 0.8)
-        return (1.0);
-    else
-        return (0.0);
-}
-
-// Specifies the boundary condition.
-int BoundaryType(const int &Patch)
-{
-    if (Patch == 10 || Patch == 20)
-        return (GALERI_DO_NOTHING);
-    else
-        return (GALERI_DIRICHLET);
-}
-
-// Specifies the boundary condition.
-double BoundaryValue(const double &x, const double &y,
-                     const double &z, const int &Patch)
-{
-    if (x == -1.0 || x == 1.0)
-        return (0.0);
-    else if (Patch == 10 || Patch == 20)
-        return (1.0);
-    else
-        return (0.0);
-}
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace tlnos;
-
-Example6::Example6()
-{
-}
-
-int Example6::execute()
-{
-#ifdef HAVE_MPI
-    /*
-   static int  argc = 1;
-   char **argv = new char*[2];// mem leak volontaire
-   argv[0] = new char[8]; strcpy(argv[0], "myprog"); // mem leak volontaire
-   argv[1] = new char[1]; strcpy(argv[1], ""); // mem leak volontaire
-
-  MPI_Init(&argc,&argv);
-  */
-    Epetra_MpiComm Comm(MPI_COMM_WORLD);
-#else
-    Epetra_SerialComm Comm;
-#endif
-
-    int status = 0; // return status
-
-    try
-    {
-
-        // this example is in serial only
-        if (Comm.NumProc() > 1)
-            exit(0);
-
-        // read grid from file, see also TwoSquares.m used to generate the grids
-        /*
-    %  +------+
-    %  |  S2  |
-    %  +------+ <- edge has tag 20 and 9 elements
-    %  +------+ <- edge has tag 10 and 10 elements
-    %  |  S1  |
-    %  +------+
-    %
-    % where S1 = (-1,1) x (-1,1) and S2 = (-1, 1) x (1, 3).
-    */
-
-        FileGrid Grid(Comm, "TwoSquares.grid");
-
-        // create a list of all nodes that are linked to a face
-        // with tag 10 and tag 20
-        map<int, int> nodes10;
-        map<int, int> nodes20;
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag == 10)
-            {
-                nodes10[nodeids[0]] = nodeids[0];
-                nodes10[nodeids[1]] = nodeids[1];
-            }
-            else if (tag == 20)
-            {
-                nodes20[nodeids[0]] = nodeids[0];
-                nodes20[nodeids[1]] = nodeids[1];
-            }
-            else
-                continue;
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Interface, in this example just one
-        // ------------------------------------------------------------- //
-        int printlevel = 0; // ( moertel takes values 0 - 10 )
-        //int printlevel = 9; // ( moertel takes values 0 - 10 )
-        MOERTEL::Interface interface(0, true, Comm, printlevel);
-
-        // ------------------------------------------------------------- //
-        // Add nodes on both sides of interface to interface
-        // loop all nodes in the maps nodes10 and nodes20 and add them
-        // to the interface with unique ids
-        // tag 10 will become interface side 0
-        // tag 20 will become interface side 1
-        // ------------------------------------------------------------- //
-        map<int, int>::iterator curr;
-        // do tag==10 or interface side 0
-        for (curr = nodes10.begin(); curr != nodes10.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue(coord[0], coord[1], coord[2], 10);
-            bool dboundary = false;
-            if (bou == 0.0)
-                dboundary = true;
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 0
-            interface.AddNode(node, 0);
-        }
-        nodes10.clear();
-
-        // do tag==20 or interface side 1
-        for (curr = nodes20.begin(); curr != nodes20.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue(coord[0], coord[1], coord[2], 20);
-            bool dboundary = false;
-            if (bou == 0.0)
-                dboundary = true;
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 1
-            interface.AddNode(node, 1);
-        }
-        nodes20.clear();
-
-        // ------------------------------------------------------------- //
-        // add segments on both sides of the interface to the interface
-        // ------------------------------------------------------------- //
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag != 10 && tag != 20)
-                continue;
-            // create a segment (galeri calls it a face)
-            MOERTEL::Segment_Linear1D segment(i, 2, nodeids, printlevel);
-
-            // add it to the interface on side 0
-            if (tag == 10)
-                interface.AddSegment(segment, 0);
-            // add it to the interface on side 1
-            else if (tag == 20)
-                interface.AddSegment(segment, 1);
-        }
-
-        // ------------------------------------------------------------- //
-        // choose the mortar side of the interface (0 or 1)
-        // here: let the package choose it (-2)
-        // ------------------------------------------------------------- //
-        interface.SetMortarSide(-2);
-
-        // ------------------------------------------------------------- //
-        // As we do not know the mortar side yet (we decided to le the
-        // package choose it), we can not set a dual trace function (mortar space)
-        // as we don't know the side to set it to
-        // so we just give orders for the function type
-        // ------------------------------------------------------------- //
-        interface.SetFunctionTypes(MOERTEL::Function::func_Linear1D,      // primal trace space
-                                   MOERTEL::Function::func_DualLinear1D); // dual mortar space (recommended)
-                                                                          //MOERTEL::Function::func_Linear1D);    // mortar space (not recommended)
-
-        // ------------------------------------------------------------- //
-        // complete the interface
-        // ------------------------------------------------------------- //
-        if (!interface.Complete())
-        {
-            cout << "Interface completion returned false\n";
-            exit(EXIT_FAILURE);
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Manager for 2D problems
-        // It organizes everything from integration to solution
-        // ------------------------------------------------------------- //
-        MOERTEL::Manager manager(Comm, printlevel);
-        manager.SetDimension(MOERTEL::Manager::manager_2D);
-
-        // ------------------------------------------------------------- //
-        // Add the interface to the manager
-        // ------------------------------------------------------------- //
-        manager.AddInterface(interface);
-
-        // ------------------------------------------------------------- //
-        // for mortar integration, the mortar manager needs to know about
-        // the rowmap of the original (uncoupled) problem because it will
-        // create coupling matrices D and M matching that rowmap
-        // ------------------------------------------------------------- //
-        manager.SetProblemMap(&Grid.RowMap());
-
-        // ============================================================= //
-        // choose integration parameters
-        // ============================================================= //
-        Teuchos::ParameterList &moertelparams = manager.Default_Parameters();
-        // this does not affect this 2D case
-        moertelparams.set("exact values at gauss points", true);
-        // 1D interface possible values are 1,2,3,4,5,6,7,8,10 (2 recommended with linear shape functions)
-        moertelparams.set("number gaussian points 1D", 2);
-        // 2D interface possible values are 3,6,12,13,16,19,27
-        moertelparams.set("number gaussian points 2D", 27);
-
-        // ============================================================= //
-        // Here we are done with the construction phase of the interface
-        // so we can integrate the mortar integrals
-        // (Note we have not yet evaluated the PDE at all!)
-        // ============================================================= //
-        manager.Mortar_Integrate();
-
-        // print interface information
-        // (Manager, Interface, Segment, Node implement the << operator)
-        if (printlevel)
-            cout << manager;
-
-        // ======================================================== //
-        // Prepares the linear system. This requires the definition //
-        // of a quadrature formula compatible with the grid, a      //
-        // variational formulation, and a problem object which take //
-        // care of filling matrix and right-hand side.              //
-        // NOTE:
-        // we are doing this AFTER we did all the mortar stuff to
-        // show that the mortar integration is actually PDE-independent
-        // ======================================================== //
-        Epetra_CrsMatrix A(Copy, Grid.RowMap(), 0);
-        Epetra_Vector LHS(Grid.RowMap(), true);
-        Epetra_Vector RHS(Grid.RowMap());
-
-        int NumQuadratureNodes = 3;
-
-        GalerkinVariational<TriangleQuadrature>
-            Laplace2D(NumQuadratureNodes, Diffusion, Source, Force,
-                      BoundaryValue, BoundaryType);
-
-        LinearProblem FiniteElementProblem(Grid, Laplace2D, A, LHS, RHS);
-        FiniteElementProblem.Compute();
-
-        // ============================================================= //
-        // this is Galeri's dense solve method if you'd like to see how
-        // the uncoupled solution looks like
-        // ============================================================= //
-        //Solve(&A, &LHS, &RHS);
-
-        // ============================================================= //
-        // Since we now have all the pieces together, let's use the
-        // MOERTEL interface to other Trilinos packages to solve the
-        // problem
-        // ============================================================= //
-
-        // ------------------------------------------------------------- //
-        // Create a Teuchos::ParameterList to hold solver arguments and also
-        // to hold arguments for connected packages AztecOO, ML and Amesos
-        // ------------------------------------------------------------- //
-        Teuchos::ParameterList list;
-
-        // ------------------------------------------------------------- //
-        // Choose which type of system of equations to generate
-        // Note that only when using DUAL mortar spaces an spd system
-        // can be generated
-        // ------------------------------------------------------------- //
-        //list.set("System","SaddleSystem");
-        list.set("System", "SPDSystem");
-
-        // ------------------------------------------------------------- //
-        // choose solver, currently there is a choice of Amesos and ML/AztecOO
-        // Note that if "SaddleSystem" was chosen as system of equations
-        // ML/AztecOO doesn't work
-        // ------------------------------------------------------------- //
-        list.set("Solver", "Amesos");
-        //list.set("Solver","ML/Aztec");
-
-        // ------------------------------------------------------------- //
-        // create sublists for packages Amesos, ML, AztecOO. they will be
-        // passed on to the individual package that is used
-        // ------------------------------------------------------------- //
-
-        // Amesos parameters:
-        Teuchos::ParameterList &amesosparams = list.sublist("Amesos");
-        amesosparams.set("Solver", "Amesos_Klu");
-        amesosparams.set("PrintTiming", true);
-        amesosparams.set("PrintStatus", true);
-        amesosparams.set("UseTranspose", true);
-
-        // AztecOO parameters
-        Teuchos::ParameterList &aztecparams = list.sublist("Aztec");
-        aztecparams.set("AZ_solver", "AZ_cg");
-        // This will involve ML as preconditioner
-        // See the AztecOO manual for other options
-        aztecparams.set("AZ_precond", "AZ_user_precond");
-        aztecparams.set("AZ_max_iter", 1200);
-        aztecparams.set("AZ_output", 100);
-        aztecparams.set("AZ_tol", 1.0e-7);
-        aztecparams.set("AZ_scaling", "AZ_none");
-
-        // ML parameters
-        // As Moertel comes with his own special mortar multigrid hierachy
-        // based on ML's smoothed aggregation, not all ML parameters are recognized
-        // It basically recognizes everything that recognized by ML's MLAPI
-        // (ML Application Programming Interface), see MLAPI documentation
-        Teuchos::ParameterList &mlparams = list.sublist("ML");
-        ML_Epetra::SetDefaults("SA", mlparams);
-        mlparams.set("output", 10);
-        mlparams.set("print unused", 1 /*-2*/);
-        mlparams.set("increasing or decreasing", "increasing");
-        mlparams.set("PDE equations", 1);
-        mlparams.set("max levels", 10);
-        mlparams.set("coarse: max size", 80);
-        mlparams.set("aggregation: type", "Uncoupled");
-        mlparams.set("aggregation: damping factor", 1.33);
-
-        // original   : The unmodified ML (smoothed) aggregation prolongator
-        // mod_simple : ( R * (I-B*W^T) )^T
-        // mod_middle : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T
-        // mod_full   : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T + ( R B*W^T*P * R * B*W^T )^T
-        mlparams.set("prolongator: type", "mod_middle");
-
-        // solvers/smoothers currently recognized by the MLAPI_InverseOperator are
-        // Ifpack:
-        //         "Jacobi" "Gauss-Seidel" "symmetric Gauss-Seidel"
-        //         "ILU" "ILUT" "IC" "ICT" "LU" "Amesos" "Amesos-KLU"
-        //         and accompanying parameters
-        // ML:
-        //         "MLS" "ML MLS" "ML symmetric Gauss-Seidel"
-        //         "ML Gauss-Seidel"
-        //         and accompanying parameters
-        mlparams.set("coarse: type", "Amesos-KLU");
-        mlparams.set("smoother: type", "symmetric Gauss-Seidel");
-        mlparams.set("smoother: MLS polynomial order", 3);
-        mlparams.set("relaxation: min diagonal value", 0.1);
-        mlparams.set("smoother: damping factor", 0.67);
-        mlparams.set("smoother: sweeps", 1);
-        mlparams.set("smoother: pre or post", "both");
-        // the ns for Laplace is the constant
-        int dimnullspace = 1;
-        int nummyrows = manager.ProblemMap()->NumMyElements();
-        int dimnsp = dimnullspace * nummyrows;
-        double *nsp = new double[dimnsp];
-        for (int i = 0; i < dimnsp; ++i)
-            nsp[i] = 1.;
-        mlparams.set("null space: type", "pre-computed");
-        mlparams.set("null space: add default vectors", false);
-        mlparams.set("null space: dimension", dimnullspace);
-        mlparams.set("null space: vectors", nsp);
-
-        // ------------------------------------------------------------- //
-        // Pass input matrix to Moertel,
-        // Moertel does NOT take ownership of A!
-        // ------------------------------------------------------------- //
-        manager.SetInputMatrix(&A, false);
-
-        // ============================================================= //
-        // Solve
-        // ============================================================= //
-        manager.Solve(list, LHS, RHS);
-
-        // ------------------------------------------------------------- //
-        // One can reset the solver, change parameters and/or matrix (with the
-        // same rowmap) and solve again if needed.
-        // If no ResetSolver() is called, the same matrix and preconditioner
-        // will be used to solve for multiple rhs
-        // ------------------------------------------------------------- //
-        //manager.ResetSolver();
-        //LHS.PutScalar(0.0);
-        //manager.SetInputMatrix(&A,false);
-        //manager.Solve(list,LHS,RHS);
-
-#ifdef MOERTEL_HAVE_EXODUS
-
-        // ==================    //
-        // Output using ExodusII //
-        // ==================    //
-        ExodusInterface exodus(Comm);
-        exodus.Write(Grid, "output", LHS);
-
-        std::cout << "Exodus is used for output" << std::endl;
-#endif
-    }
-    catch (int e)
-    {
-        cerr << "Caught exception, value = " << e << endl;
-        status = 1;
-    }
-    catch (Galeri::Exception &rhs)
-    {
-
-        cerr << "Caught Galeri exception: ";
-        rhs.Print();
-        status = 1;
-    }
-    catch (...)
-    {
-        cerr << "Caught generic exception" << endl;
-        status = 1;
-    }
-
-#ifdef HAVE_MPI
-    MPI_Finalize();
-#endif
-
-    if (status == 0)
-        std::cout << "\nTest passed!" << endl;
-    else
-        std::cout << "\nTest Failed!" << endl;
-
-    // Final return value (0 = successfull, non-zero = failure)
-
-    return status;
-}
diff --git a/tlnos/src/wExample6.h b/tlnos/src/wExample6.h
deleted file mode 100644
index 827b49fef1d1ab1e0989cdafd75177abc37f641a..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample6.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE6_H
-#define WEXAMPLE6_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example6 : public fwk::wObject
-{
-public:
-    Example6();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE6_H
diff --git a/tlnos/src/wExample7.cpp.disabled b/tlnos/src/wExample7.cpp.disabled
deleted file mode 100644
index 2f0af0ba7cce8c80f9a2e850c10347e52ab75c86..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample7.cpp.disabled
+++ /dev/null
@@ -1,509 +0,0 @@
-#include "wExample7.h"
-
-/*
-#@HEADER
-# ************************************************************************
-#
-#                          Moertel FE Package
-#                 Copyright (2006) Sandia Corporation
-#
-# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-# license for use of this work by or on behalf of the U.S. Government.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the Corporation nor the names of the
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Questions? Contact Glen Hansen (gahanse@sandia.gov)
-#
-# ************************************************************************
-#@HEADER
-*/
-/*!
- * \file TwoSquares.cpp
- *
- * \brief Simple serial example showing Moertel usage and solver interfaces
- *
- * \date Last update do Doxygen: 20-March-06
- *
- */
-#ifdef HAVE_MPI
-#include "mpi.h"
-#include "Epetra_MpiComm.h"
-#else
-#include "Epetra_SerialComm.h"
-#endif
-
-// MOERTEL headers
-#include "mrtr_manager.H"
-#include "mrtr_segment_bilinearquad.H"
-
-// Galeri headers
-#include "Galeri_Utils.h"
-#include "Galeri_FiniteElements.h"
-#ifdef MOERTEL_HAVE_EXODUS
-#include "ExodusInterface.h"
-#endif
-
-using namespace Galeri;
-using namespace Galeri::FiniteElements;
-
-// ==========================================================
-// This file solves the scalar problem
-//
-//   - \mu \nabla u + \sigma u = f    on \Omega
-//                           u = g    on \partial \Omega
-// 
-// where \Omega is a 2D rectangle, divided into triangles.
-// The input grid should be generated using similar 
-// conventions of file galeri/data/TwoSquares.m:
-// - the bc ID of 10 and 20 are for the mortar interface
-// - the bc ID of 0 is for the external domain.
-// ==========================================================
-
-double Diffusion7(const double& x, const double& y, const double& z)
-{
-  return (3.0);
-}
-
-double Source7(const double& x, const double& y, const double& z)
-{
-  return (0.0);
-}
-
-double Force7(const double& x, const double& y, const double& z)
-{
-  if (x <-6. || x > 1.)
-    return(5.0);
-  else
-    return(0.0);
-}
-
-// Specifies the boundary condition.
-int BoundaryType7(const int& Patch)
-{
-  if (Patch != 0)
-    return(GALERI_DO_NOTHING);
-  else
-    return(GALERI_DIRICHLET);
-}
-
-// Specifies the boundary condition.
-double BoundaryValue7(const double& x, const double& y, 
-                     const double& z, const int& Patch)
-{
-  return 0.0; 
-}
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace tlnos;
-
-Example7::Example7()
-{
-}
-
-
-int
-Example7::execute() 
-{
-#ifdef HAVE_MPI
-   static int  argc = 1;
-   char **argv = new char*[2];// mem leak volontaire
-   argv[0] = new char[8]; strcpy(argv[0], "myprog"); // mem leak volontaire
-   argv[1] = new char[1]; strcpy(argv[1], ""); // mem leak volontaire
-
-  MPI_Init(&argc,&argv);
-  Epetra_MpiComm Comm(MPI_COMM_WORLD);
-#else
-  Epetra_SerialComm Comm;
-#endif
-
-    // this example is in serial only
-    if (Comm.NumProc()>1) exit(0);
-
-    FileGrid Grid(Comm, "Hex_3D.grid");
-    
-    // create a list of all nodes that are linked to a face
-    // we have 4 interfaces here with each 2 sides:
-    // with tags 1/2, 11/12, 21/22, 31/32
-    const int ninter = 4;
-    vector<map<int,int> > nodes(ninter*2);
-    for (int i=0; i<Grid.NumMyBoundaryFaces(); ++i)
-    {
-      int tag;
-      int nodeids[4];
-      Grid.FaceVertices(i,tag,nodeids);
-      if (tag==1)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[0][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==2)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[1][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==11)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[2][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==12)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[3][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==21)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[4][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==22)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[5][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==31)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[6][nodeids[j]] = nodeids[j];
-      }
-      else if (tag==32)
-      {
-        for (int j=0; j<4; ++j)
-          nodes[7][nodeids[j]] = nodeids[j];
-      }
-      else 
-        continue;
-    }
-
-    // ------------------------------------------------------------- //
-    // create 4 empty MOERTEL::Interface instances
-    // ------------------------------------------------------------- //
-    int printlevel = 3; // ( moertel takes values 0 - 10 )
-    //int printlevel = 8; // ( moertel takes values 0 - 10 ) // GAH gives info about intersection root finding
-    vector<RefCountPtr<MOERTEL::Interface> > interfaces(ninter);
-    for (int i=0; i<ninter; ++i) 
-      interfaces[i] = rcp(new MOERTEL::Interface(i,false,Comm,printlevel));
-
-    // ------------------------------------------------------------- //
-    // Add nodes on both sides of interface to interfaces
-    // loop all nodes in the maps add them
-    // to the interface with unique ids
-    // ------------------------------------------------------------- //
-    for (int i=0; i<ninter; ++i)
-    {
-      map<int,int>::iterator curr;
-      for (int j=0; j<2; ++j)
-        for (curr = nodes[i*2+j].begin(); curr != nodes[i*2+j].end(); ++curr)
-        {
-          // get unique node id
-          int nodeid = curr->second;
-          // get node coordinates
-          double coord[3];
-          Grid.VertexCoord(nodeid,coord);
-          // create a moertel node
-          MOERTEL::Node node(nodeid,coord,1,&nodeid,false,printlevel);
-          // add node to interface i on side j
-          interfaces[i]->AddNode(node,j);
-        }
-    } 
-
-    // ------------------------------------------------------------- //
-    // add segments on both sides of the interface to the interface
-    // ------------------------------------------------------------- //
-    for (int i=0; i<Grid.NumMyBoundaryFaces(); ++i)
-    {
-      int tag;
-      int nodeids[4];
-      Grid.FaceVertices(i,tag,nodeids);
-      if (tag == 0)
-        continue;
-      // create a segment (galeri calls it a face)
-      MOERTEL::Segment_BiLinearQuad segment(i,4,nodeids,printlevel);
-      
-      if (tag==1)
-        interfaces[0]->AddSegment(segment,0);
-      else if (tag==2)
-        interfaces[0]->AddSegment(segment,1);
-      else if (tag==11)
-        interfaces[1]->AddSegment(segment,0);
-      else if (tag==12)
-        interfaces[1]->AddSegment(segment,1);
-      else if (tag==21)
-        interfaces[2]->AddSegment(segment,0);
-      else if (tag==22)
-        interfaces[2]->AddSegment(segment,1);
-      else if (tag==31)
-        interfaces[3]->AddSegment(segment,0);
-      else if (tag==32)
-        interfaces[3]->AddSegment(segment,1);
-      else
-      {
-        cout << "Face with unknown tag " << tag << endl;
-        exit(EXIT_FAILURE);
-      }
-    }
-
-    // ------------------------------------------------------------- //
-    // choose the mortar side of the interface (0 or 1)
-    // choose the finer side here, which is 0
-    // ------------------------------------------------------------- //
-    for (int i=0; i<ninter; ++i)
-      interfaces[i]->SetMortarSide(0);
-
-    // ------------------------------------------------------------- //
-    // As we do not know the mortar side yet (we decided to le the
-    // package choose it), we can not set a dual trace function (mortar space)
-    // as we don't know the side to set it to
-    // so we just give orders for the function type
-    // ------------------------------------------------------------- //
-    for (int i=0; i<ninter; ++i)
-      interfaces[i]->SetFunctionTypes(MOERTEL::Function::func_BiLinearQuad,       // primal trace space
-                                      MOERTEL::Function::func_DualBiLinearQuad);  // dual mortar space (recommended)
-                                      //MOERTEL::Function::func_BiLinearQuad);    // mortar space (not recommended)
-
-    // ------------------------------------------------------------- //
-    // complete the interfaces
-    // ------------------------------------------------------------- //
-    for (int i=0; i<ninter; ++i)
-      if (!interfaces[i]->Complete())
-      {
-         cout << "Interface " << i << " completion returned false\n";
-         exit(EXIT_FAILURE);
-      }
-
-    // ------------------------------------------------------------- //
-    // create an empty MOERTEL::Manager for 3D problems
-    // It organizes everything from integration to solution
-    // ------------------------------------------------------------- //
-    MOERTEL::Manager manager(Comm,MOERTEL::Manager::manager_3D,printlevel);
-    
-    // ------------------------------------------------------------- //
-    // Add the interfaces to the manager
-    // ------------------------------------------------------------- //
-    for (int i=0; i<ninter; ++i)
-      manager.AddInterface(*(interfaces[i]));
-
-    // ------------------------------------------------------------- //
-    // for mortar integration, the mortar manager needs to know about
-    // the rowmap of the original (uncoupled) problem because it will
-    // create coupling matrices D and M matching that rowmap
-    // ------------------------------------------------------------- //
-    manager.SetProblemMap(&Grid.RowMap());
-
-    // ============================================================= //
-    // choose integration parameters
-    // ============================================================= //
-    Teuchos::ParameterList& moertelparams = manager.Default_Parameters();
-    // this does affect this 3D case only
-    moertelparams.set("exact values at gauss points",true);
-    // 1D interface possible values are 1,2,3,4,5,6,7,8,10 (2 recommended with linear shape functions)
-    moertelparams.set("number gaussian points 1D",2);
-    // 2D interface possible values are 3,6,12,13,16,19,27 (12 recommended with linear functions)
-    moertelparams.set("number gaussian points 2D",12);
-
-    // ============================================================= //
-    // Here we are done with the construction phase of the interface
-    // so we can integrate the mortar integrals
-    // (Note we have not yet evaluated the PDE at all!)
-    // ============================================================= //
-    manager.Mortar_Integrate();
-    
-    // print interface information
-    // (Manager, Interface, Segment, Node implement the << operator)
-    if (printlevel) cout << manager;
-    
-    cout << "A" << endl;
-        
-    // ======================================================== //
-    // Prepares the linear system. This requires the definition //
-    // of a quadrature formula compatible with the grid, a      //
-    // variational formulation, and a problem object which take //
-    // care of filling matrix and right-hand side.              //
-    // NOTE:
-    // we are doing this AFTER we did all the mortar stuff to
-    // show that the mortar integration is actually PDE-independent
-    // ======================================================== //
-    Epetra_CrsMatrix A(Copy, Grid.RowMap(), 0);
-    Epetra_Vector    LHS(Grid.RowMap(),true);
-    Epetra_Vector    RHS(Grid.RowMap());
-
-    int NumQuadratureNodes = 8;
-
-    GalerkinVariational<HexQuadrature>
-      Laplace3D(NumQuadratureNodes, Diffusion7, Source7, Force7, 
-                BoundaryValue7, BoundaryType7);
-
-    LinearProblem FiniteElementProblem(Grid, Laplace3D, A, LHS, RHS); 
-    FiniteElementProblem.Compute();
-
-    // ============================================================= //
-    // this is Galeri's dense solve method if you'd like to see how
-    // the uncoupled solution looks like
-    // ============================================================= //
-    //Solve(&A, &LHS, &RHS);
-
-    // ============================================================= //
-    // Since we now have all the pieces together, let's use the 
-    // MOERTEL interface to other Trilinos packages to solve the
-    // problem
-    // ============================================================= //
-    
-    // ------------------------------------------------------------- //
-    // Create a Teuchos::ParameterList to hold solver arguments and also
-    // to hold arguments for connected packages AztecOO, ML and Amesos
-    // ------------------------------------------------------------- //
-    Teuchos::ParameterList list;
-    
-    // ------------------------------------------------------------- //
-    // Choose which type of system of equations to generate
-    // Note that only when using DUAL mortar spaces an spd system 
-    // can be generated
-    // ------------------------------------------------------------- //
-    //list.set("System","SaddleSystem");
-    list.set("System","SPDSystem");
-    
-    // ------------------------------------------------------------- //
-    // choose solver, currently there is a choice of Amesos and ML/AztecOO
-    // Note that if "SaddleSystem" was chosen as system of equations
-    // ML/AztecOO doesn't work
-    // ------------------------------------------------------------- //
-    list.set("Solver","Amesos");
-    //list.set("Solver","ML/Aztec"); // GAH Aztec not working FIX
-    
-    // ------------------------------------------------------------- //
-    // create sublists for packages Amesos, ML, AztecOO. they will be
-    // passed on to the individual package that is used
-    // ------------------------------------------------------------- //
-
-    // Amesos parameters:
-    Teuchos::ParameterList& amesosparams = list.sublist("Amesos");
-    amesosparams.set("Solver","Amesos_Klu");
-    amesosparams.set("PrintTiming",true);
-    amesosparams.set("PrintStatus",true);
-    amesosparams.set("UseTranspose",true);
-    
-    // AztecOO parameters
-    Teuchos::ParameterList& aztecparams = list.sublist("Aztec");
-    aztecparams.set("AZ_solver","AZ_cg");
-    // This will involve ML as preconditioner
-    // See the AztecOO manual for other options
-    aztecparams.set("AZ_precond","AZ_user_precond");
-    aztecparams.set("AZ_max_iter",1200);
-    aztecparams.set("AZ_output",100);
-    aztecparams.set("AZ_tol",1.0e-7);
-    aztecparams.set("AZ_scaling","AZ_none");
-
-        cout << "A" << endl;
-    // ML parameters
-    // As Moertel comes with his own special mortar multigrid hierachy
-    // based on ML's smoothed aggregation, not all ML parameters are recognized
-    // It basically recognizes everything that recognized by ML's MLAPI
-    // (ML Application Programming Interface), see MLAPI documentation
-    Teuchos::ParameterList& mlparams = list.sublist("ML");
-    ML_Epetra::SetDefaults("SA",mlparams);
-    mlparams.set("output",10);
-    mlparams.set("print unused",1/*-2*/);
-    mlparams.set("PDE equations",1);
-    mlparams.set("max levels",10);
-    mlparams.set("coarse: max size",500);
-    mlparams.set("aggregation: type","Uncoupled");
-    mlparams.set("aggregation: damping factor",1.33);
-
-    // original   : The unmodified ML (smoothed) aggregation prolongator
-    // mod_simple : ( R * (I-B*W^T) )^T
-    // mod_middle : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T
-    // mod_full   : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T + ( R B*W^T*P * R * B*W^T )^T
-    mlparams.set("prolongator: type","mod_full"); 
-
-    // solvers/smoothers currently recognized by the MLAPI_InverseOperator are
-    // Ifpack:
-    //         "Jacobi" "Gauss-Seidel" "symmetric Gauss-Seidel"
-    //         "ILU" "ILUT" "IC" "ICT" "LU" "Amesos" "Amesos-KLU"
-    //         and accompanying parameters as listed
-    // ML:
-    //         "MLS" "ML MLS" "ML symmetric Gauss-Seidel"
-    //         "ML Gauss-Seidel" "ML Jacobi"
-    //         and accompanying parameters as listed
-    mlparams.set("coarse: type","Amesos-KLU"); 
-    mlparams.set("smoother: type","symmetric Gauss-Seidel"); 
-    mlparams.set("smoother: MLS polynomial order",3);
-    mlparams.set("smoother: damping factor",0.67);
-    mlparams.set("smoother: sweeps",1);
-    mlparams.set("smoother: pre or post","both");
-    // the ns for Laplace is the constant
-    int dimnullspace = 1;
-    int nummyrows = manager.ProblemMap()->NumMyElements();
-    int dimnsp    = dimnullspace*nummyrows;
-    double* nsp   = new double[dimnsp];
-    for (int i=0; i<dimnsp; ++i) nsp[i] = 1.;
-    mlparams.set("null space: type","pre-computed");
-    mlparams.set("null space: add default vectors",false);
-    mlparams.set("null space: dimension",dimnullspace);
-    mlparams.set("null space: vectors",nsp);
-        
-    // ------------------------------------------------------------- //
-    // Pass input matrix to Moertel, 
-    // Moertel does NOT take ownership of A!
-    // ------------------------------------------------------------- //
-    manager.SetInputMatrix(&A,false);
-    
-    // ============================================================= //
-    // Solve
-    // ============================================================= //
-    manager.Solve(list,LHS,RHS);
-
-    // ------------------------------------------------------------- //
-    // One can reset the solver, change parameters and/or matrix (with the
-    // same rowmap) and solve again if needed.
-    // If no ResetSolver() is called, the same matrix and preconditioner
-    // will be used to solve for multiple rhs
-    // ------------------------------------------------------------- //
-    //manager.ResetSolver();
-    //LHS.PutScalar(0.0);
-    //manager.SetInputMatrix(&A,false);
-    //manager.Solve(list,LHS,RHS);
-	
-
-    // ==================    //
-    // Output using ExodusII //
-    // ==================    //
-#ifdef MOERTEL_HAVE_EXODUS
-    ExodusInterface exodus(Comm);
-    exodus.Write(Grid, "hex_output", LHS);
-#endif
-	
-
-#ifdef HAVE_MPI
-  MPI_Finalize();
-#endif
-
-  return(0);
-}
diff --git a/tlnos/src/wExample7.h.disabled b/tlnos/src/wExample7.h.disabled
deleted file mode 100644
index a15a1198eba179248647171c4610fcc7389a6a7a..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample7.h.disabled
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE7_H
-#define WEXAMPLE7_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos {
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example7 : public fwk::wObject
-{
-public:
-    Example7();
-    int execute(); 
-    
-};
-
-}
-
-#endif //WEXAMPLE7_H
diff --git a/tlnos/src/wExample8.cpp b/tlnos/src/wExample8.cpp
deleted file mode 100644
index 00dec2fe612aa9c84d765492c386540d36cc333a..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample8.cpp
+++ /dev/null
@@ -1,570 +0,0 @@
-#include "wExample8.h"
-/*
-#@HEADER
-# ************************************************************************
-#
-#                          Moertel FE Package
-#                 Copyright (2006) Sandia Corporation
-#
-# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-# license for use of this work by or on behalf of the U.S. Government.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the Corporation nor the names of the
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Questions? Contact Glen Hansen (gahanse@sandia.gov)
-#
-# ************************************************************************
-#@HEADER
-*/
-/*!
- * \file TwoSquares.cpp
- *
- * \brief Simple serial example showing Moertel usage and solver interfaces
- *
- * \date Last update do Doxygen: 20-March-06
- *
- */
-#ifdef HAVE_MPI
-#include "mpi.h"
-#include "Epetra_MpiComm.h"
-#else
-#include "Epetra_SerialComm.h"
-#endif
-
-// MOERTEL headers
-#include "mrtr_manager.H"
-#include "mrtr_segment_linear1D.H"
-
-// Galeri headers
-#include "Galeri_Utils.h"
-#include "Galeri_FiniteElements.h"
-
-#ifdef MOERTEL_HAVE_EXODUS
-#include "ExodusInterface.h"
-#endif
-
-using namespace Galeri;
-using namespace Galeri::FiniteElements;
-
-// ==========================================================
-// This file solves the scalar problem
-//
-//   - \mu \nabla u + \sigma u = f    on \Omega
-//                           u = g    on \partial \Omega
-//
-// where \Omega is a 2D rectangle, divided into triangles.
-// The input grid should be generated using similar
-// conventions of file galeri/data/TwoSquares.m:
-// - the bc ID of 10 and 20 are for the mortar interface
-// - the bc ID of 0 is for the external domain.
-// ==========================================================
-
-double Diffusion8(const double &x, const double &y, const double &z)
-{
-    return (1.0);
-}
-
-double Source8(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-double Force8(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-// Specifies the boundary condition.
-int BoundaryType8(const int &Patch)
-{
-    if (Patch == 11 || Patch == 12)
-        return (GALERI_DIRICHLET);
-    else
-        return (GALERI_DO_NOTHING);
-}
-
-// Specifies the boundary condition.
-double BoundaryValue8(const double &x, const double &y,
-                      const double &z, const int &Patch)
-{
-    if (Patch == 11 || Patch == 12)
-        return (-y / 4.0 + 0.75);
-    else
-        return (1.0);
-}
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace tlnos;
-
-Example8::Example8()
-{
-}
-
-int Example8::execute()
-{
-#ifdef HAVE_MPI
-    /*
-   static int  argc = 1;
-   char **argv = new char*[2];// mem leak volontaire
-   argv[0] = new char[8]; strcpy(argv[0], "myprog"); // mem leak volontaire
-   argv[1] = new char[1]; strcpy(argv[1], ""); // mem leak volontaire
-
-  MPI_Init(&argc,&argv);
-  */
-    Epetra_MpiComm Comm(MPI_COMM_WORLD);
-#else
-    Epetra_SerialComm Comm;
-#endif
-
-    int status = 0; // return status
-
-    try
-    {
-
-        // this example is in serial only
-        if (Comm.NumProc() > 1)
-            exit(0);
-
-        // read grid from file, see also TwoSquares.m used to generate the grids
-        /*
-    %  +------+
-    %  |  S2  |
-    %  +------+ <- edge has tag 20 and 9 elements
-    %  +------+ <- edge has tag 10 and 10 elements
-    %  |  S1  |
-    %  +------+
-    %
-    % where S1 = (-1,1) x (-1,1) and S2 = (-1, 1) x (1, 3).
-    */
-
-        FileGrid Grid(Comm, "TwoSquaresDirichlet.grid");
-
-        // create a list of all nodes that are linked to a face
-        // with tag 10 and tag 20
-        map<int, int> nodes10;
-        map<int, int> nodes20;
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag == 10)
-            {
-                nodes10[nodeids[0]] = nodeids[0];
-                nodes10[nodeids[1]] = nodeids[1];
-            }
-            else if (tag == 20)
-            {
-                nodes20[nodeids[0]] = nodeids[0];
-                nodes20[nodeids[1]] = nodeids[1];
-            }
-            else
-                continue;
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Interface, in this example just one
-        // ------------------------------------------------------------- //
-        int printlevel = 0; // ( moertel takes values 0 - 10 )
-        //int printlevel = 9; // ( moertel takes values 0 - 10 )
-        MOERTEL::Interface interface(0, true, Comm, printlevel);
-
-        // ------------------------------------------------------------- //
-        // Add nodes on both sides of interface to interface
-        // loop all nodes in the maps nodes10 and nodes20 and add them
-        // to the interface with unique ids
-        // tag 10 will become interface side 0
-        // tag 20 will become interface side 1
-        // ------------------------------------------------------------- //
-        map<int, int>::iterator curr;
-        // do tag==10 or interface side 0
-        for (curr = nodes10.begin(); curr != nodes10.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue8(coord[0], coord[1], coord[2], 10);
-            bool dboundary = false;
-            if (bou == 0.0)
-            {
-                dboundary = true;
-                std::cout << "hi" << std::endl;
-            }
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 0
-            interface.AddNode(node, 0);
-        }
-        nodes10.clear();
-
-        // do tag==20 or interface side 1
-        for (curr = nodes20.begin(); curr != nodes20.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue8(coord[0], coord[1], coord[2], 20);
-            bool dboundary = false;
-            if (bou == 0.0)
-            {
-                dboundary = true;
-                std::cout << "hi" << std::endl;
-            }
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 1
-            interface.AddNode(node, 1);
-        }
-        nodes20.clear();
-
-        // ------------------------------------------------------------- //
-        // add segments on both sides of the interface to the interface
-        // ------------------------------------------------------------- //
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag != 10 && tag != 20)
-                continue;
-            // create a segment (galeri calls it a face)
-            MOERTEL::Segment_Linear1D segment(i, 2, nodeids, printlevel);
-
-            // add it to the interface on side 0
-            if (tag == 10)
-                interface.AddSegment(segment, 0);
-            // add it to the interface on side 1
-            else if (tag == 20)
-                interface.AddSegment(segment, 1);
-        }
-
-        // ------------------------------------------------------------- //
-        // choose the mortar side of the interface (0 or 1)
-        // here: let the package choose it (-2)
-        // ------------------------------------------------------------- //
-        interface.SetMortarSide(-2);
-
-        // ------------------------------------------------------------- //
-        // As we do not know the mortar side yet (we decided to le the
-        // package choose it), we can not set a dual trace function (mortar space)
-        // as we don't know the side to set it to
-        // so we just give orders for the function type
-        // ------------------------------------------------------------- //
-        interface.SetFunctionTypes(MOERTEL::Function::func_Linear1D,      // primal trace space
-                                   MOERTEL::Function::func_DualLinear1D); // dual mortar space (recommended)
-                                                                          //MOERTEL::Function::func_Linear1D);    // mortar space (not recommended)
-
-        // ------------------------------------------------------------- //
-        // complete the interface
-        // ------------------------------------------------------------- //
-        if (!interface.Complete())
-        {
-            cout << "Interface completion returned false\n";
-            exit(EXIT_FAILURE);
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Manager for 2D problems
-        // It organizes everything from integration to solution
-        // ------------------------------------------------------------- //
-        MOERTEL::Manager manager(Comm, printlevel);
-        manager.SetDimension(MOERTEL::Manager::manager_2D);
-
-        // ------------------------------------------------------------- //
-        // Add the interface to the manager
-        // ------------------------------------------------------------- //
-        manager.AddInterface(interface);
-
-        // ------------------------------------------------------------- //
-        // for mortar integration, the mortar manager needs to know about
-        // the rowmap of the original (uncoupled) problem because it will
-        // create coupling matrices D and M matching that rowmap
-        // ------------------------------------------------------------- //
-        manager.SetProblemMap(&Grid.RowMap());
-
-        // ============================================================= //
-        // choose integration parameters
-        // ============================================================= //
-        Teuchos::ParameterList &moertelparams = manager.Default_Parameters();
-        // this does not affect this 2D case
-        moertelparams.set("exact values at gauss points", true);
-        // 1D interface possible values are 1,2,3,4,5,6,7,8,10 (2 recommended with linear shape functions)
-        moertelparams.set("number gaussian points 1D", 2);
-        // 2D interface possible values are 3,6,12,13,16,19,27
-        moertelparams.set("number gaussian points 2D", 27);
-
-        // ============================================================= //
-        // Here we are done with the construction phase of the interface
-        // so we can integrate the mortar integrals
-        // (Note we have not yet evaluated the PDE at all!)
-        // ============================================================= //
-        manager.Mortar_Integrate();
-
-        // print interface information
-        // (Manager, Interface, Segment, Node implement the << operator)
-        if (printlevel)
-            cout << manager;
-
-        // ======================================================== //
-        // Prepares the linear system. This requires the definition //
-        // of a quadrature formula compatible with the grid, a      //
-        // variational formulation, and a problem object which take //
-        // care of filling matrix and right-hand side.              //
-        // NOTE:
-        // we are doing this AFTER we did all the mortar stuff to
-        // show that the mortar integration is actually PDE-independent
-        // ======================================================== //
-        Epetra_CrsMatrix A(Copy, Grid.RowMap(), 0);
-        Epetra_Vector LHS(Grid.RowMap(), true);
-        Epetra_Vector RHS(Grid.RowMap());
-
-        int NumQuadratureNodes = 3;
-
-        GalerkinVariational<TriangleQuadrature>
-            Laplace2D(NumQuadratureNodes, Diffusion8, Source8, Force8,
-                      BoundaryValue8, BoundaryType8);
-
-        LinearProblem FiniteElementProblem(Grid, Laplace2D, A, LHS, RHS);
-        FiniteElementProblem.Compute();
-
-        // ============================================================= //
-        // this is Galeri's dense solve method if you'd like to see how
-        // the uncoupled solution looks like
-        // ============================================================= //
-        Solve(&A, &LHS, &RHS);
-#ifdef MOERTEL_HAVE_EXODUS
-        ExodusInterface exodus(Comm);
-        exodus.Write(Grid, "output", LHS);
-#endif
-        std::cout << "Exodus is used for output" << std::endl;
-
-        std::cout << A << std::endl;
-        std::cout << RHS << std::endl;
-        std::cout << LHS << std::endl;
-        // ============================================================= //
-        // Since we now have all the pieces together, let's use the
-        // MOERTEL interface to other Trilinos packages to solve the
-        // problem
-        // ============================================================= //
-
-        // ------------------------------------------------------------- //
-        // Create a Teuchos::ParameterList to hold solver arguments and also
-        // to hold arguments for connected packages AztecOO, ML and Amesos
-        // ------------------------------------------------------------- //
-        Teuchos::ParameterList list;
-
-        // ------------------------------------------------------------- //
-        // Choose which type of system of equations to generate
-        // Note that only when using DUAL mortar spaces an spd system
-        // can be generated
-        // ------------------------------------------------------------- //
-        //list.set("System","SaddleSystem");
-        list.set("System", "SPDSystem");
-
-        // ------------------------------------------------------------- //
-        // choose solver, currently there is a choice of Amesos and ML/AztecOO
-        // Note that if "SaddleSystem" was chosen as system of equations
-        // ML/AztecOO doesn't work
-        // ------------------------------------------------------------- //
-        list.set("Solver", "Amesos");
-        //list.set("Solver","ML/Aztec");
-
-        // ------------------------------------------------------------- //
-        // create sublists for packages Amesos, ML, AztecOO. they will be
-        // passed on to the individual package that is used
-        // ------------------------------------------------------------- //
-
-        // Amesos parameters:
-        Teuchos::ParameterList &amesosparams = list.sublist("Amesos");
-        amesosparams.set("Solver", "Amesos_Klu");
-        amesosparams.set("PrintTiming", true);
-        amesosparams.set("PrintStatus", true);
-        amesosparams.set("UseTranspose", true);
-
-        // AztecOO parameters
-        Teuchos::ParameterList &aztecparams = list.sublist("Aztec");
-        aztecparams.set("AZ_solver", "AZ_cg");
-        // This will involve ML as preconditioner
-        // See the AztecOO manual for other options
-        aztecparams.set("AZ_precond", "AZ_user_precond");
-        aztecparams.set("AZ_max_iter", 1200);
-        aztecparams.set("AZ_output", 100);
-        aztecparams.set("AZ_tol", 1.0e-7);
-        aztecparams.set("AZ_scaling", "AZ_none");
-
-        // ML parameters
-        // As Moertel comes with his own special mortar multigrid hierachy
-        // based on ML's smoothed aggregation, not all ML parameters are recognized
-        // It basically recognizes everything that recognized by ML's MLAPI
-        // (ML Application Programming Interface), see MLAPI documentation
-        Teuchos::ParameterList &mlparams = list.sublist("ML");
-        ML_Epetra::SetDefaults("SA", mlparams);
-        mlparams.set("output", 10);
-        mlparams.set("print unused", 1 /*-2*/);
-        mlparams.set("increasing or decreasing", "increasing");
-        mlparams.set("PDE equations", 1);
-        mlparams.set("max levels", 10);
-        mlparams.set("coarse: max size", 80);
-        mlparams.set("aggregation: type", "Uncoupled");
-        mlparams.set("aggregation: damping factor", 1.33);
-
-        // original   : The unmodified ML (smoothed) aggregation prolongator
-        // mod_simple : ( R * (I-B*W^T) )^T
-        // mod_middle : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T
-        // mod_full   : ( (I - R B*W^T*P) * R * (I-B*W^T) )^T + ( R B*W^T*P * R * B*W^T )^T
-        mlparams.set("prolongator: type", "mod_middle");
-
-        // solvers/smoothers currently recognized by the MLAPI_InverseOperator are
-        // Ifpack:
-        //         "Jacobi" "Gauss-Seidel" "symmetric Gauss-Seidel"
-        //         "ILU" "ILUT" "IC" "ICT" "LU" "Amesos" "Amesos-KLU"
-        //         and accompanying parameters
-        // ML:
-        //         "MLS" "ML MLS" "ML symmetric Gauss-Seidel"
-        //         "ML Gauss-Seidel"
-        //         and accompanying parameters
-        mlparams.set("coarse: type", "Amesos-KLU");
-        mlparams.set("smoother: type", "symmetric Gauss-Seidel");
-        mlparams.set("smoother: MLS polynomial order", 3);
-        mlparams.set("relaxation: min diagonal value", 0.1);
-        mlparams.set("smoother: damping factor", 0.67);
-        mlparams.set("smoother: sweeps", 1);
-        mlparams.set("smoother: pre or post", "both");
-        // the ns for Laplace is the constant
-        int dimnullspace = 1;
-        int nummyrows = manager.ProblemMap()->NumMyElements();
-        int dimnsp = dimnullspace * nummyrows;
-        double *nsp = new double[dimnsp];
-        for (int i = 0; i < dimnsp; ++i)
-            nsp[i] = 1.;
-        mlparams.set("null space: type", "pre-computed");
-        mlparams.set("null space: add default vectors", false);
-        mlparams.set("null space: dimension", dimnullspace);
-        mlparams.set("null space: vectors", nsp);
-
-        // ------------------------------------------------------------- //
-        // Pass input matrix to Moertel,
-        // Moertel does NOT take ownership of A!
-        // ------------------------------------------------------------- //
-        manager.SetInputMatrix(&A, false);
-
-        // ============================================================= //
-        // Solve
-        // ============================================================= //
-        manager.Solve(list, LHS, RHS);
-
-        std::cout << A << std::endl;
-        std::cout << RHS << std::endl;
-        std::cout << LHS << std::endl;
-
-        std::cout << manager << std::endl;
-
-        Epetra_CrsMatrix *B = manager.MakeSaddleProblem();
-
-        std::cout << A << std::endl;
-        std::cout << *B << std::endl;
-
-        std::cout << B->NumGlobalRows() << std::endl;
-        std::cout << B->NumGlobalCols() << std::endl;
-
-        Epetra_Vector LHS2(B->RowMap(), true);
-        Epetra_Vector LHS3(A.RowMap(), true);
-        Epetra_Vector RHS2(B->RowMap());
-
-        for (size_t i = 0; i < A.NumGlobalRows(); ++i)
-            RHS2[i] = RHS[i];
-
-        Solve(B, &LHS2, &RHS2);
-        for (size_t i = 0; i < A.NumGlobalRows(); ++i)
-            LHS3[i] = LHS2[i];
-#ifdef MOERTEL_HAVE_EXODUS
-        exodus.Write(Grid, "output3", LHS3);
-#endif
-        // ------------------------------------------------------------- //
-        // One can reset the solver, change parameters and/or matrix (with the
-        // same rowmap) and solve again if needed.
-        // If no ResetSolver() is called, the same matrix and preconditioner
-        // will be used to solve for multiple rhs
-        // ------------------------------------------------------------- //
-        //manager.ResetSolver();
-        //LHS.PutScalar(0.0);
-        //manager.SetInputMatrix(&A,false);
-        //manager.Solve(list,LHS,RHS);
-
-#ifdef MOERTEL_HAVE_EXODUS
-
-        // ==================    //
-        // Output using ExodusII //
-        // ==================    //
-        //ExodusInterface exodus(Comm);
-        exodus.Write(Grid, "output2", LHS);
-
-        std::cout << "Exodus is used for output" << std::endl;
-
-#endif
-    }
-    catch (int e)
-    {
-        cerr << "Caught exception, value = " << e << endl;
-        status = 1;
-    }
-    catch (Galeri::Exception &rhs)
-    {
-
-        cerr << "Caught Galeri exception: ";
-        rhs.Print();
-        status = 1;
-    }
-    catch (...)
-    {
-        cerr << "Caught generic exception" << endl;
-        status = 1;
-    }
-
-#ifdef HAVE_MPI
-    MPI_Finalize();
-#endif
-
-    if (status == 0)
-        std::cout << "\nTest passed!" << endl;
-    else
-        std::cout << "\nTest Failed!" << endl;
-
-    // Final return value (0 = successfull, non-zero = failure)
-
-    return status;
-}
diff --git a/tlnos/src/wExample8.h b/tlnos/src/wExample8.h
deleted file mode 100644
index 2bae4e6fa833bcc9f8b327bce922f81c2ad464f7..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample8.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE8_H
-#define WEXAMPLE8_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example8 : public fwk::wObject
-{
-public:
-    Example8();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPLE8_H
diff --git a/tlnos/src/wExample9.cpp b/tlnos/src/wExample9.cpp
deleted file mode 100644
index 378d809ae832b17bc76dc93f05370a8dbab0f542..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample9.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-#include "wExample9.h"
-/*
-#@HEADER
-# ************************************************************************
-#
-#                          Moertel FE Package
-#                 Copyright (2006) Sandia Corporation
-#
-# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-# license for use of this work by or on behalf of the U.S. Government.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the Corporation nor the names of the
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Questions? Contact Glen Hansen (gahanse@sandia.gov)
-#
-# ************************************************************************
-#@HEADER
-*/
-/*!
- * \file TwoSquares.cpp
- *
- * \brief Simple serial example showing Moertel usage and solver interfaces
- *
- * \date Last update do Doxygen: 20-March-06
- *
- */
-#ifdef HAVE_MPI
-#include "mpi.h"
-#include "Epetra_MpiComm.h"
-#else
-#include "Epetra_SerialComm.h"
-#endif
-
-// MOERTEL headers
-#include "mrtr_manager.H"
-#include "mrtr_segment_linear1D.H"
-
-// Galeri headers
-#include "Galeri_Utils.h"
-#include "Galeri_FiniteElements.h"
-#ifdef MOERTEL_HAVE_EXODUS
-#include "ExodusInterface.h"
-#endif
-using namespace Galeri;
-using namespace Galeri::FiniteElements;
-
-// ==========================================================
-// This file solves the scalar problem
-//
-//   - \mu \nabla u + \sigma u = f    on \Omega
-//                           u = g    on \partial \Omega
-//
-// where \Omega is a 2D rectangle, divided into triangles.
-// The input grid should be generated using similar
-// conventions of file galeri/data/TwoSquares.m:
-// - the bc ID of 10 and 20 are for the mortar interface
-// - the bc ID of 0 is for the external domain.
-// ==========================================================
-
-double Diffusion9(const double &x, const double &y, const double &z)
-{
-    return (1.0);
-}
-
-double Source9(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-double Force9(const double &x, const double &y, const double &z)
-{
-    return (0.0);
-}
-
-// Specifies the boundary condition.
-int BoundaryType9(const int &Patch)
-{
-    if (Patch == 11 || Patch == 12)
-        return (GALERI_DIRICHLET);
-    else
-        return (GALERI_DO_NOTHING);
-}
-
-// Specifies the boundary condition.
-double BoundaryValue9(const double &x, const double &y,
-                      const double &z, const int &Patch)
-{
-    if (Patch == 11 || Patch == 12)
-        return (-y / 4.0 + 0.75);
-    else
-        return (1.0);
-}
-
-// =========== //
-// main driver //
-// =========== //
-
-using namespace tlnos;
-
-Example9::Example9()
-{
-}
-
-int Example9::execute()
-{
-#ifdef HAVE_MPI
-    /*
-   static int  argc = 1;
-   char **argv = new char*[2];// mem leak volontaire
-   argv[0] = new char[8]; strcpy(argv[0], "myprog"); // mem leak volontaire
-   argv[1] = new char[1]; strcpy(argv[1], ""); // mem leak volontaire
-  MPI_Init(&argc,&argv);
-*/
-
-    Epetra_MpiComm Comm(MPI_COMM_WORLD);
-#else
-    Epetra_SerialComm Comm;
-#endif
-
-    int status = 0; // return status
-
-    try
-    {
-
-        // this example is in serial only
-        if (Comm.NumProc() > 1)
-            exit(0);
-
-        // read grid from file, see also TwoSquares.m used to generate the grids
-        /*
-    %  +------+
-    %  |  S2  |
-    %  +------+ <- edge has tag 20 and 9 elements
-    %  +------+ <- edge has tag 10 and 10 elements
-    %  |  S1  |
-    %  +------+
-    %
-    % where S1 = (-1,1) x (-1,1) and S2 = (-1, 1) x (1, 3).
-    */
-
-        FileGrid Grid(Comm, "TwoSquaresDirichlet.grid");
-
-        // create a list of all nodes that are linked to a face
-        // with tag 10 and tag 20
-        map<int, int> nodes10;
-        map<int, int> nodes20;
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag == 10)
-            {
-                nodes10[nodeids[0]] = nodeids[0];
-                nodes10[nodeids[1]] = nodeids[1];
-            }
-            else if (tag == 20)
-            {
-                nodes20[nodeids[0]] = nodeids[0];
-                nodes20[nodeids[1]] = nodeids[1];
-            }
-            else
-                continue;
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Interface, in this example just one
-        // ------------------------------------------------------------- //
-        int printlevel = 0; // ( moertel takes values 0 - 10 )
-        //int printlevel = 9; // ( moertel takes values 0 - 10 )
-        MOERTEL::Interface interface(0, true, Comm, printlevel);
-
-        // ------------------------------------------------------------- //
-        // Add nodes on both sides of interface to interface
-        // loop all nodes in the maps nodes10 and nodes20 and add them
-        // to the interface with unique ids
-        // tag 10 will become interface side 0
-        // tag 20 will become interface side 1
-        // ------------------------------------------------------------- //
-        map<int, int>::iterator curr;
-        // do tag==10 or interface side 0
-        for (curr = nodes10.begin(); curr != nodes10.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue9(coord[0], coord[1], coord[2], 10);
-            bool dboundary = false;
-            if (bou == 0.0)
-            {
-                dboundary = true;
-                std::cout << "hi" << std::endl;
-            }
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 0
-            interface.AddNode(node, 0);
-        }
-        nodes10.clear();
-
-        // do tag==20 or interface side 1
-        for (curr = nodes20.begin(); curr != nodes20.end(); ++curr)
-        {
-            // get unique node id (here it's equal to the degree of freedom on that node)
-            int nodeid = curr->second;
-            // get node coordinates
-            double coord[3];
-            Grid.VertexCoord(nodeid, coord);
-            // get dirichlet boundary conditions
-            double bou = BoundaryValue9(coord[0], coord[1], coord[2], 20);
-            bool dboundary = false;
-            if (bou == 0.0)
-            {
-                dboundary = true;
-                std::cout << "hi" << std::endl;
-            }
-            // create a moertel node
-            MOERTEL::Node node(nodeid, coord, 1, &nodeid, dboundary, printlevel);
-            // add node to the interface on side 1
-            interface.AddNode(node, 1);
-        }
-        nodes20.clear();
-
-        // ------------------------------------------------------------- //
-        // add segments on both sides of the interface to the interface
-        // ------------------------------------------------------------- //
-        for (int i = 0; i < Grid.NumMyBoundaryFaces(); ++i)
-        {
-            int tag;
-            int nodeids[2];
-            Grid.FaceVertices(i, tag, nodeids);
-            if (tag != 10 && tag != 20)
-                continue;
-            // create a segment (galeri calls it a face)
-            MOERTEL::Segment_Linear1D segment(i, 2, nodeids, printlevel);
-
-            // add it to the interface on side 0
-            if (tag == 10)
-                interface.AddSegment(segment, 0);
-            // add it to the interface on side 1
-            else if (tag == 20)
-                interface.AddSegment(segment, 1);
-        }
-
-        // ------------------------------------------------------------- //
-        // choose the mortar side of the interface (0 or 1)
-        // here: let the package choose it (-2)
-        // ------------------------------------------------------------- //
-        interface.SetMortarSide(-2);
-
-        // ------------------------------------------------------------- //
-        // As we do not know the mortar side yet (we decided to le the
-        // package choose it), we can not set a dual trace function (mortar space)
-        // as we don't know the side to set it to
-        // so we just give orders for the function type
-        // ------------------------------------------------------------- //
-        interface.SetFunctionTypes(MOERTEL::Function::func_Linear1D, // primal trace space
-                                   //MOERTEL::Function::func_DualLinear1D);  // dual mortar space (recommended)
-                                   MOERTEL::Function::func_Linear1D); // mortar space (not recommended)
-
-        // ------------------------------------------------------------- //
-        // complete the interface
-        // ------------------------------------------------------------- //
-        if (!interface.Complete())
-        {
-            cout << "Interface completion returned false\n";
-            exit(EXIT_FAILURE);
-        }
-
-        // ------------------------------------------------------------- //
-        // create an empty MOERTEL::Manager for 2D problems
-        // It organizes everything from integration to solution
-        // ------------------------------------------------------------- //
-        MOERTEL::Manager manager(Comm, printlevel);
-        manager.SetDimension(MOERTEL::Manager::manager_2D);
-
-        // ------------------------------------------------------------- //
-        // Add the interface to the manager
-        // ------------------------------------------------------------- //
-        manager.AddInterface(interface);
-
-        // ------------------------------------------------------------- //
-        // for mortar integration, the mortar manager needs to know about
-        // the rowmap of the original (uncoupled) problem because it will
-        // create coupling matrices D and M matching that rowmap
-        // ------------------------------------------------------------- //
-        manager.SetProblemMap(&Grid.RowMap());
-
-        // ============================================================= //
-        // choose integration parameters
-        // ============================================================= //
-        Teuchos::ParameterList &moertelparams = manager.Default_Parameters();
-        // this does not affect this 2D case
-        moertelparams.set("exact values at gauss points", true);
-        // 1D interface possible values are 1,2,3,4,5,6,7,8,10 (2 recommended with linear shape functions)
-        moertelparams.set("number gaussian points 1D", 2);
-        // 2D interface possible values are 3,6,12,13,16,19,27
-        moertelparams.set("number gaussian points 2D", 27);
-
-        // ============================================================= //
-        // Here we are done with the construction phase of the interface
-        // so we can integrate the mortar integrals
-        // (Note we have not yet evaluated the PDE at all!)
-        // ============================================================= //
-        manager.Mortar_Integrate();
-
-        // print interface information
-        // (Manager, Interface, Segment, Node implement the << operator)
-        if (printlevel)
-            cout << manager;
-
-        // ======================================================== //
-        // Prepares the linear system. This requires the definition //
-        // of a quadrature formula compatible with the grid, a      //
-        // variational formulation, and a problem object which take //
-        // care of filling matrix and right-hand side.              //
-        // NOTE:
-        // we are doing this AFTER we did all the mortar stuff to
-        // show that the mortar integration is actually PDE-independent
-        // ======================================================== //
-        Epetra_CrsMatrix A(Copy, Grid.RowMap(), 0);
-        Epetra_Vector LHS(Grid.RowMap(), true);
-        Epetra_Vector RHS(Grid.RowMap());
-
-        int NumQuadratureNodes = 3;
-
-        GalerkinVariational<TriangleQuadrature>
-            Laplace2D(NumQuadratureNodes, Diffusion9, Source9, Force9,
-                      BoundaryValue9, BoundaryType9);
-
-        LinearProblem FiniteElementProblem(Grid, Laplace2D, A, LHS, RHS);
-        FiniteElementProblem.Compute();
-
-        // ============================================================= //
-        // this is Galeri's dense solve method if you'd like to see how
-        // the uncoupled solution looks like
-        // ============================================================= //
-        Solve(&A, &LHS, &RHS);
-#ifdef MOERTEL_HAVE_EXODUS
-        ExodusInterface exodus(Comm);
-        exodus.Write(Grid, "uncoupled_output", LHS);
-#endif
-        // ============================================================= //
-        // Pass input matrix to Moertel,
-        // Moertel does NOT take ownership of A!
-        // ============================================================= //
-        manager.SetInputMatrix(&A, false);
-
-        // ============================================================= //
-        // Solve
-        // ============================================================= //
-
-        Epetra_CrsMatrix *B = manager.MakeSaddleProblem();
-
-        Epetra_CrsMatrix B1(*B);
-        Epetra_CrsMatrix B2(Copy, (*B).RowMap(), 0);
-        Epetra_Vector LHS2(B2.RowMap(), true);
-        Epetra_Vector LHS3(A.RowMap(), true);
-        Epetra_Vector RHS2(B2.RowMap());
-
-        for (size_t i = 0; i < A.NumGlobalRows(); ++i)
-            RHS2[i] = RHS[i];
-
-        int B1NumMyRow = B1.NumMyRows();
-        int B1MaxNumIndices = B1.MaxNumEntries();
-        double *values = new double[B1MaxNumIndices];
-        int B1NumIndices;
-        int *Indices_int = 0;
-        Indices_int = new int[B1MaxNumIndices];
-
-        for (size_t i = 0; i < B1NumMyRow; ++i)
-        {
-            B1.ExtractGlobalRowCopy(i, B1MaxNumIndices, B1NumIndices, values, Indices_int);
-            B2.InsertGlobalValues(i, B1NumIndices, values, Indices_int);
-        }
-
-        double U;
-        int i_treshold = (B2.NumGlobalRows() + A.NumGlobalRows()) / 2;
-        for (int i = A.NumGlobalRows(); i < B2.NumGlobalRows(); ++i)
-        {
-            if (i < i_treshold)
-                U = 0.;
-            else
-                U = 10000.;
-            B2.InsertGlobalValues(i, 1, &U, &i);
-        }
-
-        B2.FillComplete();
-
-        Solve(&B2, &LHS2, &RHS2);
-
-        for (size_t i = 0; i < A.NumGlobalRows(); ++i)
-            LHS3[i] = LHS2[i];
-#ifdef MOERTEL_HAVE_EXODUS
-        exodus.Write(Grid, "coupled_output", LHS3);
-#endif
-        std::cout << "Lambda" << std::endl
-                  << "-----" << std::endl;
-
-        for (size_t i = A.NumGlobalRows(); i < B2.NumGlobalRows(); ++i)
-            std::cout << LHS2[i] << std::endl;
-
-        std::cout << *(manager.M()) << std::endl
-                  << "-----" << std::endl;
-        std::cout << *(manager.D()) << std::endl
-                  << "-----" << std::endl;
-    }
-    catch (int e)
-    {
-        cerr << "Caught exception, value = " << e << endl;
-        status = 1;
-    }
-    catch (Galeri::Exception &rhs)
-    {
-
-        cerr << "Caught Galeri exception: ";
-        rhs.Print();
-        status = 1;
-    }
-    catch (...)
-    {
-        cerr << "Caught generic exception" << endl;
-        status = 1;
-    }
-
-#ifdef HAVE_MPI
-    MPI_Finalize();
-#endif
-
-    if (status == 0)
-        std::cout << "\nTest passed!" << endl;
-    else
-        std::cout << "\nTest Failed!" << endl;
-
-    // Final return value (0 = successfull, non-zero = failure)
-
-    return status;
-}
diff --git a/tlnos/src/wExample9.h b/tlnos/src/wExample9.h
deleted file mode 100644
index 00b890b15f625c7b438164e02ec1e25467d8cd6a..0000000000000000000000000000000000000000
--- a/tlnos/src/wExample9.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef WEXAMPLE9_H
-#define WEXAMPLE9_H
-
-#include "tlnos.h"
-#include "wObject.h"
-#include <iostream>
-#include <vector>
-#include <string>
-#ifndef SWIG
-#include "Teuchos_Comm.hpp"
-#include "Teuchos_XMLParameterListHelpers.hpp"
-#endif
-
-namespace tlnos
-{
-
-/**
- * @brief a class containing the "build-against-trilinos" example of trilinos
- */
-
-class TLNOS_API Example9 : public fwk::wObject
-{
-public:
-    Example9();
-    int execute();
-};
-
-} // namespace tlnos
-
-#endif //WEXAMPL98_H
diff --git a/tlnos/tests/example1.py b/tlnos/tests/example1.py
deleted file mode 100755
index 3e6907c3fbce4ed03bb4dfb30028373ceba2bb35..0000000000000000000000000000000000000000
--- a/tlnos/tests/example1.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    print("main!")
-    expl = tlnos.Example1()   
-    expl.execute(wu.pth("input.xml",__file__))
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/tests/example10.py b/tlnos/tests/example10.py
deleted file mode 100755
index de58b7ae197f0491b72d6e9700248551d07374de..0000000000000000000000000000000000000000
--- a/tlnos/tests/example10.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example10()   
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/tests/example2.py b/tlnos/tests/example2.py
deleted file mode 100755
index 5a2eedfd338b219b53b2ce1d1d959427bd1e8d67..0000000000000000000000000000000000000000
--- a/tlnos/tests/example2.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example2()   
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/tests/example4.py b/tlnos/tests/example4.py
deleted file mode 100755
index fdd0728e82aaf40188933322278f5ee525190fe3..0000000000000000000000000000000000000000
--- a/tlnos/tests/example4.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; -*-
-# runs the basic demo of Trilinos
-# trilinos-12.6.1-Source/demos/buildAgainstTrilinos
-
-import fwk.wutils as wu
-import tlnos
-
-def main(**d):
-    expl = tlnos.Example4()   
-    expl.execute()
-
-if __name__ == "__main__":
-    main()
-    
diff --git a/tlnos/tests/input.xml b/tlnos/tests/input.xml
deleted file mode 100644
index feeab544d5b78e77f9d4dc71d2dc1424b8c7fd9c..0000000000000000000000000000000000000000
--- a/tlnos/tests/input.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<ParameterList>
-  <ParameterList name="Application">
-    <Parameter name="Name" type="string" value="Cold Fusion"/>
-  </ParameterList>
-</ParameterList>
-
-
diff --git a/waves/CMakeFiles/CMakeDirectoryInformation.cmake b/waves/CMakeFiles/CMakeDirectoryInformation.cmake
deleted file mode 100644
index a5519e03c8316b894b76578cafe5748de586b69d..0000000000000000000000000000000000000000
--- a/waves/CMakeFiles/CMakeDirectoryInformation.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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
deleted file mode 100644
index 04f9fe46068b397a6fc24d647b7e3ec4315c15e7..0000000000000000000000000000000000000000
--- a/waves/CMakeFiles/progress.marks
+++ /dev/null
@@ -1 +0,0 @@
-59
diff --git a/waves/CMakeLists.txt b/waves/CMakeLists.txt
deleted file mode 100644
index 3f0452be22f1dc9925ec99de097b0a36e36b7643..0000000000000000000000000000000000000000
--- a/waves/CMakeLists.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-
-# 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
deleted file mode 100644
index ed6b0561f32499a905b787ca1626b68100a318ae..0000000000000000000000000000000000000000
--- a/waves/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- 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
deleted file mode 100644
index 0b3b66d98f4598c69e061074568cf48da44e3c2e..0000000000000000000000000000000000000000
--- a/waves/_src/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-
-# 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
deleted file mode 100644
index 1f48fc0b409ca325a65083d72ecd75cc1df5724a..0000000000000000000000000000000000000000
--- a/waves/_src/wavesw.i
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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
deleted file mode 100644
index afbf596d7cc76869346e40f6f959cb9b98f2fb7a..0000000000000000000000000000000000000000
--- a/waves/attic/export_xml.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# 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
deleted file mode 100644
index f0322e0fa77e5b6dc546422fd4556b3652dabbd2..0000000000000000000000000000000000000000
--- a/waves/attic/testSonarQ.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#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
deleted file mode 100644
index ca36db06d14f1bed56ee32e4d14a433ffe364afb..0000000000000000000000000000000000000000
--- a/waves/attic/wDof.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// $Id$
-
-#include "wDof.h"
diff --git a/waves/attic/wDof.h b/waves/attic/wDof.h
deleted file mode 100644
index 11a552d81f373bab672c6dde5a50eabc798d1616..0000000000000000000000000000000000000000
--- a/waves/attic/wDof.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// $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
deleted file mode 100644
index e0264b16864bb47be88aee263eab02a8d4a0eb64..0000000000000000000000000000000000000000
--- a/waves/attic/wField.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// $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
deleted file mode 100644
index 35ad5745d68285a0350de5e55f788d69f680c68c..0000000000000000000000000000000000000000
--- a/waves/attic/wField.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// $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
deleted file mode 100644
index 0bca4b799889729964781d3e3976e9e4fb776227..0000000000000000000000000000000000000000
--- a/waves/attic/wSolver1.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// $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
deleted file mode 100644
index 9b1afd8075aab6cbadb9afd6d1b6317f48a4cd9e..0000000000000000000000000000000000000000
--- a/waves/attic/wSolver1.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// $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
deleted file mode 100644
index 81cb82b738d8d4d339bdd0b1e4a36500ee80c430..0000000000000000000000000000000000000000
--- a/waves/broken/cas1.geo
+++ /dev/null
@@ -1,60 +0,0 @@
-// $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
deleted file mode 100755
index 47384a42a9a6b02ea091cfa5491e84101a117f7d..0000000000000000000000000000000000000000
--- a/waves/broken/cas1.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/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
deleted file mode 100644
index b73326f0ca418b37460a1750d18105d1c0612cfb..0000000000000000000000000000000000000000
--- a/waves/broken/geuz/geophysique.geo
+++ /dev/null
@@ -1,72 +0,0 @@
-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
deleted file mode 100644
index 5f892e4942403de4b9c0f0ec4b367635d97f0657..0000000000000000000000000000000000000000
--- a/waves/broken/geuz/geophysique.pro
+++ /dev/null
@@ -1,149 +0,0 @@
-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
deleted file mode 100755
index ec935081a5ff6231fe21d0e68982b48a50b4ebc2..0000000000000000000000000000000000000000
--- a/waves/broken/geuz/geophysique.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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
deleted file mode 100644
index 86865c09af9c242a3b3573aa9096770ab8f9e6b0..0000000000000000000000000000000000000000
--- a/waves/broken/geuz/geophysique_param.geo
+++ /dev/null
@@ -1,20 +0,0 @@
-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
deleted file mode 100755
index fbe41711959b9e8c0eaff7fe33fa53a03626636c..0000000000000000000000000000000000000000
--- a/waves/broken/waves01_onelab.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/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
deleted file mode 100644
index ec845ea873e6cbe7e01147c2dda321d1bd119f0e..0000000000000000000000000000000000000000
--- a/waves/exe/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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
deleted file mode 100644
index 2825a71fe3c4565b9b945d025f2638b86d8d3515..0000000000000000000000000000000000000000
--- a/waves/exe/main.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/waves/models/cube.geo b/waves/models/cube.geo
deleted file mode 100644
index 506ab0fd354f22a181036733f2070352720d2e59..0000000000000000000000000000000000000000
--- a/waves/models/cube.geo
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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
deleted file mode 100644
index 43d32239d0c606f895af5a5933494c7167c967a2..0000000000000000000000000000000000000000
--- a/waves/models/cube2mat.geo
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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
deleted file mode 100755
index 8f1daf1efe8db83635e3c91f77a6e1862e01affb..0000000000000000000000000000000000000000
--- a/waves/models/plane1mat.py
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/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
deleted file mode 100755
index 693a9cc4d89c423f6d1e32db7f3433d99e1880ab..0000000000000000000000000000000000000000
--- a/waves/models/plane2mat.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/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
deleted file mode 100644
index e281b8acae0909db78a2b1fc2a478004e21bec21..0000000000000000000000000000000000000000
--- a/waves/src/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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
deleted file mode 100644
index 52238cacbabf51932e072a62e09cc07b302f0c8f..0000000000000000000000000000000000000000
--- a/waves/src/wBoundary.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 98ef337e6ef5d5a00fe916218dd5d1af6d5447f7..0000000000000000000000000000000000000000
--- a/waves/src/wBoundary.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 432f096fb4e8cf0d29ada1e6c679e4def86eb266..0000000000000000000000000000000000000000
--- a/waves/src/wDisplayHook.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 859859da5810092b8e671b8028d63afc621d05c2..0000000000000000000000000000000000000000
--- a/waves/src/wDisplayHook.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 9efb91b8cbccba642c3f249b406107f915997ce6..0000000000000000000000000000000000000000
--- a/waves/src/wForwardEuler.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 1be5443bccd6832c32f9201a832442799f8cd21d..0000000000000000000000000000000000000000
--- a/waves/src/wForwardEuler.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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
deleted file mode 100644
index af87497ce489c47ae79574b3c6d6006fcce5dd3b..0000000000000000000000000000000000000000
--- a/waves/src/wMedium.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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
deleted file mode 100644
index a3e370af6f426c82fb3acb39b3f10abe7b4ecdeb..0000000000000000000000000000000000000000
--- a/waves/src/wMedium.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 919521281d4bb4257ddc7b3ebc0ce0d3b36e5165..0000000000000000000000000000000000000000
--- a/waves/src/wNewmark.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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
deleted file mode 100644
index b03d5808614e328a8c70fa1eafe7ca94219fa56d..0000000000000000000000000000000000000000
--- a/waves/src/wNewmark.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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
deleted file mode 100644
index f5effcb2221ae49d1bf618ce03f2c7c3443ae4d5..0000000000000000000000000000000000000000
--- a/waves/src/wProblem.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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
deleted file mode 100644
index adff43b5c3307f70f3490bf017a435177be500fc..0000000000000000000000000000000000000000
--- a/waves/src/wProblem.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 75e9baf257d5228d88c0eb59446e00984ddd92c7..0000000000000000000000000000000000000000
--- a/waves/src/wRungeKutta.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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
deleted file mode 100644
index e79690fda9a1f821768a7f057f733aa409396ed4..0000000000000000000000000000000000000000
--- a/waves/src/wRungeKutta.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 595eea555dba22dd4882125c679a3af0d646e825..0000000000000000000000000000000000000000
--- a/waves/src/wSource.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 6ed54658d85cab00eb657d68bdd2af444c86416a..0000000000000000000000000000000000000000
--- a/waves/src/wSource.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 7f13762b1c2144315354fc7b19ba79857c8ca9a5..0000000000000000000000000000000000000000
--- a/waves/src/wTimeIntegration.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * 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
deleted file mode 100644
index b47326b970ee6c174b39abb039b28179146ca044..0000000000000000000000000000000000000000
--- a/waves/src/wTimeIntegration.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 6b92dbee164d29ffe1949c846d312d4fe75a77e1..0000000000000000000000000000000000000000
--- a/waves/src/wWaveTerm.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 6ad3a384375d2c3c2142294f751f1f0c1da9ddfd..0000000000000000000000000000000000000000
--- a/waves/src/wWaveTerm.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 46f05cca61dd4d9114762d381ff181d8c665a971..0000000000000000000000000000000000000000
--- a/waves/src/waves.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 47a9950112b1e8bf505642942958a218441da8a9..0000000000000000000000000000000000000000
--- a/waves/srcs.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- 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
deleted file mode 100755
index 15180a74609880030731448d0e4a08d78689f694..0000000000000000000000000000000000000000
--- a/waves/tests/attic/bulthuis.geo
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ========================================================================= *
- *
- *                        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
deleted file mode 100644
index f6e5f0fd8a58d823f547eeae513d36ffaac5ff84..0000000000000000000000000000000000000000
--- a/waves/tests/attic/strates.geo
+++ /dev/null
@@ -1,49 +0,0 @@
-// $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
deleted file mode 100755
index ecb9854d70cc65dce3216a7fbdedaf2e93c57997..0000000000000000000000000000000000000000
--- a/waves/tests/mat1/interf1.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index b2adf8455ad46ffc42fd76afffe7be91d630654b..0000000000000000000000000000000000000000
--- a/waves/tests/mat1/interf2.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index c3b960817e32cd8b8a69c52c3c922f6dba6da74e..0000000000000000000000000000000000000000
--- a/waves/tests/mat1/planewave.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index 61bacc5b1bc99c8b20d96855ed2d005c69cc4cd9..0000000000000000000000000000000000000000
--- a/waves/tests/mat1/pulse.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index 571580b03262a7f94936c462692277291713c0e6..0000000000000000000000000000000000000000
--- a/waves/tests/mat1/sinsrc.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index 8342157a3406f43e26f7fc22aaded2ef44e9b5b5..0000000000000000000000000000000000000000
--- a/waves/tests/mat2/interf1.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index 6596d94ec6254aeb51f8b3beae8f000592c1986d..0000000000000000000000000000000000000000
--- a/waves/tests/mat2/pulse.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index 8bd0db96b738ddbe5fbd258e7ff7033e23681ae8..0000000000000000000000000000000000000000
--- a/waves/tests/mat2/reflex.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100755
index 575ea91fe4178898c0914a9b76c3157acbbfb262..0000000000000000000000000000000000000000
--- a/waves/tests/mat2/sinsrc.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/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
deleted file mode 100644
index ffab945dada68c5956beb7b19d3bb22a5facaeaf..0000000000000000000000000000000000000000
--- a/waves/utils.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/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
deleted file mode 100644
index 197bf0505f5592b73b39379eed20063df3eda326..0000000000000000000000000000000000000000
--- a/waves/viewer.py
+++ /dev/null
@@ -1,456 +0,0 @@
-# -*- 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)