@@ -83,7 +83,7 @@ \subsection{Generic Interface}
8383the GenericCode interface can be invoked using the \xmlNode {outputFile}
8484node in which the output file name (CSV only) must be specified.
8585For example, in the previous example, say instead of \texttt {-a gen.two } and \texttt {-o myOut }
86- in the command line, the code always produce a CSV file named
`` [email protected] '' ;
86+ in the command line, the code always produce a CSV file named
`` [email protected] '' ;
8787
8888Then, our example XML for the code would be
8989
@@ -134,9 +134,9 @@ \subsection{RAVEN Interface}
134134\label {subsec:RAVENInterface }
135135The RAVEN interface is meant to provide the possibility to execute a RAVEN input file
136136driving a set of SLAVE RAVEN calculations. For example, if the user wants to optimize the parameters
137- of a surrogate model (e.g. minimizing the distance between the surrogate predictions and the real data), he
137+ of a surrogate model (e.g. minimizing the distance between the surrogate predictions and the real data), he
138138can achieve this task by setting up a RAVEN input file (master) that performs an optimization on the feature
139- space characterized by the surrogate model parameters, whose training and validation assessment is performed in the SLAVE
139+ space characterized by the surrogate model parameters, whose training and validation assessment is performed in the SLAVE
140140RAVEN runs.
141141\\ There are some limitations for this interface:
142142\begin {itemize }
@@ -150,7 +150,7 @@ \subsection{RAVEN Interface}
150150\\ Similarly to any other code interface, the user provides paths to executables and aliases for sampled variables within the
151151\xmlNode {Models} block. The \xmlNode {Code} block will contain attributes \xmlAttr {name} and
152152\xmlAttr {subType}. \xmlAttr {name} identifies that particular \xmlNode {Code} model within RAVEN, and
153- \xmlAttr {subType} specifies which code interface the model will use (In this case \xmlAttr {subType}=`` RAVEN'' ).
153+ \xmlAttr {subType} specifies which code interface the model will use (In this case \xmlAttr {subType}=`` RAVEN'' ).
154154The \xmlNode {executable}
155155block should contain the absolute or relative (with respect to the current working
156156directory) path to the RAVEN framework script (\textbf {raven\_ framework }).
@@ -167,45 +167,45 @@ \subsection{RAVEN Interface}
167167 \ begin{lstlisting} [language=python]
168168def manipulateScalarSampledVariables(sampledVariables):
169169 """
170- This method is aimed to manipulate scalar variables.
171- The user can create new variables based on the
170+ This method is aimed to manipulate scalar variables.
171+ The user can create new variables based on the
172172 variables sampled by RAVEN
173- @ In, sampledVariables, dict, dictionary of
173+ @ In, sampledVariables, dict, dictionary of
174174 sampled variables ({"var1":value1,"var2":value2})
175- @ Out, None, the new variables should be
175+ @ Out, None, the new variables should be
176176 added in the "sampledVariables" dictionary
177177 """
178- newVariableValue =
179- sampledVariables['Distributions|Uniform@name:a_dist|lowerBound']
178+ newVariableValue =
179+ sampledVariables['Distributions|Uniform@name:a_dist|lowerBound']
180180 + 1.0
181- sampledVariables['Distributions|Uniform@name:a_dist|upperBound'] =
181+ sampledVariables['Distributions|Uniform@name:a_dist|upperBound'] =
182182 newVariableValue
183183 return
184184 \end {lstlisting }
185185
186- \item \textbf {\textit {convertNotScalarSampledVariables } }, a method that is aimed to convert not scalar variables (e.g. 1D arrays) into multiple scalar variables
186+ \item \textbf {\textit {convertNotScalarSampledVariables } }, a method that is aimed to convert not scalar variables (e.g. 1D arrays) into multiple scalar variables
187187 (e.g. \xmlNode {constant}(s) in a sampling strategy).
188- This method is going to be required in case not scalar variables are detected by the interface.
188+ This method is going to be required in case not scalar variables are detected by the interface.
189189 Example:
190190 \ begin{lstlisting} [language=python]
191191 def convertNotScalarSampledVariables(noScalarVariables):
192192 """
193- This method is aimed to convert not scalar
193+ This method is aimed to convert not scalar
194194 variables into multiple scalar variables. The user MUST
195195 create new variables based on the not Scalar Variables
196196 sampled (and passed in) by RAVEN
197- @ In, noScalarVariables, dict, dictionary of sampled
197+ @ In, noScalarVariables, dict, dictionary of sampled
198198 variables that are not scalar ({"var1":1Darray1,"var2":1Darray2})
199- @ Out, newVars, dict, the new variables that have
200- been created based on the not scalar variables
199+ @ Out, newVars, dict, the new variables that have
200+ been created based on the not scalar variables
201201 contained in "noScalarVariables" dictionary
202202 """
203203 oneDimensionalArray =
204204 noScalarVariables['temperatureHistory']
205205 newVars = {}
206206 for cnt, value in enumerate(oneDimensionalArray):
207207 newVars['Samplers|MonteCarlo@name:myMC|constant'+
208- '@name=temperatureHistory'+str(cnt)] =
208+ '@name=temperatureHistory'+str(cnt)] =
209209 oneDimensionalArray[cnt]
210210 return newVars
211211 \end {lstlisting }
@@ -225,7 +225,7 @@ \subsection{RAVEN Interface}
225225 </Code>
226226\end {lstlisting }
227227
228- Like for every other interface, the syntax of the variable names is important to make the parser understand how to perturb an input file.
228+ Like for every other interface, the syntax of the variable names is important to make the parser understand how to perturb an input file.
229229\\ For the RAVEN interface, a syntax inspired by the XPath nomenclature is used.
230230\ begin{lstlisting} [style=XML]
231231 <Samplers>
@@ -251,7 +251,7 @@ \subsection{RAVEN Interface}
251251\ begin{lstlisting} [style=XML]
252252 <Models>
253253 <ROM name="ROM1" subType="SciKitLearn">
254- ...
254+ ...
255255 <C>10.0</C>
256256 ...
257257 </ROM>
@@ -261,7 +261,7 @@ \subsection{RAVEN Interface}
261261\ begin{lstlisting} [style=XML]
262262 <Models>
263263 <ROM name="ROM1" subType="SciKitLearn">
264- ...
264+ ...
265265 <tol>0.0001</tol>
266266 ...
267267 </ROM>
@@ -275,9 +275,9 @@ \subsection{RAVEN Interface}
275275 <variable name="var1">
276276 ...
277277 <grid construction="equal" type="value" steps="1">0 1</grid>
278- ...
278+ ...
279279 </variable>
280-
280+
281281 ...
282282 </MonteCarlo>
283283 </Samplers>
@@ -295,6 +295,12 @@ \subsection{RAVEN Interface}
295295</Files>
296296\end {lstlisting }
297297
298+ \subsubsection {ExternalXML and RAVEN interface }
299+ Care must be taken if the SLAVE RAVEN uses \xmlNode {ExternalXML} nodes. In this case, each file containing
300+ external XML nodes must be added in the \xmlNode {Step} as an \xmlNode {Input} class \xmlAttr {Files} to make sure it gets copied to
301+ the individual run directory. The type for these files can be anything, with the exception of type
302+ \xmlString {raven}.
303+
298304% %%%%%%%%%%%%%%%%%%%%%%%%%%%
299305% %%%%% RELAP5 INTERFACE %%%%%%
300306% %%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1303,20 +1309,20 @@ \subsubsection{Models}
13031309 ...
13041310</Simulation>
13051311\end {lstlisting }
1306- RAVEN works best with Comma-Separated Value (CSV) files. Therefore, the default
1312+ RAVEN works best with Comma-Separated Value (CSV) files. Therefore, the default
13071313.mat output type needs to be converted to .csv output.
1308- The Dymola interface will automatically convert the .mat output to human-readable
1314+ The Dymola interface will automatically convert the .mat output to human-readable
13091315forms, i.e., .csv output, through its implementation of the finalizeCodeOutput function.
13101316\\ In order to speed up the reading and conversion of the .mat file, the user can specify
1311- the list of variables (in addition to the Time variable) that need to be imported and
1312- converted into a csv file minimizing
1313- the IO memory usage as much as possible. Within the \xmlNode {Code} the following
1314- XML
1317+ the list of variables (in addition to the Time variable) that need to be imported and
1318+ converted into a csv file minimizing
1319+ the IO memory usage as much as possible. Within the \xmlNode {Code} the following
1320+ XML
13151321node (in addition ot the \xmlNode {executable} one) can be inputted:
13161322
13171323\begin {itemize }
1318- \item \xmlNode {outputVariablesToLoad}, \xmlDesc {space separated list, optional
1319- parameter}, a space separated list of variables that need be exported from the .mat
1324+ \item \xmlNode {outputVariablesToLoad}, \xmlDesc {space separated list, optional
1325+ parameter}, a space separated list of variables that need be exported from the .mat
13201326 file (in addition to the Time variable). \default {all the variables in the .mat file}.
13211327\end {itemize }
13221328For example:
0 commit comments