Commit 95a126a5 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'releases/0.2' into 'master'

Releases/0.2

See merge request !1
parents 03c8bf81 07930b89
[submodule "externals/fmt"] [submodule "libs/fmt"]
path = externals/fmt path = libs/fmt
url = https://github.com/fmtlib/fmt.git url = https://github.com/fmtlib/fmt.git
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
project(amdis CXX) project(amdis LANGUAGES CXX VERSION 0.2)
#find dune-common and set the module path #find dune-common and set the module path
find_package(dune-common REQUIRED) find_package(dune-common REQUIRED)
...@@ -17,16 +17,18 @@ dune_enable_all_packages(MODULE_LIBRARIES amdis fmt) ...@@ -17,16 +17,18 @@ dune_enable_all_packages(MODULE_LIBRARIES amdis fmt)
add_subdirectory("bin") add_subdirectory("bin")
add_subdirectory("cmake/modules") add_subdirectory("cmake/modules")
add_subdirectory("doc") add_subdirectory("doc")
add_subdirectory("externals") add_subdirectory("examples" EXCLUDE_FROM_ALL)
add_subdirectory("libs")
add_subdirectory("src") add_subdirectory("src")
add_subdirectory("test") add_subdirectory("test")
add_subdirectory("examples" EXCLUDE_FROM_ALL)
target_link_libraries(amdis fmt) target_link_libraries(amdis fmt)
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF) option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
if (ENABLE_ALL_WARNINGS) if (ENABLE_ALL_WARNINGS)
target_compile_options(amdis PUBLIC "-Wall" "-Wextra" "-pedantic" "-Wnon-virtual-dtor" "-Wold-style-cast" "-Wcast-align" "-Woverloaded-virtual" "-Wpedantic" "-Wconversion") target_compile_options(amdis PUBLIC "-Wall" "-Wextra" "-pedantic" "-Wnon-virtual-dtor"
"-Wold-style-cast" "-Wcast-align" "-Woverloaded-virtual"
"-Wpedantic" "-Wconversion")
endif (ENABLE_ALL_WARNINGS) endif (ENABLE_ALL_WARNINGS)
# finalize the dune project, e.g. generating config.h etc. # finalize the dune project, e.g. generating config.h etc.
......
# GIT Workflow # GIT Workflow
Follow the ideas of [a-successful-git-branching-model](http://nvie.com/posts/a-successful-git-branching-model), Follow the git workflow:
especially
- Create a new branch for all new features, following the naming convention - Create a new branch for all new features, following the naming convention
`feature/XYZ` `feature/XYZ`
- Merge features in the `develop` branch only
- Correct Bugs in issue branches, following the naming convention `issue/XYZ` - Correct Bugs in issue branches, following the naming convention `issue/XYZ`
- Merge issues in the `develop` branch, except when it is a hotfix, then merge - For features and issues *Merge Request* into the master branch should be created in GitLab
to `master` and `develop` - Do not push into `master` directly
- For all merges create a meaningful *Merge Request* in GitLab - Releases are created in a new branch `release/VERSION` that is not deleted after merged into master.
After the merge, a tag with name `vVERSION` should be created.
# Code Style-Guide # Code Style-Guide
...@@ -44,24 +43,6 @@ files, such as `math.h` (remember that windows files-systems are case insensitiv ...@@ -44,24 +43,6 @@ files, such as `math.h` (remember that windows files-systems are case insensitiv
thus, there is no difference between `math.h` and `Math.H`.) thus, there is no difference between `math.h` and `Math.H`.)
## Generale file structure ## Generale file structure
Every header file should start with a copyright notice and an include guard `#pragma once`,
where the text of the copyright notice is given in the file `tools/license.templ.txt`
and can automatically by added, using the script files in the `tools` directory:
``` c++
// Software License for AMDiS
//
// Copyright (c) 2015 Institute for Scientific Computing, Technische Universitaet Dresden
// All rights reserved.
// Authors: Simon Praetorius
//
// This file is part of the AMDiS Library
// see also the LICENSE file in the distribution.
#pragma once
```
After the include guard a list of include files can be added, see *Names and Order of Includes*.
### Names and Order of Includes ### Names and Order of Includes
...@@ -84,9 +65,7 @@ For example, the includes in `io/VtkWriter.cpp` might look like this: ...@@ -84,9 +65,7 @@ For example, the includes in `io/VtkWriter.cpp` might look like this:
#include "io/VtkWriter.hpp" #include "io/VtkWriter.hpp"
// [open]mpi header // [open]mpi header
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include <mpi.h> #include <mpi.h>
#endif
// std c++ headers // std c++ headers
#include <cmath> #include <cmath>
...@@ -141,7 +120,7 @@ double const& d_ref = d; ...@@ -141,7 +120,7 @@ double const& d_ref = d;
### Functions ### Functions
Try to put all parameters in the line of the function declaration until it exceeds Try to put all parameters in the line of the function declaration until it exceeds
the maximum line length. Then list remaining arguments aligned with the first the maximum line length. Then list remaining arguments aligned with the first
function argument. Follow the style of the brackets, like function argument. Follow the style of the brackets, like
```c++ ```c++
...@@ -166,7 +145,7 @@ public: ...@@ -166,7 +145,7 @@ public:
: member1_(arg1) : member1_(arg1)
, member2_(arg2) , member2_(arg2)
{} {}
private: private:
Arg1 member1_; Arg1 member1_;
Arg2 member2_; Arg2 member2_;
......
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016-2018 Simon Praetorius Copyright (c) 2016-2019 Simon Praetorius
2018 Felix Müller 2019 Felix Müller
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -25,7 +25,14 @@ The `dunecontrol` script searches for the required ...@@ -25,7 +25,14 @@ The `dunecontrol` script searches for the required
(See the file `dune.module` for an up-to-date list of dependencies). The dune modules (See the file `dune.module` for an up-to-date list of dependencies). The dune modules
can be obtained from https://gitlab.dune-project.org and need to be found in a can be obtained from https://gitlab.dune-project.org and need to be found in a
subdirectory of `DUNE_CONTROL_PATH`. See also https://dune-project.org/doc/installation subdirectory of `DUNE_CONTROL_PATH`. See also https://dune-project.org/doc/installation
for details about the installation of dune modules. for details about the installation of dune modules. You can use the script
```
bin/install_all_dune_modules.sh DOWNLOAD_DIR
```
to clone all dune repositories into `DOWNLOAD_DIR` and provide a simple way using `dunecontrol`
to install all of them at once.
Additionally the following optional libraries can be used: Additionally the following optional libraries can be used:
- [MTL4](https://gitlab.math.tu-dresden.de/spraetor/mtl4) (use this fork to get up-to-date changes) - [MTL4](https://gitlab.math.tu-dresden.de/spraetor/mtl4) (use this fork to get up-to-date changes)
......
...@@ -9,8 +9,8 @@ DEPENDENCIES=@REQUIRES@ ...@@ -9,8 +9,8 @@ DEPENDENCIES=@REQUIRES@
Name: @PACKAGE_NAME@ Name: @PACKAGE_NAME@
Version: @VERSION@ Version: @VERSION@
Description: AMDiS dune-module Description: AMDiS dune-module
URL: https://gitlab.math.tu-dresden.de/spraetor/dune-amdis URL: https://gitlab.mn.tu-dresden.de/amdis/amdis-core
Requires: dune-common dune-geometry dune-localfunctions dune-typetree dune-grid dune-functions Requires: dune-common dune-geometry dune-localfunctions dune-typetree dune-grid dune-functions
Suggests: dune-uggrid dune-alugrid dune-foamgrid Suggests: dune-uggrid dune-alugrid dune-foamgrid dune-spgrid dune-ist
Libs: -L${libdir} Libs: -L${libdir}
Cflags: -I${includedir} Cflags: -I${includedir}
...@@ -523,10 +523,6 @@ M_DELIM ...@@ -523,10 +523,6 @@ M_DELIM
################## PROJECT.CC ################## ################## PROJECT.CC ##################
echo "- $PROJECT/src/$MODULE.cpp" echo "- $PROJECT/src/$MODULE.cpp"
cat> "$PROJECT/src/$MODULE.cpp" << CC_DELIM cat> "$PROJECT/src/$MODULE.cpp" << CC_DELIM
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
using namespace AMDiS; using namespace AMDiS;
...@@ -684,7 +680,7 @@ mesh->global refinements: 0 ...@@ -684,7 +680,7 @@ mesh->global refinements: 0
$NAME->mesh: mesh $NAME->mesh: mesh
$NAME->solver->name: default $NAME->solver->name: default
$NAME->solver->tolerance: 1.e-8 $NAME->solver->relative tolerance: 1.e-6
$NAME->solver->info: 1 $NAME->solver->info: 1
$NAME->output[0]->filename: $NAME_ $NAME->output[0]->filename: $NAME_
...@@ -801,4 +797,5 @@ echo ...@@ -801,4 +797,5 @@ echo
echo "done." echo "done."
echo "------------------------------------------" echo "------------------------------------------"
echo "For further details read the Dune build system documentation at" echo "For further details read the Dune build system documentation at"
echo "https://www.dune-project.org/buildsystem/" echo "https://www.dune-project.org/buildsystem/ or in the file"
echo "dune-common/doc/buildsystem/dune-common.rst"
#!/usr/bin/env bash
if [ $# -lt 1 ]; then
echo "usage: $0 DOWNLOAD_DIR"
exit 1
fi
DOWNLOAD_DIR="$1"
mkdir -p ${DOWNLOAD_DIR}/dune
cd ${DOWNLOAD_DIR}/dune
CORE_MODULES=("dune-common" "dune-geometry" "dune-grid" "dune-istl" "dune-localfunctions")
STAGING_MODULES=("dune-functions" "dune-typetree" "dune-uggrid")
EXTENSIONS_MODULES=("dune-alugrid" "dune-spgrid" "dune-foamgrid")
for MOD in ${CORE_MODULES[*]}; do
git clone https://gitlab.dune-project.org/core/${MOD}.git --branch releases/2.6 --single-branch
done
for MOD in ${STAGING_MODULES[*]}; do
git clone https://gitlab.dune-project.org/staging/${MOD}.git --branch releases/2.6 --single-branch
done
for MOD in ${EXTENSIONS_MODULES[*]}; do
git clone https://gitlab.dune-project.org/extensions/${MOD}.git --branch releases/2.6 --single-branch
done
echo ""
echo "=============================================================="
echo "To build all dune modules run the commands... "
echo " DUNE_CONTROL_PATH=${DOWNLOAD_DIR}/dune dunecontrol configure"
echo " DUNE_CONTROL_PATH=${DOWNLOAD_DIR}/dune dunecontrol make -j4 "
echo "=============================================================="
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
################################ ################################
Module: amdis Module: amdis
Version: 0.1 Version: 0.2
Maintainer: simon.praetorius@tu-dresden.de Maintainer: simon.praetorius@tu-dresden.de
Depends: dune-common (>= 2.6) dune-geometry (>= 2.6) dune-localfunctions (>= 2.6) dune-typetree (>= 2.6) dune-grid (>= 2.6) dune-functions (>= 2.6) Depends: dune-common (>= 2.6) dune-geometry (>= 2.6) dune-localfunctions (>= 2.6) dune-typetree (>= 2.6) dune-grid (>= 2.6) dune-functions (>= 2.6)
Suggests: dune-uggrid dune-alugrid dune-foamgrid dune-spgrid Suggests: dune-uggrid dune-alugrid dune-foamgrid dune-spgrid dune-istl
...@@ -12,7 +12,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") ...@@ -12,7 +12,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
endif() endif()
endif() endif()
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/externals/fmt/CMakeLists.txt") if (NOT EXISTS "${PROJECT_SOURCE_DIR}/libs/fmt/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif() endif()
...@@ -23,7 +23,7 @@ dune_library_add_sources(fmt SOURCES ...@@ -23,7 +23,7 @@ dune_library_add_sources(fmt SOURCES
) )
target_include_directories(fmt PUBLIC target_include_directories(fmt PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/externals/fmt/include>) $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/libs/fmt/include>)
install(FILES install(FILES
fmt/include/fmt/core.h fmt/include/fmt/core.h
......
...@@ -26,8 +26,8 @@ namespace AMDiS ...@@ -26,8 +26,8 @@ namespace AMDiS
template <class RowBasis, class ColBasis> template <class RowBasis, class ColBasis>
void init(RowBasis const& rowBasis, ColBasis const& colBasis) { /* do nothing */ } void init(RowBasis const& rowBasis, ColBasis const& colBasis) { /* do nothing */ }
template <class Matrix, class X, class B, class RN, class CN> template <class Matrix, class X, class B, class RN, class RTP, class CN, class CTP>
void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, CN const& colNode) { /* do nothing */ } void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath) { /* do nothing */ }
protected: protected:
std::shared_ptr<BoundaryManagerBase const> boundaryManager_{nullptr}; std::shared_ptr<BoundaryManagerBase const> boundaryManager_{nullptr};
......
...@@ -30,6 +30,7 @@ install(FILES ...@@ -30,6 +30,7 @@ install(FILES
DataTransfer.hpp DataTransfer.hpp
DataTransfer.inc.hpp DataTransfer.inc.hpp
DirichletBC.hpp DirichletBC.hpp
DirichletBC.inc.hpp
FileWriter.hpp FileWriter.hpp
FileWriterInterface.hpp FileWriterInterface.hpp
Flag.hpp Flag.hpp
......
...@@ -73,8 +73,8 @@ namespace AMDiS ...@@ -73,8 +73,8 @@ namespace AMDiS
* \tparam RN RowNode * \tparam RN RowNode
* \tparam CN ColNode * \tparam CN ColNode
**/ **/
template <class Mat, class Sol, class Rhs, class RN, class CN> template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode); void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath);
private: private:
Dune::Std::optional<std::function<bool(Domain)>> predicate_; Dune::Std::optional<std::function<bool(Domain)>> predicate_;
......
...@@ -28,15 +28,15 @@ init(RB const& rowBasis, CB const& colBasis) ...@@ -28,15 +28,15 @@ init(RB const& rowBasis, CB const& colBasis)
template <class D, class R> template <class D, class R>
template <class Mat, class Sol, class Rhs, class RN, class CN> template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void DirichletBC<D,R>:: void DirichletBC<D,R>::
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode) fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath)
{ {
auto columns = Constraints<Mat>::dirichletBC(matrix, dirichletNodes_); auto columns = Constraints<Mat>::dirichletBC(matrix, dirichletNodes_);
Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{}, Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{},
[&](auto id) { [&](auto id) {
auto subBasis = Dune::Functions::subspaceBasis(rhs.basis(), rowNode.treePath()); auto subBasis = Dune::Functions::subspaceBasis(rhs.basis(), rowTreePath);
Dune::Functions::interpolate(subBasis, rhs, values_, dirichletNodes_); Dune::Functions::interpolate(subBasis, rhs, values_, dirichletNodes_);
}); });
...@@ -46,7 +46,7 @@ fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, C ...@@ -46,7 +46,7 @@ fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, C
Dune::Hybrid::ifElse(std::is_same<RangeType_t<CN>, R>{}, Dune::Hybrid::ifElse(std::is_same<RangeType_t<CN>, R>{},
[&](auto id) { [&](auto id) {
auto subBasis = Dune::Functions::subspaceBasis(solution.basis(), colNode.treePath()); auto subBasis = Dune::Functions::subspaceBasis(solution.basis(), colTreePath);
Dune::Functions::interpolate(subBasis, solution, values_, dirichletNodes_); Dune::Functions::interpolate(subBasis, solution, values_, dirichletNodes_);
}); });
} }
......
...@@ -65,8 +65,8 @@ namespace AMDiS ...@@ -65,8 +65,8 @@ namespace AMDiS
template <class RB, class CB> template <class RB, class CB>
void init(RB const& rowBasis, CB const& colBasis); void init(RB const& rowBasis, CB const& colBasis);
template <class Mat, class Sol, class Rhs, class RN, class CN> template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, CN const& colNode); void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath);
auto const& associations() const auto const& associations() const
{ {
......
...@@ -231,9 +231,9 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const ...@@ -231,9 +231,9 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
template <class D, class MI> template <class D, class MI>
template <class Mat, class Sol, class Rhs, class RN, class CN> template <class Mat, class Sol, class Rhs, class RN, class RTP, class CN, class CTP>
void PeriodicBC<D,MI>:: void PeriodicBC<D,MI>::
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode) fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, RTP rowTreePath, CN const& colNode, CTP colTreePath)
{ {
Constraints<Mat>::periodicBC(matrix, periodicNodes_, associations_); Constraints<Mat>::periodicBC(matrix, periodicNodes_, associations_);
......
...@@ -456,13 +456,13 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as ...@@ -456,13 +456,13 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as
systemMatrix_->finish(asmMatrix); systemMatrix_->finish(asmMatrix);
rhs_->finish(asmVector); rhs_->finish(asmVector);
for_each_node(localView.tree(), [&,this](auto const& rowNode, auto) { for_each_node(localView.tree(), [&,this](auto const& rowNode, auto row_tp) {
for_each_node(localView.tree(), [&,this](auto const& colNode, auto) { for_each_node(localView.tree(), [&,this](auto const& colNode, auto col_tp) {
// finish boundary condition // finish boundary condition
for (auto bc : dirichletBCs_[rowNode][colNode]) for (auto bc : dirichletBCs_[rowNode][colNode])
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, colNode); bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, row_tp, colNode, col_tp);
for (auto bc : periodicBCs_[rowNode][colNode]) for (auto bc : periodicBCs_[rowNode][colNode])
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, colNode); bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, row_tp, colNode, col_tp);
}); });
}); });
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <dune/functions/functionspacebases/compositebasis.hh> #include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh> #include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh> #include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/functionspacebases/pqknodalbasis.hh>
#include <dune/grid/yaspgrid.hh> #include <dune/grid/yaspgrid.hh>
#include <amdis/common/Logical.hpp> #include <amdis/common/Logical.hpp>
......
...@@ -16,7 +16,6 @@ install(FILES ...@@ -16,7 +16,6 @@ install(FILES
Index.hpp Index.hpp
Literals.hpp Literals.hpp
Logical.hpp Logical.hpp
Loops.hpp
Math.hpp Math.hpp
MultiTypeMatrix.hpp MultiTypeMatrix.hpp
MultiTypeVector.hpp MultiTypeVector.hpp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment