Non Uniform Meshing in 1D Fem

11 次查看(过去 30 天)
Chris Dan
Chris Dan 2019-12-3
编辑: Chris Dan 2019-12-3
Hello, I am developing a 1D fem problem, I know how to create a uniform mesh, but does any one know how to create a non uniform mesh AFTER the uniform mesh is created.
For eg, if we have 5 elements, we have 6 nodes created, but now the user wants to create another node between 4 and 5 node. This would result in 6 elements and 7 nodes.
Does anyone know how to do that? or any links, here is my code, so far
%number of elements the solution 1D FEM
nE=3;
xb = 1
xa = 0
%generate nodes
nN=nE+1;
if nE<1
error('Number of elements <1');
end
%initiliasation ( speeds up calculations)
Nod= zeros(nN,1);
Elm = zeros(nE,2);
%generate list of nodes
for i=1:1:nN
Nod(i,1) = xa + (i-1)*(xb-xa)/nE;
end
%generate connectivity array for elelments
for k=1:1:nE
Elm(k,1)=k;
Elm(k,2)=k+1;
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by