Skip to content
Snippets Groups Projects
Select Git revision
  • e5a21426a2cc2ee788998476c17c8a06eb465317
  • master default protected
  • parallelistation_of_subdomain_loop
  • parallelistation_test
  • nonzero_gli_term_for_nonwetting_in_TPR
  • testing_updating_pwi_as_pwiminus1_into_calculation_of_pnwi
  • v2.2
  • v2.1
  • v2.0
  • v1.0
10 results

README.md

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;
        }
    
    };
    
    #endif