46 Loki::NoDestroy > Type;
47 return Type::Instance();
57 const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
58 const unsigned int& pNumForcingFields,
59 const TiXmlElement* pForce)
71 const Array<OneD, MultiRegions::ExpListSharedPtr>& fields,
72 const Array<
OneD, Array<OneD, NekDouble> >& inarray,
73 Array<
OneD, Array<OneD, NekDouble> >& outarray,
76 v_Apply(fields, inarray, outarray, time);
85 const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
86 const unsigned int& pNumForcingFields)
88 vector<ForcingSharedPtr> vForceList;
90 if (!pSession->DefinesElement(
"Nektar/Forcing"))
95 TiXmlElement* vForcing = pSession->GetElement(
"Nektar/Forcing");
98 unsigned int vNumForcingFields = pNumForcingFields;
99 if (!pNumForcingFields)
101 vNumForcingFields = pFields.num_elements();
104 TiXmlElement* vForce = vForcing->FirstChildElement(
"FORCE");
107 string vType = vForce->Attribute(
"TYPE");
110 vType, pSession, pFields,
111 vNumForcingFields, vForce));
112 vForce = vForce->NextSiblingElement(
"FORCE");
120 std::string pFieldName,
121 Array<OneD, NekDouble>& pArray,
122 const std::string& pFunctionName,
125 ASSERTL0(pSession->DefinesFunction(pFunctionName),
126 "Function '" + pFunctionName +
"' does not exist.");
129 pSession->GetFunction(pFunctionName, pFieldName);
131 Array<OneD, NekDouble> x0(1,0.0);
132 Array<OneD, NekDouble> x1(1,0.0);
133 Array<OneD, NekDouble> x2(1,0.0);
135 ffunc->Evaluate(x0, x1, x2, pTime, pArray);
140 Array<OneD, MultiRegions::ExpListSharedPtr> pFields,
142 std::string pFieldName,
143 Array<OneD, NekDouble>& pArray,
144 const std::string& pFunctionName,
147 ASSERTL0(pSession->DefinesFunction(pFunctionName),
148 "Function '" + pFunctionName +
"' does not exist.");
150 unsigned int nq = pFields[0]->GetNpoints();
151 if (pArray.num_elements() != nq)
153 pArray = Array<OneD, NekDouble> (nq);
157 vType = pSession->GetFunctionType(pFunctionName, pFieldName);
160 Array<OneD, NekDouble> x0(nq);
161 Array<OneD, NekDouble> x1(nq);
162 Array<OneD, NekDouble> x2(nq);
164 pFields[0]->GetCoords(x0, x1, x2);
166 pSession->GetFunction(pFunctionName, pFieldName);
168 ffunc->Evaluate(x0, x1, x2, pTime, pArray);
172 std::string filename = pSession->GetFunctionFilename(
176 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
177 std::vector<std::vector<NekDouble> > FieldData;
178 Array<OneD, NekDouble> vCoeffs(pFields[0]->GetNcoeffs());
183 fld->Import(filename, FieldDef, FieldData);
186 for (
int i = 0; i < FieldDef.size(); ++i)
188 for (
int j = 0; j < FieldDef[i]->m_fields.size(); ++j)
190 if (FieldDef[i]->m_fields[j] == pFieldName)
198 pFields[0]->ExtractDataToCoeffs(
201 FieldDef[i]->m_fields[idx],
206 cout <<
"Field " + pFieldName +
" not found." << endl;
209 pFields[0]->BwdTrans_IterPerExp(vCoeffs, pArray);