Commit 126969fa authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

minor changes in monte carlo transport

parent 470df45a
#include "MonteCarloTransport.h"
using namespace std;
void MonteCarloTransport::Method() {
logger->startMethodMSG();
logger->StartMethodMsg();
if (!onlyFineLevel)
logger->logMSGV1("l: " + to_string(l)
logger->LogMsgv1("l: " + to_string(l)
+ " dM: " + to_string(dM));
else
logger->logMSGV1("l: " + to_string(l)
logger->LogMsgv1("l: " + to_string(l)
+ " dM: " + to_string(dM)
+ " onlyFineLevel: True");
......@@ -29,11 +28,12 @@ void MonteCarloTransport::Method() {
assemble->plot = &plot;
for (int m = M; m < M + dM; m++) {
mkSampleDir(m);
stochasticField->GetFineSample(l, fineFlux);
assemble->problem->LoadNewSample(&fineFlux);
if (plotting > 1) {
const char *name = buildString(m, "flux");
string name = buildName(m, mkSampleDirName(m).append("/flux"));
plot.celldata(fineFlux, 3);
plot.vtk_cellvector(name);
}
......@@ -49,11 +49,10 @@ void MonteCarloTransport::Method() {
UpscaleFlux(coarseFlux, coarseFluxUp);
if (plotting > 1) {
const char *name = buildString(m, "flux_up");
string name = buildName(m, "flux_up");
plot.celldata(coarseFluxUp, 3);
plot.vtk_cellvector(name);
}
} else {
coarseQ = 0.0, coarseCost = 0.0, coarseSolutionUp = 0.0;
}
......@@ -62,9 +61,9 @@ void MonteCarloTransport::Method() {
updateAvg();
updateStatistic();
logger->logMSGV1("|E[Y]|: " + to_string(avgY)
logger->LogMsgv1("|E[Y]|: " + to_string(avgY)
+ " V[Y]: " + to_string(varY));
logger->endMethodMSG();
logger->EndMethodMsg();
}
void MonteCarloTransport::solveTransport(int l,
......@@ -72,8 +71,7 @@ void MonteCarloTransport::solveTransport(int l,
double &valueQ,
double &cost,
Vector &solution) {
// Date startSolving;
assemble->logger->StartMethodMsg();
Solver solver;
Preconditioner *BJ = GetPC("PointBlockJacobi");
Solver IM(BJ);
......@@ -87,9 +85,8 @@ void MonteCarloTransport::solveTransport(int l,
if (functional == "Energy") valueQ = assemble->Energy(solution);
if (functional == "Outflow")
valueQ = assemble->InFlowOutFlowRate(solution).second;
// logger->logMSGV2("Solving on level " + to_string(l) + " took " +
// to_string((startSolving - Date()).t) + " seconds");
mout << endl;
assemble->logger->EndMethodMsg();
}
TimeSeries MonteCarloTransport::getTimeSeries(bool fineLevel) {
......
......@@ -4,7 +4,7 @@
#include "MonteCarlo.h"
#include "assemble/DGTransportAssemble.h"
#include "timestepping/TimeIntegrator.h"
#include "timestepping/TimeIntegrator2.h"
//#include "timestepping/TimeIntegrator2.h"
class MonteCarloTransport : public MonteCarlo {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment