Page 374 - Process Modelling and Simulation With Finite Element Methods
P. 374
A MATLAB/FEMLAB Primer for Vector Calculus 361
>> fern
fern =
sdim: {'X' vyv}
appl : { [IXI struc 1 [IX~ struct]}
draw: [lxl struct
s imp1 if y : 'on'
geom: [lxl geom21
dim: {'U' 'V' p' 'TI}
form : I general
equ: [lxl struct
bnd : [lxl struct
pnt : [lxl struct
border : 1
expr : {IXO cell)
var : I}
sshape : 2
e 1 emmph : {lxo cell}
eleminitmoh: (1x0 cell1
mesh: "1x1 struct]
out f orm : I general
I
dif f : {'gal 'g' If' 'rl lexpr')
I
shape : { 'shlag(2, Iu') 'shlag(2, 'v') 'shlag(1, 'PI)
'shlag(2, IT') I}
rules : {IXO cell}
sol : [lxl struct]
version : [lxl struct]
xmesh: [lxl struct]
const : { 'Ra' [17101 'Pr' [l] }
The list is of fields in the structure fem above shows the description of the field
contents. Each field can be addressed with the "dot" notation:
>> fem.sdim
ans =
'X' 'Y'
fem.sdim is a cell array with two cells; the cell array is small enough that its
contents can be displayed. Since it is a cell array, the braces index reference will
act on the contents of the cell element.
>> fem.sdim{l}
ans =
X
As we can see, the fern structure has cell arrays, other structures, characters, and
numbers as its constituents. There is no reason why we cannot have cell arrays
of fem structures, which is indeed the make up of the xfem structure used by
FEMLAB for extended multiphysics, with one fem structure for each logical
geometry. We have frequently had need of the postinterp command which acts
on fern structures or xfem structures to produce values of solution variables
interpolated at points within the domain discretized by finite elements:
[is,pel =postinterp (xfem,xx)
;
,
[ul =postinterp (xfem, 'ul' is) ;
Passing the whole of the xfem structure to the postinterp function gives it access
to the complete description of the model and solution, for which it may have to

