MAE 404/503 Finite Elements in Engineering Programming Assignment #1
Write a MATLAB function that generates the nodal coordinates and connectivity matrix for a 1D finite element mesh made up of two-node elements as shown in Figure 1 below.
Figure 1. Node and element numbering for a 1D finite element mesh.
Instructions for programming and assignment submission:
Submit a single file (MATLAB code). The file name must be in the format "asurite_hw1.m". Note that the separator is an underscore and you must substitute your ASU login. For example: "asurite_jdoe123". The file must define a function of the same name as the file name (but without the .m), e.g. function [node_coords, connectivity] = asurite_hw1(ne, L) % Code goes here to define nodes & connectivity. end
Make sure you also replace "asurite" in the function name with your ASU login. L is the total length of the domain, and ne is the number of elements. The function must return two variables. The first must be a "l nn" matrix of nodal coordinates (where nn is the total number of nodes). The second must be a "2ne" matrix, where each column contains the nodes contained in the corresponding element. For example, given inputs L = 12 and ne = 5, the correct outputs would be:
node_coords = [0 2.4 4.8 7.2 9.6 12]
connectivity = [1 2; 2 3; 3 4; 4 5; 5 6]
where, for example, the first column of connectivity is [1;2] which are the nodes contained in element 1.
Nodes and elements must be ordered left-to-right and sequentially as shown in Figure 1, and the location of node 1 must be located at x = 0. Your code must give the correct outputs for any reasonable values of ne and L. If your code only works for one specific case, you will get zero credit.