source: src/commands/com_initialize_residual_norm.cpp@ 48b662

Last change on this file since 48b662 was 48b662, checked in by Olaf Lenz <olenz@…>, 14 years ago

Moved files in scafacos_fcs one level up.

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

  • Property mode set to 100644
File size: 1.0 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 <cstdio>
16
17#include "base/command.hpp"
18#include "base/object.hpp"
19#include "comm/comm.hpp"
20#include "grid/multigrid.hpp"
21#include "mg.hpp"
22
23using namespace VMG;
24
25class VMGCommandInitializeResidualNorm : public Command
26{
27public:
28 Request Run(Command::argument_vector arguments)
29 {
30 vmg_float residual = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs());
31 new ObjectStorage<vmg_float>(arguments[0], residual);
32
33 if (MG::GetComm()->Rank() == 0)
34 printf("Multigrid: Initial residual: %e\n", residual);
35
36 return Continue;
37 }
38
39 static const char* Name() {return "InitializeResidualNorm";}
40 static int Arguments() {return 1;}
41};
42
43CREATE_INITIALIZER(VMGCommandInitializeResidualNorm);
Note: See TracBrowser for help on using the repository browser.