Page 202 - Process Modelling and Simulation With Finite Element Methods
P. 202

Simulation and Nonlinear Dynamics         189

          For example, the m-file bifurc3.m was generated by exporting the m-file of the
          benard problem, and then modifying the end to put a looping structure around
          the stationary nonlinear solver and eigensolver:
          .aaaasaaaaasaaasaaaaaaaWBJZ parameters and storage%%%%%%%%%%%%%
          po~oooooooooo~ooooo~ooo
          Rayleigh=  [100:100:4000]  ;
          output=zeros (length(Ray1eigh) ,8)  ;
          &PPPSSPPPPQS~kPPPSPkPPPS%PP oooooooo~oaooooooooooooo ..Looping  Structure%%%%%%%%%%%%%%%%%%%
          for j=1: length (Rayleigh)
          %  Define constants
          fem.const={  ...
                  'Ra'  ,   Rayleigh(j), ...
                      ,
                  'Pr'     11;
          if js1
                  init=femO.sol;
          end
          %  Solve nonlinear problem
          fem.sol=femnlin(fem,  . . .
                                 .
                  'Out',   'sol', . .
                  'stop',  'on', ...
                  'init',  init, ...
                  'report', 'on', ...
                  'context','local', ...
                                 .
                  'sd',     'Off', . .
                  'nullfun', 'flnullorth', ...
                  'blocksize',5000, ...
                                             ...
                  lsolcomp',('pl,'u','v','T'},
                  'linsolver', 'matlab', ...
                  'bsteps', 0,. . .
                  'ntol',  10.0e-007, ...
                  'hnlin',  'off', ...
                  'jacobian','equ', ...
                  'maxiter',25, ...
                  'method', 'eliminate', ...
                  'uscale', 'none') ;
          %  Save current fern structure for restart purposes
          f emO=f em;
          %  Integrate on subdomains
          Il=postint(fem,'cvfluxT-cc',..
                  1 cont ' ,   ' internal I , .
                  'contorder',2, ...
                        ,
                  'edim'   2,. . .
                               .
                  'solnum', 1,. .
                  'phase', 0,. . .
                  'geomnum',l, ...
                      ,
                  'dl'     1, ...
                  'intorder',4, ...
                                  '
                          '
                  1 context , ' local )  ;
          %  Integrate on subdomains
          IZ=postint(fem, 'dfluxT-cc',  ...
                  'cont',  'internal', ...
                  'contorder',2, ...
                               .
                  'edim',  2,. .
                  'solnum', 1,. . .
   197   198   199   200   201   202   203   204   205   206   207