ProblemStatTest.cpp 1.61 KB
 1 ``````#include `````` Praetorius, Simon committed Jun 08, 2019 2 ``````#include `````` 3 4 ``````#include #include `````` Praetorius, Simon committed Sep 30, 2019 5 ``````#include `````` 6 `````` `````` Praetorius, Simon committed Sep 30, 2019 7 8 ``````#include #include `````` 9 `````` `````` Praetorius, Simon committed Sep 30, 2019 10 ``````using namespace AMDiS; `````` 11 12 13 14 `````` template void test() { `````` Praetorius, Simon committed Sep 30, 2019 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 `````` // use T as coordinate type using Grid = Dune::YaspGrid<2, Dune::EquidistantCoordinates>; Grid grid({T(1), T(1)}, {8,8}); // use T as range type for basis using namespace Dune::Functions::BasisFactory; #if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) auto basis = makeBasis(grid.leafGridView(), power<1>(lagrange<1>(), flatLexicographic())); #else auto basis = makeBasis(grid.leafGridView(), power<1>(lagrange<1,T>(), flatLexicographic())); #endif using Basis = decltype(basis); // use T as coefficient type using Param = DefaultProblemTraits; ProblemStat prob("ellipt", grid, basis); `````` 32 33 34 35 36 37 `````` prob.initialize(INIT_ALL); prob.boundaryManager()->setBoxBoundary({1,1,2,2}); prob.addMatrixOperator(sot(T(1)), 0, 0); prob.addVectorOperator(zot(T(1)), 0); prob.addDirichletBC(BoundaryType{1}, 0,0, T(0)); `````` Praetorius, Simon committed Jun 08, 2019 38 39 40 41 42 43 44 45 46 47 48 49 50 `````` AdaptInfo adaptInfo("adapt"); // test copy constructor of problem auto prob2(prob); AdaptStationary adaptStat2("adapt", prob2, adaptInfo); adaptStat2.adapt(); // test move constructor of problem auto prob3(std::move(prob2)); AdaptStationary adaptStat3("adapt", prob3, adaptInfo); adaptStat3.adapt(); `````` 51 52 53 54 ``````} int main(int argc, char** argv) { `````` Praetorius, Simon committed May 06, 2019 55 `````` Environment env(argc, argv); `````` 56 57 58 59 60 `````` test(); test(); test(); `````` Praetorius, Simon committed Sep 30, 2019 61 62 63 64 ``````#if HAVE_QUADMATH test(); #endif `````` 65 66 `````` return 0; }``````