Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdomain basic statistics . #2119

Merged
merged 12 commits into from
May 25, 2023
14 changes: 11 additions & 3 deletions doc/user_manual/PostProcessors/BasicStatistics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ \subsubsection{BasicStatistics}
\textit{\textbf{Interfaced}} post-processor of type \textbf{HistorySetSync}).
\end{itemize}
%
\ppType{BasicStatistics post-processor}{BasicStatistics}

\newcommand{\basicStatisticsBody}
{
\begin{itemize}
\item \xmlNode{"metric"}, \xmlDesc{comma separated string or node list, required field},
specifications for the metric to be calculated. The name of each node is the requested metric. There are
Expand Down Expand Up @@ -123,7 +125,7 @@ \subsubsection{BasicStatistics}
computed and stored in the given \textbf{DataSet}, and the users do not need to specify these quantities in their RAVEN input files.
%
\item \xmlNode{pivotParameter}, \xmlDesc{string, optional field}, name of the parameter that needs
to be used for the computation of the Dynamic BasicStatistics (e.g. time). This node needs to
to be used for the computation of the Dynamic statistics (e.g. time). This node needs to
be inputted just in case an \textbf{HistorySet} is used as Input. It represents the reference
monotonic variable based on which the statistics is going to be computed (e.g. time-dependent
statistical moments).
Expand All @@ -146,7 +148,7 @@ \subsubsection{BasicStatistics}
\item vector metrics, such as \xmlNode{covariance} and \xmlNode{sensitivity}, are requested, the index variables
\xmlString{targets} and \xmlString{features} will be required.
\item If \xmlNode{percentile} is requested, an additional index variable \xmlString{percent} should be added.
\item when dynamic BasicStatistics (e.g. time) is requested, the index variable \xmlString{time} will be required.
\item when dynamic statistics (e.g. time) is requested, the index variable \xmlString{time} will be required.
\end{itemize}
\default{False}
%
Expand All @@ -164,6 +166,12 @@ \subsubsection{BasicStatistics}
\textbf{Example (Static Statistics):} This example demonstrates how to request the expected value of
\xmlString{x01} and \xmlString{x02}, along with the sensitivity of both \xmlString{x01} and \xmlString{x02} to
\xmlString{a} and \xmlString{b}.
}

% in the following we have the description of the statistics
\ppType{BasicStatistics post-processor}{BasicStatistics}
\basicStatisticsBody

\begin{lstlisting}[style=XML,morekeywords={name,subType,debug}]
<Simulation>
...
Expand Down
112 changes: 112 additions & 0 deletions doc/user_manual/PostProcessors/SubdomainBasicStatistics.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
\subsubsection{SubdomainBasicStatistics}
\label{SubdomainBasicStatistics}
The \textbf{SubdomainBasicStatistics} post-processor is aimed to allow the \textbf{BasicStatistics}
post-processor to be used on subdomains of the sampling space. This post-processor fully leverages
the \textbf{BasicStatistics} post-processor and, consequentially, computes many of the most important statistical quantities on
a mesh/grid (subdomains).
Similarly to the \textbf{BasicStatistics}, the post-processor can accept as input both \textit{\textbf{PointSet}}
and \textit{\textbf{HistorySet}}.

\ppType{SubdomainBasicStatistics post-processor}{SubdomainBasicStatistics}

\begin{itemize}
\item \xmlNode{"subdomain"}, \xmlDesc{XML node, required parameter}, definition of the subdomain grid. This node
can specify the following XML node:
\begin{itemize}
\item \xmlNode{variable}, \xmlDesc{XML node, required parameter} can specify the \xmlAttr{name} attribute, which is \xmlDesc{required string attribute} and specifies the user-defined name of this variable.
\variableChildrenIntro
\begin{itemize}
\item \gridDescriptionNoCFD
\end{itemize}
\end{itemize}
\end{itemize}

Based on the definition above, the post-processor will compute \textbf{BasicStatistics} on each ``cell'' defined
by the discretization grid. The results will be exported as function of the variables used
in the definition of the grid (see below for a detailed example).

In addition to the subdomain grid defined above, the same nodes/settings available for \textbf{BasicStatistics}
are available:

\basicStatisticsBody

\textbf{Example (Static Subdomain Statistics):}
\begin{lstlisting}[style=XML,morekeywords={name,subType,debug}]
<Simulation>
...
<Models>
...
<PostProcessor name='aUserDefinedName' subType='SubdomainBasicStatistics' verbosity='debug'>
<subdomain>
<variable name="a">
<grid construction="equal" steps="2" type="value">10 100</grid>
</variable>
<variable name="b">
<grid construction="equal" steps="1" type="value">10 50</grid>
</variable>
</subdomain>
<expectedValue prefix='mean'>x01,x02</expectedValue>
<sensitivity prefix='sen'>
<targets>x01,x02</targets>
<features>a,b</features>
</sensitivity>
</PostProcessor>
...
</Models>
...
<PointSet name='statsOut'>
<Input>
a,b
</Input>
<Output>
mean_x01,mean_x02,
sen_x01_a, sen_x01_b,
sen_x02_a, sen_x02_b
</Output>
</PointSet>
</Simulation>
\end{lstlisting}

In this case, the RAVEN variables ``mean\_x01, mean\_x02, sen\_x01\_a, sen\_x02\_a, sen\_x01\_b, sen\_x02\_b''
will be computed for each cell defined above (2 cells in this case).
The results will be associated to the mid-point of each cell. For the example above:
\begin{itemize}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be:
\item $(a=40.0,b=30.0)$
\item $(a=70.0,b=30.0)$
no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interval of the fist grid is
[10,100] with 2 steps:
|---------|---------|
10 55 100
midpoints:
------|--------|------
32.5 77.5

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha

