Commit 45ea4fe7 authored by Douglas Serson's avatar Douglas Serson

Merge branch 'fix/artificialdiffusion-parallel' into 'master'

Fix bug with artificial diffusion when running in parallel

See merge request !885
parents c7683d43 5cdee0aa
......@@ -101,6 +101,7 @@ v4.4.2
- Fix a few memory leaks in polylib (!863)
- Fix a crash when Interpolator is called on an empty field (!869)
- Fix petsc compile without MPI (!873)
- Fix deadlock in DiffusionLDG (!885)
- Fix uninitialised coefficients in DirectFull solver (!898)
**NekMesh**
......
......@@ -265,9 +265,11 @@ namespace Nektar
// if Vn >= 0, uflux = uFwd at Neumann, i.e.,
// edge::eForward, if V*n<0 <=> V*n_F<0, pick uflux = uFwd
// edge::eBackward, if V*n<0 <=> V*n_B>=0, pick uflux = uFwd
Array<OneD, NekDouble > uplus(nTracePts);
fields[i]->ExtractTracePhys(ufield[i], uplus);
if(fields[0]->GetBndCondExpansions().num_elements())
{
v_WeakPenaltyforScalar(fields, i, ufield[i], fluxtemp);
v_WeakPenaltyforScalar(fields, i, ufield[i], uplus, fluxtemp);
}
for (j = 0; j < nDim; ++j)
......@@ -296,6 +298,7 @@ namespace Nektar
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const int var,
const Array<OneD, const NekDouble> &ufield,
const Array<OneD, const NekDouble> &uplus,
Array<OneD, NekDouble> &penaltyflux)
{
int i, e, id1, id2;
......@@ -304,10 +307,7 @@ namespace Nektar
int nBndEdgePts, nBndEdges;
int cnt = 0;
int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
int nTracePts = fields[0]->GetTrace()->GetTotPoints();
Array<OneD, NekDouble > uplus(nTracePts);
fields[var]->ExtractTracePhys(ufield, uplus);
for (i = 0; i < nBndRegions; ++i)
{
// Number of boundary expansion related to that region
......@@ -434,11 +434,14 @@ namespace Nektar
qfluxtemp, 1,
qfluxtemp, 1);
Array<OneD, NekDouble > qtemp(nTracePts);
fields[i]->ExtractTracePhys(qfield[j][i], qtemp);
// Imposing weak boundary condition with flux
if (fields[0]->GetBndCondExpansions().num_elements())
{
v_WeakPenaltyforVector(fields, i, j,
qfield[j][i],
qfield[j][i], qtemp,
qfluxtemp, C11);
}
......@@ -465,15 +468,13 @@ namespace Nektar
const int var,
const int dir,
const Array<OneD, const NekDouble> &qfield,
const Array<OneD, const NekDouble> &qtemp,
Array<OneD, NekDouble> &penaltyflux,
NekDouble C11)
{
int i, e, id1, id2;
int nBndEdges, nBndEdgePts;
int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
int nTracePts = fields[0]->GetTrace()->GetTotPoints();
Array<OneD, NekDouble > qtemp(nTracePts);
int cnt = 0;
/*
......@@ -486,8 +487,6 @@ namespace Nektar
fields[0]->GetTrace()->GetNormals(m_traceNormals);
*/
fields[var]->ExtractTracePhys(qfield, qtemp);
for (i = 0; i < nBndRegions; ++i)
{
nBndEdges = fields[var]->
......
......@@ -83,6 +83,7 @@ namespace Nektar
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const int var,
const Array<OneD, const NekDouble> &ufield,
const Array<OneD, const NekDouble> &uplus,
Array<OneD, NekDouble> &penaltyflux);
virtual void v_NumFluxforVector(
......@@ -96,6 +97,7 @@ namespace Nektar
const int var,
const int dir,
const Array<OneD, const NekDouble> &qfield,
const Array<OneD, const NekDouble> &qtemp,
Array<OneD, NekDouble> &penaltyflux,
NekDouble C11);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment