/** * @file com_compute_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 "base/command.hpp" #include "base/object.hpp" #include "comm/comm.hpp" #include "grid/multigrid.hpp" #include "mg.hpp" using namespace VMG; class VMGCommandComputeResidualNorm : public Command { public: Request Run(Command::argument_vector arguments) { MPE_EVENT_BEGIN() vmg_float residual = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs()); new ObjectStorage(arguments[0], residual); MPE_EVENT_END() return Continue; } static const char* Name() {return "ComputeResidualNorm";} static int Arguments() {return 1;} }; CREATE_INITIALIZER(VMGCommandComputeResidualNorm)