TransportPDESolver.cpp 1.07 KB
Newer Older
niklas.baumgarten's avatar
niklas.baumgarten committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "TransportPDESolver.hpp"


void TransportPDESolver::run(SampleSolution &solution) {
  assemble->SetTimeSeries(solution.U);
  solution.U.GetMesh().PrintInfo();
  assemble->GetTimeSeries().PrintInfo();
  timeInt->Method(assemble, solution.U);
}

void TransportPDESolver::computeQ(SampleSolution &solution) {
  if (quantity == "Energy") solution.Q = assemble->Energy(solution.U);
  else if (quantity == "Mass") solution.Q = assemble->Mass(solution.U);
  else if (quantity == "Error") solution.Q = assemble->Error(0, solution.U);
  else if (quantity == "Inflow") solution.Q = assemble->InflowOutflow(solution.U).first;
  else if (quantity == "Outflow") solution.Q = assemble->InflowOutflow(solution.U).second;
  else Exit("Quantity of interest not implemented")
}

void TransportPDESolver::computeCost(SampleSolution &solution) {
niklas.baumgarten's avatar
niklas.baumgarten committed
21
22
23
  if (costMeasure == "size") solution.C = solution.U.size();
//    else if (costMeasure == "time") solution.Cost = solution.U.size(); // Todo
  else Exit("Cost measure not implemented")
niklas.baumgarten's avatar
niklas.baumgarten committed
24
25
26
27
}

void TransportPDESolver::plotSolution(SampleSolution &solution) {
}