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< std::vector< MultiRegions::ExpListSharedPtr > > > | 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 59 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 57 of file Core/SessionFunction.cpp.
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 216 of file Core/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 76 of file Core/SessionFunction.cpp.
References Evaluate(), and m_session.
Referenced by 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 150 of file Core/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().
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 96 of file Core/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 119 of file Core/SessionFunction.cpp.
References ASSERTL0, and Evaluate().
|
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 251 of file Core/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 282 of file Core/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 383 of file Core/SessionFunction.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::Interpolator::CalcWeights(), Nektar::LibUtilities::eFunctionTypeTransientFile, Nektar::LibUtilities::eShepard, CellMLToNektar.pycml::format, Nektar::LibUtilities::PtsIO::Import(), Nektar::FieldUtils::Interpolator< T >::Interpolate(), m_field, m_interpolators, m_name, m_session, m_toCache, PrintProgressbar(), Nektar::LibUtilities::Interpolator::PrintStatistics(), and Nektar::LibUtilities::Interpolator::SetProgressCallback().
Referenced by Evaluate().
|
inline |
Definition at line 104 of file SessionFunction.h.
References m_field.
|
inline |
Definition at line 99 of file SessionFunction.h.
References m_session.
|
inlineprivate |
Definition at line 145 of file SessionFunction.h.
References Nektar::LibUtilities::PrintProgressbar().
Referenced by EvaluatePts().
|
private |
The expansion we want to evaluate this function for.
Definition at line 113 of file SessionFunction.h.
Referenced by Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), and GetExpansion().
|
private |
Interpolator for pts file input for a variable & domain combination.
Definition at line 123 of file SessionFunction.h.
Referenced by EvaluatePts().
|
private |
Last time the cache for this variable & domain combo was updated.
Definition at line 119 of file SessionFunction.h.
Referenced by Evaluate().
|
private |
Definition at line 115 of file SessionFunction.h.
Referenced by Describe(), Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), and SessionFunction().
|
private |
The session reader.
Definition at line 111 of file SessionFunction.h.
Referenced by Describe(), Evaluate(), EvaluateExp(), EvaluateFld(), EvaluatePts(), GetSession(), and SessionFunction().
|
private |
Store resulting arrays (and interpolators)
Definition at line 117 of file SessionFunction.h.
Referenced by Evaluate(), and EvaluatePts().