/** * @file com_print_residual_norm.cpp * @author Julian Iseringhausen * @date Mon Apr 18 12:47:22 2011 * * @brief Writes the current discrete L2-norm of the residual * to standard output. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include "base/command.hpp" #include "comm/comm.hpp" #include "grid/multigrid.hpp" #include "level/level_operator.hpp" #include "mg.hpp" using namespace VMG; class VMGCommandPrintResidualNorm : public Command { public: Request Run(Command::argument_vector arguments) { if (MG::GetComm()->Rank() == 0) printf("Multigrid: Residual: %e\n", MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs())); return Continue; } static const char* Name() {return "PrintResidualNorm";} static int Arguments() {return 0;} }; CREATE_INITIALIZER(VMGCommandPrintResidualNorm);