| 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 |
|
|---|
| 13 | #ifdef HAVE_CONFIG_H
|
|---|
| 14 | #include <config.h>
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | #include <cstdio>
|
|---|
| 18 |
|
|---|
| 19 | #include "base/command.hpp"
|
|---|
| 20 | #include "grid/multigrid.hpp"
|
|---|
| 21 |
|
|---|
| 22 | using namespace VMG;
|
|---|
| 23 |
|
|---|
| 24 | class VMGCommandSetLevel : public Command
|
|---|
| 25 | {
|
|---|
| 26 | public:
|
|---|
| 27 | Request Run(Command::argument_vector arguments)
|
|---|
| 28 | {
|
|---|
| 29 | Multigrid* grid = MG::GetFactory().GetObject(arguments[0])->Cast<Multigrid>();
|
|---|
| 30 | ObjectStorage<int>* level = MG::GetFactory().GetObject(arguments[1])->Cast< ObjectStorage<int> >();
|
|---|
| 31 |
|
|---|
| 32 | grid->SetLevel(level->Val());
|
|---|
| 33 |
|
|---|
| 34 | return Continue;
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | static const char* Name() {return "SetLevel";}
|
|---|
| 38 | static int Arguments() {return 2;}
|
|---|
| 39 | };
|
|---|
| 40 |
|
|---|
| 41 | CREATE_INITIALIZER(VMGCommandSetLevel);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.