Liebe Gitlab-Nutzerin, lieber Gitlab-Nutzer,
es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Die Konten der externen Nutzer:innen sind ü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. The accounts of external users can be accessed via the "Standard" tab.
The administrators

heat.cc 1.55 KB
Newer Older
Praetorius, Simon's avatar
Praetorius, Simon committed
1 2
#include <config.h>

3 4
#include <iostream>

5 6
#include <amdis/AMDiS.hpp>
#include <amdis/AdaptInstationary.hpp>
7
#include <amdis/LocalOperators.hpp>
8 9 10
#include <amdis/ProblemInstat.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/GridFunctions.hpp>
11 12 13 14

using namespace AMDiS;

// 1 component with polynomial degree 1
15 16
//using Grid = Dune::AlbertaGrid<GRIDDIM, WORLDDIM>;
using HeatParam   = YaspGridBasis<GRIDDIM, 2>;
17 18 19 20 21
using HeatProblem = ProblemStat<HeatParam>;
using HeatProblemInstat = ProblemInstat<HeatParam>;

int main(int argc, char** argv)
{
22
  Environment env(argc, argv);
23

24 25
  HeatProblem prob("heat");
  prob.initialize(INIT_ALL);
26

27 28
  HeatProblemInstat probInstat("heat", prob);
  probInstat.initialize(INIT_UH_OLD);
29

30
  AdaptInfo adaptInfo("adapt");
31

Praetorius, Simon's avatar
Praetorius, Simon committed
32
  auto invTau = std::ref(probInstat.invTau());
33

Praetorius, Simon's avatar
Praetorius, Simon committed
34
  auto opTimeLhs = makeOperator(tag::test_trial{}, invTau);
35
  prob.addMatrixOperator(opTimeLhs);
36

37
  auto opL = makeOperator(tag::gradtest_gradtrial{}, 1.0);
38
  prob.addMatrixOperator(opL);
39

40
  auto opTimeRhs = makeOperator(tag::test{},
41 42
    invokeAtQP([invTau](double u) { return u * invTau.get(); }, prob.solution()), 2);
  prob.addVectorOperator(opTimeRhs);
43

44
  auto opForce = makeOperator(tag::test{}, [](auto const& x) { return -1.0; }, 0);
45
  prob.addVectorOperator(opForce);
46 47


48 49 50
  // 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; };
51
  prob.addDirichletBC(predicate, dbcValues);
52

53 54
  AdaptInstationary adapt("adapt", prob, adaptInfo, probInstat, adaptInfo);
  adapt.adapt();
55

56
  return 0;
57
}