Skip to content
Snippets Groups Projects
Commit f6447413 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

removed a lot obsolete code

parent 9e2dadcb
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 86 deletions
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- #ifdef HAVE_CONFIG_H
// vi: set et ts=4 sw=2 sts=2: #include "config.h"
#endif
#include <iostream> #include <iostream>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
...@@ -26,13 +26,13 @@ int main(int argc, char** argv) ...@@ -26,13 +26,13 @@ int main(int argc, char** argv)
// -div(A*grad(u)) + div(b*u) + c*u = f // -div(A*grad(u)) + div(b*u) + c*u = f
auto opCD = convectionDiffusion(/*A=*/1.0, /*b=*/0.0, /*c=*/1.0, /*f=*/1.0); auto opCD = convectionDiffusion(/*A=*/1.0, /*b=*/0.0, /*c=*/1.0, /*f=*/1.0);
prob.addMatrixOperator(opCD, _0, _0); prob.addMatrixOperator(opCD, 0, 0);
prob.addVectorOperator(opCD, _0); prob.addVectorOperator(opCD, 0);
// set boundary condition // set boundary condition
auto predicate = [](auto const& x){ return x[0] < 1.e-8 || x[1] < 1.e-8; }; // define boundary auto predicate = [](auto const& x){ return x[0] < 1.e-8 || x[1] < 1.e-8; }; // define boundary
auto dbcValues = [](auto const& x){ return 0.0; }; // set value auto dbcValues = [](auto const& x){ return 0.0; }; // set value
prob.addDirichletBC(predicate, _0, _0, dbcValues); prob.addDirichletBC(predicate, 0, 0, dbcValues);
AdaptInfo adaptInfo("adapt"); AdaptInfo adaptInfo("adapt");
prob.buildAfterCoarsen(adaptInfo, Flag(0)); prob.buildAfterCoarsen(adaptInfo, Flag(0));
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- #ifdef HAVE_CONFIG_H
// vi: set et ts=4 sw=2 sts=2: #include "config.h"
#endif
#include <iostream> #include <iostream>
#include <fmt/core.h> #include <fmt/core.h>
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- #ifdef HAVE_CONFIG_H
// vi: set et ts=4 sw=2 sts=2: #include "config.h"
#endif
#include <iostream> #include <iostream>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream> #include <iostream>
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
...@@ -41,8 +45,8 @@ int main(int argc, char** argv) ...@@ -41,8 +45,8 @@ int main(int argc, char** argv)
AdaptInfo adaptInfo("adapt"); AdaptInfo adaptInfo("adapt");
// tree-paths for components // tree-paths for components
auto _v = 0_c; auto _v = Dune::Indices::_0;
auto _p = 1_c; auto _p = Dune::Indices::_1;
// <1/tau * u, v> // <1/tau * u, v>
auto opTime = makeOperator(tag::testvec_trialvec{}, density); auto opTime = makeOperator(tag::testvec_trialvec{}, density);
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream> #include <iostream>
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
...@@ -30,8 +34,8 @@ int main(int argc, char** argv) ...@@ -30,8 +34,8 @@ int main(int argc, char** argv)
Parameters::get("stokes->viscosity", viscosity); Parameters::get("stokes->viscosity", viscosity);
// tree-paths for components // tree-paths for components
auto _v = 0_c; auto _v = Dune::Indices::_0;
auto _p = 1_c; auto _p = Dune::Indices::_1;
// <viscosity*grad(u_i), grad(v_i)> // <viscosity*grad(u_i), grad(v_i)>
for (std::size_t i = 0; i < DOW; ++i) { for (std::size_t i = 0; i < DOW; ++i) {
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream> #include <iostream>
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
...@@ -30,8 +34,8 @@ int main(int argc, char** argv) ...@@ -30,8 +34,8 @@ int main(int argc, char** argv)
Parameters::get("stokes->viscosity", viscosity); Parameters::get("stokes->viscosity", viscosity);
// tree-paths for components // tree-paths for components
auto _v = 0_c; auto _v = Dune::Indices::_0;
auto _p = 1_c; auto _p = Dune::Indices::_1;
// <viscosity*grad(u_i), grad(v_i)> // <viscosity*grad(u_i), grad(v_i)>
for (std::size_t i = 0; i < DOW; ++i) { for (std::size_t i = 0; i < DOW; ++i) {
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream> #include <iostream>
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
...@@ -24,8 +28,8 @@ int main(int argc, char** argv) ...@@ -24,8 +28,8 @@ int main(int argc, char** argv)
Parameters::get("stokes->viscosity", viscosity); Parameters::get("stokes->viscosity", viscosity);
// tree-paths for components // tree-paths for components
auto _v = 0_c; auto _v = Dune::Indices::_0;
auto _p = 1_c; auto _p = Dune::Indices::_1;
auto opStokes = makeOperator(tag::stokes{}, viscosity); auto opStokes = makeOperator(tag::stokes{}, viscosity);
prob.addMatrixOperator(opStokes, treepath(), treepath()); prob.addMatrixOperator(opStokes, treepath(), treepath());
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <iostream> #include <iostream>
#include <amdis/AMDiS.hpp> #include <amdis/AMDiS.hpp>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <amdis/LinearAlgebra.hpp> #include <amdis/LinearAlgebra.hpp>
#include <amdis/LocalAssemblerList.hpp> #include <amdis/LocalAssemblerList.hpp>
#include <amdis/common/Mpl.hpp> #include <amdis/common/Mpl.hpp>
#include <amdis/common/TypeDefs.hpp>
namespace AMDiS namespace AMDiS
{ {
......
...@@ -24,8 +24,8 @@ void Assembler<Traits>::assemble( ...@@ -24,8 +24,8 @@ void Assembler<Traits>::assemble(
// 2. create a local matrix and vector // 2. create a local matrix and vector
std::size_t localSize = localView.maxSize(); std::size_t localSize = localView.maxSize();
Impl::ElementMatrix elementMatrix(localSize, localSize); mtl::mat::dense2D<typename SystemMatrixType::value_type> elementMatrix(localSize, localSize);
Impl::ElementVector elementVector(localSize); mtl::vec::dense_vector<typename SystemVectorType::value_type> elementVector(localSize);
// 3. traverse grid and assemble operators on the elements // 3. traverse grid and assemble operators on the elements
for (auto const& element : elements(globalBasis_.gridView())) for (auto const& element : elements(globalBasis_.gridView()))
......
...@@ -11,12 +11,14 @@ ...@@ -11,12 +11,14 @@
#include <amdis/Output.hpp> #include <amdis/Output.hpp>
#include <amdis/common/Concepts.hpp> #include <amdis/common/Concepts.hpp>
#include <amdis/common/ValueCategory.hpp> #include <amdis/common/ValueCategory.hpp>
#include <amdis/linear_algebra/mtl/MTLDenseVector.hpp> #include <amdis/linear_algebra/HierarchicWrapper.hpp>
#include <amdis/utility/RangeType.hpp> #include <amdis/utility/RangeType.hpp>
#include <amdis/utility/TreeData.hpp> #include <amdis/utility/TreeData.hpp>
namespace AMDiS namespace AMDiS
{ {
struct BoundaryType { int b; };
/// Implements a boundary condition of Dirichlet-type. /// Implements a boundary condition of Dirichlet-type.
/** /**
* By calling the methods \ref init() and \ref finish before and after * By calling the methods \ref init() and \ref finish before and after
...@@ -82,13 +84,13 @@ namespace AMDiS ...@@ -82,13 +84,13 @@ namespace AMDiS
using Dune::Functions::interpolate; using Dune::Functions::interpolate;
Dune::Hybrid::ifElse(std::is_same<RangeType_t<typename RowBasis::LocalView::Tree>, Range>{}, Dune::Hybrid::ifElse(std::is_same<RangeType_t<typename RowBasis::LocalView::Tree>, Range>{},
[&](auto id) { [&](auto id) {
auto rhsWrapper = wrapper(rhs.vector()); auto rhsWrapper = hierarchicVectorWrapper(rhs.vector());
interpolate(id(rowBasis), rhsWrapper, values_, dirichletNodes_); interpolate(id(rowBasis), rhsWrapper, values_, dirichletNodes_);
}); });
Dune::Hybrid::ifElse(std::is_same<RangeType_t<typename ColBasis::LocalView::Tree>, Range>{}, Dune::Hybrid::ifElse(std::is_same<RangeType_t<typename ColBasis::LocalView::Tree>, Range>{},
[&](auto id) { [&](auto id) {
auto solutionWrapper = wrapper(solution.vector()); auto solutionWrapper = hierarchicVectorWrapper(solution.vector());
interpolate(id(colBasis), solutionWrapper, values_, dirichletNodes_); interpolate(id(colBasis), solutionWrapper, values_, dirichletNodes_);
}); });
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
#include <dune/functions/functionspacebases/boundarydofs.hh> #include <dune/functions/functionspacebases/boundarydofs.hh>
#include <dune/functions/functionspacebases/interpolate.hh> #include <dune/functions/functionspacebases/interpolate.hh>
#include <dune/functions/functionspacebases/subspacebasis.hh> #include <dune/functions/functionspacebases/subspacebasis.hh>
#include <amdis/LinearAlgebra.hpp>
#include <amdis/linear_algebra/HierarchicWrapper.hpp>
#include <amdis/linear_algebra/mtl/MTLDenseVector.hpp>
namespace AMDiS namespace AMDiS
{ {
......
...@@ -2,30 +2,7 @@ ...@@ -2,30 +2,7 @@
#include <amdis/linear_algebra/LinearSolverInterface.hpp> #include <amdis/linear_algebra/LinearSolverInterface.hpp>
#include <amdis/linear_algebra/SolverInfo.hpp> #include <amdis/linear_algebra/SolverInfo.hpp>
#include <amdis/linear_algebra/mtl/DOFVector.hpp>
#if defined(AMDIS_BACKEND_ISTL) #include <amdis/linear_algebra/mtl/DOFMatrix.hpp>
#include <amdis/linear_algebra/istl/SystemVector.hpp>
#include <amdis/linear_algebra/istl/SystemMatrix.hpp>
#include <amdis/linear_algebra/istl/LinearSolver.hpp>
#elif defined(AMDIS_BACKEND_MTL)
#include <amdis/linear_algebra/mtl/SystemVector.hpp>
#include <amdis/linear_algebra/mtl/SystemMatrix.hpp>
#include <amdis/linear_algebra/mtl/LinearSolver.hpp> #include <amdis/linear_algebra/mtl/LinearSolver.hpp>
#include <amdis/linear_algebra/mtl/ITL_Solver.hpp> #include <amdis/linear_algebra/mtl/ITL_Solver.hpp>
#include <amdis/linear_algebra/mtl/BITL_Solver.hpp>
#elif defined(AMDIS_BACKEND_PETSC)
#include <amdis/linear_algebra/petsc/SystemVector.hpp>
#include <amdis/linear_algebra/petsc/SystemMatrix.hpp>
#include <amdis/linear_algebra/petsc/LinearSolver.hpp>
#else
#error "Unknown linear algebra backend!. Set corresponding variable \
AMDIS_BACKEND_ISTL, AMDIS_BACKEND_MTL or AMDIS_BACKEND_PETSC."
#endif
\ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
#include <type_traits> #include <type_traits>
#include <boost/numeric/mtl/mtl.hpp>
#include <amdis/ContextGeometry.hpp> #include <amdis/ContextGeometry.hpp>
// #include <amdis/common/ConceptsBase.hpp>
#include <amdis/common/TypeDefs.hpp>
namespace AMDiS namespace AMDiS
{ {
...@@ -22,10 +22,13 @@ namespace AMDiS ...@@ -22,10 +22,13 @@ namespace AMDiS
static_assert( numNodes == 1 || numNodes == 2, static_assert( numNodes == 1 || numNodes == 2,
"VectorAssembler gets 1 Node, MatrixAssembler gets 2 Nodes!"); "VectorAssembler gets 1 Node, MatrixAssembler gets 2 Nodes!");
using ElementMatrix = mtl::mat::dense2D<double>; // TODO: choose correct value_type
using ElementVector = mtl::vec::dense_vector<double>;
/// Either an ElementVector or an ElementMatrix (depending on the number of nodes) /// Either an ElementVector or an ElementMatrix (depending on the number of nodes)
using ElementMatrixVector = std::conditional_t< using ElementMatrixVector = std::conditional_t<
(sizeof...(Nodes)==1), Impl::ElementVector, std::conditional_t< (sizeof...(Nodes)==1), ElementVector, std::conditional_t<
(sizeof...(Nodes)==2), Impl::ElementMatrix, void>>; (sizeof...(Nodes)==2), ElementMatrix, void>>;
public: public:
/// Virtual destructor /// Virtual destructor
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <amdis/StandardProblemIteration.hpp> #include <amdis/StandardProblemIteration.hpp>
#include <amdis/common/TupleUtility.hpp> #include <amdis/common/TupleUtility.hpp>
#include <amdis/common/TypeDefs.hpp>
#include <amdis/common/Utility.hpp> #include <amdis/common/Utility.hpp>
#include <amdis/GridFunctions.hpp> #include <amdis/GridFunctions.hpp>
......
...@@ -19,7 +19,6 @@ install(FILES ...@@ -19,7 +19,6 @@ install(FILES
Size.hpp Size.hpp
Tags.hpp Tags.hpp
TupleUtility.hpp TupleUtility.hpp
TypeDefs.hpp
Utility.hpp Utility.hpp
ValueCategory.hpp ValueCategory.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/common) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/common)
#pragma once
#include <type_traits>
#include <amdis/linear_algebra/Mtl.hpp>
namespace AMDiS
{
namespace Impl
{
using ElementVector = mtl::dense_vector<double>;
using ElementMatrix = mtl::dense2D<double>;
using SystemVector = mtl::dense_vector<double>;
using SystemMatrix = mtl::compressed2D<double>;
} // end namespace Impl
struct BoundaryType { int b; };
} // end namespace AMDiS
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
install(FILES install(FILES
HierarchicWrapper.hpp HierarchicWrapper.hpp
LinearAlgebraBase.hpp
LinearSolverInterface.hpp LinearSolverInterface.hpp
Mtl.hpp
PreconditionerInterface.hpp PreconditionerInterface.hpp
RunnerInterface.hpp RunnerInterface.hpp
SolverInfo.hpp SolverInfo.hpp
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
namespace AMDiS namespace AMDiS
{ {
class DOFVectorBase class DOFVectorInterface
{ {
public: public:
/// Virtual destructor /// Virtual destructor
~DOFVectorBase() = default; ~DOFVectorInterface() = default;
/// Change dimension of DOFVector to dimension of basis /// Change dimension of DOFVector to dimension of basis
virtual void compress() = 0; virtual void compress() = 0;
......
#pragma once #pragma once
#include <boost/numeric/mtl/mtl_fwd.hpp>
#include <dune/functions/functionspacebases/sizeinfo.hh> #include <dune/functions/functionspacebases/sizeinfo.hh>
#include <amdis/utility/MultiIndex.hpp> #include <amdis/utility/MultiIndex.hpp>
...@@ -86,7 +87,7 @@ namespace AMDiS ...@@ -86,7 +87,7 @@ namespace AMDiS
} }
template <class... Params> template <class... Params>
std::size_t sizeImpl(mtl::dense_vector<Params...> const& v) const std::size_t sizeImpl(mtl::vec::dense_vector<Params...> const& v) const
{ {
return mtl::size(v); return mtl::size(v);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment