Nektar++
|
#include <SessionFunction.h>
Public Member Functions | |
SOLVER_UTILS_EXPORT | SessionFunction (const LibUtilities::SessionReaderSharedPtr &session, const MultiRegions::ExpListSharedPtr &field, std::string functionName, bool toCache=false) |
Representation of a FUNCTION defined in the session xml file. More... | |
SOLVER_UTILS_EXPORT void | Evaluate (Array< OneD, Array< OneD, NekDouble > > &pArray, const NekDouble pTime=0.0, const int domain=0) |
Evaluates a function defined in the xml session file at each quadrature point. More... | |
SOLVER_UTILS_EXPORT void | Evaluate (std::vector< std::string > pFieldNames, Array< OneD, Array< OneD, NekDouble > > &pArray, const NekDouble &pTime=0.0, const int domain=0) |
Evaluates a function defined in the xml session file at each quadrature point. More... | |
SOLVER_UTILS_EXPORT void | Evaluate (std::vector< std::string > pFieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &pTime=0.0, const int domain=0) |
Evaluates a function defined in the xml session file at each quadrature point. More... | |
SOLVER_UTILS_EXPORT void | Evaluate (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0) |
SOLVER_UTILS_EXPORT std::string | Describe (std::string pFieldName, const int domain=0) |
Provide a description of a function for a given field name. More... | |
SOLVER_UTILS_EXPORT const LibUtilities::SessionReaderSharedPtr & | GetSession () |
SOLVER_UTILS_EXPORT const MultiRegions::ExpListSharedPtr & | GetExpansion () |
Private Member Functions | |
SOLVER_UTILS_EXPORT void | EvaluateExp (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0) |
SOLVER_UTILS_EXPORT void | EvaluateFld (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0) |
SOLVER_UTILS_EXPORT void | EvaluatePts (std::string pFieldName, Array< OneD, NekDouble > &pArray, const NekDouble &pTime=0.0, const int domain=0) |
Evaluates a function from pts file. More... | |
SOLVER_UTILS_EXPORT void | PrintProgressbar (const int position, const int goal) const |
Private Attributes | |
LibUtilities::SessionReaderSharedPtr | m_session |
The session reader. More... | |
MultiRegions::ExpListSharedPtr | m_field |
The expansion we want to evaluate this function for. More... | |
std::string | m_name |
bool | m_toCache |
Store resulting arrays (and interpolators) More... | |
std::map< std::pair< std::string, int >, NekDouble > | m_lastCached |
Last time the cache for this variable & domain combo was updated. More... | |
std::map< std::string, FieldUtils::Interpolator > | m_interpolators |
Interpolator for pts file input for a variable & domain combination. More... | |
std::map< std::pair< std::string, int >, Array< OneD, NekDouble > > | m_arrays |
Cached result arrays. More... | |
Definition at line 60 of file SessionFunction.h.
Nektar::SolverUtils::SessionFunction::SessionFunction | ( | const LibUtilities::SessionReaderSharedPtr & | session, |
const MultiRegions::ExpListSharedPtr & | field, | ||
std::string | functionName, | ||
bool | toCache = false |
||
) |
Representation of a FUNCTION defined in the session xml file.
Representation of a FUNCTION defined in the session xml file.
session | The session where the function was defined. |
field | The field the function is defined on. |
functionName | The name of the function. |
toCache | Store the evaluated function for later use. |
Definition at line 58 of file SessionFunction.cpp.
References ASSERTL0, m_name, and m_session.
std::string Nektar::SolverUtils::SessionFunction::Describe | ( | std::string | pFieldName, |
const int | domain = 0 |
||
) |
Provide a description of a function for a given field name.
pFieldName | Field name. |
domain | The domain to evaluate the function in. |
Definition at line 210 of file SessionFunction.cpp.
References ASSERTL0, Nektar::LibUtilities::eFunctionTypeExpression, Nektar::LibUtilities::eFunctionTypeFile, Nektar::LibUtilities::eFunctionTypeTransientFile, m_name, and m_session.
void Nektar::SolverUtils::SessionFunction::Evaluate | ( | Array< OneD, Array< OneD, NekDouble > > & | pArray, |
const NekDouble | pTime = 0.0 , |
||
const int | domain = 0 |
||
) |
Evaluates a function defined in the xml session file at each quadrature point.
Evaluates a function defined in the xml session file at each quadrature point.
pArray | The array into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 75 of file SessionFunction.cpp.
References m_session.
Referenced by Evaluate().
void Nektar::SolverUtils::SessionFunction::Evaluate | ( | std::vector< std::string > | pFieldNames, |
Array< OneD, Array< OneD, NekDouble > > & | pArray, | ||
const NekDouble & | pTime = 0.0 , |
||
const int | domain = 0 |
||
) |
Evaluates a function defined in the xml session file at each quadrature point.
Evaluates a function defined in the xml session file at each quadrature point.
pFieldNames | The names of the fields to evaluate the function for. |
pArray | The array into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 95 of file SessionFunction.cpp.
References ASSERTL1, Evaluate(), and m_name.
void Nektar::SolverUtils::SessionFunction::Evaluate | ( | std::vector< std::string > | pFieldNames, |
Array< OneD, MultiRegions::ExpListSharedPtr > & | pFields, | ||
const NekDouble & | pTime = 0.0 , |
||
const int | domain = 0 |
||
) |
Evaluates a function defined in the xml session file at each quadrature point.
Evaluates a function defined in the xml session file at each quadrature point.
pFieldNames | The names of the fields to evaluate the function for. |
pFields | The fields into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 118 of file SessionFunction.cpp.
References ASSERTL0, and Evaluate().
void Nektar::SolverUtils::SessionFunction::Evaluate | ( | std::string | pFieldName, |
Array< OneD, NekDouble > & | pArray, | ||
const NekDouble & | pTime = 0.0 , |
||
const int | domain = 0 |
||
) |
Evaluates a function defined in the xml session file at each quadrature point.
pFieldName | The name of the field to evaluate the function for. |
pArray | The array into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 143 of file SessionFunction.cpp.
References ASSERTL0, Nektar::LibUtilities::eFunctionTypeExpression, Nektar::LibUtilities::eFunctionTypeFile, Nektar::LibUtilities::eFunctionTypeTransientFile, EvaluateExp(), EvaluateFld(), EvaluatePts(), Nektar::NekConstants::kNekZeroTol, m_arrays, m_field, m_lastCached, m_name, m_session, m_toCache, and Vmath::Vcopy().
|
private |
Evaluates a function from expression
pFieldName | The name of the field to evaluate the function for. |
pArray | The array into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 245 of file SessionFunction.cpp.
References m_field, m_name, and m_session.
Referenced by Evaluate().
|
private |
Evaluates a function from fld file
pFieldName | The name of the field to evaluate the function for. |
pArray | The array into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 277 of file SessionFunction.cpp.
References ASSERTL0, Nektar::LibUtilities::FieldIO::CreateForFile(), Nektar::LibUtilities::eFunctionTypeTransientFile, CellMLToNektar.pycml::format, m_field, m_name, m_session, and Nektar::LibUtilities::NullFieldMetaDataMap.
Referenced by Evaluate().
|
private |
Evaluates a function from pts file.
Evaluates a function from pts file
pFieldName | The name of the field to evaluate the function for. |
pArray | The array into which to write the values. |
pTime | The time at which to evaluate the function. |
domain | The domain to evaluate the function in. |
Definition at line 380 of file SessionFunction.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::eFunctionTypeTransientFile, Nektar::LibUtilities::eShepard, CellMLToNektar.pycml::format, Nektar::LibUtilities::PtsIO::Import(), m_field, m_interpolators, m_name, m_session, m_toCache, and PrintProgressbar().
Referenced by Evaluate().
|
inline |
Definition at line 105 of file SessionFunction.h.
|
inline |
Definition at line 100 of file SessionFunction.h.
|
inlineprivate |
Definition at line 144 of file SessionFunction.h.
References Nektar::LibUtilities::PrintProgressbar().
Referenced by EvaluatePts().
|
private |
The expansion we want to evaluate this function for.
Definition at line 114 of file SessionFunction.h.
Referenced by Evaluate(), EvaluateExp(), EvaluateFld(), and EvaluatePts().
|
private |
Interpolator for pts file input for a variable & domain combination.
Definition at line 122 of file SessionFunction.h.
Referenced by EvaluatePts().
|
private |
Last time the cache for this variable & domain combo was updated.
Definition at line 120 of file SessionFunction.h.
Referenced by Evaluate().
|
private |
Definition at line 116 of file SessionFunction.h.
Referenced by Describe(), Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), and SessionFunction().
|
private |
The session reader.
Definition at line 112 of file SessionFunction.h.
Referenced by Describe(), Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), and SessionFunction().
|
private |
Store resulting arrays (and interpolators)
Definition at line 118 of file SessionFunction.h.
Referenced by Evaluate(), and EvaluatePts().