 |
|
Field Math - an interpreter of AVSFOL programming language
for creation or modification of float fields
Field Math - an interpreter of AVSFOL programming language
for creation or modification of float fields
Name
Field Math - an interpreter of AVSFOL programming language
for creation or modification of float fields
Description
The module interprets a short (up to 60 lines) program written in
AVSFOL (A Very Simple Field Operation Language) conforming to the
following syntax:
:=
:= !dimensions ...
!veclen=
!nspace=
:= ||
|
Output
var> := w0 | w1 ... (output field components)
y0 | y1 ... (output field coordinates)
:= any valid C variable name (up to 20 chars)
:= any valid algebraic expression formed form:
,,,
,,
,
Input
var> := [a0 | a1 ... (input field 1 components)]
..............
[f0 | f1 ... (input field 2 components)]
[x0 | x1 ... (input field coordinates)]
i0 | i1 ... (output field indexes)
Parameter
:= p0 | p1 | p2 | p3 | p4 | p5
:= |
|
:= sin | cos | tan | exp | ln | log | sqr | sqrt | abs
:= min | max
:= fmin | fmax | avg
:= cnv
:= any C float
:= + | - | * | / | ^
:= ( | )
:=while |end while
Examples
p0=avg(a0)
p1=sqrt(avg(sqr(a0-p0)))
evaluates (numerical) laplacian of the field
!dimensions 50 50
!min_ext -5 -5
!max_ext 5 5
!veclen=2
w0=0
p2=0
while 1
p2=p2+p0
u0=p1*cos(p2)
u1=p1*sin(p2)
w1=1/(0.3+sqr(y0-u0)+sqr(y1-u1))
w0=cnv(w0,f0)+w1
flush
end while
with f0= [[0 0.25 0][0.25 0 0.25][0 0.25 0]]
starts a continuous simulation of temperature distribution in
a square plate heatened by a source rotating at a radius p1
with rotation speed p0.
Programs can be edited with a primitive line editor, saved and loaded.
New fields can be created. The module waits for dimensions
parameter to create outfield.
INPUTS
infield - field float
................
infield6 - field float
PARAMETERS
Output dimensions (typein)
requires input of the form dim0 dim1 dim2 ...
(a list of integers separated by blanks);
together with Output ndim determine dimensionality
of outfield
Output veclen (islider)
determines veclen of the output field
Make points (toggle)
if on, outfield will be irregular with user-defined
point coordinates; otherwise, coordinates of infield
will be copied to outfield or, if Create field is on,
an uniform outfield is created
Output space dimension (islider)
active when Make points is on
variables (textblock)
output only -- shows the list of all predefined variables
(input field components and coordinates - when present,
indexes and output field components and coordinates - to be
determined
functions (textblock)
output only -- shows the list of all available functions
input line (typein)
currently edited program line
program (choice_browser)
displays current program
execute (boolean)
starts/stops parsing and execution of the program
clear (oneshot)
clears all program (does not clear temporary variables
and outputs)
reset (oneshot)
clear temporary variables and outputs
edit (choice_browser)
Append -- add current input line after the highlighted line
Insert -- add current input line before the highlighted line
Edit -- the highlighted line
Delete -- the highlighted line
Formula file (browser)
Read formula (oneshot)
Write formula (oneshot)
control writing/reading of the program to/from disk file;
program files use .fmla extension and are easily editable
OUTPUTS
outfield - field float
the module outputs only after all outfield components and
coordinates are evaluated
|
|