Nektar++
|
#include <Equation.h>
Public Member Functions | |
Equation (const Equation &)=default | |
Equation (InterpreterSharedPtr evaluator, const std::string &expr="", const std::string &vlist="") | |
Equation & | operator= (const Equation &src) |
NekDouble | Evaluate () const |
NekDouble | Evaluate (NekDouble x, NekDouble y=0, NekDouble z=0, NekDouble t=0) const |
void | Evaluate (const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z, Array< OneD, NekDouble > &result) const |
void | Evaluate (const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z, const NekDouble t, Array< OneD, NekDouble > &result) const |
void | Evaluate (const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z, const Array< OneD, const NekDouble > &t, Array< OneD, NekDouble > &result) const |
void | Evaluate (const std::vector< Array< OneD, const NekDouble > > points, Array< OneD, NekDouble > &result) const |
void | SetParameter (const std::string &name, NekDouble value) |
void | SetConstants (const std::map< std::string, NekDouble > &constants) |
std::string | GetExpression (void) const |
std::string | GetVlist (void) const |
NekDouble | GetTime () const |
Returns time spend on expression evaluation at points (it does not include parse/pre-processing time). More... | |
Private Attributes | |
std::string | m_vlist |
std::string | m_expr |
int | m_expr_id |
InterpreterSharedPtr | m_evaluator |
This class stores a string form of a symbolic expression to be evaluated e.g. for the boundary conditions, the unique numeric ID of that expression and a reference to the unique static instance of the Interpreter.
The scenario is that for multiple copies of Equation class holding their symbolic expressions in the std::string form, there is a unique instance of Interpreter, which holds a set of pre-processed symbolic expressions in the form of sequential containers of execution functors, ready for fast evaluation.
The interpreter also keeps all constants and parameters specified in an XML file. There should be only one copy of Equation class per each symbolic expression specified in XML file, modulo possible bugs. Classes Equation and Interpreter are complementary in a sense that the expression ID stored in the Equation class is generated by the Interpreter which holds ordered container of pre-processed expressions.
Definition at line 67 of file Equation.h.
|
default |
Nektar::LibUtilities::Equation::Equation | ( | InterpreterSharedPtr | evaluator, |
const std::string & | expr = "" , |
||
const std::string & | vlist = "" |
||
) |
Definition at line 43 of file BasicUtils/Equation.cpp.
References Nektar::ErrorUtil::efatal, m_evaluator, m_expr, m_expr_id, m_vlist, CellMLToNektar.pycml::msg, and NEKERROR.
NekDouble Nektar::LibUtilities::Equation::Evaluate | ( | ) | const |
Definition at line 93 of file BasicUtils/Equation.cpp.
References Nektar::ErrorUtil::efatal, m_evaluator, m_expr, m_expr_id, CellMLToNektar.pycml::msg, and NEKERROR.
Referenced by Evaluate(), Nektar::SolverUtils::ForcingMovingReferenceFrame::EvaluateExpression(), Nektar::SolverUtils::FilterAeroForces::FilterAeroForces(), Nektar::FilterAeroForcesSPM::FilterAeroForcesSPM(), Nektar::SolverUtils::FilterAverageFields::FilterAverageFields(), Nektar::FilterBenchmark::FilterBenchmark(), Nektar::SolverUtils::FilterBodyFittedVelocity::FilterBodyFittedVelocity(), Nektar::SolverUtils::FilterCheckpoint::FilterCheckpoint(), Nektar::FilterCheckpointCellModel::FilterCheckpointCellModel(), Nektar::FilterElectrogram::FilterElectrogram(), Nektar::SolverUtils::FilterEnergy::FilterEnergy(), Nektar::SolverUtils::FilterEnergy1D::FilterEnergy1D(), Nektar::SolverUtils::FilterError::FilterError(), Nektar::SolverUtils::FilterFieldConvert::FilterFieldConvert(), Nektar::FilterHilbertFFTPhase::FilterHilbertFFTPhase(), Nektar::SolverUtils::FilterHistoryPoints::FilterHistoryPoints(), Nektar::SolverUtils::FilterIntegral::FilterIntegral(), Nektar::SolverUtils::FilterMaxMinFields::FilterMaxMinFields(), Nektar::SolverUtils::FilterMean::FilterMean(), Nektar::SolverUtils::FilterModalEnergy::FilterModalEnergy(), Nektar::SolverUtils::FilterMovingAverage::FilterMovingAverage(), Nektar::FilterMovingBody::FilterMovingBody(), Nektar::FilterOffsetPhase::FilterOffsetPhase(), Nektar::SolverUtils::FilterReynoldsStresses::FilterReynoldsStresses(), Nektar::SolverUtils::FilterThresholdMax::FilterThresholdMax(), Nektar::SolverUtils::FilterThresholdMin::FilterThresholdMin(), Nektar::Extrapolate::GenerateHOPBCMap(), Nektar::SpatialDomains::MeshGraph::ReadExpansionInfo(), Nektar::LibUtilities::SessionReader::ReadParameters(), Nektar::SpatialDomains::MeshGraph::ReadRefinementInfo(), Nektar::MultiRegions::DisContField::v_EvaluateBoundaryConditions(), Nektar::MultiRegions::DisContField3DHomogeneous1D::v_EvaluateBoundaryConditions(), Nektar::MultiRegions::DisContField::v_GetRobinBCInfo(), Nektar::SolverUtils::FilterLagrangianPoints::v_Initialise(), Nektar::IncNavierStokes::v_InitObject(), Nektar::TransMovingWall::v_Update(), Nektar::GlobalMapping::Mapping::v_UpdateBCs(), and Nektar::AcousticSystem::WhiteNoiseBC().
void Nektar::LibUtilities::Equation::Evaluate | ( | const Array< OneD, const NekDouble > & | x, |
const Array< OneD, const NekDouble > & | y, | ||
const Array< OneD, const NekDouble > & | z, | ||
Array< OneD, NekDouble > & | result | ||
) | const |
Definition at line 145 of file BasicUtils/Equation.cpp.
References Evaluate(), and Nektar::UnitTests::z().
void Nektar::LibUtilities::Equation::Evaluate | ( | const Array< OneD, const NekDouble > & | x, |
const Array< OneD, const NekDouble > & | y, | ||
const Array< OneD, const NekDouble > & | z, | ||
const Array< OneD, const NekDouble > & | t, | ||
Array< OneD, NekDouble > & | result | ||
) | const |
Definition at line 163 of file BasicUtils/Equation.cpp.
References Evaluate(), and Nektar::UnitTests::z().
void Nektar::LibUtilities::Equation::Evaluate | ( | const Array< OneD, const NekDouble > & | x, |
const Array< OneD, const NekDouble > & | y, | ||
const Array< OneD, const NekDouble > & | z, | ||
const NekDouble | t, | ||
Array< OneD, NekDouble > & | result | ||
) | const |
Definition at line 154 of file BasicUtils/Equation.cpp.
References Evaluate(), and Nektar::UnitTests::z().
void Nektar::LibUtilities::Equation::Evaluate | ( | const std::vector< Array< OneD, const NekDouble > > | points, |
Array< OneD, NekDouble > & | result | ||
) | const |
Definition at line 177 of file BasicUtils/Equation.cpp.
References Nektar::ErrorUtil::efatal, m_evaluator, m_expr, m_expr_id, CellMLToNektar.pycml::msg, and NEKERROR.
NekDouble Nektar::LibUtilities::Equation::Evaluate | ( | NekDouble | x, |
NekDouble | y = 0 , |
||
NekDouble | z = 0 , |
||
NekDouble | t = 0 |
||
) | const |
Definition at line 119 of file BasicUtils/Equation.cpp.
References Nektar::ErrorUtil::efatal, m_evaluator, m_expr, m_expr_id, CellMLToNektar.pycml::msg, NEKERROR, and Nektar::UnitTests::z().
std::string Nektar::LibUtilities::Equation::GetExpression | ( | void | ) | const |
Definition at line 213 of file BasicUtils/Equation.cpp.
References m_expr.
Referenced by Nektar::Extrapolate::GenerateHOPBCMap().
NekDouble Nektar::LibUtilities::Equation::GetTime | ( | ) | const |
Returns time spend on expression evaluation at points (it does not include parse/pre-processing time).
Definition at line 225 of file BasicUtils/Equation.cpp.
References m_evaluator.
std::string Nektar::LibUtilities::Equation::GetVlist | ( | void | ) | const |
Definition at line 218 of file BasicUtils/Equation.cpp.
References m_vlist.
Definition at line 84 of file BasicUtils/Equation.cpp.
References m_evaluator, m_expr, m_expr_id, and m_vlist.
void Nektar::LibUtilities::Equation::SetConstants | ( | const std::map< std::string, NekDouble > & | constants | ) |
Definition at line 208 of file BasicUtils/Equation.cpp.
References m_evaluator.
Referenced by Equation_SetConstants().
Definition at line 203 of file BasicUtils/Equation.cpp.
References m_evaluator, and CellMLToNektar.pycml::name.
|
private |
Definition at line 122 of file Equation.h.
Referenced by Equation(), Evaluate(), GetTime(), operator=(), SetConstants(), and SetParameter().
|
private |
Definition at line 120 of file Equation.h.
Referenced by Equation(), Evaluate(), GetExpression(), and operator=().
|
private |
Definition at line 121 of file Equation.h.
Referenced by Equation(), Evaluate(), and operator=().
|
private |
Definition at line 119 of file Equation.h.
Referenced by Equation(), GetVlist(), and operator=().