<commit_before># POD Reduced Basis Surrogate

This example is meant to demonstrate how a POD reduced basis surrogate model is trained
and used on a parametric problem.

## Problem statement

The full-order model is a one energy group, fixed-source diffusion-reaction problem, adopted from [!cite](prince2019parametric).
The geometry for this problem
is presented in [pwr_geom]. The problem has four different material regions, from which
three (1, 2 and 3) act as fixed sources.

!media 2d_multiregion_geometry.png style=display:block;margin-left:auto;margin-right:auto;width:40%;
       id=pwr_geom caption=The geometry of the diffusion-reaction problem used in this example ([!cite](prince2019parametric)).

The fixed-source diffusion-reaction problem with space dependent coefficients can be expressed as:

!equation id=fom_problem
-\nabla \cdot\left[D(\textbf{r})\nabla\psi(\textbf{r})\right]+\Sigma_a(\textbf{r})\psi(\textbf{r}) = q(\textbf{r}) \,, \quad \textbf{r}\in\Omega

where $D(\textbf{r})$ is the diffusion coefficient, $\Sigma_a(\textbf{r})$ is the
reaction coefficient, $q(\textbf{r})$ is the fixed source term and
field variable $\psi(\textbf{r})$ is the solution of interest. Furthermore, $\Omega$
denotes the internal domain, without the boundaries, which can be
partitioned into four sub-domains corresponding to the four material regions ($\Omega_1$, $\Omega_2$, $\Omega_3$ and $\Omega_4$).
This equation needs to be supplemented with boundary conditions.
For the symmetry lines (dashed lines in [pwr_geom], denoted by $\partial\Omega_{sym}$) a homogeneous Neumann condition is used:

!equation
-D(\textbf{r})\nabla\psi(\textbf{r})\cdot \textbf{n}(\textbf{r}) = 0 \,, \quad \textbf{r}\in\partial\Omega_{sym}

while the rest of the boundaries (in the reflector, denoted by $\partial\Omega_{refl}$) are treated with homogeneous
Dirichlet conditions:

!equation
\psi(\textbf{r}) = 0 \,, \quad \textbf{r}\in\partial\Omega_{refl}

This problem is parametric in a sense that the solution depends on the values of the
cross-sections and the source: $\psi = \psi\left(\textbf{r},D(\textbf{r}),\Sigma_a(\textbf{r}),q(\textbf{r})\right)$.
In this example, material region-wise constant cross-sections and source terms are considered
yielding eight uncertain parameters altogether (assuming that Region 4 does not have a source).
The material properties in each region have [Uniform](Uniform.md) distributions ($\mathcal{U}(a,b)$)
specified in [param_distributions] with $a$ and $b$ being the lower and upper bounds.

!table id=param_distributions caption=The distributions of the uncertain parameters used in this problem ([!cite](prince2019parametric)).
| Parameter | Symbol | Distribution |
| :- | - | - | - |
| Diffusion coefficient in Region 1 $\left(cm\right)$ | $D_1$ | $\sim\mathcal{U}(0.2, 0.8)$ |
| Diffusion coefficient in Region 2 $\left(cm\right)$ | $D_2$ | $\sim\mathcal{U}(0.2, 0.8)$ |
| Diffusion coefficient in Region 3 $\left(cm\right)$ | $D_3$ | $\sim\mathcal{U}(0.2, 0.8)$ |
| Diffusion coefficient in Region 4 $\left(cm\right)$ | $D_4$ | $\sim\mathcal{U}(0.15, 0.6)$ |
| Absorption cross-section in Region 1 $\left(cm^{-1}\right)$ | $\Sigma_{a,1}$ | $\sim\mathcal{U}(0.0425, 0.17)$ |
| Absorption cross-section in Region 2 $\left(cm^{-1}\right)$ | $\Sigma_{a,2}$ | $\sim\mathcal{U}(0.065, 0.26)$ |
| Absorption cross-section in Region 3 $\left(cm^{-1}\right)$ | $\Sigma_{a,3}$ | $\sim\mathcal{U}(0.04, 0.16)$ |
| Absorption cross-section in Region 4 $\left(cm^{-1}\right)$ | $\Sigma_{a,4}$ | $\sim\mathcal{U}(0.005, 0.02)$ |
| Fixed-source in Region 1 $\left(\frac{n}{cm^3 \cdot s}\right)$ | $q_1$ | $\sim\mathcal{U}(5, 20)$ |
| Fixed-source in Region 2 $\left(\frac{n}{cm^3 \cdot s}\right)$ | $q_2$ | $\sim\mathcal{U}(5, 20)$ |
| Fixed-source in Region 3 $\left(\frac{n}{cm^3 \cdot s}\right)$ | $q_3$ | $\sim\mathcal{U}(5, 20)$ |

