Commit dd415ee8 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Added support for variable diffusivity to UnsteadyDiffusion in ADRSolver.

Added regression test for variable coefficient in unsteady diffusion.
Removed cout statements in DisContfield2D
Fixed geometry object look-up error in MeshGraph (since geometry objects are
        now stored in maps)


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3353 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent cffdefd3
......@@ -1038,7 +1038,6 @@ namespace Nektar
{
id = m_traceMap->GetBndCondCoeffsToGlobalCoeffsMap(cnt++);
BndSol[id] = m_bndCondExpansions[i]->GetCoeffs()[j];
cout << "Dirichlet ID: " << id << endl;
}
}
else
......@@ -1058,20 +1057,12 @@ namespace Nektar
//----------------------------------
if(GloBndDofs - NumDirichlet > 0)
{
cout << "Solve linear system" << endl;
GlobalLinSysKey key(StdRegions::eHybridDGHelmBndLam,
m_traceMap,factors,varcoeff);
GlobalLinSysSharedPtr LinSys = GetGlobalBndLinSys(key);
LinSys->Solve(BndRhs,BndSol,m_traceMap);
}
cout << BndSol.num_elements() << endl;
cout << loc_lambda.num_elements() << endl;
//cout << "Before internal solves" << endl;
//for (i = 0; i < GloBndDofs; ++i)
//{
// cout << i << ": " << BndSol[i] << endl;
//}
//----------------------------------
// Internal element solves
//----------------------------------
......@@ -1082,19 +1073,9 @@ namespace Nektar
// get local trace solution from BndSol
m_traceMap->GlobalToLocalBnd(BndSol,loc_lambda);
//cout << "After trace mapping" << endl;
//for (i = 0; i < GloBndDofs; ++i)
//{
// cout << i << ": " << LocLambda[i] << endl;
//}
// out = u_f + u_lam = (*InvHDGHelm)*f + (LamtoU)*Lam
out = (*InvHDGHelm)*F + (*HDGLamToU)*LocLambda;
//cout << "After internal solves" << endl;
//for (i = 0; i < GloBndDofs; ++i)
//{
// cout << i << ": " << LocLambda[i] << endl;
//}
}
......
......@@ -216,15 +216,9 @@ namespace Nektar
{
case eSegment:
{
for(k = 0; k < m_segGeoms.size();++k)
{
if(m_segGeoms[k]->GetGlobalID() == fielddef[i]->m_elementIDs[j])
{
geom = m_segGeoms[k];
break;
}
}
ASSERTL0(k != m_segGeoms.size(),"Failed to find geometry with same global id");
ASSERTL0(m_segGeoms.count(fielddef[i]->m_elementIDs[j]),
"Failed to find geometry with same global id");
geom = m_segGeoms[fielddef[i]->m_elementIDs[j]];
LibUtilities::PointsKey pkey(nmodes[cnt]+1,LibUtilities::eGaussLobattoLegendre);
......@@ -255,15 +249,9 @@ namespace Nektar
break;
case eTriangle:
{
for(k = 0; k < m_triGeoms.size();++k)
{
if(m_triGeoms[k]->GetGlobalID() == fielddef[i]->m_elementIDs[j])
{
geom = m_triGeoms[k];
break;
}
}
ASSERTL0(k != m_triGeoms.size(),"Failed to find geometry with same global id");
ASSERTL0(m_triGeoms.count(fielddef[i]->m_elementIDs[j]),
"Failed to find geometry with same global id");
geom = m_triGeoms[fielddef[i]->m_elementIDs[j]];
LibUtilities::PointsKey pkey(nmodes[cnt]+1,LibUtilities::eGaussLobattoLegendre);
if(numPointDef&&pointDef)
......@@ -312,15 +300,10 @@ namespace Nektar
break;
case eQuadrilateral:
{
for(k = 0; k < m_quadGeoms.size();++k)
{
if(m_quadGeoms[k]->GetGlobalID() == fielddef[i]->m_elementIDs[j])
{
geom = m_quadGeoms[k];
break;
}
}
ASSERTL0(k != m_quadGeoms.size(),"Failed to find geometry with same global id");
ASSERTL0(m_quadGeoms.count(fielddef[i]->m_elementIDs[j]),
"Failed to find geometry with same global id");
geom = m_quadGeoms[fielddef[i]->m_elementIDs[j]];
for(int b = 0; b < 2; ++b)
{
LibUtilities::PointsKey pkey(nmodes[cnt+b]+1,LibUtilities::eGaussLobattoLegendre);
......
......@@ -130,6 +130,8 @@ int main(int argc, char* argv[])
Execute("ADRSolver","Test_ImDiffusion_m12.xml","2D unsteady DG implicit diffusion, order 3, P=12");
Execute("ADRSolver","Test_ImDiffusion_VarCoeff.xml","2D unsteady CG implicit diffusion, variable coeffs.");
Execute("ADRSolver","Test_ExDiffusion_m3.xml","2D unsteady DG explicit diffusion, order 4, P=3");
Execute("ADRSolver","Test_ExDiffusion_m8.xml","2D unsteady DG explicit diffusion, order 4, P=8");
......
......@@ -21,8 +21,8 @@ L 2 error (variable u) : 9.55749e-05
L inf error (variable u) : 9.27095e-05
----------------------------------------
Test_Advection_m14_Order4.xml
L 2 error (variable u) : 8.38709e-09
L inf error (variable u) : 5.3248e-08
L 2 error (variable u) : 8.38722e-09
L inf error (variable u) : 5.32501e-08
----------------------------------------
Test_Helmholtz2D_modal_DG.xml
L 2 error (variable u) : 0.011251
......@@ -37,7 +37,7 @@ L 2 error (variable u) : 9.18608e-05
L inf error (variable u) : 9.63598e-05
----------------------------------------
Test_Advection_m14_DG_Order4.xml
L 2 error (variable u) : 3.88032e-09
L 2 error (variable u) : 3.88022e-09
L inf error (variable u) : 6.24598e-08
----------------------------------------
Test_Helmholtz1D_8modes.xml
......@@ -65,8 +65,8 @@ L 2 error (variable u) : 3.62709e-05
L inf error (variable u) : 2.4442e-05
----------------------------------------
Test_Advection1D_m14_Order4.xml
L 2 error (variable u) : 8.17268e-11
L inf error (variable u) : 3.02663e-10
L 2 error (variable u) : 8.1655e-11
L inf error (variable u) : 3.02724e-10
----------------------------------------
Test_ImDiffusion_m6.xml
L 2 error (variable u) : 0.00424554
......@@ -140,3 +140,7 @@ Test_UnsteadyAdvectionDiffusion_3DHomo2D_FFT.xml
L 2 error (variable u) : 5.79861e-09
L inf error (variable u) : 1.14218e-08
----------------------------------------
Test_ImDiffusion_VarCoeff.xml
L 2 error (variable u) : 0.00173845
L inf error (variable u) : 0.00173845
----------------------------------------
......@@ -54,6 +54,23 @@ namespace Nektar
m_session->LoadParameter("wavefreq", m_waveFreq, 0.0);
m_session->LoadParameter("epsilon", m_epsilon, 0.0);
int nq = m_fields[0]->GetNpoints();
if(m_session->DefinesParameter("d00"))
{
m_varcoeff[StdRegions::eVarCoeffD00]
= Array<OneD, NekDouble>(nq, m_session->GetParameter("d00"));
}
if(m_session->DefinesParameter("d11"))
{
m_varcoeff[StdRegions::eVarCoeffD11]
= Array<OneD, NekDouble>(nq, m_session->GetParameter("d11"));
}
if(m_session->DefinesParameter("d22"))
{
m_varcoeff[StdRegions::eVarCoeffD22]
= Array<OneD, NekDouble>(nq, m_session->GetParameter("d22"));
}
if (m_explicitDiffusion)
{
m_ode.DefineOdeRhs (&UnsteadyDiffusion::DoOdeRhs, this);
......@@ -133,7 +150,7 @@ namespace Nektar
// Solve a system of equations with Helmholtz solver
m_fields[i]->HelmSolve(m_fields[i]->GetPhys(),
m_fields[i]->UpdateCoeffs(),NullFlagList,factors);
m_fields[i]->UpdateCoeffs(),NullFlagList,factors,m_varcoeff);
m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(), m_fields[i]->UpdatePhys());
m_fields[i]->SetPhysState(false);
......
......@@ -80,6 +80,7 @@ namespace Nektar
private:
NekDouble m_waveFreq;
NekDouble m_epsilon;
StdRegions::VarCoeffMap m_varcoeff;
};
}
......
Supports Markdown
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