Commit ac3fbde8 authored by Spencer Sherwin's avatar Spencer Sherwin

Updated to introduce a new VarFactorsMap into the GlobalLinSysKey and the...

Updated to introduce a new VarFactorsMap into the GlobalLinSysKey and the setup of SVVCutoffRatio which allows you to specify a single parameter per element rather than a parameter at all quadrature points. Unfortunately this mean changing HelmSolve method and changing quite a few files
parent c08dd338
......@@ -540,6 +540,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......@@ -571,7 +572,7 @@ namespace Nektar
// Solve the system
GlobalLinSysKey key(StdRegions::eHelmholtz,
m_locToGloMap,factors,varcoeff);
m_locToGloMap,factors,varcoeff,varfactors);
if(flags.isSet(eUseGlobal))
{
......
......@@ -206,6 +206,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -878,6 +878,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
......@@ -927,7 +928,7 @@ namespace Nektar
// Add weak boundary conditions to forcing
Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
GlobalLinSysKey key(StdRegions::eHelmholtz,m_locToGloMap,factors,varcoeff);
GlobalLinSysKey key(StdRegions::eHelmholtz,m_locToGloMap,factors,varcoeff,varfactors);
if(flags.isSet(eUseGlobal))
{
......
......@@ -245,6 +245,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -579,6 +579,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......@@ -625,7 +626,7 @@ namespace Nektar
Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
// Solve the system
GlobalLinSysKey key(StdRegions::eHelmholtz, m_locToGloMap, factors,varcoeff);
GlobalLinSysKey key(StdRegions::eHelmholtz, m_locToGloMap, factors,varcoeff,varfactors);
if(flags.isSet(eUseGlobal))
{
......
......@@ -182,6 +182,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
virtual void v_GeneralMatrixOp(
......
......@@ -252,6 +252,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......@@ -302,7 +303,7 @@ namespace Nektar
m_planes[n]->HelmSolve(wfce,
e_out = outarray + cnt1,
flags, new_factors, varcoeff,
dirForcing,
varfactors, dirForcing,
PhysSpaceForcing);
}
......
......@@ -95,6 +95,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -158,6 +158,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......@@ -199,7 +200,8 @@ namespace Nektar
wfce = (PhysSpaceForcing)? fce+cnt:fce+cnt1;
m_lines[l]->HelmSolve(wfce,
e_out = outarray + cnt1,
flags, new_factors, varcoeff, dirForcing,
flags, new_factors, varcoeff, varfactors,
dirForcing,
PhysSpaceForcing);
cnt += m_lines[l]->GetTotPoints();
......
......@@ -88,6 +88,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -1162,6 +1162,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......
......@@ -259,6 +259,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -1862,6 +1862,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
......
......@@ -230,6 +230,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
virtual void v_GeneralMatrixOp(
......
......@@ -2024,6 +2024,7 @@ using namespace boost::assign;
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......
......@@ -189,6 +189,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -266,6 +266,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......@@ -303,7 +304,8 @@ namespace Nektar
m_planes[n]->HelmSolve(
wfce,
e_out = outarray + cnt1,
flags, new_factors, varcoeff, dirForcing,
flags, new_factors, varcoeff, varfactors,
dirForcing,
PhysSpaceForcing);
}
......
......@@ -275,6 +275,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -211,6 +211,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......@@ -251,7 +252,7 @@ namespace Nektar
m_lines[n]->HelmSolve(wfce,
e_out = outarray + cnt1,
flags, new_factors,
varcoeff, dirForcing,
varcoeff, varfactors,dirForcing,
PhysSpaceForcing);
cnt += m_lines[n]->GetTotPoints();
......
......@@ -134,6 +134,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......
......@@ -2508,6 +2508,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
......
......@@ -46,6 +46,7 @@
#include <MultiRegions/MultiRegions.hpp>
#include <MultiRegions/GlobalMatrix.h>
#include <MultiRegions/GlobalMatrixKey.h>
#include <MultiRegions/GlobalLinSysKey.h>
#include <MultiRegions/GlobalOptimizationParameters.h>
#include <MultiRegions/AssemblyMap/AssemblyMap.h>
#include <boost/enable_shared_from_this.hpp>
......@@ -278,6 +279,8 @@ namespace Nektar
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff =
StdRegions::NullVarCoeffMap,
const MultiRegions::VarFactorsMap &varfactors =
MultiRegions::NullVarFactorsMap,
const Array<OneD, const NekDouble> &dirForcing =
NullNekDouble1DArray,
const bool PhysSpaceForcing = true);
......@@ -1197,6 +1200,7 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing);
......@@ -1745,12 +1749,13 @@ namespace Nektar
const FlagList &flags,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varcoeff,
const MultiRegions::VarFactorsMap &varfactors,
const Array<OneD, const NekDouble> &dirForcing,
const bool PhysSpaceForcing)
{
v_HelmSolve(inarray, outarray, flags, factors, varcoeff,
dirForcing, PhysSpaceForcing);
varfactors, dirForcing, PhysSpaceForcing);
}
......
......@@ -259,26 +259,31 @@ namespace Nektar
StdRegions::ConstFactorMap vConstFactorMap = m_linSysKey.GetConstFactors();
// retrieve variable coefficients
if(m_linSysKey.GetNVarCoeffs() > 0)
// setup variable factors
if(m_linSysKey.GetNVarFactors() > 0)
{
if(m_linSysKey.GetVarCoeffs().
count(StdRegions::eVarCoeffSVVDiff) != 0)
if(m_linSysKey.GetVarFactors().
count(StdRegions::eFactorSVVDiffCoeff) != 0)
{
ASSERTL1(m_linSysKey.GetConstFactors().
count(StdRegions::eFactorSVVDiffCoeff),
"VarCoeffSVVDiff is set but not FactorSVVDiff");
vConstFactorMap[StdRegions::eFactorSVVDiffCoeff] =
m_linSysKey.GetVarCoeff(StdRegions::eVarCoeffSVVDiff)[n];
m_linSysKey.GetVarFactors(StdRegions::eFactorSVVDiffCoeff)[n];
ASSERTL1(m_linSysKey.GetConstFactors().
count(StdRegions::eFactorSVVCutoffRatio),
"VarCoeffSVVCuroffRatio is set but not FactorSVVCutoffRatio");
vConstFactorMap[StdRegions::eFactorSVVCutoffRatio] =
m_linSysKey.GetVarCoeff(StdRegions::eVarCoeffSVVCutoffRatio)[n];
m_linSysKey.GetVarFactors(StdRegions::eFactorSVVCutoffRatio)[n];
}
}
// retrieve variable coefficients
if(m_linSysKey.GetNVarCoeffs() > 0)
{
StdRegions::VarCoeffMap::const_iterator x;
cnt = expList->GetPhys_Offset(n);
......@@ -286,11 +291,7 @@ namespace Nektar
for (x = m_linSysKey.GetVarCoeffs().begin();
x != m_linSysKey.GetVarCoeffs().end(); ++x)
{
if((x->first != StdRegions::eFactorSVVCutoffRatio)
||(x->first != StdRegions::eVarCoeffSVVDiff))
{
vVarCoeffMap[x->first] = x->second + cnt;
}
vVarCoeffMap[x->first] = x->second + cnt;
}
}
......@@ -354,39 +355,39 @@ namespace Nektar
StdRegions::ConstFactorMap vConstFactorMap = m_linSysKey.GetConstFactors();
// retrieve variable coefficients
if(m_linSysKey.GetNVarCoeffs() > 0)
// setup variable factors
if(m_linSysKey.GetNVarFactors() > 0)
{
if(m_linSysKey.GetVarCoeffs().
count(StdRegions::eVarCoeffSVVDiff) != 0)
if(m_linSysKey.GetVarFactors().
count(StdRegions::eFactorSVVDiffCoeff) != 0)
{
ASSERTL0(m_linSysKey.GetConstFactors().
count(StdRegions::eFactorSVVDiffCoeff),
"VarCoeffSVVDiff is set but not FactorSVVDiffCoeff");
vConstFactorMap[StdRegions::eFactorSVVDiffCoeff] =
m_linSysKey.GetVarCoeff(StdRegions::eVarCoeffSVVDiff)[n];
m_linSysKey.GetVarFactors(StdRegions::eFactorSVVDiffCoeff)[n];
ASSERTL1(m_linSysKey.GetConstFactors().
count(StdRegions::eFactorSVVCutoffRatio),
"VarCoeffSVVCuroffRatio is set but not FactorSVVCutoffRatio");
vConstFactorMap[StdRegions::eFactorSVVCutoffRatio] =
m_linSysKey.GetVarCoeff(StdRegions::eVarCoeffSVVCutoffRatio)[n];
m_linSysKey.GetVarFactors(StdRegions::eFactorSVVCutoffRatio)[n];
}
}
// retrieve variable coefficients
if(m_linSysKey.GetNVarCoeffs() > 0)
{
StdRegions::VarCoeffMap::const_iterator x;
cnt = expList->GetPhys_Offset(n);
for (x = m_linSysKey.GetVarCoeffs().begin();
x != m_linSysKey.GetVarCoeffs().end (); ++x)
{
if((x->first != StdRegions::eFactorSVVCutoffRatio)
||(x->first != StdRegions::eVarCoeffSVVDiff))
{
vVarCoeffMap[x->first] = x->second + cnt;
}
vVarCoeffMap[x->first] = x->second + cnt;
}
}
......@@ -455,29 +456,30 @@ namespace Nektar
StdRegions::VarCoeffMap vVarCoeffMap;
StdRegions::ConstFactorMap vConstFactorMap = m_linSysKey.GetConstFactors();
// retrieve variable coefficients
if(m_linSysKey.GetNVarCoeffs() > 0)
// setup variable factors
if(m_linSysKey.GetNVarFactors() > 0)
{
if(m_linSysKey.GetVarCoeffs().
count(StdRegions::eVarCoeffSVVDiff) != 0)
if(m_linSysKey.GetVarFactors().
count(StdRegions::eFactorSVVDiffCoeff) != 0)
{
vConstFactorMap[StdRegions::eFactorSVVDiffCoeff] =
m_linSysKey.GetVarCoeff(StdRegions::eVarCoeffSVVDiff)[n];
m_linSysKey.GetVarFactors(StdRegions::eFactorSVVDiffCoeff)[n];
vConstFactorMap[StdRegions::eFactorSVVCutoffRatio] =
m_linSysKey.GetVarCoeff(StdRegions::eVarCoeffSVVCutoffRatio)[n];
m_linSysKey.GetVarFactors(StdRegions::eFactorSVVCutoffRatio)[n];
}
}
// retrieve variable coefficients
if(m_linSysKey.GetNVarCoeffs() > 0)
{
StdRegions::VarCoeffMap::const_iterator x;
int cnt = expList->GetPhys_Offset(n);
for (x = m_linSysKey.GetVarCoeffs().begin();
x != m_linSysKey.GetVarCoeffs().end (); ++x)
{
if((x->first != StdRegions::eFactorSVVCutoffRatio)
||(x->first != StdRegions::eVarCoeffSVVDiff))
{
vVarCoeffMap[x->first] = x->second + cnt;
}
vVarCoeffMap[x->first] = x->second + cnt;
}
}
......
......@@ -59,11 +59,22 @@ namespace Nektar
GlobalLinSysKey::GlobalLinSysKey(const StdRegions::MatrixType matrixType,
const AssemblyMapSharedPtr &locToGloMap,
const StdRegions::ConstFactorMap &factors,
const StdRegions::VarCoeffMap &varCoeffs) :
const StdRegions::VarCoeffMap &varCoeffs,
const VarFactorsMap &varFactors) :
GlobalMatrixKey(matrixType, locToGloMap, factors, varCoeffs),
m_solnType(locToGloMap->GetGlobalSysSolnType())
m_solnType(locToGloMap->GetGlobalSysSolnType()),
m_varFactors(varFactors),
m_varFactors_hashes(varFactors.size())
{
// Create hash
int i = 0;
for (VarFactorsMap::const_iterator x = varFactors.begin();
x != varFactors.end(); ++x)
{
m_varFactors_hashes[i] = boost::hash_range(x->second.begin(), x->second.begin() + x->second.num_elements());
boost::hash_combine(m_varFactors_hashes[i], (int)x->first);
i++;
}
}
......@@ -72,7 +83,9 @@ namespace Nektar
*/
GlobalLinSysKey::GlobalLinSysKey(const GlobalLinSysKey &key):
GlobalMatrixKey(key),
m_solnType(key.m_solnType)
m_solnType(key.m_solnType),
m_varFactors(key.m_varFactors),
m_varFactors_hashes(key.m_varFactors_hashes)
{
}
......@@ -105,6 +118,28 @@ namespace Nektar
return false;
}
if(lhs.m_varFactors.size() < rhs.m_varFactors.size())
{
return true;
}
if(lhs.m_varFactors.size() > rhs.m_varFactors.size())
{
return false;
}
for (unsigned int i = 0; i < lhs.m_varFactors_hashes.size(); ++i)
{
if(lhs.m_varFactors_hashes[i] < rhs.m_varFactors_hashes[i])
{
return true;
}
if(lhs.m_varFactors_hashes[i] > rhs.m_varFactors_hashes[i])
{
return false;
}
}
return (*dynamic_cast<const GlobalMatrixKey*>(&lhs)
< *dynamic_cast<const GlobalMatrixKey*>(&rhs));
}
......@@ -132,6 +167,9 @@ namespace Nektar
}
os << "Number of variable coefficients: "
<< rhs.GetNVarCoeffs() << endl;
os << "Number of variable factors : "
<< rhs.GetNVarFactors() << endl;
return os;
}
......
......@@ -43,6 +43,10 @@ namespace Nektar
{
namespace MultiRegions
{
typedef std::map<StdRegions::ConstFactorType, Array<OneD, NekDouble> > VarFactorsMap;
static VarFactorsMap NullVarFactorsMap;
/// Describe a linear system.
class GlobalLinSysKey : public GlobalMatrixKey
{
......@@ -51,7 +55,8 @@ namespace Nektar
const AssemblyMapSharedPtr &locToGloMap
= NullAssemblyMapSharedPtr,
const StdRegions::ConstFactorMap &factors = StdRegions::NullConstFactorMap,
const StdRegions::VarCoeffMap &varCoeffs = StdRegions::NullVarCoeffMap);
const StdRegions::VarCoeffMap &varCoeffs = StdRegions::NullVarCoeffMap,
const VarFactorsMap &varFactos = NullVarFactorsMap);
/// Copy constructor.
MULTI_REGIONS_EXPORT GlobalLinSysKey(const GlobalLinSysKey &key);
......@@ -64,12 +69,20 @@ namespace Nektar
/// Return the associated solution type.
inline GlobalSysSolnType GetGlobalSysSolnType() const;
MULTI_REGIONS_EXPORT int GetNVarFactors() const;
MULTI_REGIONS_EXPORT const Array<OneD, const NekDouble> & GetVarFactors(const StdRegions::ConstFactorType& coeff) const;
MULTI_REGIONS_EXPORT const VarFactorsMap & GetVarFactors() const;
protected:
/// Store the solution type associated with the linear system. This
/// may be none, full matrix, static condensation or multi-level
/// static condensation.
GlobalSysSolnType m_solnType;
VarFactorsMap m_varFactors;
std::vector<std::size_t> m_varFactors_hashes;
private:
};
......@@ -83,6 +96,22 @@ namespace Nektar
return m_solnType;
}
inline int GlobalLinSysKey::GetNVarFactors() const
{
return m_varFactors.size();
}
inline const Array<OneD, const NekDouble> & GlobalLinSysKey::GetVarFactors(const StdRegions::ConstFactorType &factor) const
{
VarFactorsMap::const_iterator found = m_varFactors.find(factor);
return (*found).second;
}
inline const VarFactorsMap & GlobalLinSysKey::GetVarFactors() const
{
return m_varFactors;
}
}
}
......
......@@ -208,9 +208,7 @@ namespace Nektar
eVarCoeffD12,
eVarCoeffVelX,
eVarCoeffVelY,
eVarCoeffVelZ,
eVarCoeffSVVDiff,
eVarCoeffSVVCutoffRatio
eVarCoeffVelZ
};
const char* const VarCoeffTypeMap[] = {
......@@ -224,9 +222,7 @@ namespace Nektar
"VarCoeffD02",
"VarCoeffD12",
"VarCoeffVelX",
"VarCoeffVelY",
"VarCoeffSVVDiff",
"VarCoeffSVVCutoffRatio"
"VarCoeffVelY"
};
typedef std::map<StdRegions::VarCoeffType, Array<OneD, NekDouble> > VarCoeffMap;
static VarCoeffMap NullVarCoeffMap;
......
......@@ -230,8 +230,8 @@ namespace Nektar
m_session->LoadParameter("DynamicViscDefS0",
m_dynamicVisc->m_defS0,3);
//setup SVV parameters with default values;
m_dynamicVisc->m_savVarCoeffMap[StdRegions::eVarCoeffSVVCutoffRatio] = Array<OneD, NekDouble>(nel,m_sVVCutoffRatio);
m_dynamicVisc->m_savVarCoeffMap[StdRegions::eVarCoeffSVVDiff] = Array<OneD, NekDouble>(nel,m_sVVDiffCoeff/m_kinvis);
m_dynamicVisc->m_savVarFactorsMap[StdRegions::eFactorSVVCutoffRatio] = Array<OneD, NekDouble>(nel,m_sVVCutoffRatio);
m_dynamicVisc->m_savVarFactorsMap[StdRegions::eFactorSVVDiffCoeff] = Array<OneD, NekDouble>(nel,m_sVVDiffCoeff/m_kinvis);
}
else
{
......@@ -583,6 +583,8 @@ namespace Nektar
{
StdRegions::ConstFactorMap factors;
StdRegions::VarCoeffMap varCoeffMap = StdRegions::NullVarCoeffMap;
MultiRegions::VarFactorsMap varFactorsMap =
MultiRegions::NullVarFactorsMap;
if(m_useSpecVanVisc)
{
......@@ -592,7 +594,8 @@ namespace Nektar
if(m_dynamicVisc)
{
varCoeffMap = m_dynamicVisc->m_savVarCoeffMap;
varCoeffMap = m_dynamicVisc->m_savVarCoeffMap;
varFactorsMap = m_dynamicVisc->m_savVarFactorsMap;
}
// Solve Helmholtz system and put in Physical space
......@@ -601,7 +604,8 @@ namespace Nektar
// Setup coefficients for equation
factors[StdRegions::eFactorLambda] = 1.0/aii_Dt/m_diffCoeff[i];
m_fields[i]->HelmSolve(Forcing[i], m_fields[i]->UpdateCoeffs(),
NullFlagList, factors, varCoeffMap);
NullFlagList, factors, varCoeffMap,
varFactorsMap);
m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(),outarray[i]);
}
}
......@@ -661,7 +665,7 @@ namespace Nektar
= boost::lexical_cast<std::string>(m_dynamicVisc->m_fixedKinvis);
}
if(m_dynamicVisc->m_savVarCoeffMap.count(StdRegions::eVarCoeffSVVCutoffRatio) != 0)
if(m_dynamicVisc->m_savVarFactorsMap.count(StdRegions::eFactorSVVCutoffRatio) != 0)
{
variables.push_back("DynamicSVVCutoff");
Array<OneD, NekDouble> newfld(ncoeffs);
......@@ -677,8 +681,8 @@ namespace Nektar
Vmath::Fill(nquad,
m_dynamicVisc->
m_savVarCoeffMap[
StdRegions::eVarCoeffSVVCutoffRatio][e],
m_savVarFactorsMap[
StdRegions::eFactorSVVCutoffRatio][e],
tmp = cutoff+offset,1);
offset += nquad;
}
......@@ -886,13 +890,13 @@ namespace Nektar
#if 0
cout << SVVCutoffRatio[e] << " " <<
m_dynamicVisc->m_savVarCoeffMap
[StdRegions::eVarCoeffSVVCutoffRatio][e] << endl;
m_dynamicVisc->m_savVarFactorsMap
[StdRegions::eFactorSVVCutoffRatio][e] << endl;
#endif
IsDiff = (fabs(SVVCutoffRatio[e] - m_dynamicVisc->
m_savVarCoeffMap
[StdRegions::eVarCoeffSVVCutoffRatio][e])
m_savVarFactorsMap
[StdRegions::eFactorSVVCutoffRatio][e])
> 0.1 ) ? 0:1;
}
......@@ -901,11 +905,11 @@ namespace Nektar
if(IsDiff)
{
m_dynamicVisc->m_savVarCoeffMap[
StdRegions::eVarCoeffSVVDiff]
m_dynamicVisc->m_savVarFactorsMap[
StdRegions::eFactorSVVDiffCoeff]
= SVVDiffCoeff;
m_dynamicVisc->m_savVarCoeffMap
[StdRegions::eVarCoeffSVVCutoffRatio]
m_dynamicVisc->m_savVarFactorsMap
[StdRegions::eFactorSVVCutoffRatio]
= SVVCutoffRatio;
if (m_comm->GetRank() == 0)
......
......@@ -59,6 +59,7 @@ namespace Nektar
NekDouble m_defS0;
Array<OneD, NekDouble> m_h; /// estimate of h for an element
MultiRegions::VarFactorsMap m_savVarFactorsMap;
StdRegions::VarCoeffMap m_savVarCoeffMap;
ForcingDynamicViscSharedPtr m_forcing;
......
......@@ -141,6 +141,7 @@ namespace Nektar
m_pressure->HelmSolve(Forcing, m_pressure->UpdateCoeffs(),
NullFlagList,
factors, StdRegions::NullVarCoeffMap,
MultiRegions::NullVarFactorsMap,