Select Git revision
mmdgproblem4.hh
mmdgproblem4.hh 2.33 KiB
#ifndef __DUNE_MMDG_MMDGPROBLEM4_HH__
#define __DUNE_MMDG_MMDGPROBLEM4_HH__
#include <cmath>
#include <dune/mmdg/problems/coupleddgproblem.hh>
//a coupled dg problem
template<class Coordinate, class Scalar = double>
class MMDGProblem4 : public CoupledDGProblem<Coordinate, Scalar>
{
public:
static constexpr int dim = Coordinate::dimension;
using Base = CoupledDGProblem<Coordinate, Scalar>;
using Matrix = typename Base::Matrix;
//constructor
MMDGProblem4 (const Scalar d) : d_(d) {}
//the exact bulk solution at position pos
Scalar exactSolution (const Coordinate& pos) const
{
Scalar solution = pos[0] * pos[0] - pos[1] * pos[1];
if (pos[0] > 0.5)
{
return solution += d_;
}
return solution;
}
//the exact solution on the interface at position pos
Scalar exactInterfaceSolution (const Coordinate& pos) const
{
return 0.25 - pos[1] * pos[1] + 0.5 * d_;
}
//indicates whether an exact solution is implemented for the problem
bool hasExactSolution () const
{
return true;
};
//interface source term at position pos
Scalar qInterface (const Coordinate& pos) const
{
return 2.0 * d_;
}
//aperture d of the fracture at position pos
Scalar aperture (const Coordinate& pos) const
{
return d_;
}
//permeability of the fracture in normal direction at position pos
Scalar Kperp (const Coordinate& pos) const
{
return Scalar(1.0) / d_;
}
//tangential permeability tensor of the interface at position pos
Matrix Kparallel (const Coordinate& pos) const
{
Matrix permeability(0.0);
for (int i = 0; i < dim; i++)
{
permeability[i][i] = 1.0 / d_;
}
return permeability;
}
//returns the recommended quadrature order to compute an integral
//over x * boundary(x)
int quadratureOrderBoundary () const
{
return 10;
}
//returns the recommended quadrature order to compute an integral
//over x * interfaceBoundary(x)
int quadratureOrderInterfaceBoundary () const
{
return 10;
}
//returns the recommended quadrature order to compute an integral
//over x * qInterface(x)
int quadratureOrder_qInterface () const
{
return 10;
}
//returns the recommended quadrature order to compute an integral
//over x * q(x)
int quadratureOrder_q () const
{
return 10;
}
private:
Scalar d_; //aperture
};
#endif