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"]
path = externals/fmt
[submodule "libs/fmt"]
path = libs/fmt
url = https://github.com/fmtlib/fmt.git
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_package(dune-common REQUIRED)
......@@ -17,16 +17,18 @@ dune_enable_all_packages(MODULE_LIBRARIES amdis fmt)
add_subdirectory("bin")
add_subdirectory("cmake/modules")
add_subdirectory("doc")
add_subdirectory("externals")
add_subdirectory("examples" EXCLUDE_FROM_ALL)
add_subdirectory("libs")
add_subdirectory("src")
add_subdirectory("test")
add_subdirectory("examples" EXCLUDE_FROM_ALL)
target_link_libraries(amdis fmt)
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
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)
# finalize the dune project, e.g. generating config.h etc.
......
# GIT Workflow
Follow the ideas of [a-successful-git-branching-model](http://nvie.com/posts/a-successful-git-branching-model),
especially
Follow the git workflow:
- Create a new branch for all new features, following the naming convention
`feature/XYZ`
- Merge features in the `develop` branch only
- 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
to `master` and `develop`
- For all merges create a meaningful *Merge Request* in GitLab
- For features and issues *Merge Request* into the master branch should be created in GitLab
- Do not push into `master` directly
- 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
......@@ -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`.)
## 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
......@@ -84,9 +65,7 @@ For example, the includes in `io/VtkWriter.cpp` might look like this:
#include "io/VtkWriter.hpp"
// [open]mpi header
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include <mpi.h>
#endif
// std c++ headers
#include <cmath>
......
The MIT License (MIT)
Copyright (c) 2016-2018 Simon Praetorius
2018 Felix Müller
Copyright (c) 2016-2019 Simon Praetorius
2019 Felix Müller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -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
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
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:
- [MTL4](https://gitlab.math.tu-dresden.de/spraetor/mtl4) (use this fork to get up-to-date changes)
......
......@@ -9,8 +9,8 @@ DEPENDENCIES=@REQUIRES@
Name: @PACKAGE_NAME@
Version: @VERSION@
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
Suggests: dune-uggrid dune-alugrid dune-foamgrid
Suggests: dune-uggrid dune-alugrid dune-foamgrid dune-spgrid dune-ist
Libs: -L${libdir}
Cflags: -I${includedir}
......@@ -523,10 +523,6 @@ M_DELIM
################## PROJECT.CC ##################
echo "- $PROJECT/src/$MODULE.cpp"
cat> "$PROJECT/src/$MODULE.cpp" << CC_DELIM
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <amdis/AMDiS.hpp>
using namespace AMDiS;
......@@ -684,7 +680,7 @@ mesh->global refinements: 0
$NAME->mesh: mesh
$NAME->solver->name: default
$NAME->solver->tolerance: 1.e-8
$NAME->solver->relative tolerance: 1.e-6
$NAME->solver->info: 1
$NAME->output[0]->filename: $NAME_
......@@ -801,4 +797,5 @@ echo
echo "done."
echo "------------------------------------------"
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 @@
################################
Module: amdis
Version: 0.1
Version: 0.2
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)
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")
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.")
endif()
......@@ -23,7 +23,7 @@ dune_library_add_sources(fmt SOURCES
)
target_include_directories(fmt PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/externals/fmt/include>)
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/libs/fmt/include>)
install(FILES
fmt/include/fmt/core.h
......
......@@ -26,8 +26,8 @@ namespace AMDiS
template <class RowBasis, class ColBasis>
void init(RowBasis const& rowBasis, ColBasis const& colBasis) { /* do nothing */ }
template <class Matrix, class X, class B, class RN, class CN>
void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, CN const& colNode) { /* do nothing */ }
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, RTP rowTreePath, CN const& colNode, CTP colTreePath) { /* do nothing */ }
protected:
std::shared_ptr<BoundaryManagerBase const> boundaryManager_{nullptr};
......
......@@ -30,6 +30,7 @@ install(FILES
DataTransfer.hpp
DataTransfer.inc.hpp
DirichletBC.hpp
DirichletBC.inc.hpp
FileWriter.hpp
FileWriterInterface.hpp
Flag.hpp
......
......@@ -73,8 +73,8 @@ namespace AMDiS
* \tparam RN RowNode
* \tparam CN ColNode
**/
template <class Mat, class Sol, class Rhs, class RN, class CN>
void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode);
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, RTP rowTreePath, CN const& colNode, CTP colTreePath);
private:
Dune::Std::optional<std::function<bool(Domain)>> predicate_;
......
......@@ -28,15 +28,15 @@ init(RB const& rowBasis, CB const& colBasis)
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>::
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_);
Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{},
[&](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_);
});
......@@ -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>{},
[&](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_);
});
}
......
......@@ -65,8 +65,8 @@ namespace AMDiS
template <class RB, class CB>
void init(RB const& rowBasis, CB const& colBasis);
template <class Mat, class Sol, class Rhs, class RN, class CN>
void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, CN const& colNode);
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, RTP rowTreePath, CN const& colNode, CTP colTreePath);
auto const& associations() const
{
......
......@@ -231,9 +231,9 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
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>::
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_);
......
......@@ -456,13 +456,13 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as
systemMatrix_->finish(asmMatrix);
rhs_->finish(asmVector);
for_each_node(localView.tree(), [&,this](auto const& rowNode, auto) {
for_each_node(localView.tree(), [&,this](auto const& colNode, auto) {
for_each_node(localView.tree(), [&,this](auto const& rowNode, auto row_tp) {
for_each_node(localView.tree(), [&,this](auto const& colNode, auto col_tp) {
// finish boundary condition
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])
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, colNode);
bc->fillBoundaryCondition(*systemMatrix_, *solution_, *rhs_, rowNode, row_tp, colNode, col_tp);
});
});
......
......@@ -4,7 +4,6 @@
#include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/functionspacebases/pqknodalbasis.hh>
#include <dune/grid/yaspgrid.hh>
#include <amdis/common/Logical.hpp>
......
......@@ -16,7 +16,6 @@ install(FILES
Index.hpp
Literals.hpp
Logical.hpp
Loops.hpp
Math.hpp
MultiTypeMatrix.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