Non Uniform Meshing in 1D Fem

조회 수: 6 (최근 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에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by