[File: Building_Your_MODEL.txt, Last revision 3/8/06] Solving Your Application with the MODEL Library (Except for Existing Example Source Applications) To create a finite element model using your source code for at least the application dependent square matrix within the MODEL library you must carry out the following steps: A. Obtain the Unix makefile(s) that will link you application calculations to the general MODEL library with: cp ~mech517/public_html/Archive/make_* . That will give you the option of two make files: make_apply will be needed for your application make_exact is used instead if you supply an exact solution also. (When you modify any supplied INCLUDE file one of these will be used to create your new application executable code.) B. Copy the application dependent library to your directory with: cp ~mech517/public_html/Copyrighted/application_lib.f . and, if you plan to provide an exact solution for comparison, cp ~mech517/public_html/Copyrighted/exact_lib.f . To utilize the finite element library you will always need to at least modify one INCLUDE file to define the standard element square matrix. Usually, you do not change application_lib.f and exact_lib.f directly. C. Copy all of the default INCLUDE files to your directory with: cp ~mech517/public_html/Archive/my_*_inc . The latter operation should create all dummy INCLUDE files that will be required by the compiler. Only the "my_el_sq_inc" is ALWAYS needed. The list of INCLUDE files for various user defined operations is: 1.) standard finite elements: my_el_sq_inc ! MUST ALWAYS use for S matrix, C matrix optional my_el_col_inc ! for optional C array not done in my_el_sq_inc my_el_post_inc ! rarely needed, for data not saved in my_el_sq_inc my_post_el_inc ! usually needed to post-process a standard element Note: The integrand of the S matrix in "my_el_sq_inc" is often expressed in a common notation as the triple matrix product: (B^T) * E * B, so we often define the two matrices B and E during the numerical integration of S. They are also used if the optional error estimator is activated. 2.) standard error estimator for numerically integrated elements my_b_matrix_inc ! B, required for standard error estimation my_e_matrix_inc ! E, required for standard error estimation These are not accessed if you turn off the error estimator calculations by putting "no_scp" in the control keywords. (If no properties are given the operator matrix, B, defaults to the gradient, and the constitutive matrix, E, defaults to the identity matrix.) 3.) non-zero element boundary flux source vector my_seg_col_inc ! defines boundary segment C due to source 4.) non-zero element boundary Mixed, or Robin, conditions my_mixed_bc_inc ! defines boundary segment S, C is optional 5.) non-linear iterative, or transient starting values my_iter_start_inc ! user defined starting conditions D. After you have created the application dependent source files, by at least editing "my_el_sq_inc" to define the S matrix, you create the executable file "my_model" by running the makefile with either: make -f make_apply OR make -f make_exact You may see WARNING messages from the compiler since some optional arrays or variables are not needed by your application. An ERROR message should appear only if you have made a programming error. If you are supplying an exact solution for comparison then you will have to edit at least one of the my_exact*inc files. E. When the compile succeeds without error and produces file "my_model" place your data in the file "test.dat" and run your application with: my_model >! out & which creates an output file named "out". The last output line should list how many warnings were issued. You can search for them with: grep WARNING out F. A number of example INCLUDE files and associated data are provided. Usually associated output files are also provided. You may want to copy and run some of these to get familiar with the MODEL system. A few old examples may be for a previous release of MODEL and may need minor changes, or give outputs that look different (but have the same numerical results). To get started try a simple ordinary differential equation. After carrying out steps A, B, C above get the application test files with: cp ~mech517/public_html/Archive/Test_1* . Read file Test_1.txt, and then overwrite the defaults with: cp Test_1_el_sq_inc my_el_sq_inc cp Test_1_data_1 test.dat and carry out sets D and E above: make -f make_apply my_model >! out & Compare the output to the file Test_1_out_1. To see comparisons with the supplied exact solution edit the test.dat file to remove the # (comment) sign from the "exact" keywords, and: cp Test_1_exact_EBC_inc my_exact_inc cp Test_1_exact_flux_EBC_inc my_exact_flux_inc make -f make_exact my_model >! out & To see optional post processing output edit the test.dat file to remove the # (comment) sign from the "post_" keywords, and: cp Test_1_post_el_inc my_post_el_inc make -f make_exact my_model >! out & After these work correctly try some of the other data files for this test application to see how different element types and/or different meshes change the answers and error estimates. File Test_1_data_1_Flux uses a flux boundary condition for the same exact solution as the essential boundary condition (EBC) test. Files with NBC in the name use a natural boundary condition, and have a different exact solution. G. Plots: You will note that additional formatted output have been placed in various *.tmp files. They are intended for use by plotting codes such as the Matlab scripts provided. Start Matlab and enter: addpath /net/course-a/mech517/public_html/Matlab_Plots so Matlab can find the scripts in that directory. Scripts for a 1-D problem are those with "1d" in the name as well as a few others: bc_values_plot, el_error_value_plot, mesh_plot, mesh_shrink_plot, etc. See files MODEL_1_D_PLOTS.txt, and FE_MODEL_PLOTS.txt in directory ~mech517/public_html/Matlab_Plots for more help. Use: ghostview Test_1_graph_0.ps, etc. to see the stored hardcopies. ------------------------------------------------------------------------