├── asef ├── forzetrave.m ├── matriceriferimento.m ├── baricentrasezione.m ├── area.m ├── rigidezzaelemento.m ├── statico.m ├── inerzia.m ├── massasezione.m ├── massaelemento.m ├── rigidezzasezione.m ├── operatoredeformazione.m ├── tests │ ├── provamensola.m │ ├── provarisolvi.m │ └── provafem2.m ├── operatorespostamento.m ├── GAUSS.m ├── risolvi.m ├── funzioneforma.m ├── stress_displacement.m ├── modal_movie.m ├── plotstruttura.m └── assemblaggio.m ├── fsa ├── ULS Analysis │ ├── TANGENT METHOD preliminary │ │ ├── in sospeso.txt │ │ ├── err.m │ │ ├── lenp.m │ │ ├── lambda.m │ │ ├── lambda1.m │ │ └── ULS.m │ └── SECANT METHOD │ │ ├── area.m │ │ ├── secpropsteel.m │ │ ├── secstiff.m │ │ ├── Bq.m │ │ ├── alpha.m │ │ ├── stiff.m │ │ ├── tests │ │ └── test.m │ │ ├── firstareamoment.m │ │ ├── secondareamoment.m │ │ ├── ULS.m │ │ ├── clERRE.m │ │ ├── secproperty.m │ │ └── ERRE.m ├── Force formulation FEM │ ├── RBMmatrix.m │ ├── residual.m │ ├── stressoperator.m │ ├── solve0.m │ ├── elementstiffness0.m │ ├── area.m │ ├── rotationmatrix.m │ ├── sectionstiffness0.m │ ├── Iareamoment.m │ ├── IIareamoment.m │ ├── deassemble.m │ ├── epsIvectors.m │ ├── assemble.m │ ├── sectionstiffstress.m │ ├── fiberfree.m │ ├── tests │ │ ├── preliminary_tests │ │ │ └── testNF.m │ │ ├── testFEMappoggeappogg.m │ │ ├── testfiberfree.m │ │ └── testFEMmensola.m │ ├── assemble0.m │ ├── NF.m │ ├── solveFFF.m │ ├── solveFFFincr.m │ ├── division.m │ └── cutpoints.m └── 3D Corotational Formulation │ ├── Ematrix.m │ ├── qvector.m │ ├── Pmatrix.m │ ├── rvector.m │ ├── residual.m │ ├── Bmatrix.m │ ├── materialstiffness.m │ ├── globalelementstiffness.m │ ├── skewsymm.m │ ├── area.m │ ├── solveKaug.m │ ├── Iareamoment.m │ ├── geometricstiffness.m │ ├── IIareamoment.m │ ├── Rgmatrix.m │ ├── drawdiagram.m │ ├── Qmatrix.m │ ├── R0matrix.m │ ├── strainoperator.m │ ├── solve.m │ ├── plotstructure.m │ ├── epsIvectors.m │ ├── Dmatrix.m │ ├── Rrmatrix.m │ ├── avector.m │ ├── fiberfree.m │ ├── tangentstiffness.m │ ├── fvector.m │ ├── assemble.m │ ├── Gmatrix.m │ ├── sectionstiffstress.m │ ├── resistingforces.m │ ├── fisrtNRiter.m │ ├── loadmultipliers.m │ ├── tests │ ├── testFEMcorot_mensola.m │ ├── preliminary_tests │ │ ├── testLOADMULTIPL.m │ │ └── testLEESFRAME.m │ └── testFEMcorot.m │ ├── solveITER.m │ ├── solveARCLENGTH.m │ ├── division.m │ └── cutpoints.m └── pasm └── plane stress element ├── distributed_load.m ├── elasticity_matrix_m.m ├── sigma_eq_vonMises.m ├── displacement_operator_m.m ├── transltoG.m ├── XYZ.m ├── translrotatetolocal.m ├── plotelement.m ├── strain_operator_m.m ├── jacobian.m ├── plotstructure.m ├── rotation_matrix.m ├── XYZD.m ├── chi.m ├── solve_m.m ├── stiffness_matrix_m.m ├── rotatetoglobal.m ├── read_ne.m ├── vonMises_colour.m ├── stress.m ├── colour.m ├── plot_vonMises.m ├── test_plot_sigma.m ├── assemble_m.m ├── tests └── test_piastra_forata.m ├── ELIST1.txt ├── NLIST1.txt └── ELIST2.txt /asef/forzetrave.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnotomista/fem/HEAD/asef/forzetrave.m -------------------------------------------------------------------------------- /fsa/ULS Analysis/TANGENT METHOD preliminary/in sospeso.txt: -------------------------------------------------------------------------------- 1 | procedureB 2 | 3 | tangentoperator -------------------------------------------------------------------------------- /asef/matriceriferimento.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnotomista/fem/HEAD/asef/matriceriferimento.m -------------------------------------------------------------------------------- /fsa/Force formulation FEM/RBMmatrix.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnotomista/fem/HEAD/fsa/Force formulation FEM/RBMmatrix.m -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/area.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnotomista/fem/HEAD/fsa/ULS Analysis/SECANT METHOD/area.m -------------------------------------------------------------------------------- /pasm/plane stress element/distributed_load.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnotomista/fem/HEAD/pasm/plane stress element/distributed_load.m -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/secpropsteel.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gnotomista/fem/HEAD/fsa/ULS Analysis/SECANT METHOD/secpropsteel.m -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Ematrix.m: -------------------------------------------------------------------------------- 1 | function E=Ematrix(node,element) 2 | 3 | 4 | Rr=Rrmatrix(node,element); 5 | 6 | E=blkdiag(Rr,Rr,Rr,Rr); 7 | 8 | 9 | end -------------------------------------------------------------------------------- /asef/baricentrasezione.m: -------------------------------------------------------------------------------- 1 | function P=baricentrasezione(P) 2 | G=statico(P)/area(P); 3 | P(:,1)=P(:,1)-ones(size(P,1),1)*G(1); 4 | P(:,2)=P(:,2)-ones(size(P,1),1)*G(2); 5 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/qvector.m: -------------------------------------------------------------------------------- 1 | function [q1,q2,q]=qvector(Rg1,Rg2,R0) 2 | 3 | 4 | q1=Rg1*R0*[0;1;0]; 5 | q2=Rg2*R0*[0;1;0]; 6 | 7 | q=(q1+q2)/2; 8 | 9 | 10 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/residual.m: -------------------------------------------------------------------------------- 1 | function r=residual(f,fi,v) 2 | 3 | 4 | constr=find(v); 5 | 6 | fi(constr)=zeros(length(constr),1); 7 | 8 | r=f-fi; 9 | 10 | 11 | end -------------------------------------------------------------------------------- /pasm/plane stress element/elasticity_matrix_m.m: -------------------------------------------------------------------------------- 1 | function C_m=elasticity_matrix_m(E,ni) 2 | 3 | C_m=E/(1-ni^2)*[1 ni 0; 4 | ni 1 0; 5 | 0 0 (1-ni)/2]; 6 | 7 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Pmatrix.m: -------------------------------------------------------------------------------- 1 | function P=Pmatrix(node,element) 2 | 3 | 4 | G=Gmatrix(node,element); 5 | I=eye(3); 6 | o=zeros(3); 7 | 8 | P=[o I o o;o o o I]-[G';G']; 9 | 10 | 11 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/rvector.m: -------------------------------------------------------------------------------- 1 | function r=rvector(node,element) 2 | 3 | 4 | Rr=Rrmatrix(node,element); 5 | r1=Rr(:,1); 6 | 7 | o=zeros(1,3); 8 | 9 | r=[-r1',o,r1',o]; 10 | 11 | 12 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/residual.m: -------------------------------------------------------------------------------- 1 | function [r,R]=residual(f,fi,v) 2 | 3 | 4 | r=f-fi; 5 | 6 | constr=find(v); 7 | 8 | r(constr)=zeros(length(constr),1); 9 | 10 | R=norm(r); 11 | 12 | 13 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/stressoperator.m: -------------------------------------------------------------------------------- 1 | function S=stressoperator(L,x) 2 | 3 | 4 | S=[1 0 0 0 0 0; 5 | 0 0 0 -x/L+1/2 0 -x/L-1/2; 6 | 0 0 x/L-1/2 0 x/L+1/2 0; 7 | 0 1 0 0 0 0]; 8 | 9 | 10 | end -------------------------------------------------------------------------------- /pasm/plane stress element/sigma_eq_vonMises.m: -------------------------------------------------------------------------------- 1 | function sigma_vonMises=sigma_eq_vonMises(sigma) 2 | 3 | sx=sigma(1); 4 | sy=sigma(2); 5 | txy=sigma(3); 6 | 7 | sigma_vonMises=sqrt(sx^2+sy^2-sx*sy+3*txy^2); 8 | 9 | end -------------------------------------------------------------------------------- /asef/area.m: -------------------------------------------------------------------------------- 1 | function A=area(P) 2 | R=[0 1;-1 0]; 3 | P=[P;P(1,:)]; 4 | A=0; 5 | for i=1:size(P,1)-1 6 | ri=P(i,:)'; 7 | rj=P(i+1,:)'; 8 | rjo=R*rj; 9 | A=A+ri'*rjo; 10 | end 11 | A=1/2*A; 12 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Bmatrix.m: -------------------------------------------------------------------------------- 1 | function B=Bmatrix(node,element) 2 | 3 | 4 | r=rvector(node,element); 5 | P=Pmatrix(node,element); 6 | E=Ematrix(node,element); 7 | 8 | B=[r;P*E']; 9 | 10 | 11 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/solve0.m: -------------------------------------------------------------------------------- 1 | function d=solve0(K,f,v) 2 | 3 | 4 | free=find(-v+ones(length(v),1)); 5 | 6 | Kff=K(free,free); 7 | 8 | d=zeros(length(f),1); 9 | 10 | d(free)=Kff\f(free); 11 | 12 | 13 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/materialstiffness.m: -------------------------------------------------------------------------------- 1 | function MSM=materialstiffness(node,element) 2 | 3 | 4 | Kl=tangentstiffness(node,element); 5 | 6 | B=Bmatrix(node,element); 7 | 8 | MSM=B'*Kl*B; 9 | 10 | 11 | end -------------------------------------------------------------------------------- /asef/rigidezzaelemento.m: -------------------------------------------------------------------------------- 1 | function Ke=rigidezzaelemento(l,E,G,P) 2 | Ks=rigidezzasezione(E,G,P); 3 | gp=GAUSS(2); 4 | B1=operatoredeformazione(l,gp.x(1)*l/2); 5 | B2=operatoredeformazione(l,gp.x(2)*l/2); 6 | Ke=l/2*(B1'*Ks*B1+B2'*Ks*B2); 7 | end -------------------------------------------------------------------------------- /asef/statico.m: -------------------------------------------------------------------------------- 1 | function S=statico(P) 2 | R=[0 1;-1 0]; 3 | P=[P;P(1,:)]; 4 | S=[0;0]; 5 | for i=1:size(P,1)-1 6 | ri=P(i,:)'; 7 | rj=P(i+1,:)'; 8 | rjo=R*rj; 9 | S=S+(ri'*rjo)*(ri+rj); 10 | end 11 | S=1/6*S; 12 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/globalelementstiffness.m: -------------------------------------------------------------------------------- 1 | function Ke=globalelementstiffness(node,element) 2 | 3 | 4 | MSM=materialstiffness(node,element); 5 | GSM=geometricstiffness(node,element); 6 | 7 | Ke=MSM+GSM; 8 | 9 | 10 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/skewsymm.m: -------------------------------------------------------------------------------- 1 | function R=skewsymm(r) 2 | 3 | 4 | R=zeros(3,3); 5 | 6 | R(2,3)=-r(1); 7 | R(1,3)=r(2); 8 | R(1,2)=-r(3); 9 | R(3,2)=-R(2,3); 10 | R(3,1)=-R(1,3); 11 | R(2,1)=-R(1,2); 12 | 13 | 14 | end -------------------------------------------------------------------------------- /pasm/plane stress element/displacement_operator_m.m: -------------------------------------------------------------------------------- 1 | function D_m=displacement_operator_m(r,s) 2 | 3 | D_m=1/4*[(1+r)*(1+s), (1-r)*(1+s), (1-r)*(1-s), (1+r)*(1-s), 0, 0, 0, 0; 4 | 0, 0, 0, 0, (1+r)*(1+s), (1-r)*(1+s), (1-r)*(1-s), (1+r)*(1-s)]; 5 | 6 | end -------------------------------------------------------------------------------- /asef/inerzia.m: -------------------------------------------------------------------------------- 1 | function J=inerzia(P) 2 | R=[0 1;-1 0]; 3 | P=[P;P(1,:)]; 4 | J=[0 0;0 0]; 5 | for i=1:size(P,1)-1 6 | ri=P(i,:)'; 7 | rj=P(i+1,:)'; 8 | rjo=R*rj; 9 | J=J+(ri'*rjo)*(ri*ri'+1/2*(ri*rj'+rj*ri')+rj*rj'); 10 | end 11 | J=1/12*J; 12 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/elementstiffness0.m: -------------------------------------------------------------------------------- 1 | function Ke=elementstiffness0(L,E,G,P) 2 | 3 | 4 | Ks=sectionstiffness0(E,G,P); 5 | 6 | S1=stressoperator(L,-L/(2*sqrt(3))); 7 | S2=stressoperator(L,L/(2*sqrt(3))); 8 | 9 | Ke=inv(L/2*(S1'*(Ks\S1)+S2'*(Ks\S2))); 10 | 11 | 12 | end -------------------------------------------------------------------------------- /asef/massasezione.m: -------------------------------------------------------------------------------- 1 | function Ms=massasezione(P,rho) 2 | A=area(P); 3 | S=statico(P); 4 | J=inerzia(P); 5 | Ms=[A 0 0 0 0 -S(2); 6 | 0 A 0 0 0 S(1); 7 | 0 0 A S(2) -S(1) 0; 8 | 0 0 S(2) J(2,2) J(1,2) 0; 9 | 0 0 -S(1) J(1,2) J(1,1) 0; 10 | -S(2) S(1) 0 0 0 J(1,1)+J(2,2)]*rho; 11 | end -------------------------------------------------------------------------------- /pasm/plane stress element/transltoG.m: -------------------------------------------------------------------------------- 1 | function x=transltoG(X) 2 | 3 | G=1/4*[X(1,1)+X(2,1)+X(3,1)+X(4,1); 4 | X(1,2)+X(2,2)+X(3,2)+X(4,2); 5 | X(1,3)+X(2,3)+X(3,3)+X(4,3)]; 6 | 7 | x(:,1)=X(:,1)-G(1)*ones(4,1); 8 | x(:,2)=X(:,2)-G(2)*ones(4,1); 9 | x(:,3)=X(:,3)-G(3)*ones(4,1); 10 | 11 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/area.m: -------------------------------------------------------------------------------- 1 | function A=area(P) 2 | 3 | 4 | R=[0 1;-1 0]; 5 | 6 | A=0; 7 | 8 | for i=1:size(P,1)-1 9 | 10 | ri=P(i,:)'; 11 | 12 | rj=P(i+1,:)'; 13 | 14 | rjo=R*rj; 15 | 16 | A=A+ri'*rjo; 17 | 18 | end 19 | 20 | A=1/2*A; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /pasm/plane stress element/XYZ.m: -------------------------------------------------------------------------------- 1 | function X=XYZ(node,connections) 2 | 3 | I=connections(1); 4 | II=connections(2); 5 | III=connections(3); 6 | IV=connections(4); 7 | 8 | X(1,:)=node(I).coordinates; 9 | X(2,:)=node(II).coordinates; 10 | X(3,:)=node(III).coordinates; 11 | X(4,:)=node(IV).coordinates; 12 | 13 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/area.m: -------------------------------------------------------------------------------- 1 | function A=area(P) 2 | 3 | 4 | R=[0 1;-1 0]; 5 | 6 | A=0; 7 | 8 | for i=1:size(P,1)-1 9 | 10 | ri=P(i,:)'; 11 | 12 | rj=P(i+1,:)'; 13 | 14 | rjo=R*rj; 15 | 16 | A=A+ri'*rjo; 17 | 18 | end 19 | 20 | A=1/2*A; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/solveKaug.m: -------------------------------------------------------------------------------- 1 | function [dp,dl]=solveKaug(Kt,f,Dp,Dl,psi,g,a,free) 2 | 3 | 4 | Kaug=[Kt(free,free),-f(free); 5 | 2*(Dp(free))',2*Dl*psi^2*(f'*f)]; 6 | 7 | d=-Kaug\[g(free);a]; 8 | 9 | dp=zeros(length(f),1); 10 | dp(free)=d(1:length(free)); 11 | 12 | dl=d(length(d)); 13 | 14 | 15 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/secstiff.m: -------------------------------------------------------------------------------- 1 | function K=secstiff(concrete,steel,ui) 2 | 3 | 4 | As=secproperty(concrete,steel,ui,0); 5 | 6 | Ss=secproperty(concrete,steel,ui,1); 7 | 8 | Js=secproperty(concrete,steel,ui,2); 9 | 10 | K=[As Ss(1) Ss(2); 11 | Ss(1) Js(1,1) Js(1,2); 12 | Ss(2) Js(2,1) Js(2,2)]; 13 | 14 | 15 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/rotationmatrix.m: -------------------------------------------------------------------------------- 1 | function R=rotationmatrix(n1,n2,vr) 2 | 3 | 4 | x1=(n2-n1)/norm(n2-n1); 5 | x3=cross(x1,vr)/norm(cross(x1,vr)); 6 | x2=cross(x3,x1); 7 | 8 | r=[x1'; 9 | x2'; 10 | x3']; 11 | o=zeros(3,3); 12 | 13 | R=[r,o,o,o; 14 | o,r,o,o; 15 | o,o,r,o; 16 | o,o,o,r]; 17 | 18 | 19 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/sectionstiffness0.m: -------------------------------------------------------------------------------- 1 | function Ks=sectionstiffness0(E,G,P) 2 | 3 | 4 | A=area(P); 5 | 6 | S=Iareamoment(P); 7 | 8 | J=IIareamoment(P); 9 | 10 | Ks=[E*A, E*S(1), E*S(2), 0; 11 | E*S(1), E*J(1,1), E*J(1,2), 0; 12 | E*S(2), E*J(2,1), E*J(2,2), 0; 13 | 0, 0, 0, G*(J(1,1)+J(2,2))]; 14 | 15 | 16 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/Iareamoment.m: -------------------------------------------------------------------------------- 1 | function S=Iareamoment(P) 2 | 3 | 4 | R=[0 1;-1 0]; 5 | 6 | S=[0;0]; 7 | 8 | for i=1:size(P,1)-1 9 | 10 | ri=P(i,:)'; 11 | 12 | rj=P(i+1,:)'; 13 | 14 | rjo=R*rj; 15 | 16 | S=S+(ri'*rjo)*(ri+rj); 17 | 18 | end 19 | 20 | S=1/6*S; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Iareamoment.m: -------------------------------------------------------------------------------- 1 | function S=Iareamoment(P) 2 | 3 | 4 | R=[0 1;-1 0]; 5 | 6 | S=[0;0]; 7 | 8 | for i=1:size(P,1)-1 9 | 10 | ri=P(i,:)'; 11 | 12 | rj=P(i+1,:)'; 13 | 14 | rjo=R*rj; 15 | 16 | S=S+(ri'*rjo)*(ri+rj); 17 | 18 | end 19 | 20 | S=1/6*S; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /asef/massaelemento.m: -------------------------------------------------------------------------------- 1 | function Me=massaelemento(l,P,rho) 2 | Ms=massasezione(P,rho); 3 | gp=GAUSS(4); 4 | D1=operatorespostamento(l,gp.x(1)*l/2); 5 | D2=operatorespostamento(l,gp.x(2)*l/2); 6 | D3=operatorespostamento(l,gp.x(3)*l/2); 7 | D4=operatorespostamento(l,gp.x(4)*l/2); 8 | Me=l/2*((D1'*Ms*D1)*gp.w(1)+(D2'*Ms*D2)*gp.w(2)+(D3'*Ms*D3)*gp.w(3)+(D4'*Ms*D4)*gp.w(4)); 9 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/geometricstiffness.m: -------------------------------------------------------------------------------- 1 | function GSM=geometricstiffness(node,element) 2 | 3 | 4 | f=fvector(node,element); 5 | D=Dmatrix(node,element); 6 | E=Ematrix(node,element); 7 | Q=Qmatrix(node,element); 8 | G=Gmatrix(node,element); 9 | a=avector(node,element,f); 10 | r=rvector(node,element); 11 | 12 | GSM=D*f(1)-E*Q*G'*E'+E*G*a*r; 13 | 14 | 15 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/IIareamoment.m: -------------------------------------------------------------------------------- 1 | function J=IIareamoment(P) 2 | 3 | 4 | R=[0 1;-1 0]; 5 | 6 | J=[0 0;0 0]; 7 | 8 | for i=1:size(P,1)-1 9 | 10 | ri=P(i,:)'; 11 | 12 | rj=P(i+1,:)'; 13 | 14 | rjo=R*rj; 15 | 16 | J=J+(ri'*rjo)*(ri*ri'+1/2*(ri*rj'+rj*ri')+rj*rj'); 17 | 18 | end 19 | 20 | J=1/12*J; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/IIareamoment.m: -------------------------------------------------------------------------------- 1 | function J=IIareamoment(P) 2 | 3 | 4 | R=[0 1;-1 0]; 5 | 6 | J=[0 0;0 0]; 7 | 8 | for i=1:size(P,1)-1 9 | 10 | ri=P(i,:)'; 11 | 12 | rj=P(i+1,:)'; 13 | 14 | rjo=R*rj; 15 | 16 | J=J+(ri'*rjo)*(ri*ri'+1/2*(ri*rj'+rj*ri')+rj*rj'); 17 | 18 | end 19 | 20 | J=1/12*J; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Rgmatrix.m: -------------------------------------------------------------------------------- 1 | function [Rg1,Rg2]=Rgmatrix(node,element) 2 | 3 | 4 | ni=element.connections(1); 5 | nf=element.connections(2); 6 | 7 | di=node(ni).displacements; 8 | df=node(nf).displacements; 9 | 10 | ri=di(4:6); 11 | rf=df(4:6); 12 | 13 | rg1=skewsymm(ri); 14 | rg2=skewsymm(rf); 15 | 16 | Rg1=expm(rg1); 17 | Rg2=expm(rg2); 18 | 19 | 20 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/drawdiagram.m: -------------------------------------------------------------------------------- 1 | function drawdiagram(C,node,fi,k) 2 | 3 | 4 | hold on 5 | 6 | ddrw=node(C(1)).displacements; 7 | fdrw=fi(6*(C(1)-1)+C(2)); 8 | 9 | % plot(abs(ddrw(C(2))),abs(fdrw),'*') 10 | % 11 | % text(abs(ddrw(C(2))),abs(fdrw),int2str(k)); 12 | 13 | plot(ddrw(C(2)),fdrw,'*') 14 | 15 | text(ddrw(C(2)),fdrw,int2str(k)); 16 | 17 | 18 | end -------------------------------------------------------------------------------- /pasm/plane stress element/translrotatetolocal.m: -------------------------------------------------------------------------------- 1 | function x=translrotatetolocal(X) 2 | 3 | G=1/4*[X(1,1)+X(2,1)+X(3,1)+X(4,1); 4 | X(1,2)+X(2,2)+X(3,2)+X(4,2); 5 | X(1,3)+X(2,3)+X(3,3)+X(4,3)]; 6 | 7 | x_G(:,1)=X(:,1)-G(1)*ones(4,1); 8 | x_G(:,2)=X(:,2)-G(2)*ones(4,1); 9 | x_G(:,3)=X(:,3)-G(3)*ones(4,1); 10 | 11 | R=rotation_matrix(X); 12 | 13 | x=x_G*R; 14 | 15 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Qmatrix.m: -------------------------------------------------------------------------------- 1 | function Q=Qmatrix(node,element) 2 | 3 | 4 | f=fvector(node,element); 5 | 6 | P=Pmatrix(node,element); 7 | 8 | nm=P'*f(2:7); 9 | 10 | n1=nm(1:3); 11 | m1=nm(4:6); 12 | n2=nm(7:9); 13 | m2=nm(10:12); 14 | 15 | N1=skewsymm(n1); 16 | M1=skewsymm(m1); 17 | N2=skewsymm(n2); 18 | M2=skewsymm(m2); 19 | 20 | Q=[N1;M1;N2;M2]; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/R0matrix.m: -------------------------------------------------------------------------------- 1 | function R0=R0matrix(node,element) 2 | 3 | 4 | ni=element.connections(1); 5 | nf=element.connections(2); 6 | 7 | xyzi=node(ni).xyz; 8 | xyzf=node(nf).xyz; 9 | 10 | v=element.reference; 11 | 12 | e01=(xyzf-xyzi)/norm(xyzf-xyzi); 13 | e03=cross(e01,v)/norm(cross(e01,v)); 14 | e02=cross(e03,e01); 15 | 16 | R0=[e01,e02,e03]; 17 | 18 | 19 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/Bq.m: -------------------------------------------------------------------------------- 1 | function Bq=Bq(m,q,a,e0i) 2 | 3 | 4 | Aq=0; 5 | 6 | for r=0:q 7 | 8 | for s=0:4-q 9 | 10 | Aq=Aq+(-1)^r*factorial(m+1)/factorial(2+m+r)*... 11 | factorial(q)/factorial(q-r)*nchoosek(s+q,s)*... 12 | a(s+q+1)*e0i; 13 | 14 | end 15 | 16 | end 17 | 18 | Bq=Aq/(m+q+1); 19 | 20 | 21 | end -------------------------------------------------------------------------------- /pasm/plane stress element/plotelement.m: -------------------------------------------------------------------------------- 1 | function plotelement(node,element,d,scale) 2 | 3 | C=element.connections; 4 | 5 | if strcmp(d,'undeformed') 6 | 7 | X=XYZ(node,C); 8 | X=[X;X(1,:)]; 9 | plot3(X(:,1),X(:,2),X(:,3)); 10 | 11 | else 12 | 13 | D=XYZD(node,C,scale); 14 | D=[D;D(1,:)]; 15 | plot3(D(:,1),D(:,2),D(:,3),':r'); 16 | 17 | end 18 | 19 | end -------------------------------------------------------------------------------- /asef/rigidezzasezione.m: -------------------------------------------------------------------------------- 1 | function Ks=rigidezzasezione(E,G,P) 2 | A=area(P); 3 | S1=statico(P)'*[1;0]; 4 | S2=statico(P)'*[0;1]; 5 | J11=(inerzia(P)*[1;0])'*[1;0]; 6 | J12=(inerzia(P)*[1;0])'*[0;1]; 7 | J21=(inerzia(P)*[0;1])'*[1;0]; 8 | J22=(inerzia(P)*[0;1])'*[0;1]; 9 | Jp=J11+J22; 10 | Ks=[E*A, E*S1, E*S2, 0; 11 | E*S1, E*J11, E*J12, 0; 12 | E*S2, E*J21, E*J22, 0; 13 | 0, 0, 0, G*Jp]; 14 | end -------------------------------------------------------------------------------- /pasm/plane stress element/strain_operator_m.m: -------------------------------------------------------------------------------- 1 | function B_m=strain_operator_m(x,r,s) 2 | 3 | J=jacobian(x,r,s); 4 | 5 | B_m(1:2,:)=1/4*inv(J)*[(1+s), -(1+s), -(1-s), (1-s), 0, 0, 0, 0; 6 | 0, 0, 0, 0, (1+r), (1-r), -(1-r), -(1+r)]; 7 | 8 | B_m(3,:)=sum(1/4*inv(J)*[(1+r), (1-r), -(1-r), -(1+r), 0, 0, 0, 0; 9 | 0, 0, 0, 0, (1+s), -(1+s), -(1-s), (1-s)],1); 10 | 11 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/strainoperator.m: -------------------------------------------------------------------------------- 1 | function B=strainoperator(l,x) 2 | 3 | 4 | B=zeros(4,12); 5 | 6 | B(1,1)=-1/l; 7 | B(1,7)=1/l; 8 | 9 | B(2,2)=12*x/l^3; 10 | B(2,6)=6*x/l^2-1/l; 11 | B(2,8)=-12*x/l^3; 12 | B(2,12)=6*x/l^2+1/l; 13 | 14 | B(3,3)=12*x/l^3; 15 | B(3,5)=-(6*x/l^2-1/l); 16 | B(3,9)=-12*x/l^3; 17 | B(3,11)=-(6*x/l^2+1/l); 18 | 19 | B(4,4)=-1/l; 20 | B(4,10)=1/l; 21 | 22 | 23 | end -------------------------------------------------------------------------------- /pasm/plane stress element/jacobian.m: -------------------------------------------------------------------------------- 1 | function J=jacobian(x,r,s) 2 | 3 | J(1,1)=x(1,1)*1/4*((1+s)+x(2,1)*(-(1+s))+... 4 | x(3,1)*(-(1-s))+x(4,1)*(1-s)); 5 | 6 | J(1,2)=x(1,2)*1/4*((1+s)+x(2,2)*(-(1+s))+... 7 | x(3,2)*(-(1-s))+x(4,2)*(1-s)); 8 | 9 | J(2,1)=x(1,1)*1/4*((1+r)+x(2,1)*(1-r)+... 10 | x(3,1)*(-(1-r))+x(4,1)*(-(1+r))); 11 | 12 | J(2,2)=x(1,2)*1/4*((1+r)+x(2,2)*(1-r)+... 13 | x(3,2)*(-(1-r))+x(4,2)*(-(1+r))); 14 | 15 | end -------------------------------------------------------------------------------- /pasm/plane stress element/plotstructure.m: -------------------------------------------------------------------------------- 1 | function plotstructure(node,element,d,scale) 2 | 3 | for e=1:length(element) 4 | 5 | hold on 6 | 7 | if strcmp(d,'undeformed') 8 | 9 | plotelement(node,element(e),'undeformed',scale); 10 | 11 | else 12 | 13 | plotelement(node,element(e),'deformed',scale); 14 | 15 | end 16 | 17 | end 18 | 19 | axis image 20 | 21 | end -------------------------------------------------------------------------------- /pasm/plane stress element/rotation_matrix.m: -------------------------------------------------------------------------------- 1 | function R=rotation_matrix(X) 2 | 3 | a=det([X(1,2) X(1,3) 1;X(2,2) X(2,3) 1;X(3,2) X(3,3) 1]); 4 | b=-det([X(1,1) X(1,3) 1;X(2,1) X(2,3) 1;X(3,1) X(3,3) 1]); 5 | c=det([X(1,1) X(1,2) 1;X(2,1) X(2,2) 1;X(3,1) X(3,2) 1]); 6 | 7 | x=transltoG(X); 8 | 9 | k=[a;b;c]/norm([a,b,c]); 10 | 11 | i=((x(1,:)+x(4,:))/2)'/norm((x(1,:)+x(4,:))/2); 12 | 13 | j=cross(k,i)/norm(cross(k,i)); 14 | 15 | R=[i,j,k]; 16 | 17 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/solve.m: -------------------------------------------------------------------------------- 1 | function node=solve(node,element) 2 | 3 | 4 | d=zeros(6*length(node),1); 5 | 6 | [K,f,v]=assemble(node,element); 7 | 8 | constr=find(v); 9 | free=find(-v+ones(length(v),1)); 10 | 11 | d(free)=K(free,free)\f(free); 12 | f(constr)=K(constr,free)*d(free); 13 | 14 | for n=1:length(node) 15 | 16 | node(n).forces=f(6*n-5:6*n); 17 | node(n).displacements=d(6*n-5:6*n); 18 | 19 | end 20 | 21 | 22 | end -------------------------------------------------------------------------------- /pasm/plane stress element/XYZD.m: -------------------------------------------------------------------------------- 1 | function D=XYZD(node,connections,scale) 2 | 3 | for f=1:length(node) 4 | 5 | node(f).deform_displ=node(f).coordinates+scale*node(f).displacement'; 6 | 7 | end 8 | 9 | I=connections(1); 10 | II=connections(2); 11 | III=connections(3); 12 | IV=connections(4); 13 | 14 | D(1,:)=node(I).deform_displ; 15 | D(2,:)=node(II).deform_displ; 16 | D(3,:)=node(III).deform_displ; 17 | D(4,:)=node(IV).deform_displ; 18 | 19 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/deassemble.m: -------------------------------------------------------------------------------- 1 | function [Ddi,L,R,T,ni,nf]=deassemble(node,element,Dd) 2 | 3 | 4 | ni=element.connections(1); 5 | nf=element.connections(2); 6 | 7 | xyzi=node(ni).xyz; 8 | xyzf=node(nf).xyz; 9 | 10 | L=norm(xyzf-xyzi); 11 | 12 | R=rotationmatrix(xyzi,xyzf,element.reference); 13 | 14 | Ddg(1:6)=Dd(6*ni-5:6*ni); 15 | Ddg(7:12)=Dd(6*nf-5:6*nf); 16 | 17 | Ddl=R*Ddg'; 18 | 19 | T=RBMmatrix(L); 20 | 21 | Ddi=T*Ddl; 22 | 23 | 24 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/plotstructure.m: -------------------------------------------------------------------------------- 1 | function plotstructure(node,element) 2 | 3 | figure('color','w') 4 | hold on 5 | axis vis3d 6 | xlabel('asse x') 7 | ylabel('asse y') 8 | zlabel('asse z') 9 | 10 | for i=1:length(element) 11 | 12 | ni=element(i).connections(1); 13 | nf=element(i).connections(2); 14 | xyz(:,1)=node(ni).xyz; 15 | xyz(:,2)=node(nf).xyz; 16 | 17 | plot3(xyz(1,:),xyz(2,:),xyz(3,:),'k-'); 18 | 19 | end 20 | 21 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/alpha.m: -------------------------------------------------------------------------------- 1 | function a=alpha(uit,concrete,steel,elim) 2 | 3 | 4 | e0it=uit(1); 5 | git=uit(2:3); 6 | 7 | ecu=elim(1); 8 | esu=elim(2); 9 | 10 | P1=concrete.section; 11 | P2=steel.section; 12 | 13 | for i=1:length(P1) 14 | 15 | ec(i)=abs(ecu)/abs(e0it+git'*P1(i,:)'); 16 | 17 | end 18 | 19 | for i=1:length(P2) 20 | 21 | es(i)=abs(esu)/abs(e0it+git'*P2(i,1:2)'); 22 | 23 | end 24 | 25 | a=min([min(ec),min(es)]); 26 | 27 | 28 | end -------------------------------------------------------------------------------- /asef/operatoredeformazione.m: -------------------------------------------------------------------------------- 1 | function B=operatoredeformazione(l,x) 2 | B=zeros(4,12); 3 | B(1,3)=funzioneforma(l,x,1,1); 4 | B(1,9)=funzioneforma(l,x,2,1); 5 | B(2,1)=-funzioneforma(l,x,3,2); 6 | B(2,5)=-funzioneforma(l,x,5,2); 7 | B(2,7)=-funzioneforma(l,x,4,2); 8 | B(2,11)=-funzioneforma(l,x,6,2); 9 | B(3,2)=-funzioneforma(l,x,3,2); 10 | B(3,4)=funzioneforma(l,x,5,2); 11 | B(3,8)=-funzioneforma(l,x,4,2); 12 | B(3,10)=funzioneforma(l,x,6,2); 13 | B(4,6)=funzioneforma(l,x,1,1); 14 | B(4,12)=funzioneforma(l,x,2,1); 15 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/epsIvectors.m: -------------------------------------------------------------------------------- 1 | function [eps,I]=epsIvectors(P,e,epsy) 2 | 3 | 4 | I=zeros(length(P),1); 5 | 6 | eps=zeros(length(P),1); 7 | 8 | for i=1:length(P) 9 | 10 | eps(i)=[1,P(i,:)]*e(1:3); 11 | 12 | if eps(i)<=-epsy 13 | 14 | I(i)=1; 15 | 16 | else if eps(i)>=epsy 17 | 18 | I(i)=3; 19 | 20 | else I(i)=2; 21 | 22 | end 23 | 24 | end 25 | 26 | end 27 | 28 | 29 | end -------------------------------------------------------------------------------- /asef/tests/provamensola.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | nodo(1).xyz=[0;0;0]; 6 | nodo(2).xyz=[10;0;0]; 7 | trave(1).connessione=[1 2]; 8 | trave(1).E=210000; 9 | trave(1).G=70000; 10 | trave(1).sezione=[1 0;1 1;0 1;0 0]; 11 | trave(1).carichi=[0;0;10;0;0;0]; 12 | trave(1).riferimento=[0;1;0]; 13 | nodo(1).azioni=[0;0;0;0;0;0]; 14 | nodo(2).azioni=[0;0;0;0;0;0]; 15 | nodo(1).vincoli=[1;1;1;1;1;1]; 16 | nodo(2).vincoli=[1;1;1;1;1;1]; 17 | trave(1).vincoli=[1;1;1;1;1;1;1;1;1;1;1;1]; 18 | nodo=risolvi(nodo,trave); -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/epsIvectors.m: -------------------------------------------------------------------------------- 1 | function [eps,I]=epsIvectors(P,e,epsy) 2 | 3 | 4 | I=zeros(length(P),1); 5 | 6 | eps=zeros(length(P),1); 7 | 8 | for i=1:length(P) 9 | 10 | eps(i)=[1,P(i,:)]*e(1:3); 11 | 12 | if eps(i)<=-epsy 13 | 14 | I(i)=1; 15 | 16 | else if eps(i)>=epsy 17 | 18 | I(i)=3; 19 | 20 | else I(i)=2; 21 | 22 | end 23 | 24 | end 25 | 26 | end 27 | 28 | 29 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Dmatrix.m: -------------------------------------------------------------------------------- 1 | function D=Dmatrix(node,element) 2 | 3 | 4 | Rr=Rrmatrix(node,element); 5 | r1=Rr(:,1); 6 | 7 | o=zeros(3); 8 | 9 | I=eye(3); 10 | 11 | ni=element.connections(1); 12 | nf=element.connections(2); 13 | 14 | xyzi=node(ni).xyz; 15 | xyzf=node(nf).xyz; 16 | 17 | di=node(ni).displacements; 18 | df=node(nf).displacements; 19 | 20 | ui=di(1:3); 21 | uf=df(1:3); 22 | 23 | ln=norm(xyzf+uf-xyzi-ui); 24 | 25 | D3=(I-r1*r1')/ln; 26 | 27 | D=[D3 o -D3 o; 28 | o o o o; 29 | -D3 o D3 o; 30 | o o o o]; 31 | 32 | 33 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Rrmatrix.m: -------------------------------------------------------------------------------- 1 | function Rr=Rrmatrix(node,element) 2 | 3 | 4 | ni=element.connections(1); 5 | nf=element.connections(2); 6 | 7 | xyzi=node(ni).xyz; 8 | xyzf=node(nf).xyz; 9 | 10 | di=node(ni).displacements; 11 | df=node(nf).displacements; 12 | 13 | ui=di(1:3); 14 | uf=df(1:3); 15 | 16 | [Rg1,Rg2]=Rgmatrix(node,element); 17 | 18 | R0=R0matrix(node,element); 19 | 20 | [~,~,q]=qvector(Rg1,Rg2,R0); 21 | 22 | r1=(xyzf+uf-xyzi-ui)/norm(xyzf+uf-xyzi-ui); 23 | r3=cross(r1,q)/norm(cross(r1,q)); 24 | r2=cross(r3,r1); 25 | 26 | Rr=[r1,r2,r3]; 27 | 28 | 29 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/assemble.m: -------------------------------------------------------------------------------- 1 | function [Ki,fi]=assemble(Ki,fi,Fei,fei,R,T,ni,nf) 2 | 3 | 4 | Kel=T'*(Fei\T); 5 | Keg=R'*Kel*R; 6 | 7 | fel=T'*fei; 8 | feg=R'*fel; 9 | 10 | Ki(6*ni-5:6*ni,6*ni-5:6*ni)=Ki(6*ni-5:6*ni,6*ni-5:6*ni)+Keg(1:6,1:6); 11 | Ki(6*ni-5:6*ni,6*nf-5:6*nf)=Ki(6*ni-5:6*ni,6*nf-5:6*nf)+Keg(1:6,7:12); 12 | Ki(6*nf-5:6*nf,6*ni-5:6*ni)=Ki(6*nf-5:6*nf,6*ni-5:6*ni)+Keg(7:12,1:6); 13 | Ki(6*nf-5:6*nf,6*nf-5:6*nf)=Ki(6*nf-5:6*nf,6*nf-5:6*nf)+Keg(7:12,7:12); 14 | 15 | fi(6*ni-5:6*ni)=fi(6*ni-5:6*ni)+feg(1:6); 16 | fi(6*nf-5:6*nf)=fi(6*nf-5:6*nf)+feg(7:12); 17 | 18 | 19 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/TANGENT METHOD preliminary/err.m: -------------------------------------------------------------------------------- 1 | function e=err(concrete,steel,u,elim) 2 | 3 | 4 | e0i=u(1); 5 | gi=u(2:3); 6 | 7 | ecu=elim(1); 8 | esu=elim(2); 9 | 10 | P1=concrete.section; 11 | P2=steel.section; 12 | 13 | for i=1:length(P1) 14 | 15 | ri=P1(i,:); 16 | 17 | ec(i)=e0i+gi'*ri'; 18 | 19 | end 20 | 21 | ecmin=min(ec); 22 | 23 | for i=1:length(P2) 24 | 25 | ri=P2(i,1:2); 26 | 27 | es(i)=e0i+gi'*ri'; 28 | 29 | end 30 | 31 | esmin=min(es); 32 | 33 | e=min([(ecu-ecmin)/ecmin,(esu-esmin)/esmin]); 34 | 35 | 36 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/stiff.m: -------------------------------------------------------------------------------- 1 | function K=stiff(concrete,steel) 2 | 3 | 4 | A=area(concrete,steel); 5 | S=firstareamoment(concrete,steel); 6 | J=secondareamoment(concrete,steel); 7 | 8 | Ec=concrete.E0; 9 | Es=steel.E0; 10 | 11 | Ac=A.concrete; 12 | Sc=S.concrete; 13 | Jc=J.concrete; 14 | 15 | As=A.steel; 16 | Ss=S.steel; 17 | Js=J.steel; 18 | 19 | Kc=Ec*[Ac Sc(1) Sc(2); 20 | Sc(1) Jc(1,1) Jc(1,2); 21 | Sc(2) Jc(2,1) Jc(2,2)]; 22 | 23 | Ks=Es*[As Ss(1) Ss(2); 24 | Ss(1) Js(1,1) Js(1,2); 25 | Ss(2) Js(2,1) Js(2,2)]; 26 | 27 | K=Kc+Ks; 28 | 29 | 30 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/avector.m: -------------------------------------------------------------------------------- 1 | function a=avector(node,element,f) 2 | 3 | 4 | a=zeros(3,1); 5 | 6 | [Rg1,Rg2]=Rgmatrix(node,element); 7 | R0=R0matrix(node,element); 8 | [~,~,q]=qvector(Rg1,Rg2,R0); 9 | Rr=Rrmatrix(node,element); 10 | c=Rr'*q; 11 | n=c(1)/c(2); 12 | 13 | ni=element.connections(1); 14 | nf=element.connections(2); 15 | xyzi=node(ni).xyz; 16 | xyzf=node(nf).xyz; 17 | di=node(ni).displacements; 18 | df=node(nf).displacements; 19 | ui=di(1:3); 20 | uf=df(1:3); 21 | ln=norm(xyzf+uf-xyzi-ui); 22 | 23 | a(1)=0; 24 | a(2)=n/ln*(f(2)+f(5))-1/ln*(f(3)+f(6)); 25 | a(3)=1/ln*(f(4)+f(7)); 26 | 27 | 28 | end -------------------------------------------------------------------------------- /pasm/plane stress element/chi.m: -------------------------------------------------------------------------------- 1 | function P=chi(X,rho) 2 | 3 | r=rho(1); 4 | s=rho(2); 5 | 6 | x=translrotatetolocal(X); 7 | R=rotation_matrix(X); 8 | 9 | G=1/4*[X(1,1)+X(2,1)+X(3,1)+X(4,1); 10 | X(1,2)+X(2,2)+X(3,2)+X(4,2); 11 | X(1,3)+X(2,3)+X(3,3)+X(4,3)]; 12 | 13 | Pl(1)=1/4*(x(1,1)*(1+r)*(1+s)+x(2,1)*(1-r)*(1+s)... 14 | +x(3,1)*(1-r)*(1-s)+x(4,1)*(1+r)*(1-s)); 15 | 16 | Pl(2)=1/4*(x(1,2)*(1+r)*(1+s)+x(2,2)*(1-r)*(1+s)... 17 | +x(3,2)*(1-r)*(1-s)+x(4,2)*(1+r)*(1-s)); 18 | 19 | Pl(3)=0; 20 | 21 | Pg=R*Pl'; 22 | 23 | P(1)=Pg(1)+G(1); 24 | P(2)=Pg(2)+G(2); 25 | P(3)=Pg(3)+G(3); 26 | 27 | end 28 | -------------------------------------------------------------------------------- /fsa/ULS Analysis/TANGENT METHOD preliminary/lenp.m: -------------------------------------------------------------------------------- 1 | function [ln,en,lp,ep]=lenp(l,e) 2 | 3 | 4 | i=length(e)+1; 5 | 6 | c1=1; 7 | c2=1; 8 | 9 | for j=1:i-1 10 | 11 | if e(j)<0 12 | 13 | lni(c1)=l(c1); 14 | 15 | ni(c1)=j; 16 | 17 | c1=c1+1; 18 | 19 | else 20 | 21 | lpi(c2)=l(c2); 22 | 23 | pi(c2)=j; 24 | 25 | c2=c2+1; 26 | 27 | end 28 | 29 | end 30 | 31 | [ln,index1]=min(lni); 32 | 33 | en=e(ni(index1)); 34 | 35 | [lp,index2]=max(lpi); 36 | 37 | ep=e(pi(index2)); 38 | 39 | 40 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/tests/test.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | concrete.section=[-150 -300;150 -300;150 300;-150 300]; 8 | concrete.fck=20.75; 9 | fck=concrete.fck; 10 | soc=0.85*fck/1.6; 11 | concrete.constitutivelaw=soc*[10^3,-1.23825*10^5,-1.61536*10^8,6.26558*10^10,-6.58692*10^12]; 12 | concrete.E0=1000*soc; 13 | 14 | steel.section=[-120 -270 314.2;120 -270 314.2;120 270 314.2;-120 270 314.2]; 15 | steel.constitutivelaw=[210000,375]; 16 | steel.E0=210000; 17 | 18 | elim=[-0.0035,0.01]; 19 | 20 | f0=[0 0 -0.17e9;1 0 0]; 21 | 22 | tol=10^-5; 23 | 24 | fu=ULS(concrete,steel,f0,elim,tol) -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/firstareamoment.m: -------------------------------------------------------------------------------- 1 | function S=firstareamoment(concrete,steel) 2 | 3 | 4 | M=[0 1;-1 0]; 5 | 6 | Pc=concrete.section; 7 | Ps=steel.section; 8 | 9 | Ss=[sum(Ps(2).*Ps(3));sum(Ps(1).*Ps(3))]; 10 | 11 | n=length(Pc); 12 | 13 | Sc=[0;0]; 14 | 15 | for i=1:n 16 | 17 | ri=Pc(i,:)'; 18 | 19 | if i0) && (j<=i-1) 9 | 10 | j=j+1; 11 | 12 | end 13 | 14 | if j==i 15 | 16 | cond=1; 17 | 18 | else 19 | 20 | cond=0; 21 | 22 | end 23 | 24 | if cond==0 25 | 26 | [ln,en,lp,ep]=lenp(l,e); 27 | 28 | lmbd=(ep*ln-en*lp)/(ep-en); 29 | 30 | else 31 | 32 | if e(i-1)tol 23 | 24 | uh=ui; 25 | 26 | uit=K\f; 27 | 28 | a=alpha(uit,concrete,steel,elim); 29 | 30 | l=a*l; 31 | 32 | f=fd+l*fl; 33 | 34 | ui=a*uit; 35 | 36 | K=secstiff(concrete,steel,ui); 37 | 38 | fr=K*ui; 39 | 40 | cont=cont+1 41 | 42 | err=abs(1-a)+norm(ui-uh)/norm(ui)+norm(f-fr)/norm(f) 43 | 44 | end 45 | 46 | fu=fd+l*fl; 47 | 48 | 49 | end -------------------------------------------------------------------------------- /asef/risolvi.m: -------------------------------------------------------------------------------- 1 | function [nodo,Mp]=risolvi(nodo,trave) 2 | [K,M,F,v,C]=assemblaggio(nodo,trave); 3 | gdlv=find(v); 4 | gdll=find(ones(length(v),1)-v); 5 | Kvl=K(gdlv,gdll); 6 | Kll=K(gdll,gdll); 7 | d=zeros(6*length(nodo)); 8 | d(gdll)=Kll\F(gdll); 9 | F(gdlv)=Kvl*d(gdll); 10 | Mll=M(gdll,gdll); 11 | W=Mll\Kll; 12 | [phi,w2]=eig(W); 13 | w=zeros(size(w2,1),1); 14 | for i=1:length(w) 15 | w(i)=sqrt(w2(i,i)); 16 | end 17 | [~,ordine]=sort(w); 18 | PHI=zeros(6*length(nodo),size(phi,2)); 19 | PHI(gdll,:)=phi(:,ordine); 20 | for n=1:length(nodo) 21 | nodo(n).azioni=F(6*n-5:6*n); 22 | nodo(n).spostamenti=d(6*n-5:6*n); 23 | nodo(n).modi=PHI(6*n-5:6*n,:); 24 | end 25 | Mp=zeros(6,size(PHI,2)); 26 | for m=1:size(PHI,2) 27 | den=PHI(:,m)'*M*PHI(:,m); 28 | num=(PHI(:,m)'*M*C).^2; 29 | Mp(:,m)=num/den; 30 | end -------------------------------------------------------------------------------- /pasm/plane stress element/read_ne.m: -------------------------------------------------------------------------------- 1 | function [node,element]=read_ne(listanodi,listaelementi) 2 | 3 | nodes = fopen(listanodi); 4 | N=textscan(nodes,'%d %f %f %f'); 5 | fclose(nodes); 6 | 7 | elem = fopen(listaelementi); 8 | E=textscan(elem,'%d %*d %*d %*d %*d %*d %d %d %d %d'); 9 | fclose(elem); 10 | 11 | 12 | num_n=N{1}; 13 | ics=N{2}; 14 | ipsilon=N{3}; 15 | zeta=N{4}; 16 | 17 | for i=1:length(num_n) 18 | 19 | idntf_n=num_n(i); 20 | 21 | node(idntf_n).coordinates=[ics(i);ipsilon(i);zeta(i)]; 22 | 23 | end 24 | 25 | 26 | num_e=E{1}; 27 | conn1=E{2}; 28 | conn2=E{3}; 29 | conn3=E{4}; 30 | conn4=E{5}; 31 | 32 | for i=1:length(num_e) 33 | 34 | idntf_e=num_e(i); 35 | 36 | element(idntf_e).connections=[conn1(i);conn2(i);conn3(i);conn4(i)]; 37 | 38 | end 39 | 40 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/assemble.m: -------------------------------------------------------------------------------- 1 | function [K,f,v]=assemble(node,element) 2 | 3 | 4 | K=zeros(6*length(node)); 5 | f=zeros(6*length(node),1); 6 | v=zeros(6*length(node),1); 7 | 8 | for e=1:length(element) 9 | 10 | ni=element(e).connections(1); 11 | nf=element(e).connections(2); 12 | 13 | Ke=globalelementstiffness(node,element(e)); 14 | 15 | K(6*ni-5:6*ni,6*ni-5:6*ni)=K(6*ni-5:6*ni,6*ni-5:6*ni)+Ke(1:6,1:6); 16 | K(6*ni-5:6*ni,6*nf-5:6*nf)=K(6*ni-5:6*ni,6*nf-5:6*nf)+Ke(1:6,7:12); 17 | K(6*nf-5:6*nf,6*ni-5:6*ni)=K(6*nf-5:6*nf,6*ni-5:6*ni)+Ke(7:12,1:6); 18 | K(6*nf-5:6*nf,6*nf-5:6*nf)=K(6*nf-5:6*nf,6*nf-5:6*nf)+Ke(7:12,7:12); 19 | 20 | end 21 | 22 | for n=1:length(node) 23 | 24 | f(6*n-5:6*n)=f(6*n-5:6*n)+node(n).forces; 25 | v(6*n-5:6*n)=v(6*n-5:6*n)+node(n).constraints; 26 | 27 | end 28 | 29 | 30 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/Gmatrix.m: -------------------------------------------------------------------------------- 1 | function G=Gmatrix(node,element) 2 | 3 | 4 | ni=element.connections(1); 5 | nf=element.connections(2); 6 | 7 | xyzi=node(ni).xyz; 8 | xyzf=node(nf).xyz; 9 | 10 | di=node(ni).displacements; 11 | df=node(nf).displacements; 12 | 13 | ui=di(1:3); 14 | uf=df(1:3); 15 | 16 | [Rg1,Rg2]=Rgmatrix(node,element); 17 | 18 | R0=R0matrix(node,element); 19 | 20 | [q1,q2,q]=qvector(Rg1,Rg2,R0); 21 | 22 | Rr=Rrmatrix(node,element); 23 | 24 | c=Rr'*q; 25 | c1=Rr'*q1; 26 | c2=Rr'*q2; 27 | 28 | n=c(1)/c(2); 29 | n11=c1(1)/c(2); 30 | n12=c1(2)/c(2); 31 | n21=c2(1)/c(2); 32 | n22=c2(2)/c(2); 33 | 34 | ln=norm(xyzf+uf-xyzi-ui); 35 | 36 | G=zeros(12,3); 37 | 38 | G(3,1)=n/ln; 39 | G(4,1)=n12/2; 40 | G(5,1)=-n11/2; 41 | G(9,1)=-n/ln; 42 | G(10,1)=n22/2; 43 | G(11,1)=-n21/2; 44 | G(3,2)=1/ln; 45 | G(9,2)=-1/ln; 46 | G(2,3)=-1/ln; 47 | G(8,3)=1/ln; 48 | 49 | 50 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/clERRE.m: -------------------------------------------------------------------------------- 1 | function clR=clERRE(m,j) 2 | 3 | 4 | switch m 5 | 6 | case 0 7 | 8 | clR=0; 9 | 10 | case 1 11 | 12 | switch j 13 | 14 | case 1 15 | 16 | clR=0; 17 | 18 | case 2 19 | 20 | clR=1; 21 | 22 | end 23 | 24 | case 2 25 | 26 | switch j 27 | 28 | case 1 29 | 30 | clR=0; 31 | 32 | case 2 33 | 34 | clR=1; 35 | 36 | case 3 37 | 38 | clR=1; 39 | 40 | case 4 41 | 42 | clR=2; 43 | 44 | end 45 | 46 | 47 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/secproperty.m: -------------------------------------------------------------------------------- 1 | function S=secproperty(concrete,steel,ui,m) 2 | 3 | 4 | M=[0 1;-1 0]; 5 | 6 | e0i=ui(1); 7 | 8 | gi=ui(2:3); 9 | 10 | P=concrete.section; 11 | 12 | n=length(P); 13 | 14 | P(n+1,:)=P(1,:); 15 | 16 | a=concrete.constitutivelaw; 17 | 18 | Sc=0; 19 | 20 | for q=0:4 21 | 22 | for i=1:n 23 | 24 | ri=P(i,:)'; 25 | 26 | rj=P(i+1,:)'; 27 | 28 | rjo=M*rj; 29 | 30 | for j=1:2*m 31 | 32 | for k=0:q 33 | 34 | Sc=Sc+(Bq(m,q,a,e0i)*(ri'*rjo)*ERRE(m,j,i,P)*... 35 | nchoosek(q,k)/nchoosek(m+q,k+clERRE(m,j))*... 36 | (ri'*gi)^(q-k)*(rj'*gi)^k); 37 | 38 | end 39 | 40 | end 41 | 42 | end 43 | 44 | end 45 | 46 | Ss=secpropsteel(steel,ui,m); 47 | 48 | S=Sc+Ss; 49 | 50 | 51 | end -------------------------------------------------------------------------------- /fsa/ULS Analysis/SECANT METHOD/ERRE.m: -------------------------------------------------------------------------------- 1 | function R=ERRE(m,j,i,P) 2 | 3 | 4 | switch m 5 | 6 | case 0 7 | 8 | R=1; 9 | 10 | case 1 11 | 12 | switch j 13 | 14 | case 1 15 | 16 | R=P(i,:)'; 17 | 18 | case 2 19 | 20 | R=P(i+1,:)'; 21 | 22 | end 23 | 24 | case 2 25 | 26 | switch j 27 | 28 | case 1 29 | 30 | R=P(i,:)*P(i,:)'; 31 | 32 | case 2 33 | 34 | R=P(i,:)*P(i+1,:)'; 35 | 36 | case 3 37 | 38 | R=P(i+1,:)*P(i,:)'; 39 | 40 | case 4 41 | 42 | R=P(i+1,:)*P(i+1,:)'; 43 | 44 | end 45 | 46 | 47 | end -------------------------------------------------------------------------------- /pasm/plane stress element/vonMises_colour.m: -------------------------------------------------------------------------------- 1 | function colour=vonMises_colour(sigma_vonMises,sigma_y,s) 2 | 3 | 4 | %colours RGB 5 | 6 | colours(1:3,1)=[0 0 128]; %blu marino 7 | colours(1:3,2)=[0 71 171]; %cobalto 8 | colours(1:3,3)=[0 255 255]; %ciano 9 | colours(1:3,4)=[0 255 0]; %verde 10 | colours(1:3,5)=[173 255 47]; %verde giallo 11 | colours(1:3,6)=[255 255 0]; %giallo 12 | colours(1:3,7)=[255 153 0]; %arancione 13 | colours(1:3,8)=[255 0 0]; %rosso 14 | colours(1:3,9)=[199 21 133]; %rosso violaceo 15 | colours(1:3,10)=[252 15 192]; %rosa shocking 16 | 17 | white=[255 255 255]; 18 | 19 | 20 | %colorous RGB MatLab 21 | 22 | colour_RGB_MatLab=zeros(3,10); 23 | 24 | for i=1:10 25 | 26 | colour_RGB_MatLab(1:3,i)=colours(1:3,i)./white'; 27 | 28 | end 29 | 30 | 31 | %colour evaluation 32 | 33 | sigma_max=sigma_y/s; 34 | 35 | D=sigma_max/10; 36 | 37 | n=ceil(sigma_vonMises/D); 38 | 39 | if n<=10 40 | 41 | colour=colour_RGB_MatLab(1:3,n)'; 42 | 43 | else 44 | 45 | colour=[0 0 0]; 46 | 47 | end 48 | 49 | 50 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/sectionstiffstress.m: -------------------------------------------------------------------------------- 1 | function [Ks,s]=sectionstiffstress(P1,P2,P3,element,e) 2 | 3 | 4 | E=element.material.E; 5 | Et=element.material.Et; 6 | G=element.material.G; 7 | sy=element.material.sy; 8 | 9 | A1=area(P1); 10 | A2=area(P2); 11 | A3=area(P3); 12 | 13 | S1=Iareamoment(P1); 14 | S2=Iareamoment(P2); 15 | S3=Iareamoment(P3); 16 | 17 | J1=IIareamoment(P1); 18 | J2=IIareamoment(P2); 19 | J3=IIareamoment(P3); 20 | 21 | Ks1=[Et*A1, Et*S1(1), Et*S1(2), 0; 22 | Et*S1(1), Et*J1(1,1), Et*J1(1,2), 0; 23 | Et*S1(2), Et*J1(2,1), Et*J1(2,2), 0; 24 | 0, 0, 0, G*(J1(1,1)+J1(2,2))]; 25 | 26 | Ks2=[E*A2, E*S2(1), E*S2(2), 0; 27 | E*S2(1), E*J2(1,1), E*J2(1,2), 0; 28 | E*S2(2), E*J2(2,1), E*J2(2,2), 0; 29 | 0, 0, 0, G*(J2(1,1)+J2(2,2))]; 30 | 31 | Ks3=[Et*A3, Et*S3(1), Et*S3(2), 0; 32 | Et*S3(1), Et*J3(1,1), Et*J3(1,2), 0; 33 | Et*S3(2), Et*J3(2,1), Et*J3(2,2), 0; 34 | 0, 0, 0, G*(J3(1,1)+J3(2,2))]; 35 | 36 | Ks=Ks1+Ks2+Ks3; 37 | 38 | s=Ks*e; 39 | 40 | s(1)=s(1)+sy*(1-Et/E)*(A3-A1); 41 | s(2:3)=s(2:3)+sy*(1-Et/E)*(S3-S1); 42 | 43 | 44 | end -------------------------------------------------------------------------------- /pasm/plane stress element/stress.m: -------------------------------------------------------------------------------- 1 | function node=stress(node,element) 2 | 3 | for e=1:length(element) 4 | 5 | connections=element(e).connections; 6 | 7 | X=XYZ(node,connections); 8 | x=translrotatetolocal(X); 9 | 10 | R=rotation_matrix(X); 11 | 12 | E=element(e).E; 13 | ni=element(e).ni; 14 | 15 | C=elasticity_matrix_m(E,ni); 16 | 17 | u=zeros(8,1); 18 | 19 | for n=1:4 20 | 21 | c=connections(n); 22 | 23 | d_g=node(c).displacement'; 24 | 25 | d_l=R'*d_g; 26 | 27 | u(n)=d_l(1); 28 | u(n+4)=d_l(2); 29 | 30 | end 31 | 32 | rs=[1 1;-1 1;-1 -1;1 -1]; 33 | 34 | for n=1:4 35 | 36 | r=rs(n,1); 37 | s=rs(n,2); 38 | 39 | B=strain_operator_m(x,r,s); 40 | 41 | eps=B*u; 42 | 43 | sigma=C*eps; 44 | 45 | c=connections(n); 46 | 47 | node(c).stresses=sigma; 48 | 49 | end 50 | 51 | end 52 | 53 | 54 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/sectionstiffstress.m: -------------------------------------------------------------------------------- 1 | function [Ks,s]=sectionstiffstress(P1,P2,P3,element,e) 2 | 3 | 4 | E=element.material.E; 5 | Et=element.material.Et; 6 | G=element.material.G; 7 | sy=element.material.sy; 8 | 9 | A1=area(P1); 10 | A2=area(P2); 11 | A3=area(P3); 12 | 13 | S1=Iareamoment(P1); 14 | S2=Iareamoment(P2); 15 | S3=Iareamoment(P3); 16 | 17 | J1=IIareamoment(P1); 18 | J2=IIareamoment(P2); 19 | J3=IIareamoment(P3); 20 | 21 | Ks1=[Et*A1, Et*S1(1), Et*S1(2), 0; 22 | Et*S1(1), Et*J1(1,1), Et*J1(1,2), 0; 23 | Et*S1(2), Et*J1(2,1), Et*J1(2,2), 0; 24 | 0, 0, 0, G*(J1(1,1)+J1(2,2))]; 25 | 26 | Ks2=[E*A2, E*S2(1), E*S2(2), 0; 27 | E*S2(1), E*J2(1,1), E*J2(1,2), 0; 28 | E*S2(2), E*J2(2,1), E*J2(2,2), 0; 29 | 0, 0, 0, G*(J2(1,1)+J2(2,2))]; 30 | 31 | Ks3=[Et*A3, Et*S3(1), Et*S3(2), 0; 32 | Et*S3(1), Et*J3(1,1), Et*J3(1,2), 0; 33 | Et*S3(2), Et*J3(2,1), Et*J3(2,2), 0; 34 | 0, 0, 0, G*(J3(1,1)+J3(2,2))]; 35 | 36 | Ks=Ks1+Ks2+Ks3; 37 | 38 | s=Ks*e; 39 | 40 | s(1)=s(1)+sy*(1-Et/E)*(A3-A1); 41 | s(2:3)=s(2:3)+sy*(1-Et/E)*(S3-S1); 42 | 43 | 44 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/resistingforces.m: -------------------------------------------------------------------------------- 1 | function fi=resistingforces(node,element) 2 | 3 | 4 | fi=zeros(6*length(node),1); 5 | 6 | for e=1:length(element) 7 | 8 | ni=element(e).connections(1); 9 | nf=element(e).connections(2); 10 | 11 | xyzi=node(ni).xyz; 12 | xyzf=node(nf).xyz; 13 | 14 | di=node(ni).displacements; 15 | df=node(nf).displacements; 16 | 17 | d=[di;df]; 18 | 19 | B=Bmatrix(node,element(e)); 20 | 21 | dl=B*d; 22 | 23 | ui=di(1:3); 24 | uf=df(1:3); 25 | 26 | ln=norm(xyzf+uf-xyzi-ui); 27 | 28 | B1=strainoperator(ln,-ln/(2*sqrt(3))); 29 | B2=strainoperator(ln,ln/(2*sqrt(3))); 30 | 31 | rbm=[7,4,5,6,10,11,12]; 32 | 33 | e1=B1(:,rbm)*dl; 34 | e2=B2(:,rbm)*dl; 35 | 36 | [~,s1]=fiberfree(element(e),e1); 37 | [~,s2]=fiberfree(element(e),e2); 38 | 39 | fl=ln/2*((B1(:,rbm))'*s1+(B2(:,rbm))'*s2); 40 | 41 | fg=B'*fl; 42 | 43 | fi(6*ni-5:6*ni)=fi(6*ni-5:6*ni)+fg(1:6); 44 | fi(6*nf-5:6*nf)=fi(6*nf-5:6*nf)+fg(7:12); 45 | 46 | end 47 | 48 | 49 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/fiberfree.m: -------------------------------------------------------------------------------- 1 | function [Ks,s]=fiberfree(element,e) 2 | 3 | 4 | Ks=zeros(4,4); 5 | s=zeros(4,1); 6 | 7 | for i=1:length(element.section) 8 | 9 | P=element.section(i).vertices; % chiudere la sezione col punto iniziale 10 | 11 | epsy=element.material.sy/element.material.E; 12 | 13 | [eps,I]=epsIvectors(P,e,epsy); 14 | 15 | [PT,IT]=cutpoints(P,eps,I,epsy); % contiene tutti i punti di divisione tra le aree 16 | 17 | [P1,P2,P3]=division(PT,IT); 18 | 19 | %%%%% PLOT AREE 1 3 2 (sigma<-sigmaY, sigma>sigmaY, -sigmaYtol 28 | 29 | if cont==1 30 | 31 | l(2)=lambda1(concrete,steel,u0,f0,elim); 32 | 33 | f=fd+l(2)*fl; 34 | 35 | u=procedureB(concrete,steel,f); 36 | 37 | e(2)=err(concrete,steel,u,elim); 38 | 39 | end 40 | 41 | l(cont+2)=lambda(l,e); 42 | 43 | f=fd+l(cont+2)*fl; 44 | 45 | u=procedureB(concrete,steel,f); 46 | 47 | e(cont+2)=err(concrete,steel,u,elim); 48 | 49 | error=e(cont+2) 50 | 51 | cont=cont+1 52 | 53 | end 54 | 55 | end 56 | 57 | fu=fd+l(cont+1)*fl; 58 | 59 | 60 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/assemble0.m: -------------------------------------------------------------------------------- 1 | function [K,f,v]=assemble0(node,element) 2 | 3 | 4 | K=zeros(6*length(node),6*length(node)); 5 | f=zeros(6*length(node),1); 6 | v=zeros(6*length(node),1); 7 | 8 | for t=1:length(element) 9 | 10 | ni=element(t).connections(1); 11 | nf=element(t).connections(2); 12 | 13 | xyzi=node(ni).xyz; 14 | xyzf=node(nf).xyz; 15 | 16 | L=norm(xyzf-xyzi); 17 | 18 | E=element(t).material.E; 19 | G=element(t).material.G; 20 | 21 | P=element(t).section(1).vertices; 22 | 23 | Ke=elementstiffness0(L,E,G,P); 24 | 25 | R=rotationmatrix(xyzi,xyzf,element(t).reference); 26 | T=RBMmatrix(L); 27 | 28 | Kl=T'*Ke*T; 29 | 30 | Kg=R'*Kl*R; 31 | 32 | K(6*ni-5:6*ni,6*ni-5:6*ni)=K(6*ni-5:6*ni,6*ni-5:6*ni)+Kg(1:6,1:6); 33 | K(6*ni-5:6*ni,6*nf-5:6*nf)=K(6*ni-5:6*ni,6*nf-5:6*nf)+Kg(1:6,7:12); 34 | K(6*nf-5:6*nf,6*ni-5:6*ni)=K(6*nf-5:6*nf,6*ni-5:6*ni)+Kg(7:12,1:6); 35 | K(6*nf-5:6*nf,6*nf-5:6*nf)=K(6*nf-5:6*nf,6*nf-5:6*nf)+Kg(7:12,7:12); 36 | 37 | end 38 | 39 | for i=1:length(node) 40 | 41 | f(6*i-5:6*i)=f(6*i-5:6*i)+node(i).forces; 42 | v(6*i-5:6*i)=v(6*i-5:6*i)+node(i).constraints; 43 | 44 | end 45 | 46 | 47 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/fisrtNRiter.m: -------------------------------------------------------------------------------- 1 | function [node,Dl0,Dp0,DL,f,v,free,R]=fisrtNRiter(node,element,nstep,psi,tol,C) 2 | 3 | 4 | Dd=zeros(6*length(node),1); 5 | 6 | [~,f,v]=assemble(node,element); 7 | 8 | free=find(-v+ones(length(v),1)); 9 | 10 | Df=f/nstep; 11 | 12 | [K,~,~]=assemble(node,element); 13 | 14 | Dd(free)=K(free,free)\Df(free); 15 | 16 | for n=1:length(node) 17 | 18 | node(n).displacements=Dd(6*n-5:6*n); 19 | 20 | end 21 | 22 | fi=resistingforces(node,element); 23 | 24 | [r,R]=residual(Df,fi,v); 25 | 26 | iter=0; 27 | 28 | while R>tol && iter<100 29 | 30 | iter=iter+1; 31 | 32 | [K,~,~]=assemble(node,element); 33 | 34 | Dd(free)=K(free,free)\r(free); 35 | 36 | for n=1:length(node) 37 | 38 | node(n).displacements=node(n).displacements+Dd(6*n-5:6*n); 39 | 40 | end 41 | 42 | fi=resistingforces(node,element); 43 | 44 | [r,R]=residual(Df,fi,v); 45 | 46 | end 47 | 48 | drawdiagram(C,node,fi,1); 49 | 50 | Dl0=1/nstep; 51 | 52 | Dp0=zeros(6*length(node),1); 53 | 54 | for n=1:length(node) 55 | 56 | Dp0(6*n-5:6*n)=node(n).displacements; 57 | 58 | end 59 | 60 | DL=sqrt(Dp0'*Dp0+psi^2*Dl0^2*(f'*f)); 61 | 62 | 63 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/tests/testFEMappoggeappogg.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | node(1).xyz=[0;0;0]; 8 | node(2).xyz=[500;0;0]; 9 | node(3).xyz=[1000;0;0]; 10 | 11 | element(1).connections=[1;2]; 12 | element(2).connections=[2;3]; 13 | 14 | for i=1:length(element) 15 | 16 | element(i).material.E=210000; 17 | element(i).material.Et=210000/10; 18 | element(i).material.G=77000; 19 | element(i).material.sy=220; 20 | 21 | square=[-10,-10;10,-10;10,10;-10,10;-10,-10]; 22 | element(i).section(1).vertices=square; 23 | element(i).section(2).vertices=square; 24 | element(i).reference=[0;1;0]; 25 | 26 | end 27 | 28 | node(1).constraints=[1;1;1;1;0;0]; 29 | node(2).constraints=[0;0;0;0;0;0]; 30 | node(3).constraints=[0;1;1;0;0;0]; 31 | 32 | node(1).forces=[0;0;0;0;0;0]; 33 | node(2).forces=[0;-10*10^3;0;0;0;0]; 34 | node(3).forces=[0;0;0;0;0;0]; 35 | 36 | Nsteps=100; 37 | 38 | tol=10^-2; 39 | 40 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 41 | 42 | 43 | %%%%%%%%%%%%%% SOLVING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 44 | 45 | node=solveFFFincr(node,element,Nsteps,tol,C); 46 | 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /asef/funzioneforma.m: -------------------------------------------------------------------------------- 1 | function f=funzioneforma(l,x,n,d) 2 | switch n 3 | case 1 4 | switch d 5 | case 0 6 | f=-x/l+1/2; 7 | case 1 8 | f=-1/l; 9 | end 10 | case 2 11 | switch d 12 | case 0 13 | f=x/l+1/2; 14 | case 1 15 | f=1/l; 16 | end 17 | case 3 18 | switch d 19 | case 0 20 | f=2*x^3/l^3-3*x/(2*l)+1/2; 21 | case 1 22 | f=6*x^2/l^3-3/(2*l); 23 | case 2 24 | f=12*x/l^3; 25 | end 26 | case 4 27 | switch d 28 | case 0 29 | f=-2*x^3/l^3+3*x/(2*l)+1/2; 30 | case 1 31 | f=-6*x^2/l^3+3/(2*l); 32 | case 2 33 | f=-12*x/l^3; 34 | end 35 | case 5 36 | switch d 37 | case 0 38 | f=x^3/l^2-x^2/(2*l)-x/4+l/8; 39 | case 1 40 | f=3*x^2/l^2-x/l-1/4; 41 | case 2 42 | f=6*x/l^2-1/l; 43 | end 44 | case 6 45 | switch d 46 | case 0 47 | f=x^3/l^2+x^2/(2*l)-x/4-l/8; 48 | case 1 49 | f=3*x^2/l^2+x/l-1/4; 50 | case 2 51 | f=6*x/l^2+1/l; 52 | end 53 | end 54 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/loadmultipliers.m: -------------------------------------------------------------------------------- 1 | function l=loadmultipliers(node,element) 2 | 3 | 4 | MSMg=zeros(6*length(node)); 5 | GSMg=zeros(6*length(node)); 6 | 7 | [~,~,v]=assemble(node,element); 8 | free=find(-v+ones(length(v),1)); 9 | 10 | for e=1:length(element) 11 | 12 | ni=element(e).connections(1); 13 | nf=element(e).connections(2); 14 | 15 | MSM=materialstiffness(node,element(e)); 16 | 17 | MSMg(6*ni-5:6*ni,6*ni-5:6*ni)=MSMg(6*ni-5:6*ni,6*ni-5:6*ni)+MSM(1:6,1:6); 18 | MSMg(6*ni-5:6*ni,6*nf-5:6*nf)=MSMg(6*ni-5:6*ni,6*nf-5:6*nf)+MSM(1:6,7:12); 19 | MSMg(6*nf-5:6*nf,6*ni-5:6*ni)=MSMg(6*nf-5:6*nf,6*ni-5:6*ni)+MSM(7:12,1:6); 20 | MSMg(6*nf-5:6*nf,6*nf-5:6*nf)=MSMg(6*nf-5:6*nf,6*nf-5:6*nf)+MSM(7:12,7:12); 21 | 22 | end 23 | 24 | for e=1:length(element) 25 | 26 | ni=element(e).connections(1); 27 | nf=element(e).connections(2); 28 | 29 | GSM=geometricstiffness(node,element(e)); 30 | 31 | GSMg(6*ni-5:6*ni,6*ni-5:6*ni)=GSMg(6*ni-5:6*ni,6*ni-5:6*ni)+GSM(1:6,1:6); 32 | GSMg(6*ni-5:6*ni,6*nf-5:6*nf)=GSMg(6*ni-5:6*ni,6*nf-5:6*nf)+GSM(1:6,7:12); 33 | GSMg(6*nf-5:6*nf,6*ni-5:6*ni)=GSMg(6*nf-5:6*nf,6*ni-5:6*ni)+GSM(7:12,1:6); 34 | GSMg(6*nf-5:6*nf,6*nf-5:6*nf)=GSMg(6*nf-5:6*nf,6*nf-5:6*nf)+GSM(7:12,7:12); 35 | 36 | end 37 | 38 | [~,L]=eig(-GSMg(free,free)\MSMg(free,free)); 39 | 40 | l=diag(L); 41 | 42 | 43 | end -------------------------------------------------------------------------------- /pasm/plane stress element/plot_vonMises.m: -------------------------------------------------------------------------------- 1 | function plot_vonMises(node,element) 2 | 3 | 4 | for e=1:length(element) 5 | 6 | connections=element(e).connections; 7 | 8 | X=XYZ(node,connections); 9 | x=translrotatetolocal(X); 10 | 11 | R=rotation_matrix(X); 12 | 13 | E=element(e).E; 14 | ni=element(e).ni; 15 | sigma_y=element(e).Y; 16 | coeff=element(e).coeff; 17 | 18 | C=elasticity_matrix_m(E,ni); 19 | 20 | for r=-1:0.1:1 21 | 22 | for s=-1:0.1:1 23 | 24 | B=strain_operator_m(x,r,s); 25 | 26 | u=zeros(8,1); 27 | 28 | for n=1:4 29 | 30 | c=connections(n); 31 | 32 | d_g=node(c).displacement'; 33 | 34 | d_l=R'*d_g; 35 | 36 | u(n)=d_l(1); 37 | u(n+4)=d_l(2); 38 | 39 | end 40 | 41 | eps=B*u; 42 | 43 | sigma=C*eps; 44 | 45 | sigma_vonMises=sigma_eq_vonMises(sigma); 46 | 47 | clr=vonMises_colour(sigma_vonMises,sigma_y,coeff); 48 | 49 | P=chi(X,[r,s]); 50 | 51 | plot(P(1),P(2),'o','Color',clr); 52 | 53 | end 54 | 55 | end 56 | 57 | end 58 | 59 | end 60 | -------------------------------------------------------------------------------- /asef/tests/provarisolvi.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | nodo(1).xyz=[0;0;0]; 7 | nodo(2).xyz=[10;0;0]; 8 | nodo(3).xyz=[20;0;0]; 9 | trave(1).connessione=[1 2]; 10 | trave(2).connessione=[2 3]; 11 | trave(1).E=206000; 12 | trave(1).G=77000; 13 | cerchio=zeros(400,2); 14 | a=0; 15 | for r=1:400 16 | a=a+2*pi/400; 17 | cerchio(r,:)=.5*[cos(a) sin(a)]; 18 | end 19 | sezione=baricentrasezione(cerchio); 20 | trave(1).sezione=sezione; 21 | trave(1).carichi=[0;0;0;0;0;0]; 22 | trave(1).riferimento=[0;1;0]; 23 | trave(1).densita=7800; 24 | nodo(1).masse=[0;0;0;0;0;0]; 25 | nodo(2).masse=[0;0;0;0;0;0]; 26 | trave(2).E=206000; 27 | trave(2).G=77000; 28 | trave(2).sezione=sezione; 29 | trave(2).carichi=[0;0;0;0;0;0]; 30 | trave(2).riferimento=[0;1;0]; 31 | trave(2).densita=7800; 32 | nodo(3).masse=[0;0;0;0;0;0]; 33 | nodo(1).azioni=[0;0;0;0;0;0]; 34 | nodo(2).azioni=[0;0;10;0;0;0]; 35 | nodo(3).azioni=[0;0;0;0;0;0]; 36 | nodo(1).vincoli=[1;1;1;1;1;1]; 37 | nodo(2).vincoli=[0;0;0;0;0;0]; 38 | nodo(3).vincoli=[0;1;1;0;0;0]; 39 | trave(1).vincoli=[1;1;1;1;1;1;1;1;1;1;1;1]; 40 | trave(2).vincoli=[1;1;1;1;1;1;1;1;1;1;1;1]; 41 | [nodo,Mp]=risolvi(nodo,trave); 42 | numero_modi=size(nodo(1).modi,2); 43 | nsez=100; 44 | for modo=1:size(nodo(1).modi,2) 45 | trave=stress_displacement(nodo,trave,nsez,modo); 46 | scala=[0.01;0.1;10]; %=[ Mf ; T,N,Mt ; D,Dm ] 47 | % ! ! ! PERICOLO->vedi plotstruttura per spostamenti modali ! ! ! 48 | plotstruttura(nodo,trave,'Dm',scala); 49 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/NF.m: -------------------------------------------------------------------------------- 1 | function [Ki,fi,elemi]=NF(node,element,Dd,elemh) 2 | 3 | 4 | Ki=zeros(6*length(node)); 5 | fi=zeros(6*length(node),1); 6 | 7 | for b=1:length(element) 8 | 9 | [Ddi,L,R,T,ni,nf]=deassemble(node,element(b),Dd); 10 | 11 | sth1=elemh(b).sect(1).st; 12 | sth2=elemh(b).sect(2).st; 13 | feh=elemh(b).fe; 14 | eh1=elemh(b).sect(1).e; 15 | eh2=elemh(b).sect(2).e; 16 | 17 | [Ksh1,sh1]=fiberfree(element(b),eh1); 18 | [Ksh2,sh2]=fiberfree(element(b),eh2); 19 | 20 | S1=stressoperator(L,-L/(2*sqrt(3))); 21 | S2=stressoperator(L,L/(2*sqrt(3))); 22 | 23 | Feh=L/2*(S1'*(Ksh1\S1)+S2'*(Ksh2\S2)); 24 | 25 | Dfi=Feh\Ddi; 26 | 27 | Dsi1=S1*Dfi+sth1; 28 | Dsi2=S2*Dfi+sth2; 29 | 30 | Dei1=Ksh1\Dsi1; 31 | Dei2=Ksh2\Dsi2; 32 | 33 | ei1=eh1+Dei1; 34 | ei2=eh2+Dei2; 35 | 36 | [Ksi1,si1]=fiberfree(element(b),ei1); 37 | [Ksi2,si2]=fiberfree(element(b),ei2); 38 | 39 | Fei=L/2*(S1'*(Ksi1\S1)+S2'*(Ksi2\S2)); 40 | 41 | et1=Ksi1\(Dsi1-(si1-sh1)); 42 | et2=Ksi2\(Dsi2-(si2-sh2)); 43 | 44 | dt=L/2*(S1'*et1+S2'*et2); 45 | 46 | fei=feh+Dfi-Fei\dt; 47 | 48 | sti1=S1*fei-si1; 49 | sti2=S2*fei-si2; 50 | 51 | elemi(b).sect(1).st=sti1; 52 | elemi(b).sect(2).st=sti2; 53 | elemi(b).fe=fei; 54 | elemi(b).sect(1).e=ei1; 55 | elemi(b).sect(2).e=ei2; 56 | 57 | [Ki,fi]=assemble(Ki,fi,Fei,fei,R,T,ni,nf); 58 | 59 | end 60 | 61 | 62 | end -------------------------------------------------------------------------------- /pasm/plane stress element/test_plot_sigma.m: -------------------------------------------------------------------------------- 1 | function element=test_plot_sigma(node,element,comp) 2 | 3 | 4 | for e=1:length(element) 5 | 6 | connections=element(e).connections; 7 | 8 | X=XYZ(node,connections); 9 | x=translrotatetolocal(X); 10 | 11 | R=rotation_matrix(X); 12 | 13 | E=element(e).E; 14 | ni=element(e).ni; 15 | sigma_y=element(e).Y; 16 | coeff=element(e).coeff; 17 | 18 | C=elasticity_matrix_m(E,ni); 19 | 20 | for r=-1:0.1:1 21 | 22 | for s=-1:0.1:1 23 | 24 | B=strain_operator_m(x,r,s); 25 | 26 | u=zeros(8,1); 27 | 28 | for n=1:4 29 | 30 | c=connections(n); 31 | 32 | d_g=node(c).displacement'; 33 | 34 | d_l=R'*d_g; 35 | 36 | u(n)=d_l(1); 37 | u(n+4)=d_l(2); 38 | 39 | end 40 | 41 | eps=B*u; 42 | 43 | sigma=C*eps; 44 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 45 | if r==-1 && s==1 46 | 47 | element(e).stress=sigma; 48 | 49 | end 50 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 51 | sigmatoplot=sigma(comp); 52 | 53 | clr=colour(sigmatoplot,sigma_y,coeff); 54 | 55 | P=chi(X,[r,s]); 56 | 57 | plot(P(1),P(2),'o','Color',clr); 58 | 59 | end 60 | 61 | end 62 | 63 | end 64 | 65 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/tests/testFEMcorot_mensola.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | node(1).xyz=[0;0;0]; 8 | node(2).xyz=[100;0;0]; 9 | node(3).xyz=[200;0;0]; 10 | node(4).xyz=[300;0;0]; 11 | node(5).xyz=[400;0;0]; 12 | node(6).xyz=[500;0;0]; 13 | node(7).xyz=[600;0;0]; 14 | node(8).xyz=[700;0;0]; 15 | node(9).xyz=[800;0;0]; 16 | node(10).xyz=[900;0;0]; 17 | node(11).xyz=[1000;0;0]; 18 | 19 | element(1).connections=[1,2]; 20 | element(2).connections=[2,3]; 21 | element(3).connections=[3,4]; 22 | element(4).connections=[4,5]; 23 | element(5).connections=[5,6]; 24 | element(6).connections=[6,7]; 25 | element(7).connections=[7,8]; 26 | element(8).connections=[8,9]; 27 | element(9).connections=[9,10]; 28 | element(10).connections=[10,11]; 29 | 30 | for e=1:length(element) 31 | 32 | element(e).reference=[0;0;1]; 33 | element(e).material.E=10^7; 34 | element(e).material.Et=10^7/1; 35 | element(e).material.G=3.8462*10^6; 36 | element(e).material.sy=220; 37 | element(e).section(1).vertices=[-10,-10;10,-10;10,10;-10,10;-10,-10]; 38 | element(e).section(2).vertices=[-10,-10;10,-10;10,10;-10,10;-10,-10]; 39 | 40 | end 41 | 42 | for n=1:length(node) 43 | 44 | node(n).constraints=[0;0;0;0;0;0]; 45 | node(n).forces=[0;0;0;0;0;0]; 46 | node(n).displacements=[0;0;0;0;0;0]; 47 | 48 | end 49 | 50 | node(1).constraints=[1;1;1;1;1;1]; 51 | 52 | node(11).forces=[0;0;-10;0;0;0]; 53 | 54 | 55 | nstep=15; 56 | 57 | psi=0.05; 58 | 59 | tol=10^-1; 60 | 61 | C=[11,3]; 62 | 63 | 64 | 65 | %node=solveITER(node,element,nstep,tol,C); 66 | node=solveARCLENGTH(node,element,nstep,psi,tol,C); 67 | 68 | 69 | 70 | 71 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /fsa/Force formulation FEM/tests/testfiberfree.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | 6 | %%%%% Sezione a I 7 | rect1=[5,-50;5,0;-5,0;-5,-50;5,-50]+25*[zeros(5,1),ones(5,1)]; 8 | rect2=[-50,-5;50,-5;50,5;-50,5;-50,-5]+30*[zeros(5,1),ones(5,1)]; 9 | rect3=[-50,-5;50,-5;50,5;-50,5;-50,-5]-30*[zeros(5,1),ones(5,1)]; 10 | element.section(1).vertices=rect1; 11 | element.section(2).vertices=rect2; 12 | element.section(3).vertices=rect3; 13 | %%%%% Sezione quadrata cava 14 | % cornice_ext=[-25 -25;25 -25;25 25;-25 25;-25 -25]; 15 | % cornice_int=99/100*[-25 -25;-25 25;25 25;25 -25;-25 -25]; 16 | % element.section(1).vertices=cornice_ext; 17 | % element.section(2).vertices=cornice_int; 18 | element.material.sy=220; 19 | element.material.E=210000; 20 | element.material.Et=210000/10; 21 | element.material.G=77000; 22 | 23 | L=1000; 24 | 25 | S1=stressoperator(L,-L/(2*sqrt(3))); 26 | S2=stressoperator(L,L/(2*sqrt(3))); 27 | 28 | T=RBMmatrix(L); 29 | 30 | % e0=[0.0001;0.0001;0.0001;0.0001]; 31 | % l1=[0;1;0;0]; 32 | % l2=[0;1.04;0;0]; 33 | % l3=[0;1.05;0;0]; 34 | % e1=l1.*e0; 35 | % e2=l2.*e0; 36 | % e3=l3.*e0; 37 | 38 | e=10^-4*[0;0.6;0.45;0]; 39 | % e1=10^-4*[0;0.4151;0;0]; 40 | % e2=10^-4*[0;0.4714;0;0]; 41 | % e3=10^-4*[0;1;0;0]; 42 | 43 | 44 | [Ks,s]=fiberfree(element,e); 45 | % [Ks1,s1]=fiberfree(element,e1); 46 | % [Ks2,s2]=fiberfree(element,e2); 47 | % [Ks3,s3]=fiberfree(element,e3); 48 | 49 | 50 | % Fe1=L/2*(S1'*(Ks1\S1)+S2'*(Ks1\S2)); 51 | % Fe2=L/2*(S1'*(Ks2\S1)+S2'*(Ks2\S2)); 52 | % Fe3=L/2*(S1'*(Ks3\S1)+S2'*(Ks3\S2)); 53 | % 54 | % Kel1=T'*(Fe1\T); 55 | % Kel2=T'*(Fe2\T); 56 | % Kel3=T'*(Fe3\T); 57 | 58 | % PLOT SEZIONE 59 | figure(1) 60 | axis equal 61 | hold on 62 | for i=1:length(element.section) 63 | plot(element.section(i).vertices(:,1),element.section(i).vertices(:,2)) 64 | end 65 | 66 | 67 | -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/tests/preliminary_tests/testLOADMULTIPL.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | node(1).xyz=[0;0;0]; 8 | node(2).xyz=[100;0;0]; 9 | node(3).xyz=[200;0;0]; 10 | node(4).xyz=[300;0;0]; 11 | node(5).xyz=[400;0;0]; 12 | node(6).xyz=[500;0;0]; 13 | node(7).xyz=[600;0;0]; 14 | node(8).xyz=[700;0;0]; 15 | node(9).xyz=[800;0;0]; 16 | node(10).xyz=[900;0;0]; 17 | node(11).xyz=[1000;0;0]; 18 | 19 | element(1).connections=[1,2]; 20 | element(2).connections=[2,3]; 21 | element(3).connections=[3,4]; 22 | element(4).connections=[4,5]; 23 | element(5).connections=[5,6]; 24 | element(6).connections=[6,7]; 25 | element(7).connections=[7,8]; 26 | element(8).connections=[8,9]; 27 | element(9).connections=[9,10]; 28 | element(10).connections=[10,11]; 29 | 30 | for e=1:length(element) 31 | 32 | element(e).reference=[0;0;1]; 33 | element(e).material.E=10^7; 34 | element(e).material.Et=10^7/10; 35 | element(e).material.G=3.8462*10^6; 36 | element(e).material.sy=220; 37 | element(e).section(1).vertices=5*[-10,-10;10,-10;10,10;-10,10;-10,-10]; 38 | element(e).section(2).vertices=5*[-10,-10;10,-10;10,10;-10,10;-10,-10]; 39 | 40 | end 41 | 42 | for n=1:length(node) 43 | 44 | node(n).constraints=[0;0;0;0;0;0]; 45 | node(n).forces=[0;0;0;0;0;0]; 46 | node(n).displacements=[0;0;0;0;0;0]; 47 | 48 | end 49 | 50 | node(1).constraints=[1;1;1;1;1;1]; 51 | 52 | node(11).forces=[-1000*10^6;0;-1000*10^6;0;0;0]; 53 | 54 | 55 | nstep=1; 56 | 57 | psi=0.05; 58 | 59 | tol=10^-1; 60 | 61 | C=[1,3]; 62 | 63 | 64 | 65 | %node=solveITER(node,element,nstep,tol,C); 66 | %node=solveARCLENGTH(node,element,nstep,psi,tol,C); 67 | 68 | l=loadmultipliers(node,element); 69 | 70 | 71 | 72 | 73 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /pasm/plane stress element/assemble_m.m: -------------------------------------------------------------------------------- 1 | function [K_m,F_m,v]=assemble_m(node,element) 2 | 3 | n=length(node); 4 | 5 | K_m=zeros(3*n); 6 | F_m=zeros(3*n,1); 7 | v=zeros(3*n,1); 8 | 9 | for e=1:length(element) 10 | 11 | C=element(e).connections; 12 | X=XYZ(node,C); 13 | R=rotation_matrix(X); 14 | t=element(e).t; 15 | E=element(e).E; 16 | ni=element(e).ni; 17 | 18 | k_m=stiffness_matrix_m(X,t,E,ni); 19 | 20 | q=element(e).load; 21 | Fn_e=distributed_load(X,q); 22 | 23 | [k_m_g,f_g]=rotatetoglobal(k_m,Fn_e,R); 24 | 25 | for i=1:4 26 | 27 | for j=1:4 28 | 29 | c=C(i); 30 | d=C(j); 31 | 32 | K_m(c,d)=K_m(c,d)+k_m_g(i,j); 33 | K_m(c,d+n)=K_m(c,d+n)+k_m_g(i,j+4); 34 | K_m(c,d+2*n)=K_m(c,d+2*n)+k_m_g(i,j+8); 35 | K_m(c+n,d)=K_m(c+n,d)+k_m_g(i+4,j); 36 | K_m(c+n,d+n)=K_m(c+n,d+n)+k_m_g(i+4,j+4); 37 | K_m(c+n,d+2*n)=K_m(c+n,d+2*n)+k_m_g(i+4,j+8); 38 | K_m(c+2*n,d)=K_m(c+2*n,d)+k_m_g(i+8,j); 39 | K_m(c+2*n,d+n)=K_m(c+2*n,d+n)+k_m_g(i+8,j+4); 40 | K_m(c+2*n,d+2*n)=K_m(c+2*n,d+2*n)+k_m_g(i+8,j+8); 41 | 42 | end 43 | 44 | end 45 | 46 | for i=1:4 47 | 48 | c=C(i); 49 | 50 | F_m(c)=F_m(c)+f_g(i); 51 | F_m(c+n)=F_m(c+n)+f_g(i+4); 52 | F_m(c+2*n)=F_m(c+2*n)+f_g(i+8); 53 | 54 | end 55 | 56 | end 57 | 58 | for f=1:n 59 | 60 | Fn_n=node(f).forces; 61 | 62 | F_m(f)=F_m(f)+Fn_n(1); 63 | F_m(f+n)=F_m(f+n)+Fn_n(2); 64 | F_m(f+2*n)=F_m(f+2*n)+Fn_n(3); 65 | 66 | 67 | vn=node(f).constraints; 68 | 69 | v(f)=v(f)+vn(1); 70 | v(f+n)=v(f+n)+vn(2); 71 | v(f+2*n)=v(f+2*n)+vn(3); 72 | 73 | end 74 | 75 | end -------------------------------------------------------------------------------- /asef/stress_displacement.m: -------------------------------------------------------------------------------- 1 | function trave=stress_displacement(nodo,trave,nsez,modo) 2 | for t=1:length(trave) 3 | ni=trave(t).connessione(1); 4 | nf=trave(t).connessione(2); 5 | xyzi=nodo(ni).xyz; 6 | xyzf=nodo(nf).xyz; 7 | l=norm(xyzf-xyzi); 8 | E=trave(t).E; 9 | G=trave(t).G; 10 | P=trave(t).sezione; 11 | Ke=rigidezzaelemento(l,E,G,P); 12 | dg=[nodo(ni).spostamenti';nodo(nf).spostamenti']; 13 | v_rif=trave(t).riferimento; 14 | R=matriceriferimento(xyzi,xyzf,v_rif); 15 | dl=R*dg; 16 | dmg=[nodo(ni).modi(:,modo);nodo(nf).modi(:,modo)]; 17 | dml=R*dmg; 18 | q_glob=trave(t).carichi; 19 | q_loc=R(1:6,1:6)*q_glob; 20 | f=forzetrave(l,q_loc); 21 | gdlf=find(trave(t).vincoli); 22 | gdlr=find(ones(12,1)-trave(t).vincoli); 23 | if isempty(gdlr) 24 | Kc=Ke; 25 | fc=f'; 26 | else 27 | Kc(gdlf,gdlf)=Ke(gdlf,gdlf)-Ke(gdlf,gdlr)*(Ke(gdlr,gdlr)\Ke(gdlr,gdlf)); 28 | Kc(gdlf,gdlr)=zeros(length(gdlf),length(gdlr)); 29 | Kc(gdlr,gdlf)=zeros(length(gdlr),length(gdlf)); 30 | Kc(gdlr,gdlr)=zeros(length(gdlr),length(gdlr)); 31 | fc(gdlf)=f(gdlf)-Ke(gdlf,gdlr)*(Ke(gdlr,gdlr)\f(gdlr)); 32 | fc(gdlr)=zeros(length(gdlr),1); 33 | dl(gdlr)=Ke(gdlr,gdlr)\(-Ke(gdlr,gdlf)*dl(gdlf)); 34 | dml(gdlr)=Ke(gdlr,gdlr)\(-Ke(gdlr,gdlf)*dl(gdlf)); 35 | end 36 | fi=Kc*dl-fc'; 37 | delta=l/(nsez-1); 38 | for sez=1:nsez 39 | s=(sez-1)*delta; 40 | trave(t).T1(sez)=-fi(1)-q_loc(1)*s; 41 | trave(t).T2(sez)=-fi(2)-q_loc(2)*s; 42 | trave(t).N(sez)=-fi(3)-q_loc(3)*s; 43 | trave(t).M1(sez)=-fi(4)-fi(2)*s-q_loc(2)*s^2/2-q_loc(4)*s; 44 | trave(t).M2(sez)=-fi(5)+fi(1)*s+q_loc(1)*s^2/2-q_loc(5)*s; 45 | trave(t).M3(sez)=-fi(6)-q_loc(6)*s; 46 | u=R(1:6,1:6)'*(operatorespostamento(l,s-l/2)*dl); 47 | trave(t).spostamenti(:,sez)=u; 48 | um=R(1:6,1:6)'*(operatorespostamento(l,s-l/2)*dml); 49 | trave(t).spostamentimodali(:,sez)=um; 50 | end 51 | end 52 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/solveITER.m: -------------------------------------------------------------------------------- 1 | function node=solveITER(node,element,nstep,tol,C) 2 | 3 | 4 | Dd=zeros(6*length(node),1); 5 | 6 | [~,f0,v]=assemble(node,element); 7 | 8 | free=find(-v+ones(length(v),1)); 9 | 10 | Df=f0/nstep; 11 | 12 | for k=1:nstep 13 | 14 | disp(' ') 15 | disp('_______________________________________________') 16 | disp(' ') 17 | disp('N E W L O A D S T E P = ') 18 | disp(' ') 19 | disp(k) 20 | disp('_______________________________________________') 21 | disp(' ') 22 | 23 | fk=k*Df; 24 | 25 | [K,~,~]=assemble(node,element); 26 | 27 | Dd(free)=K(free,free)\Df(free); 28 | 29 | for n=1:length(node) 30 | 31 | node(n).displacements=node(n).displacements+Dd(6*n-5:6*n); 32 | 33 | end 34 | 35 | fi=resistingforces(node,element); 36 | 37 | [r,R]=residual(fk,fi,v); 38 | 39 | iter=0; 40 | 41 | disp('Iteration n. ') 42 | disp(iter) 43 | disp('Residual: ') 44 | disp(R) 45 | 46 | while R>tol && iter<100 47 | 48 | iter=iter+1; 49 | 50 | [K,~,~]=assemble(node,element); 51 | 52 | Dd(free)=K(free,free)\r(free); 53 | 54 | for n=1:length(node) 55 | 56 | node(n).displacements=node(n).displacements+Dd(6*n-5:6*n); 57 | 58 | end 59 | 60 | fi=resistingforces(node,element); 61 | 62 | [r,R]=residual(fk,fi,v); 63 | 64 | disp('-----------------------------------------------') 65 | disp('Iteration n. ') 66 | disp(iter) 67 | disp('Residual: ') 68 | disp(R) 69 | 70 | end 71 | 72 | drawdiagram(C,node,fi,k); 73 | 74 | end 75 | 76 | for n=1:length(node) 77 | 78 | node(n).forces=node(n).forces+fi(6*n-5:6*n); 79 | 80 | end 81 | 82 | 83 | end -------------------------------------------------------------------------------- /asef/modal_movie.m: -------------------------------------------------------------------------------- 1 | function modal_movie(nodo,trave,s_movie,q) 2 | if q 3 | video = VideoWriter('modal#.avi'); 4 | open(video); 5 | end 6 | figure('color','w') 7 | hold on 8 | axis vis3d 9 | xlabel('asse x') 10 | ylabel('asse y') 11 | zlabel('asse z') 12 | for t=1:length(trave) 13 | ni=trave(t).connessione(1); 14 | nf=trave(t).connessione(2); 15 | xyz(:,1)=nodo(ni).xyz; 16 | xyz(:,2)=nodo(nf).xyz; 17 | plot3(xyz(1,:),xyz(2,:),xyz(3,:)); 18 | l=norm(xyz(:,2)-xyz(:,1)); 19 | x3=(xyz(:,2)-xyz(:,1))/l; 20 | nsez=length(trave(t).M3); 21 | delta=l/(nsez-1); 22 | xyzs=zeros(3,nsez); 23 | drawDm=zeros(3,nsez); 24 | for sez=1:nsez 25 | xyzs(:,sez)=xyz(:,1)+delta*(sez-1)*x3; 26 | drawDm(:,sez)=xyzs(:,sez)+trave(t).spostamentimodali(1:3,sez)*s_movie; 27 | end 28 | plot3(drawDm(1,:),drawDm(2,:),drawDm(3,:),'g'); 29 | end 30 | axis tight 31 | set(gca,'nextplot','replacechildren'); 32 | frame=25; 33 | for j = 1:frame 34 | close all 35 | figure 36 | view([1,1,1]) 37 | hold on 38 | axis vis3d 39 | axis([-50 250 -50 250 -50 250]) 40 | xlabel('asse x') 41 | ylabel('asse y') 42 | zlabel('asse z') 43 | for t=1:length(trave) 44 | ni=trave(t).connessione(1); 45 | nf=trave(t).connessione(2); 46 | xyz(:,1)=nodo(ni).xyz; 47 | xyz(:,2)=nodo(nf).xyz; 48 | plot3(xyz(1,:),xyz(2,:),xyz(3,:)); 49 | l=norm(xyz(:,2)-xyz(:,1)); 50 | x3=(xyz(:,2)-xyz(:,1))/l; 51 | nsez=length(trave(t).M3); 52 | delta=l/(nsez-1); 53 | xyzs=zeros(3,nsez); 54 | drawDm=zeros(3,nsez); 55 | for sez=1:nsez 56 | xyzs(:,sez)=xyz(:,1)+delta*(sez-1)*x3; 57 | drawDm(:,sez)=xyzs(:,sez)+sin(2*pi*(j-1)/(frame))*trave(t).spostamentimodali(1:3,sez)*s_movie; 58 | end 59 | plot3(drawDm(1,:),drawDm(2,:),drawDm(3,:),'g'); 60 | end 61 | F(j) = getframe; 62 | end 63 | f=length(F); 64 | t=10;%number of repetitions 65 | for n=1:t-1 66 | F(n*frame+1:n*frame+f)=F(1:f); 67 | end 68 | if q 69 | writeVideo(video,F) 70 | close(video); 71 | end 72 | movie(F,100,frame); 73 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/solveFFF.m: -------------------------------------------------------------------------------- 1 | function node=solveFFF(node,element,Nsteps,tol,C) 2 | 3 | 4 | [K,f,v]=assemble0(node,element); 5 | 6 | Df=f/Nsteps; 7 | 8 | for k=1:Nsteps 9 | 10 | disp(' ') 11 | disp('_______________________________________________') 12 | disp(' ') 13 | disp('N E W L O A D S T E P = ') 14 | disp(k) 15 | disp('_______________________________________________') 16 | disp(' ') 17 | 18 | for e=1:length(element) 19 | 20 | elemi(e).sect(1).st=zeros(4,1); 21 | elemi(e).sect(2).st=zeros(4,1); 22 | elemi(e).fe=zeros(6,1); 23 | elemi(e).sect(1).e=zeros(4,1); 24 | elemi(e).sect(2).e=zeros(4,1); 25 | 26 | end 27 | 28 | fk=k*Df; 29 | 30 | di=solve0(K,fk,v); 31 | 32 | [Ki,fi,elemi]=NF(node,element,di,elemi); 33 | 34 | r=residual(fk,fi,v); 35 | 36 | R=norm(r); 37 | 38 | cont=0; 39 | 40 | disp('Iteration n. '); 41 | disp(cont) 42 | disp('Residual: ') 43 | disp(R) 44 | 45 | while R>tol && cont<100 46 | 47 | cont=cont+1; 48 | 49 | Dd=solve0(Ki,r,v); 50 | 51 | [Ki,fi,elemi]=NF(node,element,Dd,elemi); 52 | 53 | di=di+Dd; 54 | 55 | r=residual(fk,fi,v); 56 | 57 | R=norm(r); 58 | 59 | disp('-----------------------------------------------') 60 | disp('Iteration n. '); 61 | disp(cont) 62 | disp('Residual: ') 63 | disp(R) 64 | 65 | end 66 | 67 | %%%%%%%%%%%%%%%%%%% CREARE UNA FUNZIONE A PARTE !!!!! %%%%%%%%%%%%%%%%% 68 | c=(C(1)-1)*6+C(2); 69 | 70 | hold on 71 | 72 | plot(abs(di(c)),abs(fk(c)),'*'); 73 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 74 | 75 | end 76 | 77 | for n=1:length(node) 78 | 79 | node(n).forces=fi(6*n-5:6*n); 80 | node(n).displacements=di(6*n-5:6*n); 81 | 82 | end 83 | 84 | 85 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/solveFFFincr.m: -------------------------------------------------------------------------------- 1 | function node=solveFFFincr(node,element,Nsteps,tol,C) 2 | 3 | 4 | [Ki,f,v]=assemble0(node,element); 5 | 6 | Df=f/Nsteps; 7 | 8 | di=zeros(length(f),1); 9 | 10 | for e=1:length(element) 11 | 12 | elemi(e).sect(1).st=zeros(4,1); 13 | elemi(e).sect(2).st=zeros(4,1); 14 | elemi(e).fe=zeros(6,1); 15 | elemi(e).sect(1).e=zeros(4,1); 16 | elemi(e).sect(2).e=zeros(4,1); 17 | 18 | end 19 | 20 | for k=1:Nsteps 21 | 22 | disp(' ') 23 | disp('_______________________________________________') 24 | disp(' ') 25 | disp('N E W L O A D S T E P = ') 26 | disp(k) 27 | disp('_______________________________________________') 28 | disp(' ') 29 | 30 | fk=k*Df; 31 | 32 | dki=solve0(Ki,Df,v); 33 | 34 | [Ki,fi,elemi]=NF(node,element,dki,elemi); 35 | 36 | r=residual(fk,fi,v); 37 | 38 | R=norm(r); % display 39 | 40 | cont=0; 41 | 42 | disp('Iteration n. '); 43 | disp(cont) 44 | disp('Residual: ') 45 | disp(R) 46 | 47 | while R>tol && cont<100 48 | 49 | cont=cont+1; 50 | 51 | Dd=solve0(Ki,r,v); 52 | 53 | [Ki,fi,elemi]=NF(node,element,Dd,elemi); 54 | 55 | dki=dki+Dd; 56 | 57 | r=residual(fk,fi,v); 58 | 59 | R=norm(r); 60 | 61 | disp('-----------------------------------------------') 62 | disp('Iteration n. '); 63 | disp(cont) 64 | disp('Residual: ') 65 | disp(R) 66 | 67 | end 68 | 69 | di=di+dki; 70 | 71 | %%%%%%%%%%%% --- CREARE UNA FUNZIONE A PARTE --- %%%%%%%%%%%%%%%%%%%%%% 72 | c=(C(1)-1)*6+C(2); 73 | 74 | hold on 75 | 76 | plot(abs(di(c)),abs(fk(c)),'*'); 77 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 78 | 79 | end 80 | 81 | for n=1:length(node) 82 | 83 | node(n).forces=fi(6*n-5:6*n); 84 | node(n).displacements=di(6*n-5:6*n); 85 | 86 | end 87 | 88 | 89 | end -------------------------------------------------------------------------------- /pasm/plane stress element/tests/test_piastra_forata.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | %%%%%%%%%%%%%%%% PRE-PROCESSOR %%%%%%%%%%%%%%%% 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 11 | 12 | %%% create nodes & elements %%% 13 | 14 | [node,element]=read_ne('NLIST1.txt','ELIST1.txt'); 15 | % [node,element]=read_ne('NLIST2.txt','ELIST2.txt'); 16 | 17 | %%% material properties %%% 18 | 19 | for e=1:length(element) 20 | 21 | element(e).t=0.1; 22 | element(e).E=2e8; 23 | element(e).ni=0.3; 24 | element(e).Y=1000; 25 | element(e).coeff=1.5; 26 | 27 | end 28 | 29 | %%% define constraints %%% 30 | 31 | for n=1:length(node) 32 | 33 | C=node(n).coordinates; 34 | if C(2)==0 35 | node(n).constraints=[0;1;1]; 36 | else if C(1)==60 37 | node(n).constraints=[1;0;1]; 38 | else 39 | node(n).constraints=[0;0;1]; 40 | end 41 | end 42 | 43 | end 44 | 45 | %%% define loads %%% 46 | 47 | for n=1:length(node) 48 | 49 | C=node(n).coordinates; 50 | if C(2)==100 51 | node(n).forces=[0;100;0]; 52 | else 53 | node(n).forces=[0;0;0]; 54 | end 55 | 56 | end 57 | 58 | for e=1:length(element) 59 | 60 | element(e).load=[0;0]; 61 | 62 | end 63 | 64 | 65 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 66 | %%%%%%%%%%%%%%%%%%% SOLVING %%%%%%%%%%%%%%%%%%% 67 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 68 | 69 | node=solve_m(node,element); 70 | 71 | 72 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 73 | %%%%%%%%%%%%%%%% POST-PROCESSOR %%%%%%%%%%%%%%%% 74 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 75 | 76 | %%% plotting %%% 77 | 78 | plotstructure(node,element,'undeformed',1); 79 | %plotstructure(node,element,'deformed',10000); 80 | plot_vonMises(node,element); 81 | %element=test_plot_sigma(node,element,1); 82 | 83 | %%% stress %%% 84 | 85 | %node=stress(node,element); 86 | 87 | 88 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 89 | %%%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%% 90 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /asef/plotstruttura.m: -------------------------------------------------------------------------------- 1 | function plotstruttura(nodo,trave,diag,s) 2 | figure('color','w') 3 | hold on 4 | axis vis3d 5 | xlabel('asse x') 6 | ylabel('asse y') 7 | zlabel('asse z') 8 | for t=1:length(trave) 9 | ni=trave(t).connessione(1); 10 | nf=trave(t).connessione(2); 11 | xyz(:,1)=nodo(ni).xyz; 12 | xyz(:,2)=nodo(nf).xyz; 13 | plot3(xyz(1,:),xyz(2,:),xyz(3,:)); 14 | R=matriceriferimento(xyz(:,1),xyz(:,2),trave(t).riferimento); 15 | l=norm(xyz(:,2)-xyz(:,1)); 16 | x3=(xyz(:,2)-xyz(:,1))/l; 17 | nsez=length(trave(t).M3); 18 | delta=l/(nsez-1); 19 | xyzs=zeros(3,nsez); 20 | Mf=zeros(3,nsez); 21 | drawMf=zeros(3,nsez); 22 | T=zeros(3,nsez); 23 | drawT=zeros(3,nsez); 24 | N=zeros(3,nsez); 25 | drawN=zeros(3,nsez); 26 | Mt=zeros(3,nsez); 27 | drawMt=zeros(3,nsez); 28 | drawD=zeros(3,nsez); 29 | drawDm=zeros(3,nsez); 30 | for sez=1:nsez 31 | xyzs(:,sez)=xyz(:,1)+delta*(sez-1)*x3; 32 | switch diag 33 | case 'Mf' 34 | Mf(:,sez)=R(1:3,1:3)'*[-trave(t).M2(sez);trave(t).M1(sez);0]; 35 | drawMf(:,sez)=xyzs(:,sez)+Mf(:,sez)*s(1); 36 | case 'T' 37 | T(:,sez)=R(1:3,1:3)'*[trave(t).T1(sez);trave(t).T2(sez);0]; 38 | drawT(:,sez)=xyzs(:,sez)+T(:,sez)*s(2); 39 | case 'N' 40 | N(:,sez)=R(1:3,1:3)'*[trave(t).N(sez);0;0]; 41 | drawN(:,sez)=xyzs(:,sez)+N(:,sez)*s(2); 42 | case 'Mt' 43 | Mt(:,sez)=R(1:3,1:3)'*[trave(t).M3(sez);0;0]; 44 | drawMt(:,sez)=xyzs(:,sez)+Mt(:,sez)*s(2); 45 | case 'D' 46 | drawD(:,sez)=xyzs(:,sez)+trave(t).spostamenti(1:3,sez)*s(3); 47 | case 'Dm' 48 | drawDm(:,sez)=xyzs(:,sez)+trave(t).spostamentimodali(1:3,sez)*s(3); 49 | end 50 | end 51 | switch diag 52 | case 'Mf' 53 | plot3(drawMf(1,:),drawMf(2,:),drawMf(3,:),'r'); 54 | case 'T' 55 | plot3(drawT(1,:),drawT(2,:),drawT(3,:),'r'); 56 | case 'N' 57 | plot3(drawN(1,:),drawN(2,:),drawN(3,:),'r'); 58 | case 'Mt' 59 | plot3(drawMt(1,:),drawMt(2,:),drawMt(3,:),'r'); 60 | case 'D' 61 | plot3(drawD(1,:),drawD(2,:),drawD(3,:),'g'); 62 | case 'Dm' 63 | plot3(drawDm(1,:),drawDm(2,:),drawDm(3,:),'g'); 64 | end 65 | end 66 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/tests/preliminary_tests/testLEESFRAME.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | node(1).xyz=[0;0;0]; 8 | node(2).xyz=[0;12;0]; 9 | node(3).xyz=[0;24;0]; 10 | node(4).xyz=[0;36;0]; 11 | node(5).xyz=[0;48;0]; 12 | node(6).xyz=[0;60;0]; 13 | node(7).xyz=[0;72;0]; 14 | node(8).xyz=[0;84;0]; 15 | node(9).xyz=[0;96;0]; 16 | node(10).xyz=[0;108;0]; 17 | node(11).xyz=[0;120;0]; 18 | node(12).xyz=[12;120;0]; 19 | node(13).xyz=[24;120;0]; 20 | node(14).xyz=[36;120;0]; 21 | node(15).xyz=[48;120;0]; 22 | node(16).xyz=[60;120;0]; 23 | node(17).xyz=[72;120;0]; 24 | node(18).xyz=[84;120;0]; 25 | node(19).xyz=[96;120;0]; 26 | node(20).xyz=[108;120;0]; 27 | node(21).xyz=[120;120;0]; 28 | 29 | element(1).connections=[1,2]; 30 | element(2).connections=[2,3]; 31 | element(3).connections=[3,4]; 32 | element(4).connections=[4,5]; 33 | element(5).connections=[5,6]; 34 | element(6).connections=[6,7]; 35 | element(7).connections=[7,8]; 36 | element(8).connections=[8,9]; 37 | element(9).connections=[9,10]; 38 | element(10).connections=[10,11]; 39 | element(11).connections=[11,12]; 40 | element(12).connections=[12,13]; 41 | element(13).connections=[13,14]; 42 | element(14).connections=[14,15]; 43 | element(15).connections=[15,16]; 44 | element(16).connections=[16,17]; 45 | element(17).connections=[17,18]; 46 | element(18).connections=[18,19]; 47 | element(19).connections=[19,20]; 48 | element(20).connections=[20,21]; 49 | 50 | % plotstructure(node,element) 51 | % pause 52 | 53 | for e=1:length(element) 54 | 55 | element(e).reference=[0;0;1]; 56 | element(e).material.E=720; 57 | element(e).material.Et=720/1; 58 | element(e).material.G=300; 59 | element(e).material.sy=15; 60 | element(e).section(1).vertices=[-1,-1.5;1,-1.5;1,1.5;-1,1.5;-1,-1.5]; 61 | element(e).section(2).vertices=[-1,-1.5;1,-1.5;1,1.5;-1,1.5;-1,-1.5]; 62 | 63 | end 64 | 65 | for n=1:length(node) 66 | 67 | node(n).constraints=[0;0;0;0;0;0]; 68 | node(n).forces=[0;0;0;0;0;0]; 69 | node(n).displacements=[0;0;0;0;0;0]; 70 | 71 | end 72 | node(1).constraints=[1;1;1;0;1;0]; 73 | node(21).constraints=[1;1;1;0;0;0]; 74 | 75 | node(13).forces=[0;-10;0;0;0;0]; 76 | 77 | 78 | nstep=100; 79 | 80 | psi=1; 81 | 82 | tol=10^-1; 83 | 84 | C=[13,2]; 85 | 86 | 87 | 88 | %node=solveITER(node,element,nstep,tol,C); 89 | node=solveARCLENGTH(node,element,nstep,psi,tol,C); 90 | 91 | 92 | 93 | 94 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /asef/assemblaggio.m: -------------------------------------------------------------------------------- 1 | function [K,M,F,v,C]=assemblaggio(nodo,trave) 2 | K=zeros(6*length(nodo),6*length(nodo)); 3 | M=zeros(6*length(nodo),6*length(nodo)); 4 | F=zeros(6*length(nodo),1); 5 | v=zeros(6*length(nodo),1); 6 | C=zeros(6*length(nodo),6); 7 | for t=1:length(trave) 8 | ni=trave(t).connessione(1); 9 | nf=trave(t).connessione(2); 10 | xyzi=nodo(ni).xyz; 11 | xyzf=nodo(nf).xyz; 12 | l=norm(xyzf-xyzi); 13 | E=trave(t).E; 14 | G=trave(t).G; 15 | P=trave(t).sezione; 16 | Ke=rigidezzaelemento(l,E,G,P); 17 | rho=trave(t).densita; 18 | Me=massaelemento(l,P,rho); 19 | q_glob=trave(t).carichi; 20 | v_rif=trave(t).riferimento; 21 | R=matriceriferimento(xyzi,xyzf,v_rif); 22 | q_loc=R(1:6,1:6)*q_glob; 23 | f=forzetrave(l,q_loc); 24 | gdlf=find(trave(t).vincoli); 25 | gdlr=find(ones(12,1)-trave(t).vincoli); 26 | if isempty(gdlr) 27 | Kc=Ke; 28 | Mc=Me; 29 | fc=f'; 30 | else 31 | Kc(gdlf,gdlf)=Ke(gdlf,gdlf)-Ke(gdlf,gdlr)*(Ke(gdlr,gdlr)\Ke(gdlr,gdlf)); 32 | Kc(gdlf,gdlr)=zeros(length(gdlf),length(gdlr)); 33 | Kc(gdlr,gdlf)=zeros(length(gdlr),length(gdlf)); 34 | Kc(gdlr,gdlr)=zeros(length(gdlr),length(gdlr)); 35 | Mc(gdlf,gdlf)=Ke(gdlf,gdlf)-Ke(gdlf,gdlr)*(Ke(gdlr,gdlr)\Ke(gdlr,gdlf)); 36 | Mc(gdlf,gdlr)=zeros(length(gdlf),length(gdlr)); 37 | Mc(gdlr,gdlf)=zeros(length(gdlr),length(gdlf)); 38 | Mc(gdlr,gdlr)=zeros(length(gdlr),length(gdlr)); 39 | fc(gdlf)=f(gdlf);%-Ke(gdlf,gdlr)*(Ke(gdlr,gdlr)\f(gdlr)); 40 | fc(gdlr)=zeros(length(gdlr),1); 41 | end 42 | Kg=R'*Kc*R; 43 | Mg=R'*Mc*R; 44 | fg=R'*fc'; 45 | K(6*ni-5:6*ni,6*ni-5:6*ni)=K(6*ni-5:6*ni,6*ni-5:6*ni)+Kg(1:6,1:6); 46 | K(6*ni-5:6*ni,6*nf-5:6*nf)=K(6*ni-5:6*ni,6*nf-5:6*nf)+Kg(1:6,7:12); 47 | K(6*nf-5:6*nf,6*ni-5:6*ni)=K(6*nf-5:6*nf,6*ni-5:6*ni)+Kg(7:12,1:6); 48 | K(6*nf-5:6*nf,6*nf-5:6*nf)=K(6*nf-5:6*nf,6*nf-5:6*nf)+Kg(7:12,7:12); 49 | M(6*ni-5:6*ni,6*ni-5:6*ni)=M(6*ni-5:6*ni,6*ni-5:6*ni)+Mg(1:6,1:6); 50 | M(6*ni-5:6*ni,6*nf-5:6*nf)=M(6*ni-5:6*ni,6*nf-5:6*nf)+Mg(1:6,7:12); 51 | M(6*nf-5:6*nf,6*ni-5:6*ni)=M(6*nf-5:6*nf,6*ni-5:6*ni)+Mg(7:12,1:6); 52 | M(6*nf-5:6*nf,6*nf-5:6*nf)=M(6*nf-5:6*nf,6*nf-5:6*nf)+Mg(7:12,7:12); 53 | F(6*ni-5:6*ni)=F(6*ni-5:6*ni)+fg(1:6); 54 | F(6*nf-5:6*nf)=F(6*nf-5:6*nf)+fg(7:12); 55 | end 56 | 57 | for i=1:length(nodo) 58 | M(6*i-5:6*i,6*i-5:6*i)=M(6*i-5:6*i,6*i-5:6*i)+diag(nodo(i).masse); 59 | F(6*i-5:6*i)=F(6*i-5:6*i)+nodo(i).azioni; 60 | v(6*i-5:6*i)=v(6*i-5:6*i)+nodo(i).vincoli; 61 | C(6*i-5:6*i,:)=diag(ones(6,1)); 62 | end 63 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/solveARCLENGTH.m: -------------------------------------------------------------------------------- 1 | function node=solveARCLENGTH(node,element,nstep,psi,tol,C) 2 | 3 | 4 | % newton-raphson procedure (only first step) 5 | 6 | [node,Dl0,Dp0,DL,f,v,free,R]=fisrtNRiter(node,element,nstep,psi,tol,C); 7 | 8 | disp(' ') 9 | disp('_______________________________________________') 10 | disp(' ') 11 | disp('F I R S T S T E P') 12 | disp('_______________________________________________') 13 | disp(' ') 14 | disp('Newton-Raphson iter') 15 | disp(' ') 16 | disp('Residual: ') 17 | disp(R) 18 | 19 | % arc length procedure 20 | 21 | l=Dl0; 22 | 23 | Dp=Dp0; 24 | 25 | Dl=Dl0; 26 | 27 | for k=2:nstep 28 | 29 | disp(' ') 30 | disp('_______________________________________________') 31 | disp(' ') 32 | disp('N E W S T E P = ') 33 | disp(' ') 34 | disp(k) 35 | disp('_______________________________________________') 36 | disp(' ') 37 | 38 | for n=1:length(node) 39 | 40 | node(n).displacements=node(n).displacements+Dp(6*n-5:6*n); 41 | 42 | end 43 | 44 | l=l+Dl; 45 | 46 | fi=resistingforces(node,element); 47 | 48 | [g,~]=residual(fi,l*f,v); 49 | 50 | a=Dp'*Dp+psi^2*Dl^2*(f'*f)-DL^2; 51 | 52 | R=norm(g)+abs(a); 53 | 54 | iter=0; 55 | 56 | disp('-----------------------------------------------') 57 | disp('Arc length iter n. ') 58 | disp(iter) 59 | disp('Residual: ') 60 | disp(R) 61 | 62 | while R>tol && iter<100 63 | 64 | iter=iter+1; 65 | 66 | [K,~,~]=assemble(node,element); 67 | 68 | [dp,dl]=solveKaug(K,f,Dp,Dl,psi,g,a,free); 69 | 70 | Dp=Dp+dp; 71 | 72 | Dl=Dl+dl; 73 | 74 | for n=1:length(node) 75 | 76 | node(n).displacements=node(n).displacements+dp(6*n-5:6*n); 77 | 78 | end 79 | 80 | l=l+dl; 81 | 82 | fi=resistingforces(node,element); 83 | 84 | [g,~]=residual(fi,l*f,v); 85 | 86 | a=(Dp'*Dp)+psi^2*Dl^2*(f'*f)-DL^2; 87 | 88 | R=norm(g)+abs(a); 89 | 90 | disp('-----------------------------------------------') 91 | disp('Arc length iter n. ') 92 | disp(iter) 93 | disp('Residual: ') 94 | disp(R) 95 | 96 | end 97 | 98 | drawdiagram(C,node,fi,k); 99 | 100 | end 101 | 102 | for n=1:length(node) 103 | 104 | node(n).forces=node(n).forces+fi(6*n-5:6*n); 105 | 106 | end 107 | 108 | 109 | end -------------------------------------------------------------------------------- /fsa/Force formulation FEM/division.m: -------------------------------------------------------------------------------- 1 | function [P1,P2,P3]=division(PT,IT) 2 | 3 | 4 | P1=[]; 5 | P2=[]; 6 | P3=[]; 7 | 8 | for i=1:length(PT)-1 9 | 10 | v1=size(P1,1); 11 | v2=size(P2,1); 12 | v3=size(P3,1); 13 | 14 | if IT(i)==1 || IT(i+1)==1 15 | 16 | if v1==0 17 | 18 | P1(v1+1,1:2)=PT(i,:); 19 | P1(v1+2,1:2)=PT(i+1,:); 20 | 21 | else 22 | 23 | if P1(v1,:)==PT(i,:) 24 | 25 | P1(v1+1,1:2)=PT(i+1,:); 26 | 27 | else 28 | 29 | P1(v1+1,1:2)=PT(i,:); 30 | P1(v1+2,1:2)=PT(i+1,:); 31 | 32 | end 33 | 34 | end 35 | 36 | end 37 | 38 | if IT(i)==2 || IT(i+1)==2 39 | 40 | if v2==0 41 | 42 | P2(v2+1,1:2)=PT(i,:); 43 | P2(v2+2,1:2)=PT(i+1,:); 44 | 45 | else 46 | 47 | if P2(v2,:)==PT(i,:) 48 | 49 | P2(v2+1,1:2)=PT(i+1,:); 50 | 51 | else 52 | 53 | P2(v2+1,1:2)=PT(i,:); 54 | P2(v2+2,1:2)=PT(i+1,:); 55 | 56 | end 57 | 58 | end 59 | 60 | end 61 | 62 | if IT(i)==3 || IT(i+1)==3 63 | 64 | if v3==0 65 | 66 | P3(v3+1,1:2)=PT(i,:); 67 | P3(v3+2,1:2)=PT(i+1,:); 68 | 69 | else 70 | 71 | if P3(v3,:)==PT(i,:) 72 | 73 | P3(v3+1,1:2)=PT(i+1,:); 74 | 75 | else 76 | 77 | P3(v3+1,1:2)=PT(i,:); 78 | P3(v3+2,1:2)=PT(i+1,:); 79 | 80 | end 81 | 82 | end 83 | 84 | end 85 | 86 | if IT(i)==0 && IT(i+1)==0 87 | 88 | if v2==0 89 | 90 | P2(v2+1,1:2)=PT(i,:); 91 | P2(v2+2,1:2)=PT(i+1,:); 92 | 93 | else 94 | 95 | if P2(v2,:)==PT(i,:) 96 | 97 | P2(v2+1,1:2)=PT(i+1,:); 98 | 99 | else 100 | 101 | P2(v2+1,1:2)=PT(i,:); 102 | P2(v2+2,1:2)=PT(i+1,:); 103 | 104 | 105 | end 106 | 107 | end 108 | 109 | end 110 | 111 | end 112 | 113 | 114 | if ~isempty(P1) 115 | 116 | if P1(size(P1,1),:)==P1(1,:) 117 | 118 | open1=false; 119 | 120 | else 121 | 122 | open1=true; 123 | 124 | end 125 | 126 | if open1 127 | 128 | P1(size(P1,1)+1,:)=P1(1,:); 129 | 130 | end 131 | 132 | end 133 | 134 | if ~isempty(P2) 135 | 136 | if P2(size(P2,1),:)==P2(1,:) 137 | 138 | open2=false; 139 | 140 | else 141 | 142 | open2=true; 143 | 144 | end 145 | 146 | if open2 147 | 148 | P2(size(P2,1)+1,:)=P2(1,:); 149 | 150 | end 151 | 152 | end 153 | 154 | if ~isempty(P3) 155 | 156 | if P3(size(P3,1),:)==P3(1,:) 157 | 158 | open3=false; 159 | 160 | else 161 | 162 | open3=true; 163 | 164 | end 165 | 166 | if open3 167 | 168 | P3(size(P3,1)+1,:)=P3(1,:); 169 | 170 | end 171 | 172 | end 173 | 174 | 175 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/division.m: -------------------------------------------------------------------------------- 1 | function [P1,P2,P3]=division(PT,IT) 2 | 3 | 4 | P1=[]; 5 | P2=[]; 6 | P3=[]; 7 | 8 | for i=1:length(PT)-1 9 | 10 | v1=size(P1,1); 11 | v2=size(P2,1); 12 | v3=size(P3,1); 13 | 14 | if IT(i)==1 || IT(i+1)==1 15 | 16 | if v1==0 17 | 18 | P1(v1+1,1:2)=PT(i,:); 19 | P1(v1+2,1:2)=PT(i+1,:); 20 | 21 | else 22 | 23 | if P1(v1,:)==PT(i,:) 24 | 25 | P1(v1+1,1:2)=PT(i+1,:); 26 | 27 | else 28 | 29 | P1(v1+1,1:2)=PT(i,:); 30 | P1(v1+2,1:2)=PT(i+1,:); 31 | 32 | end 33 | 34 | end 35 | 36 | end 37 | 38 | if IT(i)==2 || IT(i+1)==2 39 | 40 | if v2==0 41 | 42 | P2(v2+1,1:2)=PT(i,:); 43 | P2(v2+2,1:2)=PT(i+1,:); 44 | 45 | else 46 | 47 | if P2(v2,:)==PT(i,:) 48 | 49 | P2(v2+1,1:2)=PT(i+1,:); 50 | 51 | else 52 | 53 | P2(v2+1,1:2)=PT(i,:); 54 | P2(v2+2,1:2)=PT(i+1,:); 55 | 56 | end 57 | 58 | end 59 | 60 | end 61 | 62 | if IT(i)==3 || IT(i+1)==3 63 | 64 | if v3==0 65 | 66 | P3(v3+1,1:2)=PT(i,:); 67 | P3(v3+2,1:2)=PT(i+1,:); 68 | 69 | else 70 | 71 | if P3(v3,:)==PT(i,:) 72 | 73 | P3(v3+1,1:2)=PT(i+1,:); 74 | 75 | else 76 | 77 | P3(v3+1,1:2)=PT(i,:); 78 | P3(v3+2,1:2)=PT(i+1,:); 79 | 80 | end 81 | 82 | end 83 | 84 | end 85 | 86 | if IT(i)==0 && IT(i+1)==0 87 | 88 | if v2==0 89 | 90 | P2(v2+1,1:2)=PT(i,:); 91 | P2(v2+2,1:2)=PT(i+1,:); 92 | 93 | else 94 | 95 | if P2(v2,:)==PT(i,:) 96 | 97 | P2(v2+1,1:2)=PT(i+1,:); 98 | 99 | else 100 | 101 | P2(v2+1,1:2)=PT(i,:); 102 | P2(v2+2,1:2)=PT(i+1,:); 103 | 104 | 105 | end 106 | 107 | end 108 | 109 | end 110 | 111 | end 112 | 113 | 114 | if ~isempty(P1) 115 | 116 | if P1(size(P1,1),:)==P1(1,:) 117 | 118 | open1=false; 119 | 120 | else 121 | 122 | open1=true; 123 | 124 | end 125 | 126 | if open1 127 | 128 | P1(size(P1,1)+1,:)=P1(1,:); 129 | 130 | end 131 | 132 | end 133 | 134 | if ~isempty(P2) 135 | 136 | if P2(size(P2,1),:)==P2(1,:) 137 | 138 | open2=false; 139 | 140 | else 141 | 142 | open2=true; 143 | 144 | end 145 | 146 | if open2 147 | 148 | P2(size(P2,1)+1,:)=P2(1,:); 149 | 150 | end 151 | 152 | end 153 | 154 | if ~isempty(P3) 155 | 156 | if P3(size(P3,1),:)==P3(1,:) 157 | 158 | open3=false; 159 | 160 | else 161 | 162 | open3=true; 163 | 164 | end 165 | 166 | if open3 167 | 168 | P3(size(P3,1)+1,:)=P3(1,:); 169 | 170 | end 171 | 172 | end 173 | 174 | 175 | end -------------------------------------------------------------------------------- /asef/tests/provafem2.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | %coordinate nodi 8 | nodo(1).xyz=[0;0;0]; 9 | nodo(2).xyz=[200;0;0]; 10 | nodo(3).xyz=[200;200;0]; 11 | nodo(4).xyz=[0;200;0]; 12 | nodo(5).xyz=[100;100;0]; 13 | nodo(6).xyz=[100;0;0]; 14 | nodo(7).xyz=[200;100;0]; 15 | nodo(8).xyz=[100;200;0]; 16 | nodo(9).xyz=[0;100;0]; 17 | nodo(10).xyz=[0;0;100]; 18 | nodo(11).xyz=[200;0;100]; 19 | nodo(12).xyz=[200;200;100]; 20 | nodo(13).xyz=[0;200;100]; 21 | nodo(14).xyz=[100;100;100]; 22 | nodo(15).xyz=[100;0;100]; 23 | nodo(16).xyz=[200;100;100]; 24 | nodo(17).xyz=[100;200;100]; 25 | nodo(18).xyz=[0;100;100]; 26 | nodo(19).xyz=[0;0;200]; 27 | nodo(20).xyz=[200;200;200]; 28 | nodo(21).xyz=[0;200;200]; 29 | nodo(22).xyz=[100;100;200]; 30 | nodo(23).xyz=[100;0;200]; 31 | nodo(24).xyz=[200;100;200]; 32 | nodo(25).xyz=[100;200;200]; 33 | nodo(26).xyz=[0;100;200]; 34 | 35 | %vincoli nodi 36 | for i=1:9 37 | nodo(i).vincoli=[1;1;1;1;1;1]; 38 | end 39 | for i=10:26 40 | nodo(i).vincoli=[0;0;0;0;0;0]; 41 | end 42 | 43 | %azioni nodi 44 | for i=1:26 45 | nodo(i).azioni=[0;0;0;0;0;0]; 46 | end 47 | nodo(11).azioni=[-100;0;0;0;0;0]; 48 | nodo(19).azioni=[0;100;0;0;0;0]; 49 | nodo(20).azioni=[0;-1000;0;0;0;0]; 50 | nodo(21).azioni=[0;0;0;0;0;-1000]; 51 | 52 | %masse nodi 53 | for i=1:26 54 | nodo(i).masse=[0;0;0;0;0;0]; 55 | end 56 | 57 | %connessioni travi 58 | trave(1).connessione=[1;10]; 59 | trave(2).connessione=[2;11]; 60 | trave(3).connessione=[3;12]; 61 | trave(4).connessione=[4;13]; 62 | trave(5).connessione=[5;14]; 63 | trave(6).connessione=[6;15]; 64 | trave(7).connessione=[7;16]; 65 | trave(8).connessione=[8;17]; 66 | trave(9).connessione=[9;18]; 67 | trave(10).connessione=[10;19]; 68 | trave(11).connessione=[12;20]; 69 | trave(12).connessione=[13;21]; 70 | trave(13).connessione=[14;22]; 71 | trave(14).connessione=[15;23]; 72 | trave(15).connessione=[16;24]; 73 | trave(16).connessione=[17;25]; 74 | trave(17).connessione=[18;26]; 75 | trave(18).connessione=[10;15]; 76 | trave(19).connessione=[15;11]; 77 | trave(20).connessione=[11;16]; 78 | trave(21).connessione=[16;12]; 79 | trave(22).connessione=[12;17]; 80 | trave(23).connessione=[17;13]; 81 | trave(24).connessione=[13;18]; 82 | trave(25).connessione=[18;10]; 83 | trave(26).connessione=[14;15]; 84 | trave(27).connessione=[14;16]; 85 | trave(28).connessione=[14;17]; 86 | trave(29).connessione=[14;18]; 87 | trave(30).connessione=[19;23]; 88 | trave(31).connessione=[24;20]; 89 | trave(32).connessione=[20;25]; 90 | trave(33).connessione=[25;21]; 91 | trave(34).connessione=[21;26]; 92 | trave(35).connessione=[26;19]; 93 | trave(36).connessione=[22;23]; 94 | trave(37).connessione=[22;24]; 95 | trave(38).connessione=[22;25]; 96 | trave(39).connessione=[22;26]; 97 | 98 | %riferimento travi 99 | for i=1:17 100 | trave(i).riferimento=[1;0;0]; 101 | end 102 | for i=18:39 103 | trave(i).riferimento=[0;0;1]; 104 | end 105 | 106 | %caratteristiche comuni travi 107 | quadrato=[-5 -5;5 -5;5 5;-5 5]; 108 | for i=1:39 109 | trave(i).carichi=[0;0;0;0;0;0]; 110 | trave(i).vincoli=[1;1;1;1;1;1;1;1;1;1;1;1]; 111 | trave(i).sezione=quadrato; 112 | trave(i).E=220000; 113 | trave(i).G=80000; 114 | trave(i).densita=7800; 115 | end 116 | trave(36).vincoli=[1;1;1;0;0;0;1;1;1;0;0;1]; 117 | trave(37).vincoli=[1;1;1;0;0;0;1;1;1;0;0;1]; 118 | trave(38).vincoli=[1;1;1;0;0;0;1;1;1;0;0;1]; 119 | trave(39).vincoli=[1;1;1;0;0;0;1;1;1;0;0;1]; 120 | 121 | trave(37).carichi=[0;10;0;0;0;0]; 122 | trave(39).carichi=[0;10;0;0;0;0]; 123 | 124 | 125 | 126 | 127 | 128 | nsez=10; 129 | 130 | nodo=risolvi(nodo,trave); 131 | 132 | %numero di modo per il calcolo degli SPOSTAMENTI MODALI: 133 | mod=69; 134 | 135 | trave=stress_displacement(nodo,trave,nsez,mod); 136 | 137 | % seleziona scala diagramma(M,N,T,Mt), deformata(D) o un modo(modal): 138 | s=[0.01;0.1;100]; 139 | s_movie=100; 140 | 141 | %plotstruttura(nodo,trave,'D',s,create avi? 0 or 1); 142 | modal_movie(nodo,trave,s_movie,1); 143 | 144 | numero_modi=size(nodo(1).modi,2); -------------------------------------------------------------------------------- /fsa/Force formulation FEM/tests/testFEMmensola.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | node(1).xyz=[0;0;0]; 8 | node(2).xyz=[1000;0;0]; 9 | 10 | element(1).connections=[1;2]; 11 | 12 | for i=1:length(element) 13 | 14 | element(i).material.E=210000; 15 | element(i).material.Et=210000/1; 16 | element(i).material.G=77000; 17 | element(i).material.sy=220; 18 | 19 | square=[-25,-25;25,-25;25,25;-25,25;-25,-25]; 20 | element(i).section(1).vertices=square; 21 | element(i).reference=[0;1;0]; 22 | 23 | end 24 | 25 | node(1).constraints=[1;1;1;1;1;1]; 26 | node(2).constraints=[0;0;0;0;0;0]; 27 | 28 | node(1).forces=[0;0;0;0;0;0]; 29 | node(2).forces=[0;-20e3;0;0;0;0]; 30 | 31 | Nsteps=100; 32 | 33 | tol=10^-2; 34 | 35 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 36 | 37 | 38 | %%%%%%%%%%%%%% SOLVING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 39 | 40 | %%%%%%%%%%%%%%%%% I %%%%%%%%%%%%%%%%%% 41 | % Et=E 42 | 43 | node=solveFFFincr(node,element,Nsteps,tol,C); 44 | hold on 45 | pause 46 | 47 | %%%%%%%%%%%%%%%%% II %%%%%%%%%%%%%%%%% 48 | % Et=E/2 49 | 50 | clc 51 | clear all 52 | 53 | node(1).xyz=[0;0;0]; 54 | node(2).xyz=[1000;0;0]; 55 | 56 | element(1).connections=[1;2]; 57 | 58 | for i=1:length(element) 59 | 60 | element(i).material.E=210000; 61 | element(i).material.Et=210000/2; 62 | element(i).material.G=77000; 63 | element(i).material.sy=220; 64 | 65 | square=[-25,-25;25,-25;25,25;-25,25;-25,-25]; 66 | element(i).section(1).vertices=square; 67 | element(i).reference=[0;1;0]; 68 | 69 | end 70 | 71 | node(1).constraints=[1;1;1;1;1;1]; 72 | node(2).constraints=[0;0;0;0;0;0]; 73 | 74 | node(1).forces=[0;0;0;0;0;0]; 75 | node(2).forces=[0;-20e3;0;0;0;0]; 76 | 77 | Nsteps=100; 78 | 79 | tol=10^-2; 80 | 81 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 82 | 83 | node=solveFFFincr(node,element,Nsteps,tol,C); 84 | pause 85 | 86 | %%%%%%%%%%%%%%%%% III %%%%%%%%%%%%%%%% 87 | % Et=E/5 88 | 89 | clc 90 | clear all 91 | 92 | node(1).xyz=[0;0;0]; 93 | node(2).xyz=[1000;0;0]; 94 | 95 | element(1).connections=[1;2]; 96 | 97 | for i=1:length(element) 98 | 99 | element(i).material.E=210000; 100 | element(i).material.Et=210000/5; 101 | element(i).material.G=77000; 102 | element(i).material.sy=220; 103 | 104 | square=[-25,-25;25,-25;25,25;-25,25;-25,-25]; 105 | element(i).section(1).vertices=square; 106 | element(i).reference=[0;1;0]; 107 | 108 | end 109 | 110 | node(1).constraints=[1;1;1;1;1;1]; 111 | node(2).constraints=[0;0;0;0;0;0]; 112 | 113 | node(1).forces=[0;0;0;0;0;0]; 114 | node(2).forces=[0;-20e3;0;0;0;0]; 115 | 116 | Nsteps=100; 117 | 118 | tol=10^-2; 119 | 120 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 121 | 122 | node=solveFFFincr(node,element,Nsteps,tol,C); 123 | pause 124 | 125 | %%%%%%%%%%%%%%%%% IV %%%%%%%%%%%%%%%%% 126 | % Et=E/10 127 | 128 | clc 129 | clear all 130 | 131 | node(1).xyz=[0;0;0]; 132 | node(2).xyz=[1000;0;0]; 133 | 134 | element(1).connections=[1;2]; 135 | 136 | for i=1:length(element) 137 | 138 | element(i).material.E=210000; 139 | element(i).material.Et=210000/10; 140 | element(i).material.G=77000; 141 | element(i).material.sy=220; 142 | 143 | square=[-25,-25;25,-25;25,25;-25,25;-25,-25]; 144 | element(i).section(1).vertices=square; 145 | element(i).reference=[0;1;0]; 146 | 147 | end 148 | 149 | node(1).constraints=[1;1;1;1;1;1]; 150 | node(2).constraints=[0;0;0;0;0;0]; 151 | 152 | node(1).forces=[0;0;0;0;0;0]; 153 | node(2).forces=[0;-20e3;0;0;0;0]; 154 | 155 | Nsteps=100; 156 | 157 | tol=10^-2; 158 | 159 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 160 | 161 | node=solveFFFincr(node,element,Nsteps,tol,C); 162 | pause 163 | 164 | %%%%%%%%%%%%%%%%% V %%%%%%%%%%%%%%%%%% 165 | % Et=E/100 166 | 167 | clc 168 | clear all 169 | 170 | node(1).xyz=[0;0;0]; 171 | node(2).xyz=[1000;0;0]; 172 | 173 | element(1).connections=[1;2]; 174 | 175 | for i=1:length(element) 176 | 177 | element(i).material.E=210000; 178 | element(i).material.Et=210000/100; 179 | element(i).material.G=77000; 180 | element(i).material.sy=220; 181 | 182 | square=[-25,-25;25,-25;25,25;-25,25;-25,-25]; 183 | element(i).section(1).vertices=square; 184 | element(i).reference=[0;1;0]; 185 | 186 | end 187 | 188 | node(1).constraints=[1;1;1;1;1;1]; 189 | node(2).constraints=[0;0;0;0;0;0]; 190 | 191 | node(1).forces=[0;0;0;0;0;0]; 192 | node(2).forces=[0;-20e3;0;0;0;0]; 193 | 194 | Nsteps=100; 195 | 196 | tol=10^-2; 197 | 198 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 199 | 200 | node=solveFFFincr(node,element,Nsteps,tol,C); 201 | pause 202 | 203 | %%%%%%%%%%%%%%%%% VI %%%%%%%%%%%%%%%%%% 204 | % Et=E/2 205 | % section = I shape (with same area) 206 | 207 | clc 208 | clear all 209 | 210 | node(1).xyz=[0;0;0]; 211 | node(2).xyz=[1000;0;0]; 212 | 213 | element(1).connections=[1;2]; 214 | 215 | for i=1:length(element) 216 | 217 | element(i).material.E=210000; 218 | element(i).material.Et=210000/2; 219 | element(i).material.G=77000; 220 | element(i).material.sy=220; 221 | 222 | rect1=[5,-50;5,0;-5,0;-5,-50;5,-50]+25*[zeros(5,1),ones(5,1)]; 223 | rect2=[-50,-5;50,-5;50,5;-50,5;-50,-5]+30*[zeros(5,1),ones(5,1)]; 224 | rect3=[-50,-5;50,-5;50,5;-50,5;-50,-5]-30*[zeros(5,1),ones(5,1)]; 225 | element(i).section(1).vertices=rect1; 226 | element(i).section(2).vertices=rect2; 227 | element(i).section(3).vertices=rect3; 228 | element(i).reference=[0;1;0]; 229 | 230 | end 231 | 232 | node(1).constraints=[1;1;1;1;1;1]; 233 | node(2).constraints=[0;0;0;0;0;0]; 234 | 235 | node(1).forces=[0;0;0;0;0;0]; 236 | node(2).forces=[0;-20e3;0;0;0;0]; 237 | 238 | Nsteps=100; 239 | 240 | tol=10^-2; 241 | 242 | C=[2,2]; % node [C(1)] and force component [C(2)] to display vs dual displacement 243 | 244 | % node=solveFFFincr(node,element,Nsteps,tol,C); 245 | 246 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/tests/testFEMcorot.m: -------------------------------------------------------------------------------- 1 | addpath(genpath('../')) 2 | 3 | clc 4 | clear all 5 | close all 6 | 7 | node(1).xyz=[0;0;0.6]; 8 | node(2).xyz=[0;15;0]; 9 | node(3).xyz=[-15*sqrt(3)/2;-15/2;0]; 10 | node(4).xyz=[15*sqrt(3)/2;-15/2;0]; 11 | node(5).xyz=[0;7/8*15*sqrt(3)/2;1/8*0.6]; 12 | node(6).xyz=[-7/8*15*sqrt(3)/2;-7/8*15/2;1/8*0.6]; 13 | node(7).xyz=[7/8*15*sqrt(3)/2;-7/8*15/2;1/8*0.6]; 14 | node(8).xyz=[0;6/8*15*sqrt(3)/2;2/8*0.6]; 15 | node(9).xyz=[-6/8*15*sqrt(3)/2;-6/8*15/2;2/8*0.6]; 16 | node(10).xyz=[6/8*15*sqrt(3)/2;-6/8*15/2;2/8*0.6]; 17 | node(11).xyz=[0;5/8*15*sqrt(3)/2;3/8*0.6]; 18 | node(12).xyz=[-5/8*15*sqrt(3)/2;-5/8*15/2;3/8*0.6]; 19 | node(13).xyz=[5/8*15*sqrt(3)/2;-5/8*15/2;3/8*0.6]; 20 | node(14).xyz=[0;4/8*15*sqrt(3)/2;4/8*0.6]; 21 | node(15).xyz=[-4/8*15*sqrt(3)/2;-4/8*15/2;4/8*0.6]; 22 | node(16).xyz=[4/8*15*sqrt(3)/2;-4/8*15/2;4/8*0.6]; 23 | node(17).xyz=[0;3/8*15*sqrt(3)/2;5/8*0.6]; 24 | node(18).xyz=[-3/8*15*sqrt(3)/2;-3/8*15/2;5/8*0.6]; 25 | node(19).xyz=[3/8*15*sqrt(3)/2;-3/8*15/2;5/8*0.6]; 26 | node(20).xyz=[0;2/8*15*sqrt(3)/2;6/8*0.6]; 27 | node(21).xyz=[-2/8*15*sqrt(3)/2;-2/8*15/2;6/8*0.6]; 28 | node(22).xyz=[2/8*15*sqrt(3)/2;-2/8*15/2;6/8*0.6]; 29 | node(23).xyz=[0;1/8*15*sqrt(3)/2;7/8*0.6]; 30 | node(24).xyz=[-1/8*15*sqrt(3)/2;-1/8*15/2;7/8*0.6]; 31 | node(25).xyz=[1/8*15*sqrt(3)/2;-1/8*15/2;7/8*0.6]; 32 | 33 | element(1).connections=[1,23]; 34 | element(2).connections=[23,20]; 35 | element(3).connections=[20,17]; 36 | element(4).connections=[17,14]; 37 | element(5).connections=[14,11]; 38 | element(6).connections=[11,8]; 39 | element(7).connections=[8,5]; 40 | element(8).connections=[5,2]; 41 | element(9).connections=[1,25]; 42 | element(10).connections=[25,22]; 43 | element(11).connections=[22,19]; 44 | element(12).connections=[19,16]; 45 | element(13).connections=[16,13]; 46 | element(14).connections=[13,10]; 47 | element(15).connections=[10,7]; 48 | element(16).connections=[7,4]; 49 | element(17).connections=[1,24]; 50 | element(18).connections=[24,21]; 51 | element(19).connections=[21,18]; 52 | element(20).connections=[18,15]; 53 | element(21).connections=[15,12]; 54 | element(22).connections=[12,9]; 55 | element(23).connections=[9,6]; 56 | element(24).connections=[6,3]; 57 | 58 | %plotstructure(node,element) 59 | 60 | for e=1:length(element) 61 | 62 | element(e).reference=[0;0;1]; 63 | element(e).material.E=10^7; 64 | element(e).material.Et=10^7/1; 65 | element(e).material.G=3.8462*10^6; 66 | element(e).material.sy=220; 67 | element(e).section(1).vertices=[-0.17/2,-0.14/2;0.17/2,-0.14/2;0.17/2,0.14/2;-0.17/2,0.14/2;-0.17/2,-0.14/2]; 68 | element(e).section(2).vertices=[-0.17/2,-0.14/2;0.17/2,-0.14/2;0.17/2,0.14/2;-0.17/2,0.14/2;-0.17/2,-0.14/2]; 69 | 70 | end 71 | 72 | for n=1:length(node) 73 | 74 | node(n).constraints=[0;0;0;0;0;0]; 75 | node(n).forces=[0;0;0;0;0;0]; 76 | node(n).displacements=[0;0;0;0;0;0]; 77 | 78 | end 79 | node(2).constraints=[1;1;1;1;1;1]; 80 | node(3).constraints=[1;1;1;1;1;1]; 81 | node(4).constraints=[1;1;1;1;1;1]; 82 | 83 | node(1).forces=[0;0;-30;0;0;0]; 84 | 85 | 86 | nstep=15; 87 | 88 | psi=0.05; 89 | 90 | tol=10^-1; 91 | 92 | C=[1,3]; 93 | 94 | 95 | 96 | %node=solveITER(node,element,nstep,tol,C); 97 | node=solveARCLENGTH(node,element,nstep,psi,tol,C); 98 | 99 | 100 | 101 | 102 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 103 | hold on 104 | clc 105 | clear all 106 | 107 | node(1).xyz=[0;0;0.6]; 108 | node(2).xyz=[0;15;0]; 109 | node(3).xyz=[-15*sqrt(3)/2;-15/2;0]; 110 | node(4).xyz=[15*sqrt(3)/2;-15/2;0]; 111 | node(5).xyz=[0;7/8*15*sqrt(3)/2;1/8*0.6]; 112 | node(6).xyz=[-7/8*15*sqrt(3)/2;-7/8*15/2;1/8*0.6]; 113 | node(7).xyz=[7/8*15*sqrt(3)/2;-7/8*15/2;1/8*0.6]; 114 | node(8).xyz=[0;6/8*15*sqrt(3)/2;2/8*0.6]; 115 | node(9).xyz=[-6/8*15*sqrt(3)/2;-6/8*15/2;2/8*0.6]; 116 | node(10).xyz=[6/8*15*sqrt(3)/2;-6/8*15/2;2/8*0.6]; 117 | node(11).xyz=[0;5/8*15*sqrt(3)/2;3/8*0.6]; 118 | node(12).xyz=[-5/8*15*sqrt(3)/2;-5/8*15/2;3/8*0.6]; 119 | node(13).xyz=[5/8*15*sqrt(3)/2;-5/8*15/2;3/8*0.6]; 120 | node(14).xyz=[0;4/8*15*sqrt(3)/2;4/8*0.6]; 121 | node(15).xyz=[-4/8*15*sqrt(3)/2;-4/8*15/2;4/8*0.6]; 122 | node(16).xyz=[4/8*15*sqrt(3)/2;-4/8*15/2;4/8*0.6]; 123 | node(17).xyz=[0;3/8*15*sqrt(3)/2;5/8*0.6]; 124 | node(18).xyz=[-3/8*15*sqrt(3)/2;-3/8*15/2;5/8*0.6]; 125 | node(19).xyz=[3/8*15*sqrt(3)/2;-3/8*15/2;5/8*0.6]; 126 | node(20).xyz=[0;2/8*15*sqrt(3)/2;6/8*0.6]; 127 | node(21).xyz=[-2/8*15*sqrt(3)/2;-2/8*15/2;6/8*0.6]; 128 | node(22).xyz=[2/8*15*sqrt(3)/2;-2/8*15/2;6/8*0.6]; 129 | node(23).xyz=[0;1/8*15*sqrt(3)/2;7/8*0.6]; 130 | node(24).xyz=[-1/8*15*sqrt(3)/2;-1/8*15/2;7/8*0.6]; 131 | node(25).xyz=[1/8*15*sqrt(3)/2;-1/8*15/2;7/8*0.6]; 132 | 133 | element(1).connections=[1,23]; 134 | element(2).connections=[23,20]; 135 | element(3).connections=[20,17]; 136 | element(4).connections=[17,14]; 137 | element(5).connections=[14,11]; 138 | element(6).connections=[11,8]; 139 | element(7).connections=[8,5]; 140 | element(8).connections=[5,2]; 141 | element(9).connections=[1,25]; 142 | element(10).connections=[25,22]; 143 | element(11).connections=[22,19]; 144 | element(12).connections=[19,16]; 145 | element(13).connections=[16,13]; 146 | element(14).connections=[13,10]; 147 | element(15).connections=[10,7]; 148 | element(16).connections=[7,4]; 149 | element(17).connections=[1,24]; 150 | element(18).connections=[24,21]; 151 | element(19).connections=[21,18]; 152 | element(20).connections=[18,15]; 153 | element(21).connections=[15,12]; 154 | element(22).connections=[12,9]; 155 | element(23).connections=[9,6]; 156 | element(24).connections=[6,3]; 157 | 158 | %plotstructure(node,element) 159 | 160 | for e=1:length(element) 161 | 162 | element(e).reference=[0;0;1]; 163 | element(e).material.E=10^7; 164 | element(e).material.Et=10^7/2; 165 | element(e).material.G=3.8462*10^6; 166 | element(e).material.sy=220; 167 | element(e).section(1).vertices=[-0.17/2,-0.14/2;0.17/2,-0.14/2;0.17/2,0.14/2;-0.17/2,0.14/2;-0.17/2,-0.14/2]; 168 | element(e).section(2).vertices=[-0.17/2,-0.14/2;0.17/2,-0.14/2;0.17/2,0.14/2;-0.17/2,0.14/2;-0.17/2,-0.14/2]; 169 | 170 | end 171 | 172 | for n=1:length(node) 173 | 174 | node(n).constraints=[0;0;0;0;0;0]; 175 | node(n).forces=[0;0;0;0;0;0]; 176 | node(n).displacements=[0;0;0;0;0;0]; 177 | 178 | end 179 | node(2).constraints=[1;1;1;1;1;1]; 180 | node(3).constraints=[1;1;1;1;1;1]; 181 | node(4).constraints=[1;1;1;1;1;1]; 182 | 183 | node(1).forces=[0;0;-30;0;0;0]; 184 | 185 | 186 | nstep=15; 187 | 188 | psi=0.05; 189 | 190 | tol=10^-1; 191 | 192 | C=[1,3]; 193 | 194 | 195 | 196 | %node=solveITER(node,element,nstep,tol,C); 197 | node=solveARCLENGTH(node,element,nstep,psi,tol,C); 198 | 199 | 200 | 201 | 202 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -------------------------------------------------------------------------------- /pasm/plane stress element/ELIST1.txt: -------------------------------------------------------------------------------- 1 | 1 1 1 1 0 1 161 151 45 155 2 | 2 1 1 1 0 1 160 157 6 49 3 | 3 1 1 1 0 1 158 108 4 5 4 | 4 1 1 1 0 1 156 137 37 110 5 | 5 1 1 1 0 1 153 148 44 89 6 | 6 1 1 1 0 1 152 138 45 151 7 | 7 1 1 1 0 1 149 146 11 10 8 | 8 1 1 1 0 1 147 87 50 12 9 | 9 1 1 1 0 1 145 143 30 144 10 | 10 1 1 1 0 1 141 83 48 86 11 | 11 1 1 1 0 1 139 98 40 135 12 | 12 1 1 1 0 1 136 133 32 113 13 | 13 1 1 1 0 1 134 131 34 119 14 | 14 1 1 1 0 1 132 129 31 124 15 | 15 1 1 1 0 1 130 68 70 127 16 | 16 1 1 1 0 1 128 24 25 125 17 | 17 1 1 1 0 1 126 26 27 120 18 | 18 1 1 1 0 1 123 14 13 22 19 | 19 1 1 1 0 1 121 28 61 114 20 | 20 1 1 1 0 1 118 16 15 117 21 | 21 1 1 1 0 1 115 63 64 111 22 | 22 1 1 1 0 1 112 66 69 107 23 | 23 1 1 1 0 1 109 3 4 108 24 | 24 1 1 1 0 1 106 18 17 105 25 | 25 1 1 1 0 1 103 20 19 102 26 | 26 1 1 1 0 1 100 55 52 99 27 | 27 1 1 1 0 1 97 58 57 96 28 | 28 1 1 1 0 1 94 62 75 77 29 | 29 1 1 1 0 1 91 60 59 90 30 | 30 1 1 1 0 1 88 51 50 87 31 | 31 1 1 1 0 1 85 54 53 84 32 | 32 1 1 1 0 1 82 8 7 67 33 | 33 1 1 1 0 1 79 74 73 78 34 | 34 1 1 1 0 1 142 39 151 161 35 | 35 1 1 1 0 1 41 142 161 159 36 | 36 1 1 1 0 1 159 161 155 29 37 | 37 1 1 1 0 1 159 29 157 160 38 | 38 1 1 1 0 1 41 159 160 93 39 | 39 1 1 1 0 1 93 160 49 56 40 | 40 1 1 1 0 1 154 35 108 158 41 | 41 1 1 1 0 1 29 154 158 157 42 | 42 1 1 1 0 1 157 158 5 6 43 | 43 1 1 1 0 1 155 45 137 156 44 | 44 1 1 1 0 1 29 155 156 154 45 | 45 1 1 1 0 1 154 156 110 35 46 | 46 1 1 1 0 1 144 30 148 153 47 | 47 1 1 1 0 1 39 144 153 150 48 | 48 1 1 1 0 1 150 153 89 43 49 | 49 1 1 1 0 1 95 42 138 152 50 | 50 1 1 1 0 1 43 95 152 150 51 | 51 1 1 1 0 1 150 152 151 39 52 | 52 1 1 1 0 1 148 30 146 149 53 | 53 1 1 1 0 1 44 148 149 81 54 | 54 1 1 1 0 1 81 149 10 9 55 | 55 1 1 1 0 1 143 46 87 147 56 | 56 1 1 1 0 1 30 143 147 146 57 | 57 1 1 1 0 1 146 147 12 11 58 | 58 1 1 1 0 1 140 46 143 145 59 | 59 1 1 1 0 1 41 140 145 142 60 | 60 1 1 1 0 1 142 145 144 39 61 | 61 1 1 1 0 1 92 47 83 141 62 | 62 1 1 1 0 1 41 92 141 140 63 | 63 1 1 1 0 1 140 141 86 46 64 | 64 1 1 1 0 1 138 42 98 139 65 | 65 1 1 1 0 1 45 138 139 137 66 | 66 1 1 1 0 1 137 139 135 37 67 | 67 1 1 1 0 1 101 38 133 136 68 | 68 1 1 1 0 1 40 101 136 135 69 | 69 1 1 1 0 1 135 136 113 37 70 | 70 1 1 1 0 1 104 36 131 134 71 | 71 1 1 1 0 1 38 104 134 133 72 | 72 1 1 1 0 1 133 134 119 32 73 | 73 1 1 1 0 1 116 33 129 132 74 | 74 1 1 1 0 1 36 116 132 131 75 | 75 1 1 1 0 1 131 132 124 34 76 | 76 1 1 1 0 1 122 23 68 130 77 | 77 1 1 1 0 1 33 122 130 129 78 | 78 1 1 1 0 1 129 130 127 31 79 | 79 1 1 1 0 1 72 21 24 128 80 | 80 1 1 1 0 1 70 72 128 127 81 | 81 1 1 1 0 1 127 128 125 31 82 | 82 1 1 1 0 1 125 25 26 126 83 | 83 1 1 1 0 1 31 125 126 124 84 | 84 1 1 1 0 1 124 126 120 34 85 | 85 1 1 1 0 1 117 15 14 123 86 | 86 1 1 1 0 1 33 117 123 122 87 | 87 1 1 1 0 1 122 123 22 23 88 | 88 1 1 1 0 1 120 27 28 121 89 | 89 1 1 1 0 1 34 120 121 119 90 | 90 1 1 1 0 1 119 121 114 32 91 | 91 1 1 1 0 1 105 17 16 118 92 | 92 1 1 1 0 1 36 105 118 116 93 | 93 1 1 1 0 1 116 118 117 33 94 | 94 1 1 1 0 1 114 61 63 115 95 | 95 1 1 1 0 1 32 114 115 113 96 | 96 1 1 1 0 1 113 115 111 37 97 | 97 1 1 1 0 1 111 64 66 112 98 | 98 1 1 1 0 1 37 111 112 110 99 | 99 1 1 1 0 1 110 112 107 35 100 | 100 1 1 1 0 1 71 1 3 109 101 | 101 1 1 1 0 1 69 71 109 107 102 | 102 1 1 1 0 1 107 109 108 35 103 | 103 1 1 1 0 1 102 19 18 106 104 | 104 1 1 1 0 1 38 102 106 104 105 | 105 1 1 1 0 1 104 106 105 36 106 | 106 1 1 1 0 1 99 52 20 103 107 | 107 1 1 1 0 1 40 99 103 101 108 | 108 1 1 1 0 1 101 103 102 38 109 | 109 1 1 1 0 1 96 57 55 100 110 | 110 1 1 1 0 1 42 96 100 98 111 | 111 1 1 1 0 1 98 100 99 40 112 | 112 1 1 1 0 1 90 59 58 97 113 | 113 1 1 1 0 1 43 90 97 95 114 | 114 1 1 1 0 1 95 97 96 42 115 | 115 1 1 1 0 1 93 56 62 94 116 | 116 1 1 1 0 1 41 93 94 92 117 | 117 1 1 1 0 1 92 94 77 47 118 | 118 1 1 1 0 1 80 65 60 91 119 | 119 1 1 1 0 1 44 80 91 89 120 | 120 1 1 1 0 1 89 91 90 43 121 | 121 1 1 1 0 1 84 53 51 88 122 | 122 1 1 1 0 1 48 84 88 86 123 | 123 1 1 1 0 1 86 88 87 46 124 | 124 1 1 1 0 1 78 73 54 85 125 | 125 1 1 1 0 1 47 78 85 83 126 | 126 1 1 1 0 1 83 85 84 48 127 | 127 1 1 1 0 1 81 9 8 82 128 | 128 1 1 1 0 1 44 81 82 80 129 | 129 1 1 1 0 1 80 82 67 65 130 | 130 1 1 1 0 1 76 2 74 79 131 | 131 1 1 1 0 1 75 76 79 77 132 | 132 1 1 1 0 1 77 79 78 47 133 | 134 | -------------------------------------------------------------------------------- /pasm/plane stress element/NLIST1.txt: -------------------------------------------------------------------------------- 1 | 1 0.00000000000 0.00000000000 0.00000000000 2 | 2 45.0000000000 0.00000000000 0.00000000000 3 | 3 7.88155852302 0.00000000000 0.00000000000 4 | 4 15.7631170460 0.00000000000 0.00000000000 5 | 5 21.4006500000 0.00000000000 0.00000000000 6 | 6 27.0385767440 0.00000000000 0.00000000000 7 | 7 60.0000000000 15.0000000000 0.00000000000 8 | 8 58.0420681821 14.8716677947 0.00000000000 9 | 9 56.1177143234 14.4888873943 0.00000000000 10 | 10 54.2597485137 13.8581929873 0.00000000000 11 | 11 52.4999999984 12.9903810558 0.00000000000 12 | 12 50.8686097162 11.9003240076 0.00000000000 13 | 13 60.0000000000 100.000000000 0.00000000000 14 | 14 60.0000000000 89.5564750000 0.00000000000 15 | 15 60.0000000000 79.1130880551 0.00000000000 16 | 16 60.0000000000 70.8365000000 0.00000000000 17 | 17 60.0000000000 62.5600197993 0.00000000000 18 | 18 60.0000000000 56.0010250000 0.00000000000 19 | 19 60.0000000000 49.4415622023 0.00000000000 20 | 20 60.0000000000 44.2434000000 0.00000000000 21 | 21 0.00000000000 100.000000000 0.00000000000 22 | 22 50.0000000000 100.000000000 0.00000000000 23 | 23 40.0000000000 100.000000000 0.00000000000 24 | 24 0.00000000000 90.4237912497 0.00000000000 25 | 25 0.00000000000 80.8475824995 0.00000000000 26 | 26 0.00000000000 71.8070000000 0.00000000000 27 | 27 0.00000000000 62.7660243261 0.00000000000 28 | 28 0.00000000000 54.2305000000 0.00000000000 29 | 29 25.7462946782 12.2183859832 0.00000000000 30 | 30 46.7616406115 15.1721588373 0.00000000000 31 | 31 19.9086330878 81.9481819233 0.00000000000 32 | 32 19.1126262627 48.4476192633 0.00000000000 33 | 33 40.2640966327 80.3239817529 0.00000000000 34 | 34 19.4237605795 64.8217143202 0.00000000000 35 | 35 13.7394238673 14.3113903127 0.00000000000 36 | 36 39.6691529791 64.5142530898 0.00000000000 37 | 37 19.8455301826 31.7577693778 0.00000000000 38 | 38 39.0416758682 50.5030396450 0.00000000000 39 | 39 39.2957568424 18.4302572887 0.00000000000 40 | 40 39.7561364278 38.4710200911 0.00000000000 41 | 41 35.6654521512 9.90872728925 0.00000000000 42 | 42 43.8259277284 29.5981756955 0.00000000000 43 | 43 48.2334710093 23.3015720143 0.00000000000 44 | 44 52.1573843988 18.6145623364 0.00000000000 45 | 45 31.1491727137 23.3949720762 0.00000000000 46 | 46 44.1003041056 11.1927818209 0.00000000000 47 | 47 42.0053485768 5.16830068588 0.00000000000 48 | 48 44.9986278165 8.08930487708 0.00000000000 49 | 49 31.0711500000 0.00000000000 0.00000000000 50 | 50 49.3933982796 10.6066017152 0.00000000000 51 | 51 48.0996759860 9.13139027545 0.00000000000 52 | 52 60.0000000000 39.0450648845 0.00000000000 53 | 53 47.0096189405 7.49999999525 0.00000000000 54 | 54 46.1418070102 5.74025148034 0.00000000000 55 | 55 60.0000000000 34.9252750000 0.00000000000 56 | 56 35.1039860809 0.00000000000 0.00000000000 57 | 57 60.0000000000 30.8057459187 0.00000000000 58 | 58 60.0000000000 27.5409000000 0.00000000000 59 | 59 60.0000000000 24.2760104758 0.00000000000 60 | 60 60.0000000000 21.6886500000 0.00000000000 61 | 61 0.00000000000 45.6954510699 0.00000000000 62 | 62 37.9885500000 0.00000000000 0.00000000000 63 | 63 0.00000000000 37.6370000000 0.00000000000 64 | 64 0.00000000000 29.5793360481 0.00000000000 65 | 65 60.0000000000 19.1011355701 0.00000000000 66 | 66 0.00000000000 21.9715000000 0.00000000000 67 | 67 60.0000000000 17.0505677851 0.00000000000 68 | 68 30.0000000000 100.000000000 0.00000000000 69 | 69 0.00000000000 14.3643131254 0.00000000000 70 | 70 20.0000000000 100.000000000 0.00000000000 71 | 71 0.00000000000 7.18200000000 0.00000000000 72 | 72 9.99990000000 100.000000000 0.00000000000 73 | 73 45.5111126038 3.88228566948 0.00000000000 74 | 74 45.1283270789 1.95789287968 0.00000000000 75 | 75 40.8732256075 0.00000000000 0.00000000000 76 | 76 42.9365250000 0.00000000000 0.00000000000 77 | 77 41.1117082915 2.70117802516 0.00000000000 78 | 78 43.7364891469 4.19069523530 0.00000000000 79 | 79 43.1333459372 2.19236272014 0.00000000000 80 | 80 55.9520558085 19.3216739985 0.00000000000 81 | 81 54.0588831285 16.5616676503 0.00000000000 82 | 82 56.8937160480 17.0986472318 0.00000000000 83 | 83 43.5019881966 6.62880278148 0.00000000000 84 | 84 45.8191455307 7.73092462772 0.00000000000 85 | 85 44.7114561315 5.94527854645 0.00000000000 86 | 86 44.7868978841 9.49895376646 0.00000000000 87 | 87 47.4918932726 10.9476927113 0.00000000000 88 | 88 46.5202761230 9.50661776630 0.00000000000 89 | 89 50.3111379062 20.7711012201 0.00000000000 90 | 90 53.9559328612 24.3364441756 0.00000000000 91 | 91 54.9677796691 21.6991957440 0.00000000000 92 | 92 39.0971425493 6.72274319213 0.00000000000 93 | 93 34.4154189289 5.00448155645 0.00000000000 94 | 94 37.8555591959 3.88261908156 0.00000000000 95 | 95 46.0161585328 26.2339287846 0.00000000000 96 | 96 51.6471522480 30.7971006077 0.00000000000 97 | 97 52.8157997162 27.3292099944 0.00000000000 98 | 98 41.4587000351 33.7245830061 0.00000000000 99 | 99 49.7328339110 39.4011180977 0.00000000000 100 | 100 50.4970404909 34.9010841884 0.00000000000 101 | 101 39.1114675618 44.1118832845 0.00000000000 102 | 102 49.3759502697 49.8795920572 0.00000000000 103 | 103 49.4216313078 44.5367481157 0.00000000000 104 | 104 39.2105267592 57.4159375010 0.00000000000 105 | 105 49.8345764895 63.5371364445 0.00000000000 106 | 106 49.6052633796 56.7083642509 0.00000000000 107 | 107 7.27742076265 15.0512985294 0.00000000000 108 | 108 13.8607926837 6.86214747840 0.00000000000 109 | 109 7.29947612385 7.05231915574 0.00000000000 110 | 110 16.4344529058 22.8321268992 0.00000000000 111 | 111 9.57122791984 31.0137970282 0.00000000000 112 | 112 8.54262665522 23.0847191358 0.00000000000 113 | 113 19.2241732327 40.3850768346 0.00000000000 114 | 114 9.55521423264 47.1627087881 0.00000000000 115 | 115 9.62002407670 38.8840426486 0.00000000000 116 | 116 39.9666248059 72.4191174214 0.00000000000 117 | 117 50.1320483163 79.7185349040 0.00000000000 118 | 118 49.9833124029 71.6278356743 0.00000000000 119 | 119 19.2959325827 56.4618703320 0.00000000000 120 | 120 9.69522430992 63.9008830278 0.00000000000 121 | 121 9.61743463100 55.4313207230 0.00000000000 122 | 122 40.1320483163 90.1619908765 0.00000000000 123 | 123 50.0660241582 89.8592674520 0.00000000000 124 | 124 19.6661968337 73.3849481217 0.00000000000 125 | 125 9.85908720431 81.6618563594 0.00000000000 126 | 126 9.76545866304 72.7131744430 0.00000000000 127 | 127 20.0347799966 90.8231870928 0.00000000000 128 | 128 9.97715827196 90.6989411057 0.00000000000 129 | 129 30.0863648603 81.1360818381 0.00000000000 130 | 130 30.1706922267 90.5426055765 0.00000000000 131 | 131 29.3948451924 64.9642018957 0.00000000000 132 | 132 29.7176278176 72.9876012121 0.00000000000 133 | 133 28.9052877145 49.6170939835 0.00000000000 134 | 134 29.0969708180 57.1885077918 0.00000000000 135 | 135 29.9441803329 36.1388903324 0.00000000000 136 | 136 28.8272871657 42.4463634909 0.00000000000 137 | 137 26.2897730401 26.9571490755 0.00000000000 138 | 138 36.7486420771 27.1681798301 0.00000000000 139 | 139 32.8728511631 31.1993709639 0.00000000000 140 | 140 40.1818977919 11.0701229610 0.00000000000 141 | 141 41.2220573850 8.63289529806 0.00000000000 142 | 142 36.6278872048 14.6932773600 0.00000000000 143 | 143 44.9056383660 13.2370475124 0.00000000000 144 | 144 43.0170573046 16.7059392179 0.00000000000 145 | 145 40.8149107774 13.9143893096 0.00000000000 146 | 146 49.6707271251 14.1696866967 0.00000000000 147 | 147 48.6446217807 12.4861224600 0.00000000000 148 | 148 48.8864732361 17.2626394883 0.00000000000 149 | 149 51.6021739781 15.5588176147 0.00000000000 150 | 150 43.2571771615 21.3333223975 0.00000000000 151 | 151 35.3881147693 20.6325098821 0.00000000000 152 | 152 40.0804673055 24.0162273856 0.00000000000 153 | 153 46.1101679227 19.1424497154 0.00000000000 154 | 154 19.9229509678 13.2650039456 0.00000000000 155 | 155 27.5400409180 18.2026017931 0.00000000000 156 | 156 22.1534392094 20.5527028936 0.00000000000 157 | 157 25.9869904179 6.10749435196 0.00000000000 158 | 158 20.0945055560 6.65332500965 0.00000000000 159 | 159 30.8633472986 11.0368278792 0.00000000000 160 | 160 30.8249551652 5.50012301008 0.00000000000 161 | 161 32.3097738175 16.1725133070 0.00000000000 162 | 163 | -------------------------------------------------------------------------------- /fsa/Force formulation FEM/cutpoints.m: -------------------------------------------------------------------------------- 1 | function [PT,IT]=cutpoints(P,eps,I,epsy) 2 | 3 | PT=[]; 4 | IT=[]; 5 | 6 | for i=1:length(P)-1 7 | 8 | v=size(PT,1); 9 | 10 | switch I(i)*I(i+1) 11 | 12 | %%%%%%%%%%%%%%%%%%%%%%%%% caso B.1 %%%%%%%%%%%%%%%%%%%%%%%%% 13 | 14 | case 2 15 | 16 | if I(i)==1 17 | 18 | s=(-epsy-eps(i))/(eps(i+1)-eps(i)); 19 | 20 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 21 | 22 | if v==0 23 | 24 | IT(v+1)=1; 25 | IT(v+2)=0; 26 | IT(v+3)=2; 27 | 28 | else 29 | 30 | if PT(v,:)==P(i,:) 31 | 32 | IT(v+1)=0; 33 | IT(v+2)=2; 34 | 35 | else 36 | 37 | IT(v+1)=1; 38 | IT(v+2)=0; 39 | IT(v+3)=2; 40 | 41 | end 42 | 43 | end 44 | 45 | else 46 | 47 | s=(epsy+eps(i))/(eps(i)-eps(i+1)); 48 | 49 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 50 | 51 | if v==0 52 | 53 | IT(v+1)=2; 54 | IT(v+2)=0; 55 | IT(v+3)=1; 56 | 57 | else 58 | 59 | if PT(v,:)==P(i,:) 60 | 61 | IT(v+1)=0; 62 | IT(v+2)=1; 63 | 64 | else 65 | 66 | IT(v+1)=2; 67 | IT(v+2)=0; 68 | IT(v+3)=1; 69 | 70 | end 71 | 72 | end 73 | 74 | end 75 | 76 | if v==0 77 | 78 | PT(v+1,1:2)=P(i,:); 79 | PT(v+2,1:2)=Padd; 80 | PT(v+3,1:2)=P(i+1,:); 81 | 82 | else 83 | 84 | if PT(v,:)==P(i,:) 85 | 86 | PT(v+1,1:2)=Padd; 87 | PT(v+2,1:2)=P(i+1,:); 88 | 89 | else 90 | 91 | PT(v+1,1:2)=P(i,:); 92 | PT(v+2,1:2)=Padd; 93 | PT(v+3,1:2)=P(i+1,:); 94 | 95 | end 96 | 97 | end 98 | 99 | %%%%%%%%%%%%%%%%%%%%%%%%% caso B.2 %%%%%%%%%%%%%%%%%%%%%%%%% 100 | 101 | case 6 102 | 103 | if I(i)==2 104 | 105 | s=(epsy-eps(i))/(eps(i+1)-eps(i)); 106 | 107 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 108 | 109 | if v==0 110 | 111 | IT(v+1)=2; 112 | IT(v+2)=0; 113 | IT(v+3)=3; 114 | 115 | else 116 | 117 | if PT(v,:)==P(i,:) 118 | 119 | IT(v+1)=0; 120 | IT(v+2)=3; 121 | 122 | else 123 | 124 | IT(v+1)=2; 125 | IT(v+2)=0; 126 | IT(v+3)=3; 127 | 128 | end 129 | 130 | end 131 | 132 | else 133 | 134 | s=(eps(i)-epsy)/(eps(i)-eps(i+1)); 135 | 136 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 137 | 138 | if v==0 139 | 140 | IT(v+1)=3; 141 | IT(v+2)=0; 142 | IT(v+3)=2; 143 | 144 | else 145 | 146 | if PT(v,:)==P(i,:) 147 | 148 | IT(v+1)=0; 149 | IT(v+2)=2; 150 | 151 | else 152 | 153 | IT(v+1)=3; 154 | IT(v+2)=0; 155 | IT(v+3)=2; 156 | 157 | end 158 | 159 | end 160 | 161 | end 162 | 163 | if v==0 164 | 165 | PT(v+1,1:2)=P(i,:); 166 | PT(v+2,1:2)=Padd; 167 | PT(v+3,1:2)=P(i+1,:); 168 | 169 | else 170 | 171 | if PT(v,:)==P(i,:) 172 | 173 | PT(v+1,1:2)=Padd; 174 | PT(v+2,1:2)=P(i+1,:); 175 | 176 | else 177 | 178 | PT(v+1,1:2)=P(i,:); 179 | PT(v+2,1:2)=Padd; 180 | PT(v+3,1:2)=P(i+1,:); 181 | 182 | end 183 | 184 | end 185 | 186 | %%%%%%%%%%%%%%%%%%%%%%%%% caso C %%%%%%%%%%%%%%%%%%%%%%%%% 187 | 188 | case 3 189 | 190 | if I(i)==1 191 | 192 | s1=(-epsy-eps(i))/(eps(i+1)-eps(i)); 193 | s2=(epsy-eps(i))/(eps(i+1)-eps(i)); 194 | 195 | Padd1=P(i,:)+s1*(P(i+1,:)-P(i,:)); 196 | Padd2=P(i,:)+s2*(P(i+1,:)-P(i,:)); 197 | 198 | if v==0 199 | 200 | IT(v+1)=1; 201 | IT(v+2)=0; 202 | IT(v+3)=0; 203 | IT(v+4)=3; 204 | 205 | else 206 | 207 | if PT(v,:)==P(i,:) 208 | 209 | IT(v+1)=0; 210 | IT(v+2)=0; 211 | IT(v+3)=3; 212 | 213 | else 214 | 215 | IT(v+1)=1; 216 | IT(v+2)=0; 217 | IT(v+3)=0; 218 | IT(v+4)=3; 219 | 220 | end 221 | 222 | end 223 | 224 | else 225 | 226 | s1=(eps(i)-epsy)/(eps(i)-eps(i+1)); 227 | s2=(eps(i)+epsy)/(eps(i)-eps(i+1)); 228 | 229 | Padd1=P(i,:)+s1*(P(i+1,:)-P(i,:)); 230 | Padd2=P(i,:)+s2*(P(i+1,:)-P(i,:)); 231 | 232 | if v==0 233 | 234 | IT(v+1)=3; 235 | IT(v+2)=0; 236 | IT(v+3)=0; 237 | IT(v+4)=1; 238 | 239 | else 240 | 241 | if PT(v,:)==P(i,:) 242 | 243 | IT(v+1)=0; 244 | IT(v+2)=0; 245 | IT(v+3)=1; 246 | 247 | else 248 | 249 | IT(v+1)=3; 250 | IT(v+2)=0; 251 | IT(v+3)=0; 252 | IT(v+4)=1; 253 | 254 | end 255 | 256 | end 257 | 258 | end 259 | 260 | if v==0 261 | 262 | PT(v+1,1:2)=P(i,:); 263 | PT(v+2,1:2)=Padd1; 264 | PT(v+3,1:2)=Padd2; 265 | PT(v+4,1:2)=P(i+1,:); 266 | 267 | else 268 | 269 | if PT(v,:)==P(i,:) 270 | 271 | PT(v+1,1:2)=Padd1; 272 | PT(v+2,1:2)=Padd2; 273 | PT(v+3,1:2)=P(i+1,:); 274 | 275 | else 276 | 277 | PT(v+1,1:2)=P(i,:); 278 | PT(v+2,1:2)=Padd1; 279 | PT(v+3,1:2)=Padd2; 280 | PT(v+4,1:2)=P(i+1,:); 281 | 282 | end 283 | 284 | end 285 | 286 | %%%%%%%%%%%%%%%%%%%%%%%%% caso A %%%%%%%%%%%%%%%%%%%%%%%%% 287 | 288 | otherwise 289 | 290 | if v==0 291 | 292 | PT(v+1,1:2)=P(i,:); 293 | PT(v+2,1:2)=P(i+1,:); 294 | 295 | else 296 | 297 | if PT(v,:)==P(i,:) 298 | 299 | PT(v+1,1:2)=P(i+1,:); 300 | 301 | else 302 | 303 | PT(v+1,1:2)=P(i,:); 304 | PT(v+2,1:2)=P(i+1,:); 305 | 306 | end 307 | 308 | end 309 | 310 | if I(i)==1 311 | 312 | if v==0 313 | 314 | IT(v+1)=1; 315 | IT(v+2)=1; 316 | 317 | else 318 | 319 | if PT(v,:)==P(i,:) 320 | 321 | IT(v+1)=1; 322 | 323 | else 324 | 325 | IT(v+1)=1; 326 | IT(v+2)=1; 327 | 328 | end 329 | 330 | end 331 | 332 | else 333 | 334 | if I(i)==2 335 | 336 | if v==0 337 | 338 | IT(v+1)=2; 339 | IT(v+2)=2; 340 | 341 | else 342 | 343 | if PT(v,:)==P(i,:) 344 | 345 | IT(v+1)=2; 346 | 347 | else 348 | 349 | IT(v+1)=2; 350 | IT(v+2)=2; 351 | 352 | end 353 | 354 | end 355 | 356 | else 357 | 358 | if v==0 359 | 360 | IT(v+1)=3; 361 | IT(v+2)=3; 362 | 363 | else 364 | 365 | if PT(v,:)==P(i,:) 366 | 367 | IT(v+1)=3; 368 | 369 | else 370 | 371 | IT(v+1)=3; 372 | IT(v+2)=3; 373 | 374 | end 375 | 376 | end 377 | 378 | end 379 | 380 | end 381 | 382 | end 383 | 384 | end 385 | 386 | 387 | if PT(size(PT,1),:)==PT(1,:) 388 | 389 | open=false; 390 | 391 | else 392 | 393 | open=true; 394 | 395 | end 396 | 397 | if open 398 | 399 | PT(size(PT,1)+1,:)=PT(1,:); 400 | 401 | IT(length(IT)+1)=IT(1); 402 | 403 | end 404 | 405 | 406 | end -------------------------------------------------------------------------------- /fsa/3D Corotational Formulation/cutpoints.m: -------------------------------------------------------------------------------- 1 | function [PT,IT]=cutpoints(P,eps,I,epsy) 2 | 3 | PT=[]; 4 | IT=[]; 5 | 6 | for i=1:length(P)-1 7 | 8 | v=size(PT,1); 9 | 10 | switch I(i)*I(i+1) 11 | 12 | %%%%%%%%%%%%%%%%%%%%%%%%% caso B.1 %%%%%%%%%%%%%%%%%%%%%%%%% 13 | 14 | case 2 15 | 16 | if I(i)==1 17 | 18 | s=(-epsy-eps(i))/(eps(i+1)-eps(i)); 19 | 20 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 21 | 22 | if v==0 23 | 24 | IT(v+1)=1; 25 | IT(v+2)=0; 26 | IT(v+3)=2; 27 | 28 | else 29 | 30 | if PT(v,:)==P(i,:) 31 | 32 | IT(v+1)=0; 33 | IT(v+2)=2; 34 | 35 | else 36 | 37 | IT(v+1)=1; 38 | IT(v+2)=0; 39 | IT(v+3)=2; 40 | 41 | end 42 | 43 | end 44 | 45 | else 46 | 47 | s=(epsy+eps(i))/(eps(i)-eps(i+1)); 48 | 49 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 50 | 51 | if v==0 52 | 53 | IT(v+1)=2; 54 | IT(v+2)=0; 55 | IT(v+3)=1; 56 | 57 | else 58 | 59 | if PT(v,:)==P(i,:) 60 | 61 | IT(v+1)=0; 62 | IT(v+2)=1; 63 | 64 | else 65 | 66 | IT(v+1)=2; 67 | IT(v+2)=0; 68 | IT(v+3)=1; 69 | 70 | end 71 | 72 | end 73 | 74 | end 75 | 76 | if v==0 77 | 78 | PT(v+1,1:2)=P(i,:); 79 | PT(v+2,1:2)=Padd; 80 | PT(v+3,1:2)=P(i+1,:); 81 | 82 | else 83 | 84 | if PT(v,:)==P(i,:) 85 | 86 | PT(v+1,1:2)=Padd; 87 | PT(v+2,1:2)=P(i+1,:); 88 | 89 | else 90 | 91 | PT(v+1,1:2)=P(i,:); 92 | PT(v+2,1:2)=Padd; 93 | PT(v+3,1:2)=P(i+1,:); 94 | 95 | end 96 | 97 | end 98 | 99 | %%%%%%%%%%%%%%%%%%%%%%%%% caso B.2 %%%%%%%%%%%%%%%%%%%%%%%%% 100 | 101 | case 6 102 | 103 | if I(i)==2 104 | 105 | s=(epsy-eps(i))/(eps(i+1)-eps(i)); 106 | 107 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 108 | 109 | if v==0 110 | 111 | IT(v+1)=2; 112 | IT(v+2)=0; 113 | IT(v+3)=3; 114 | 115 | else 116 | 117 | if PT(v,:)==P(i,:) 118 | 119 | IT(v+1)=0; 120 | IT(v+2)=3; 121 | 122 | else 123 | 124 | IT(v+1)=2; 125 | IT(v+2)=0; 126 | IT(v+3)=3; 127 | 128 | end 129 | 130 | end 131 | 132 | else 133 | 134 | s=(eps(i)-epsy)/(eps(i)-eps(i+1)); 135 | 136 | Padd=P(i,:)+s*(P(i+1,:)-P(i,:)); 137 | 138 | if v==0 139 | 140 | IT(v+1)=3; 141 | IT(v+2)=0; 142 | IT(v+3)=2; 143 | 144 | else 145 | 146 | if PT(v,:)==P(i,:) 147 | 148 | IT(v+1)=0; 149 | IT(v+2)=2; 150 | 151 | else 152 | 153 | IT(v+1)=3; 154 | IT(v+2)=0; 155 | IT(v+3)=2; 156 | 157 | end 158 | 159 | end 160 | 161 | end 162 | 163 | if v==0 164 | 165 | PT(v+1,1:2)=P(i,:); 166 | PT(v+2,1:2)=Padd; 167 | PT(v+3,1:2)=P(i+1,:); 168 | 169 | else 170 | 171 | if PT(v,:)==P(i,:) 172 | 173 | PT(v+1,1:2)=Padd; 174 | PT(v+2,1:2)=P(i+1,:); 175 | 176 | else 177 | 178 | PT(v+1,1:2)=P(i,:); 179 | PT(v+2,1:2)=Padd; 180 | PT(v+3,1:2)=P(i+1,:); 181 | 182 | end 183 | 184 | end 185 | 186 | %%%%%%%%%%%%%%%%%%%%%%%%% caso C %%%%%%%%%%%%%%%%%%%%%%%%% 187 | 188 | case 3 189 | 190 | if I(i)==1 191 | 192 | s1=(-epsy-eps(i))/(eps(i+1)-eps(i)); 193 | s2=(epsy-eps(i))/(eps(i+1)-eps(i)); 194 | 195 | Padd1=P(i,:)+s1*(P(i+1,:)-P(i,:)); 196 | Padd2=P(i,:)+s2*(P(i+1,:)-P(i,:)); 197 | 198 | if v==0 199 | 200 | IT(v+1)=1; 201 | IT(v+2)=0; 202 | IT(v+3)=0; 203 | IT(v+4)=3; 204 | 205 | else 206 | 207 | if PT(v,:)==P(i,:) 208 | 209 | IT(v+1)=0; 210 | IT(v+2)=0; 211 | IT(v+3)=3; 212 | 213 | else 214 | 215 | IT(v+1)=1; 216 | IT(v+2)=0; 217 | IT(v+3)=0; 218 | IT(v+4)=3; 219 | 220 | end 221 | 222 | end 223 | 224 | else 225 | 226 | s1=(eps(i)-epsy)/(eps(i)-eps(i+1)); 227 | s2=(eps(i)+epsy)/(eps(i)-eps(i+1)); 228 | 229 | Padd1=P(i,:)+s1*(P(i+1,:)-P(i,:)); 230 | Padd2=P(i,:)+s2*(P(i+1,:)-P(i,:)); 231 | 232 | if v==0 233 | 234 | IT(v+1)=3; 235 | IT(v+2)=0; 236 | IT(v+3)=0; 237 | IT(v+4)=1; 238 | 239 | else 240 | 241 | if PT(v,:)==P(i,:) 242 | 243 | IT(v+1)=0; 244 | IT(v+2)=0; 245 | IT(v+3)=1; 246 | 247 | else 248 | 249 | IT(v+1)=3; 250 | IT(v+2)=0; 251 | IT(v+3)=0; 252 | IT(v+4)=1; 253 | 254 | end 255 | 256 | end 257 | 258 | end 259 | 260 | if v==0 261 | 262 | PT(v+1,1:2)=P(i,:); 263 | PT(v+2,1:2)=Padd1; 264 | PT(v+3,1:2)=Padd2; 265 | PT(v+4,1:2)=P(i+1,:); 266 | 267 | else 268 | 269 | if PT(v,:)==P(i,:) 270 | 271 | PT(v+1,1:2)=Padd1; 272 | PT(v+2,1:2)=Padd2; 273 | PT(v+3,1:2)=P(i+1,:); 274 | 275 | else 276 | 277 | PT(v+1,1:2)=P(i,:); 278 | PT(v+2,1:2)=Padd1; 279 | PT(v+3,1:2)=Padd2; 280 | PT(v+4,1:2)=P(i+1,:); 281 | 282 | end 283 | 284 | end 285 | 286 | %%%%%%%%%%%%%%%%%%%%%%%%% caso A %%%%%%%%%%%%%%%%%%%%%%%%% 287 | 288 | otherwise 289 | 290 | if v==0 291 | 292 | PT(v+1,1:2)=P(i,:); 293 | PT(v+2,1:2)=P(i+1,:); 294 | 295 | else 296 | 297 | if PT(v,:)==P(i,:) 298 | 299 | PT(v+1,1:2)=P(i+1,:); 300 | 301 | else 302 | 303 | PT(v+1,1:2)=P(i,:); 304 | PT(v+2,1:2)=P(i+1,:); 305 | 306 | end 307 | 308 | end 309 | 310 | if I(i)==1 311 | 312 | if v==0 313 | 314 | IT(v+1)=1; 315 | IT(v+2)=1; 316 | 317 | else 318 | 319 | if PT(v,:)==P(i,:) 320 | 321 | IT(v+1)=1; 322 | 323 | else 324 | 325 | IT(v+1)=1; 326 | IT(v+2)=1; 327 | 328 | end 329 | 330 | end 331 | 332 | else 333 | 334 | if I(i)==2 335 | 336 | if v==0 337 | 338 | IT(v+1)=2; 339 | IT(v+2)=2; 340 | 341 | else 342 | 343 | if PT(v,:)==P(i,:) 344 | 345 | IT(v+1)=2; 346 | 347 | else 348 | 349 | IT(v+1)=2; 350 | IT(v+2)=2; 351 | 352 | end 353 | 354 | end 355 | 356 | else 357 | 358 | if v==0 359 | 360 | IT(v+1)=3; 361 | IT(v+2)=3; 362 | 363 | else 364 | 365 | if PT(v,:)==P(i,:) 366 | 367 | IT(v+1)=3; 368 | 369 | else 370 | 371 | IT(v+1)=3; 372 | IT(v+2)=3; 373 | 374 | end 375 | 376 | end 377 | 378 | end 379 | 380 | end 381 | 382 | end 383 | 384 | end 385 | 386 | 387 | if PT(size(PT,1),:)==PT(1,:) 388 | 389 | open=false; 390 | 391 | else 392 | 393 | open=true; 394 | 395 | end 396 | 397 | if open 398 | 399 | PT(size(PT,1)+1,:)=PT(1,:); 400 | 401 | IT(length(IT)+1)=IT(1); 402 | 403 | end 404 | 405 | 406 | end -------------------------------------------------------------------------------- /pasm/plane stress element/ELIST2.txt: -------------------------------------------------------------------------------- 1 | 1 1 1 1 0 1 585 579 45 522 2 | 2 1 1 1 0 1 584 525 75 76 3 | 3 1 1 1 0 1 583 561 6 49 4 | 4 1 1 1 0 1 582 446 37 340 5 | 5 1 1 1 0 1 581 490 44 266 6 | 6 1 1 1 0 1 580 451 45 579 7 | 7 1 1 1 0 1 578 477 53 51 8 | 8 1 1 1 0 1 577 553 164 74 9 | 9 1 1 1 0 1 576 482 30 511 10 | 10 1 1 1 0 1 575 239 48 255 11 | 11 1 1 1 0 1 574 293 40 441 12 | 12 1 1 1 0 1 573 428 32 351 13 | 13 1 1 1 0 1 572 419 34 373 14 | 14 1 1 1 0 1 571 410 31 394 15 | 15 1 1 1 0 1 570 185 186 405 16 | 16 1 1 1 0 1 569 26 27 398 17 | 17 1 1 1 0 1 568 63 64 377 18 | 18 1 1 1 0 1 567 14 13 22 19 | 19 1 1 1 0 1 566 71 175 355 20 | 20 1 1 1 0 1 565 18 17 387 21 | 21 1 1 1 0 1 564 179 181 344 22 | 22 1 1 1 0 1 563 205 206 331 23 | 23 1 1 1 0 1 562 5 6 561 24 | 24 1 1 1 0 1 560 55 52 366 25 | 25 1 1 1 0 1 559 60 59 323 26 | 26 1 1 1 0 1 558 169 165 312 27 | 27 1 1 1 0 1 557 174 173 301 28 | 28 1 1 1 0 1 556 192 199 223 29 | 29 1 1 1 0 1 555 198 195 290 30 | 30 1 1 1 0 1 554 166 164 553 31 | 31 1 1 1 0 1 552 190 189 258 32 | 32 1 1 1 0 1 551 8 7 209 33 | 33 1 1 1 0 1 550 197 196 247 34 | 34 1 1 1 0 1 549 499 151 548 35 | 35 1 1 1 0 1 547 546 161 543 36 | 36 1 1 1 0 1 545 544 155 519 37 | 37 1 1 1 0 1 542 529 157 541 38 | 38 1 1 1 0 1 539 538 160 534 39 | 39 1 1 1 0 1 536 535 162 163 40 | 40 1 1 1 0 1 533 329 108 532 41 | 41 1 1 1 0 1 531 530 158 526 42 | 42 1 1 1 0 1 528 527 56 62 43 | 43 1 1 1 0 1 524 450 137 523 44 | 44 1 1 1 0 1 521 520 156 515 45 | 45 1 1 1 0 1 517 516 110 336 46 | 46 1 1 1 0 1 513 493 148 512 47 | 47 1 1 1 0 1 510 509 153 506 48 | 48 1 1 1 0 1 508 507 89 261 49 | 49 1 1 1 0 1 505 454 138 504 50 | 50 1 1 1 0 1 503 502 152 497 51 | 51 1 1 1 0 1 500 498 151 499 52 | 52 1 1 1 0 1 495 481 146 494 53 | 53 1 1 1 0 1 492 491 149 487 54 | 54 1 1 1 0 1 489 488 50 12 55 | 55 1 1 1 0 1 486 253 87 485 56 | 56 1 1 1 0 1 484 483 147 478 57 | 57 1 1 1 0 1 480 479 73 54 58 | 58 1 1 1 0 1 476 474 143 475 59 | 59 1 1 1 0 1 473 472 145 467 60 | 60 1 1 1 0 1 470 468 144 469 61 | 61 1 1 1 0 1 465 244 83 464 62 | 62 1 1 1 0 1 463 462 141 458 63 | 63 1 1 1 0 1 460 459 86 250 64 | 64 1 1 1 0 1 456 298 98 455 65 | 65 1 1 1 0 1 453 452 139 447 66 | 66 1 1 1 0 1 449 448 135 437 67 | 67 1 1 1 0 1 445 432 133 444 68 | 68 1 1 1 0 1 443 442 136 438 69 | 69 1 1 1 0 1 440 439 113 347 70 | 70 1 1 1 0 1 436 423 131 435 71 | 71 1 1 1 0 1 434 433 134 429 72 | 72 1 1 1 0 1 431 430 119 369 73 | 73 1 1 1 0 1 427 414 129 426 74 | 74 1 1 1 0 1 425 424 132 420 75 | 75 1 1 1 0 1 422 421 124 390 76 | 76 1 1 1 0 1 418 72 182 417 77 | 77 1 1 1 0 1 416 415 130 411 78 | 78 1 1 1 0 1 413 412 127 401 79 | 79 1 1 1 0 1 409 24 25 408 80 | 80 1 1 1 0 1 407 406 128 402 81 | 81 1 1 1 0 1 404 403 125 395 82 | 82 1 1 1 0 1 400 28 61 399 83 | 83 1 1 1 0 1 397 396 126 391 84 | 84 1 1 1 0 1 393 392 120 374 85 | 85 1 1 1 0 1 389 16 15 388 86 | 86 1 1 1 0 1 386 385 123 381 87 | 87 1 1 1 0 1 383 382 23 68 88 | 88 1 1 1 0 1 379 66 69 378 89 | 89 1 1 1 0 1 376 375 121 370 90 | 90 1 1 1 0 1 372 371 114 352 91 | 91 1 1 1 0 1 368 20 19 367 92 | 92 1 1 1 0 1 365 364 118 359 93 | 93 1 1 1 0 1 362 360 117 361 94 | 94 1 1 1 0 1 357 176 178 356 95 | 95 1 1 1 0 1 354 353 115 348 96 | 96 1 1 1 0 1 350 349 111 341 97 | 97 1 1 1 0 1 346 184 187 345 98 | 98 1 1 1 0 1 343 342 112 337 99 | 99 1 1 1 0 1 339 338 107 326 100 | 100 1 1 1 0 1 335 3 4 334 101 | 101 1 1 1 0 1 333 332 109 327 102 | 102 1 1 1 0 1 330 328 108 329 103 | 103 1 1 1 0 1 325 58 57 324 104 | 104 1 1 1 0 1 322 321 106 316 105 | 105 1 1 1 0 1 319 317 105 318 106 | 106 1 1 1 0 1 314 67 65 313 107 | 107 1 1 1 0 1 311 310 103 305 108 | 108 1 1 1 0 1 308 306 102 307 109 | 109 1 1 1 0 1 303 172 171 302 110 | 110 1 1 1 0 1 300 299 100 294 111 | 111 1 1 1 0 1 297 295 99 296 112 | 112 1 1 1 0 1 292 183 180 291 113 | 113 1 1 1 0 1 289 288 97 283 114 | 114 1 1 1 0 1 286 284 96 285 115 | 115 1 1 1 0 1 281 177 191 280 116 | 116 1 1 1 0 1 278 277 94 272 117 | 117 1 1 1 0 1 274 273 77 218 118 | 118 1 1 1 0 1 270 201 200 269 119 | 119 1 1 1 0 1 268 267 91 262 120 | 120 1 1 1 0 1 265 263 90 264 121 | 121 1 1 1 0 1 260 168 167 259 122 | 122 1 1 1 0 1 257 256 88 251 123 | 123 1 1 1 0 1 254 252 87 253 124 | 124 1 1 1 0 1 249 194 193 248 125 | 125 1 1 1 0 1 246 245 85 240 126 | 126 1 1 1 0 1 243 241 84 242 127 | 127 1 1 1 0 1 238 10 9 237 128 | 128 1 1 1 0 1 235 234 82 229 129 | 129 1 1 1 0 1 231 230 207 203 130 | 130 1 1 1 0 1 227 215 214 226 131 | 131 1 1 1 0 1 225 224 79 219 132 | 132 1 1 1 0 1 222 220 78 221 133 | 133 1 1 1 0 1 548 151 579 585 134 | 134 1 1 1 0 1 161 548 585 544 135 | 135 1 1 1 0 1 544 585 522 155 136 | 136 1 1 1 0 1 541 157 525 584 137 | 137 1 1 1 0 1 160 541 584 535 138 | 138 1 1 1 0 1 535 584 76 162 139 | 139 1 1 1 0 1 532 108 561 583 140 | 140 1 1 1 0 1 158 532 583 527 141 | 141 1 1 1 0 1 527 583 49 56 142 | 142 1 1 1 0 1 523 137 446 582 143 | 143 1 1 1 0 1 156 523 582 516 144 | 144 1 1 1 0 1 516 582 340 110 145 | 145 1 1 1 0 1 512 148 490 581 146 | 146 1 1 1 0 1 153 512 581 507 147 | 147 1 1 1 0 1 507 581 266 89 148 | 148 1 1 1 0 1 504 138 451 580 149 | 149 1 1 1 0 1 152 504 580 498 150 | 150 1 1 1 0 1 498 580 579 151 151 | 151 1 1 1 0 1 494 146 477 578 152 | 152 1 1 1 0 1 149 494 578 488 153 | 153 1 1 1 0 1 488 578 51 50 154 | 154 1 1 1 0 1 485 87 553 577 155 | 155 1 1 1 0 1 147 485 577 479 156 | 156 1 1 1 0 1 479 577 74 73 157 | 157 1 1 1 0 1 475 143 482 576 158 | 158 1 1 1 0 1 145 475 576 468 159 | 159 1 1 1 0 1 468 576 511 144 160 | 160 1 1 1 0 1 464 83 239 575 161 | 161 1 1 1 0 1 141 464 575 459 162 | 162 1 1 1 0 1 459 575 255 86 163 | 163 1 1 1 0 1 455 98 293 574 164 | 164 1 1 1 0 1 139 455 574 448 165 | 165 1 1 1 0 1 448 574 441 135 166 | 166 1 1 1 0 1 444 133 428 573 167 | 167 1 1 1 0 1 136 444 573 439 168 | 168 1 1 1 0 1 439 573 351 113 169 | 169 1 1 1 0 1 435 131 419 572 170 | 170 1 1 1 0 1 134 435 572 430 171 | 171 1 1 1 0 1 430 572 373 119 172 | 172 1 1 1 0 1 426 129 410 571 173 | 173 1 1 1 0 1 132 426 571 421 174 | 174 1 1 1 0 1 421 571 394 124 175 | 175 1 1 1 0 1 417 182 185 570 176 | 176 1 1 1 0 1 130 417 570 412 177 | 177 1 1 1 0 1 412 570 405 127 178 | 178 1 1 1 0 1 408 25 26 569 179 | 179 1 1 1 0 1 128 408 569 403 180 | 180 1 1 1 0 1 403 569 398 125 181 | 181 1 1 1 0 1 399 61 63 568 182 | 182 1 1 1 0 1 126 399 568 392 183 | 183 1 1 1 0 1 392 568 377 120 184 | 184 1 1 1 0 1 388 15 14 567 185 | 185 1 1 1 0 1 123 388 567 382 186 | 186 1 1 1 0 1 382 567 22 23 187 | 187 1 1 1 0 1 378 69 71 566 188 | 188 1 1 1 0 1 121 378 566 371 189 | 189 1 1 1 0 1 371 566 355 114 190 | 190 1 1 1 0 1 367 19 18 565 191 | 191 1 1 1 0 1 118 367 565 360 192 | 192 1 1 1 0 1 360 565 387 117 193 | 193 1 1 1 0 1 356 178 179 564 194 | 194 1 1 1 0 1 115 356 564 349 195 | 195 1 1 1 0 1 349 564 344 111 196 | 196 1 1 1 0 1 345 187 205 563 197 | 197 1 1 1 0 1 112 345 563 338 198 | 198 1 1 1 0 1 338 563 331 107 199 | 199 1 1 1 0 1 334 4 5 562 200 | 200 1 1 1 0 1 109 334 562 328 201 | 201 1 1 1 0 1 328 562 561 108 202 | 202 1 1 1 0 1 324 57 55 560 203 | 203 1 1 1 0 1 106 324 560 317 204 | 204 1 1 1 0 1 317 560 366 105 205 | 205 1 1 1 0 1 313 65 60 559 206 | 206 1 1 1 0 1 103 313 559 306 207 | 207 1 1 1 0 1 306 559 323 102 208 | 208 1 1 1 0 1 302 171 169 558 209 | 209 1 1 1 0 1 100 302 558 295 210 | 210 1 1 1 0 1 295 558 312 99 211 | 211 1 1 1 0 1 291 180 174 557 212 | 212 1 1 1 0 1 97 291 557 284 213 | 213 1 1 1 0 1 284 557 301 96 214 | 214 1 1 1 0 1 280 191 192 556 215 | 215 1 1 1 0 1 94 280 556 273 216 | 216 1 1 1 0 1 273 556 223 77 217 | 217 1 1 1 0 1 269 200 198 555 218 | 218 1 1 1 0 1 91 269 555 263 219 | 219 1 1 1 0 1 263 555 290 90 220 | 220 1 1 1 0 1 259 167 166 554 221 | 221 1 1 1 0 1 88 259 554 252 222 | 222 1 1 1 0 1 252 554 553 87 223 | 223 1 1 1 0 1 248 193 190 552 224 | 224 1 1 1 0 1 85 248 552 241 225 | 225 1 1 1 0 1 241 552 258 84 226 | 226 1 1 1 0 1 237 9 8 551 227 | 227 1 1 1 0 1 82 237 551 230 228 | 228 1 1 1 0 1 230 551 209 207 229 | 229 1 1 1 0 1 226 214 197 550 230 | 230 1 1 1 0 1 79 226 550 220 231 | 231 1 1 1 0 1 220 550 247 78 232 | 232 1 1 1 0 1 466 39 499 549 233 | 233 1 1 1 0 1 142 466 549 546 234 | 234 1 1 1 0 1 546 549 548 161 235 | 235 1 1 1 0 1 471 142 546 547 236 | 236 1 1 1 0 1 41 471 547 537 237 | 237 1 1 1 0 1 537 547 543 159 238 | 238 1 1 1 0 1 543 161 544 545 239 | 239 1 1 1 0 1 159 543 545 540 240 | 240 1 1 1 0 1 540 545 519 29 241 | 241 1 1 1 0 1 540 29 529 542 242 | 242 1 1 1 0 1 159 540 542 538 243 | 243 1 1 1 0 1 538 542 541 160 244 | 244 1 1 1 0 1 537 159 538 539 245 | 245 1 1 1 0 1 41 537 539 276 246 | 246 1 1 1 0 1 276 539 534 93 247 | 247 1 1 1 0 1 534 160 535 536 248 | 248 1 1 1 0 1 93 534 536 279 249 | 249 1 1 1 0 1 279 536 163 170 250 | 250 1 1 1 0 1 514 35 329 533 251 | 251 1 1 1 0 1 154 514 533 530 252 | 252 1 1 1 0 1 530 533 532 158 253 | 253 1 1 1 0 1 518 154 530 531 254 | 254 1 1 1 0 1 29 518 531 529 255 | 255 1 1 1 0 1 529 531 526 157 256 | 256 1 1 1 0 1 526 158 527 528 257 | 257 1 1 1 0 1 157 526 528 525 258 | 258 1 1 1 0 1 525 528 62 75 259 | 259 1 1 1 0 1 522 45 450 524 260 | 260 1 1 1 0 1 155 522 524 520 261 | 261 1 1 1 0 1 520 524 523 156 262 | 262 1 1 1 0 1 519 155 520 521 263 | 263 1 1 1 0 1 29 519 521 518 264 | 264 1 1 1 0 1 518 521 515 154 265 | 265 1 1 1 0 1 515 156 516 517 266 | 266 1 1 1 0 1 154 515 517 514 267 | 267 1 1 1 0 1 514 517 336 35 268 | 268 1 1 1 0 1 511 30 493 513 269 | 269 1 1 1 0 1 144 511 513 509 270 | 270 1 1 1 0 1 509 513 512 153 271 | 271 1 1 1 0 1 469 144 509 510 272 | 272 1 1 1 0 1 39 469 510 496 273 | 273 1 1 1 0 1 496 510 506 150 274 | 274 1 1 1 0 1 506 153 507 508 275 | 275 1 1 1 0 1 150 506 508 501 276 | 276 1 1 1 0 1 501 508 261 43 277 | 277 1 1 1 0 1 282 42 454 505 278 | 278 1 1 1 0 1 95 282 505 502 279 | 279 1 1 1 0 1 502 505 504 152 280 | 280 1 1 1 0 1 287 95 502 503 281 | 281 1 1 1 0 1 43 287 503 501 282 | 282 1 1 1 0 1 501 503 497 150 283 | 283 1 1 1 0 1 497 152 498 500 284 | 284 1 1 1 0 1 150 497 500 496 285 | 285 1 1 1 0 1 496 500 499 39 286 | 286 1 1 1 0 1 493 30 481 495 287 | 287 1 1 1 0 1 148 493 495 491 288 | 288 1 1 1 0 1 491 495 494 149 289 | 289 1 1 1 0 1 490 148 491 492 290 | 290 1 1 1 0 1 44 490 492 233 291 | 291 1 1 1 0 1 233 492 487 81 292 | 292 1 1 1 0 1 487 149 488 489 293 | 293 1 1 1 0 1 81 487 489 236 294 | 294 1 1 1 0 1 236 489 12 11 295 | 295 1 1 1 0 1 474 46 253 486 296 | 296 1 1 1 0 1 143 474 486 483 297 | 297 1 1 1 0 1 483 486 485 147 298 | 298 1 1 1 0 1 482 143 483 484 299 | 299 1 1 1 0 1 30 482 484 481 300 | 300 1 1 1 0 1 481 484 478 146 301 | 301 1 1 1 0 1 478 147 479 480 302 | 302 1 1 1 0 1 146 478 480 477 303 | 303 1 1 1 0 1 477 480 54 53 304 | 304 1 1 1 0 1 457 46 474 476 305 | 305 1 1 1 0 1 140 457 476 472 306 | 306 1 1 1 0 1 472 476 475 145 307 | 307 1 1 1 0 1 461 140 472 473 308 | 308 1 1 1 0 1 41 461 473 471 309 | 309 1 1 1 0 1 471 473 467 142 310 | 310 1 1 1 0 1 467 145 468 470 311 | 311 1 1 1 0 1 142 467 470 466 312 | 312 1 1 1 0 1 466 470 469 39 313 | 313 1 1 1 0 1 271 47 244 465 314 | 314 1 1 1 0 1 92 271 465 462 315 | 315 1 1 1 0 1 462 465 464 141 316 | 316 1 1 1 0 1 275 92 462 463 317 | 317 1 1 1 0 1 41 275 463 461 318 | 318 1 1 1 0 1 461 463 458 140 319 | 319 1 1 1 0 1 458 141 459 460 320 | 320 1 1 1 0 1 140 458 460 457 321 | 321 1 1 1 0 1 457 460 250 46 322 | 322 1 1 1 0 1 454 42 298 456 323 | 323 1 1 1 0 1 138 454 456 452 324 | 324 1 1 1 0 1 452 456 455 139 325 | 325 1 1 1 0 1 451 138 452 453 326 | 326 1 1 1 0 1 45 451 453 450 327 | 327 1 1 1 0 1 450 453 447 137 328 | 328 1 1 1 0 1 447 139 448 449 329 | 329 1 1 1 0 1 137 447 449 446 330 | 330 1 1 1 0 1 446 449 437 37 331 | 331 1 1 1 0 1 304 38 432 445 332 | 332 1 1 1 0 1 101 304 445 442 333 | 333 1 1 1 0 1 442 445 444 136 334 | 334 1 1 1 0 1 309 101 442 443 335 | 335 1 1 1 0 1 40 309 443 441 336 | 336 1 1 1 0 1 441 443 438 135 337 | 337 1 1 1 0 1 438 136 439 440 338 | 338 1 1 1 0 1 135 438 440 437 339 | 339 1 1 1 0 1 437 440 347 37 340 | 340 1 1 1 0 1 315 36 423 436 341 | 341 1 1 1 0 1 104 315 436 433 342 | 342 1 1 1 0 1 433 436 435 134 343 | 343 1 1 1 0 1 320 104 433 434 344 | 344 1 1 1 0 1 38 320 434 432 345 | 345 1 1 1 0 1 432 434 429 133 346 | 346 1 1 1 0 1 429 134 430 431 347 | 347 1 1 1 0 1 133 429 431 428 348 | 348 1 1 1 0 1 428 431 369 32 349 | 349 1 1 1 0 1 358 33 414 427 350 | 350 1 1 1 0 1 116 358 427 424 351 | 351 1 1 1 0 1 424 427 426 132 352 | 352 1 1 1 0 1 363 116 424 425 353 | 353 1 1 1 0 1 36 363 425 423 354 | 354 1 1 1 0 1 423 425 420 131 355 | 355 1 1 1 0 1 420 132 421 422 356 | 356 1 1 1 0 1 131 420 422 419 357 | 357 1 1 1 0 1 419 422 390 34 358 | 358 1 1 1 0 1 380 70 72 418 359 | 359 1 1 1 0 1 122 380 418 415 360 | 360 1 1 1 0 1 415 418 417 130 361 | 361 1 1 1 0 1 384 122 415 416 362 | 362 1 1 1 0 1 33 384 416 414 363 | 363 1 1 1 0 1 414 416 411 129 364 | 364 1 1 1 0 1 411 130 412 413 365 | 365 1 1 1 0 1 129 411 413 410 366 | 366 1 1 1 0 1 410 413 401 31 367 | 367 1 1 1 0 1 213 21 24 409 368 | 368 1 1 1 0 1 210 213 409 406 369 | 369 1 1 1 0 1 406 409 408 128 370 | 370 1 1 1 0 1 188 210 406 407 371 | 371 1 1 1 0 1 186 188 407 405 372 | 372 1 1 1 0 1 405 407 402 127 373 | 373 1 1 1 0 1 402 128 403 404 374 | 374 1 1 1 0 1 127 402 404 401 375 | 375 1 1 1 0 1 401 404 395 31 376 | 376 1 1 1 0 1 398 27 28 400 377 | 377 1 1 1 0 1 125 398 400 396 378 | 378 1 1 1 0 1 396 400 399 126 379 | 379 1 1 1 0 1 395 125 396 397 380 | 380 1 1 1 0 1 31 395 397 394 381 | 381 1 1 1 0 1 394 397 391 124 382 | 382 1 1 1 0 1 391 126 392 393 383 | 383 1 1 1 0 1 124 391 393 390 384 | 384 1 1 1 0 1 390 393 374 34 385 | 385 1 1 1 0 1 387 17 16 389 386 | 386 1 1 1 0 1 117 387 389 385 387 | 387 1 1 1 0 1 385 389 388 123 388 | 388 1 1 1 0 1 361 117 385 386 389 | 389 1 1 1 0 1 33 361 386 384 390 | 390 1 1 1 0 1 384 386 381 122 391 | 391 1 1 1 0 1 381 123 382 383 392 | 392 1 1 1 0 1 122 381 383 380 393 | 393 1 1 1 0 1 380 383 68 70 394 | 394 1 1 1 0 1 377 64 66 379 395 | 395 1 1 1 0 1 120 377 379 375 396 | 396 1 1 1 0 1 375 379 378 121 397 | 397 1 1 1 0 1 374 120 375 376 398 | 398 1 1 1 0 1 34 374 376 373 399 | 399 1 1 1 0 1 373 376 370 119 400 | 400 1 1 1 0 1 370 121 371 372 401 | 401 1 1 1 0 1 119 370 372 369 402 | 402 1 1 1 0 1 369 372 352 32 403 | 403 1 1 1 0 1 366 52 20 368 404 | 404 1 1 1 0 1 105 366 368 364 405 | 405 1 1 1 0 1 364 368 367 118 406 | 406 1 1 1 0 1 318 105 364 365 407 | 407 1 1 1 0 1 36 318 365 363 408 | 408 1 1 1 0 1 363 365 359 116 409 | 409 1 1 1 0 1 359 118 360 362 410 | 410 1 1 1 0 1 116 359 362 358 411 | 411 1 1 1 0 1 358 362 361 33 412 | 412 1 1 1 0 1 355 175 176 357 413 | 413 1 1 1 0 1 114 355 357 353 414 | 414 1 1 1 0 1 353 357 356 115 415 | 415 1 1 1 0 1 352 114 353 354 416 | 416 1 1 1 0 1 32 352 354 351 417 | 417 1 1 1 0 1 351 354 348 113 418 | 418 1 1 1 0 1 348 115 349 350 419 | 419 1 1 1 0 1 113 348 350 347 420 | 420 1 1 1 0 1 347 350 341 37 421 | 421 1 1 1 0 1 344 181 184 346 422 | 422 1 1 1 0 1 111 344 346 342 423 | 423 1 1 1 0 1 342 346 345 112 424 | 424 1 1 1 0 1 341 111 342 343 425 | 425 1 1 1 0 1 37 341 343 340 426 | 426 1 1 1 0 1 340 343 337 110 427 | 427 1 1 1 0 1 337 112 338 339 428 | 428 1 1 1 0 1 110 337 339 336 429 | 429 1 1 1 0 1 336 339 326 35 430 | 430 1 1 1 0 1 212 1 3 335 431 | 431 1 1 1 0 1 211 212 335 332 432 | 432 1 1 1 0 1 332 335 334 109 433 | 433 1 1 1 0 1 208 211 332 333 434 | 434 1 1 1 0 1 206 208 333 331 435 | 435 1 1 1 0 1 331 333 327 107 436 | 436 1 1 1 0 1 327 109 328 330 437 | 437 1 1 1 0 1 107 327 330 326 438 | 438 1 1 1 0 1 326 330 329 35 439 | 439 1 1 1 0 1 323 59 58 325 440 | 440 1 1 1 0 1 102 323 325 321 441 | 441 1 1 1 0 1 321 325 324 106 442 | 442 1 1 1 0 1 307 102 321 322 443 | 443 1 1 1 0 1 38 307 322 320 444 | 444 1 1 1 0 1 320 322 316 104 445 | 445 1 1 1 0 1 316 106 317 319 446 | 446 1 1 1 0 1 104 316 319 315 447 | 447 1 1 1 0 1 315 319 318 36 448 | 448 1 1 1 0 1 312 165 67 314 449 | 449 1 1 1 0 1 99 312 314 310 450 | 450 1 1 1 0 1 310 314 313 103 451 | 451 1 1 1 0 1 296 99 310 311 452 | 452 1 1 1 0 1 40 296 311 309 453 | 453 1 1 1 0 1 309 311 305 101 454 | 454 1 1 1 0 1 305 103 306 308 455 | 455 1 1 1 0 1 101 305 308 304 456 | 456 1 1 1 0 1 304 308 307 38 457 | 457 1 1 1 0 1 301 173 172 303 458 | 458 1 1 1 0 1 96 301 303 299 459 | 459 1 1 1 0 1 299 303 302 100 460 | 460 1 1 1 0 1 285 96 299 300 461 | 461 1 1 1 0 1 42 285 300 298 462 | 462 1 1 1 0 1 298 300 294 98 463 | 463 1 1 1 0 1 294 100 295 297 464 | 464 1 1 1 0 1 98 294 297 293 465 | 465 1 1 1 0 1 293 297 296 40 466 | 466 1 1 1 0 1 290 195 183 292 467 | 467 1 1 1 0 1 90 290 292 288 468 | 468 1 1 1 0 1 288 292 291 97 469 | 469 1 1 1 0 1 264 90 288 289 470 | 470 1 1 1 0 1 43 264 289 287 471 | 471 1 1 1 0 1 287 289 283 95 472 | 472 1 1 1 0 1 283 97 284 286 473 | 473 1 1 1 0 1 95 283 286 282 474 | 474 1 1 1 0 1 282 286 285 42 475 | 475 1 1 1 0 1 279 170 177 281 476 | 476 1 1 1 0 1 93 279 281 277 477 | 477 1 1 1 0 1 277 281 280 94 478 | 478 1 1 1 0 1 276 93 277 278 479 | 479 1 1 1 0 1 41 276 278 275 480 | 480 1 1 1 0 1 275 278 272 92 481 | 481 1 1 1 0 1 272 94 273 274 482 | 482 1 1 1 0 1 92 272 274 271 483 | 483 1 1 1 0 1 271 274 218 47 484 | 484 1 1 1 0 1 228 202 201 270 485 | 485 1 1 1 0 1 80 228 270 267 486 | 486 1 1 1 0 1 267 270 269 91 487 | 487 1 1 1 0 1 232 80 267 268 488 | 488 1 1 1 0 1 44 232 268 266 489 | 489 1 1 1 0 1 266 268 262 89 490 | 490 1 1 1 0 1 262 91 263 265 491 | 491 1 1 1 0 1 89 262 265 261 492 | 492 1 1 1 0 1 261 265 264 43 493 | 493 1 1 1 0 1 258 189 168 260 494 | 494 1 1 1 0 1 84 258 260 256 495 | 495 1 1 1 0 1 256 260 259 88 496 | 496 1 1 1 0 1 242 84 256 257 497 | 497 1 1 1 0 1 48 242 257 255 498 | 498 1 1 1 0 1 255 257 251 86 499 | 499 1 1 1 0 1 251 88 252 254 500 | 500 1 1 1 0 1 86 251 254 250 501 | 501 1 1 1 0 1 250 254 253 46 502 | 502 1 1 1 0 1 247 196 194 249 503 | 503 1 1 1 0 1 78 247 249 245 504 | 504 1 1 1 0 1 245 249 248 85 505 | 505 1 1 1 0 1 221 78 245 246 506 | 506 1 1 1 0 1 47 221 246 244 507 | 507 1 1 1 0 1 244 246 240 83 508 | 508 1 1 1 0 1 240 85 241 243 509 | 509 1 1 1 0 1 83 240 243 239 510 | 510 1 1 1 0 1 239 243 242 48 511 | 511 1 1 1 0 1 236 11 10 238 512 | 512 1 1 1 0 1 81 236 238 234 513 | 513 1 1 1 0 1 234 238 237 82 514 | 514 1 1 1 0 1 233 81 234 235 515 | 515 1 1 1 0 1 44 233 235 232 516 | 516 1 1 1 0 1 232 235 229 80 517 | 517 1 1 1 0 1 229 82 230 231 518 | 518 1 1 1 0 1 80 229 231 228 519 | 519 1 1 1 0 1 228 231 203 202 520 | 520 1 1 1 0 1 217 2 215 227 521 | 521 1 1 1 0 1 216 217 227 224 522 | 522 1 1 1 0 1 224 227 226 79 523 | 523 1 1 1 0 1 204 216 224 225 524 | 524 1 1 1 0 1 199 204 225 223 525 | 525 1 1 1 0 1 223 225 219 77 526 | 526 1 1 1 0 1 219 79 220 222 527 | 527 1 1 1 0 1 77 219 222 218 528 | 528 1 1 1 0 1 218 222 221 47 529 | 530 | --------------------------------------------------------------------------------