Commit 89d98d51 authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

fix&update code comments

parent c0d8a52f
......@@ -16,8 +16,8 @@ function [par1, par2] = elcd_i(ielem, ~, top, mat, ichois)
% par2 = [];
% ichois = 4 par1: shape function that defines the geometry
% par2 = [];
% ichois = 5 par1: defintion of location of dofs (vpos)
% par2: defintion of their shape functions (vshp)
% ichois = 5 par1: definition of location of dofs (vpos)
% par2: definition of their shape functions (vshp)
%
% See also elcd, elcd_s
......@@ -112,7 +112,7 @@ elseif ichois == 4
elseif ichois == 5
% defintion of location of dofs (vpos) and their shape functions
% definition of location of dofs (vpos) and their shape functions
if ietype == 1
% linear triangle
......
......@@ -8,8 +8,8 @@ function [Me,Ce,Ke,rhse,dum3]=elcdu(ielem,coord,top,mat,pos,sol,solu,posu,matu);
% Ce : element damping matrix (not used)
% Ke : element stiffness matrix
% rhse : element right hand side
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% e = mat(imat,1); (Young's modulus)
......
......@@ -8,7 +8,7 @@ function [Me, Ce, Ke, rhse, dummy] = ele(ielem, coord, top, mat, varargin)
% top topology array
% ielem element number
% mat material properties (mat.mat)
% E = mat(imat, 1); (Youngs modulus)
% E = mat(imat, 1); (Youngs modulus)
% nu = mat(imat, 2); (Poisson ratio)
% axi = mat(imat, 3); (0: plane strain, 1: axi-symmetric, 2: plane stress)
%
......
......@@ -8,12 +8,14 @@ function [sigma, sig, elweight] = ele_d(ielem, coord, top, mat, pos, ...
% input:
%
% ielem : element number
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% mat : material properties
% e = mat(imat, 1); (Young's modulus)
% E = mat(imat, 1); (Young's modulus)
% nu = mat(imat, 2); (Poisson's ratio)
% axi = mat(imat, 3); (0: plane strain, 1: axi-symmetric, 2: plane stress)
% pos : global pos array
% sol : array with calculated displacements (solutions)
%
% output:
% sigma(ielem, :) = [sigma_xx sigma_yy sigma_xy sigma_tt .... sigma_xx sigma_yy sigma_xy sigma_tt];
......@@ -90,7 +92,7 @@ end
% initialize strain-displacement matrix
B = zeros(4, nedofu);
ii = 0:2:nedofu-2;
% initialise sigam
% initialise sigma
sig = zeros(nint, 4);
str = zeros(nint, 4);
......
......@@ -15,8 +15,8 @@ function [par1, par2] = ele_i(ielem, ~, top, mat, ichois)
% par2 = [];
% ichois = 4 par1: shape function that defines the geometry
% par2 = [];
% ichois = 5 par1: defintion of location of dofs (vpos)
% par2: defintion of their shape functions (vshp)
% ichois = 5 par1: definition of location of dofs (vpos)
% par2: definition of their shape functions (vshp)
%
% See also ele, ele_d, ele_s
......@@ -32,42 +32,11 @@ par1 = []; par2 = [];
if ichois == 1
% definition of number of degrees of freedom for each node
if ietype == 1 % linear triangular-element
par1 = [2 2 2];
elseif ietype == 2 % quadratic element
par1 = [2 2 2 2 2 2];
elseif ietype == 3 % bilinear element
par1 = [2 2 2 2 ];
elseif ietype == 4 % bi-quadratic element
par1 = [2 2 2 2 2 2 2 2 2];
elseif ietype == 5 % P1+ element
par1 = [2 2 2 2];
end
% sanity check
npar = length(par1);
if npar ~= nlnodes
string_err = ['Number of nodes = ' num2str(nlnodes) ...
' for element type ' num2str(ietype) ...
' in ielem ' num2str(ielem) ', should be '];
error([string_err num2str(npar)]);
end
par1 = 2*ones(1, nlnodes);
elseif ichois == 2
if ietype == 1
par1 = 8*ones(1, nlnodes);
elseif ietype==2,
par1 = 8*ones(1, nlnodes);
elseif ietype==3,
par1 = 8*ones(1, nlnodes);
elseif ietype==4,
par1 = 8*ones(1, nlnodes);
elseif ietype==5,
par1 = 8*ones(1, nlnodes);
end
par1 = 8*ones(1, nlnodes);
elseif ichois == 3
% definition of sequence of nodes for plotting purposes
......@@ -93,7 +62,7 @@ elseif ichois == 4
elseif ietype == 2
% quadratic triangle
gshp(1, :) = [26 2 7];
gshp(1, :) = [26 2 7];
elseif ietype == 3
% linear quad
......@@ -113,7 +82,7 @@ elseif ichois == 4
elseif ichois == 5
% defintion of location of dofs (vpos) and their shape functions
% definition of location of dofs (vpos) and their shape functions
if ietype == 1
% linear triangle
......
......@@ -9,8 +9,8 @@ function [Me, Ce, Ke, rhse, dum3] = ...
% Ce : element damping matrix (not used)
% Ke : element stiffness matrix
% rhse : element right hand side
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% e = mat(imat,1); (Young's modulus)
......
......@@ -5,8 +5,8 @@ function [sigma,sig,elweight] = ...
%
% Parameters:
%
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% e = mat(imat,1); (Young's modulus)
......
......@@ -8,8 +8,8 @@ function [Ke, rhse] = elm1d(ielem, coord, top, mat)
%
% Input:
% ielem : element number
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% mat : material properties
%
% Output:
......
......@@ -6,11 +6,13 @@ function cdudx = elm1d_d(ielem, coord, top, mat, pos, sol)
% input:
%
% ielem : element number
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% mat : material properties
% f = mat(imat, 1); (source term)
% c = mat(imat, 2); (diffusion constant)
% pos : global pos array
% sol : array with calculated concentrations (solutions)
%
% output:
% cdudx :row with flux c du/dx for each node of the element
......@@ -54,4 +56,4 @@ end
cdudx = (n\cdudxint)';
% part of mlfem_nac: https://gitlab.tue.nl/STEM/mlfem_nac
end
\ No newline at end of file
end
......@@ -16,8 +16,8 @@ function [par1, par2] = elm1d_i(ielem, ~, top, mat, ichois)
% par2 = [];
% ichois = 4 par1: shape function that defines the geometry
% par2 = [];
% ichois = 5 par1: defintion of location of dofs (vpos)
% par2: defintion of their shape functions (vshp)
% ichois = 5 par1: definition of location of dofs (vpos)
% par2: definition of their shape functions (vshp)
%
% See also elm1d, elm1d_d, elm1d_s
......@@ -88,7 +88,7 @@ elseif ichois == 4
elseif ichois == 5
% defintion of location of dofs (vpos) and their shape functions
% definition of location of dofs (vpos) and their shape functions
if ietype == 1
% linear element
......
......@@ -7,8 +7,8 @@ function [Me, Ce, Ke, rhse] = elm1dcd(ielem, coord, top, mat)
%
% Input
% ielem : element number
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% mat : material properties
%
% Output
......
......@@ -6,11 +6,13 @@ function cdudx = elm1dcd_d(ielem, coord, top, mat, pos, sol)
% input:
%
% ielem : element number
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% mat : material properties
% f = mat(imat, 1); (source term)
% c = mat(imat, 2); (diffusion constant)
% pos : global pos array
% sol : array with calculated concentrations (solutions)
%
% output:
% cdudx :row with flux c du/dx for each node of the element
......
......@@ -16,8 +16,8 @@ function [par1, par2] = elm1dcd_i(ielem, ~, top, mat, ichois)
% par2 = [];
% ichois = 4 par1: shape function that defines the geometry
% par2 = [];
% ichois = 5 par1: defintion of location of dofs (vpos)
% par2: defintion of their shape functions (vshp)
% ichois = 5 par1: definition of location of dofs (vpos)
% par2: definition of their shape functions (vshp)
%
% See also elm1dcd, elm1dcd_d, elm1dcd_s
......@@ -90,7 +90,7 @@ elseif ichois == 4
elseif ichois == 5
% defintion of location of dofs (vpos) and their shape functions
% definition of location of dofs (vpos) and their shape functions
if ietype == 1
% linear element
......
......@@ -8,8 +8,8 @@ function [Me,Ce,Ke,rhse,dum3]=elme(ielem,coord,top,mat,pos,sol,soln,dum1,dum2);
% Ce : element damping matrix (not used)
% Ke : element stiffness matrix
% rhse : element right hand side
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% e = mat(imat,1); (Young's modulus)
......
......@@ -5,8 +5,8 @@ function [sigma,sig,elweight] = ...
%
% Parameters:
%
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% e = mat(imat,1); (Young's modulus)
......
......@@ -8,8 +8,8 @@ function [Me,Ce,Ke,rhse,dum3]=elsf(ielem,coord,top,mat,pos,sol,d3,dum1,param);
% Ce : element damping matrix (not used)
% Ke : element stiffness matrix
% rhse : element right hand side
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
%
......
......@@ -5,8 +5,8 @@ function [sigma,sig,elweight] = ...
%
% Parameters:
%
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% e = mat(imat,1); (Young's modulus)
......
......@@ -6,8 +6,8 @@ function [Me,Ce,Ke,rhse,dum3]=elup(ielem,coord,top,mat,pos,sol,soln,dum1,dum2);
%
% Ke : element stiffness matrix
% rhse : element right hand side
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% eta = mat(imat,1);
......
......@@ -8,8 +8,8 @@ function [sigma,sig,elweight] = ...
%
% Ke : element stiffness matrix
% rhse : element right hand side
% coord : coordinates of all nodes
% top : topology array
% coord : global node coordinates array
% top : global topology array
% ielem : element number
% mat : material properties
% eta = mat(imat,1);
......
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