53 return exp->GetExp(i);
58 std::ofstream out(filename.c_str());
59 exp->WriteVtkHeader(out);
60 size_t nExp = exp->GetExpSize();
61 for (
size_t i = 0; i < nExp; ++i)
63 exp->WriteVtkPieceHeader(out, i);
64 exp->WriteVtkPieceFooter(out, i);
66 exp->WriteVtkFooter(out);
73 exp->FwdTrans(in, out);
81 exp->BwdTrans(in, out);
89 exp->IProductWRTBase(in, out);
97 exp->MultiplyByInvMassMatrix(in, out);
103 const py::object constFactorMap,
104 const py::object varCoeffMap)
111 if (!constFactorMap.is_none())
113 facMap = py::extract<StdRegions::ConstFactorMap>(constFactorMap);
115 if (!varCoeffMap.is_none())
117 coeffMap = py::extract<StdRegions::VarCoeffMap>(varCoeffMap);
120 exp->HelmSolve(in, out, facMap, coeffMap);
134 return exp->L2(in, err);
140 return exp->Linf(in);
147 return exp->Linf(in, err);
152 size_t nPhys = exp->GetNpoints();
153 size_t coordim = exp->GetCoordim(0);
155 std::vector<Array<OneD, NekDouble>> coords(coordim);
156 for (
size_t i = 0; i < coordim; ++i)
164 exp->GetCoords(coords[0]);
165 return py::make_tuple(coords[0]);
168 exp->GetCoords(coords[0], coords[1]);
169 return py::make_tuple(coords[0], coords[1]);
172 exp->GetCoords(coords[0], coords[1], coords[2]);
173 return py::make_tuple(coords[0], coords[1], coords[2]);
182 exp->SetPhysArray(inarray);
188 exp->SetPhys(inarray);
193 return exp->GetPhys();
199 exp->SetCoeffsArray(inarray);
204 return exp->GetCoeffs();
209 return exp->Integral();
214 std::stringstream ss;
215 ss << static_cast<const void *>(&(exp->GetPhys()[0]));
221 exp->ClearGlobalLinSysManager();
231 size_t nExp = exp->GetExpSize();
235 for (
size_t i = 0; i < nExp; ++i)
237 elementGIDs[i] = exp->GetExp(i)->GetGeom()->GetGlobalID();
240 std::vector<LibUtilities::FieldDefinitionsSharedPtr> def;
241 std::vector<std::vector<NekDouble>> data;
243 LibUtilities::FieldIO::CreateForFile(exp->GetSession(), filename);
249 Vmath::Zero(exp->GetNcoeffs(), exp->UpdateCoeffs(), 1);
252 for (
size_t i = 0; i < def.size(); ++i)
255 for (
size_t j = 0; j < def[i]->m_fields.size(); ++j)
257 if (def[i]->m_fields[j] == varName)
265 exp->ExtractDataToCoeffs(def[i], data[i], def[i]->m_fields[idx],
266 exp->UpdateCoeffs());
270 std::cout <<
"Field " + varName +
" not found." << std::endl;
274 exp->BwdTrans(exp->GetCoeffs(), exp->UpdatePhys());
279 int (
ExpList::*GetNcoeffs)()
const = &ExpList::GetNcoeffs;
281 py::class_<ExpList, std::shared_ptr<ExpList>, boost::noncopyable>(
287 .def(
"GetExpSize", &ExpList::GetExpSize)
288 .def(
"GetNpoints", &ExpList::GetNpoints)
289 .def(
"GetNcoeffs", GetNcoeffs)
291 .def(
"GetPhys_Offset", &ExpList::GetPhys_Offset)
292 .def(
"GetCoeff_Offset", &ExpList::GetCoeff_Offset)
295 .def(
"PhysEvaluate", &ExpList::PhysEvaluate)
304 (py::arg(
"in"), py::arg(
"constFactorMap") = py::object(),
305 py::arg(
"varCoeffMap") = py::object()))
319 .def(
"SetPhysState", &ExpList::SetPhysState)
320 .def(
"GetPhysState", &ExpList::GetPhysState)
332 export_SharedArray<std::shared_ptr<ExpList>>();
const Array< OneD, const NekDouble > ExpList_GetCoeffs(ExpListSharedPtr exp)
NekDouble ExpList_Linf_Error(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in, const Array< OneD, const NekDouble > &err)
Array< OneD, NekDouble > ExpList_MultiplyByInvMassMatrix(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
void ExpList_ResetManagers(ExpListSharedPtr exp)
NekDouble ExpList_Linf(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
const Array< OneD, const NekDouble > ExpList_GetPhys(ExpListSharedPtr exp)
Array< OneD, NekDouble > ExpList_HelmSolve(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in, const py::object constFactorMap, const py::object varCoeffMap)
NekDouble ExpList_Integral(ExpListSharedPtr exp)
Array< OneD, NekDouble > ExpList_IProductWRTBase(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
ExpansionSharedPtr ExpList_GetExp(ExpListSharedPtr exp, int i)
void ExpList_SetPhysArray(ExpListSharedPtr exp, Array< OneD, NekDouble > inarray)
Array< OneD, NekDouble > ExpList_BwdTrans(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
void ExpList_LoadField(ExpListSharedPtr exp, std::string filename, std::string varName)
void ExpList_WriteVTK(ExpListSharedPtr exp, std::string filename)
void ExpList_SetPhys(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &inarray)
py::tuple ExpList_GetCoords(ExpListSharedPtr exp)
void ExpList_SetCoeffsArray(ExpListSharedPtr exp, Array< OneD, NekDouble > inarray)
NekDouble ExpList_L2(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
std::string ExpList_GetPhysAddress(ExpListSharedPtr exp)
Array< OneD, NekDouble > ExpList_FwdTrans(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
NekDouble ExpList_L2_Error(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in, const Array< OneD, const NekDouble > &err)
Base class for all multi-elemental spectral/hp expansions.
std::shared_ptr< FieldIO > FieldIOSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static FieldMetaDataMap NullFieldMetaDataMap
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
static ConstFactorMap NullConstFactorMap
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
void Zero(int n, T *x, const int incx)
Zero vector.
Used to lookup the create function in NekManager.