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