-
Notifications
You must be signed in to change notification settings - Fork 1
/
createNodesPlasticMoments.m
32 lines (32 loc) · 1.11 KB
/
createNodesPlasticMoments.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function nodes = createNodesPlasticMoments(Mppx, Mnpx, Mppy, Mnpy, nelem_x, nelem_y)
% Defines nodes coordinates
%
% INPUT
% a Length of the plate along x-axis [m]
% b Length of the plate along y-axis [m]
% nelem_y Number of elements in the vertical direction
% nelem_x Number of elements in x-direction of the beam
%
% OUTPUT
% ElemNode Matrix containing the node numbers associated
% with its coordinate, e.g.
% ElemNode = [...
% 2 4 0
% ... ]
% The nodes are be numbered within increase in x-direction
%--------------------------------------------------------------------------
% Michele De Filippo
% Department of Civil Engineering
% The Hong Kong University of Science and Technology
% Latest revision: June 2017
%--------------------------------------------------------------------------
a = Mppx - Mnpx; b = Mppy - Mnpy;
stepx = a/nelem_x;
stepy = b/nelem_y;
nodes = [];
for y = Mnpy : stepy : Mppy
for x = Mnpx : stepx : Mppx
nodes = [nodes; size(nodes, 1) + 1 x y];
end
end
end