source: src/commands/com_initialize_residual_norm.cpp@ facba0

Last change on this file since facba0 was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

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

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file com_initialize_residual_norm.cpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 12:40:12 2011
5 *
6 * @brief Computes the residual in the discrete L2-norm
7 * and hands the value over to the factory.
8 *
9 */
10
11#ifdef HAVE_CONFIG_H
12#include <config.h>
13#endif
14
15#include "base/command.hpp"
16#include "base/object.hpp"
17#include "comm/comm.hpp"
18#include "grid/multigrid.hpp"
19#include "mg.hpp"
20
21using namespace VMG;
22
23class VMGCommandInitializeResidualNorm : public Command
24{
25public:
26 Request Run(Command::argument_vector arguments)
27 {
28 MPE_EVENT_BEGIN()
29
30 vmg_float residual = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs());
31 new ObjectStorage<vmg_float>(arguments[0], residual);
32
33#ifdef DEBUG_OUTPUT
34 MG::GetComm()->PrintStringOnce("Initial residual: %e", residual);
35#endif /* DEBUG_OUTPUT */
36
37 MPE_EVENT_END()
38
39 return Continue;
40 }
41
42 static const char* Name() {return "InitializeResidualNorm";}
43 static int Arguments() {return 1;}
44};
45
46CREATE_INITIALIZER(VMGCommandInitializeResidualNorm)
Note: See TracBrowser for help on using the repository browser.