clear all
close all
clc

load C:\\School_work\\ESM_4714\\All_Nodes_Elems_Position_in_Elems

NEP = All_Node_Elem_Pos;

clear All_Node_Elem_Pos

file = fopen('C:\School_work\ESM_4714\Strain_results_only.txt')

% We know that the largets element number is 2156 but there are only 1936 Elements

for k = 1:2 % This value will loop through each mode 1-35

for m = 1:16
fgetl(file); % Read in Header and IGNORE
end

for n=1:1:1798; % This loops through all of the elements

eval(sprintf('E = str2num(fgetl(file));'));

for j =1:8 % this gets all of the data at each node of the element

eval(sprintf('Top_1 = str2num(fgetl(file));'));
eval(sprintf('Bot_1 = str2num(fgetl(file));'));

Elem_no_strain_top(n,j,:) = [E(1) Top_1];

end

% Now calculate the strain per node

for n=1:1:5529

if NEP(n,1,2) == Elem_no_strain_top(n,1)

Strain_XYZ_RXRYRZ = NEP(n,:,:);

end

% Looking for which elements contain a certain node?
mode = k
end

%dlmwrite('C:\School_work\ESM_4714\Elem_and_nodes_for_ansys.txt',Elem_no_type_nodes,'\t')
%dlmwrite('C:\School_work\ESM_4714\Node_Elem_Position_in_Elem.txt',Node_Elem_Pos,'\t')