Commit 4c17b82e authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

add references to book exercises and equations to index

parent 67f3131e
......@@ -14,7 +14,8 @@ https://gitlab.tue.nl/stem/mlfem_nac/tree/v20-q2
* [feature] feedback on which elm1d_c.m or elcd_a.m function is used (fem1d, femlin_cd)
* [update] update crmesh chapter in manual for more clarity (thanks to Roderick for the feedback!)
* [update] fix some minor issues in manual (typos, typesetting, etc.) and update to v20-q2 (new global matrix names reflect terminology in book)
* [update] update engine chapter in manual with (linear) global matrices, equations, and engine output
* [update] update engine chapter in manual with global matrices, equations, and engine output for linear elements
* [update] add references to book exercises and equations to index of manual, and update index lay-ouy (because I can)
# Version 20-q1
......
......@@ -23,7 +23,7 @@ In this chapter we will have a closer on \demo{demo\_2d\_1dmimic\_conv\_diffusio
clear all, close all %#ok<CLSCR>
\end{lstlisting}
This demo basically adds the second dimension to the demo in chapter \ref{demosimple}, while it solves the same problem in \cite[Example 15.1]{Oomens2018} .
This demo basically adds the second dimension to the demo in chapter \ref{demosimple}, while it solves the same problem in \cite[Example \bkex{15.1}]{Oomens2018} .
As we will see, this has consequences for the pre-processing. Most importantly: we will use \kwc{crmesh} (chapter \ref{crmesh}) to make our 2D mesh, we will require the use of \kwo{pos} and \kwo{dest} for the initial conditions (and post-processing), and we use \kwc{addbndc} (section \ref{addbndc}) for our boundary conditions.
......
......@@ -41,11 +41,11 @@ script & engine & element & geometry & $\theta$ \\
\subsection*{\demo{demo\_1d\_diffusion.m}}
This demo belongs to \cite[Example 14.7]{Oomens2018} (the first FEM example in the book) and solves the steady state 1D diffusion equation.
This demo belongs to \cite[Example \bkex{14.7}]{Oomens2018} (the first FEM example in the book) and solves the steady state 1D diffusion equation.
\subsection*{\demo{demo\_1d\_conv\_diffusion.m} }
This demo belongs to \cite[Example 15.1]{Oomens2018} and is the subject of chapter \ref{demosimple}.
This demo belongs to \cite[Example \bkex{15.1}]{Oomens2018} and is the subject of chapter \ref{demosimple}.
\subsection*{\demo{demo\_2d\_1dmimic\_conv\_diffusion.m}}
......@@ -160,7 +160,7 @@ The demo further uses post-processing functions from \kdir{/library/postlib} to
\subsection*{\demo{demo\_2ds\_bar\_bending.m}}
This demo belongs to \cite[Example 18.1]{Oomens2018} and analyses the bending of a bar with linear (`Hookean') elements in a plane stress configuration.
This demo belongs to \cite[Example \bkex{18.1}]{Oomens2018} and analyses the bending of a bar with linear (`Hookean') elements in a plane stress configuration.
The demo shows how to apply nodal forces and compares the analysis results with the linear theory for bar bending in the post-processing phase.
......
......@@ -20,7 +20,7 @@ In this chapter we will have a closer on \demo{demo\_1d\_conv\_diffusion.m}:
clear all, close all %#ok<CLSCR>
\end{lstlisting}
This is a fairly simple demo that solves the problem in \cite[Example 15.1]{Oomens2018} with a manually created 1D mesh and little to no post-processing.
This is a fairly simple demo that solves the problem in \cite[Example \bkex{15.1}]{Oomens2018} with a manually created 1D mesh and little to no post-processing.
What it \textsl{does} showcase, are the three phases of FEM modeling (section \ref{femstruct}).
......@@ -210,7 +210,7 @@ title(['Pe = ', num2str(Pe)])
% part of mlfem_nac: https://gitlab.tue.nl/STEM/mlfem_nac
\end{lstlisting}
The element Peclet number is calculated \cite[Example 15.4]{Oomens2018} to annotate the plot (lines 89--92), and the results are visualized by simply plotting \kwo{sol} against \kwo{coord} (line 95). Again: this is possible because of the simple 1D mesh and single degree of freedom per node, so that \kwo{coord}\texttt{(}\kwo{inode}\texttt{)} corresponds with \kwo{sol}\texttt{(}\kwo{inode}\texttt{, :)}.
The element Peclet number is calculated \cite[Example \bkex{15.4}]{Oomens2018} to annotate the plot (lines 89--92), and the results are visualized by simply plotting \kwo{sol} against \kwo{coord} (line 95). Again: this is possible because of the simple 1D mesh and single degree of freedom per node, so that \kwo{coord}\texttt{(}\kwo{inode}\texttt{)} corresponds with \kwo{sol}\texttt{(}\kwo{inode}\texttt{, :)}.
If all went well, the demo produces figure \ref{fig:Ch5fig1} with \kwo{ntime} $+1$ lines: The (first, upper) straight line is for the initial conditions, the other \kwo{ntime} lines are the results for the \kwo{ntime} time-steps.
\begin{figure}[h!]
......
......@@ -59,11 +59,11 @@ So the (linear) engines solve the global linear system of equations
\mat{K}\cdot \col{u} & = \col{f} &\text{\kwc{fem1d}, \kwc{femlin\_e}} \label{Kuf}\\
\mat{q}\cdot \col{u} & = \col{f} & \text{\kwc{fem1dcd}, \kwc{femlin\_cd}, \kwo{istat}} =1 \label{quf}
\end{align}
for stationary problems. The instationary convection-diffusion equations lead to \cite[eq. 15.17 \& 16.39]{Oomens2018}:
for stationary problems. The instationary convection-diffusion equations lead to \cite[equations \bkeq{15.17} \& \bkeq{16.39}]{Oomens2018}:
\begin{equation}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} = \col{f} \label{prethetamat}
\end{equation}
and the convection-diffusion engines calculate the solution $u_{n+1}$ at the current time point for time-dependent problems with \cite[eq. 15.28]{Oomens2018}:
and the convection-diffusion engines calculate the solution $u_{n+1}$ at the current time point for time-dependent problems with \cite[equation \bkeq{15.28}]{Oomens2018}:
\begin{align}
\left(\frac{\mat{M}}{\Deltaup t}+\theta\left(\mat{C}+ \mat{K}\right)\right)\cdot \col{u}_{n+1} & = \left(\frac{\mat{M}}{\Deltaup t} - (1-\theta)\left(\mat{C}+\mat{K}\right)\right)\cdot \col{u}_n + \col{f} \label{thetamat}\\
\mat{q}\cdot\col{u}_{n+1} & = \col{f}_n & \text{\kwo{istat}} =2 \label{qunfn}
......@@ -76,7 +76,7 @@ The script \kwc{fem1d} uses the element \kwc{elm1d} to solve the 1D diffusion eq
\begin{equation}
\deriv{~}{x}\left(c\deriv{u}{x}\right) + f = 0 \tag{\ref{elm1deq}}
\end{equation}
with the final linear set of equations \cite[equation 14.61]{Oomens2018}:
with the final linear set of equations \cite[equation \bkeq{14.61}]{Oomens2018}:
\begin{equation}
\mat{K}\cdot\col{u} = \col{f} \tag{\ref{Kuf}}
\end{equation}
......@@ -97,7 +97,7 @@ The script \kwc{fem1dcd} uses the element \kwc{elm1dcd} to solve the 1D (instati
\begin{equation}
\pderiv{u}{t} + v \pderiv{u}{x} = \pderiv{}{x}\left(c\pderiv{u}{x}\right) + f \tag{\ref{elcdeq}}
\end{equation}
with the final linear set of equations \cite[equation 15.27]{Oomens2018}:
with the final linear set of equations \cite[equation \bkeq{15.27}]{Oomens2018}:
\begin{align}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} & = \col{f} \tag{\ref{prethetamat}}\\
\mat{q}\cdot\col{u} & = \col{f} &\text{\kwo{istat}} = 1 \tag{\ref{quf}}\\
......@@ -125,7 +125,7 @@ The script \kwc{femlin\_cd} uses the element \kwc{elcd} to solve the (instationa
\begin{equation}
\pderiv{u}{t} + \vec{v} \cdot\grad u = \grad\cdot\left(c\grad u\right) \tag{\ref{elcdeq}}
\end{equation}
with the final linear set of equations \cite[equation 16.39]{Oomens2018}:
with the final linear set of equations \cite[equation \bkeq{16.39}]{Oomens2018}:
\begin{align}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} & = \col{f} \tag{\ref{prethetamat}}\\
\mat{q}\cdot\col{u} & = \col{f} &\text{\kwo{istat}} = 1 \tag{\ref{quf}}\\
......@@ -173,7 +173,7 @@ but the structure and interpretation of $\mat{K}$ and $\col{u}$ can vary greatl
\subsection{Linear elasticity}\label{enginefemlin_es}
The script \kwc{femlin\_e} solves (2D) linear elasticity problems of the type
The script \kwc{femlin\_e} solves (2D) linear elasticity problems of the type \cite[equation \bkeq{18.4}]{Oomens2018}:
\begin{equation}
\ten{\sigma} = \kappa \trace\left(\ten{\epsilon}\right)\ten{I} + 2G\tend{\epsilon} \tag{\ref{eleeq}}
\end{equation}
......@@ -424,7 +424,7 @@ So, the end-user that is not into engine development will never have to `worry'
\subsection{Options for \kwc{sysnewt}}\label{newtoptions}
The engines for non-linear problems (\kwc{femnl} and \kwc{femnlt}) use the function \kwc{sysnewt} for the Newton linearization process. This function \kwc{sysnewt} requires an input argument \kwc{newtoptions} (table \ref{optionssysnewt}).
The engines for non-linear problems (\kwc{femnl} and \kwc{femnlt}) use the function \kwc{sysnewt} for the Newton linearization process. This function \kwc{sysnewt} requires an input argument \kwo{newtoptions} (table \ref{optionssysnewt}).
\begin{table}[h]
\center
\caption{The \kwo{newtoptions} input argument for \kwc{sysnewt}. Default values are set by the main engine when the user does not explicitly set these \kwo{newtoptions} in the pre-processing phase (before you call the engine).\label{optionssysnewt}}
......
......@@ -20,11 +20,9 @@
% listings and code
\usepackage{listings}
\input{listingset.tex}
% references and hyperlinks
\usepackage[square,sort&compress,comma,numbers]{natbib}
\usepackage[pdftex,breaklinks]{hyperref}
\usepackage{hypernat}
% indexing
\usepackage{makeidx}
\makeindex
% graphics and color
\usepackage[pdftex]{graphicx}
......@@ -54,28 +52,37 @@
% \renewcommand{\@defaultcnfont}{LinuxBiolinumO-LF}
% \makeatother
% references and hyperlinks
\usepackage[square,sort&compress,comma,numbers]{natbib}
\usepackage[pdftex,breaklinks]{hyperref}
\usepackage{hypernat}
% document specific conventions
\providecommand*{\mlfem}{\href{https://gitlab.tue.nl/STEM/mlfem_nac}{\color{black}\texttt{mlfem\_nac}}}
\providecommand*\warning{\marginpar{\center\includegraphics[width=1cm]{Exclamation.png}\\}}
\usepackage{makeidx}
% indexing
\providecommand*\kwo[1]{%
\index{\textbf{Variables and Parameters}!#1@\texttt{#1}}%
\index{\bigskip\hrule\smallskip\textbf{Variables and Parameters}!#1@\texttt{#1}}%
\textcolor{orange}{\texttt{#1}}%
}
\providecommand*\kwc[1]{%
\index{\textbf{Scripts \& Functions}!#1@\texttt{#1}}%
\index{\bigskip\hrule\smallskip\textbf{Scripts \& Functions}!#1@\texttt{#1}}%
\textcolor{cyan}{\texttt{#1}}%
}
\providecommand*\demo[1]{%
\index{\textbf{Demo scripts}!#1@\texttt{#1}}%
\index{\bigskip\hrule\smallskip\textbf{Demo scripts}!#1@\texttt{#1}}%
\textcolor{cyan}{\texttt{#1}}%
}
\providecommand*\kdir[1]{%
\index{\textbf{Directories}!#1@\texttt{#1}}%
\index{\bigskip\hrule\smallskip\textbf{Directories}!#1@\texttt{#1}}%
\textcolor{cyan}{\texttt{#1}}%
}
\makeindex
}
\providecommand*\bkeq[1]{%
\index{\bigskip\hrule\smallskip\textbf{Book references}!#1@equation\,#1}%
#1}%
\providecommand*\bkex[1]{%
\index{\bigskip\hrule\smallskip\textbf{Book references}!#1@Example\,#1}%
#1}%
\usepackage{enumitem}
\usepackage{tabularx}
......
clear all; close all;
points = [0 0; 1 0; 1 1; 0 1];
curves = [1 2 1 1 1; 2 3 1 1 1; 3 4 1 1 1; 4 1 1 1 1];
subarea = [1 2 3 4 1];
mat.mat(1) = 1;
mat.types = 'elcneo';
istat = 1;
bndcon = [1 1 0];
nodfrc = [];
% % ietype = 1: linear triangle
% ietype = 1; norder = 1; itype = 20;
%
% [top, coord] = crmesh(curves, subarea, points, norder, itype);
% mat.mat(11) = ietype;
% femnl
% sol
% ietype = 2: quadratic quad
ietype = 2; norder = 2; itype = 1;
clear sol
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femnl
sol
% % ietype = 3: linear quad
% ietype = 3; norder = 1; itype = 1;
%
% [top, coord] = crmesh(curves, subarea, points, norder, itype);
% mat.mat(11) = ietype;
% femlin_e
% sol
% ietype = 4: quadratic triangle, works but not if you the quad first (?!)
ietype = 4; norder = 2; itype = 20;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
clear sol
femnl
sol
%
% % ietype = 5: extended linear triangle
% ietype = 5; norder = 1; itype = 21;
%
% [top, coord] = crmesh(curves, subarea, points, norder, itype);
% mat.mat(11) = ietype;
% femlin_e
% sol
clear all; close all;
points = [0 0; 1 0; 1 1; 0 1];
curves = [1 2 1 1 1; 2 3 1 1 1; 3 4 1 1 1; 4 1 1 1 1];
subarea = [1 2 3 4 1];
mat.mat(1) = 1;
mat.types = 'elcd';
istat = 1;
bndcon = [1 1 1];
nodfrc = [];
% ietype = 1: linear triangle
ietype = 1; norder = 1; itype = 20;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_cd
sol
% ietype = 2: quadratic triangle
ietype = 2; norder = 2; itype = 20;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_cd
sol
% ietype = 3: linear quad
ietype = 3; norder = 1; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_cd
sol
% ietype = 4: quadratic quad
ietype = 4; norder = 2; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_cd
sol
%%%%% not supported %%%%
% ietype = 5: extended linear triangle
ietype = 5; norder = 1; itype = 21;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_cd
sol
clear all; close all;
points = [0 0; 1 0; 1 1; 0 1];
curves = [1 2 1 1 1; 2 3 1 1 1; 3 4 1 1 1; 4 1 1 1 1];
subarea = [1 2 3 4 1];
mat.mat(1) = 1;
mat.types = 'ele';
istat = 1;
bndcon = [1 1 0];
nodfrc = [];
% ietype = 1: linear triangle
ietype = 1; norder = 1; itype = 20;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_e
sol
% ietype = 2: quadratic triangle
ietype = 2; norder = 2; itype = 20;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_e
sol
% ietype = 3: linear quad
ietype = 3; norder = 1; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_e
sol
% ietype = 4: quadratic quad
ietype = 4; norder = 2; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_e
sol
% ietype = 5: extended linear triangle
ietype = 5; norder = 1; itype = 21;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femlin_e
sol
clear all; close all;
points = [0 0; 1 0; 1 1; 0 1];
curves = [1 2 1 1 1; 2 3 1 1 1; 3 4 1 1 1; 4 1 1 1 1];
subarea = [1 2 3 4 1];
mat.mat(1) = 1;
mat.types = 'elup';
istat = 1;
bndcon = [1 1 0];
nodfrc = [];
% elup_i, comments:
% ietype:
%
% 1 - Mini-element
% 2- Crouzeix Raviart
% 3 - Taylor-Hood quad
% 4 - Taylor-Hood triangle
% 5 - Crouzeix-Raviart triangle
% 6 - 4-noded quad with midpoint
% 7 - 4-noded quad with midpoint, but without bubble
% elup_i, ichois = 5:
% if (ietype==1) % 4-noded triangle with linear pressure
% elseif (ietype==2) % 9-noded quad with discontinuous pressure
% elseif (ietype==3) % 9-noded quad with continuous bi-linear pressure
% elseif (ietype==4) % 6-noded triangle with continuous linear pressure
% elseif (ietype==5) % 7-noded triangle with discontinuous linear pressure
% elseif (ietype==6) % 4-noded quad with constant pressure
% elseif (ietype==7) % 4-noded quad with constant pressure
% 1 - Mini-element
% 2 - Crouzeix Raviart
% 3 - Taylor-Hood quad
% 4 - Taylor-Hood triangle
% 5 - Crouzeix-Raviart triangle
% 6 - 4-noded quad with midpoint
eltype=3;
if eltype==1,
norder=1; itype=21;
elseif eltype==2,
norder=2; itype=1;
elseif eltype==3,
norder=2; itype=1;
elseif eltype==4,
norder=2; itype=20;
elseif eltype==5,
norder=2; itype=21;
elseif eltype==6 | eltype==7
norder=1; itype=2;
end
% ietype = 1: linear triangle
% ichois 5: 4-noded triangle with linear pressure
ietype = 1; norder = 1; itype = 21;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
% [top, dest] = equatnr(coord, top, mat)
femnlt
top
dest
% ietype = 2: linear triangle
% ichois 5: 4-noded triangle with linear pressure
ietype = 2; norder = 2; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femnl
top
dest
% ietype = 2: linear triangle
% ichois 5: 4-noded triangle with linear pressure
ietype = 3; norder = 2; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
femnl
top
dest
clear all; close all;
points = [0 0; 1 0; 1 1; 0 1];
curves = [1 2 1 1 1; 2 3 1 1 1; 3 4 1 1 1; 4 1 1 1 1];
subarea = [1 2 3 4 1];
mat.mat(1) = 1;
mat.types = 'elineo';
istat = 1;
bndcon = [1 1 0];
nodfrc = [];
% ietype = 1
ietype = 2; norder = 2; itype = 1;
[top, coord] = crmesh(curves, subarea, points, norder, itype);
mat.mat(11) = ietype;
nincr = 3
femnl
sol
[~, dest]= equatnr(coord, top, mat)
nnodes = size(top, 2) - 2
%
% % ietype = 2: quadratic quad
% ietype = 2; norder = 2; itype = 1;
% clear sol
% [top, coord] = crmesh(curves, subarea, points, norder, itype);
% mat.mat(11) = ietype;
% femnl
% sol
%
%
% % % ietype = 3: linear quad
% % ietype = 3; norder = 1; itype = 1;
% %
% % [top, coord] = crmesh(curves, subarea, points, norder, itype);
% % mat.mat(11) = ietype;
% % femlin_e
% % sol
%
%
%
% % ietype = 4: quadratic triangle, works but not if you the quad first (?!)
% ietype = 4; norder = 2; itype = 20;
%
% [top, coord] = crmesh(curves, subarea, points, norder, itype);
% mat.mat(11) = ietype;
% clear sol
% femnl
% sol
%
% %
% % % ietype = 5: extended linear triangle
% % ietype = 5; norder = 1; itype = 21;
% %
% % [top, coord] = crmesh(curves, subarea, points, norder, itype);
% % mat.mat(11) = ietype;
% % femlin_e
% % sol
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