Page 22 - Process Modelling and Simulation With Finite Element Methods
P. 22
Introduction to FEMLAB 9
Figure 0.7 The single composite analyzed geometry (CO1) of the static mixer model. This geometry
was drawn by geometry primitive commands (rectangles and arcs) and then merged together to form
one contiguous domain.
Engineers usually put problem solving first, and skills and techniques are
acquired as necessary to solve problems. Programming strategies should reflect
this. My FORTRAN programming strategy is simple - I find the “off-the-shelf”
subprograms that do the integral steps of what I want to achieve, and then build a
program “shell” around it to read in parameters, set up storage, call the essential
subprograms, and then “post process” (also often with canned routines) and then
write out the data to files.
I treat FEMLABMATLAB programming the same.
The key is to get the FEMLAB GUI to do the work for you.
The File Menu has the “Save Model m-file” and “Reset Mode m-file”
options for you.
Set up the “workhorse” of your model in the GUI, and then export the
model m-file, which provides most of the “program body” needed to
use FEMLAB as a programming language in MATLAB, thus providing
all the subroutines and command syntax and logical structure, without
the User needing to know the details.
MATLAB m-files/ m-file functions can then be set up to provide data
entry, storage set up, post-processing, and output. Complicated
programmes can be built up modularly without the user specifying, or
even knowing all the details. MATLAB programming expertise is
needed, but crucially NOT FEMLAB programming expertise.