Non Uniform Meshing in 1D Fem

6 visualizzazioni (ultimi 30 giorni)
Chris Dan
Chris Dan il 3 Dic 2019
Modificato: Chris Dan il 3 Dic 2019
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

Risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by