source: src/commands/com_set_level.cpp@ dfed1c

Last change on this file since dfed1c 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: 975 bytes
Line 
1/**
2 * @file com_set_level.cpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 12:51:22 2011
5 *
6 * @brief Bring a given multigrid to a given level.
7 * For the level argument, no numerical value is allowed
8 * but the name of a variable in the factory.
9 *
10 */
11
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <cstdio>
17
18#include "base/command.hpp"
19#include "grid/multigrid.hpp"
20
21using namespace VMG;
22
23class VMGCommandSetLevel : public Command
24{
25public:
26 Request Run(Command::argument_vector arguments)
27 {
28 MPE_EVENT_BEGIN()
29
30 Multigrid* grid = MG::GetFactory().Get(arguments[0])->Cast<Multigrid>();
31 ObjectStorage<int>* level = MG::GetFactory().Get(arguments[1])->Cast< ObjectStorage<int> >();
32
33 grid->SetLevel(level->Val());
34
35 MPE_EVENT_END()
36
37 return Continue;
38 }
39
40 static const char* Name() {return "SetLevel";}
41 static int Arguments() {return 2;}
42};
43
44CREATE_INITIALIZER(VMGCommandSetLevel)
Note: See TracBrowser for help on using the repository browser.