Skip to content
Snippets Groups Projects
Commit 1579df4b authored by Robert Kloefkorn's avatar Robert Kloefkorn
Browse files

allow to select advection, diffusion, or both.

parent ba2c38f8
No related branches found
No related tags found
No related merge requests found
# install these headers
advdiffdir=$(includedir)/test/advdiff
advdiff_HEADERS = models.hh problemcreator.hh \
problem.hh problemQuasiHeatEqn.hh
advdiff_HEADERS = models.hh deformationalflow.hh problemcreator.hh \
problem.hh problemQuasiHeatEqn.hh steppertraits.hh
LDADD = $(ALL_PKG_LDFLAGS) $(ALL_PKG_LIBS) $(LOCAL_LIBS) $(DUNEMPILDFLAGS) $(DUNEMPILIBS)
......@@ -22,6 +22,9 @@ GRIDDIM = 2
DIMRANGE = 1
FLUX = 1 # LLF 1, HLL 2
ADVECTION=0
DIFFUSION=1
#USE_OMP=-fopenmp
# INFO SPACE OPERATOR:
......@@ -37,6 +40,7 @@ check_PROGRAMS = advdiff advdiffonep advdiff12 # quasiadvdiff quasiadvdiff12 pla
AM_CPPFLAGS = $(USE_OMP) -I../../problems/advdiff $(ALL_PKG_CPPFLAGS) -DGRIDDIM=$(GRIDDIM) \
-D$(GRIDTYPE) $(DUNEMPICPPFLAGS) -DFEMTIMER \
-DADVECTION=$(ADVECTION) -DDIFFUSION=$(DIFFUSION) \
-DDIMRANGE=$(DIMRANGE) -DFLUX=$(FLUX) -DPRIMALDG -DUSE_ASSERT_THROW
AM_LDFLAGS = $(ALL_PKG_LDFLAGS) $(LAPACK_LDFLAGS) $(USE_OMP)
......
......@@ -39,14 +39,9 @@ femhowto.zvelocity: 0. # the only advection part for the linear heat eqn
# DOMAIN
#-------
fem.io.macroGridFile_1d: ../macrogrids/unitcube1.dgf
fem.io.macroGridFile_2d: ../macrogrids/unitcube2_per.dgf
#fem.io.macroGridFile_2d: ../macrogrids/unitcube2_unstr.dgf
#fem.io.macroGridFile_2d: ../macrogrids/test2.dgf
#fem.io.macroGridFile_2d: ../macrogrids/unitgrid2d_unstr_2.dgf
#fem.io.macroGridFile_2d: ../macrogrids/stability.dgf
#fem.io.macroGridFile_2d: ../macrogrids/cdgpaper_test.dgf
fem.io.macroGridFile_3d: ../macrogrids/unitcube3.dgf
fem.io.macroGridFile_1d: ../grids/unitcube1.dgf
fem.io.macroGridFile_2d: ../grids/unitcube2.dgf
fem.io.macroGridFile_3d: ../grids/unitcube3.dgf
# SOLVER
......
......@@ -10,6 +10,8 @@
// local includes
#include <dune/fem-dg/operator/fluxes/diffusionflux.hh>
#include <dune/fem-dg/stepper/base.hh>
#include "problem.hh"
#include "problemQuasiHeatEqn.hh"
#include "deformationalflow.hh"
......@@ -94,6 +96,12 @@ struct ProblemGenerator
}
};
//#include <dune/fem-dg/stepper/advectionstepper.hh>
#include "steppertraits.hh"
#if ADVECTION && DIFFUSION
#include <dune/fem-dg/stepper/advectiondiffusionstepper.hh>
#else
#include <dune/fem-dg/stepper/advectionstepper.hh>
#endif
#endif // FEMHOWTO_HEATSTEPPER_HH
#ifndef DUNE_STEPPERTRAITS_HH
#define DUNE_STEPPERTRAITS_HH
#include <dune/fem/gridpart/adaptiveleafgridpart.hh>
#include <dune/fem/gridpart/idgridpart.hh>
#include <dune/fem/solver/odesolver.hh>
#include <dune/fem/solver/pardginverseoperators.hh>
#include <dune/fem-dg/operator/dg/dgoperatorchoice.hh>
template <class GridImp,
class ProblemTraits,
int polOrd>
struct StepperTraits
{
enum { polynomialOrder = polOrd };
// type of Grid
typedef GridImp GridType;
// Choose a suitable GridView
typedef Dune :: Fem :: DGAdaptiveLeafGridPart< GridType > HostGridPartType;
typedef HostGridPartType GridPartType ;
//typedef Dune :: Fem :: IdGridPart< HostGridPartType > GridPartType;
// problem dependent types
typedef typename ProblemTraits :: template Traits< GridPartType > :: InitialDataType InitialDataType;
typedef typename ProblemTraits :: template Traits< GridPartType > :: ModelType ModelType;
typedef typename ProblemTraits :: template Traits< GridPartType > :: FluxType FluxType;
static const Dune::DGDiffusionFluxIdentifier DiffusionFluxId
= ProblemTraits :: template Traits< GridPartType > ::PrimalDiffusionFluxId ;
private:
// The DG Operator (using 2 Passes)
// The first operator is sum of the other two
// The other two are needed for semi-implicit time discretization
#ifdef LIMITER
#if (not defined EULER) and (defined FLUXDG)
#warning "DGAdvectionDiffusionOperator: using LIMITER."
typedef Dune :: DGLimitedAdvectionDiffusionOperator<
ModelType, FluxType, DiffusionFluxId, polynomialOrder > DgType;
#else
#warning "DGAdvectionDiffusionOperator: LIMITER can NOT be used. Not supported -> LIMITER, no EULER, no FLUXDG."
typedef Dune :: DGAdvectionDiffusionOperator<
ModelType, FluxType, DiffusionFluxId, polynomialOrder > DgType;
#endif
#ifndef HIGHER_ORDER_FV
#warning "DGAdvectionOperator: using LIMITER."
typedef Dune :: DGLimitedAdvectionOperator< ModelType, FluxType,
DiffusionFluxId, polynomialOrder > DgAdvectionType;
#else
#warning "DGAdvectionOperator: using HIGHER ORDER FV."
typedef Dune :: DGLimitedAdvectionOperator< ModelType, FluxType,
DiffusionFluxId, -1 > DgAdvectionType;
#endif
#else // no LIMITER
#warning "No limiter is applied to the numerical solution !!"
typedef Dune :: DGAdvectionDiffusionOperator< ModelType, FluxType,
DiffusionFluxId, polynomialOrder > DgType;
typedef Dune :: DGAdvectionOperator< ModelType, FluxType,
DiffusionFluxId, polynomialOrder > DgAdvectionType;
#endif
typedef Dune :: DGDiffusionOperator< ModelType, FluxType,
DiffusionFluxId, polynomialOrder > DgDiffusionType;
public:
#if ADVECTION && DIFFUSION
#warning "Using Advection-Diffusion Operator"
typedef DgType FullOperatorType;
typedef DgDiffusionType ImplicitOperatorType;
typedef DgAdvectionType ExplicitOperatorType;
#elif ADVECTION
#warning "Using Advection Operator"
typedef DgAdvectionType FullOperatorType;
typedef FullOperatorType ImplicitOperatorType;
typedef FullOperatorType ExplicitOperatorType;
#elif DIFFUSION
#warning "Using Diffusion Operator"
typedef DgDiffusionType FullOperatorType;
typedef FullOperatorType ImplicitOperatorType;
typedef FullOperatorType ExplicitOperatorType;
#else
#error "Either ADVECTION or DIFFUSSION has to be set"
#endif
// The discrete function for the unknown solution is defined in the DgOperator
typedef typename DgType :: DestinationType DiscreteFunctionType;
// The indicator function in case of limiting
typedef typename DgAdvectionType :: IndicatorType IndicatorType;
// ... as well as the Space type
typedef typename DgType :: SpaceType DiscreteSpaceType;
// The ODE Solvers /*@LST1S@*/
typedef DuneODE :: OdeSolverInterface< DiscreteFunctionType > OdeSolverType ;
// type of restriction/prolongation projection for adaptive simulations
typedef Dune :: Fem :: RestrictProlongDefault< DiscreteFunctionType > RestrictionProlongationType;
// type of IOTuple
typedef Dune::tuple< DiscreteFunctionType*, DiscreteFunctionType*, IndicatorType* > IOTupleType;
// type of linear solver for implicit ode
typedef Dune::Fem::ParDGGeneralizedMinResInverseOperator< DiscreteFunctionType > LinearInverseOperatorType;
typedef Dune::Fem::ParDGGeneralizedMinResInverseOperator< DiscreteFunctionType > LinearInverseImplicitOperatorType;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment