13#ifndef DUMUX_IO_GRID_MANAGER_UG_HH
14#define DUMUX_IO_GRID_MANAGER_UG_HH
17#include <dune/grid/uggrid.hh>
18#include <dune/grid/io/file/dgfparser/dgfug.hh>
21#ifndef DUMUX_IO_GRID_MANAGER_BASE_HH
56 using Grid =
typename Dune::UGGrid<dim>;
58 using Element =
typename Grid::template Codim<0>::Entity;
63 void init(
const std::string& modelParamGroup =
"")
69 preProcessing_(modelParamGroup);
71 postProcessing_(modelParamGroup);
78 preProcessing_(modelParamGroup);
81 if (cellType ==
"Cube")
83 else if (cellType ==
"Simplex")
86 DUNE_THROW(Dune::IOError,
"UGGrid only supports 'Cube' or 'Simplex' as cell type. Not '"<< cellType<<
"'!");
87 postProcessing_(modelParamGroup);
93 const auto prefix = modelParamGroup.empty() ? modelParamGroup : modelParamGroup +
".";
95 << prefix +
"Grid.UpperRight"
96 <<
", or a grid file in " << prefix +
"Grid.File");
110 if (Dune::MPIHelper::getCommunication().size() > 1)
149 void preProcessing_(
const std::string& modelParamGroup)
155 void postProcessing_(
const std::string& modelParamGroup)
159 if (refType ==
"Local")
160 ParentType::grid().setRefinementType(Dune::UGGrid<dim>::RefinementType::LOCAL);
161 else if (refType ==
"Copy")
162 ParentType::grid().setRefinementType(Dune::UGGrid<dim>::RefinementType::COPY);
164 DUNE_THROW(Dune::IOError,
"UGGrid only supports 'Local' or 'Copy' as refinement type. Not '"<< refType<<
"'!");
168 if (closureType ==
"Green")
169 ParentType::grid().setClosureType(Dune::UGGrid<dim>::ClosureType::GREEN);
170 else if (closureType ==
"None")
171 ParentType::grid().setClosureType(Dune::UGGrid<dim>::ClosureType::NONE);
173 DUNE_THROW(Dune::IOError,
"UGGrid only supports 'Green' or 'None' as closure type. Not '"<< closureType<<
"'!");
176 ParentType::maybeRefineGrid(modelParamGroup);
191 {
return gv.comm().size() <= 1; }
typename Grid::template Codim< 0 >::Entity Element
Definition gridmanager_ug.hh:58
GridManagerBase< Grid > ParentType
Definition gridmanager_ug.hh:57
void init(const std::string &modelParamGroup="")
Make the UGGrid.
Definition gridmanager_ug.hh:63
typename Dune::UGGrid< dim > Grid
Definition gridmanager_ug.hh:56
void loadBalance()
Call loadBalance() function of the grid.
Definition gridmanager_ug.hh:108
The grid manager base interface (public) and methods common to most grid manager specializations (pro...
Definition gridmanager_base.hh:56
bool enableVtkData_
Definition gridmanager_base.hh:335
void makeGridFromFile(const std::string &fileName, const std::string &modelParamGroup)
Definition gridmanager_base.hh:205
void makeStructuredGrid(CellType cellType, const std::string &modelParamGroup)
Definition gridmanager_base.hh:286
Dune::GridPtr< Grid > & dgfGridPtr()
Definition gridmanager_base.hh:174
std::shared_ptr< GridData > gridData_
Definition gridmanager_base.hh:340
bool enableGmshDomainMarkers_
Definition gridmanager_base.hh:330
void loadBalance()
Definition gridmanager_base.hh:98
@ Simplex
Definition gridmanager_base.hh:280
@ Cube
Definition gridmanager_base.hh:280
std::shared_ptr< Grid > & gridPtr()
Definition gridmanager_base.hh:163
bool enableDgfGridPointer_
Definition gridmanager_base.hh:325
The grid manager (this is the class used by the user) for all supported grid managers that constructs...
Definition gridmanager_base.hh:344
Exception thrown if a run-time parameter is not specified correctly.
Definition exceptions.hh:48
dune-grid capabilities compatibility layer
Provides a grid manager for all supported grid managers with input file interfaces....
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:149
bool hasParamInGroup(const std::string ¶mGroup, const std::string ¶m)
Check whether a key exists in the parameter tree with a model group prefix.
Definition parameters.hh:165
Definition gridcapabilities.hh:17
Definition common/pdesolver.hh:24
static bool eval(const GV &gv)
Definition gridmanager_ug.hh:190
Definition gridcapabilities.hh:27