Skip to content
Snippets Groups Projects
Commit e62bdc74 authored by Hörl, Maximilian's avatar Hörl, Maximilian
Browse files

change problem mmdg6 to allow arbitrary xi

parent bfe1f4f7
Branches
Tags
No related merge requests found
...@@ -12,7 +12,10 @@ public: ...@@ -12,7 +12,10 @@ public:
static constexpr int dim = Coordinate::dimension; static constexpr int dim = Coordinate::dimension;
//constructor //constructor
MMDGProblem6 (const Scalar d0) : d0_(d0) {} MMDGProblem6 (const Scalar d0) : d0_(d0), xi_(1.0) {}
//constructor
MMDGProblem6 (const Scalar d0, const Scalar xi) : d0_(d0), xi_(xi) {}
//the exact bulk solution at position pos //the exact bulk solution at position pos
Scalar exactSolution (const Coordinate& pos) const Scalar exactSolution (const Coordinate& pos) const
...@@ -26,7 +29,11 @@ public: ...@@ -26,7 +29,11 @@ public:
//the exact solution on the interface at position pos //the exact solution on the interface at position pos
Scalar exactInterfaceSolution (const Coordinate& pos) const Scalar exactInterfaceSolution (const Coordinate& pos) const
{ {
return std::cos(4.0 * pos[1]); constexpr Scalar coshsqrt2 = std::cosh(sqrt(2.0));
constexpr Scalar sinhsqrt2 = std::sinh(sqrt(2.0));
return std::cos(4.0 * pos[1]) * (coshsqrt2 * coshsqrt2
- (2 * xi_ - 1) * sinhsqrt2 * sinhsqrt2);
} }
//indicates whether an exact solution is implemented for the problem //indicates whether an exact solution is implemented for the problem
...@@ -49,8 +56,12 @@ public: ...@@ -49,8 +56,12 @@ public:
{ {
const Scalar cos4y = std::cos(4.0 * pos[1]); const Scalar cos4y = std::cos(4.0 * pos[1]);
constexpr Scalar sqrt2 = 2.0 * sqrt(2.0); constexpr Scalar sqrt2 = 2.0 * sqrt(2.0);
constexpr Scalar coshsqrt2 = std::cosh(sqrt(2.0));
constexpr Scalar sinhsqrt2 = std::sinh(sqrt(2.0));
const Scalar hyperbolicFactor =
(coshsqrt2 * coshsqrt2 - (2 * xi_ - 1) * sinhsqrt2 * sinhsqrt2);
return -48.0 * d0_ * d0_ * std::exp(-8.0 * pos[1]) * ( cos4y return -48.0 * d0_ * d0_ * std::exp(-8.0 * pos[1]) * hyperbolicFactor * ( cos4y
+ 3.0 * std::sin(4.0 * pos[1]) ) - sqrt2 * std::sinh(sqrt2) * cos4y; + 3.0 * std::sin(4.0 * pos[1]) ) - sqrt2 * std::sinh(sqrt2) * cos4y;
} }
...@@ -117,6 +128,7 @@ public: ...@@ -117,6 +128,7 @@ public:
private: private:
Scalar d0_; //prefactor of the aperture Scalar d0_; //prefactor of the aperture
Scalar xi_; //coupling constant
}; };
......
...@@ -95,9 +95,9 @@ int main(int argc, char** argv) ...@@ -95,9 +95,9 @@ int main(int argc, char** argv)
} }
else if (pt["problem"] == "mmdg6") else if (pt["problem"] == "mmdg6")
{ {
problem = new MMDGProblem6<Coordinate>(aperture); xi = (pt.hasKey("xi")) ? std::stod(pt["xi"]) : 1.0;
problem = new MMDGProblem6<Coordinate>(aperture, xi);
gridType = "mmdg2_5e-2"; gridType = "mmdg2_5e-2";
xi = 1.0;
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment