The Expression Editor is used for defining formulae for different applications/operations:
The working area in the center of the dialog is used to set up and edit a user-defined expression, assisted by using a number of toolbars and the model parameters listed in a parameter-tree view on the right-hand side. Parameters can be used in different units. In some cases, the editor also contains a list of stored expressions on the left-hand side.
The left-hand side of the editor may contain a list of stored named formulae and the current formula. Using the context menu on any entry, a formula can be stored, renamed, copied or deleted. Storing formulae is not possible for formula-based parameters and reaction kinetics definitions.
One or several equations can be written to the working window of the dialog.
The most important equation specifies the parameter to be defined or the condition to be fulfilled, e.g., the recharge rate for the source/sink parameter or the condition to be fulfilled to select a node:
Possible additional equations may serve to extract parts of the main equation for more clearness, e.g., using additional variables defined by a separate equation. They can be inserted by hitting <Enter> in the working area. Each new equation will be inserted above the one currently edited.
Red question marks and red parts of the equation show locations where processing of the equation fails.
Corrections have to be made before being able to close the dialog or apply the formula.
All the equations are organized in different boxes which are visible by left-clicking on parts of the equation. The
cursor position within or outside of these boxes determines where additional variables or operations are input. Use
the cursor keys or the mouse to navigate within the equation.
All variables and mathematical operations available in the toolbars and the parameter-tree view can be used in the formulae. All of them can also be input using the keyboard without clicking the corresponding symbols in the toolbars or the parameter in the tree view. For example, type <C> <_> <#> <1> for concentration of species 1 (shown as C#1).
The first tool bar provides basic functionality like loading formula from a file (*.fme), saving formulae to a file (*.fme), creating new formulae, undo and redo functions, cut, copy and paste.
The third bar provides basic elements for composing equations: brackets, super/subscript, simple operations, etc.
The operators @, () and ()@ have the following functionality:
Operator | Name |
Example |
---|---|---|
@ | Insert value at time template | e.g., Head@20 refers to hydraulic head at a simulation time of 20 days, time unit always being days |
() | Insert value at index template | e.g., Head(123) refers to hydraulic head at node 123, index starting from 0 |
()@ | Insert value at index and time template | e.g., Head(123)@20 refers to hydraulic head at node 123, index starting from 0, at a simulation time of 20 days, time unit always being days |
The interval tool is used to limit values to a specific interval, i.e., if the value is higher, the maximum value is used, if it is lower, the minimum is applied. The Greek symbols can be used to define additional variables.
The first part of the forth tool bar is for inserting templates for piece-wise defined functions and if/else statements. The second and third part offer logical statements to be used in the equations. The tools on the left hand side can be used to describe intervals much easier than by using the logical statements in the second part.
These options are only available when using the Select by Expression functionality of the Selection toolbar. They allow to replace the default (current time) for the evaluation by a specific time or time interval. It refers to time-varying properties (boundary conditions and material properties), but also to results values if called having loaded a results file (*.dac).
This option provides the possibility to evaluate quantities at a specific point in time.
This option provides the possibility to evaluate quantities at time stages defined by a constant time step within a set interval.
The third option allows to select one of the saved time steps in a results file (*.dac) as the evaluation time (instead of switching the Simulator toolbar to this time as the current time).
This toolbar is not shown by default. To get it, right-click on an empty spot in the toolbars and select Tools for experienced users. This toolbar serves for checking the current expression using the current values for the different variables. The play button starts interpretation. In case of successful interpretation, the result of the expression is shown, otherwise an error message is displayed.
This area on the right-hand side of the dialog contains a list of all parameters that can be used in the formula. These typical encompass the FEFLOW parameters listed in the Data panel (Process Variables, Boundary Conditions, Material Properties, User Data) and are complemented by additional data such as Temporal Data (current time, time series), Reference Constants (Reference concentration and Reference temperature as defined in Problem Settings) and Mesh Data (e.g., node or element numbers, slice/layer numbers, coordinates). For calculations on map attribute data, only the map attributes show up in the list.
The Unit in the corresponding column provides information about the currently set unit for each parameter in FEFLOW. When using a parameter, values will be entering the calculation of the expression in the currently defined unit.
By double-clicking on a parameter it is inserted into the formula at the current cursor location in the working area.
When using Select by Expression in the Selection toolbar or the Expression mode in the input box of the Editor toolbar, expressions can be stored for later use in the same model. This is done via the context menu entry Store as Named Expression on the default list entry Current Expression.
The context menu on stored expressions can be used to Copy Expression, Rename Expression and Delete Expression.
Named expressions can be chosen from the drop-down list of the input box of the Editor toolbar in the Expression mode when using them for assigning data (in addition to the default entry Current Expression).
|
Expressions can currently not be stored in the Expression Editor used for defining reaction kinetics, Expression-based nodal distributions/Expression-based elemental distributions or expression-based material properties. |
All parameters in the expression editor, including the left-hand side of the equation (if representing a parameter), carry units. The units are shown in the tooltip of each parameter (in both the working area and parameter-tree view) by moving the mouse over a parameter and waiting a short period of time.
The unit used in the editor can be changed via the Change unit entry in the context menu of the parameter in the working area or the parameter-tree view. Additional units can be defined in the Unit conversion dialog available from the Tools menu. Here also the general unit setting can be modified.
By default, the default or user-defined unit for the parameter (as set in the Data panel) is applied. Expressions in legacy files not containing unit settings are converted to using internal units.
Search the well by Expression Editor