Commit 7dc56e0e authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

remove redundant int2elm* files

parent db8ecc61
function elmdat=int2elm(intdat,coord,top,mat);
%
% elmdat=int2elm(intdat,coord,top,mat);
%
if nargin<6,
struct=[];
end
[nnodes,nsd,nelem,maxnlnodes,iimat,iitype] = sysinfo(size(coord),size(top));
nlnodes=maxnlnodes;
par=eleminfo(1,[],top,mat,7);
nint=par(1); nvar=par(2); nmode=par(3);
elmdat=zeros(nelem,nlnodes,nvar,nmode);
for ielem=1:nelem
par=eleminfo(ielem,[],top,mat,7);
if ~isempty(par),
nint=par(1); nvar=par(2); nmode=par(3);
imat = top(ielem,iimat);
etop = top(ielem,:);
gshp = eleminfo(1,[],etop,mat,4);
ng = elemshp(1,[],etop,mat,gshp);
[vpos,vshp] = eleminfo(1,[],top,mat,5);
[n,dn,intworg,intcoord] = elemshp(1,[],etop,mat,vshp(1,:));
nint=length(intworg);
% make a linear projection
n=elemshp(1,[],etop,mat,[23 2 nint]);
[n,dn,intw] = elemshp(1,[],etop,mat,[23 2 nint]);
nodcoord=zeros(nlnodes,2);
nodcoord(:,1)=coord(top(ielem,1:nlnodes),1);
nodcoord(:,2)=coord(top(ielem,1:nlnodes),2);
eintdat=reshape(intdat(ielem,:),nint,nvar,nmode);
qp=zeros(3,3);
rhse=zeros(3,nvar,nmode);
for int=1:nint
qp=qp+n(int,:)'*n(int,:)*intw(int);
for ivar=1:nvar
for imode=1:nmode
rhse(:,ivar,imode)=rhse(:,ivar,imode) + n(int,:)'*eintdat(int,ivar,imode)*intw(int);
end
end
end
nlnodes=length(ng(1,:));
eintdat=reshape(intdat(ielem,:),nint,nvar,nmode);
ksinodes=eleminfo(ielem,coord,top,mat,6);
[n] = elemshp(1,[],etop,mat,[23 2 nint],ksinodes);
for ivar=1:nvar
for imode=1:nmode
sol = qp \ rhse(:,ivar,imode);
elmdat(ielem,1:nlnodes,ivar,imode)=n*sol;
end
end
end
end
% part of mlfem_nac: https://gitlab.tue.nl/STEM/mlfem_nac
function [elmdat,topelgrp]=int2elmq(intdat,coord,top,mat,elgrp);
%
% [elmdat,topelgrp]=int2elmq(intdat,coord,top,mat);
% [elmdat,topelgrp]=int2elmq(intdat,coord,top,mat,elgrp);
%
if nargin<5, elgrp=1; end
%
if nargin<6,
struct=[];
end
[nnodes,nsd,nelem,maxnlnodes,iimat,iitype] = sysinfo(size(coord),size(top));
nlnodes=maxnlnodes;
par=eleminfo(1,[],top,mat,7);
nint=par(1); nvar=par(2); nmode=par(3);
elmdat=zeros(nelem,nlnodes,nvar,nmode);
nelgrp=length(elgrp);
for ielgrp=1:nelgrp
elmsg=find(top(:,iitype)==elgrp(ielgrp));
if ielgrp==1,
elms=elmsg;
else
elms=[elms; elmsg];
end
end
topelgrp=top(elms,:);
nelms=length(elms);
for iel=1:nelms
ielem=elms(iel);
par=eleminfo(ielem,[],top,mat,7);
if ~isempty(par),
nint=par(1); nvar=par(2); nmode=par(3);
imat = top(ielem,iimat);
etop = top(ielem,:);
gshp = eleminfo(1,[],etop,mat,4);
ng = elemshp(1,[],etop,mat,gshp);
[vpos,vshp] = eleminfo(1,[],top,mat,5);
[n,dn,intworg,intcoord] = elemshp(1,[],etop,mat,vshp(1,:));
nint=length(intworg);
% make a linear projection
n=elemshp(1,[],etop,mat,[14 1 sqrt(nint)]);
[n,dn,intw] = elemshp(1,[],etop,mat,[14 1 sqrt(nint)]);
nodcoord=zeros(nlnodes,2);
nodcoord(:,1)=coord(top(ielem,1:nlnodes),1);
nodcoord(:,2)=coord(top(ielem,1:nlnodes),2);
eintdat=reshape(intdat(ielem,1:nint*nvar*nmode),nint,nvar,nmode);
qp=zeros(4,4);
rhse=zeros(4,nvar,nmode);
for int=1:nint
qp=qp+n(int,:)'*n(int,:)*intw(int);
for ivar=1:nvar
for imode=1:nmode
rhse(:,ivar,imode)=rhse(:,ivar,imode) + n(int,:)'*eintdat(int,ivar,imode)*intw(int);
end
end
end
nlnodes=length(ng(1,:));
eintdat=reshape(intdat(ielem,1:nint*nvar*nmode),nint,nvar,nmode);
ksinodes=eleminfo(ielem,coord,top,mat,6);
[n] = elemshp(1,[],etop,mat,[14 1 sqrt(nint)],ksinodes);
for ivar=1:nvar
for imode=1:nmode
sol = qp \ rhse(:,ivar,imode);
elmdat(iel,1:nlnodes,ivar,imode)=n*sol;
end
end
end
end
% part of mlfem_nac: https://gitlab.tue.nl/STEM/mlfem_nac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment