Nektar++
Functions
Python/SessionFunction.cpp File Reference
#include <FieldUtils/Interpolator.h>
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <SolverUtils/Core/SessionFunction.h>

Go to the source code of this file.

Functions

std::shared_ptr< SessionFunctionSessionFunction_Init (const LibUtilities::SessionReaderSharedPtr session, const MultiRegions::ExpListSharedPtr field, std::string functionName)
 
std::string SessionFunction_Describe (std::shared_ptr< SessionFunction > func, std::string fieldName)
 
Array< OneD, MultiRegions::ExpListSharedPtrSessionFunction_Evaluate_ExpList (std::shared_ptr< SessionFunction > func, std::vector< std::string > fieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > explists, NekDouble time)
 
Array< OneD, MultiRegions::ExpListSharedPtrSessionFunction_Evaluate (std::shared_ptr< SessionFunction > func, py::list fieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > explists, NekDouble time)
 
Array< OneD, MultiRegions::ExpListSharedPtrSessionFunction_Evaluate1 (std::shared_ptr< SessionFunction > func, py::list fieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > explists)
 
void export_SessionFunction ()
 

Function Documentation

◆ export_SessionFunction()

void export_SessionFunction ( )

Definition at line 92 of file Python/SessionFunction.cpp.

93{
94 py::class_<SessionFunction, std::shared_ptr<SessionFunction>,
95 boost::noncopyable>("SessionFunction", py::no_init)
96 .def("__init__", &SessionFunction_Init)
97 .def("Describe", &SessionFunction_Describe)
98 .def("Evaluate", &SessionFunction_Evaluate)
99 .def("Evaluate", &SessionFunction_Evaluate1);
100}
std::string SessionFunction_Describe(std::shared_ptr< SessionFunction > func, std::string fieldName)
Array< OneD, MultiRegions::ExpListSharedPtr > SessionFunction_Evaluate1(std::shared_ptr< SessionFunction > func, py::list fieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > explists)
std::shared_ptr< SessionFunction > SessionFunction_Init(const LibUtilities::SessionReaderSharedPtr session, const MultiRegions::ExpListSharedPtr field, std::string functionName)
Array< OneD, MultiRegions::ExpListSharedPtr > SessionFunction_Evaluate(std::shared_ptr< SessionFunction > func, py::list fieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > explists, NekDouble time)

References SessionFunction_Describe(), SessionFunction_Evaluate(), SessionFunction_Evaluate1(), and SessionFunction_Init().

Referenced by BOOST_PYTHON_MODULE().

◆ SessionFunction_Describe()

std::string SessionFunction_Describe ( std::shared_ptr< SessionFunction func,
std::string  fieldName 
)

Definition at line 50 of file Python/SessionFunction.cpp.

52{
53 return func->Describe(fieldName);
54}

Referenced by export_SessionFunction().

◆ SessionFunction_Evaluate()

Array< OneD, MultiRegions::ExpListSharedPtr > SessionFunction_Evaluate ( std::shared_ptr< SessionFunction func,
py::list  fieldNames,
Array< OneD, MultiRegions::ExpListSharedPtr explists,
NekDouble  time 
)

Definition at line 64 of file Python/SessionFunction.cpp.

67{
68 std::vector<std::string> fields(py::len(fieldNames));
69
70 for (std::size_t i = 0; i < py::len(fieldNames); ++i)
71 {
72 fields[i] = py::extract<std::string>(fieldNames[i]);
73 }
74
75 if (explists.size() == 0)
76 {
77 throw new ErrorUtil::NekError("List of fields is empty");
78 }
79
80 // Check first entry in list to guess which version of this function needs
81 // to be called.
82 return SessionFunction_Evaluate_ExpList(func, fields, explists, time);
83}
Nektar::ErrorUtil::NekError NekError
Array< OneD, MultiRegions::ExpListSharedPtr > SessionFunction_Evaluate_ExpList(std::shared_ptr< SessionFunction > func, std::vector< std::string > fieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > explists, NekDouble time)

References SessionFunction_Evaluate_ExpList().

Referenced by export_SessionFunction(), and SessionFunction_Evaluate1().

◆ SessionFunction_Evaluate1()

Array< OneD, MultiRegions::ExpListSharedPtr > SessionFunction_Evaluate1 ( std::shared_ptr< SessionFunction func,
py::list  fieldNames,
Array< OneD, MultiRegions::ExpListSharedPtr explists 
)

Definition at line 85 of file Python/SessionFunction.cpp.

88{
89 return SessionFunction_Evaluate(func, fieldNames, explists, 0.0);
90}

References SessionFunction_Evaluate().

Referenced by export_SessionFunction().

◆ SessionFunction_Evaluate_ExpList()

Array< OneD, MultiRegions::ExpListSharedPtr > SessionFunction_Evaluate_ExpList ( std::shared_ptr< SessionFunction func,
std::vector< std::string >  fieldNames,
Array< OneD, MultiRegions::ExpListSharedPtr explists,
NekDouble  time 
)

Definition at line 56 of file Python/SessionFunction.cpp.

59{
60 func->Evaluate(fieldNames, explists, time);
61 return explists;
62}

Referenced by SessionFunction_Evaluate().

◆ SessionFunction_Init()

std::shared_ptr< SessionFunction > SessionFunction_Init ( const LibUtilities::SessionReaderSharedPtr  session,
const MultiRegions::ExpListSharedPtr  field,
std::string  functionName 
)

Definition at line 42 of file Python/SessionFunction.cpp.

45{
47 functionName);
48}
General purpose memory allocation routines with the ability to allocate from thread specific memory p...

References FilterPython_Function::field.

Referenced by export_SessionFunction().