84 Loki::NoDestroy > Type;
85 return Type::Instance();
95 : m_comm (pSession->GetComm()),
137 if (
m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
139 std::string HomoStr =
m_session->GetSolverInfo(
"HOMOGENEOUS");
142 if ((HomoStr ==
"HOMOGENEOUS1D") || (HomoStr ==
"Homogeneous1D")
143 || (HomoStr ==
"1D") || (HomoStr ==
"Homo1D"))
149 if(
m_session->DefinesSolverInfo(
"ModeType"))
151 m_session->MatchSolverInfo(
"ModeType",
"SingleMode",
153 m_session->MatchSolverInfo(
"ModeType",
"HalfMode",
155 m_session->MatchSolverInfo(
"ModeType",
"MultipleModes",
160 if (
m_session->DefinesSolverInfo(
"ModeType"))
176 ASSERTL0(
false,
"SolverInfo ModeType not valid");
185 if ((HomoStr ==
"HOMOGENEOUS2D") || (HomoStr ==
"Homogeneous2D")
186 || (HomoStr ==
"2D") || (HomoStr ==
"Homo2D"))
196 if ((HomoStr ==
"HOMOGENEOUS3D") || (HomoStr ==
"Homogeneous3D")
197 || (HomoStr ==
"3D") || (HomoStr ==
"Homo3D"))
209 m_session->MatchSolverInfo(
"DEALIASING",
"True",
213 m_session->MatchSolverInfo(
"DEALIASING",
"On",
224 m_session->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"True",
228 m_session->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"On",
234 if (
m_session->DefinesSolverInfo(
"PROJECTION"))
236 std::string ProjectStr =
m_session->GetSolverInfo(
"PROJECTION");
238 if ((ProjectStr ==
"Continuous") || (ProjectStr ==
"Galerkin") ||
239 (ProjectStr ==
"CONTINUOUS") || (ProjectStr ==
"GALERKIN"))
243 else if ((ProjectStr ==
"MixedCGDG") ||
244 (ProjectStr ==
"Mixed_CG_Discontinuous"))
248 else if(ProjectStr ==
"DisContinuous")
254 ASSERTL0(
false,
"PROJECTION value not recognised");
259 cerr <<
"Projection type not specified in SOLVERINFO,"
260 "defaulting to continuous Galerkin" << endl;
268 int nvariables =
m_session->GetVariables().size();
269 bool DeclareCoeffPhysArrays =
true;
272 m_fields = Array<OneD, MultiRegions::ExpListSharedPtr>(nvariables);
274 m_expdim = m_graph->GetMeshDimension();
296 for (i = 0; i <
m_fields.num_elements(); i++)
309 for (i = 0; i <
m_fields.num_elements(); i++)
336 for(i = 0; i <
m_fields.num_elements(); i++)
364 for (i = 0; i <
m_fields.num_elements(); i++)
366 if(
m_session->GetVariable(i).compare(
"w")
402 for (i = 0; i <
m_fields.num_elements(); i++)
423 DeclareCoeffPhysArrays,
426 for (i = 1; i < m_fields.num_elements(); i++)
429 SameExpansions(
m_session->GetVariable(0),
434 *firstfield, m_graph,
436 DeclareCoeffPhysArrays,
445 DeclareCoeffPhysArrays,
455 Array<OneD, Array<OneD, NekDouble> >
464 m_fields[0]->GetTrace()->
482 for (i = 1; i < m_fields.num_elements(); i++)
484 if(m_graph->SameExpansions(
490 *firstfield, m_graph,
509 Array<OneD, Array<OneD, NekDouble> >
519 for(i = 1; i < m_fields.num_elements(); ++i)
521 m_fields[i]->GetTrace();
527 ASSERTL0(
false,
"Expansion dimension not recognised");
550 for (i = 0; i <
m_fields.num_elements(); i++)
563 for (i = 0; i <
m_fields.num_elements(); i++)
583 for (i = 0; i <
m_fields.num_elements(); i++)
595 for (i = 0; i <
m_fields.num_elements(); i++)
611 "3D fully periodic problems not implemented yet");
615 for (i = 0; i <
m_fields.num_elements(); i++)
626 ASSERTL0(
false,
"Expansion dimension not recognised");
632 Array<OneD, Array<OneD, NekDouble> >(
m_spacedim);
650 m_session->LoadParameter(
"NumQuadPointsError",
675 Array<
OneD, Array<OneD, NekDouble> >& pArray,
676 std::string pFunctionName,
681 "Function '" + pFunctionName +
"' does not exist.");
683 std::vector<std::string> vFieldNames =
m_session->GetVariables();
685 for(
int i = 0 ; i < vFieldNames.size(); i++)
698 std::vector<std::string> pFieldNames,
699 Array<
OneD, Array<OneD, NekDouble> > &pFields,
700 const std::string& pFunctionName,
703 ASSERTL1(pFieldNames.size() == pFields.num_elements(),
704 "Function '" + pFunctionName
705 +
"' variable list size mismatch with array storage.");
707 "Function '" + pFunctionName +
"' does not exist.");
709 for(
int i = 0; i < pFieldNames.size(); i++)
721 std::vector<std::string> pFieldNames,
722 Array<OneD, MultiRegions::ExpListSharedPtr> &pFields,
723 const std::string& pFunctionName,
727 "Function '" + pFunctionName +
"' does not exist.");
728 ASSERTL0(pFieldNames.size() == pFields.num_elements(),
729 "Field list / name list size mismatch.");
731 for(
int i = 0; i < pFieldNames.size(); i++)
734 pFunctionName, 0.0, domain);
735 pFields[i]->FwdTrans_IterPerExp(pFields[i]->GetPhys(),
736 pFields[i]->UpdateCoeffs());
743 std::string pFieldName,
744 Array<OneD, NekDouble>& pArray,
745 const std::string& pFunctionName,
750 "Function '" + pFunctionName +
"' does not exist.");
752 unsigned int nq =
m_fields[0]->GetNpoints();
753 if (pArray.num_elements() < nq)
755 pArray = Array<OneD, NekDouble>(nq);
759 vType =
m_session->GetFunctionType(pFunctionName, pFieldName,domain);
762 Array<OneD,NekDouble> x0(nq);
763 Array<OneD,NekDouble> x1(nq);
764 Array<OneD,NekDouble> x2(nq);
770 =
m_session->GetFunction(pFunctionName, pFieldName,domain);
772 ffunc->Evaluate(x0,x1,x2,pTime,pArray);
777 =
m_session->GetFunctionFilename(pFunctionName, pFieldName,domain);
779 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
780 std::vector<std::vector<NekDouble> > FieldData;
785 int numexp =
m_fields[0]->GetExpSize();
786 Array<OneD,int> ElementGIDs(numexp);
788 for(
int i = 0; i < numexp; ++i)
790 ElementGIDs[i] =
m_fields[0]->GetExp(i)->GetGeom()->GetGlobalID();
794 m_fld->Import(filename,FieldDef,FieldData,
801 for (
int i = 0; i < FieldDef.size(); ++i)
805 for(
int j = 0; j < FieldDef[i]->m_fields.size(); ++j)
807 if (FieldDef[i]->
m_fields[j] == pFieldName)
816 FieldDef[i], FieldData[i],
817 FieldDef[i]->
m_fields[idx], vCoeffs);
821 cout <<
"Field " + pFieldName +
" not found." << endl;
826 m_fields[0]->BwdTrans_IterPerExp(vCoeffs, pArray);
837 std::string pFieldName,
838 const std::string &pFunctionName,
842 "Function '" + pFunctionName +
"' does not exist.");
847 vType =
m_session->GetFunctionType(pFunctionName, pFieldName);
851 =
m_session->GetFunction(pFunctionName, pFieldName,domain);
852 retVal = ffunc->GetExpression();
857 =
m_session->GetFunctionFilename(pFunctionName, pFieldName,domain);
858 retVal =
"from file " + filename;
872 int nvariables =
m_fields.num_elements();
873 for (
int i = 0; i < nvariables; ++i)
876 m_fields[i]->EvaluateBoundaryConditions(time, varName);
889 const Array<OneD, NekDouble> &exactsoln,
896 if (
m_fields[field]->GetPhysState() ==
false)
902 if (exactsoln.num_elements())
906 else if (
m_session->DefinesFunction(
"ExactSolution"))
908 Array<OneD, NekDouble>
921 if (Normalised ==
true)
929 L2error = sqrt(L2error*L2error/Vol);
934 Array<OneD,NekDouble> L2INF(2);
949 const Array<OneD, NekDouble> &exactsoln)
955 if (
m_fields[field]->GetPhysState() ==
false)
961 if (exactsoln.num_elements())
965 else if (
m_session->DefinesFunction(
"ExactSolution"))
967 Array<OneD, NekDouble>
982 Array<OneD,NekDouble> L2INF(2);
984 Linferror = L2INF[1];
1000 Array<OneD,NekDouble> L2INF(2);
1023 int ErrorCoordim = ErrorExp->GetCoordim(0);
1024 int ErrorNq = ErrorExp->GetTotPoints();
1026 Array<OneD,NekDouble> ErrorXc0(ErrorNq, 0.0);
1027 Array<OneD,NekDouble> ErrorXc1(ErrorNq, 0.0);
1028 Array<OneD,NekDouble> ErrorXc2(ErrorNq, 0.0);
1030 switch(ErrorCoordim)
1033 ErrorExp->GetCoords(ErrorXc0);
1036 ErrorExp->GetCoords(ErrorXc0, ErrorXc1);
1039 ErrorExp->GetCoords(ErrorXc0, ErrorXc1, ErrorXc2);
1043 m_session->GetFunction(
"ExactSolution", field);
1046 Array<OneD,NekDouble> ErrorSol(ErrorNq);
1048 exSol->Evaluate(ErrorXc0,ErrorXc1,ErrorXc2,
m_time,ErrorSol);
1052 ErrorExp->BwdTrans_IterPerExp(
m_fields[field]->GetCoeffs(),
1053 ErrorExp->UpdatePhys());
1055 L2INF[0] = ErrorExp->L2 (ErrorExp->GetPhys(), ErrorSol);
1056 L2INF[1] = ErrorExp->Linf(ErrorExp->GetPhys(), ErrorSol);
1069 bool dumpInitialConditions,
1072 if (
m_session->GetComm()->GetRank() == 0)
1074 cout <<
"Initial Conditions:" << endl;
1077 if (
m_session->DefinesFunction(
"InitialConditions"))
1080 "InitialConditions",domain);
1082 if (
m_session->GetComm()->GetRank() == 0)
1085 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1087 std::string varName =
m_session->GetVariable(i);
1088 cout <<
" - Field " << varName <<
": "
1096 int nq =
m_fields[0]->GetNpoints();
1097 for (
int i = 0; i <
m_fields.num_elements(); i++)
1103 if (
m_session->GetComm()->GetRank() == 0)
1105 cout <<
" - Field " <<
m_session->GetVariable(i)
1106 <<
": 0 (default)" << endl;
1121 Array<OneD, NekDouble> &outfield,
1125 "ExactSolution array size mismatch.");
1126 Vmath::Zero(outfield.num_elements(), outfield, 1);
1127 if (
m_session->DefinesFunction(
"ExactSolution"))
1130 "ExactSolution", time);
1145 Array<
OneD, Array<OneD, NekDouble> > &base)
1147 base = Array<OneD, Array<OneD, NekDouble> >(
m_spacedim);
1148 std::vector<std::string> vel;
1149 vel.push_back(
"Vx");
1150 vel.push_back(
"Vy");
1151 vel.push_back(
"Vz");
1164 int nvariables =
m_session->GetVariables().size();
1165 m_base = Array<OneD, MultiRegions::ExpListSharedPtr>(nvariables);
1173 for(i = 0; i <
m_base.num_elements(); i++)
1193 for (i = 0 ; i <
m_base.num_elements(); i++)
1197 ::AllocateSharedPtr(
1202 m_base[i]->SetWaveSpace(
true);
1214 for (i = 0 ; i <
m_base.num_elements(); i++)
1218 ::AllocateSharedPtr(
1223 m_base[i]->SetWaveSpace(
true);
1234 for (i = 0 ; i <
m_base.num_elements(); i++)
1238 ::AllocateSharedPtr(
1243 m_base[i]->SetWaveSpace(
false);
1256 for (i = 1 ; i < m_base.num_elements(); i++)
1273 for (i = 1 ; i < m_base.num_elements(); i++)
1282 ASSERTL0(
false,
"Expansion dimension not recognised");
1294 for(i = 0 ; i <
m_base.num_elements(); i++)
1305 for(i = 0 ; i <
m_base.num_elements(); i++)
1317 ASSERTL0(
false,
"Expansion dimension not recognised");
1325 std::string pInfile,
1328 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1329 std::vector<std::vector<NekDouble> > FieldData;
1332 m_fld->Import(pInfile,FieldDef,FieldData);
1334 int nvar =
m_session->GetVariables().size();
1335 if (
m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
1337 std::string HomoStr =
m_session->GetSolverInfo(
"HOMOGENEOUS");
1340 for (
int j = 0; j < nvar; ++j)
1342 for(
int i = 0; i < FieldDef.size(); ++i)
1344 bool flag = FieldDef[i]->m_fields[j] ==
1346 ASSERTL1(flag, (std::string(
"Order of ") + pInfile
1347 + std::string(
" data and that defined in "
1348 "m_boundaryconditions differs")).c_str());
1350 m_base[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
1352 m_base[j]->UpdateCoeffs());
1402 for (
int i = 0; i <
m_fields.num_elements(); i++)
1414 for (
int i = 0; i <
m_fields.num_elements(); i++)
1433 const Array<
OneD, Array<OneD, NekDouble> > &F,
1434 Array<OneD, NekDouble> &outarray)
1437 int ndim = F.num_elements();
1438 int nCoeffs =
m_fields[0]->GetNcoeffs();
1440 Array<OneD, NekDouble> iprod(nCoeffs);
1443 for (
int i = 0; i < ndim; ++i)
1445 m_fields[0]->IProductWRTDerivBase(i, F[i], iprod);
1446 Vmath::Vadd(nCoeffs, iprod, 1, outarray, 1, outarray, 1);
1457 const Array<
OneD, Array<OneD, NekDouble> > &F,
1458 Array<OneD, NekDouble> &outarray)
1461 int ndim = F.num_elements();
1462 int nPointsTot =
m_fields[0]->GetNpoints();
1463 Array<OneD, NekDouble> tmp(nPointsTot);
1464 Array<OneD, NekDouble> div(nPointsTot, 0.0);
1467 for (
int i = 0; i < ndim; ++i)
1474 m_fields[0]->IProductWRTBase(div, outarray);
1485 const Array<
OneD, Array<OneD, NekDouble> > &V,
1486 const Array<OneD, const NekDouble> &u,
1487 Array<OneD, NekDouble> &outarray,
1491 int ndim = V.num_elements();
1493 int nPointsTot =
m_fields[0]->GetNpoints();
1494 Array<OneD, NekDouble> tmp(nPointsTot);
1495 Array<OneD, NekDouble> wk(ndim * nPointsTot, 0.0);
1501 m_fields[0]->IProductWRTBase(tmp, outarray,
1506 m_fields[0]->IProductWRTBase_IterPerExp(tmp, outarray);
1518 const Array<
OneD, Array<OneD, NekDouble> > &V,
1519 const Array<OneD, const NekDouble> &u,
1520 Array<OneD, NekDouble> &outarray,
1521 Array<OneD, NekDouble> &wk)
1524 int ndim = V.num_elements();
1529 int nPointsTot =
m_fields[0]->GetNpoints();
1530 Array<OneD, NekDouble> grad0,grad1,grad2;
1533 if (wk.num_elements())
1539 grad0 = Array<OneD, NekDouble> (nPointsTot);
1547 Vmath::Vmul(nPointsTot, grad0, 1, V[0], 1, outarray,1);
1550 grad1 = Array<OneD, NekDouble> (nPointsTot);
1551 m_fields[0]->PhysDeriv(u, grad0, grad1);
1552 Vmath::Vmul (nPointsTot, grad0, 1, V[0], 1, outarray, 1);
1554 outarray, 1, outarray, 1);
1557 grad1 = Array<OneD, NekDouble> (nPointsTot);
1558 grad2 = Array<OneD, NekDouble> (nPointsTot);
1559 m_fields[0]->PhysDeriv(u,grad0,grad1,grad2);
1560 Vmath::Vmul (nPointsTot, grad0, 1, V[0], 1, outarray, 1);
1562 outarray, 1, outarray, 1);
1564 outarray, 1, outarray, 1);
1567 ASSERTL0(
false,
"dimension unknown");
1582 const Array<
OneD, Array<OneD, NekDouble> >& InField,
1583 Array<
OneD, Array<OneD, NekDouble> >& OutField,
1584 bool NumericalFluxIncludesNormal,
1585 bool InFieldIsInPhysSpace,
1596 nvariables =
m_fields.num_elements();
1599 Array<OneD, Array<OneD, NekDouble> > fluxvector(nVelDim);
1600 Array<OneD, Array<OneD, NekDouble> > physfield (nvariables);
1602 for(i = 0; i < nVelDim; ++i)
1604 fluxvector[i] = Array<OneD, NekDouble>(nPointsTot);
1609 if (InFieldIsInPhysSpace ==
true)
1611 for (i = 0; i < nvariables; ++i)
1613 physfield[i] = InField[i];
1619 for(i = 0; i < nvariables; ++i)
1622 physfield[i] = Array<OneD, NekDouble>(nPointsTot);
1623 m_fields[i]->BwdTrans(InField[i],physfield[i]);
1628 for (i = 0; i < nvariables; ++i)
1640 if (NumericalFluxIncludesNormal ==
true)
1642 Array<OneD, Array<OneD, NekDouble> > numflux (nvariables);
1644 for (i = 0; i < nvariables; ++i)
1646 numflux[i] = Array<OneD, NekDouble>(nTracePointsTot);
1654 for (i = 0; i < nvariables; ++i)
1657 m_fields[i]->AddTraceIntegral(numflux[i],OutField[i]);
1665 Array<OneD, Array<OneD, NekDouble> > numfluxX (nvariables);
1666 Array<OneD, Array<OneD, NekDouble> > numfluxY (nvariables);
1668 for (i = 0; i < nvariables; ++i)
1670 numfluxX[i] = Array<OneD, NekDouble>(nTracePointsTot);
1671 numfluxY[i] = Array<OneD, NekDouble>(nTracePointsTot);
1679 for(i = 0; i < nvariables; ++i)
1682 m_fields[i]->AddTraceIntegral(numfluxX[i], numfluxY[i],
1696 const Array<
OneD, Array<OneD, NekDouble> >& InField,
1697 Array<
OneD, Array<OneD, NekDouble> >& OutField,
1698 bool NumericalFluxIncludesNormal,
1699 bool InFieldIsInPhysSpace)
1705 int nvariables =
m_fields.num_elements();
1708 Array<OneD, NekDouble> qcoeffs (ncoeffs);
1709 Array<OneD, NekDouble> temp (ncoeffs);
1711 Array<OneD, Array<OneD, NekDouble> > fluxvector (
m_spacedim);
1712 Array<OneD, Array<OneD, NekDouble> > ufield (nvariables);
1714 Array<OneD, Array<OneD, Array<OneD, NekDouble> > > flux (nqvar);
1715 Array<OneD, Array<OneD, Array<OneD, NekDouble> > > qfield (nqvar);
1717 for (j = 0; j < nqvar; ++j)
1719 qfield[j] = Array<OneD, Array<OneD, NekDouble> >(nqvar);
1720 flux[j] = Array<OneD, Array<OneD, NekDouble> >(nqvar);
1722 for (i = 0; i< nvariables; ++i)
1724 ufield[i] = Array<OneD, NekDouble>(nPointsTot, 0.0);
1725 qfield[j][i] = Array<OneD, NekDouble>(nPointsTot, 0.0);
1726 flux[j][i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
1732 fluxvector[k] = Array<OneD, NekDouble>(nPointsTot, 0.0);
1736 if (InFieldIsInPhysSpace ==
true)
1738 for (i = 0; i < nvariables; ++i)
1740 ufield[i] = InField[i];
1746 for (i = 0; i < nvariables; ++i)
1749 ufield[i] = Array<OneD, NekDouble>(nPointsTot);
1750 m_fields[i]->BwdTrans(InField[i],ufield[i]);
1760 for (j = 0; j < nqvar; ++j)
1762 for (i = 0; i < nvariables; ++i)
1772 ufield[i], 1, fluxvector[k], 1);
1784 m_fields[i]->AddTraceIntegral(flux[j][i], qcoeffs);
1799 m_fields[i]->MultiplyByElmtInvMass(qcoeffs, qcoeffs);
1802 m_fields[i]->BwdTrans(qcoeffs, qfield[j][i]);
1814 for (i = 0; i < nvariables; ++i)
1817 OutField[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
1818 temp = Array<OneD, NekDouble>(ncoeffs, 0.0);
1822 for (j = 0; j < nqvar; ++j)
1827 qfield[j][i], 1, fluxvector[k], 1);
1848 m_fields[i]->AddTraceIntegral(flux[0][i], OutField[i]);
1860 boost::lexical_cast<std::string>(n);
1872 std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
1873 std::vector<std::string> &variables)
1875 char chkout[16] =
"";
1876 sprintf(chkout,
"%d", n);
1877 std::string outname =
m_sessionName +
"_" + chkout +
".chk";
1878 WriteFld(outname, field, fieldcoeffs, variables);
1887 std::vector<Array<OneD, NekDouble> > fieldcoeffs(
1889 std::vector<std::string> variables(
m_fields.num_elements());
1891 for (
int i = 0; i <
m_fields.num_elements(); ++i)
1895 fieldcoeffs[i] =
m_fields[i]->UpdateCoeffs();
1899 fieldcoeffs[i] = Array<OneD,NekDouble>(
m_fields[0]->
1923 const std::string &outname,
1925 std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
1926 std::vector<std::string> &variables)
1928 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
1929 = field->GetFieldDefinitions();
1930 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
1933 for(
int j = 0; j < fieldcoeffs.size(); ++j)
1935 for(
int i = 0; i < FieldDef.size(); ++i)
1938 FieldDef[i]->m_fields.push_back(variables[j]);
1939 field->AppendFieldData(FieldDef[i], FieldData[i],
1961 const std::string &infile,
1962 Array<OneD, MultiRegions::ExpListSharedPtr> &pFields)
1964 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1965 std::vector<std::vector<NekDouble> > FieldData;
1967 m_fld->Import(infile,FieldDef,FieldData);
1970 for(
int j = 0; j < pFields.num_elements(); ++j)
1973 pFields[j]->UpdateCoeffs(),1);
1975 for(
int i = 0; i < FieldDef.size(); ++i)
1979 std::string(
"Order of ") + infile
1980 + std::string(
" data and that defined in "
1981 "m_boundaryconditions differs"));
1983 pFields[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
1985 pFields[j]->UpdateCoeffs());
1987 pFields[j]->BwdTrans(pFields[j]->GetCoeffs(),
1988 pFields[j]->UpdatePhys());
2002 const std::string &infile,
2003 Array<OneD, MultiRegions::ExpListSharedPtr> &pFields,
2006 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2007 std::vector<std::vector<NekDouble> > FieldData;
2013 ASSERTL0(ndomains*nvariables == pFields.num_elements(),
"Number of fields does not match the number of variables and domains");
2016 for(
int j = 0; j < ndomains; ++j)
2018 for(
int i = 0; i < nvariables; ++i)
2022 for(
int n = 0; n < FieldDef.size(); ++n)
2025 std::string(
"Order of ") + infile
2026 + std::string(
" data and that defined in "
2027 "m_boundaryconditions differs"));
2029 pFields[j*nvariables+i]->ExtractDataToCoeffs(FieldDef[n], FieldData[n],
2031 pFields[j*nvariables+i]->UpdateCoeffs());
2033 pFields[j*nvariables+i]->BwdTrans(pFields[j*nvariables+i]->GetCoeffs(),
2034 pFields[j*nvariables+i]->UpdatePhys());
2045 const std::string &infile,
2047 std::string &pFieldName)
2049 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2050 std::vector<std::vector<NekDouble> > FieldData;
2052 m_fld->Import(infile,FieldDef,FieldData);
2055 Vmath::Zero(pField->GetNcoeffs(),pField->UpdateCoeffs(),1);
2057 for(
int i = 0; i < FieldDef.size(); ++i)
2060 for(
int j = 0; j < FieldData.size(); ++j)
2062 if (FieldDef[i]->
m_fields[j] == pFieldName)
2067 ASSERTL1(idx >= 0,
"Field " + pFieldName +
" not found.");
2069 pField->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
2071 pField->UpdateCoeffs());
2073 pField->BwdTrans(pField->GetCoeffs(), pField->UpdatePhys());
2084 const std::string &infile,
2085 std::vector< std::string> &fieldStr,
2086 Array<
OneD, Array<OneD, NekDouble> > &coeffs)
2089 ASSERTL0(fieldStr.size() <= coeffs.num_elements(),
2090 "length of fieldstr should be the same as pFields");
2092 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
2093 std::vector<std::vector<NekDouble> > FieldData;
2095 m_fld->Import(infile,FieldDef,FieldData);
2098 for(
int j = 0; j < fieldStr.size(); ++j)
2100 Vmath::Zero(coeffs[j].num_elements(),coeffs[j],1);
2101 for(
int i = 0; i < FieldDef.size(); ++i)
2103 m_fields[0]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
2104 fieldStr[j], coeffs[j]);
2127 ? boost::lexical_cast<string>(
m_NumMode) :
"ALL");
2144 if (
m_session->DefinesSolverInfo(
"UpwindType"))
2147 m_session->GetSolverInfo(
"UpwindType"));
2150 if (
m_session->DefinesSolverInfo(
"AdvectionType"))
2152 std::string AdvectionType;
2153 AdvectionType =
m_session->GetSolverInfo(
"AdvectionType");
2155 GetClassDescription(AdvectionType));
2169 "Mixed Continuous Galerkin and Discontinuous");
2172 if (
m_session->DefinesSolverInfo(
"DiffusionType"))
2174 std::string DiffusionType;
2175 DiffusionType =
m_session->GetSolverInfo(
"DiffusionType");
2177 GetClassDescription(DiffusionType));
2194 string::const_iterator it1=s1.begin();
2195 string::const_iterator it2=s2.begin();
2198 while ( (it1!=s1.end()) && (it2!=s2.end()) )
2200 if(::toupper(*it1) != ::toupper(*it2))
2203 return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1;
2211 size_t size1=s1.size();
2212 size_t size2=s2.size();
2220 return (size1 < size2) ? -1 : 1;
2225 return Array<OneD, bool>(
m_session->GetVariables().size(),
false);
2229 const int i, Array<
OneD,
2230 Array<OneD, NekDouble> > &physfield,
2231 Array<
OneD, Array<OneD, NekDouble> > &flux)
2233 ASSERTL0(
false,
"v_GetFluxVector: This function is not valid "
2234 "for the Base class");
2238 const int i,
const int j,
2239 Array<
OneD, Array<OneD, NekDouble> > &physfield,
2240 Array<
OneD, Array<OneD, NekDouble> > &flux)
2242 ASSERTL0(
false,
"v_GetqFluxVector: This function is not valid "
2243 "for the Base class");
2247 const int i, Array<
OneD,
2248 Array<OneD, NekDouble> > &physfield,
2249 Array<
OneD, Array<OneD, NekDouble> > &fluxX,
2250 Array<
OneD, Array<OneD, NekDouble> > &fluxY)
2252 ASSERTL0(
false,
"v_GetFluxVector: This function is not valid "
2253 "for the Base class");
2257 Array<
OneD, Array<OneD, NekDouble> > &physfield,
2258 Array<
OneD, Array<OneD, NekDouble> > &numflux)
2260 ASSERTL0(
false,
"v_NumericalFlux: This function is not valid "
2261 "for the Base class");
2265 Array<
OneD, Array<OneD, NekDouble> > &physfield,
2266 Array<
OneD, Array<OneD, NekDouble> > &numfluxX,
2267 Array<
OneD, Array<OneD, NekDouble> > &numfluxY )
2269 ASSERTL0(
false,
"v_NumericalFlux: This function is not valid "
2270 "for the Base class");
2274 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
2275 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &uflux)
2277 ASSERTL0(
false,
"v_NumFluxforScalar: This function is not valid "
2278 "for the Base class");
2282 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
2283 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &qfield,
2284 Array<
OneD, Array<OneD, NekDouble > > &qflux)
2286 ASSERTL0(
false,
"v_NumFluxforVector: This function is not valid "
2287 "for the Base class");
2292 ASSERTL0(
false,
"This function is not valid for the Base class");
2298 std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
2299 std::vector<std::string> &variables)