Ignore:
Timestamp:
Nov 22, 2011, 9:22:10 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
facba0
Parents:
66f24d
Message:

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/commands/com_print_residual_norm.cpp

    r66f24d rdfed1c  
    1313#endif
    1414
    15 #include <cstdio>
     15#include <sstream>
    1616
    1717#include "base/command.hpp"
    1818#include "comm/comm.hpp"
     19#include "grid/grid.hpp"
    1920#include "grid/multigrid.hpp"
    2021#include "level/level_operator.hpp"
     
    2829  Request Run(Command::argument_vector arguments)
    2930  {
    30     if (MG::GetComm()->Rank() == 0)
    31       printf("Multigrid: Residual: %e\n", MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs()));
     31    MPE_EVENT_BEGIN()
     32
     33    Multigrid* sol = MG::GetSol();
     34    Multigrid* rhs = MG::GetRhs();
     35    Comm* comm = MG::GetComm();
     36
     37    if ((*sol)(sol->MaxLevel()).IsActive()) {
     38      vmg_float residual = comm->ComputeResidualNorm(*sol, *rhs);
     39      comm->PrintStringOnce("Residual: %e", residual);
     40    }
     41
     42    MPE_EVENT_END()
    3243
    3344    return Continue;
     
    3849};
    3950
    40 CREATE_INITIALIZER(VMGCommandPrintResidualNorm);
     51CREATE_INITIALIZER(VMGCommandPrintResidualNorm)
Note: See TracChangeset for help on using the changeset viewer.