Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

How meshing the undernearth in x,y, z-direction with this un rectangle elements?

1 view (last 30 days)
Hello every one,
I'd be happy to help me in any way you can. I wrote my code in Matlab for right element that I attached copies of elements and formula for both of them. Now I don't know how meshing the underneath in x,y, z-direction with this un rectangle elements.
I appreciate it for your consideration and any help. I am eagerly waiting for kind replies.
clc;clear all;close all;
%% coordinate for 8 node of element (my assume)
Xp=[0 1 0 1 -0.2 1.2 -0.2 1.2];Xp=(Xp.*2)+2;
Yp=[0 0 1 1 0 0 1 1];Yp=(Yp.*2)+2;
Zp=[0 0 0 0 1 1 1 1];Zp=(Zp.*2)+2;
% grid on
%% coordinate for center of element
etac=(((Xp(1)+Xp(2))./2)+((Xp(3)+Xp(4))./2)+((Xp(5)+Xp(6))./2)+((Xp(7)+Xp(8))./2))./4;
betac=(((Yp(1)+Yp(2))./2)+((Yp(3)+Yp(4))./2)+((Yp(5)+Yp(6))./2)+((Yp(7)+Yp(8))./2))./4;
zetac=(((Zp(1)+Zp(2))./2)+((Zp(3)+Zp(4))./2)+((Zp(5)+Zp(6))./2)+((Zp(7)+Zp(8))./2))./4;
%% length of element
for ii=1:length(Xp)
if etac>Xp(ii)
etaq(ii)=etac-Xp(ii);
elseif etac<Xp(ii)
etaq(ii)=Xp(ii)-etac;
end
end
for ii=1:length(Yp)
if betac>Yp(ii)
betaq(ii)=betac-Yp(ii);
elseif betac<Yp(ii)
betaq(ii)=Yp(ii)-betac;
end
end
for ii=1:length(Zp)
if zetac>Zp(ii)
zetaq(ii)=zetac-Zp(ii);
elseif betac<Zp(ii)
zetaq(ii)=Zp(ii)-zetac;
end
end
%% local coordinate for element base on table A2 in the article
etaii=[-1 1 -1 1 -1 1 -1 1];
betaii=[-1 -1 1 1 -1 -1 1 1];
zetaii=[-1 -1 -1 -1 1 1 1 1];
%% function A11 in the article
syms eta beta zeta
for ii=1:8
Nii(ii)=(1/8).*(1+(etaii(ii).*eta)).*(1+(betaii(ii).*beta)).*(1+(zetaii(ii).*zeta));
end
X=0;
for ii=1:8
Xf=Nii(ii).*Xp(ii);
X=X+Xf;
end
Y=0;
for ii=1:8
Yf=Nii(ii).*Yp(ii);
Y=Y+Yf;
end
Z=0;
for ii=1:8
Zf=Nii(ii).*Zp(ii);
Z=Z+Zf;
end

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!