To reduce differences between serial and parallel runs as much as possible, the Dune::MPIHelper class is used to toggle these runs. To use this feature, the following code should always be called at the beginning of the function main:
#include <dune/grid/utility/gridtype.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, see documentation for constructors GridType grid; ... // 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/utility/griddim.hh>
#include <dune/grid/yaspgrid.hh>
Go to the source code of this file.