1313
1414
1515class compute_residual_and_error (Operator ):
16- """Computes the norm of a field or a field container.
16+ """Computes the Lp- norm of a field or a field container.
1717 When a second entry is provided, the residual (the difference
1818 between the first and second entry) is calculated along with the
19- error.
19+ error as the Lp-norm of the difference .
2020 When a second input is not provided, the calculation is only
2121 completed for the first entry.
2222 The type of calculation performed is based on the specifications
23- provided for pins 1 and pin 2 defines the type of error norm (L1
24- vs L2).
25- Note that if the input is a field container that only contains one
26- field, the operator's outputs are of type field
23+ provided for pin 1, pin 2 defines the type of error norm (L1 vs
24+ L2), and
25+ pin 3 which entity to use as a reference
2726
2827 Parameters
2928 ----------
@@ -36,10 +35,14 @@ class compute_residual_and_error(Operator):
3635 0 for absolute,
3736 1 for relative to the first entry at
3837 a given time step,
39- 2 for normalized by the max of the
40- first entry at a given time step,
41- 3 for normalized by the max of the
42- first entry over all time steps
38+ 2 for normalized by the max at a
39+ given time step of the first entry or
40+ residuals depending on the reference
41+ field option,
42+ 3 for normalized by the max over all
43+ time steps of the first entry or
44+ residuals depending on the reference
45+ field option
4346 norm_calculation_type : int, optional
4447 Type for norm calculation (optional, default:
4548 l2) - it is normalized depending on
@@ -116,18 +119,17 @@ def __init__(
116119
117120 @staticmethod
118121 def _spec ():
119- description = """Computes the norm of a field or a field container.
122+ description = """Computes the Lp- norm of a field or a field container.
120123 When a second entry is provided, the residual (the
121124 difference between the first and second entry) is
122- calculated along with the error.
125+ calculated along with the error as the Lp-norm of the
126+ difference.
123127 When a second input is not provided, the calculation is
124128 only completed for the first entry.
125129 The type of calculation performed is based on the
126- specifications provided for pins 1 and pin 2 defines the
127- type of error norm (L1 vs L2).
128- Note that if the input is a field container that only
129- contains one field, the operator's outputs are of type
130- field"""
130+ specifications provided for pin 1, pin 2 defines the type
131+ of error norm (L1 vs L2), and
132+ pin 3 which entity to use as a reference"""
131133 spec = Specification (
132134 description = description ,
133135 map_input_pin_spec = {
@@ -147,10 +149,14 @@ def _spec():
147149 0 for absolute,
148150 1 for relative to the first entry at
149151 a given time step,
150- 2 for normalized by the max of the
151- first entry at a given time step,
152- 3 for normalized by the max of the
153- first entry over all time steps""" ,
152+ 2 for normalized by the max at a
153+ given time step of the first entry or
154+ residuals depending on the reference
155+ field option,
156+ 3 for normalized by the max over all
157+ time steps of the first entry or
158+ residuals depending on the reference
159+ field option""" ,
154160 ),
155161 2 : PinSpecification (
156162 name = "norm_calculation_type" ,
@@ -321,10 +327,14 @@ def normalization_type(self):
321327 0 for absolute,
322328 1 for relative to the first entry at
323329 a given time step,
324- 2 for normalized by the max of the
325- first entry at a given time step,
326- 3 for normalized by the max of the
327- first entry over all time steps
330+ 2 for normalized by the max at a
331+ given time step of the first entry or
332+ residuals depending on the reference
333+ field option,
334+ 3 for normalized by the max over all
335+ time steps of the first entry or
336+ residuals depending on the reference
337+ field option
328338
329339 Parameters
330340 ----------
0 commit comments