Getting and running a 2-D MODEL example Note: % denotes a Unix prompt, >> denotes a Matlab prompt ! denotes my remarks % script step_by_step ! catch all the keystrokes Script started on Thu Feb 06 15:31:18 2003 % source ~mech517/public_html/Aliases Model and Matlab Unix aliases are turned on: Enter Help_Run_Ex for MODEL library example run info Enter Subjects for locating plot scripts by subject Enter Matlab5 to start old release 5 % List_Alias ! edited to save space # Summary of aliases for the MODEL fea code and mesh generators #---------------------------------------------------------------- # Copy_Zip copy zipped text files for stored example: Copy_Zip 104 # Dir_Tmp directory of all MODEL tmp file output # Ex_Text list any text files for stored example: Ex_Text 104 # Find_Key find control keyword related to 'word': Find_Key word # Get_Ex_Data copy example data : Get_Ex_Data 104_01 for 104_01.dat # Help_Run_Ex list help file on how to run an existing MODEL example # List_Ex list stored examples by number # My_Warn list warnings in output file: My_Warn out # Node_Order list order for connecting nodes to elements # Notation list the variable notations for the MODEL code # Plot_Path echo plot path for Matlab (before running Matlab) # Required list the required control keywords for test.dat # Run_Ex run MODEL for test.dat with existing 'example' keyword % Find_Key nodes ! search for keywords with string "nodes" el_nodes 8 ! Maximum number of nodes per element [2] nodes 999 ! Number of nodes in the mesh [2] type_nodes 3 2 ! Number of analysis nodes for element types [2] type_geom 3 2 ! Number of geometric nodes for type [type_nodes] el_segment 3 ! Maximum nodes on element boundary segment [0] seg_pt_flux 1 ! Segment flux components input at flux nodes [1] list_exact ! List given exact answers at nodes, etc [F] list_exact_flux ! List given exact fluxes at nodes, etc [F] bar_long ! Use distance between bar chart nodes [F] el_corners 3 ! Maximum number of element corner nodes [2] el_geom 6 ! Number of geometry nodes on an element [A] sav_el_topo ! Create msh_nodes.tmp for matlab [T] face_nodes 3 ! Number of shared nodes on an element face [d] % List_txt 202 ! list related help files, if any *** DESCRIPTIONS OF EXAMPLE 202 *** Numerically Integrated Anisotropic Poisson Equation in 2-D or Axisymmetric K_xx U,xx + 2K_xy U,xy + K_yy U,yy + Q = 0 PROP(1) = CONDUCTIVITY K_XX PROP(2) = CONDUCTIVITY K_YY PROP(3) = CONDUCTIVITY K_XY PROP(4) = SOURCE PER UNIT VOLUME, Q or use my_exact_source_inc when EXACT_CASE = 0 ... DATA_SET 08 EXACT_CASE = 20 ! Cubic 2d Laplace equation. Q=0, Kx=Ky=1, Kxy=0 ! u,xx + u,yy = 0, u=-x^3 -y^3 + 3x^2y + 3xy^2 ! K_xx U,xx + 2K_xy U,xy + K_yy U,yy + Q = 0 ! Properties: K_xx, K_yy, K_xy, and if el_real >3, Q ! 96 T6 elements ... % Get_Ex_Data 202_08 ! sounds interesting, get a data file % ls -l 202* ! verify copy complete -rw-r--r-- 1 akin 1687 Feb 6 15:33 202_01.dat % head -22 202_08.dat ! look at the top 22 lines title "Cubic 2d Laplace Equation, on 1.6 x 1 rectangle" exact_case 20 ! Exact analytic solution use_exact_bc ! Use exact solution for essential bc list_exact ! List given exact answers at nodes, etc list_exact_flux ! List given exact fluxes at nodes, etc nodes 221 ! Number of nodes in the mesh elems 96 ! Number of elements in the system dof 1 ! Number of unknowns per node el_nodes 6 ! Maximum number of nodes per element shape 2 ! Element shape, 1=line, 2=tri, 3=quad, 4=hex el_real 3 ! Number of real properties per element space 2 ! Solution space dimension b_rows 2 ! Number of rows in the B matrix gauss 6 ! Maximum number of quadrature points el_homo ! Element properties are homogeneous pt_list ! List the answers at each node point example 202 ! Source library example number data_set 08 ! Data set for example (this file) scp_neigh_el ! Default SCP patch group type scp_2nd_deriv ! Recover 2nd derivatives data also save_new_mesh ! Save new element sizes for adaptive mesher % mv 202_08.dat test.dat ! model requires local test.dat file % Run_Ex >! out ! run and save text output to file out STOP: NORMAL END OF MODEL_F90, WITH WARNINGS % My_Warn out NORMAL END OF MODEL_F90 (NO WARNINGS) % ls -l out ! verify text output size -rw-r--r-- 1 akin 14682 Feb 6 15:35 out ! (Use a text editor to review or list the out file) % Dir_Tmp ! list tmp files for Matlab plot data el_error_est.tmp msh_bc_xyz.tmp pt_ave_error_est.tmp el_qp_xyz_fluxes.tmp msh_new_el_scale.tmp pt_ave_ex_error.tmp ex_error_est.tmp msh_new_el_size.tmp pt_ave_grad_flux.tmp exact_node_flux.tmp msh_typ_nodes.tmp pt_ex_grad_flux.tmp exact_node_solution.tmp node_results.tmp scp_node_ave_fluxes.tmp % Plot_Path ! prepare to call Matlab addpath /net/course-a/mech517/public_html/Matlab_Plots % matlab < M A T L A B > Copyright 1984-1999 The MathWorks, Inc. Version 5.3.0.10183 (R11) Jan 21 1999 >> diary step_by >> addpath /net/course-a/mech517/public_html/Matlab_Plots >> bare_mesh_plot(2,5) % (elem, node) number increment to show Read 221 mesh coordinate pairs Read 96 elements with 6 nodes each >> bare_mesh_plot(0,0) % omit all element, node numbers >> print ('-dpsc', 'mesh') % ! make ps file copy >> bare_bc_stars_plot % locate essential boundary conditions >> bare_mesh_reshape_plot % predicted sizes from error estimates Read 96 element scale values >> hidden_result_surface_plot(1) % (dof) carpet plot Read 221 nodal solution values with 1 components each >> print ('-dpsc', 'result_1') % ! make ps file copy >> color_result_surface(1) % (dof) smooth color carpet plot Read 221 nodal solution values with 1 components each >> color_result_step(1) % (dof) step color carpet plot >> contour_result_on_mesh(1) % (dof) Read 221 nodal solution values with 1 components each >> contour_result(1) % (dof) without mesh >> hidden_exact_surface(1) % (dof) exact value carpet plot Read 221 exact nodal value sets with 1 components each >> hidden_error_surface(1) % (dof) exact nodal error carpet plot Read 221 fea value sets with 1 components each Read 221 exact nodal value sets with 1 components each >> exact_solution_error_shrink(1) %(dof) explode el error surface >> contour_exact_error(1) % (dof) error, without mesh >> contour_exact_err_on_mesh(1) % (dof) error, with mesh >> quiver_el_qp_flux %(scale, inc_g) before average (2-D) Using a scale of 1 and vector increment of 1 Read 96 Gauss x & y coord & flux sets >> quiver_scp_ave_pt_flux %(scale, inc_v) after average (2-D) Using a scale of 1 and vector increment of 1 Read 221 nodal flux sets Using Fourier law sign change >> print ('-dpsc', 'ave_node_flux') % ! save PS to print >> quiver_exact_node_flux %(scale, inc_v) exact flux Read 221 nodal flux sets Using Fourier law sign change >> exact_and_fe_node_flux_vec %(mesh, length) logic, scaleing Read 221 nodal exact flux sets Read 221 nodal SCP flux sets >> quiver_dif_ex_scp_n_flux %(scale, inc_v) difference vectors Using a scale of 1 and vector increment of 1 Read 221 nodal flux sets Using Fourier law sign change >> contour_pt_ave_error_est % in energy norm, without mesh >> contour_pt_ave_ex_er_norm % in energy norm, without mesh >> contour_qp_flux_component(1) %(component), without mesh >> contour_qp_flux_component(2) %(component), without mesh >> contour_n_exact_flux(1) %(component), without mesh >> contour_n_exact_flux(2) %(component), without mesh >> quit Thu Feb 6 15:40:39 CST 2003 % ls *.ps mesh.ps ave_node_flux.ps result_1.ps % ghostview mesh_plot.ps ! view saved plot file % ^D ! crtl D closes keystroke capture script script done on Thu Feb 06 15:41:14 2003