@@ -172,14 +172,11 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
172172 public:
173173
174174 /* *
175- Check if a variable was updated since the last time the input
176- was finalized.
175+ Check if a variable was explicitly updated since the last time
176+ the input was finalized.
177177 \param[in] name Variable name.
178- \param[in] ignoreClassFlag If true, only return true if the
179- specific variable was updated.
180178 */
181- EPHOTO_API bool inputUpdated (const std::string& name,
182- const bool ignoreClassFlag=false ) const ;
179+ EPHOTO_API bool inputUpdated (const std::string& name) const ;
183180 /* *
184181 Throw an error if the named variable was updated.
185182 */
@@ -238,6 +235,8 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
238235 are not stored on Variables instances.
239236 \param[in] subset Subset of parameters to output.
240237 \param[in] additionalVars Map of additional names & values to dump.
238+ \param[in] skip_calculated If true, don't output the calculated
239+ variables.
241240 */
242241 void dump (const std::string& filename,
243242 const bool includeSkipped = false ,
@@ -247,7 +246,8 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
247246 const std::map<std::string, std::string>& key_aliases={},
248247 const std::map<MODULE, const ValueSet_t*>& conditions={},
249248 const std::vector<std::string>& subset={},
250- const std::map<std::string, double >& additionalVars={}) const ;
249+ const std::map<std::string, double >& additionalVars={},
250+ const bool skip_calculated=false ) const ;
251251 /* *
252252 Serialize all parameters attached to this instance to an output
253253 stream.
@@ -263,6 +263,8 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
263263 are not stored on Variables instances.
264264 \param[in] subset Subset of parameters to output.
265265 \param[in] additionalVars Map of additional names & values to dump.
266+ \param[in] skip_calculated If true, don't output the calculated
267+ variables.
266268 \returns Updated output stream.
267269 */
268270 std::ostream& dump (std::ostream& out,
@@ -273,7 +275,8 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
273275 const std::map<std::string, std::string>& key_aliases={},
274276 const std::map<MODULE, const ValueSet_t*>& conditions={},
275277 const std::vector<std::string>& subset={},
276- const std::map<std::string, double >& additionalVars={}) const ;
278+ const std::map<std::string, double >& additionalVars={},
279+ const bool skip_calculated=false ) const ;
277280 /* *
278281 Serialize parameters for a single value set to an output stream.
279282 \param[in] module ID for module that should be serialized.
@@ -649,31 +652,75 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
649652 \param[in] name String identifying the variable.
650653 \param[in] isGlymaID If true, name will be treated as a GlymaID.
651654 If false, name will be treated as the variable name.
655+ \param[in] conditions Map of conditions for composite modules that
656+ are not stored on Variables instances.
652657 \returns Variable value.
653658 */
654659 EPHOTO_API double getVar (const MODULE& mod, const PARAM_TYPE& pt,
655660 const std::string& name,
656- const bool & isGlymaID = false ) const ;
661+ const bool & isGlymaID = false ,
662+ const std::map<MODULE, const ValueSet_t*>& conditions={}) const ;
657663 /* *
658664 Get the value of a variable in a value set.
659665 \param[in] mod Module associated with the value set that the
660666 variable is part of.
661667 \param[in] pt Parameter type associated with the value set that the
662668 variable is part of.
663669 \param[in] key Key identifying the variable.
670+ \param[in] conditions Map of conditions for composite modules that
671+ are not stored on Variables instances.
664672 \returns Variable value.
665673 */
666674 EPHOTO_API double getVar (const MODULE& mod, const PARAM_TYPE& pt,
667- const int & key) const ;
675+ const int & key,
676+ const std::map<MODULE, const ValueSet_t*>& conditions={}) const ;
668677 /* *
669678 Get the value of a variable in a value set.
670679 \param[in] k String identifying the variable.
671680 \param[in] isGlymaID If true, name will be treated as a GlymaID.
672681 If false, name will be treated as the variable name.
682+ \param[in] conditions Map of conditions for composite modules that
683+ are not stored on Variables instances.
673684 \returns Variable value.
674685 */
675686 EPHOTO_API double getVar (const std::string& k,
676- const bool & isGlymaID = false ) const ;
687+ const bool & isGlymaID = false ,
688+ const std::map<MODULE, const ValueSet_t*>& conditions={}) const ;
689+ /* *
690+ Get the value of a calculated quantity using variables from the
691+ current value sets.
692+ \param[in] name String identifying the variable.
693+ \param[in] conditions Map of conditions for composite modules that
694+ are not stored on Variables instances.
695+ \returns Variable value.
696+ */
697+ EPHOTO_API double getVarCalculated (const std::string& name,
698+ const std::map<MODULE, const ValueSet_t*>& conditions={}) const ;
699+
700+ /* *
701+ Get information about the modules required to calculate variables.
702+ These variables can be retrieved via the Variables::getVar,
703+ Variables::getVarCalculated or Variables::getCalculatedVars
704+ methods.
705+ */
706+ EPHOTO_API static const std::map<std::string, std::vector<MODULE> >&
707+ getCalculatedVariableRegistry ();
708+ /* *
709+ Get the set of variable names that can be calculated. These
710+ variables can be retrieved via the Variables::getVar,
711+ Variables::getVarCalculated or Variables::getCalculatedVars
712+ methods.
713+ */
714+ EPHOTO_API const std::vector<std::string>&
715+ getCalculatedVarNames () const ;
716+ /* *
717+ Populate a map with calculated variables.
718+ \param[out] dest Map that should be populated.
719+ \param[in] conditions Map of conditions for composite modules that
720+ are not stored on Variables instances.
721+ */
722+ EPHOTO_API void getCalculatedVars (std::map<std::string, double >& dest,
723+ const std::map<MODULE, const ValueSet_t*>& conditions) const ;
677724 /* *
678725 Get the documentation string for a variable in a value set.
679726 \param[in] mod Module associated with the value set that the
0 commit comments