| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * command_print_grid.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: 16.03.2011
|
|---|
| 5 | * Author: Julian Iseringhausen
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | /**
|
|---|
| 9 | * @file com_print_grid.cpp
|
|---|
| 10 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 11 | * @date Mon Apr 18 12:43:54 2011
|
|---|
| 12 | *
|
|---|
| 13 | * @brief Writes a given grid including boundary and
|
|---|
| 14 | * halo to a VTKStructuredPoints file in
|
|---|
| 15 | * output/date_time
|
|---|
| 16 | *
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | #ifdef HAVE_CONFIG_H
|
|---|
| 21 | #include <config.h>
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | #include <sstream>
|
|---|
| 25 |
|
|---|
| 26 | #include "base/command.hpp"
|
|---|
| 27 | #include "comm/comm.hpp"
|
|---|
| 28 | #include "grid/grid.hpp"
|
|---|
| 29 | #include "grid/multigrid.hpp"
|
|---|
| 30 |
|
|---|
| 31 | using namespace VMG;
|
|---|
| 32 |
|
|---|
| 33 | class VMGCommandPrintGrid : public Command
|
|---|
| 34 | {
|
|---|
| 35 | public:
|
|---|
| 36 | Request Run(Command::argument_vector arguments)
|
|---|
| 37 | {
|
|---|
| 38 | std::ostringstream buffer;
|
|---|
| 39 |
|
|---|
| 40 | Multigrid& grid = *MG::GetFactory().GetObject(arguments[0])->Cast<Multigrid>();
|
|---|
| 41 |
|
|---|
| 42 | buffer << "Level " << grid.Level() << " ";
|
|---|
| 43 | switch (grid().Global().BoundaryType())
|
|---|
| 44 | {
|
|---|
| 45 | case LocallyRefined:
|
|---|
| 46 | buffer << "Locally Refined ";
|
|---|
| 47 | break;
|
|---|
| 48 | case GlobalMax:
|
|---|
| 49 | buffer << "Global Max ";
|
|---|
| 50 | break;
|
|---|
| 51 | case GlobalCoarsened:
|
|---|
| 52 | buffer << "Global Coarsened ";
|
|---|
| 53 | break;
|
|---|
| 54 | case EmptyGrid:
|
|---|
| 55 | buffer << "Empty grid ";
|
|---|
| 56 | break;
|
|---|
| 57 | }
|
|---|
| 58 | buffer << arguments[0];
|
|---|
| 59 |
|
|---|
| 60 | MG::GetComm()->PrintGrid(grid(), buffer.str().c_str());
|
|---|
| 61 |
|
|---|
| 62 | return Continue;
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|
| 65 | static const char* Name() {return "PrintGrid";}
|
|---|
| 66 | static int Arguments() {return 1;}
|
|---|
| 67 | };
|
|---|
| 68 |
|
|---|
| 69 | CREATE_INITIALIZER(VMGCommandPrintGrid);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.