Commit cc2e213d authored by Kilian Lackhove's avatar Kilian Lackhove
Browse files

Forcing: move smoothing back into APE

parent dfb6f903
...@@ -118,17 +118,9 @@ namespace Nektar ...@@ -118,17 +118,9 @@ namespace Nektar
return vForceList; return vForceList;
} }
void Forcing::Smooth(const MultiRegions::ExpListSharedPtr &field) Nektar::Array<OneD, Array<OneD, NekDouble> > &Forcing::UpdateForces()
{ {
Array<OneD, NekDouble> tmpC(m_Forcing[0].num_elements()); return m_Forcing;
for (int i = 0; i < m_NumVariable; ++i)
{
field->IProductWRTBase(m_Forcing[i], tmpC);
field->MultiplyByElmtInvMass(tmpC, tmpC);
field->LocalToGlobal(tmpC, tmpC);
field->GlobalToLocal(tmpC, tmpC);
field->BwdTrans(tmpC, m_Forcing[i]);
}
} }
const Nektar::Array<OneD, const Array<OneD, NekDouble> > &Forcing::GetForces() const Nektar::Array<OneD, const Array<OneD, NekDouble> > &Forcing::GetForces()
......
...@@ -90,11 +90,10 @@ namespace SolverUtils ...@@ -90,11 +90,10 @@ namespace SolverUtils
const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields, const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
const unsigned int& pNumForcingFields = 0); const unsigned int& pNumForcingFields = 0);
SOLVER_UTILS_EXPORT const Array<OneD, const Array<OneD, NekDouble> >& SOLVER_UTILS_EXPORT const Array<OneD, const Array<OneD, NekDouble> >
GetForces(); &GetForces();
SOLVER_UTILS_EXPORT void Smooth( SOLVER_UTILS_EXPORT Array<OneD, Array<OneD, NekDouble> > &UpdateForces();
const MultiRegions::ExpListSharedPtr &field);
protected: protected:
/// Session reader /// Session reader
......
...@@ -153,7 +153,14 @@ void APE::v_InitObject() ...@@ -153,7 +153,14 @@ void APE::v_InitObject()
std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x; std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
for (x = m_forcing.begin(); x != m_forcing.end(); ++x) for (x = m_forcing.begin(); x != m_forcing.end(); ++x)
{ {
(*x)->Smooth(m_bfField); for (int i = 0; i < (*x)->GetForces().num_elements(); ++i)
{
m_bfField->IProductWRTBase((*x)->GetForces()[i], tmpC);
m_bfField->MultiplyByElmtInvMass(tmpC, tmpC);
m_bfField->LocalToGlobal(tmpC, tmpC);
m_bfField->GlobalToLocal(tmpC, tmpC);
m_bfField->BwdTrans(tmpC, (*x)->UpdateForces()[i]);
}
} }
// Do not forwards transform initial condition // Do not forwards transform initial condition
...@@ -331,7 +338,14 @@ bool APE::v_PostIntegrate(int step) ...@@ -331,7 +338,14 @@ bool APE::v_PostIntegrate(int step)
std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x; std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
for (x = m_forcing.begin(); x != m_forcing.end(); ++x) for (x = m_forcing.begin(); x != m_forcing.end(); ++x)
{ {
(*x)->Smooth(m_bfField); for (int i = 0; i < (*x)->GetForces().num_elements(); ++i)
{
m_bfField->IProductWRTBase((*x)->GetForces()[i], tmpC);
m_bfField->MultiplyByElmtInvMass(tmpC, tmpC);
m_bfField->LocalToGlobal(tmpC, tmpC);
m_bfField->GlobalToLocal(tmpC, tmpC);
m_bfField->BwdTrans(tmpC, (*x)->UpdateForces()[i]);
}
} }
for (int i = 0; i < m_spacedim + 2; ++i) for (int i = 0; i < m_spacedim + 2; ++i)
......
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