dgfgridtype.hh File Reference
Detailed Description
A simple strategy for defining a grid type depending on defines set during the make proecess:.To reduce differences between seriell and parallel runs as much as possible additional the Dune::MPIHelper class is used to toggle between serial and parallel runs via specialization of this class for runs using MPI und such that doesn't. To use this feature, the following code should always be called at the beginning of the function main:
#include <dune/grid/io/file/dgfparser/dgfgridtype.hh> ... int main(int argc, char ** argv, char ** envp) { // get reference to the singelton MPIHelper MPIHelper & mpiHelper = MPIHelper::instance(argc,argv); // optional one can get rank and size from this little helper class int myrank = mpiHelper.rank(); int mysize = mpiHelper.size(); ... // construct the grid GridPtr<GridType> grid(argv[1], mpiHelper.getCommunicator() ); GridType & grid = *gridptr; ... // as the MPIHelper is a singleton, on it's destruction the // MPI_Finalize() command is called. }
--with-grid-dim=1|2|3
and optional --with-grid-type=ALBERTAGRID | ALUGRID_CUBE | ALUGRID_SIMPLEX | ONEDGRID | SGRID | UGGRID | YASPGRID. This will add the following to the ALL_PKG_CPPFLAGS -DGRIDDIM=$(GRIDDIM) -DGRIDTYPE=$(GRIDTYPE)
ALL_PKG_CPPFLAGS
or GRIDDIM_CPPFLAGS
to the programs CXXFLAGS
one can choose the grids dimension and type by invoking the following make command make GRIDDIM=3 GRIDTYPE=ALBERTAGRID myprogram
3
for grid dimension and ALBERTAGRID
for grid type are passed as pre-processoer variables to gridtype.hh and are then used to define the typedef
GridType
.
#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <dune/grid/utility/gridtype.hh>
Go to the source code of this file.