Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

Commit f688bc11 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Cleanup of directory structure and removed obsolete files and functions

parent 0ef5f46a
...@@ -23,5 +23,10 @@ add_subdirectory("externals") ...@@ -23,5 +23,10 @@ add_subdirectory("externals")
target_link_libraries(amdis fmt) 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")
endif (ENABLE_ALL_WARNINGS)
# finalize the dune project, e.g. generating config.h etc. # finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE) finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
#pragma once
#include <string>
#include "Flag.hpp"
namespace AMDiS
{
class AdaptInfo;
class ProblemStatBase;
const Flag BUILD = 1; // Assemble vectors and matrices
const Flag BUILD_RHS = 2; // Assemble rhs vectors only
const Flag ADAPT = 4; // Run adaption procedure
const Flag SOLVE = 8; // Solve system
const Flag SOLVE_RHS = 16; // Solve system, where only rhs vectors have changed
const Flag ESTIMATE = 32; // Estimate error
const Flag MARK = 64; // Mark elements
const Flag FULL_ITERATION = BUILD | ADAPT | SOLVE | ESTIMATE | MARK;
const Flag NO_ADAPTION = BUILD | SOLVE | ESTIMATE;
/** \brief
* Interface for master problems needed by the adaption loop. A master problem
* can handle one single or multiple coupled problems. In the latter case,
* the master problem can determine the execution order of the build, solve,
* estimate, and adapt steps of the single problems in \ref oneIteration().
*/
class ProblemIterationInterface
{
public:
virtual ~ProblemIterationInterface() = default;
/// Called before each adaption loop iteration.
virtual void beginIteration(AdaptInfo&) { /* by default, do nothing */ }
/** \brief
* Determines the execution order of the single adaption steps. If adapt is
* true, mesh adaption will be performed. This allows to avoid mesh adaption,
* e.g. in timestep adaption loops of timestep adaptive strategies.
*/
virtual Flag oneIteration(AdaptInfo& adaptInfo, Flag toDo = FULL_ITERATION) = 0;
/// Called after each adaption loop iteration.
virtual void endIteration(AdaptInfo&) { /* by default, do nothing */ }
/// Returns number of managed problems
virtual int numProblems() const = 0;
/** \brief
* Returns the problem with the given number. If only one problem
* is managed by this master problem, the number hasn't to be given.
*/
virtual ProblemStatBase& problem(int number = 0) = 0;
/// Returns the problem with the given name.
virtual ProblemStatBase& problem(std::string const& name) = 0;
/// Returns the name of the problem.
virtual std::string const& name() const = 0;
};
} // end namespace AMDiS
...@@ -32,8 +32,8 @@ INPUT += @top_srcdir@/src/amdis \ ...@@ -32,8 +32,8 @@ INPUT += @top_srcdir@/src/amdis \
@top_srcdir@/src/amdis/common \ @top_srcdir@/src/amdis/common \
@top_srcdir@/src/amdis/gridfunctions \ @top_srcdir@/src/amdis/gridfunctions \
@top_srcdir@/src/amdis/io \ @top_srcdir@/src/amdis/io \
@top_srcdir@/src/amdis/linear_algebra \ @top_srcdir@/src/amdis/linearalgebra \
@top_srcdir@/src/amdis/linear_algebra/mtl \ @top_srcdir@/src/amdis/linearalgebra/mtl \
@top_srcdir@/src/amdis/operations \ @top_srcdir@/src/amdis/operations \
@top_srcdir@/src/amdis/utility \ @top_srcdir@/src/amdis/utility \
@top_srcdir@/doc @top_srcdir@/doc
...@@ -45,8 +45,8 @@ INPUT += @top_srcdir@/src/amdis \ ...@@ -45,8 +45,8 @@ INPUT += @top_srcdir@/src/amdis \
# excluded from the INPUT source files. This way you can easily exclude a # 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. # subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE += @top_srcdir@/src/amdis/linear_algebra/eigen \ EXCLUDE += @top_srcdir@/src/amdis/linearalgebra/eigen \
@top_srcdir@/src/amdis/linear_algebra/istl @top_srcdir@/src/amdis/linearalgebra/istl
# The EXAMPLE_PATH tag can be used to specify one or more files or # The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see # directories that contain example code fragments that are included (see
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/Integrate.hpp> #include <amdis/Integrate.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp> #include <amdis/LocalOperators.hpp>
#include <amdis/common/Literals.hpp> #include <amdis/common/Literals.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/assembler/ConvectionDiffusionOperator.hpp> #include <amdis/localoperators/ConvectionDiffusionOperator.hpp>
#include <amdis/common/Literals.hpp> #include <amdis/common/Literals.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/Integrate.hpp> #include <amdis/Integrate.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#include <amdis/common/Literals.hpp> #include <amdis/common/Literals.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/AdaptInstationary.hpp> #include <amdis/AdaptInstationary.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemInstat.hpp> #include <amdis/ProblemInstat.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#include <amdis/GridFunctions.hpp> #include <amdis/GridFunctions.hpp>
#include <amdis/common/Literals.hpp> #include <amdis/common/Literals.hpp>
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/common/FieldMatVec.hpp> #include <amdis/common/FieldMatVec.hpp>
#include <amdis/AdaptInstationary.hpp> #include <amdis/AdaptInstationary.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/ProblemInstat.hpp> #include <amdis/ProblemInstat.hpp>
#include <amdis/Operators.hpp> #include <amdis/localoperators/StokesOperator.hpp>
#include <amdis/assembler/StokesOperator.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/Integrate.hpp> #include <amdis/Integrate.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp> #include <amdis/LocalOperators.hpp>
#include <amdis/common/Literals.hpp> #include <amdis/common/Literals.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/Integrate.hpp> #include <amdis/Integrate.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp> #include <amdis/LocalOperators.hpp>
#include <amdis/common/Literals.hpp> #include <amdis/common/Literals.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include <cmath> #include <cmath>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#ifdef DOW #ifdef DOW
#undef DOW #undef DOW
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include <cmath> #include <cmath>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#ifdef DOW #ifdef DOW
#undef DOW #undef DOW
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#include <cmath> #include <cmath>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp> #include <amdis/localoperators/StokesOperator.hpp>
#include <amdis/assembler/StokesOperator.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include <iostream> #include <iostream>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp> #include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
using namespace AMDiS; using namespace AMDiS;
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
// AMDiS includes // AMDiS includes
#include <amdis/Output.hpp> #include <amdis/Output.hpp>
#include <amdis/common/ConceptsBase.hpp> #include <amdis/common/ConceptsBase.hpp>
#include <amdis/common/Math.hpp> #include <amdis/typetree/TreePath.hpp>
#include <amdis/utility/TreePath.hpp>
namespace AMDiS namespace AMDiS
{ {
......
#pragma once #pragma once
#include <functional>
#include <memory>
#include <type_traits>
#include <dune/common/shared_ptr.hh>
#include <dune/geometry/quadraturerules.hh>
#include <amdis/ContextGeometry.hpp>
#include <amdis/AssemblerInterface.hpp>
#include <amdis/common/Concepts.hpp>
#include <amdis/typetree/FiniteElementType.hpp>
namespace AMDiS namespace AMDiS
{ {
template <class ElementAssembler, class IntersectionAssembler, class BoundaryAssembler> /// Implementation of interface \ref AssemblerBase
struct AssemblerTriple template <class LocalContext, class Operator, class... Nodes>
class Assembler
: public AssemblerInterface<LocalContext, Nodes...>
{ {
ElementAssembler elementAssembler; using Super = AssemblerInterface<LocalContext, Nodes...>;
IntersectionAssembler intersectionAssembler;
BoundaryAssembler boundaryAssembler; private:
};
using Element = typename Super::Element;
using Geometry = typename Super::Geometry;
using ElementMatrixVector = typename Super::ElementMatrixVector;
public:
template <class EA, class IA, class BA> /// Constructor. Stores a copy of operator `op`.
AssemblerTriple<EA, IA, BA> makeAssemblerTriple(EA const& ea, IA const& ia, BA const& ba) explicit Assembler(Operator const& op)
: op_(Dune::wrap_or_move(op))
{}
/// Constructor. Stores a copy of operator `op`.
explicit Assembler(Operator&& op)
: op_(Dune::wrap_or_move(std::move(op)))
{}
/// Constructor. Stores the reference to the operator.
explicit Assembler(std::reference_wrapper<Operator> op)
: op_(Dune::wrap_or_move(op.get()))
{}
/// \brief Implementation of \ref AssemblerInterface::bind.
/**
* Binds the operator `op_` to the `element` and `geometry` and
* stores point to the `element` and `geometry`.
**/
void bind(Element const& element, Geometry const& geometry) final
{ {
return {ea, ia, ba}; element_ = &element;
geometry_ = &geometry;
op_->bind(element, geometry);
} }
/// \brief Implementation of \ref AssemblerBase::unbind
template <class GridView, class Element, class Operators, class EA, class IA, class BA> /**
void assembleOperators( * Unbinds the operator `op_` and sets \ref element_ and \ref geometry_
GridView const& gridView, * to nullptr.
Element const& element, **/
Operators& operators, void unbind() final
AssemblerTriple<EA,IA,BA> const& assemblerTriple)
{ {
// assemble element operators op_->unbind();
assemblerTriple.elementAssembler(element, operators.onElement()); geometry_ = nullptr;
element_ = nullptr;
}
// assemble intersection operators /// Implementation of \ref AssemblerBase::assemble
if (!operators.onIntersection().empty() /**
|| (!operators.onBoundary().empty() && element.hasBoundaryIntersections())) * Stores geometry and localGeometry and calls
* \ref calculateElementVector or \ref calculateElementMatrix on the
* vector or matrix operator, respectively.
**/
void assemble(LocalContext const& localContext,
Nodes const&... nodes,
ElementMatrixVector& elementMatrixVector) final
{ {
for (auto const& intersection : intersections(gridView, element)) { ContextGeometry<LocalContext> context{localContext, element(), geometry()};
if (intersection.boundary()) assembleImpl(context, nodes..., elementMatrixVector);
assemblerTriple.boundaryAssembler(intersection, operators.onBoundary());
else
assemblerTriple.intersectionAssembler(intersection, operators.onIntersection());
} }
#ifndef DOXYGEN
protected: // implementation detail
// matrix assembling
template <class Context, class RowNode, class ColNode, class ElementMatrix>
void assembleImpl(Context const& context,
RowNode const& rowNode, ColNode const& colNode,
ElementMatrix& elementMatrix)
{
op_->calculateElementMatrix(context, rowNode, colNode, elementMatrix);
} }
// vector assembling
template <class Context, class Node, class ElementVector>
void assembleImpl(Context const& context,
Node const& node,
ElementVector& elementVector)
{
op_->calculateElementVector(context, node, elementVector);
} }
#endif // DOXYGEN
public:
template <class Node, class ElementVector> /// return the bound entity (of codim 0)
auto makeVectorAssembler(Node const& node, ElementVector& elementVector) Element const& element() const
{ {
return makeAssemblerTriple( assert( element_ );
[&](auto const& element, auto& operators) { return *element_;
for (auto op : operators)
op->assemble(element, node, elementVector);
},
[&](auto const& is, auto& operators) {
for (auto op : operators)
op->assemble(is, node, elementVector);
},
[&](auto const& bis, auto& operators) {
for (auto data : operators) {
if (data.bc.onBoundary(bis))
data.op->assemble(bis, node, elementVector);
} }
});
/// return the geometry of the bound element
Geometry const& geometry() const
{
assert( geometry_ );
return *geometry_;
} }
template <class RowNode, class ColNode, class ElementMatrix> private:
auto makeMatrixAssembler(RowNode const& rowNode, ColNode const& colNode, ElementMatrix& elementMatrix)
/// the stored operator, implementing \ref GridFunctionOperatorBase
std::shared_ptr<Operator> op_;
Element const* element_ = nullptr;
Geometry const* geometry_ = nullptr;
};
/// Generate a \ref Assembler on a given `LocalContext` (element or intersection)
template <class LocalContext, class Operator, class... Nodes>
auto makeAssembler(Operator&& op, Nodes const&...)
{ {
return makeAssemblerTriple( return Assembler<LocalContext, Underlying_t<Operator>, Nodes...>{std::forward<Operator>(op)};
[&](auto const& element, auto& operators) {
for (auto op : operators)
op->assemble(element, rowNode, colNode, elementMatrix);
},
[&](auto const& is, auto& operators) {
for (auto op : operators)
op->assemble(is, rowNode, colNode, elementMatrix);
},
[&](auto const& bis, auto& operators) {
for (auto data : operators) {
if (data.bc.onBoundary(bis))
data.op->assemble(bis, rowNode, colNode, elementMatrix);
}
});
} }
} // end namespace AMDiS } // end namespace AMDiS
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
namespace AMDiS namespace AMDiS
{ {
/// Abstract base-class of a \ref LocalAssembler /// Abstract base-class of a \ref Assembler
template <class LocalContext, class... Nodes> template <class LocalContext, class... Nodes>
class LocalAssemblerBase class AssemblerInterface
{ {
using ContextType = Impl::ContextTypes<LocalContext>;
public: public:
/// The codim=0 grid entity /// The codim=0 grid entity
using Element = typename Impl::ContextTypes<LocalContext>::Entity; using Element = typename ContextType::Entity;
/// The geometry of the \ref Element /// The geometry of the \ref Element
using Geometry = typename Element::Geometry; using Geometry = typename Element::Geometry;
...@@ -33,7 +35,7 @@ namespace AMDiS ...@@ -33,7 +35,7 @@ namespace AMDiS
public: public:
/// Virtual destructor /// Virtual destructor
virtual ~LocalAssemblerBase() = default; virtual ~AssemblerInterface() = default;
/// Bind the local-assembler to the grid-element with its corresponding geometry /// Bind the local-assembler to the grid-element with its corresponding geometry
virtual void bind(Element const& element, Geometry const& geometry) = 0; virtual void bind(Element const& element, Geometry const& geometry) = 0;
......
...@@ -20,13 +20,18 @@ install(FILES ...@@ -20,13 +20,18 @@ install(FILES
AdaptStationary.hpp AdaptStationary.hpp
AMDiS.hpp AMDiS.hpp
Assembler.hpp Assembler.hpp
AssemblerInterface.hpp
Boundary.hpp Boundary.hpp
BoundaryCondition.hpp
BoundaryManager.hpp
ContextGeometry.hpp ContextGeometry.hpp
CreatorInterface.hpp CreatorInterface.hpp
CreatorMap.hpp CreatorMap.hpp
DataTransfer.hpp DataTransfer.hpp
DataTransfer.inc.hpp
DirichletBC.hpp DirichletBC.hpp
FileWriter.hpp FileWriter.hpp
FileWriterInterface.hpp
Flag.hpp Flag.hpp
GridFunctionOperator.hpp GridFunctionOperator.hpp
GridFunctions.hpp GridFunctions.hpp
...@@ -34,18 +39,18 @@ install(FILES ...@@ -34,18 +39,18 @@ install(FILES
GridTransferManager.hpp GridTransferManager.hpp
Initfile.hpp Initfile.hpp
InitfileParser.hpp InitfileParser.hpp