ResampleLinearFunction¶
-
MLModule
¶
Purpose¶
The module ResampleLinearFunction
creates a piecewise multi-linear function (or an array of such functions) out of another such function (or an array, respectively), using different refinement settings.
The new refinement settings must be less strict than the original settings that were used to create the input object, since otherwise additional evaluations of the originally approximated function would be required.
The use of this module is for convergence studies. Usually, you will approximate you function using piecewise multi-linear functions with increasing fineness and check for convergence (in whatsoever way). Since you would certainly minimize the total amount of function evaluations of your original function as well as the total amount of written code, it is a good idea to just run you code once with the finest refinement settings that you require and then feed the result into a ResampleLinearFunction
module to simulate what would have happened if coarser settings would have been used.
Parameter Fields¶
Field Index¶
Apply : Trigger |
Refinement Rule : Enum |
Auto apply : Bool |
Use unfinished : Bool |
Balance Mode : Enum |
|
Epsilon : String |
|
Exponent : Double |
|
Maximal Level : Integer |
|
Maximal Level per Direction : String |
|
Minimal Level : Integer |
Visible Fields¶
Minimal Level¶
-
name:
minLevel
, type:
Integer
, default:
2
, minimum:
0
¶ Sets a value so that the sparse grid on which the function is interpolated is refined uniformly up to this level.
Maximal Level¶
-
name:
maxLevel
, type:
Integer
, default:
10
, minimum:
0
¶ Sets a value so that the sparse grid on which the function is interpolated is not refined more than to this level.
Maximal Level per Direction¶
-
name:
maxLevelPerDirection
, type:
String
¶ Sets a level value per direction.
Additionally to the
Maximal Level
field, it is possible to specify here maximal levels for each direction (separated by commas). This allows to do the following two things: First, use different maximal levels for different directions. Secondly, specify that the finest allowed grid is a uniform grid, which is often useful for discontinuous functions.
Refinement Rule¶
-
name:
refinementRule
, type:
Enum
, default:
Default
¶ Sets a refinement rule that is applied to values between
Minimal Level
andMaximal Level
.
Values:
Title | Name | Description |
---|---|---|
Default | Default | This is what the MutlivarLinFuncCreator class does if no user-specified refinement rule is employed: Let ε be the value of the Epsilon, a the value of the Exponent field, n the current level, and x the surplus on a node of this level. Then, the node corresponding to x is refined if any only if x > ε2-na. |
Distance And Angle | Distance And Angle | This mode assumes that the number of functions is an even number (typically 6) and that the first half of them denote position vectors in an n-dimensional space (typically n=3) and the second half of them denote direction vectors in the same dimension. Any node is refined if the Euclidean norm of the surplus of the position is larger than ε1 or the cosine of the angle between the refined and unrefined directions is smaller than 1-ε2. Here, the Epsilon should contain exactly two values; they correspond to ε1 and ε2. |
Epsilon¶
-
name:
eps
, type:
String
, default:
1.0e-5
¶ Sets a value for refinement.
These values are supposed to be parameters to the selected refinement rule. If the Default refinement rule is selected, the
Epsilon
field should contain as many values (separated by commas) as the function array has components. See rules for a detailed description of the meaning of these values. For the other refinement rules, see also the above description for the number of the expected parameters and their meanings. TheExponent
field is only utilized for the Default rule.
Exponent¶
Balance Mode¶
-
name:
balanceMode
, type:
Enum
, default:
Adaptive
¶ Defines a balance mode.
For details about balancing see the paper Bungartz/Dirnstorfer: Computing 71, 89-114 (2003).
Values:
Title | Name |
---|---|
None | None |
Full | Full |
Adaptive | Adaptive |
Use unfinished¶
-
name:
useUnfinished
, type:
Bool
, default:
FALSE
¶ If the module detects that the input function(s) do not provide all the information required to create the requested output function(s) (that means, the selected refinement settings would lead to a grid that is at least partially finer than the original one), this is indicated by invalidating the output completely. Usually, this means that you should recompute your input function with finer settings. If, for whatever reason, you like to get the (unfinished) result of the computation, please enable this field.