Skip to content
Snippets Groups Projects
Select Git revision
  • 376ca5e1e0b7c6217440a85a2afb9a5c13e2f030
  • master default protected
  • release/1.0
3 results

dgproblem.hh

Blame
  • dgproblem.hh 1.75 KiB
    #ifndef __DUNE_MMDG_DGPROBLEM_HH__
    #define __DUNE_MMDG_DGPROBLEM_HH__
    
    //abstract class providing an interface for a problem that is to be solved with
    //a discontinuous Galerkin scheme
    template<class Coordinate, class Scalar = double>
    class DGProblem
    {
      public:
        static constexpr int dim = Coordinate::dimension;
        using Matrix = Dune::FieldMatrix<Scalar, dim, dim>;
    
        //the exact solution at position pos
        virtual Scalar exactSolution (const Coordinate& pos) const
        {
          return Scalar(0.0);
        }
    
        //indicates whether an exact solution is implemented for the problem
        virtual bool hasExactSolution () const
        {
          return false;
        };
    
        //source term at position pos
        virtual Scalar q (const Coordinate& pos) const
        {
          return Scalar(0.0);
        }
    
        //boundary condition at position pos
        virtual Scalar boundary (const Coordinate& pos) const
        {
          return exactSolution(pos);
        }
    
        //permeability tensor at position pos
        virtual Matrix K (const Coordinate& pos) const
        {
          Matrix permeability(0.0);
    
          for (int i = 0; i < dim; i++)
          {
            permeability[i][i] = 1.0;
          }
    
          //return identity matrix
          return permeability;
        }
    
        //returns the recommended quadrature order to compute an integral
        //over x * q(x)
        virtual int quadratureOrder_q () const
        {
          return 1;
        }
    
        //returns the recommended quadrature order to compute an integral
        //over x * boundary(x) and K(x) * boundary(x)
        virtual int quadratureOrderBoundary () const
        {
          return 1;
        }
    
        //returns the recommended quadrature order to compute an integral
        //over an entry K[i][j] of the permeability tensor
        virtual int quadratureOrder_K () const
        {
          return 0;
        }