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

[bugfix] fix index error in an interface entry of the load vector

parent 3d379c05
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ public: ...@@ -12,7 +12,7 @@ public:
static constexpr auto iSimplex = Dune::GeometryTypes::simplex(dim-1); static constexpr auto iSimplex = Dune::GeometryTypes::simplex(dim-1);
using Base = DG<GridView, Mapper, Problem>; using Base = DG<GridView, Mapper, Problem>;
using Scalar = typename Base::Scalar; //NOTE using Base::Scalar using Scalar = typename Base::Scalar;
using Matrix = typename Base::Matrix; using Matrix = typename Base::Matrix;
using Vector = typename Base::Vector; using Vector = typename Base::Vector;
using Coordinate = Dune::FieldVector<Scalar, dim>; using Coordinate = Dune::FieldVector<Scalar, dim>;
...@@ -203,22 +203,25 @@ private: ...@@ -203,22 +203,25 @@ private:
const Scalar quadratureFactor = const Scalar quadratureFactor =
ip.weight() * iGeo.integrationElement(qpLocal); ip.weight() * iGeo.integrationElement(qpLocal);
const Scalar betaEvaluation = beta(qpGlobal); const Scalar interfaceUpdate1 = quadratureFactor * beta(qpGlobal);
for (int i = 0; i < dim - 1; i++) for (int i = 0; i < dim - 1; i++)
{ {
for (int j = 0; j <= i; j++) const Scalar qpI = iFrame[i] * qpGlobal;
{ const Scalar interfaceUpdate2 = interfaceUpdate1 * qpI;
(*Base::A)[iElemIdxSLE + i + 1][iElemIdxSLE + j + 1] +=
quadratureFactor * betaEvaluation * (iFrame[i] * qpGlobal)
* (iFrame[j] * qpGlobal);
if (i != j) (*Base::A)[iElemIdxSLE + i + 1][iElemIdxSLE + i + 1] +=
interfaceUpdate2 * qpI;
for (int j = 0; j < i; j++)
{ {
const Scalar interfaceUpdate3 =
interfaceUpdate2 * (iFrame[j] * qpGlobal);
(*Base::A)[iElemIdxSLE + i + 1][iElemIdxSLE + j + 1] +=
interfaceUpdate3;
(*Base::A)[iElemIdxSLE + j + 1][iElemIdxSLE + i + 1] += (*Base::A)[iElemIdxSLE + j + 1][iElemIdxSLE + i + 1] +=
quadratureFactor * betaEvaluation * (iFrame[i] * qpGlobal) interfaceUpdate3;
* (iFrame[j] * qpGlobal);
}
} }
} }
} }
...@@ -571,9 +574,10 @@ private: ...@@ -571,9 +574,10 @@ private:
// int_intersct d * g * (mu * phi_iElem,i + // int_intersct d * g * (mu * phi_iElem,i +
// (Kparallel * grad(phi_i,iElem)) * normal) dr // (Kparallel * grad(phi_i,iElem)) * normal) dr
//for i = 0,...,dim-1 //for i = 0,...,dim-1
const Scalar dgGamma = Base::problem_.aperture(center) const Scalar dEvaluation = Base::problem_.aperture(center);
* Base::problem_.boundary(center); const Scalar dgGamma = dEvaluation * Base::problem_.boundary(center);
Base::b[iElemIdxSLE] += mu * dgGamma;
Base::b[iElemIdxSLE] += mu * dgGamma * dEvaluation;
for (int i = 0; i < dim - 1; i++) for (int i = 0; i < dim - 1; i++)
{ {
...@@ -584,7 +588,8 @@ private: ...@@ -584,7 +588,8 @@ private:
const Scalar interfaceUpdate3 = const Scalar interfaceUpdate3 =
interfaceUpdate1 - interfaceUpdate2; interfaceUpdate1 - interfaceUpdate2;
Base::b[iElemIdxSLE] += dgGamma * (mu * centerI - interfaceUpdate2); Base::b[iElemIdxSLE + i + 1] +=
dgGamma * dEvaluation * (mu * centerI - interfaceUpdate2);
(*Base::A)[iElemIdxSLE + i + 1][iElemIdxSLE] += (*Base::A)[iElemIdxSLE + i + 1][iElemIdxSLE] +=
interfaceUpdate3; interfaceUpdate3;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment