convection_diffusion_dg_default_parameter.hh 3.16 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#ifndef DUNE_BIOMAG_CONVECTIONDIFFUSION_DG_DEFAULTPARAMETER_HH
#define DUNE_BIOMAG_CONVECTIONDIFFUSION_DG_DEFAULTPARAMETER_HH

#include <dune/pdelab/localoperator/convectiondiffusionparameter.hh>

#include <duneuro/common/convection_diffusion_dg_operator.hh>

namespace duneuro
{
  template <typename VC>
  class ConvectionDiffusion_DG_DefaultParameter
  {
  public:
14
    typedef Dune::PDELab::ConvectionDiffusionBoundaryConditions::Type BCType;
15
    typedef typename VC::GridView GV;
16 17
    typedef Dune::PDELab::ConvectionDiffusionParameterTraits<GV, typename GV::ctype> Traits;

Andreas Nüßing's avatar
Andreas Nüßing committed
18
    explicit ConvectionDiffusion_DG_DefaultParameter(std::shared_ptr<const VC> volumeConductor)
19 20
        : volumeConductor_(volumeConductor)
    {
21
      assert(volumeConductor_);
22 23 24 25 26 27 28 29 30
    }

    template <class EG>
    typename Traits::PermTensorType A(const EG& e, const typename Traits::DomainType& x) const
    {
      return A(e.entity(), x);
    }

    typename Traits::PermTensorType A(const typename Traits::ElementType& e,
31
                                      const typename Traits::DomainType&) const
32 33 34 35 36
    {
      return volumeConductor_->tensor(e);
    }

    template <class IG>
37
    typename Traits::PermTensorType A(const IG& ig, const typename Traits::IntersectionDomainType&,
38 39 40 41 42 43 44 45
                                      ConvectionDiffusion_DG_Side::Type side) const
    {
      switch (side) {
      case ConvectionDiffusion_DG_Side::inside: return volumeConductor_->tensor(ig.inside());
      default: return volumeConductor_->tensor(ig.outside());
      }
    }

46 47
    BCType bctype(const typename Traits::IntersectionType&,
                  const typename Traits::IntersectionDomainType&) const
48 49 50 51
    {
      return Dune::PDELab::ConvectionDiffusionBoundaryConditions::Neumann;
    }

52 53
    typename Traits::RangeFieldType f(const typename Traits::ElementType&,
                                      const typename Traits::DomainType&) const
54 55 56 57
    {
      return 0.0;
    }

58 59
    typename Traits::RangeFieldType g(const typename Traits::ElementType&,
                                      const typename Traits::DomainType&) const
60 61 62 63
    {
      return 0.0;
    }

64 65 66 67 68 69 70
    template <class IG>
    typename Traits::RangeFieldType g(const IG& ig,
                                      const typename Traits::IntersectionDomainType&) const
    {
      return 0.0;
    }

71 72
    typename Traits::RangeFieldType j(const typename Traits::IntersectionType&,
                                      const typename Traits::IntersectionDomainType&) const
73 74 75 76
    {
      return 0.0;
    }

77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
    typename Traits::RangeType b(const typename Traits::ElementType&,
                                 const typename Traits::DomainType&) const
    {
      return {0.0};
    }

    typename Traits::RangeFieldType c(const typename Traits::ElementType&,
                                      const typename Traits::DomainType&) const
    {
      return 0.0;
    }

    template <class IG>
    typename Traits::RangeFieldType o(const IG& ig,
                                      const typename Traits::IntersectionDomainType&) const
    {
      return 0.0;
    }

96
  private:
Andreas Nüßing's avatar
Andreas Nüßing committed
97
    std::shared_ptr<const VC> volumeConductor_;
98 99 100 101
  };
}

#endif // DUNE_BIOMAG_CONVECTIONDIFFUSION_DG_DEFAULTPARAMETER_HH