\item $(a=32.5,b=30.0)$
\item $(a=77.5,b=30.0)$
\end{itemize}
The results will be then accessible for the RAVEN entities \textbf{DataObjects} and \textbf{OutStreams}.

\textbf{Example (Dynamic Subdomain Statistics):}

\begin{lstlisting}[style=XML,morekeywords={name,subType,debug}]
<Simulation>
...
<Models>
...
<PostProcessor name='aUserDefinedNameForDynamicPP' subType='BasicStatistics' verbosity='debug'>
<expectedValue prefix='mean'>x01,x02</expectedValue>
<sensitivity prefix='sen'>
<targets>x01,x02</targets>
<features>a,b</features>
</sensitivity>
<pivotParameter>time</pivotParameter>
</PostProcessor>
...
</Models>
...
<HistorySet name='basicStatHistorySet'>
<Input>
a,b
</Input>
<Output>
mean_x01,mean_x02,
sen_x01_a, sen_x01_b,
sen_x02_a, sen_x02_b
</Output>
<options>
<pivotParameter>time</pivotParameter>
</options>
</HistorySet>
</Simulation>
\end{lstlisting}

4 changes: 4 additions & 0 deletions doc/user_manual/postprocessor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ \subsection{PostProcessor}
\begin{itemize}
\itemsep0em
\item \textbf{BasicStatistics}
\item \textbf{SubdomainBasicStatistics}
\item \textbf{ComparisonStatistics}
\item \textbf{ImportanceRank}
\item \textbf{SafestPoint}
Expand Down Expand Up @@ -69,6 +70,9 @@ \subsection{PostProcessor}
%%%%% PP BasicStatistics %%%%%%%
\input{PostProcessors/BasicStatistics.tex}

%%%%% PP SubdomainBasicStatistics %%%%%%%
\input{PostProcessors/SubdomainBasicStatistics.tex}

%%%%% PP ComparisonStatistics %%%%%%%
\input{PostProcessors/ComparisonStatistics.tex}

Expand Down
13 changes: 13 additions & 0 deletions doc/user_manual/raven_user_manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@

\usepackage{listings}

% the following allows for 8 levels list nesting
\usepackage{enumitem}
\setlistdepth{8}
\setlist[itemize,1]{label=$\bullet$}
\setlist[itemize,2]{label=$\bullet$}
\setlist[itemize,3]{label=$\bullet$}
\setlist[itemize,4]{label=$\bullet$}
\setlist[itemize,5]{label=$\bullet$}
\setlist[itemize,6]{label=$\bullet$}
\setlist[itemize,7]{label=$\bullet$}
\setlist[itemize,8]{label=$\bullet$}
\renewlist{itemize}{itemize}{8}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this added code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment at the begin of the command:
the following allows for 8 levels list nesting

This allows to add an additional level of nesting for the "itemize" command

% Python style for highlighting
\newcommand\pythonstyle{\lstset{
language=Python,
Expand Down
43 changes: 43 additions & 0 deletions doc/user_manual/sampler.tex
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,34 @@ \section{Samplers}
code will raise an error.
\end{itemize}
}
\newcommand{\constructionGridDescriptionNoCFD}
{
Based on the \xmlAttr{construction} type, the content of the \xmlNode{grid}
XML node and the requirements for other attributes change:
\begin{itemize}
\item \xmlAttr{construction}\textbf{\texttt{=}}\xmlString{equal}.
The grid is going to be constructed equally-spaced
(\xmlAttr{type}\textbf{\texttt{=}}\xmlString{value}).
This construction type requires the definition of additional attributes:
\begin{itemize}
\item \xmlAttr{steps}, \xmlDesc{required integer attribute}, number
of equally spaced/probable discretization steps.
\end{itemize}
This construction type requires that the content of the \xmlNode{grid}
node represents the lower and upper bounds (either
in probability or value). Two values need to be specified; the lowest one
will be considered as the $lowerBound$, the largest, the $upperBound$.
The $stepSize$ is determined as follows:
\\ $stepSize=(upperBound - lowerBound)/steps$
\item \xmlAttr{construction}\textbf{\texttt{=}}\xmlString{custom}.
The grid will be directly specified by the user.
No additional attributes are needed.
This construction type requires that the \xmlNode{grid} node contains
the actual mesh bins.
For example, if the grid \xmlAttr{type} is \xmlString{value}, in the body
of \xmlNode{grid}, the user will specify the values representing the nodes of the grid.
\end{itemize}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this description needed in sampler.tex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah probably not the right location. Moved to postprocessors.tex

\newcommand{\variableDescription}
{
\xmlNode{variable}, \xmlDesc{XML node, required parameter} can specify the following attribute:
Expand Down Expand Up @@ -234,6 +262,21 @@ \section{Samplers}
information is requested.}
}

\newcommand{\gridDescriptionNoCFD}
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does CFD stand for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. CFD -> CDF (Cumulative Dist Function)

\xmlNode{grid}, \xmlDesc{space separated floats, required
field}, the content of this XML node allows for a type of the grid only:
\begin{itemize}
\itemsep0em
\item \xmlAttr{type}, \xmlDesc{required string attribute}, user-defined
discretization metric type: 1) \xmlString{value}, the grid will be provided
using variable values.
\item \xmlAttr{construction}, \xmlDesc{required string attribute}, how
the grid needs to be constructed, independent of its type.
\end{itemize}
\constructionGridDescriptionNoCFD
}

\newcommand{\convergenceDescription}
{
\xmlNode{Convergence}, \xmlDesc{float, required field}, Convergence
Expand Down
Loading