Getting and running a 1-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 #---------------------------------------------------------------- # Dir_Tmp directory of all MODEL tmp file output # 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 # List_Txt list related help files, if any: List_Txt 104 # My_Warn list warnings in output file: My_Warn out # Plot_Path echo plot path for Matlab (before running Matlab) # 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 104 ! list related help files, if any Application example summary text: EXAMPLE=104 Solution of the ODE u" + u + x = 0 for x in ]0,1[ with various boundary conditions, by Galerkin's method. Optional source to post-process invoked if keywords "post_1" and/or "post_2" appear in the keywords control. exact_case 9 is exact source for BC set u(0)=0=u(1), or u(0)=0 and u'(1)=cos(1)/sin(1) - 1 is u(x) = sin(x)/sin(1) - x. exact_case 10 is source for EBC u(0)=0, and natural BC u'(1)=0. The solution u(x) = sin(x)/cos(1) - x DATA_SET= 01 U,XX + U + X = 0, U(0)=0=U(1), U = Sin(x)/Sin(1) - x Here we use six linear (L2) line elements. This is exact_case 9 DATA_SET=2 U,XX + U + X = 0, U(0)=0, U'(1)=-0.3579, U = Sin(x)/Sin(1) - x Here we use six linear (L2) line elements. This is exact_case 9 DATA_SET=3 U,XX + U + X = 0, U(0)=0, U'(1)=0, U = Sin(x)/Cos(1) - x Here we use six linear (L2) line elements. This is exact_case 10 DATA_SET=4 U,XX + U + X = 0, U(0)=0=U(1), U = Sin(x)/Sin(1) - x Here we use three quadratic (L3) line elements. This is exact_case 9 DATA_SET=5 U,XX + U + X = 0, U(0)=0=U(1), U = Sin(x)/Sin(1) - x Here we use two cubic (L4) line elements. Error < 1% Energy Norm This is exact_case 9 DATA_SET=6 U,XX + U + X = 0, U(0)=0=U(1), U = Sin(x)/Sin(1) - x Here we use one cubic (L4) line element. This corresponds to the global Galerkin example give in the text discussion of weighted residual methods. This is exact_case 9 % Get_Ex_Data 104_01 ! sounds interesting, get a data file % ls -l 104* ! verify copy complete -rw-r--r-- 1 akin 1687 Feb 6 15:33 104_01.dat % head -22 104_01.dat ! look at the top 22 lines title "L2 SOLUTION U,XX + U + X = 0" ! begin keywords nodes 7 ! Number of nodes in the mesh elems 6 ! Number of elements in the system dof 1 ! Number of unknowns per node el_nodes 2 ! Maximum number of nodes per element space 1 ! Solution space dimension b_rows 1 ! Number of rows in the B (operator) matrix shape 1 ! Element shape, 1=line, 2=tri, 3=quad, 4=hex remarks 7 ! Number of user remarks gauss 2 ! Maximum number of quadrature points pt_list ! List the answers at each node point post_1 ! Post-processing, create n_tape1, for gradients post_2 ! Post-processing, create n_tape2, for norm exact_case 9 ! Analytic solution for list_exact, etc list_exact ! List given exact answers at nodes, etc list_exact_flux ! List given exact fluxes at nodes, etc example 104 ! Application source code library number data_set 1 ! Data for "example" (may set exact_case) quit ! keyword input U,XX + U + X = 0, U(0)=0=U(1), U = Sin(x)/Sin(1) - x Here we use six linear (L2) line elements. Notes: 1) The FE solution is continuous, but the gradients % mv 104_01.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 WARNING, NO PROPERTY INPUT STATIC_MODEL GAVE 1 WARNINGS NORMAL END OF MODEL_F90, WITH 1 WARNINGS % ls -l out ! verify text output size -rw-r--r-- 1 akin 14682 Feb 6 15:35 out ! (Use a text editor or list the out file) % Dir_Tmp ! list tmp files for Matlab plot data -rw-r--r-- 1 akin 84 Feb 6 15:35 el_error_est.tmp -rw-r--r-- 1 akin 324 Feb 6 15:35 el_qp_xyz_fluxes.tmp -rw-r--r-- 1 akin 84 Feb 6 15:35 ex_error_est.tmp -rw-r--r-- 1 akin 98 Feb 6 15:35 exact_node_flux.tmp -rw-r--r-- 1 akin 105 Feb 6 15:35 exact_node_solution.tmp -rw-r--r-- 1 akin 140 Feb 6 15:35 msh_bc_xyz.tmp -rw-r--r-- 1 akin 114 Feb 6 15:35 msh_typ_nodes.tmp -rw-r--r-- 1 akin 105 Feb 6 15:35 node_results.tmp -rw-r--r-- 1 akin 98 Feb 6 15:35 pt_ave_error_est.tmp -rw-r--r-- 1 akin 98 Feb 6 15:35 pt_ave_ex_error.tmp -rw-r--r-- 1 akin 98 Feb 6 15:35 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 >> mesh_plot(1,1) ! display number increment (elem, node) Read 7 mesh coordinate pairs, Read 6 elements with 2 nodes each >> print ('-dpsc', 'mesh') % ! make ps file copy >> bc_flags_plot % ! plot BC flag locations >> bc_values_plot % ! plot BC values and locations Read 7 nodal solution values with 1 components each >> result_1d_graph(1) % ! plot nodal result for (dof) Read 7 nodal solution values with 1 components each >> print ('-dpsc', 'result_1') % ! make ps file copy Read 7 mesh coordinate pairs Read 6 elements connections Read 7 nodal solution values with 1 components each >> true_result_1d_graph (1,9) ! (fea_dof, exact_case) Read 7 nodal solution values with 1 components each Max value is 0.0695676 at node 4 Min value is 0 at node 1 ! use Print button for hardcopy, or File/SaveAs for file copy >> exact_error_1d_graph(1) % ! exact errrors in nodal (dof) Read 7 nodal exact values with 1 components each Read 7 nodal solution values with 1 components each Max error is 2.2829e-10 at node 7 Min error is -0.000179 at node 4 >> el_qp_flux_1d_graph % ! flux at quadrature points Read 12 Gauss x coord & flux sets Max value is 0.182426 Min value is -0.277036 >> ave_node_flux_1d_graph(1) % ! plot nodal (flux) averages Read 7 nodal solution values with 1 components each Max value is 0.315589 at node 7 Min value is 0.045843 at node 4 >> print ('-dpsc', 'ave_node_flux') % ! save PS to print >> elem_error_est_1d_graph % ! element level estimated error Read 6 element error estimate values Max value is 11.401 at element 6 Min value is 2.0806 at element 1 >> pt_ave_error_est_1d_graph % ! elem estimates averaged at nodes Read 7 nodal error estimate values Max value is 11.4013 at node 7 Min value is 2.08063 at node 1 >> pt_ave_ex_er_norm_graph % ! elem exact error averaged at nodes Read 7 nodal error estimate values Max value is 11.0504 at node 7 Min value is 1.2022 at node 1 >> pt_ave_est_ex_norms_graph % ! both averaged error norm graphs Read 7 nodal exact error norms Max value is 11.0504 at node 7 Min value is 1.2022 at node 1 Read 7 nodal estimate error norms Max value is 11.4013 at node 7 Min value is 2.08063 at node 1 >> 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