Commit 737602d0 authored by Spencer Sherwin's avatar Spencer Sherwin

Update to fix average fields when different polynomial spaces are used

parent e9280d9c
......@@ -161,15 +161,14 @@ void FilterFieldConvert::v_Initialise(
{
v_FillVariablesName(pFields);
int ncoeff = pFields[0]->GetNcoeffs();
// m_variables need to be filled by a derived class
m_outFields.resize(m_variables.size());
for (int n = 0; n < m_variables.size(); ++n)
{
m_outFields[n] = Array<OneD, NekDouble>(ncoeff, 0.0);
m_outFields[n] = Array<OneD, NekDouble>(pFields[n]->GetNcoeffs(), 0.0);
}
m_fieldMetaData["InitialTime"] = boost::lexical_cast<std::string>(time);
// Fill some parameters of m_f
......@@ -462,9 +461,10 @@ void FilterFieldConvert::CreateFields(
m_f->m_exp[n] = m_f->AppendExpList(
NumHomogeneousDir, m_variables[0]);
m_f->m_exp[n]->SetWaveSpace(false);
Vmath::Vcopy( m_outFields[n].num_elements(),
m_outFields[n], 1,
m_f->m_exp[n]->UpdateCoeffs(), 1);
m_f->m_exp[n]->ExtractCoeffsToCoeffs(pFields[n], m_outFields[n],
m_f->m_exp[n]->UpdateCoeffs());
m_f->m_exp[n]->BwdTrans( m_f->m_exp[n]->GetCoeffs(),
m_f->m_exp[n]->UpdatePhys());
}
......
......@@ -52,6 +52,7 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES )
ADD_NEKTAR_TEST(ChanFlow_m8)
ADD_NEKTAR_TEST(ChanFlow_m8_BodyForce)
ADD_NEKTAR_TEST(ChanFlow_m8_singular)
ADD_NEKTAR_TEST(ChanFlow_V8P7_Avg)
ADD_NEKTAR_TEST(Channel_Flow_3modes_rad)
ADD_NEKTAR_TEST(Couette_3DH2D_MVM)
ADD_NEKTAR_TEST(Hex_channel_m3)
......
<?xml version="1.0" encoding="utf-8"?>
<test>
<description>Channel Flow Vel P=8 Pre P=7 dumping average field </description>
<executable>IncNavierStokesSolver</executable>
<parameters>ChanFlow_V8P7_Avg.xml</parameters>
<files>
<file description="Session File">ChanFlow_V8P7_Avg.xml</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-12">4.08607e-16</value>
<value variable="v" tolerance="1e-12">1.54276e-16</value>
<value variable="p" tolerance="1e-12">1.1993e-14</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-12">6.43929e-15</value>
<value variable="v" tolerance="1e-12">6.36813e-16</value>
<value variable="p" tolerance="1e-12">4.86278e-14</value>
</metric>
</metrics>
</test>
<?xml version="1.0" encoding="utf-8"?>
<NEKTAR xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nektar.info/nektar.xsd">
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="8" FIELDS="u,v" TYPE="MODIFIED" />
<E COMPOSITE="C[0]" NUMMODES="7" FIELDS="p" TYPE="MODIFIEDQUADPLUS1" />
</EXPANSIONS>
<CONDITIONS>
<SOLVERINFO>
<I PROPERTY="SolverType" VALUE="VelocityCorrectionScheme" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyNavierStokes" />
<I PROPERTY="AdvectionForm" VALUE="Convective" />
<I PROPERTY="Projection" VALUE="Galerkin" />
<I PROPERTY="TimeIntegrationMethod" VALUE="IMEXOrder1" />
</SOLVERINFO>
<PARAMETERS>
<P> TimeStep = 0.001 </P>
<P> NumSteps = 1000 </P>
<P> IO_CheckSteps = 1000 </P>
<P> IO_InfoSteps = 1000 </P>
<P> Kinvis = 1 </P>
</PARAMETERS>
<VARIABLES>
<V ID="0"> u </V>
<V ID="1"> v </V>
<V ID="2"> p </V>
</VARIABLES>
<BOUNDARYREGIONS>
<B ID="0"> C[1] </B>
<B ID="1"> C[2] </B>
<B ID="2"> C[3] </B>
</BOUNDARYREGIONS>
<BOUNDARYCONDITIONS>
<REGION REF="0">
<D VAR="u" VALUE="0" />
<D VAR="v" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" />
</REGION>
<REGION REF="1">
<D VAR="u" VALUE="y*(1-y)" />
<D VAR="v" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" />
</REGION>
<REGION REF="2">
<N VAR="u" VALUE="0" />
<N VAR="v" VALUE="0" />
<D VAR="p" VALUE="0" />
</REGION>
</BOUNDARYCONDITIONS>
<FUNCTION NAME="InitialConditions">
<E VAR="u" VALUE="0" />
<E VAR="v" VALUE="0" />
<E VAR="p" VALUE="0" />
</FUNCTION>
<FUNCTION NAME="ExactSolution">
<E VAR="u" VALUE="y*(1-y)" />
<E VAR="v" VALUE="0" />
<E VAR="p" VALUE="-2*Kinvis*(x-1)" />
</FUNCTION>
</CONDITIONS>
<GEOMETRY DIM="2" SPACE="2">
<VERTEX>
<V ID="0"> 0.0 0.0 0.0 </V>
<V ID="1"> 0.5 0.0 0.0 </V>
<V ID="2"> 1.0 0.0 0.0 </V>
<V ID="3"> 0.0 0.5 0.0 </V>
<V ID="4"> 0.5 0.5 0.0 </V>
<V ID="5"> 1.0 0.5 0.0 </V>
<V ID="6"> 0.0 1.0 0.0 </V>
<V ID="7"> 0.5 1.0 0.0 </V>
<V ID="8"> 1.0 1.0 0.0 </V>
</VERTEX>
<EDGE>
<E ID="0"> 0 1 </E>
<E ID="1"> 1 2 </E>
<E ID="2"> 0 3 </E>
<E ID="3"> 1 4 </E>
<E ID="4"> 2 5 </E>
<E ID="5"> 3 4 </E>
<E ID="6"> 4 5 </E>
<E ID="7"> 3 6 </E>
<E ID="8"> 4 7 </E>
<E ID="9"> 5 8 </E>
<E ID="10"> 6 7 </E>
<E ID="11"> 7 8 </E>
</EDGE>
<ELEMENT>
<Q ID="0"> 0 3 5 2 </Q>
<Q ID="1"> 1 4 6 3 </Q>
<Q ID="2"> 5 8 10 7 </Q>
<Q ID="3"> 6 9 11 8 </Q>
</ELEMENT>
<COMPOSITE>
<C ID="0"> Q[0-3] </C>
<C ID="1"> E[0,1,10,11] </C> <!-- Walls -->
<C ID="2"> E[2,7] </C> <!-- Inflow -->
<C ID="3"> E[4,9] </C> <!-- Outflow -->
</COMPOSITE>
<DOMAIN> C[0] </DOMAIN>
</GEOMETRY>
<FILTERS>
<FILTER TYPE="AverageFields">
<PARAM NAME="OutputFile"> AverageField </PARAM>
<PARAM NAME="OutputFrequency">1000</PARAM>
<PARAM NAME="SampleFrequency"> 10 </PARAM>
</FILTER>
</FILTERS>
</NEKTAR>
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