@@ -149,12 +149,17 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
149149
150150 protected:
151151 static void _initStaticMembers ();
152-
152+
153+ /* *
154+ Copy non-member attributes.
155+ \param[in] other Variables instance to copy.
156+ */
157+ void __copyNonMembers (const Variables& other);
153158 /* *
154159 Copy additional members.
155160 Some variables are not included in the default copy (e.g. alfa,
156161 fc, lightParam, CO2A, RedoxReg_MP, module *_Param values, &
157- rates). To include these, use deepcopy.
162+ rates). To include these, use deepcopy (or __copyNonMembers) .
158163 \param[in] other Variables instance to copy.
159164 */
160165 void __copyMembers (const Variables& other) override ;
@@ -166,16 +171,37 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
166171 bool noChildren = false ) const override ;
167172 public:
168173
174+ /* *
175+ Check if a variable was updated since the last time the input
176+ was finalized.
177+ \param[in] name Variable name.
178+ \param[in] ignoreClassFlag If true, only return true if the
179+ specific variable was updated.
180+ */
181+ EPHOTO_API bool inputUpdated (const std::string& name,
182+ const bool ignoreClassFlag=false ) const ;
183+ /* *
184+ Throw an error if the named variable was updated.
185+ */
186+ EPHOTO_API void assertCalcNotUpdated (const std::string& name) const ;
169187 /* *
170188 Finalize variables read from input including any unit changes.
189+ \param[in] dontReset If true, don't set the inputsFinalized flag
190+ to true or clear inputsUpdated.
171191 */
172- EPHOTO_API void finalizeInputs ();
192+ EPHOTO_API void finalizeInputs (const bool dontReset= false );
173193 /* *
174194 Create a deep copy of this instance including variables excluded
175195 from a default copy.
176196 \returns New instance with all parameters copied.
177197 */
178198 EPHOTO_API Variables* deepcopy () const ;
199+ /* *
200+ Copy another instance including variables excluded from a default
201+ copy.
202+ \param[in] Instance to copy.
203+ */
204+ EPHOTO_API void deepcopy (const Variables& rhs);
179205 /* * \copydoc ValueSet::equals */
180206 bool equals (const ValueSet_t& b,
181207 const bool noChildren = false ) const override ;
@@ -211,6 +237,7 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
211237 \param[in] conditions Map of conditions for composite modules that
212238 are not stored on Variables instances.
213239 \param[in] subset Subset of parameters to output.
240+ \param[in] additionalVars Map of additional names & values to dump.
214241 */
215242 void dump (const std::string& filename,
216243 const bool includeSkipped = false ,
@@ -219,7 +246,8 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
219246 const std::vector<std::string>& skip_keys={},
220247 const std::map<std::string, std::string>& key_aliases={},
221248 const std::map<MODULE, const ValueSet_t*>& conditions={},
222- const std::vector<std::string>& subset={}) const ;
249+ const std::vector<std::string>& subset={},
250+ const std::map<std::string, double >& additionalVars={}) const ;
223251 /* *
224252 Serialize all parameters attached to this instance to an output
225253 stream.
@@ -234,6 +262,7 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
234262 \param[in] conditions Map of conditions for composite modules that
235263 are not stored on Variables instances.
236264 \param[in] subset Subset of parameters to output.
265+ \param[in] additionalVars Map of additional names & values to dump.
237266 \returns Updated output stream.
238267 */
239268 std::ostream& dump (std::ostream& out,
@@ -243,7 +272,8 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
243272 const std::vector<std::string>& skip_keys={},
244273 const std::map<std::string, std::string>& key_aliases={},
245274 const std::map<MODULE, const ValueSet_t*>& conditions={},
246- const std::vector<std::string>& subset={}) const ;
275+ const std::vector<std::string>& subset={},
276+ const std::map<std::string, double >& additionalVars={}) const ;
247277 /* *
248278 Serialize parameters for a single value set to an output stream.
249279 \param[in] module ID for module that should be serialized.
@@ -810,6 +840,7 @@ class Variables : public VALUE_SET_PARENT(Variables, Variables, MODULE_ALL, PARA
810840 EPHOTO_API void readGRN (const std::string& fname);
811841
812842 bool inputsFinalized = false ;
843+ std::map<std::string, bool > inputsUpdated; /* *< Name of variables that were updated after inputs were finalized. */
813844 bool record = false ;
814845 int GP = 0 ;
815846 int GRNC = 0 ; /* *< Control parameter; if 1, VfactorCp values will be used to scale enzyme activities in the PS, PR, & SUCS modules when CO2 > 0 */
0 commit comments