Commit 28e338f8 authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Updated to hopefully start handling single mode output correctly. Also added...

Updated to hopefully start handling single mode output correctly. Also added ability to use a -z option to specify the number of planes in the z-direction
parent a3b7baaa
This diff is collapsed.
<?xml version="1.0" encoding="utf-8" ?>
<NEKTAR xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.nektar.info/schema/nektar.xsd">
<GEOMETRY DIM="2" SPACE="2">
<VERTEX XSCALE="3.0*PI">
<V ID="0"> 0 -1 0.0 </V>
<V ID="1"> 0.25 -1 0.0 </V>
<V ID="2"> 0.5 -1 0.0 </V>
<V ID="3"> 0.75 -1 0.0 </V>
<V ID="4"> 1 -1 0.0 </V>
<V ID="5"> 0 -0.95 0.0 </V>
<V ID="6"> 0.25 -0.95 0.0 </V>
<V ID="7"> 0.5 -0.95 0.0 </V>
<V ID="8"> 0.75 -0.95 0.0 </V>
<V ID="9"> 1 -0.95 0.0 </V>
<V ID="10"> 0 -0.9 0.0 </V>
<V ID="11"> 0.25 -0.9 0.0 </V>
<V ID="12"> 0.5 -0.9 0.0 </V>
<V ID="13"> 0.75 -0.9 0.0 </V>
<V ID="14"> 1 -0.9 0.0 </V>
<V ID="15"> 0 -0.5 0.0 </V>
<V ID="16"> 0.25 -0.5 0.0 </V>
<V ID="17"> 0.5 -0.5 0.0 </V>
<V ID="18"> 0.75 -0.5 0.0 </V>
<V ID="19"> 1 -0.5 0.0 </V>
<V ID="20"> 0 0 0.0 </V>
<V ID="21"> 0.25 0 0.0 </V>
<V ID="22"> 0.5 0 0.0 </V>
<V ID="23"> 0.75 0 0.0 </V>
<V ID="24"> 1 0 0.0 </V>
<V ID="25"> 0 0.5 0.0 </V>
<V ID="26"> 0.25 0.5 0.0 </V>
<V ID="27"> 0.5 0.5 0.0 </V>
<V ID="28"> 0.75 0.5 0.0 </V>
<V ID="29"> 1 0.5 0.0 </V>
<V ID="30"> 0 0.9 0.0 </V>
<V ID="31"> 0.25 0.9 0.0 </V>
<V ID="32"> 0.5 0.9 0.0 </V>
<V ID="33"> 0.75 0.9 0.0 </V>
<V ID="34"> 1 0.9 0.0 </V>
<V ID="35"> 0 0.95 0.0 </V>
<V ID="36"> 0.25 0.95 0.0 </V>
<V ID="37"> 0.5 0.95 0.0 </V>
<V ID="38"> 0.75 0.95 0.0 </V>
<V ID="39"> 1 0.95 0.0 </V>
<V ID="40"> 0 1 0.0 </V>
<V ID="41"> 0.25 1 0.0 </V>
<V ID="42"> 0.5 1 0.0 </V>
<V ID="43"> 0.75 1 0.0 </V>
<V ID="44"> 1 1 0.0 </V>
</VERTEX>
<EDGE>
<E ID="0"> 0 1 </E>
<E ID="1"> 1 2 </E>
<E ID="2"> 2 3 </E>
<E ID="3"> 3 4 </E>
<E ID="4"> 0 5 </E>
<E ID="5"> 1 6 </E>
<E ID="6"> 2 7 </E>
<E ID="7"> 3 8 </E>
<E ID="8"> 4 9 </E>
<E ID="9"> 5 6 </E>
<E ID="10"> 6 7 </E>
<E ID="11"> 7 8 </E>
<E ID="12"> 8 9 </E>
<E ID="13"> 5 10 </E>
<E ID="14"> 6 11 </E>
<E ID="15"> 7 12 </E>
<E ID="16"> 8 13 </E>
<E ID="17"> 9 14 </E>
<E ID="18"> 10 11 </E>
<E ID="19"> 11 12 </E>
<E ID="20"> 12 13 </E>
<E ID="21"> 13 14 </E>
<E ID="22"> 10 15 </E>
<E ID="23"> 11 16 </E>
<E ID="24"> 12 17 </E>
<E ID="25"> 13 18 </E>
<E ID="26"> 14 19 </E>
<E ID="27"> 15 16 </E>
<E ID="28"> 16 17 </E>
<E ID="29"> 17 18 </E>
<E ID="30"> 18 19 </E>
<E ID="31"> 15 20 </E>
<E ID="32"> 16 21 </E>
<E ID="33"> 17 22 </E>
<E ID="34"> 18 23 </E>
<E ID="35"> 19 24 </E>
<E ID="36"> 20 21 </E>
<E ID="37"> 21 22 </E>
<E ID="38"> 22 23 </E>
<E ID="39"> 23 24 </E>
<E ID="40"> 20 25 </E>
<E ID="41"> 21 26 </E>
<E ID="42"> 22 27 </E>
<E ID="43"> 23 28 </E>
<E ID="44"> 24 29 </E>
<E ID="45"> 25 26 </E>
<E ID="46"> 26 27 </E>
<E ID="47"> 27 28 </E>
<E ID="48"> 28 29 </E>
<E ID="49"> 25 30 </E>
<E ID="50"> 26 31 </E>
<E ID="51"> 27 32 </E>
<E ID="52"> 28 33 </E>
<E ID="53"> 29 34 </E>
<E ID="54"> 30 31 </E>
<E ID="55"> 31 32 </E>
<E ID="56"> 32 33 </E>
<E ID="57"> 33 34 </E>
<E ID="58"> 30 35 </E>
<E ID="59"> 31 36 </E>
<E ID="60"> 32 37 </E>
<E ID="61"> 33 38 </E>
<E ID="62"> 34 39 </E>
<E ID="63"> 35 36 </E>
<E ID="64"> 36 37 </E>
<E ID="65"> 37 38 </E>
<E ID="66"> 38 39 </E>
<E ID="67"> 35 40 </E>
<E ID="68"> 36 41 </E>
<E ID="69"> 37 42 </E>
<E ID="70"> 38 43 </E>
<E ID="71"> 39 44 </E>
<E ID="72"> 40 41 </E>
<E ID="73"> 41 42 </E>
<E ID="74"> 42 43 </E>
<E ID="75"> 43 44 </E>
</EDGE>
<ELEMENT>
<Q ID="0"> 0 5 9 4 </Q>
<Q ID="1"> 1 6 10 5 </Q>
<Q ID="2"> 2 7 11 6 </Q>
<Q ID="3"> 3 8 12 7 </Q>
<Q ID="4"> 9 14 18 13 </Q>
<Q ID="5"> 10 15 19 14 </Q>
<Q ID="6"> 11 16 20 15 </Q>
<Q ID="7"> 12 17 21 16 </Q>
<Q ID="8"> 18 23 27 22 </Q>
<Q ID="9"> 19 24 28 23 </Q>
<Q ID="10"> 20 25 29 24 </Q>
<Q ID="11"> 21 26 30 25 </Q>
<Q ID="12"> 27 32 36 31 </Q>
<Q ID="13"> 28 33 37 32 </Q>
<Q ID="14"> 29 34 38 33 </Q>
<Q ID="15"> 30 35 39 34 </Q>
<Q ID="16"> 36 41 45 40 </Q>
<Q ID="17"> 37 42 46 41 </Q>
<Q ID="18"> 38 43 47 42 </Q>
<Q ID="19"> 39 44 48 43 </Q>
<Q ID="20"> 45 50 54 49 </Q>
<Q ID="21"> 46 51 55 50 </Q>
<Q ID="22"> 47 52 56 51 </Q>
<Q ID="23"> 48 53 57 52 </Q>
<Q ID="24"> 54 59 63 58 </Q>
<Q ID="25"> 55 60 64 59 </Q>
<Q ID="26"> 56 61 65 60 </Q>
<Q ID="27"> 57 62 66 61 </Q>
<Q ID="28"> 63 68 72 67 </Q>
<Q ID="29"> 64 69 73 68 </Q>
<Q ID="30"> 65 70 74 69 </Q>
<Q ID="31"> 66 71 75 70 </Q>
</ELEMENT>
<COMPOSITE>
<C ID="0"> Q[0-31] </C>
<C ID="1"> E[0,1,2,3] </C> // south border
<C ID="2"> E[4,13,22,31,40,49,58,67] </C> // west border
<C ID="3"> E[72,73,74,75] </C> // north border
<C ID="4"> E[8,17,26,35,44,53,62,71] </C> // East border
</COMPOSITE>
<DOMAIN> C[0] </DOMAIN>
</GEOMETRY>
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="11" FIELDS="u,v,w,p" TYPE="MODIFIED" />
</EXPANSIONS>
<CONDITIONS>
<SOLVERINFO>
<I PROPERTY="SolverType" VALUE="VelocityCorrectionScheme" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyNavierStokes" />
<I PROPERTY="EvolutionOperator" VALUE="Direct" />
<I PROPERTY="HOMOGENEOUS" VALUE="1D"/>
<I PROPERTY="ModeType" VALUE="HalfMode"/>
<I PROPERTY="Projection" VALUE="Galerkin" />
<I PROPERTY="TimeIntegrationMethod" VALUE="IMEXOrder2" />
<I PROPERTY="Driver" VALUE="ModifiedArnoldi" />
<I PROPERTY="InitialVector" VALUE="File" />
</SOLVERINFO>
<PARAMETERS>
<P> TimeStep = 0.001 </P>
<P> NumSteps = 1000 </P>
<P> IO_CheckSteps = 1000 </P>
<P> IO_InfoSteps = 20 </P>
<P> Re = 15000 </P>
<P> Kinvis = 1.0/Re </P>
<P> kdim = 16 </P>
<P> HomModesZ = 2 </P>
<P> evtol = 1e-5 </P>
<P> nvec = 4 </P>
<P> nits = 5000 </P>
<P> LZ = 6*PI/sqrt(5) </P>
</PARAMETERS>
<VARIABLES>
<V ID="0"> u </V>
<V ID="1"> v </V>
<V ID="2"> w </V>
<V ID="3"> p </V>
</VARIABLES>
<BOUNDARYREGIONS>
<B ID="0"> C[1] </B>
<B ID="1"> C[2] </B>
<B ID="2"> C[3] </B>
<B ID="3"> C[4] </B>
</BOUNDARYREGIONS>
<BOUNDARYCONDITIONS>
<REGION REF="0">
<D VAR="u" VALUE="0" />
<D VAR="v" VALUE="0" />
<D VAR="w" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" />
</REGION>
<REGION REF="1">
<P VAR="u" VALUE="[3]" />
<P VAR="v" VALUE="[3]" />
<P VAR="w" VALUE="[3]" />
<P VAR="p" VALUE="[3]" />
</REGION>
<REGION REF="2">
<D VAR="u" VALUE="0" />
<D VAR="v" VALUE="0" />
<D VAR="w" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" />
</REGION>
<REGION REF="3">
<P VAR="u" VALUE="[1]" />
<P VAR="v" VALUE="[1]" />
<P VAR="w" VALUE="[1]" />
<P VAR="p" VALUE="[1]" />
</REGION>
</BOUNDARYCONDITIONS>
<FUNCTION NAME="BaseFlow">
<E VAR="u" VALUE="1-y*y" />
<E VAR="v" VALUE="0" />
<E VAR="w" VALUE="0" />
<E VAR="p" VALUE="0" />
</FUNCTION>
<FUNCTION NAME="InitialConditions">
<F VAR="u,v,w,p" FILE="PPF_R15000_3D_VCS.rst" />
</FUNCTION>
</CONDITIONS>
</NEKTAR>
......@@ -111,7 +111,8 @@ struct Field {
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap;
MultiRegions::ExpListSharedPtr SetUpFirstExpList(int NumHomogeneousDir,
bool fldfilegiven = false)
bool fldfilegiven = false,
int zplanes = -1)
{
MultiRegions::ExpListSharedPtr exp;
......@@ -141,22 +142,36 @@ struct Field {
if(fldfilegiven)
{
nplanes = m_fielddef[0]->m_numModes[1];
if(zplanes == -1)
{
nplanes = m_fielddef[0]->m_numModes[1];
}
else
{
nplanes = zplanes;
}
ly = m_fielddef[0]->m_homogeneousLengths[0];
btype = m_fielddef[0]->m_basis[1];
}
else
{
m_session->LoadParameter("HomModesZ", nplanes);
if(zplanes == -1)
{
m_session->LoadParameter("HomModesZ", nplanes);
}
else
{
nplanes = zplanes;
}
m_session->LoadParameter("LY",ly);
btype = LibUtilities::eFourier;
}
// Choose points to be at evenly spaced points at
// nplanes points
// nplanes +1 points
const LibUtilities::PointsKey
Pkey(nplanes, LibUtilities::ePolyEvenlySpaced);
Pkey(nplanes+1, LibUtilities::ePolyEvenlySpaced);
const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
......@@ -281,24 +296,52 @@ struct Field {
int nplanes;
NekDouble lz;
LibUtilities::BasisType btype;
if(fldfilegiven)
{
nplanes = m_fielddef[0]->m_numModes[2];
if(zplanes == -1)
{
nplanes = m_fielddef[0]->m_numModes[2];
}
else
{
nplanes = zplanes;
}
lz = m_fielddef[0]->m_homogeneousLengths[0];
btype = m_fielddef[0]->m_basis[2];
// redefined single mode to be Fourier modes
// so visualisation makes sense
if(btype == LibUtilities::eFourierSingleMode)
{
btype = LibUtilities::eFourier;
m_fielddef[0]->m_basis[2] = LibUtilities::eFourierSingleMode;
if(nplanes <= 2)
{
nplanes = 4;
WARNINGL0(false,"Redefining HomModesZ to 4 "
"so that First Fourier mode is visible");
}
}
}
else
{
m_session->LoadParameter("HomModesZ", nplanes);
if(zplanes == -1)
{
m_session->LoadParameter("HomModesZ", nplanes);
}
else
{
nplanes = zplanes;
}
m_session->LoadParameter("LZ",lz);
btype = LibUtilities::eFourier;
}
// Choose points to be at evenly spaced points at
// nplanes points
// nplanes +1 points
const LibUtilities::PointsKey
Pkey(nplanes, LibUtilities::ePolyEvenlySpaced);
Pkey(nplanes+1, LibUtilities::ePolyEvenlySpaced);
const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
......
......@@ -75,7 +75,9 @@ int main(int argc, char* argv[])
("useSessionVariables",
"Use variables defined in session for output")
("verbose,v",
"Enable verbose mode.");
"Enable verbose mode.")
("zplanes,z", po::value<int>(),
"use specified number of z planes in Homogeneous direction.");
po::options_description hidden("Hidden options");
hidden.add_options()
......
......@@ -290,8 +290,16 @@ void InputXml::Process(po::variables_map &vm)
m_f->m_graph->SetExpansionsToEvenlySpacedPoints(nPointsNew);
}
int zplanes = -1;
m_f->m_exp[0] = m_f->SetUpFirstExpList(NumHomogeneousDir,fldfilegiven);
if(vm.count("zplanes"))
{
zplanes = vm["zplanes"].as<int>();
}
m_f->m_exp[0] = m_f->SetUpFirstExpList(NumHomogeneousDir,fldfilegiven,zplanes);
}
}
......
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