Commit 1681e00a authored by Praetorius, Simon's avatar Praetorius, Simon

renamed path dune/amdis to amdis

parent 91f95d14
cmake_minimum_required(VERSION 3.1)
project(dune-amdis CXX)
if(NOT (dune-common_DIR OR dune-common_ROOT OR
"${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
string(REPLACE ${CMAKE_PROJECT_NAME} dune-common dune-common_DIR
${PROJECT_BINARY_DIR})
endif()
project(amdis CXX)
#find dune-common and set the module path
find_package(dune-common REQUIRED)
......@@ -17,33 +11,30 @@ include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
dune_enable_all_packages(MODULE_LIBRARIES amdis)
include(AmdisMacros)
add_subdirectory("src")
add_subdirectory("test")
add_subdirectory("dune")
add_subdirectory("examples")
add_subdirectory("doc")
add_subdirectory("cmake/modules")
# some additional packages and flags
add_dune_alberta_flags("amdis" OBJECT USE_GENERIC)
target_compile_definitions("amdis" PUBLIC AMDIS_BACKEND_MTL=1)
target_compile_options("amdis" PUBLIC -ftemplate-backtrace-limit=0 -Wall -pedantic -Wno-unused-parameter)
find_package(MTL REQUIRED
PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4)
if (MTL_FOUND)
target_include_directories("amdis" PUBLIC ${MTL_INCLUDE_DIRS})
target_include_directories(amdis PUBLIC ${MTL_INCLUDE_DIRS})
set (CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
foreach (feature ${CXX_ELEVEN_FEATURE_LIST})
target_compile_definitions("amdis" PUBLIC MTL_WITH_${feature})
target_compile_definitions(amdis PUBLIC MTL_WITH_${feature})
endforeach ()
if (HAVE_UMFPACK OR ENABLE_SUITESPARSE OR SuiteSparse_FOUND)
target_compile_definitions("amdis" PUBLIC MTL_HAS_UMFPACK)
target_compile_definitions(amdis PUBLIC MTL_HAS_UMFPACK)
endif ()
endif (MTL_FOUND)
......
# File for module specific CMake tests.
include(AMDiSCXXFeatures)
\ No newline at end of file
include(AMDiSCXXFeatures)
#find_package(SuiteSparse)
#find_package(Alberta)
\ No newline at end of file
......@@ -13,10 +13,10 @@ and \f$ g(x) \equiv 0 \f$, the domain \f$ \Omega \f$ a square domain \f$ [0,1]^2
and \f$ \Gamma \f$ the lower and left edge of the boundary.
~~~~~~~~~~~~~~~{.cpp}
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/AdaptInfo.hpp>
#include <dune/amdis/AdaptStationary.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/AdaptInfo.hpp>
#include <amdis/AdaptStationary.hpp>
#include <amdis/ProblemStat.hpp>
// The namespace all AMDiS classes and functions are defined in
using namespace AMDiS;
......
......@@ -3,7 +3,7 @@
################################
#Name of the module
Module: dune-amdis
Module: amdis
Version: 0.1
Maintainer: simon.praetorius@tu-dresden.de
#depending on
......
add_subdirectory(amdis)
# add_subdirectory(amdis/test)
\ No newline at end of file
#pragma once
#include <dune/amdis/linear_algebra/LinearSolverInterface.hpp>
#include <dune/amdis/linear_algebra/SolverInfo.hpp>
#if defined(AMDIS_BACKEND_ISTL)
#include <dune/amdis/linear_algebra/istl/SystemVector.hpp>
#include <dune/amdis/linear_algebra/istl/SystemMatrix.hpp>
#include <dune/amdis/linear_algebra/istl/LinearSolver.hpp>
#elif defined(AMDIS_BACKEND_MTL)
#include <dune/amdis/linear_algebra/mtl/SystemVector.hpp>
#include <dune/amdis/linear_algebra/mtl/SystemMatrix.hpp>
#include <dune/amdis/linear_algebra/mtl/LinearSolver.hpp>
#include <dune/amdis/linear_algebra/mtl/ITL_Solver.hpp>
#include <dune/amdis/linear_algebra/mtl/BITL_Solver.hpp>
#elif defined(AMDIS_BACKEND_PETSC)
#include <dune/amdis/linear_algebra/petsc/SystemVector.hpp>
#include <dune/amdis/linear_algebra/petsc/SystemMatrix.hpp>
#include <dune/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
set(projects2d "ellipt" "heat" "vecellipt" "stokes0" "stokes1" "stokes3" "navier_stokes")
foreach(project ${projects2d})
add_executable(${project}.2d ${project}.cc)
add_dune_alberta_flags(GRIDDIM 2 WORLDDIM 2 ${project}.2d)
target_link_dune_default_libraries(${project}.2d)
target_link_libraries(${project}.2d "amdis")
target_compile_definitions(${project}.2d PRIVATE AMDIS_DIM=2 AMDIS_DOW=2)
endforeach()
set(projects3d "ellipt" "heat")
foreach(project ${projects3d})
add_executable(${project}.3d ${project}.cc)
add_dune_alberta_flags(GRIDDIM 3 WORLDDIM 3 ${project}.3d)
target_link_dune_default_libraries(${project}.3d)
target_link_libraries(${project}.3d "amdis")
target_compile_definitions(${project}.3d PRIVATE AMDIS_DIM=3 AMDIS_DOW=3)
endforeach()
\ No newline at end of file
......@@ -3,10 +3,10 @@
#include <iostream>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Operators.hpp>
#include <dune/amdis/common/Literals.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#include <amdis/common/Literals.hpp>
using namespace AMDiS;
......
......@@ -3,13 +3,13 @@
#include <iostream>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/AdaptInstationary.hpp>
#include <dune/amdis/ProblemInstat.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Operators.hpp>
#include <dune/amdis/GridFunctions.hpp>
#include <dune/amdis/common/Literals.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/AdaptInstationary.hpp>
#include <amdis/ProblemInstat.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#include <amdis/GridFunctions.hpp>
#include <amdis/common/Literals.hpp>
using namespace AMDiS;
......
......@@ -2,27 +2,18 @@
#include <ctime>
#include <cmath>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/AdaptInstationary.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/ProblemInstat.hpp>
#include <dune/amdis/Operators.hpp>
#include <dune/amdis/assembler/StokesOperator.hpp>
#ifdef DOW
#undef DOW
#endif
#define DOW AMDIS_DOW
#ifndef STRATEGY
#define STRATEGY 1
#endif
#include <amdis/AMDiS.hpp>
#include <amdis/AdaptInstationary.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/ProblemInstat.hpp>
#include <amdis/Operators.hpp>
#include <amdis/assembler/StokesOperator.hpp>
using namespace AMDiS;
struct NavierStokesBasis
{
using Grid = Dune::AlbertaGrid<AMDIS_DIM,AMDIS_DOW>;
using Grid = Dune::YaspGrid<AMDIS_DIM>;
using GlobalBasis = typename TaylorHoodBasis<Grid::LeafGridView>::GlobalBasis;
};
......@@ -69,7 +60,7 @@ int main(int argc, char** argv)
auto opNonlin1 = makeOperator(tag::testvec_trialvec{}, density * trans(gradientAtQP(prob.getSolution(_v))));
prob.addMatrixOperator(opNonlin1, _v, _v);
for (std::size_t i = 0; i < DOW; ++i) {
for (std::size_t i = 0; i < AMDIS_DOW; ++i) {
// <(u^old * nabla)u_i, v_i>
auto opNonlin2 = makeOperator(tag::test_gradtrial{}, density * prob.getSolution(_v));
prob.addMatrixOperator(opNonlin2, treepath(_v,i), treepath(_v,i));
......
#pragma once
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/LinearAlgebra.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/LinearAlgebra.hpp>
namespace AMDiS
{
......
#pragma once
#include "BlockPreconditioner.hpp"
#include <dune/amdis/common/Literals.hpp>
#include <amdis/common/Literals.hpp>
namespace AMDiS
{
......
......@@ -9,7 +9,7 @@
#include <dune/istl/multitypeblockvector.hh>
#include <dune/istl/preconditioner.hh>
#include <dune/amdis/common/Mpl.hpp>
#include <amdis/common/Mpl.hpp>
namespace AMDiS {
......
......@@ -5,11 +5,11 @@
#include <ctime>
#include <cmath>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/AdaptInstationary.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/ProblemInstat.hpp>
#include <dune/amdis/Terms.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/AdaptInstationary.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/ProblemInstat.hpp>
#include <amdis/Terms.hpp>
#include "MTLPfcPrecon.hpp"
......
......@@ -2,9 +2,9 @@
#include <ctime>
#include <cmath>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Operators.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#ifdef DOW
#undef DOW
......@@ -47,6 +47,8 @@ int main(int argc, char** argv)
prob.addMatrixOperator(opDiv, _p, treepath(_v,i));
}
auto opZero = makeOperator(tag::test_trial{}, 0.0);
prob.addMatrixOperator(opZero, _p, _p);
// define boundary regions
auto left = [](auto const& x) { return x[0] < 1.e-8; };
......@@ -74,6 +76,11 @@ int main(int argc, char** argv)
// assemble and solve system
prob.buildAfterCoarsen(adaptInfo, Flag(0));
// write matrix to file
mtl::io::matrix_market_ostream out("matrix_stokes0.mtx");
out << prob.getSystemMatrix()->getMatrix();
std::cout << prob.getSystemMatrix()->getMatrix() << '\n';
prob.solve(adaptInfo);
// output solution
......
......@@ -2,9 +2,9 @@
#include <ctime>
#include <cmath>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Operators.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#ifdef DOW
#undef DOW
......@@ -78,14 +78,9 @@ int main(int argc, char** argv)
prob.buildAfterCoarsen(adaptInfo, Flag(0));
// write matrix to file
if (Parameters::get<int>("stokesMesh->global refinements").value_or(0) < 2) {
mtl::io::matrix_market_ostream out("stokes_matrix.mtx");
out << prob.getSystemMatrix()->getMatrix();
std::cout << "A = \n" << prob.getSystemMatrix()->getMatrix() << '\n';
std::cout << "x = \n" << prob.getSolution()->getVector() << '\n';
std::cout << "b = \n" << prob.getRhs()->getVector() << '\n';
}
mtl::io::matrix_market_ostream out("matrix_stokes1.mtx");
out << prob.getSystemMatrix()->getMatrix();
std::cout << prob.getSystemMatrix()->getMatrix() << '\n';
prob.solve(adaptInfo);
......
......@@ -2,10 +2,10 @@
#include <ctime>
#include <cmath>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Operators.hpp>
#include <dune/amdis/assembler/StokesOperator.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
#include <amdis/assembler/StokesOperator.hpp>
using namespace AMDiS;
......@@ -30,6 +30,9 @@ int main(int argc, char** argv)
auto opStokes = makeOperator(tag::stokes{}, viscosity);
prob.addMatrixOperator(opStokes, treepath(), treepath());
auto opZero = makeOperator(tag::test_trial{}, 0.0);
prob.addMatrixOperator(opZero, _p, _p);
// define boundary regions
auto left = [](auto const& x) { return x[0] < 1.e-8; };
auto not_left = [](auto const& x) { return x[0] > 1.0 - 1.e-8 || x[1] < 1.e-8 || x[1] > 1.0 - 1.e-8; };
......
#include <iostream>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Operators.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/Operators.hpp>
using namespace AMDiS;
......
set(projects2d "ellipt" "heat" "vecellipt" "expressions" "stokes0" "stokes1" "stokes3")
foreach(project ${projects2d})
add_executable(${project}.2d ${project}.cc)
add_dune_alberta_flags(GRIDDIM 2 WORLDDIM 2 ${project}.2d)
target_link_dune_default_libraries(${project}.2d)
target_link_libraries(${project}.2d "amdis")
target_compile_definitions(${project}.2d PRIVATE AMDIS_DIM=2 AMDIS_DOW=2)
endforeach()
set(projects3d "ellipt" "heat")
foreach(project ${projects3d})
add_executable(${project}.3d ${project}.cc)
add_dune_alberta_flags(GRIDDIM 3 WORLDDIM 3 ${project}.3d)
target_link_dune_default_libraries(${project}.3d)
target_link_libraries(${project}.3d "amdis")
target_compile_definitions(${project}.3d PRIVATE AMDIS_DIM=3 AMDIS_DOW=3)
endforeach()
\ No newline at end of file
add_subdirectory(amdis)
\ No newline at end of file
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#include <iostream>
#include <dune/amdis/AMDiS.hpp>
#include <dune/amdis/ProblemStat.hpp>
#include <dune/amdis/Terms.hpp>
using namespace AMDiS;
// 1 component with polynomial degree 1
using HeatParam = TestTraits<AMDIS_DIM, 2>;
using HeatProblem = ProblemStat<HeatParam>;
int main(int argc, char** argv)
{
AMDiS::init(argc, argv);
HeatProblem prob("heat");
prob.initialize(INIT_ALL);
AdaptInfo adaptInfo("adapt");
double tau = adaptInfo.getTimestep();
AMDIS_MSG("timestep = " << tau);
using Op = HeatProblem::ElementOperator;
Op opLhs;
opLhs.addZOT( constant(1.0/tau) );
opLhs.addSOT( constant(1.0) );
Op opRhs;
opRhs.addZOT( valueOf(prob.getSolution<0>(), 1.0/tau) );
opRhs.addZOT( eval([](auto const& x) { return -1.0; }) );
prob.addMatrixOperator(opLhs, 0, 0);
prob.addVectorOperator(opRhs, 0);
// set boundary condition
auto predicate = [](auto const& p){ return p[0] < 1.e-8 || p[1] < 1.e-8; };
auto dbcValues = [](auto const& p){ return 0.0; };
prob.addDirichletBC(predicate, 0, 0, dbcValues);
prob.getSolution<0>().getVector() = 0.0;
double t = 0.0;
for (t = adaptInfo.getStartTime();
t < adaptInfo.getEndTime();
t+= adaptInfo.getTimestep())
{
prob.writeFiles(adaptInfo, t);
prob.buildAfterCoarsen(adaptInfo, Flag(0));
prob.solve(adaptInfo);
}
prob.writeFiles(adaptInfo, t);
AMDiS::finalize();
return 0;
}
\ No newline at end of file
#include "AMDiS.hpp"
// AMDiS includes
#include <dune/amdis/Initfile.hpp>
#include <dune/amdis/Output.hpp>
#include <amdis/Initfile.hpp>
#include <amdis/Output.hpp>
namespace AMDiS
{
......
......@@ -4,7 +4,7 @@
#include <string>
#include <iostream>
#include <dune/amdis/Initfile.hpp>
#include <amdis/Initfile.hpp>
namespace AMDiS
{
......
......@@ -8,8 +8,8 @@
#include <vector>
// AMDiS includes
#include <dune/amdis/Output.hpp>
#include <dune/amdis/common/Math.hpp>
#include <amdis/Output.hpp>
#include <amdis/common/Math.hpp>
namespace AMDiS
{
......
#include "AdaptInstationary.hpp"
// AMDiS includes
#include <dune/amdis/AdaptInfo.hpp>
#include <dune/amdis/Flag.hpp>
#include <dune/amdis/Initfile.hpp>
#include <dune/amdis/Output.hpp>
#include <dune/amdis/ProblemIterationInterface.hpp>
#include <dune/amdis/ProblemTimeInterface.hpp>
#include <amdis/AdaptInfo.hpp>
#include <amdis/Flag.hpp>
#include <amdis/Initfile.hpp>
#include <amdis/Output.hpp>
#include <amdis/ProblemIterationInterface.hpp>
#include <amdis/ProblemTimeInterface.hpp>
namespace AMDiS
{
......
......@@ -6,11 +6,11 @@
#include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#include <dune/amdis/DirichletBC.hpp>
#include <dune/amdis/LinearAlgebra.hpp>
#include <dune/amdis/LocalAssemblerBase.hpp>
#include <dune/amdis/common/Mpl.hpp>
#include <dune/amdis/common/TypeDefs.hpp>
#include <amdis/DirichletBC.hpp>
#include <amdis/LinearAlgebra.hpp>
#include <amdis/LocalAssemblerBase.hpp>
#include <amdis/common/Mpl.hpp>
#include <amdis/common/TypeDefs.hpp>
namespace AMDiS
{
......
#pragma once
#include <dune/functions/functionspacebases/subspacebasis.hh>
#include <dune/amdis/utility/TreePath.hpp>
#include <dune/amdis/utility/Visitor.hpp>
#include <amdis/utility/TreePath.hpp>
#include <amdis/utility/Visitor.hpp>
#include <dune/amdis/common/Math.hpp>
#include <amdis/common/Math.hpp>
namespace AMDiS {
......
......@@ -13,6 +13,7 @@ dune_library_add_sources(amdis SOURCES
ProblemStat.cpp
StandardProblemIteration.cpp
)
link_libraries(amdis)
install(FILES
AdaptBase.hpp
......@@ -50,7 +51,7 @@ install(FILES
ProblemStatTraits.hpp
ProblemTimeInterface.hpp
StandardProblemIteration.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/amdis)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis)
add_subdirectory("assembler")
add_subdirectory("common")
......
......@@ -3,8 +3,8 @@
#include <memory>
#include <string>
#include <dune/amdis/common/Utility.hpp>
#include <dune/amdis/Output.hpp>
#include <amdis/common/Utility.hpp>
#include <amdis/Output.hpp>
namespace AMDiS
{
......
......@@ -5,7 +5,7 @@
#include <string>
// AMDiS includes
#include <dune/amdis/CreatorInterface.hpp>
#include <amdis/CreatorInterface.hpp>
namespace AMDiS
{
......
......@@ -5,11 +5,11 @@
#include <type_traits>
#include <vector>
#include <dune/amdis/Output.hpp>
#include <dune/amdis/common/Concepts.hpp>
#include <dune/amdis/common/ValueCategory.hpp>
#include <dune/amdis/utility/RangeType.hpp>
#include <dune/amdis/utility/TreeData.hpp>
#include <amdis/Output.hpp>
#include <amdis/common/Concepts.hpp>
#include <amdis/common/ValueCategory.hpp>
#include <amdis/utility/RangeType.hpp>
#include <amdis/utility/TreeData.hpp>
namespace AMDiS
{
......
......@@ -2,8 +2,8 @@
#include <dune/functions/functionspacebases/interpolate.hh>
#include <dune/functions/functionspacebases/subspacebasis.hh>
#include <dune/amdis/LinearAlgebra.hpp>
#include <dune/amdis/linear_algebra/HierarchicWrapper.hpp>
#include <amdis/LinearAlgebra.hpp>
#include <amdis/linear_algebra/HierarchicWrapper.hpp>
namespace AMDiS
{
......
......@@ -9,12 +9,12 @@
//#include <dune/geometry/referenceelements.hh>
#include <dune/typetree/childextraction.hh>
#include <dune/amdis/Initfile.hpp>
#include <dune/amdis/common/Size.hpp>
#include <dune/amdis/common/ValueCategory.hpp>
#include <dune/amdis/gridfunctions/DOFVectorView.hpp>
#include <dune/amdis/io/FileWriterInterface.hpp>
#include <dune/amdis/utility/Filesystem.hpp>
#include <amdis/Initfile.hpp>
#include <amdis/common/Size.hpp>
#include <amdis/common/ValueCategory.hpp>
#include <amdis/gridfunctions/DOFVectorView.hpp>
#include <amdis/io/FileWriterInterface.hpp>
#include <amdis/utility/Filesystem.hpp>
namespace AMDiS
{
......
#pragma once
#include <dune/amdis/common/TupleUtility.hpp>
#include <dune/amdis/common/IndexSeq.hpp>
#include <dune/amdis/common/Loops.hpp>
#include <amdis/common/TupleUtility.hpp>
#include <amdis/common/IndexSeq.hpp>
#include <amdis/common/Loops.hpp>
namespace AMDiS
{
......