/** * @file com_initialize_residual_norm.cpp * @author Julian Iseringhausen * @date Mon Apr 18 12:40:12 2011 * * @brief Computes the residual in the discrete L2-norm * and hands the value over to the factory. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include "base/command.hpp" #include "base/object.hpp" #include "comm/comm.hpp" #include "grid/multigrid.hpp" #include "mg.hpp" using namespace VMG; class VMGCommandInitializeResidualNorm : public Command { public: Request Run(Command::argument_vector arguments) { vmg_float residual = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs()); new ObjectStorage(arguments[0], residual); if (MG::GetComm()->Rank() == 0) printf("Multigrid: Initial residual: %e\n", residual); return Continue; } static const char* Name() {return "InitializeResidualNorm";} static int Arguments() {return 1;} }; CREATE_INITIALIZER(VMGCommandInitializeResidualNorm);