It is important to mention that POD-RB surrogates are only efficient when the original
problem has an affine decomposition. For more information about affine decomposition see<commit_msg>Applied comments on documentation. (#15538)<commit_after># POD Reduced Basis Surrogate

This example is meant to demonstrate how a POD reduced basis surrogate model is trained
and used on a parametric problem.

## Problem statement

The full-order model is a one energy group, fixed-source diffusion-reaction problem, adopted from [!cite](prince2019parametric).
The geometry for this problem
is presented in [pwr_geom]. The problem has four different material regions, from which
three (1, 2 and 3) act as fixed sources.

!media 2d_multiregion_geometry.png style=display:block;margin-left:auto;margin-right:auto;width:40%;
       id=pwr_geom caption=The geometry of the diffusion-reaction problem used in this example ([!cite](prince2019parametric)).

The fixed-source diffusion-reaction problem with space dependent coefficients can be expressed as:

!equation id=fom_problem
-\nabla \cdot\left[D(\textbf{r})\nabla\psi(\textbf{r})\right]+\Sigma_a(\textbf{r})\psi(\textbf{r}) = q(\textbf{r}) \,, \quad \textbf{r}\in\Omega

where $D(\textbf{r})$ is the diffusion coefficient, $\Sigma_a(\textbf{r})$ is the
reaction coefficient, $q(\textbf{r})$ is the fixed source term and
field variable $\psi(\textbf{r})$ is the solution of interest. Furthermore, $\Omega$
denotes the internal domain, without the boundaries, which can be
partitioned into four sub-domains corresponding to the four material regions ($\Omega_1$, $\Omega_2$, $\Omega_3$ and $\Omega_4$).
This equation needs to be supplemented with boundary conditions.
For the symmetry lines (dashed lines in [pwr_geom], denoted by $\partial\Omega_{sym}$) a homogeneous Neumann condition is used:

!equation
-D(\textbf{r})\nabla\psi(\textbf{r})\cdot \textbf{n}(\textbf{r}) = 0 \,, \quad \textbf{r}\in\partial\Omega_{sym}

while the rest of the boundaries (in the reflector, denoted by $\partial\Omega_{refl}$) are treated with homogeneous
Dirichlet conditions:

!equation
\psi(\textbf{r}) = 0 \,, \quad \textbf{r}\in\partial\Omega_{refl}

This problem is parametric in a sense that the solution depends on the values of the
coefficients and the source: $\psi = \psi\left(\textbf{r},D(\textbf{r}),\Sigma_a(\textbf{r}),q(\textbf{r})\right)$.
In this example, material region-wise constant coefficients and source terms are considered
yielding eight uncertain parameters altogether (assuming that Region 4 does not have a source).
The material properties in each region have [Uniform](Uniform.md) distributions ($\mathcal{U}(a,b)$)
specified in [param_distributions] with $a$ and $b$ being the lower and upper bounds.

!table id=param_distributions caption=The distributions of the uncertain parameters used in this problem ([!cite](prince2019parametric)).
| Parameter | Symbol | Distribution |
| :- | - | - | - |
| Diffusion coefficient in Region 1 $\left(cm\right)$ | $D_1$ | $\sim\mathcal{U}(0.2, 0.8)$ |
| Diffusion coefficient in Region 2 $\left(cm\right)$ | $D_2$ | $\sim\mathcal{U}(0.2, 0.8)$ |
| Diffusion coefficient in Region 3 $\left(cm\right)$ | $D_3$ | $\sim\mathcal{U}(0.2, 0.8)$ |
| Diffusion coefficient in Region 4 $\left(cm\right)$ | $D_4$ | $\sim\mathcal{U}(0.15, 0.6)$ |
| Reaction coefficient in Region 1 $\left(cm^{-1}\right)$ | $\Sigma_{a,1}$ | $\sim\mathcal{U}(0.0425, 0.17)$ |
| Reaction coefficient in Region 2 $\left(cm^{-1}\right)$ | $\Sigma_{a,2}$ | $\sim\mathcal{U}(0.065, 0.26)$ |
| Reaction coefficient in Region 3 $\left(cm^{-1}\right)$ | $\Sigma_{a,3}$ | $\sim\mathcal{U}(0.04, 0.16)$ |
| Reaction coefficient in Region 4 $\left(cm^{-1}\right)$ | $\Sigma_{a,4}$ | $\sim\mathcal{U}(0.005, 0.02)$ |
| Fixed-source in Region 1 $\left(\frac{n}{cm^3 \cdot s}\right)$ | $q_1$ | $\sim\mathcal{U}(5, 20)$ |
| Fixed-source in Region 2 $\left(\frac{n}{cm^3 \cdot s}\right)$ | $q_2$ | $\sim\mathcal{U}(5, 20)$ |
| Fixed-source in Region 3 $\left(\frac{n}{cm^3 \cdot s}\right)$ | $q_3$ | $\sim\mathcal{U}(5, 20)$ |

It is important to mention that POD-RB surrogates are only efficient when the original
problem has an affine decomposition. For more information about affine decomposition see
{'fraction_non_alphanumeric': 0.15638875185002465, 'fraction_numerical': 0.027257030093734584, 'mean_word_length': 4.884615384615385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2774617', 'n_tokens_mistral': 2656, 'n_tokens_neox': 2460, 'n_words': 855}