SpECTRE  v2024.12.16
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Events::ObserveNorms< ObservableTensorTagsList, NonTensorComputeTagsList, ArraySectionIdTag, OptionName > Class Template Reference

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

Detailed Description

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

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

The L2 norm is computed as the RMS, so

L2(u)=1Ni=0Nui2

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)

L2(vk)=1Ni=0N[(vix)2+(viy)2+(viz)2]

The L2 integral norm is:

(1)L2,int(vk)=1VΩ[(vix)2+(viy)2+(viz)2]dV

where V=Ω is the volume of the entire domain in inertial coordinates.

VolumeIntegral only computes the volume integral without any normalization.

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: VolumeIntegral
Components: Sum
- Name: Var1
NormType: L2Norm
Components: Individual
- Name: Var1
NormType: L2IntegralNorm
Components: Individual
- Name: Var1
NormType: VolumeIntegral
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.
Option name
The OptionName template parameter is used to give the event a name in the input file. If it is not specified, the name defaults to "ObserveNorms". If you have multiple ObserveNorms events in the input file, you must specify a unique name for each one. This can happen, for example, if you want to observe norms the full domain and also over a section of the domain.

The documentation for this class was generated from the following file: