Edit me

Norms Summary

Few different norms are predefined in this application. Following table summarize supported variable types for each norm.

  Double Array 3D Vector Matrix
Value [x]      
Magnitude [x] [x] [x] [x]
Euclidean   [x] [x]  
Infinity   [x] [x] [x]
P-Norm   [x] [x] [x]
Lpq-Norm       [x]
Frobenius       [x]
Trace       [x]
Index     [x] [x]
Component   [x]    

Supported methods summary

All of the value methods mentioned in Statistical Methods supports norm version of it, in these methods, higher dimensional values are transformed in to scalar values by a use specified norm, and then statistics are calculated based on the chosen method. Supported norm types may differ based on the variable data type being used. There are few methods, which only supports norm methods. Following table summarize availability of value and norm methods.

Statistical Methods Value Method Norm Method
Sum [x] [x]
Mean [x] [x]
Root mean square [x] [x]
Variance [x] [x]
Min   [x]
Max   [x]
Median   [x]
Distribution   [x]

Example

Following example shows variance method, under value category and norm category for nodal non historical velocity. Norm method uses "magnitude" as the norm to reduce VELOCITY to a scalar value. value_mean and value_variance will be of Array 3D type, whereas norm_mean and norm_variance will be of Double type.

import KratosMultiphysics as Kratos
import KratosMultiphysics.StatisticsApplication as KratosStats
model = Kratos.Model()
model_part = model.CreateModelPart("test_model_part")
value_mean, value_variance = KratosStats.SpatialMethods.NonHistorical.Nodes.ValueMethods.Variance(model_part, Kratos.VELOCITY)
norm_mean, norm_variance = KratosStats.SpatialMethods.NonHistorical.Nodes.NormMethods.Variance(model_part, Kratos.VELOCITY, "magnitude")