diff --git a/dune/fem-dg/operator/fluxes/diffusion/averageflux.hh b/dune/fem-dg/operator/fluxes/diffusion/averageflux.hh index 49d1db5b8fa04319a04eacf9565898d3d80373c6..e19b6cd50a6da85ff0472c48ef1adef72e86645e 100644 --- a/dune/fem-dg/operator/fluxes/diffusion/averageflux.hh +++ b/dune/fem-dg/operator/fluxes/diffusion/averageflux.hh @@ -55,9 +55,6 @@ namespace Fem // jacobians of the functions do not have to be evaluated for this flux enum { evaluateJacobian = false }; - private: - // no copying - LDGAverageDiffusionFlux(const LDGAverageDiffusionFlux& other); protected: using BaseType::determineDirection; using BaseType::model_; @@ -73,7 +70,7 @@ namespace Fem LDGAverageDiffusionFlux(GridPartType& gridPart, const ModelImp& mod, const ParameterType& param ) : - BaseType( mod, true, param ), + BaseType( gridPart, mod, param ), penalty_( parameter().penalty() ), // Set CFL number for penalty term (compare diffusion in first pass) penaltyTerm_( std::abs( penalty_ ) > 0 ) @@ -84,6 +81,12 @@ namespace Fem } } + LDGAverageDiffusionFlux(const LDGAverageDiffusionFlux& other) + : BaseType( other ), + penalty_( other.penalty_ ), + penaltyTerm_( other.penaltyTerm_ ) + {} + //! returns true if lifting has to be calculated const bool hasLifting () const { return false; } @@ -128,11 +131,11 @@ namespace Fem GradientJacobianType& gDiffLeft, GradientJacobianType& gDiffRight) const { - const FaceDomainType& x = faceQuadInner.localPoint( quadPoint ); - const DomainType normal = intersection.integrationOuterNormal( x ); + const FaceDomainType& x = left.localPosition(); + const DomainType normal = left.intersection().integrationOuterNormal( x ); // get factor for each side - const double thetaLeft = getTheta( intersection ); + const double thetaLeft = getTheta( left.intersection() ); const double thetaRight = 1.0 - thetaLeft; GradientJacobianType diffmatrix; @@ -154,7 +157,7 @@ namespace Fem if( thetaRight > 0 ) { const double diffStepRight = - model_.diffusion( right, uRight, diffmatrix ) + model_.diffusion( right, uRight, diffmatrix ); diffmatrix.mv(normal, gRight); @@ -188,7 +191,7 @@ namespace Fem const DomainType normal = left.intersection().integrationOuterNormal( x ); // get factor for each side - const double thetaLeft = getTheta( intersection ); + const double thetaLeft = getTheta( left.intersection() ); const double thetaRight = 1.0 - thetaLeft; GradientJacobianType diffmatrix; diff --git a/dune/fem-dg/operator/fluxes/diffusion/dgprimalfluxes.hh b/dune/fem-dg/operator/fluxes/diffusion/dgprimalfluxes.hh index 1b56670f2cb15d412e992e5bb152294cf7fb18a7..f2e57c8821a8410bfb2951dbd6d966e56a54265e 100644 --- a/dune/fem-dg/operator/fluxes/diffusion/dgprimalfluxes.hh +++ b/dune/fem-dg/operator/fluxes/diffusion/dgprimalfluxes.hh @@ -141,7 +141,7 @@ namespace Fem typedef typename BaseType::ParameterType ParameterType; protected: typedef typename BaseType::IdEnum EnumType; - typedef typename BaseType::LiftingEnum LiftingEnum; + typedef typename ParameterType::LiftingEnum LiftingEnum; public: using BaseType :: parameter ; diff --git a/dune/fem-dg/operator/fluxes/diffusion/fluxbase.hh b/dune/fem-dg/operator/fluxes/diffusion/fluxbase.hh index f3b173e75e3c55a6fb0da9db5804edb968bb766c..0698620656b7ae167f46e36509ee038bba5b3de1 100644 --- a/dune/fem-dg/operator/fluxes/diffusion/fluxbase.hh +++ b/dune/fem-dg/operator/fluxes/diffusion/fluxbase.hh @@ -61,7 +61,6 @@ namespace Fem typedef FluxParameterImp ParameterType; typedef typename ParameterType::IdEnum IdEnum; - typedef typename ParameterType::LiftingEnum LiftingEnum; enum { dimDomain = DiscreteFunctionSpaceType::dimDomain }; enum { dimRange = DiscreteFunctionSpaceType::dimRange }; @@ -168,6 +167,21 @@ namespace Fem bool hasLifting() const { return false; } + void diffusionFluxName( std::ostream& out ) const + { + out << ParameterType::methodNames( param_.getMethod() ); + } + + void diffusionFluxPenalty( std::ostream& out ) const + { + out << param_.penalty(); + } + + void diffusionFluxLiftFactor( std::ostream& out ) const + { + } + + template <class LocalEvaluation, class ArgumentTupleVector > void initializeIntersection(const LocalEvaluation& left, const LocalEvaluation& right, @@ -297,7 +311,7 @@ namespace Fem typedef typename BaseType::FaceDomainType FaceDomainType; typedef typename BaseType::GridPartType GridPartType; - typedef typename BaseType::IntersectionIteratorType IntersectionIterator; + typedef typename BaseType::IntersectionIterator IntersectionIterator; typedef typename BaseType::Intersection Intersection; typedef typename BaseType::GridType GridType; typedef typename BaseType::EntityType EntityType; @@ -316,9 +330,6 @@ namespace Fem // jacobians of the functions do not have to be evaluated for this flux enum { evaluateJacobian = false }; - private: - // no copying - LDGDiffusionFluxBase(const LDGDiffusionFluxBase& other); protected: using BaseType::determineDirection; using BaseType::model_; @@ -337,6 +348,11 @@ namespace Fem BaseType( mod, true, param ) {} + //! copy constructor + LDGDiffusionFluxBase( const LDGDiffusionFluxBase& other ) + : BaseType( other ) + {} + //! returns true if lifting has to be calculated const bool hasLifting () const { return false; } diff --git a/dune/fem-dg/operator/fluxes/diffusion/parameters.hh b/dune/fem-dg/operator/fluxes/diffusion/parameters.hh index 3df98cb387ec7eb51455d4124e5172b2f0086899..29886ff8f2740c848964fe2e497c9e3368a3ffbb 100644 --- a/dune/fem-dg/operator/fluxes/diffusion/parameters.hh +++ b/dune/fem-dg/operator/fluxes/diffusion/parameters.hh @@ -249,6 +249,19 @@ namespace Fem return DualDiffusionFlux::_enums[i]; } + //! todo please doc me + virtual double penalty() const + { + return Fem::Parameter::getValue<double>( keyPrefix_ + "penalty" ); + } + + //! todo please doc me + template <class DomainType> + void upwind( DomainType& upwd ) const + { + Fem::Parameter::get(keyPrefix_ + "upwind", upwd, upwd); + } + private: const std::string keyPrefix_;