SpECTRE  v2022.05.05
Events::ObserveNorms< ObservationValueTag, ObservableTensorTagsList, NonTensorComputeTagsList, ArraySectionIdTag > Class Template Reference

Compute norms of tensors in the DataBox and write them to disk. More...

## Detailed Description

template<typename ObservationValueTag, typename ObservableTensorTagsList, typename NonTensorComputeTagsList = tmpl::list<>, typename ArraySectionIdTag = void>
class Events::ObserveNorms< ObservationValueTag, ObservableTensorTagsList, NonTensorComputeTagsList, ArraySectionIdTag >

Compute norms of tensors in the DataBox and write them to disk.

The L2 norm is computed as the RMS, so

\begin{align*} L_2(u)=\sqrt{\frac{1}{N}\sum_{i=0}^{N} u_i^2} \end{align*}

where $$N$$ is the number of grid points.

The norm can be taken for each individual component, or summed over components. For the max/min it is then the max/min over all components, while for the L2 norm we have (for a 3d vector, 2d and 1d are similar)

\begin{align*} L_2(v^k)=\sqrt{\frac{1}{N}\sum_{i=0}^{N} \left[(v^x_i)^2 + (v^y_i)^2 + (v^z_i)^2\right]} \end{align*}

The L2 integral norm is:

\begin{equation} L_{2,\mathrm{int}}(v^k) = \sqrt{\frac{1}{V}\int_\Omega \left[ (v^x_i)^2 + (v^y_i)^2 + (v^z_i)^2\right] \mathrm{d}V} \end{equation}

where $$V=\int_\Omega$$ is the volume of the entire domain in inertial coordinates.

Note
The integral norm does not currently work with a Spectral::Basis::FiniteDifference mesh because definite_integral does not support it.

Here is an example of an input file:

R"(
ObserveNorms:
SubfileName: reduction0
TensorsToObserve:
- Name: Var0
NormType: Max
Components: Individual
- Name: Var1
NormType: Min
Components: Individual
- Name: Var0
NormType: Max
Components: Sum
- Name: Var0TimesTwo
NormType: Max
Components: Individual
- Name: Var0TimesThree
NormType: Max
Components: Individual
- Name: Var1
NormType: L2Norm
Components: Sum
- Name: Var1
NormType: L2IntegralNorm
Components: Sum
- Name: Var1
NormType: L2Norm
Components: Individual
- Name: Var1
NormType: L2IntegralNorm
Components: Individual
- Name: Var1
NormType: Min
Components: Sum
)");
Note
The NonTensorComputeTags are intended to be used for Variables compute tags like Tags::DerivCompute
Array sections
This event supports sections (see Parallel::Section). Set the ArraySectionIdTag template parameter to split up observations into subsets of elements. The observers::Tags::ObservationKey<ArraySectionIdTag> must be available in the DataBox. It identifies the section and is used as a suffix for the path in the output file.

The documentation for this class was generated from the following file:
• src/ParallelAlgorithms/Events/ObserveNorms.hpp