55 #include <boost/format.hpp>
56 # include <boost/function.hpp>
86 Loki::ClassLevelLockable> Type;
87 return Type::Instance();
97 : m_comm (pSession->GetComm()),
103 const vector<std::string> filenames =
m_session->GetFilenames();
105 for(
int i = 0; i < filenames.size(); ++i)
107 string sessionname =
"SessionName";
108 sessionname += boost::lexical_cast<std::string>(i);
146 if (
m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
148 std::string HomoStr =
m_session->GetSolverInfo(
"HOMOGENEOUS");
151 if ((HomoStr ==
"HOMOGENEOUS1D") || (HomoStr ==
"Homogeneous1D")
152 || (HomoStr ==
"1D") || (HomoStr ==
"Homo1D"))
158 if(
m_session->DefinesSolverInfo(
"ModeType"))
160 m_session->MatchSolverInfo(
"ModeType",
"SingleMode",
162 m_session->MatchSolverInfo(
"ModeType",
"HalfMode",
164 m_session->MatchSolverInfo(
"ModeType",
"MultipleModes",
169 if (
m_session->DefinesSolverInfo(
"ModeType"))
185 ASSERTL0(
false,
"SolverInfo ModeType not valid");
194 if ((HomoStr ==
"HOMOGENEOUS2D") || (HomoStr ==
"Homogeneous2D")
195 || (HomoStr ==
"2D") || (HomoStr ==
"Homo2D"))
205 if ((HomoStr ==
"HOMOGENEOUS3D") || (HomoStr ==
"Homogeneous3D")
206 || (HomoStr ==
"3D") || (HomoStr ==
"Homo3D"))
218 m_session->MatchSolverInfo(
"DEALIASING",
"True",
222 m_session->MatchSolverInfo(
"DEALIASING",
"On",
233 m_session->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"True",
237 m_session->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"On",
243 if (
m_session->DefinesSolverInfo(
"PROJECTION"))
245 std::string ProjectStr =
m_session->GetSolverInfo(
"PROJECTION");
247 if ((ProjectStr ==
"Continuous") || (ProjectStr ==
"Galerkin") ||
248 (ProjectStr ==
"CONTINUOUS") || (ProjectStr ==
"GALERKIN"))
252 else if ((ProjectStr ==
"MixedCGDG") ||
253 (ProjectStr ==
"Mixed_CG_Discontinuous"))
257 else if(ProjectStr ==
"DisContinuous")
263 ASSERTL0(
false,
"PROJECTION value not recognised");
268 cerr <<
"Projection type not specified in SOLVERINFO,"
269 "defaulting to continuous Galerkin" << endl;
277 int nvariables =
m_session->GetVariables().size();
278 bool DeclareCoeffPhysArrays =
true;
283 m_expdim = m_graph->GetMeshDimension();
305 for (i = 0; i <
m_fields.num_elements(); i++)
318 for (i = 0; i <
m_fields.num_elements(); i++)
345 for(i = 0; i <
m_fields.num_elements(); i++)
373 for (i = 0; i <
m_fields.num_elements(); i++)
375 if(
m_session->GetVariable(i).compare(
"w")
412 for (i = 0; i <
m_fields.num_elements(); i++)
433 DeclareCoeffPhysArrays,
436 for (i = 1; i < m_fields.num_elements(); i++)
439 SameExpansions(
m_session->GetVariable(0),
444 *firstfield, m_graph,
446 DeclareCoeffPhysArrays,
455 DeclareCoeffPhysArrays,
474 m_fields[0]->GetTrace()->
492 for (i = 1; i < m_fields.num_elements(); i++)
494 if(m_graph->SameExpansions(
500 *firstfield, m_graph,
529 for(i = 1; i < m_fields.num_elements(); ++i)
531 m_fields[i]->GetTrace();
537 ASSERTL0(
false,
"Expansion dimension not recognised");
560 for (i = 0; i <
m_fields.num_elements(); i++)
573 for (i = 0; i <
m_fields.num_elements(); i++)
593 for (i = 0; i <
m_fields.num_elements(); i++)
605 for (i = 0; i <
m_fields.num_elements(); i++)
621 "3D fully periodic problems not implemented yet");
625 for (i = 0; i <
m_fields.num_elements(); i++)
636 ASSERTL0(
false,
"Expansion dimension not recognised");
660 m_session->LoadParameter(
"NumQuadPointsError",
686 std::string pFunctionName,
691 "Function '" + pFunctionName +
"' does not exist.");
693 std::vector<std::string> vFieldNames =
m_session->GetVariables();
695 for(
int i = 0 ; i < vFieldNames.size(); i++)
708 std::vector<std::string> pFieldNames,
710 const std::string& pFunctionName,
713 ASSERTL1(pFieldNames.size() == pFields.num_elements(),
714 "Function '" + pFunctionName
715 +
"' variable list size mismatch with array storage.");
717 "Function '" + pFunctionName +
"' does not exist.");
719 for(
int i = 0; i < pFieldNames.size(); i++)
731 std::vector<std::string> pFieldNames,
733 const std::string& pFunctionName,
737 "Function '" + pFunctionName +
"' does not exist.");
738 ASSERTL0(pFieldNames.size() == pFields.num_elements(),
739 "Field list / name list size mismatch.");
741 for(
int i = 0; i < pFieldNames.size(); i++)
744 pFunctionName, 0.0, domain);
745 pFields[i]->FwdTrans_IterPerExp(pFields[i]->GetPhys(),
746 pFields[i]->UpdateCoeffs());
753 std::string pFieldName,
755 const std::string& pFunctionName,
760 "Function '" + pFunctionName +
"' does not exist.");
762 unsigned int nq =
m_fields[0]->GetNpoints();
763 if (pArray.num_elements() < nq)
769 vType =
m_session->GetFunctionType(pFunctionName, pFieldName,domain);
780 =
m_session->GetFunction(pFunctionName, pFieldName,domain);
782 ffunc->Evaluate(x0,x1,x2,pTime,pArray);
787 std::string filename =
m_session->GetFunctionFilename(
788 pFunctionName, pFieldName, domain);
789 std::string fileVar =
m_session->GetFunctionFilenameVariable(
790 pFunctionName, pFieldName, domain);
792 if (fileVar.length() == 0)
794 fileVar = pFieldName;
797 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
798 std::vector<std::vector<NekDouble> > FieldData;
802 int numexp =
m_fields[0]->GetExpSize();
806 for(
int i = 0; i < numexp; ++i)
808 ElementGIDs[i] =
m_fields[0]->GetExp(i)->GetGeom()->GetGlobalID();
820 unsigned int old_exponent_format;
821 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
822 filename = boost::str(boost::format(filename) %
m_time);
823 _set_output_format(old_exponent_format);
825 filename = boost::str(boost::format(filename) % m_time);
830 ASSERTL0(
false,
"Invalid Filename in function \""
831 + pFunctionName +
"\", variable \"" + fileVar +
"\"")
835 if (boost::filesystem::path(filename).extension() !=
".pts")
837 m_fld->Import(filename, FieldDef, FieldData,
844 for (
int i = 0; i < FieldDef.size(); ++i)
848 for (
int j = 0; j < FieldDef[i]->m_fields.size(); ++j)
850 if (FieldDef[i]->
m_fields[j] == fileVar)
859 FieldDef[i], FieldData[i],
860 FieldDef[i]->
m_fields[idx], vCoeffs);
864 cout <<
"Field " + fileVar +
" not found." << endl;
868 m_fields[0]->BwdTrans_IterPerExp(vCoeffs, pArray);
880 m_fields[0]->GetCoords(coords[0], coords[1], coords[2]);
883 std::string weightsKey =
m_session->GetFunctionFilename(pFunctionName, pFieldName, domain);
884 map<std::string, Array<OneD, Array<OneD, float> > >
::iterator it
893 if (
m_session->GetComm()->GetRank() == 0)
896 cout <<
"Interpolating: ";
898 ptsField->CalcWeights(coords);
899 if (
m_session->GetComm()->GetRank() == 0)
907 ptsField->Interpolate(intFields);
910 vector<string> fieldNames = ptsField->GetFieldNames();
911 for (fieldInd = 0; fieldInd < fieldNames.size(); ++fieldInd)
913 if (ptsField->GetFieldName(fieldInd) == pFieldName)
918 ASSERTL0(fieldInd != fieldNames.size(),
"field not found");
920 pArray = intFields[fieldInd];
933 std::string pFieldName,
934 const std::string &pFunctionName,
938 "Function '" + pFunctionName +
"' does not exist.");
943 vType =
m_session->GetFunctionType(pFunctionName, pFieldName);
947 =
m_session->GetFunction(pFunctionName, pFieldName,domain);
948 retVal = ffunc->GetExpression();
953 =
m_session->GetFunctionFilename(pFunctionName, pFieldName,domain);
954 retVal =
"from file " + filename;
968 int nvariables =
m_fields.num_elements();
969 for (
int i = 0; i < nvariables; ++i)
972 m_fields[i]->EvaluateBoundaryConditions(time, varName);
992 if (
m_fields[field]->GetPhysState() ==
false)
998 if (exactsoln.num_elements())
1002 else if (
m_session->DefinesFunction(
"ExactSolution"))
1008 "ExactSolution",
m_time);
1017 if (Normalised ==
true)
1025 L2error = sqrt(L2error*L2error/Vol);
1051 if (
m_fields[field]->GetPhysState() ==
false)
1057 if (exactsoln.num_elements())
1061 else if (
m_session->DefinesFunction(
"ExactSolution"))
1067 "ExactSolution",
m_time);
1080 Linferror = L2INF[1];
1119 int ErrorCoordim = ErrorExp->GetCoordim(0);
1120 int ErrorNq = ErrorExp->GetTotPoints();
1126 switch(ErrorCoordim)
1129 ErrorExp->GetCoords(ErrorXc0);
1132 ErrorExp->GetCoords(ErrorXc0, ErrorXc1);
1135 ErrorExp->GetCoords(ErrorXc0, ErrorXc1, ErrorXc2);
1139 m_session->GetFunction(
"ExactSolution", field);
1144 exSol->Evaluate(ErrorXc0,ErrorXc1,ErrorXc2,
m_time,ErrorSol);
1148 ErrorExp->BwdTrans_IterPerExp(
m_fields[field]->GetCoeffs(),
1149 ErrorExp->UpdatePhys());
1151 L2INF[0] = ErrorExp->L2 (ErrorExp->GetPhys(), ErrorSol);
1152 L2INF[1] = ErrorExp->Linf(ErrorExp->GetPhys(), ErrorSol);
1165 bool dumpInitialConditions,
1168 if (
m_session->GetComm()->GetRank() == 0)
1170 cout <<
"Initial Conditions:" << endl;
1173 if (
m_session->DefinesFunction(
"InitialConditions"))
1176 "InitialConditions",domain);
1178 if (
m_session->GetComm()->GetRank() == 0)
1181 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1183 std::string varName =
m_session->GetVariable(i);
1184 cout <<
" - Field " << varName <<
": "
1192 int nq =
m_fields[0]->GetNpoints();
1193 for (
int i = 0; i <
m_fields.num_elements(); i++)
1199 if (
m_session->GetComm()->GetRank() == 0)
1201 cout <<
" - Field " <<
m_session->GetVariable(i)
1202 <<
": 0 (default)" << endl;
1221 "ExactSolution array size mismatch.");
1222 Vmath::Zero(outfield.num_elements(), outfield, 1);
1223 if (
m_session->DefinesFunction(
"ExactSolution"))
1226 "ExactSolution", time);
1244 std::vector<std::string> vel;
1245 vel.push_back(
"Vx");
1246 vel.push_back(
"Vy");
1247 vel.push_back(
"Vz");
1260 int nvariables =
m_session->GetVariables().size();
1269 for(i = 0; i <
m_base.num_elements(); i++)
1289 for (i = 0 ; i <
m_base.num_elements(); i++)
1293 ::AllocateSharedPtr(
1298 m_base[i]->SetWaveSpace(
true);
1310 for (i = 0 ; i <
m_base.num_elements(); i++)
1314 ::AllocateSharedPtr(
1319 m_base[i]->SetWaveSpace(
true);
1330 for (i = 0 ; i <
m_base.num_elements(); i++)
1334 ::AllocateSharedPtr(
1339 m_base[i]->SetWaveSpace(
false);
1352 for (i = 1 ; i < m_base.num_elements(); i++)
1369 for (i = 1 ; i < m_base.num_elements(); i++)
1378 ASSERTL0(
false,
"Expansion dimension not recognised");
1390 for(i = 0 ; i <
m_base.num_elements(); i++)
1401 for(i = 0 ; i <
m_base.num_elements(); i++)
1413 ASSERTL0(
false,
"Expansion dimension not recognised");
1421 std::string pInfile,
1424 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1425 std::vector<std::vector<NekDouble> > FieldData;
1428 m_fld->Import(pInfile,FieldDef,FieldData);
1430 int nvar =
m_session->GetVariables().size();
1431 if (
m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
1433 std::string HomoStr =
m_session->GetSolverInfo(
"HOMOGENEOUS");
1436 for (
int j = 0; j < nvar; ++j)
1438 for(
int i = 0; i < FieldDef.size(); ++i)
1440 bool flag = FieldDef[i]->m_fields[j] ==
1442 ASSERTL0(flag, (std::string(
"Order of ") + pInfile
1443 + std::string(
" data and that defined in "
1444 "the session differs")).c_str());
1446 m_base[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
1448 m_base[j]->UpdateCoeffs());
1509 for (
int i = 0; i <
m_fields.num_elements(); i++)
1521 for (
int i = 0; i <
m_fields.num_elements(); i++)
1544 int ndim = F.num_elements();
1545 int nCoeffs =
m_fields[0]->GetNcoeffs();
1550 for (
int i = 0; i < ndim; ++i)
1552 m_fields[0]->IProductWRTDerivBase(i, F[i], iprod);
1553 Vmath::Vadd(nCoeffs, iprod, 1, outarray, 1, outarray, 1);
1568 int ndim = F.num_elements();
1569 int nPointsTot =
m_fields[0]->GetNpoints();
1574 for (
int i = 0; i < ndim; ++i)
1581 m_fields[0]->IProductWRTBase(div, outarray);
1598 int ndim = V.num_elements();
1600 int nPointsTot =
m_fields[0]->GetNpoints();
1608 m_fields[0]->IProductWRTBase(tmp, outarray,
1613 m_fields[0]->IProductWRTBase_IterPerExp(tmp, outarray);
1631 int ndim = V.num_elements();
1636 int nPointsTot =
m_fields[0]->GetNpoints();
1640 if (wk.num_elements())
1654 Vmath::Vmul(nPointsTot, grad0, 1, V[0], 1, outarray,1);
1658 m_fields[0]->PhysDeriv(u, grad0, grad1);
1659 Vmath::Vmul (nPointsTot, grad0, 1, V[0], 1, outarray, 1);
1661 outarray, 1, outarray, 1);
1666 m_fields[0]->PhysDeriv(u,grad0,grad1,grad2);
1667 Vmath::Vmul (nPointsTot, grad0, 1, V[0], 1, outarray, 1);
1669 outarray, 1, outarray, 1);
1671 outarray, 1, outarray, 1);
1674 ASSERTL0(
false,
"dimension unknown");
1691 bool NumericalFluxIncludesNormal,
1692 bool InFieldIsInPhysSpace,
1703 nvariables =
m_fields.num_elements();
1709 for(i = 0; i < nVelDim; ++i)
1716 if (InFieldIsInPhysSpace ==
true)
1718 for (i = 0; i < nvariables; ++i)
1720 physfield[i] = InField[i];
1726 for(i = 0; i < nvariables; ++i)
1730 m_fields[i]->BwdTrans(InField[i],physfield[i]);
1735 for (i = 0; i < nvariables; ++i)
1747 if (NumericalFluxIncludesNormal ==
true)
1751 for (i = 0; i < nvariables; ++i)
1761 for (i = 0; i < nvariables; ++i)
1764 m_fields[i]->AddTraceIntegral(numflux[i],OutField[i]);
1775 for (i = 0; i < nvariables; ++i)
1786 for(i = 0; i < nvariables; ++i)
1789 m_fields[i]->AddTraceIntegral(numfluxX[i], numfluxY[i],
1805 bool NumericalFluxIncludesNormal,
1806 bool InFieldIsInPhysSpace)
1812 int nvariables =
m_fields.num_elements();
1824 for (j = 0; j < nqvar; ++j)
1829 for (i = 0; i< nvariables; ++i)
1843 if (InFieldIsInPhysSpace ==
true)
1845 for (i = 0; i < nvariables; ++i)
1847 ufield[i] = InField[i];
1853 for (i = 0; i < nvariables; ++i)
1857 m_fields[i]->BwdTrans(InField[i],ufield[i]);
1867 for (j = 0; j < nqvar; ++j)
1869 for (i = 0; i < nvariables; ++i)
1879 ufield[i], 1, fluxvector[k], 1);
1891 m_fields[i]->AddTraceIntegral(flux[j][i], qcoeffs);
1906 m_fields[i]->MultiplyByElmtInvMass(qcoeffs, qcoeffs);
1909 m_fields[i]->BwdTrans(qcoeffs, qfield[j][i]);
1921 for (i = 0; i < nvariables; ++i)
1929 for (j = 0; j < nqvar; ++j)
1934 qfield[j][i], 1, fluxvector[k], 1);
1955 m_fields[i]->AddTraceIntegral(flux[0][i], OutField[i]);
1967 boost::lexical_cast<std::string>(n);
1980 std::vector<std::string> &variables)
1982 char chkout[16] =
"";
1983 sprintf(chkout,
"%d", n);
1984 std::string outname =
m_sessionName +
"_" + chkout +
".chk";
1985 WriteFld(outname, field, fieldcoeffs, variables);
1995 boost::lexical_cast<std::string>(n);
2006 std::vector<Array<OneD, NekDouble> > fieldcoeffs(
2008 std::vector<std::string> variables(
m_fields.num_elements());
2010 for (
int i = 0; i <
m_fields.num_elements(); ++i)
2014 fieldcoeffs[i] =
m_fields[i]->UpdateCoeffs();
2042 const std::string &outname,
2045 std::vector<std::string> &variables)
2047 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
2048 = field->GetFieldDefinitions();
2049 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
2052 for(
int j = 0; j < fieldcoeffs.size(); ++j)
2054 for(
int i = 0; i < FieldDef.size(); ++i)
2057 FieldDef[i]->m_fields.push_back(variables[j]);
2058 field->AppendFieldData(FieldDef[i], FieldData[i],
2080 const std::string &infile,
2083 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2084 std::vector<std::vector<NekDouble> > FieldData;
2086 m_fld->Import(infile,FieldDef,FieldData);
2089 for(
int j = 0; j < pFields.num_elements(); ++j)
2092 pFields[j]->UpdateCoeffs(),1);
2094 for(
int i = 0; i < FieldDef.size(); ++i)
2098 std::string(
"Order of ") + infile
2099 + std::string(
" data and that defined in "
2100 "m_boundaryconditions differs"));
2102 pFields[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
2104 pFields[j]->UpdateCoeffs());
2106 pFields[j]->BwdTrans(pFields[j]->GetCoeffs(),
2107 pFields[j]->UpdatePhys());
2121 const std::string &infile,
2125 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2126 std::vector<std::vector<NekDouble> > FieldData;
2132 ASSERTL0(ndomains*nvariables == pFields.num_elements(),
"Number of fields does not match the number of variables and domains");
2135 for(
int j = 0; j < ndomains; ++j)
2137 for(
int i = 0; i < nvariables; ++i)
2141 for(
int n = 0; n < FieldDef.size(); ++n)
2144 std::string(
"Order of ") + infile
2145 + std::string(
" data and that defined in "
2146 "m_boundaryconditions differs"));
2148 pFields[j*nvariables+i]->ExtractDataToCoeffs(FieldDef[n], FieldData[n],
2150 pFields[j*nvariables+i]->UpdateCoeffs());
2152 pFields[j*nvariables+i]->BwdTrans(pFields[j*nvariables+i]->GetCoeffs(),
2153 pFields[j*nvariables+i]->UpdatePhys());
2164 const std::string &infile,
2166 std::string &pFieldName)
2168 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2169 std::vector<std::vector<NekDouble> > FieldData;
2171 m_fld->Import(infile,FieldDef,FieldData);
2174 Vmath::Zero(pField->GetNcoeffs(),pField->UpdateCoeffs(),1);
2176 for(
int i = 0; i < FieldDef.size(); ++i)
2179 for(
int j = 0; j < FieldData.size(); ++j)
2181 if (FieldDef[i]->
m_fields[j] == pFieldName)
2186 ASSERTL1(idx >= 0,
"Field " + pFieldName +
" not found.");
2188 pField->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
2190 pField->UpdateCoeffs());
2192 pField->BwdTrans(pField->GetCoeffs(), pField->UpdatePhys());
2203 const std::string &infile,
2204 std::vector< std::string> &fieldStr,
2208 ASSERTL0(fieldStr.size() <= coeffs.num_elements(),
2209 "length of fieldstr should be the same as pFields");
2211 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2212 std::vector<std::vector<NekDouble> > FieldData;
2214 m_fld->Import(infile,FieldDef,FieldData);
2217 for(
int j = 0; j < fieldStr.size(); ++j)
2219 Vmath::Zero(coeffs[j].num_elements(),coeffs[j],1);
2220 for(
int i = 0; i < FieldDef.size(); ++i)
2222 m_fields[0]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
2223 fieldStr[j], coeffs[j]);
2246 ? boost::lexical_cast<string>(
m_NumMode) :
"ALL");
2263 if (
m_session->DefinesSolverInfo(
"UpwindType"))
2266 m_session->GetSolverInfo(
"UpwindType"));
2269 if (
m_session->DefinesSolverInfo(
"AdvectionType"))
2271 std::string AdvectionType;
2272 AdvectionType =
m_session->GetSolverInfo(
"AdvectionType");
2274 GetClassDescription(AdvectionType));
2288 "Mixed Continuous Galerkin and Discontinuous");
2291 if (
m_session->DefinesSolverInfo(
"DiffusionType"))
2293 std::string DiffusionType;
2294 DiffusionType =
m_session->GetSolverInfo(
"DiffusionType");
2296 GetClassDescription(DiffusionType));
2313 string::const_iterator it1=s1.begin();
2314 string::const_iterator it2=s2.begin();
2317 while ( (it1!=s1.end()) && (it2!=s2.end()) )
2319 if(::toupper(*it1) != ::toupper(*it2))
2322 return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1;
2330 size_t size1=s1.size();
2331 size_t size2=s2.size();
2339 return (size1 < size2) ? -1 : 1;
2352 ASSERTL0(
false,
"v_GetFluxVector: This function is not valid "
2353 "for the Base class");
2357 const int i,
const int j,
2361 ASSERTL0(
false,
"v_GetqFluxVector: This function is not valid "
2362 "for the Base class");
2371 ASSERTL0(
false,
"v_GetFluxVector: This function is not valid "
2372 "for the Base class");
2379 ASSERTL0(
false,
"v_NumericalFlux: This function is not valid "
2380 "for the Base class");
2388 ASSERTL0(
false,
"v_NumericalFlux: This function is not valid "
2389 "for the Base class");
2396 ASSERTL0(
false,
"v_NumFluxforScalar: This function is not valid "
2397 "for the Base class");
2405 ASSERTL0(
false,
"v_NumFluxforVector: This function is not valid "
2406 "for the Base class");
2411 ASSERTL0(
false,
"This function is not valid for the Base class");
2418 std::vector<std::string> &variables)
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &l)
Virtual function for generating summary information.
bool m_singleMode
Flag to determine if single homogeneous mode is used.
SOLVER_UTILS_EXPORT void NumFluxforScalar(const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &uflux)
f SOLVER_UTILS_EXPORT void AdvectionNonConservativeForm(const Array< OneD, Array< OneD, NekDouble > > &V, const Array< OneD, const NekDouble > &u, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wk=NullNekDouble1DArray)
Compute the non-conservative advection.
#define ASSERTL0(condition, msg)
SOLVER_UTILS_EXPORT void InitialiseBaseFlow(Array< OneD, Array< OneD, NekDouble > > &base)
Perform initialisation of the base flow.
LibUtilities::NekFactory< std::string, EquationSystem, const LibUtilities::SessionReaderSharedPtr & > EquationSystemFactory
Datatype of the NekFactory used to instantiate classes derived from the EquationSystem class...
SOLVER_UTILS_EXPORT std::string DescribeFunction(std::string pFieldName, const std::string &pFunctionName, const int domain)
Provide a description of a function for a given field name.
static boost::shared_ptr< MeshGraph > Read(const LibUtilities::SessionReaderSharedPtr &pSession, DomainRangeShPtr &rng=NullDomainRangeShPtr)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekDouble m_time
Current time of simulation.
SOLVER_UTILS_EXPORT void WeakAdvectionNonConservativeForm(const Array< OneD, Array< OneD, NekDouble > > &V, const Array< OneD, const NekDouble > &u, Array< OneD, NekDouble > &outarray, bool UseContCoeffs=false)
Compute the inner product .
NekDouble m_timestep
Time step size.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::vector< std::pair< std::string, std::string > > SummaryList
SOLVER_UTILS_EXPORT int GetNvariables()
bool m_halfMode
Flag to determine if half homogeneous mode is used.
NekDouble m_LhomZ
physical length in Z direction (if homogeneous)
virtual SOLVER_UTILS_EXPORT NekDouble v_L2Error(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
Virtual function for the L_2 error computation between fields and a given exact solution.
Array< OneD, bool > m_checkIfSystemSingular
Flag to indicate if the fields should be checked for singularity.
int m_expdim
Expansion dimension.
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
DiffusionFactory & GetDiffusionFactory()
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
Principle Modified Functions .
map< std::string, Array< OneD, Array< OneD, unsigned int > > > m_interpInds
Map of the interpolation indices for a specific filename.
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > ErrorExtraPoints(unsigned int field)
Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf].
SOLVER_UTILS_EXPORT void WeakAdvectionGreensDivergenceForm(const Array< OneD, Array< OneD, NekDouble > > &F, Array< OneD, NekDouble > &outarray)
Compute the inner product .
NekDouble m_checktime
Time between checkpoints.
bool m_useFFT
Flag to determine if FFT is used for homogeneous transform.
NekDouble m_LhomY
physical length in Y direction (if homogeneous)
boost::shared_ptr< ContField2D > ContField2DSharedPtr
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
SOLVER_UTILS_EXPORT int GetNumExpModes()
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
SOLVER_UTILS_EXPORT void PrintProgressbar(const int position, const int goal) const
virtual SOLVER_UTILS_EXPORT NekDouble v_LinfError(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
Virtual function for the L_inf error computation between fields and a given exact solution...
int m_npointsZ
number of points in Z direction (if homogeneous)
virtual SOLVER_UTILS_EXPORT ~EquationSystem()
Destructor.
std::string m_sessionName
Name of the session.
int m_NumMode
Mode to use in case of single mode analysis.
SOLVER_UTILS_EXPORT void WeakAdvectionDivergenceForm(const Array< OneD, Array< OneD, NekDouble > > &F, Array< OneD, NekDouble > &outarray)
Compute the inner product .
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
int m_checksteps
Number of steps between checkpoints.
boost::shared_ptr< PtsField > PtsFieldSharedPtr
LibUtilities::CommSharedPtr m_comm
Communicator.
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
Gauss Radau pinned at x=-1, .
NekDouble m_fintime
Finish time of the simulation.
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Initialisation object for EquationSystem.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_tanbasis
2 x m_spacedim x nq
int m_steps
Number of steps to take.
SOLVER_UTILS_EXPORT int NoCaseStringCompare(const string &s1, const string &s2)
Perform a case-insensitive string comparison.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
int m_HomoDirec
number of homogenous directions
SOLVER_UTILS_EXPORT void FwdTransFields()
SOLVER_UTILS_EXPORT void WeakDGDiffusion(const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField, bool NumericalFluxIncludesNormal=true, bool InFieldIsInPhysSpace=false)
Calculate weak DG Diffusion in the LDG form.
1D Evenly-spaced points using Fourier Fit
bool m_multipleModes
Flag to determine if use multiple homogenenous modes are used.
Fourier Modified expansions with just the real part of the first mode .
virtual SOLVER_UTILS_EXPORT Array< OneD, bool > v_GetSystemSingularChecks()
SOLVER_UTILS_EXPORT void NumericalFlux(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
SOLVER_UTILS_EXPORT void SetUpBaseFields(SpatialDomains::MeshGraphSharedPtr &mesh)
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
int m_npointsY
number of points in Y direction (if homogeneous)
Abstraction of a global continuous one-dimensional spectral/hp element expansion which approximates t...
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff()
Virtual function for transformation to coefficient space.
virtual SOLVER_UTILS_EXPORT void v_GetFluxVector(const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
Principle Modified Functions .
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
virtual SOLVER_UTILS_EXPORT void v_Output(void)
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
int m_spacedim
Spatial dimension (>= expansion dim).
This class is the abstraction of a global discontinuous two- dimensional spectral/hp element expansio...
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
Defines a specification for a set of points.
void Neg(int n, T *x, const int incx)
Negate x = -x.
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
SOLVER_UTILS_EXPORT void GetFluxVector(const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
boost::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
SOLVER_UTILS_EXPORT void EvaluateFunction(Array< OneD, Array< OneD, NekDouble > > &pArray, std::string pFunctionName, const NekDouble pTime=0.0, const int domain=0)
Evaluates a function as specified in the session file.
boost::shared_ptr< Equation > EquationSharedPtr
virtual SOLVER_UTILS_EXPORT void v_DoInitialise()
Virtual function for initialisation implementation.
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
EquationSystemFactory & GetEquationSystemFactory()
Fourier Modified expansions with just the imaginary part of the first mode .
SOLVER_UTILS_EXPORT void ImportFldToMultiDomains(const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int ndomains)
Input field data from the given file to multiple domains.
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
MultiRegions::Direction const DirCartesianMap[]
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Fourier ModifiedExpansion with just the first mode .
Array< OneD, MultiRegions::ExpListSharedPtr > m_base
Base fields.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
1D Non Evenly-spaced points for Single Mode analysis
LibUtilities::FieldIOSharedPtr m_fld
Field input/output.
virtual SOLVER_UTILS_EXPORT void v_NumFluxforVector(const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp()
Virtual function to identify if operator is negated in DoSolve.
virtual SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr v_GetPressure(void)
SOLVER_UTILS_EXPORT void NumFluxforVector(const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)
SOLVER_UTILS_EXPORT void ZeroPhysFields()
SOLVER_UTILS_EXPORT void SessionSummary(SummaryList &vSummary)
Write out a session summary.
SpatialDomains::MeshGraphSharedPtr m_graph
Pointer to graph defining mesh.
virtual SOLVER_UTILS_EXPORT void v_NumFluxforScalar(const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &uflux)
SOLVER_UTILS_EXPORT void WeakDGAdvection(const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField, bool NumericalFluxIncludesNormal=true, bool InFieldIsInPhysSpace=false, int nvariables=0)
Calculate the weak discontinuous Galerkin advection.
Used to lookup the create function in NekManager.
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow(const int n)
Write base flow file of m_fields.
SOLVER_UTILS_EXPORT void ImportFldBase(std::string pInfile, SpatialDomains::MeshGraphSharedPtr pGraph)
virtual SOLVER_UTILS_EXPORT void v_DoSolve()
Virtual function for solve implementation.
boost::shared_ptr< ContField3D > ContField3DSharedPtr
void Zero(int n, T *x, const int incx)
Zero vector.
int m_NumQuadPointsError
Number of Quadrature points used to work out the error.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
static FieldMetaDataMap NullFieldMetaDataMap
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
virtual SOLVER_UTILS_EXPORT void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys()
Virtual function for transformation to physical space.
map< std::string, Array< OneD, Array< OneD, float > > > m_interpWeights
Map of the interpolation weights for a specific filename.
Describes the specification for a Basis.
SOLVER_UTILS_EXPORT EquationSystem(const LibUtilities::SessionReaderSharedPtr &pSession)
Initialises EquationSystem class members.
virtual SOLVER_UTILS_EXPORT void v_NumericalFlux(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
enum HomogeneousType m_HomogeneousType
1D Gauss-Lobatto-Legendre quadrature points
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Provides a generic Factory class.
SOLVER_UTILS_EXPORT void ImportFld(const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Input field data from the given file.