OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
ReactionExpression.cpp File Reference

Reaction expression compiler + Tier-1 evaluator — phase R2 body. More...

#include "ReactionExpression.hpp"
#include "../../../data/ReactionData.hpp"
#include <cctype>
#include <cmath>
#include <cstdlib>
Include dependency graph for ReactionExpression.cpp:

Namespaces

namespace  openswmm
 
namespace  openswmm::transport
 

Functions

std::string openswmm::transport::compileReactionExpression (const std::string &src, const RxSymbols &symbols, std::vector< RxToken > &pool, RxExprSpan &out, int &error_col)
 Compile an infix scalar reaction expression into appended stack-machine tokens.
 
double openswmm::transport::evalReactionExpression (const std::vector< RxToken > &pool, const RxExprSpan &span, const RxEvalEnv &env) noexcept
 Evaluate a validated compiled reaction span with stack-local scratch.
 
int openswmm::transport::reactionFunctionCount ()
 Read number of supported compiled scalar function entries.
 
bool openswmm::transport::reactionFunctionInfo (int idx, const char **name, int *arity)
 Read name and argument count of one supported expression function.
 
int openswmm::transport::reactionHydVarCount ()
 Read number of declared hydraulic/thermal/groundwater expression variables.
 
bool openswmm::transport::reactionHydVarInfo (int idx, const char **name, const char **description)
 Read canonical variable name and description including its declared units/support.
 
std::string openswmm::transport::reactionContextDiagnostic (const ReactionData &rx, const std::vector< RxToken > &pool, const RxExprSpan &span, int context)
 Recursively reject hydraulic/species/pollutant references unavailable in one reactor context.
 
bool openswmm::transport::reactionHydVarPopulated (int idx)
 Test the network-quality variable range currently populated by native routing.
 
std::string openswmm::transport::unpopulatedHydVarDiagnostic (const std::string &src, const std::vector< RxToken > &pool, const RxExprSpan &span, int &error_col)
 Report first compiled hydraulic variable not in the network-populated range.
 

Detailed Description

Reaction expression compiler + Tier-1 evaluator — phase R2 body.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0