Finite element method: Difference between revisions

Content deleted Content added
m discretization step fixage, again.
m Replace curly quotes with straight quotes (see MOS:CURLY).
 
Line 1:
{{short description|Numerical method for solving physical or engineering problems}}
[[ja:有限要素法]]
{{Redirect|Finite element|the elements of a [[poset]]|compact element}}
[[File:FAE visualization.jpg|thumb|250px|Visualization of how a car deforms in an asymmetrical crash using finite element analysis]]
{{Differential equations}}
 
'''Finite element method''' ('''FEM''') is a popular method for numerically solving [[differential equation]]s arising in engineering and [[mathematical models|mathematical modeling]]. Typical problem areas of interest include the traditional fields of [[structural analysis]], [[heat transfer]], [[fluid flow]], mass transport, and [[electromagnetic potential]]. Computers are usually used to perform the calculations required. With high-speed [[supercomputer]]s, better solutions can be achieved and are often required to solve the largest and most complex problems.
The '''finite element method''' is used for solving [[partial differential equation]]s (PDE). Solutions are achieved by either eliminating the differential equation completely (steady state problems), or rendering the PDE into an equivalent [[ordinary differential equation]], which is then solved using standard techniques such as [[finite difference]]s, etc. Use of the finite element method in engineering for the analysis of physical systems is commonly known as [[finite element analysis]].
 
FEM is a general [[numerical analysis|numerical method]] for solving [[partial differential equations]] in two- or three-space variables (i.e., some [[boundary value problem]]s). There are also studies about using FEM to solve high-dimensional problems.<ref>{{Cite journal
Finite element methods have also been developed to solve [[integral equation]]s such as the heat transport equation.
| last1 = Hoang
| first1 = Viet Ha
| last2 = Schwab
| first2 = Christoph
| title = High-dimensional finite elements for elliptic problems with multiple scales
| journal = Multiscale Modeling & Simulation
| volume = 3
| issue = 1
| pages = 168–194
| year = 2005
| publisher = SIAM
| doi = 10.1137/030601077
| hdl = 20.500.11850/147656
| hdl-access = free
}}</ref> To solve a problem, FEM subdivides a large system into smaller, simpler parts called '''finite elements'''. This is achieved by a particular space [[discretization]] in the space dimensions, which is implemented by the construction of a [[Types of mesh|mesh]] of the object: the numerical ___domain for the solution that has a finite number of points. FEM formulation of a boundary value problem finally results in a system of [[algebraic equation]]s. The method approximates the unknown function over the ___domain.<ref>{{cite book
| title = A first course in the finite element method
| author = Daryl L. Logan
| publisher = Cengage Learning
| year = 2011
| isbn = 9780495668275
}}</ref> The simple equations that model these finite elements are then assembled into a larger system of equations that models the entire problem. FEM then approximates a solution by minimizing an associated error function via the [[calculus of variations]].
 
Studying or [[Analysis|analyzing]] a phenomenon with FEM is often referred to as '''finite element analysis''' (FEA).
The method was introduced by [[Richard Courant]] to solve torsion on cylinder. Courant's contribution was evolutionary, drawing on a large body of earlier results
for PDEs developed by Rayleigh, Ritz and Galerkin. Development of the method began in earnest in the middle to late 1950s for airframe and structural analysis, and picked up a lot of steam at Berkeley in the 1960s for use in [[civil engineering]]. The method was provided with a rigorous mathematical foundation in 1973 with the publication of Strang and Fix's ''The Finite Element Method''.
 
==Basic concepts==
Finite element methods are used in a wide variety of engineering disciplines. In computer graphics, [[radiosity]] algorithms are finite element methods.
{{multiple image
| align = right
| image1 = Example of 2D mesh.png
| width1 = 300
| alt1 = Example of 2D mesh
| caption1 = FEM [[Polygon mesh|mesh]] created by an analyst before finding a solution to a [[Magnetism|magnetic]] problem using FEM software. Colors indicate that the analyst has set material properties for each zone, in this case, a [[Electrical conductor|conducting]] wire coil in orange; a [[Ferromagnetism|ferromagnetic]] component (perhaps [[iron]]) in light blue; and air in grey. Although the geometry may seem simple, it would be very challenging to calculate the magnetic field for this setup without FEM software using [[Closed-form expression|equations alone]].
| image2 = FEM_example_of_2D_solution.png
| width2 = 300
| alt2 = FEM_example_of_2D_solution
| caption2 = FEM solution to the problem at left, involving a [[Cylinder (geometry)|cylindrically]] shaped [[Magnetic shielding|magnetic shield]]. The [[Ferromagnetism|ferromagnetic]] cylindrical part shields the area inside the cylinder by diverting the magnetic field [[Electromagnet|created]] by the coil (rectangular area on the right). The color represents the [[Norm (mathematics)|amplitude]] of the [[Magnetic field#Definitions, units, and measurement|magnetic flux density]], as indicated by the scale in the inset legend, red being high amplitude. The area inside the cylinder is low amplitude (dark blue, with widely spaced lines of magnetic flux), which suggests that the shield is performing as it was designed to.
| footer =
}}
 
The subdivision of a whole ___domain into simpler parts has several advantages:<ref name=":0">{{cite book |first1=J. N. |last1= Reddy |title= An Introduction to the Finite Element Method |edition=Third |publisher=McGraw-Hill |year=2006 |isbn=9780071267618}}</ref>
In solving [[partial differential equation]]s, the primary challenge is to create an equation which approximates the equation to be studied, but which is stable, meaning that
* Accurate representation of complex geometry;
errors in the calculation do not acculumlate and cause the resulting output to be garbage.
* Inclusion of dissimilar material properties;
* Easy representation of the total solution; and
* Capture of local effects.
 
A typical approach using the method involves the following steps:
''See also:'' [[Discrete element method]] [[Spectral method]]
# Dividing the ___domain of the problem into a collection of subdomains, with each subdomain represented by a set of element equations for the original problem.
# Systematically recombining all sets of element equations into a global system of equations for the final calculation.
 
The global system of equations uses known solution techniques and can be calculated from the [[initial value]]s of the original problem to obtain a numerical answer.
 
In the first step above, the element equations are simple equations that locally approximate the original complex equations to be studied, where the original equations are often [[partial differential equation]]s (PDEs). To explain the approximation of this process, FEM is commonly introduced as a special case of the [[Galerkin method]]. The process, in mathematical language, is to construct an integral of the [[inner product]] of the residual and the [[weight function]]s; then, set the integral to zero. In simple terms, it is a procedure that minimizes the approximation error by fitting trial functions into the PDE. The residual is the error caused by the trial functions, and the weight functions are [[polynomial]] approximation functions that project the residual. The process eliminates all the spatial derivatives from the PDE, thus approximating the PDE locally using the following:
== Technical Overview ==
* a set of [[algebraic equations]] for [[steady state|steady-state]] problems; and
* a set of [[ordinary differential equation]]s for [[transient state|transient]] problems.
 
These equation sets are element equations. They are [[linear]] if the underlying PDE is linear and vice versa. Algebraic equation sets that arise in the steady-state problems are solved using [[numerical linear algebra]]ic methods. In contrast, [[ordinary differential equation]] sets that occur in the transient problems are solved by numerical integrations using standard techniques such as [[Euler's method]] or the [[Runge–Kutta methods|Runge]][[Euler–Bernoulli beam theory|–]]Kutta method.
For this discussion, we assume a basic understanding of differential [[calculus]] in several variables. If ''f'' is a function, then the notation ''f<sub>x</sub>'' will denote the partial derivative of ''f'' with respect to ''x''.
 
In the second step above, a global system of equations is generated from the element equations by transforming coordinates from the subdomains' local nodes to the ___domain's global nodes. This spatial transformation includes appropriate [[Transformation matrix|orientation adjustment]]s as applied in relation to the reference [[coordinate system]]. The process is often carried out using FEM software with [[coordinates|coordinate]] data generated from the subdomains.
The best way to introduce the subject is to give a simple example (a "model problem"). We shall use the Laplace equation on the torus [0,1)x[0,1). First some notation. Let
 
The practical application of FEM is known as finite element analysis (FEA). FEA, as applied in [[engineering]], is a computational tool for performing [[engineering analysis]]. It includes the use of [[mesh generation]] techniques for dividing a [[complex system|complex problem]] into smaller elements, as well as the use of software coded with a FEM algorithm. When applying FEA, the complex problem is usually a physical system with the underlying [[physics]], such as the [[Euler–Bernoulli beam theory|Euler–Bernoulli beam equation]], the [[heat equation]], or the [[Navier-Stokes equations|Navier]][[Euler–Bernoulli beam theory|–]]Stokes equations, expressed in either PDEs or [[integral equation]]s, while the divided, smaller elements of the complex problem represent different areas in the physical system.
:T:=[0,1)x[0,1)={(''x'',''y'');''0''&le;''x'',''y''<''1''}<br>
 
FEA may be used for analyzing problems over complicated domains (e.g., cars and oil pipelines) when the ___domain changes (e.g., during a solid-state reaction with a moving boundary), when the desired precision varies over the entire ___domain, or when the solution lacks smoothness. FEA simulations provide a valuable resource, as they remove multiple instances of creating and testing complex prototypes for various high-fidelity situations.<ref>{{Cite journal |date=2022 |title=Editorial Board |url=https://doi.org/10.1016/s0168-874x(22)00118-4 |journal=Finite Elements in Analysis and Design |volume=211 |article-number=103845 |doi=10.1016/s0168-874x(22)00118-4 |issn=0168-874X|url-access=subscription }}</ref> For example, in a frontal crash simulation, it is possible to increase prediction accuracy in important areas, like the front of the car, and reduce it in the rear of the car, thus reducing the cost of the simulation. Another example would be in [[numerical weather prediction]], where it is more important to have accurate predictions over developing highly nonlinear phenomena, such as [[tropical cyclone]]s in the atmosphere or [[Eddy (fluid dynamics)|eddies]] in the ocean, rather than relatively calm areas.
Now let ''g'' be a function from T to '''F''', the field of scalars (either the real line '''R''' or the complex plane '''C'''.) Our problem is to find a function ''u'' from the entire plane '''R'''<sup>2</sup> to '''F''' so that
 
A clear, detailed, and practical presentation of this approach can be found in the textbook ''The Finite Element Method for Engineers''.<ref>{{Cite book |last=Huebner |first=Kenneth H. |title=The Finite Element Method for Engineers |publisher=Wiley |year=2001 |isbn=978-0-471-37078-9}}</ref>
# ''u'' is twice differentiable over '''R'''<sup>2</sup> in the sense of multivariate calculus.
# ''u<sub>xx</sub>''+''u<sub>yy</sub>''=''g'' in T
# ''u''(x,y)=''u''(''x''+1,''y'')=''u''(''x'',''y''+1), that is, ''u'' is periodic in ''x'' and in ''y'', and of period 1 in both direction.
 
==History==
This problem can be rephrased in terms of linear maps and vector spaces.
While it is difficult to quote the date of the invention of FEM, the method originated from the need to solve complex [[Elasticity (physics)|elasticity]] and [[structural analysis]] problems in [[civil engineering|civil]] and [[aeronautical engineering]].<ref>{{Cite journal |last1=Liu |first1=Wing Kam |last2=Li |first2=Shaofan |last3=Park |first3=Harold S. |date=2022 |title=Eighty Years of the Finite Element Method: Birth, Evolution, and Future |journal=Archives of Computational Methods in Engineering |language=en |volume=29 |issue=6 |pages=4431–4453 |doi=10.1007/s11831-022-09740-9 |s2cid=235794921 |issn=1134-3060|doi-access=free |arxiv=2107.04960 }}</ref> Its development can be traced back to work by [[Alexander Hrennikoff]]<ref>{{Cite journal |last=Hrennikoff |first=Alexander |title=Solution of problems of elasticity by the framework method |journal=Journal of Applied Mechanics |volume=8 |issue=4 |pages=169–175 |year=1941 |doi=10.1115/1.4009129 |bibcode=1941JAM.....8A.169H }}</ref> and [[Richard Courant]]<ref>{{Cite journal |last=Courant |first=R. |title=Variational methods for the solution of problems of equilibrium and vibrations |journal=Bulletin of the American Mathematical Society |volume=49 |pages=1–23 |year=1943 |issue=1 |doi= 10.1090/s0002-9904-1943-07818-4 | doi-access=free }}</ref> in the early 1940s. Another pioneer was [[Ioannis Argyris]]. In the USSR, the introduction of the practical application of FEM is usually connected with [[Leonard Oganesyan]].<ref>{{cite web |url=http://emi.nw.ru/INDEX.html?0/resume/oganesan.htm |title=СПб ЭМИ РАН |website=emi.nw.ru |access-date=17 March 2018|archive-url=https://web.archive.org/web/20150930001741/http://emi.nw.ru/INDEX.html?0%2Fresume%2Foganesan.htm |archive-date=30 September 2015 |url-status=dead}}</ref> It was also independently rediscovered in China by [[Feng Kang]] in the late 1950s and early 1960s, based on the computations of dam constructions, where it was called the "[[finite difference method]]" based on variation principles. Although the approaches used by these pioneers are different, they share one essential characteristic: the [[Polygon mesh|mesh]] [[discretization]] of a continuous ___domain into a set of discrete sub-domains, usually called elements.
 
Hrennikoff's work discretizes the ___domain by using a [[Lattice (group)|lattice]] analogy, while Courant's approach divides the ___domain into finite triangular sub-regions to solve [[Partial differential equation#Linear equations of second order|second-order]] [[elliptic partial differential equation]]s that arise from the problem of the [[torsion (mechanics)|torsion]] of a [[cylinder (geometry)|cylinder]]. Courant's contribution was evolutionary, drawing on a large body of earlier results for PDEs developed by [[John William Strutt, 3rd Baron Rayleigh|Lord Rayleigh]], [[Walther Ritz]], and [[Boris Galerkin]].
# ''u'' is in V, the vector space of twice differentiable functions of the torus T.
# L''u''=''g'' with ''g'' is some given vector in V.
 
The application of FEM gained momentum in the 1960s and 1970s due to the developments of [[John Argyris|J. H. Argyris]] and his co-workers at the [[University of Stuttgart]]; [[Ray W. Clough|R. W. Clough]] and his co-workers at [[University of California, Berkeley|University of California Berkeley]]; [[Olgierd Zienkiewicz|O. C. Zienkiewicz]] and his co-workers [[Ernest Hinton]], [[Bruce Irons (engineer)|Bruce Irons]],<ref>{{Cite journal |last1=Hinton |first1=Ernest |last2=Irons |first2=Bruce |title=Least squares smoothing of experimental data using finite elements |journal=Strain |volume=4 |issue=3 |pages=24–27 |date=July 1968 |doi= 10.1111/j.1475-1305.1968.tb01368.x}}</ref> and others at [[Swansea University]]; [[Philippe G. Ciarlet]] at the University of [[Pierre-and-Marie-Curie University|Paris 6]]; and [[Richard H. Gallagher|Richard Gallagher]] and his co-workers at [[Cornell University]]. During this period, additional impetus was provided by the available open-source FEM programs. NASA sponsored the original version of [[NASTRAN]]. University of California Berkeley made the finite element programs SAP IV<ref>{{cite web |title=SAP-IV Software and Manuals |url=http://nisee.berkeley.edu/elibrary/getpkg?id=SAP4 |___location=NISEE e-Library, The Earthquake Engineering Online Archive |access-date=2013-01-24 |archive-date=2013-03-09 |archive-url=https://web.archive.org/web/20130309013628/http://nisee.berkeley.edu/elibrary/getpkg?id=SAP4 |url-status=live }}</ref> and, later, [[OpenSees]] widely available. In Norway, the ship classification society Det Norske Veritas (now [[DNV GL]]) developed [[SESAM (FEM)|Sesam]] in 1969 for use in the analysis of ships.<ref>{{cite book |title=Building Trust, The history of DNV 1864-2014 |author1=Gard Paulsen |author2=Håkon With Andersen |author3=John Petter Collett |author4=Iver Tangen Stensrud |date=2014 |publisher=Dinamo Forlag A/S |isbn=978-82-8071-256-1 |___location=Lysaker, Norway |pages=121, 436}}<!-- |access-date=30 June 2015 --></ref> A rigorous mathematical basis for FEM was provided in 1973 with a publication by [[Gilbert Strang]] and [[George Fix]].<ref>{{cite book |first1=Gilbert |last1=Strang |author-link1=Gilbert Strang |first2=George |last2=Fix |author-link2=George Fix |title=An Analysis of The Finite Element Method |url=https://archive.org/details/analysisoffinite0000stra |url-access=registration |publisher=Prentice Hall |year=1973 |isbn=978-0-13-032946-2}}</ref> The method has since been generalized for the [[numerical analysis|numerical modeling]] of physical systems in a wide variety of [[engineering]] disciplines, such as [[electromagnetism]], [[heat transfer]], and [[fluid dynamics]].<ref name="ZienkiewiczTaylor2013">{{cite book |author1=Olek C Zienkiewicz |author2=Robert L Taylor |author3=J.Z. Zhu |title=The Finite Element Method: Its Basis and Fundamentals |url=https://books.google.com/books?id=7UL5Ls9hOF8C |date=31 August 2013 |publisher=Butterworth-Heinemann |isbn=978-0-08-095135-5}}</ref><ref>{{cite book |first1=K.J. |last1=Bathe |author-link1= Klaus-Jürgen Bathe |title=Finite Element Procedures |publisher= Cambridge, MA: Klaus-Jürgen Bathe |year=2006 |isbn= 978-0979004902}}</ref>
Of course, here L is the differential operator given by:
 
==Technical discussion==
:L''f''=''f''<sub>''xx''</sub>+''f''<sub>''yy''</sub>
 
===The structure of finite element methods===
L is known as the Laplace operator. We are now looking for a ''u'' in V so that L''u''=''g''.
A finite element method is characterized by a [[Calculus of variations|variational formulation]], a discretization strategy, one or more solution algorithms, and post-processing procedures.
 
Examples of the variational formulation are the [[Galerkin method]], the discontinuous Galerkin method, mixed methods, etc.
=== Weak formulation ===
A discretization strategy is understood to mean a clearly defined set of procedures that cover (a) the creation of finite element meshes, (b) the definition of basis function on reference elements (also called shape functions), and (c) the mapping of reference elements onto the elements of the mesh. Examples of discretization strategies are the h-version, [[p-FEM|p-version]], [[Hp-FEM|hp-version]], [[Extended finite element method|x-FEM]], [[isogeometric analysis]], etc. Each discretization strategy has certain advantages and disadvantages. A reasonable criterion in selecting a discretization strategy is to realize nearly optimal performance for the broadest set of mathematical models in a particular model class.
 
Various numerical solution algorithms can be classified into two broad categories; direct and iterative solvers. These algorithms are designed to exploit the sparsity of matrices that depend on the variational formulation and discretization strategy choices.
Now let &phi;(u,v) be any [[functional]] of V, that is, &phi; is a function of V to '''F''' so that for any ''t'' in '''F''' and ''u'',''v'' in V:
 
Post-processing procedures are designed to extract the data of interest from a finite element solution. To meet the requirements of solution verification, postprocessors need to provide for ''a posteriori'' error estimation in terms of the quantities of interest. When the errors of approximation are larger than what is considered acceptable, then the discretization has to be changed either by an automated adaptive process or by the action of the analyst. Some very efficient postprocessors provide for the realization of [[superconvergence]].
: &phi;(''tu''+''v'')=''t''&phi;(''u'')+&phi;(''v'')
 
{{clear}}
We denote by V<sup>*</sup> the set of all such functionals. Then, certainly, the following statements are equivalent:
 
===Illustrative problems P1 and P2===
: L''u''=''g''
The following two problems demonstrate the finite element method.
 
P1 is a one-dimensional problem
<math display="block">\text{ P1 } : \begin{cases}
u''(x) = f(x) \text{ in } (0,1), \\
u(0) = u(1) = 0,
\end{cases}</math>
where <math>f</math> is given, <math>u</math> is an unknown function of <math>x</math>, and <math>u''</math> is the second derivative of <math>u</math> with respect to <math>x</math>.
 
P2 is a two-dimensional problem ([[Dirichlet problem]])
<math display="block">\text{P2 }: \begin{cases}
u_{xx}(x,y)+u_{yy}(x,y)=f(x,y) & \text{ in } \Omega, \\
u=0 & \text{ on } \partial \Omega,
\end{cases}</math>
 
where <math>\Omega</math> is a connected open region in the <math>(x,y)</math> plane whose boundary <math>\partial \Omega</math> is nice (e.g., a [[smooth manifold]] or a [[polygon]]), and <math>u_{xx}</math> and <math>u_{yy}</math> denote the second derivatives with respect to <math>x</math> and <math>y</math>, respectively.
 
The problem P1 can be solved directly by computing [[antiderivative]]s. However, this method of solving the [[boundary value problem]] (BVP) works only when there is one spatial dimension. It does not generalize to higher-dimensional problems or problems like <math>u+V''=f</math>. For this reason, we will develop the finite element method for P1 and outline its generalization to P2.
 
Our explanation will proceed in two steps, which mirror two essential steps one must take to solve a boundary value problem (BVP) using the FEM.
* In the first step, one rephrases the original BVP in its weak form. Little to no computation is usually required for this step. The transformation is done by hand on paper.
* The second step is discretization, where the weak form is discretized in a finite-dimensional space.
After this second step, we have concrete formulae for a large but finite-dimensional linear problem whose solution will approximately solve the original BVP. This finite-dimensional problem is then implemented on a [[computer]].
 
===Weak formulation===
The first step is to convert P1 and P2 into their equivalent [[weak formulation]]s.
 
====The weak form of P1====
If <math>u</math> solves P1, then for any smooth function <math>v</math> that satisfies the displacement boundary conditions, i.e. <math>v=0</math> at <math>x=0</math> and <math>x=1</math>, we have
{{NumBlk||<math display="block">\int_0^1 f(x)v(x) \, dx = \int_0^1 u''(x)v(x) \, dx.</math>|{{EquationRef|1}}}}
 
Conversely, if <math>u</math> with <math>u(0) = u(1) = 0</math> satisfies (1) for every smooth function <math>v(x)</math> then one may show that this <math>u</math> will solve P1. The proof is easier for twice continuously differentiable <math>u</math> ([[mean value theorem]]) but may be proved in a [[Distribution (mathematics)|distributional]] sense as well.
 
We define a new operator or map <math>\phi(u,v)</math> by using [[integration by parts]] on the right-hand-side of (1):
{{NumBlk|:|<math>
\begin{align}
\int_0^1 f(x)v(x) \, dx & = \int_0^1 u''(x)v(x) \, dx \\
& = u'(x)v(x)|_0^1-\int_0^1 u'(x)v'(x) \, dx \\
& = -\int_0^1 u'(x)v'(x) \, dx \equiv -\phi (u,v),
\end{align}
</math>|{{EquationRef|2}}}}
 
where we have used the assumption that <math>v(0) = v(1) = 0</math>.
 
====The weak form of P2====
If we integrate by parts using a form of [[Green's identities]], we see that if <math>u</math> solves P2, then we may define <math>\phi(u,v)</math> for any <math>v</math> by
<math display="block">\int_\Omega fv\,ds = -\int_\Omega \nabla u \cdot \nabla v \, ds \equiv -\phi(u,v),</math>
 
where <math>\nabla</math> denotes the [[gradient]] and <math>\cdot</math> denotes the [[dot product]] in the two-dimensional plane. Once more <math>\,\!\phi</math> can be turned into an inner product on a suitable space <math>H_0^1(\Omega)</math> of once differentiable functions of <math>\Omega</math> that are zero on <math>\partial \Omega</math>. We have also assumed that <math>v \in H_0^1(\Omega)</math> (see [[Sobolev space]]s). The existence and uniqueness of the solution can also be shown.
 
====A proof outline of the existence and uniqueness of the solution====
We can loosely think of <math>H_0^1(0,1)</math> to be the [[absolutely continuous]] functions of <math>(0,1)</math> that are <math>0</math> at <math>x=0</math> and <math>x=1</math> (see [[Sobolev spaces]]). Such functions are (weakly) once differentiable, and it turns out that the symmetric [[bilinear map]] <math>\!\,\phi</math> then defines an [[inner product]] which turns <math>H_0^1(0,1)</math> into a [[Hilbert space]] (a detailed proof is nontrivial). On the other hand, the left-hand-side <math>\int_0^1 f(x)v(x)dx</math> is also an inner product, this time on the [[Lp space]] <math>L^2(0,1)</math>. An application of the [[Riesz representation theorem]] for Hilbert spaces shows that there is a unique <math>u</math> solving (2) and, therefore, P1. This solution is a-priori only a member of <math>H_0^1(0,1)</math>, but using [[elliptic operator|elliptic]] regularity, will be smooth if <math>f</math> is.
 
==Discretization==
[[File: Finite element method 1D illustration1.svg|thumb|A function in <math>H_0^1,</math> with zero values at the endpoints (blue) and a piecewise linear approximation (red)]]
 
P1 and P2 are ready to be discretized, which leads to a common sub-problem (3). The basic idea is to replace the infinite-dimensional linear problem:
:Find <math>u \in H_0^1</math> such that
:<math>\forall v \in H_0^1, \; -\phi(u,v)=\int fv</math>
with a finite-dimensional version:
 
{{NumBlk|:|Find <math>u \in V</math> such that<br/>
<math>\forall v \in V, \; -\phi(u,v)=\int fv</math>|{{EquationRef|3}}}}
 
where <math>V</math> is a finite-dimensional [[Linear subspace|subspace]] of <math>H_0^1</math>. There are many possible choices for <math>V</math> (one possibility leads to the [[spectral method]]). However, we take <math>V</math> as a space of piecewise polynomial functions for the finite element method.
 
===For problem P1===
We take the interval <math>(0,1)</math>, choose <math>n</math> values of <math>x</math> with <math>0=x_0 < x_1 < \cdots < x_n < x_{n+1}=1</math> and we define <math>V</math> by:
<math display="block">V = \{v:[0,1] \to \mathbb R\;: v\text{ is continuous, } v|_{[x_k,x_{k+1}]} \text{ is linear for } k = 0,\dots,n \text{, and } v(0)=v(1)=0 \} </math>
 
where we define <math>x_0=0</math> and <math>x_{n+1}=1</math>. Observe that functions in <math>V</math> are not differentiable according to the elementary definition of calculus. Indeed, if <math>v \in V</math> then the derivative is typically not defined at any <math>x = x_k</math>, <math>k = 1,\ldots,n</math>. However, the derivative exists at every other value of <math>x</math>, and one can use this derivative for [[integration by parts]].
 
[[File:Piecewise linear function2D.svg|thumb|A piecewise linear function in two dimensions]]
 
===For problem P2===
We need <math>V</math> to be a set of functions of <math>\Omega</math>. In the figure on the right, we have illustrated a [[Polygon triangulation|triangulation]] of a 15-sided [[polygon]]al region <math>\Omega</math> in the plane (below), and a [[piecewise linear function]] (above, in color) of this polygon which is linear on each triangle of the triangulation; the space <math>V</math> would consist of functions that are linear on each triangle of the chosen triangulation.
 
One hopes that as the underlying triangular mesh becomes finer and finer, the solution of the discrete problem (3) will, in some sense, converge to the solution of the original boundary value problem P2. To measure this mesh fineness, the triangulation is indexed by a real-valued parameter <math>h > 0</math> which one takes to be very small. This parameter will be related to the largest or average triangle size in the triangulation. As we refine the triangulation, the space of piecewise linear functions <math>V</math> must also change with <math>h</math>. For this reason, one often reads <math>V_h</math> instead of <math>V</math> in the literature. Since we do not perform such an analysis, we will not use this notation.
 
===Choosing a basis===
{{multiple image
| caption_align = left
| header_align = center
| align = right
| direction = vertical
| width = 200
| header = Interpolation of a [[Bessel function]]
| image1 = Linear interpolation of J0 (basis set).svg
| alt1 = Sixteen triangular basis functions used to reconstruct J0
| caption1 = 16 scaled and shifted triangular basis functions (colors) used to reconstruct a zeroeth order Bessel function ''J''<sub>''0''</sub> (black)
| image2 = Linear interpolation of J1 (basis set).svg
| alt2 = Summation of basis functions
| caption2 = The linear combination of basis functions (yellow) reproduces ''J''<sub>''0''</sub> (black) to any desired accuracy.
}}
 
To complete the discretization, we must select a [[Basis (linear algebra)|basis]] of <math>V</math>. In the one-dimensional case, for each control point <math>x_k</math> we will choose the piecewise linear function <math>v_k</math> in <math>V</math> whose value is <math>1</math> at <math>x_k</math> and zero at every <math>x_j,\;j \neq k</math>, i.e.,
<math display="block">v_{k}(x) = \begin{cases}
{x-x_{k-1} \over x_k\,-x_{k-1}} & \text{ if } x \in [x_{k-1},x_k], \\
{x_{k+1}\,-x \over x_{k+1}\,-x_k} & \text{ if } x \in [x_k,x_{k+1}], \\
0 & \text{ otherwise},
\end{cases}</math>
 
for <math>k = 1,\dots,n</math>; this basis is a shifted and scaled [[tent function]]. For the two-dimensional case, we choose again one basis function <math>v_k</math> per vertex <math>x_k</math> of the triangulation of the planar region <math>\Omega</math>. The function <math>v_k</math> is the unique function of <math>V</math> whose value is <math>1</math> at <math>x_k</math> and zero at every <math>x_j,\;j \neq k</math>.
 
Depending on the author, the word "element" in the "finite element method" refers to the ___domain's triangles, the piecewise linear basis function, or both. So, for instance, an author interested in curved domains might replace the triangles with curved primitives and so might describe the elements as being curvilinear. On the other hand, some authors replace "piecewise linear" with "piecewise quadratic" or even "piecewise polynomial". The author might then say "higher order element" instead of "higher degree polynomial". The finite element method is not restricted to triangles (tetrahedra in 3-d or higher-order simplexes in multidimensional spaces). Still, it can be defined on quadrilateral subdomains (hexahedra, prisms, or pyramids in 3-d, and so on). Higher-order shapes (curvilinear elements) can be defined with polynomial and even non-polynomial shapes (e.g., ellipse or circle).
 
Examples of methods that use higher degree piecewise polynomial basis functions are the [[hp-FEM]] and [[spectral element method|spectral FEM]].
 
More advanced implementations (adaptive finite element methods) utilize a method to assess the quality of the results (based on error estimation theory) and modify the mesh during the solution aiming to achieve an approximate solution within some bounds from the exact solution of the continuum problem. Mesh adaptivity may utilize various techniques; the most popular are:
* moving nodes (r-adaptivity)
* refining (and unrefined) elements (h-adaptivity)
* changing order of base functions (p-adaptivity)
* combinations of the above ([[hp-FEM|hp-adaptivity]]).
 
=== Small support of the basis ===
[[File:Finite element triangulation.svg|thumb|Solving the two-dimensional problem <math>u_{xx}+u_{yy}=-4</math> in the disk centered at the origin and radius 1, with zero boundary conditions.<br />(a) The triangulation.]]
[[File:Finite element sparse matrix.png|thumb|(b) The [[sparse matrix]] ''L'' of the discretized linear system]]
[[File:Finite element solution.svg|thumb|(c) The computed solution, <math>u(x, y)=1-x^2-y^2</math>]]
The primary advantage of this choice of basis is that the inner products
<math display="block">\langle v_j,v_k \rangle = \int_0^1 v_j v_k\,dx</math>
and
<math display="block">\phi(v_j,v_k)=\int_0^1 v_j' v_k'\,dx</math>
will be zero for almost all <math>j,k</math>.
(The matrix containing <math>\langle v_j, v_k \rangle</math> in the <math>(j,k)</math> ___location is known as the [[Gramian matrix]].)
In the one dimensional case, the [[support (mathematics)|support]] of <math>v_k</math> is the interval <math>[x_{k-1},x_{k+1}]</math>. Hence, the integrands of <math>\langle v_j, v_k \rangle</math> and <math>\phi(v_j,v_k)</math> are identically zero whenever <math>|j-k|>1</math>.
 
Similarly, in the planar case, if <math>x_j</math> and <math>x_k</math> do not share an edge of the triangulation, then the integrals
<math display="block">\int_{\Omega} v_j v_k\,ds</math>
and
<math display="block">\int_{\Omega} \nabla v_j \cdot \nabla v_k\,ds</math>
are both zero.
 
===Matrix form of the problem===
If we write <math>u(x) = \sum_{k=1}^n u_k v_k(x)</math> and <math>f(x) = \sum_{k=1}^n f_k v_k(x)</math> then problem (3), taking <math>v(x) = v_j(x)</math> for <math>j = 1, \dots, n</math>, becomes
{{NumBlk|:|<math>-\sum_{k=1}^n u_k \phi (v_k,v_j) = \sum_{k=1}^n f_k \int v_k v_j dx</math> for <math>j = 1,\dots,n.</math> |{{EquationRef|4}}}}
 
If we denote by <math>\mathbf{u}</math> and <math>\mathbf{f}</math> the column vectors <math>(u_1,\dots,u_n)^t</math> and <math>(f_1,\dots,f_n)^t</math>, and if we let
<math display="block">L = (L_{ij})</math>
and
<math display="block">M = (M_{ij})</math>
be matrices whose entries are
<math display="block">L_{ij} = \phi (v_i,v_j)</math>
and
<math display="block">M_{ij} = \int v_i v_j dx</math>
then we may rephrase (4) as
{{NumBlk||<math display="block">-L \mathbf{u} = M \mathbf{f}.</math>|{{EquationRef|5}}}}
 
It is not necessary to assume <math>f(x) = \sum_{k=1}^n f_k v_k(x)</math>. For a general function <math>f(x)</math>, problem (3) with <math>v(x) = v_j(x)</math> for <math>j = 1, \dots, n</math> becomes actually simpler, since no matrix <math>M</math> is used,
{{NumBlk||<math display="block">-L \mathbf{u} = \mathbf{b},</math>|{{EquationRef|6}}}}
where <math>\mathbf{b} = (b_1, \dots, b_n)^t</math> and <math>b_j = \int f v_j dx</math> for <math>j = 1, \dots, n</math>.
 
As we have discussed before, most of the entries of <math>L</math> and <math>M</math> are zero because the basis functions <math>v_k</math> have small support. So we now have to solve a linear system in the unknown <math>\mathbf{u}</math> where most of the entries of the matrix <math>L</math>, which we need to invert, are zero.
 
Such matrices are known as [[sparse matrix|sparse matrices]], and there are efficient solvers for such problems (much more efficient than actually inverting the matrix.) In addition, <math>L</math> is symmetric and positive definite, so a technique such as the [[conjugate gradient method]] is favored. For problems that are not too large, sparse [[LU decomposition]]s and [[Cholesky decomposition]]s still work well. For instance, [[MATLAB]]'s backslash operator (which uses sparse LU, sparse Cholesky, and other factorization methods) can be sufficient for meshes with a hundred thousand vertices.
 
The matrix <math>L</math> is usually referred to as the [[stiffness matrix]], while the matrix <math>M</math> is dubbed the [[mass matrix]].
 
===General form of the finite element method===
In general, the finite element method is characterized by the following process.
 
*One chooses a grid for <math>\Omega </math>. In the preceding treatment, the grid consisted of triangles, but one can also use squares or curvilinear polygons.
*Then, one chooses basis functions. We used piecewise linear basis functions in our discussion, but it is common to use piecewise polynomial basis functions.
 
Separate consideration is the smoothness of the basis functions. For second-order [[elliptic boundary value problem]]s, piecewise polynomial basis function that is merely continuous suffice (i.e., the derivatives are discontinuous.) For higher-order partial differential equations, one must use smoother basis functions. For instance, for a fourth-order problem such as <math>u_{xxxx} + u_{yyyy} = f</math>, one may use piecewise quadratic basis functions that are [[Smooth function#Order of continuity|<math>C^1</math>]].
: For all &phi; in V<sup>*</sup>, &phi;(L''u'')=&phi;(''g'')
 
Another consideration is the relation of the finite-dimensional space <math>V</math> to its infinite-dimensional counterpart in the examples above <math>H_0^1</math>. A [[conforming element method]] is one in which space <math>V</math> is a subspace of the element space for the continuous problem. The example above is such a method. If this condition is not satisfied, we obtain a [[nonconforming element method]], an example of which is the space of piecewise linear functions over the mesh, which are continuous at each edge midpoint. Since these functions are generally discontinuous along the edges, this finite-dimensional space is not a subspace of the original <math>H_0^1</math>.
The latter statement is said to be the ''weak form'' of our problem. One can think of it as emphasizing that the simple equality
 
Typically, one has an algorithm for subdividing a given mesh. If the primary method for increasing precision is to subdivide the mesh, one has an ''h''-method (''h'' is customarily the diameter of the largest element in the mesh.) In this manner, if one shows that the error with a grid <math>h</math> is bounded above by <math>Ch^p</math>, for some <math>C < \infty</math> and <math>p > 0</math>, then one has an order ''p'' method. Under specific hypotheses (for instance, if the ___domain is convex), a piecewise polynomial of order <math>d</math> method will have an error of order <math>p = d+1</math>.
: &phi;(L''u'')=&phi;(''g'')
 
If instead of making ''h'' smaller, one increases the degree of the polynomials used in the basis function, one has a ''p''-method. If one combines these two refinement types, one obtains an ''hp''-method ([[hp-FEM]]). In the hp-FEM, the polynomial degrees can vary from element to element. High-order methods with large uniform ''p'' are called spectral finite element methods ([[spectral element method|SFEM]]). These are not to be confused with [[spectral method]]s.
for a single &phi; in V<sup>*</sup> is insufficient to imply L''u''=''g'', and thus it is weaker. The true meaning of the nomenclature is related to the so-called weak [[topology]] for Banach spaces, which is induced by V<sup>*</sup>, but this is beyond the scope of this article.
 
For vector partial differential equations, the basis functions may take values in <math>\mathbb{R}^n</math>.
=== The bilinear form of L, test functions ===
 
==Various types of finite element methods==
The set V<sup>*</sup> is larger than it absolutely needs to be. It turns out that it suffices to use functionals of the form
 
===AEM===
:&phi;<sub>''v''</sub>(f)=&int;<sub>0</sub><sup>1</sup>&int;<sub>0</sub><sup>1</sup>''v''(x,y)''f''(x,y)dxdy
The Applied Element Method or AEM combines features of both FEM and [[Discrete element method]] or (DEM).
{{Main|Applied element method}}
 
===A-FEM===
That is, we are now replacing the original problem with that of finding ''u'' in V so that
Yang and Lui introduced the Augmented-Finite Element Method, whose goal was to model the weak and strong discontinuities without needing extra DoFs, as PuM stated.
 
=== CutFEM ===
:&phi;<sub>''v''</sub>(L''u'')=&phi;<sub>''v''</sub>(''g'')
The Cut Finite Element Approach was developed in 2014.<ref>{{Cite web |last=celledoni |date=2023-02-27 |title=CutFEM: Discretizing Partial Differential Equations and Geometry |url=https://ecmiindmath.org/2023/02/27/cutfem-discretizing-partial-differential-equations-and-geometry/ |access-date=2023-10-13 |website=ECMI |language=en-US}}</ref> The approach is "to make the discretization as independent as possible of the geometric description and minimize the complexity of mesh generation, while retaining the accuracy and robustness of a standard finite element method."<ref>{{Cite journal |last1=Burman |first1=Erik |last2=Claus |first2=Susanne |last3=Hansbo |first3=Peter |last4=Larson |first4=Mats G. |last5=Massing |first5=André |date=2015-11-16 |title=CutFEM: Discretizing geometry and partial differential equations |journal=International Journal for Numerical Methods in Engineering |language=en |volume=104 |issue=7 |pages=472–501 |doi=10.1002/nme.4823 |issn=0029-5981|doi-access=free |bibcode=2015IJNME.104..472B }}</ref>
 
===Generalized finite element method===
for all ''v'' in V. From now on, we will use &int;<sub>T</sub> for the double integral &int;<sub>0</sub><sup>1</sup>&int;<sub>0</sub><sup>1</sup>. One can see, via [[integration by parts]] that the last equality is equivalent to:
The generalized finite element method (GFEM) uses local spaces consisting of functions, not necessarily polynomials, that reflect the available information on the unknown solution and thus ensure good local approximation. Then a [[partition of unity]] is used to "bond" these spaces together to form the approximating subspace. The effectiveness of GFEM has been shown when applied to problems with domains having complicated boundaries, problems with micro-scales, and problems with boundary layers.<ref>{{cite journal | first1=Ivo | last1=Babuška | author1-link=Ivo Babuška | first2=Uday | last2=Banerjee | first3=John E. | last3=Osborn | author3-link=John E. Osborn (mathematician) | title=Generalized Finite Element Methods: Main Ideas, Results, and Perspective | journal=[[International Journal of Computational Methods]] | date=June 2004 | issue=1 | pages= 67–103 | doi=10.1142/S0219876204000083 | volume=1}}</ref>
 
===Mixed finite element method===
:&psi;(''u'',''v''):=-&int;<sub>T</sub>(''u<sub>x</sub>v<sub>x</sub>''+''u<sub>y</sub>v<sub>y</sub>'') = -&int;<sub>T</sub>''u'&middot;v' ''
{{Main|Mixed finite element method}}
The mixed finite element method is a type of finite element method in which extra independent variables are introduced as nodal variables during the discretization of a partial differential equation problem.
 
===Variable – polynomial===
where ''u' '' is the gradient of u, ''v' '' is the gradient of v and &middot; is the Euclidian scalar product. The function &psi; of ''u'' and ''v'' is in fact [[bilinear]], and it is the bilinear form associated with L. The functions ''v'' are called ''test functions''.
The [[hp-FEM]] combines adaptively elements with variable size ''h'' and polynomial degree ''p'' to achieve exceptionally fast, exponential convergence rates.<ref>P. Solin, K. Segeth, I. Dolezel: Higher-Order Finite Element Methods, Chapman & Hall/CRC Press, 2003</ref>
 
===hpk-FEM===
We note here that &psi; only uses first derivatives, and it would therefore be possible to discuss solutions to the original problem while only assuming first derivatives. Also note that in fact in most cases, the solution ''u'' will be infinitely differentiable.
The [[hpk-FEM]] combines adaptively elements with variable size ''h'', polynomial degree of the local approximations ''p'', and global differentiability of the local approximations (''k''-1) to achieve the best convergence rates.
 
===XFEM===
=== A minimal set of test functions ===
{{Main|Extended finite element method}}
 
The [[extended finite element method]] (XFEM) is a numerical technique based on the generalized finite element method (GFEM) and the partition of unity method (PUM). It extends the classical finite element method by enriching the solution space for solutions to differential equations with discontinuous functions. Extended finite element methods enrich the approximation space to naturally reproduce the challenging feature associated with the problem of interest: the discontinuity, singularity, boundary layer, etc. It was shown that for some problems, such an embedding of the problem's feature into the approximation space can significantly improve convergence rates and accuracy. Moreover, treating problems with discontinuities with XFEMs suppresses the need to mesh and re-mesh the discontinuity surfaces, thus alleviating the computational costs and projection errors associated with conventional finite element methods at the cost of restricting the discontinuities to mesh edges.
From [[functional analysis]], we know that we do not in fact need to try every possible test function ''v'' in V. In fact, if E={''e''<sub>1</sub>,''e''<sub>2</sub>,...} is a subset of V so that its [[linear span]] is [[dense]] in V (in a suitable topology) then we can use only those functions as test functions. That is, we are now trying to find a solution to the problem
 
Several research codes implement this technique to various degrees:
(*) &psi;(''u'',''e<sub>j</sub>'')=&int;<sub>T</sub>''u' '' &middot; ''e'<sub>j</sub>'' for every ''e<sub>j</sub>'' in E.
# GetFEM++
# xfem++
# openxfem++
 
XFEM has also been implemented in codes like Altair Radios, ASTER, Morfeo, and Abaqus. It is increasingly being adopted by other commercial finite element software, with a few plugins and actual core implementations available (ANSYS, SAMCEF, OOFELIE, etc.).
=== First discretization step ===
 
===Scaled boundary finite element method (SBFEM)===
In order to turn this process into an algorithm that can be run on actual hardware, one chooses a finite subset of E. Now we have F=F<sub>''n''</sub>={e<sub>1</sub>,e<sub>2</sub>,...,e<sub>n</sub>} a finite set, F a subset of E, and we wish to solve the problem
The introduction of the scaled boundary finite element method (SBFEM) came from Song and Wolf (1997).<ref>{{cite journal |first1=Chongmin |last1=Song |first2=John P. |last2=Wolf |title=The scaled boundary finite-element method – alias consistent infinitesimal finite-element cell method – for elastodynamics |journal=Computer Methods in Applied Mechanics and Engineering |volume=147 |issue=3–4 |date=5 August 1997 |pages=329–355 |doi=10.1016/S0045-7825(97)00021-2|bibcode=1997CMAME.147..329S }}</ref> The SBFEM has been one of the most profitable contributions in the area of numerical analysis of fracture mechanics problems. It is a semi-analytical fundamental-solutionless method combining the advantages of finite element formulations and procedures and boundary element discretization. However, unlike the boundary element method, no fundamental differential solution is required.
 
===S-FEM===
(**) &psi;(''u<sub>n</sub>'',''e<sub>j</sub>'')=&int;<sub>T</sub>''u<sub>n</sub>' ''&middot;''e'<sub>j</sub>'' for every ''e<sub>j</sub>'' in F<sub>''n''</sub>
{{Main|Smoothed finite element method}}
The S-FEM, Smoothed Finite Element Methods, is a particular class of numerical simulation algorithms for the simulation of physical phenomena. It was developed by combining mesh-free methods with the finite element method.
 
===Spectral element method===
with the goal that, as ''n'' increases to infinity (and F<sub>''n''</sub> increases to E), the solutions ''u<sub>n</sub>'' should converge to the solution ''u'' of (*)
{{Main|Spectral element method}}Spectral element methods combine the geometric flexibility of finite elements and the acute accuracy of spectral methods. Spectral methods are the approximate solution of weak-form partial equations based on high-order Lagrangian interpolants and used only with certain quadrature rules.<ref>{{Cite web|url=http://lsec.cc.ac.cn/~cjxu/SEM_mem.html|title=Spectral Element Methods|website=State Key Laboratory of Scientific and Engineering Computing|access-date=2017-07-28|archive-date=2017-08-10|archive-url=https://web.archive.org/web/20170810215437/http://lsec.cc.ac.cn/~cjxu/SEM_mem.html|url-status=dead}}</ref>
 
===Meshfree methods===
=== Second discretization step ===
{{Main|Meshfree methods}}
 
===Discontinuous Galerkin methods===
Let us now look for a solution in the linear span of F. While the actual solution of (*) is almost certainly not in the linear span of F, we are once more hoping for some sort of convergence property. If everything were occurring inside the linear span of F, we would have
{{Main|Discontinuous Galerkin method}}
 
===Finite element limit analysis===
:''u<sub>n</sub>''=&sum;''a<sub>k</sub>e<sub>k</sub>''
{{Main|Finite element limit analysis}}
:''g<sub>n</sub>''=&sum;''b<sub>k</sub>e<sub>k</sub>''
 
===Stretched grid method===
Substituting into (**) and expanding, we obtain:
{{Main|Stretched grid method}}
 
===Loubignac iteration===
(***) &sum;''a<sub>k</sub>''&psi;(''e<sub>k</sub>'',''e<sub>j</sub>'')=&sum;''b<sub>k</sub>''&int;<sub>T</sub>''e<sub>k</sub>e<sub>j</sub>'' for all j=1,...,n.
[[Loubignac iteration]] is an iterative method in finite element methods.
 
===Crystal plasticity finite element method (CPFEM)===
There is now the question of how to invent a suitable ''g<sub>n</sub>'' and there are many approaches, depending on how the set E was chosen. If E is chosen to be some Fourier basis, then ''g<sub>n</sub>'' can be obtained as the projection of ''g'' onto the linear span of F, but other approaches are possible.
The crystal plasticity finite element method (CPFEM) is an advanced numerical tool developed by Franz Roters. Metals can be regarded as crystal aggregates, which behave anisotropy under deformation, such as abnormal stress and strain localization. CPFEM, based on the slip (shear strain rate), can calculate dislocation, crystal orientation, and other texture information to consider crystal anisotropy during the routine. It has been applied in the numerical study of material deformation, surface roughness, fractures, etc.
 
===Virtual element method (VEM)===
The desire of course is again to make certain that the resulting ''u<sub>n</sub>'' will converge to a solution of (*).
The virtual element method (VEM), introduced by Beirão da Veiga et al. (2013)<ref>{{cite journal | first1=L. | last1=Beirão da Veiga | first2=F. | last2=Brezzi | first3=A. | last3=Cangiani | first4=G. | last4=Manzini | first5=L. D. | last5=Marini | first6=A. | last6=Russo | title=Basic principles of Virtual Element Methods | journal=[[Mathematical Models and Methods in Applied Sciences]] |date=2013 | issue=1 | pages= 199–214 | doi=10.1142/S0218202512500492 | volume=23}}</ref> as an extension of [[mimesis (mathematics)|mimetic]] [[finite difference method|finite difference]] (MFD) methods, is a generalization of the standard finite element method for arbitrary element geometries. This allows admission of general polygons (or [[polyhedra]] in 3D) that are highly irregular and non-convex in shape. The name ''virtual'' derives from the fact that knowledge of the local shape function basis is not required and is, in fact, never explicitly calculated.
 
==Link with the gradient discretization method==
=== Matrix version ===
Some types of finite element methods (conforming, nonconforming, mixed finite element methods) are particular cases of the [[gradient discretization method]] (GDM). Hence the convergence properties of the GDM, which are established for a series of problems (linear and nonlinear elliptic problems, linear, nonlinear, and degenerate parabolic problems), hold as well for these particular FEMs.
 
==Comparison to the finite difference method==
The astute reader will have noted that the last problem can be formulated as a [[matrix]] problem as follows:
The [[finite difference method]] (FDM) is an alternative way of approximating solutions of PDEs. The differences between FEM and FDM are:
 
* The most attractive feature of the FEM is its ability to handle complicated geometries (and boundaries) with relative ease. While FDM in its basic form is restricted to handle rectangular shapes and simple alterations thereof, the handling of geometries in FEM is theoretically straightforward.<ref name=":0" /><ref name=":1">{{Cite journal |last=Topper |first=Jürgen |date=January 2005 |title=Option pricing with finite elements |url=http://dx.doi.org/10.1002/wilm.42820050119 |journal=Wilmott |volume=2005 |issue=1 |pages=84–90 |doi=10.1002/wilm.42820050119 |issn=1540-6962|url-access=subscription }}</ref>
:P''a''=Q''b''
* FDM is not usually used for irregular CAD geometries but more often for rectangular or block-shaped models.<ref>{{Cite news|url=http://www.machinedesign.com/fea-and-simulation/what-s-difference-between-fem-fdm-and-fvm|title=What's The Difference Between FEM, FDM, and FVM?|date=2016-04-18|work=Machine Design|access-date=2017-07-28|archive-date=2017-07-28|archive-url=https://web.archive.org/web/20170728024918/http://www.machinedesign.com/fea-and-simulation/what-s-difference-between-fem-fdm-and-fvm|url-status=live}}</ref>
* FEM generally allows for more flexible mesh adaptivity than FDM.<ref name=":1" />
* The most attractive feature of finite differences is that it is straightforward to implement.<ref name=":1" />
* One could consider the FDM a particular case of the FEM approach in several ways. E.g., first-order FEM is identical to FDM for [[Poisson's equation]] if the problem is [[Discretization|discretized]] by a regular rectangular mesh with each rectangle divided into two triangles.
* There are reasons to consider the mathematical foundation of the finite element approximation more sound, for instance, because the quality of the approximation between grid points is poor in FDM.
* The quality of a FEM approximation is often higher than in the corresponding FDM approach, but this is highly problem-dependent, and several examples to the contrary can be provided.
 
Generally, FEM is the method of choice in all types of analysis in structural mechanics (i.e., solving for deformation and stresses in solid bodies or dynamics of structures). In contrast, [[computational fluid dynamics]] (CFD) tend to use FDM or other methods like [[finite volume method]] (FVM). CFD problems usually require discretization of the problem into a large number of cells/gridpoints (millions and more). Therefore the cost of the solution favors simpler, lower-order approximation within each cell. This is especially true for 'external flow' problems, like airflow around the car, airplane, or weather simulation.
where ''a'' is the column vector (a1,a2,...,an) and ''b'' is the column vector (b1,b2,...,bn). The matrices P and Q are given by (***):
 
== Finite element and fast fourier transform (FFT) methods ==
:P[j,k]=&psi;(''e<sub>k</sub>'',''e<sub>j</sub>'')
Another method used for approximating solutions to a partial differential equation is the [[Fast Fourier transform|Fast Fourier Transform]] (FFT), where the solution is approximated by a fourier series computed using the FFT. For approximating the mechanical response of materials under stress, FFT is often much faster,<ref>{{Cite journal |last1=Ma |first1=X |last2=Parvathaneni |first2=K |last3=Lomov |first3=S |last4=Vasiukov |first4=D |last5=Shakoor |first5=M |last6=Park |first6=C |title=Quantitative comparison between fast fourier transform and finite element method for micromechanical modeling of composite |url=https://hal.science/hal-02416258 |journal=FiBreMoD Conference|date=December 2019 }}</ref> but FEM may be more accurate.<ref name=":2">{{Cite journal |last1=Prakash |first1=A |last2=Lebensohn |first2=R A |date=2009-09-01 |title=Simulation of micromechanical behavior of polycrystals: finite elements versus fast Fourier transforms |url=https://iopscience.iop.org/article/10.1088/0965-0393/17/6/064010 |journal=Modelling and Simulation in Materials Science and Engineering |volume=17 |issue=6 |pages=064010 |doi=10.1088/0965-0393/17/6/064010 |bibcode=2009MSMSE..17f4010P |issn=0965-0393|url-access=subscription }}</ref> One example of the respective advantages of the two methods is in simulation of [[Rolling (metalworking)|rolling]] a sheet of [[Aluminium|aluminum]] (an FCC metal), and [[Wire drawing|drawing]] a wire of [[tungsten]] (a BCC metal). This simulation did not have a sophisticated shape update algorithm for the FFT method. In both cases, the FFT method was more than 10 times as fast as FEM, but in the wire drawing simulation, where there were large deformations in [[Crystallite|grains]], the FEM method was much more accurate. In the sheet rolling simulation, the results of the two methods were similar.<ref name=":2" /> FFT has a larger speed advantage in cases where the boundary conditions are given in the materials [[Strain (mechanics)|strain]], and loses some of its efficiency in cases where the [[Stress (mechanics)|stress]] is used to apply the boundary conditions, as more iterations of the method are needed.<ref>{{Cite journal |last1=Cruzado |first1=A |last2=Segurado |first2=J |last3=Hartl |first3=D J |last4=Benzerga |first4=A A |date=2021-06-01 |title=A variational fast Fourier transform method for phase-transforming materials |url=https://iopscience.iop.org/article/10.1088/1361-651X/abe4c7 |journal=Modelling and Simulation in Materials Science and Engineering |volume=29 |issue=4 |pages=045001 |doi=10.1088/1361-651X/abe4c7 |bibcode=2021MSMSE..29d5001C |issn=0965-0393|url-access=subscription }}</ref>
:Q[j,k]=&int;<sub>T</sub>''e<sub>k</sub>e<sub>j</sub>''
 
The FE and FFT methods can also be combined in a [[voxel]] based method (2) to simulate deformation in materials, where the FE method is used for the macroscale stress and deformation, and the FFT method is used on the microscale to deal with the effects of microscale on the mechanical response.<ref name=":3">{{Cite journal |last1=Gierden |first1=Christian |last2=Kochmann |first2=Julian |last3=Waimann |first3=Johanna |last4=Svendsen |first4=Bob |last5=Reese |first5=Stefanie |date=2022-10-01 |title=A Review of FE-FFT-Based Two-Scale Methods for Computational Modeling of Microstructure Evolution and Macroscopic Material Behavior |journal=Archives of Computational Methods in Engineering |language=en |volume=29 |issue=6 |pages=4115–4135 |doi=10.1007/s11831-022-09735-6 |issn=1886-1784|doi-access=free }}</ref> Unlike FEM, FFT methods’ similarities to image processing methods means that an actual image of the microstructure from a microscope can be input to the solver to get a more accurate stress response. Using a real image with FFT avoids meshing the microstructure, which would be required if using FEM simulation of the microstructure, and might be difficult. Because fourier approximations are inherently periodic, FFT can only be used in cases of periodic microstructure, but this is common in real materials.<ref name=":3" /> FFT can also be combined with FEM methods by using fourier components as the variational basis for approximating the fields inside an element, which can take advantage of the speed of FFT based solvers.<ref>{{Cite journal |last1=Zeman |first1=J. |last2=de Geus |first2=T. W. J. |last3=Vondřejc |first3=J. |last4=Peerlings |first4=R. H. J. |last5=Geers |first5=M. G. D. |date=2017-09-07 |title=A finite element perspective on nonlinear FFT-based micromechanical simulations: A FINITE ELEMENT PERSPECTIVE ON NONLINEAR FFT-BASED SIMULATIONS |url=https://onlinelibrary.wiley.com/doi/10.1002/nme.5481 |journal=International Journal for Numerical Methods in Engineering |language=en |volume=111 |issue=10 |pages=903–926 |doi=10.1002/nme.5481|arxiv=1601.05970 }}</ref>
P is called the ''stiffness matrix'' and Q is called the ''mass matrix''.
 
=== Algorithm =Application==
[[File:Vanadis a1 test.gif|thumb|245x245px|3D pollution transport model - concentration field on ground level|alt=]]
[[File:Vanadis a2 test.gif|thumb|245x245px|3D pollution transport model - concentration field on perpendicular surface |alt=]]
 
Various specializations under the umbrella of the mechanical engineering discipline (such as aeronautical, biomechanical, and automotive industries) commonly use integrated FEM in the design and development of their products. Several modern FEM packages include specific components such as thermal, electromagnetic, fluid, and structural working environments. In a structural simulation, FEM helps tremendously in producing stiffness and strength visualizations and minimizing weight, materials, and costs.<ref name="Engineering Asset Management">{{cite journal|last1=Kiritsis |first1=D. |last2=Eemmanouilidis |first2=Ch. |last3=Koronios |first3=A. |last4=Mathew |first4=J. |date=2009 |title=Engineering Asset Management |journal=Proceedings of the 4th World Congress on Engineering Asset Management (WCEAM) |pages=591–592}}</ref>
The Finite Element algorithm is thus as follows:
 
[[File:Human knee joint FE model.png|thumb|245x245px|Finite Element Model of a human knee joint<ref>{{Cite journal| last1=Naghibi Beidokhti| first1=Hamid| last2=Janssen| first2=Dennis| last3=Khoshgoftar| first3=Mehdi| last4=Sprengers| first4=Andre| last5=Perdahcioglu| first5=Emin Semih| last6=Boogaard| first6=Ton Van den| last7=Verdonschot| first7=Nico| title=A comparison between dynamic implicit and explicit finite element simulations of the native knee joint| journal=Medical Engineering & Physics| volume=38| issue=10| pages=1123–1130| doi=10.1016/j.medengphy.2016.06.001| pmid=27349493| year=2016| url=https://ris.utwente.nl/ws/files/6153316/CMBBE2014-Hamid-Submitted.pdf| access-date=2019-09-19| archive-date=2018-07-19| archive-url=https://web.archive.org/web/20180719212657/https://ris.utwente.nl/ws/files/6153316/CMBBE2014-Hamid-Submitted.pdf| url-status=live}}</ref>]]
# Compute the Stiffness Matrix P.
# Compute the Mass Matrix Q.
# Approximate ''g'' and compute ''b''.
# Solve the matrix problem P''a''=Q''b'' for the unknown vector ''a''.
# Possibly convert the vector ''a'' back into a solution ''u'' (e.g. for viewing with a graphical computer program.)
 
This powerful design tool has significantly improved both the standard of engineering designs and the design process methodology in many industrial applications.<ref name=Hastings>Hastings, J. K., Juds, M. A., Brauer, J. R., ''Accuracy and Economy of Finite Element Magnetic Analysis'', 33rd Annual National Relay Conference, April 1985.</ref> The introduction of FEM has substantially decreased the time to take products from concept to the production line.<ref name=Hastings/> Testing and development have been accelerated primarily through improved initial prototype designs using FEM.<ref name="McLaren-Mercedes">{{cite web|title=McLaren Mercedes: Feature - Stress to impress |author=McLaren-Mercedes |year=2006 |url=http://www.mclaren.com/features/technical/stress_to_impress.php |access-date=2006-10-03 |archive-url=https://web.archive.org/web/20061030200423/http://www.mclaren.com/features/technical/stress_to_impress.php |archive-date=2006-10-30 |url-status=dead }}</ref> In summary, benefits of FEM include increased accuracy, enhanced design and better insight into critical design parameters, virtual prototyping, fewer hardware prototypes, a faster and less expensive design cycle, increased productivity, and increased revenue.<ref name=Hastings/>
=== Note on the choice of basis ===
 
In the 1990s FEM was proposed for use in stochastic modeling for numerically solving probability models<ref>{{cite journal |title=Methods with high accuracy for finite element probability computing |author1=Peng Long |author2=Wang Jinliang |author3=Zhu Qiding |journal=Journal of Computational and Applied Mathematics |volume=59 |issue=2 |date=19 May 1995 |pages=181–189 |doi=10.1016/0377-0427(94)00027-X |doi-access= }}</ref> and later for reliability assessment.<ref>{{cite book |first1=Achintya |last1=Haldar |first2=Sankaran |last2=Mahadevan |title=Reliability Assessment Using Stochastic Finite Element Analysis |publisher=John Wiley & Sons |isbn=978-0471369615 |year=2000}}</ref>
If one chooses a Fourier basis for E, then one gets a so-called [[Spectral method]], which from our point of view is closely related to the finite element method. Typically, in the finite element method, the set F is chosen directly, and is not usually construed to be a subset of some E.
 
FEM is widely applied for approximating differential equations that describe physical systems. This method is very popular in the community of [[Computational fluid dynamics]], and there are many applications for solving [[Navier–Stokes equations]] with FEM.<ref>{{cite book |last1=Girault |first1=Vivette |last2=Raviart |first2=Pierre-Arnaud |title=Finite Element Approximation of the Navier-Stokes Equations |volume=749 |year=1979 |publisher=Springer Berlin|isbn=978-3-540-09557-6}}</ref><ref>{{cite book |last1=Cuvelier |first1=Cornelis |last2=Segal |first2=August |last3=Van Steenhoven |first3=Anton A |title=Finite Element Methods and Navier-Stokes Equations |volume=22 |year=1986 |publisher=Springer Science & Business Media|isbn=978-1-4020-0309-7}}</ref><ref>{{cite book |last1=Girault |first1=Vivette |last2=Raviart |first2=Pierre-Arnaud |title=Finite Element Methods for Navier-Stokes Equations: Theory and Algorithms |volume=5 |year=2012 |publisher=Springer Science & Business Media|isbn=978-3-642-64888-5}}</ref> Recently, the application of FEM has been increasing in the researches of computational plasma. Promising numerical results using FEM for [[Magnetohydrodynamics]], [[Vlasov equation]], and [[Schrödinger equation]] have been proposed.<ref>{{cite journal |last1=Karakashian |first1=Ohannes |last2=Makridakis |first2=Charalambos |year=1999 |title=A Space-Time Finite Element Method for the Nonlinear Schrödinger Equation: The Continuous Galerkin Method |journal=SIAM Journal on Numerical Analysis |publisher=SIAM |volume=36 |issue=6 |pages=1779–1807 |doi=10.1137/S0036142997330111 |doi-access=}}</ref><ref>{{cite journal |last1=Sovinec |first1=Carl R. |last2=Glasser |first2=A.H. |last3=Gianakon |first3=T.A. |last4=Barnes |first4=D.C. |last5=Nebel |first5=R.A. |last6=Kruger |first6=S.E. |last7=Schnack |first7=D.D. |last8=Plimpton |first8=S.J. |last9=Tarditi |first9=A. |last10=Chu |first10=M.S. |title=Nonlinear Magnetohydrodynamics Simulation Using High-Order Finite Elements |journal=Journal of Computational Physics |volume=195 |issue=1 |pages=355–386 |year=2004 |doi=10.1016/j.jcp.2003.10.004 |publisher=Elsevier|bibcode=2004JCoPh.195..355S }}</ref>
Instead, the functions of F can be chosen to be ''piecewise linear''. A ''tesselation'' of the ___domain T is chosen, which decomposes T into triangles (say) and the functions of F are those that are linear on each component of the tesselation of T. (An illustration would be good here.) Each triangle is referred to as an "element."
 
==See also==
To obtain better algorithms, one can attempt to vary the primitives of the tesselation; it may be more natural to use rectangular elements, and in some cases curvilinear elements are called for. Conversely, once the elements are chosen, one still has a choice of how to define the test functions on each element. Test functions are usually, but not always chosen to be piecewise polynomial.
{{div col|colwidth=20em}}
*[[Applied element method]]
*[[Boundary element method]]
*[[Céa's lemma]]
*[[Computer experiment]]
*[[Direct stiffness method]]
*[[Discontinuity layout optimization]]
*[[Discrete element method]]
*[[Finite difference method]]
*[[Finite element machine]]
*[[Finite element method in structural mechanics]]
*[[Finite volume method]]
*[[Finite volume method for unsteady flow]]
*[[Infinite element method]]
*[[Interval finite element]]
*[[Isogeometric analysis]]
*[[Lattice Boltzmann methods]]
*[[List of finite element software packages]]
*[[Meshfree methods]]
*[[Movable cellular automaton]]
*[[Multidisciplinary design optimization]]
*[[Multiphysics]]
*[[Patch test (finite elements)|Patch test]]
*[[Rayleigh–Ritz method]]
*[[SDC Verifier]]
*[[Space mapping]]
*[[STRAND7]]
*[[Tessellation (computer graphics)]]
*[[Weakened weak form]]
{{div col end}}
 
==References==
If the test functions are chosen in a cunning way, the matrices P and Q will be structured so that the linear problem Pa=Qb can be solved very quickly. To understand the problem here, the calculation of Qb requires apparently O(n^2) multiplications and additions. However, if one chooses the Fourier basis, one notes that Q is the identity matrix, so there's nothing to be done to compute Qb. The coefficients of b can then be found using the fast fourier transform of g, which runs in O(nlogn) time. The matrix P is diagonal with easily calculated entries, so solving for a is trivial. One would then typically do an inverse Fourier transform on a, which requires O(nlogn) to obtain u.
{{Reflist|30em}}
 
==Further reading==
If one chooses a finite element basis (using, for instance, the triangular elements discussed above) so that each test function is supported on a small number of elements then one can see that the matrices P and Q will be ''sparse'' -- that is, most of the entries are zero. Then the calculation Qb can be done in O(n) time, and solving for a can be done efficiently using an iterative algorithm (such as the [[Conjugate gradient iteration]]).
{{Commons category}}
*G. Allaire and A. Craig: ''[https://books.google.com/books?id=HIwSDAAAQBAJ&q=%22finite+element%22 Numerical Analysis and Optimization: An Introduction to Mathematical Modelling and Numerical Simulation]''.
*K. J. Bathe: ''Numerical methods in finite element analysis'', Prentice-Hall (1976).
*Thomas J.R. Hughes: ''The Finite Element Method: Linear Static and Dynamic Finite Element Analysis,'' Prentice-Hall (1987).
*J. Chaskalovic: ''Finite Elements Methods for Engineering Sciences'', Springer Verlag, (2008).
*[[Endre Süli]]: [http://people.maths.ox.ac.uk/suli/fem.pdf ''Finite Element Methods for Partial Differential Equations''].
*O. C. Zienkiewicz, R. L. Taylor, J. Z. Zhu : ''[https://books.google.com/books?id=YocoaH8lnx8C The Finite Element Method: Its Basis and Fundamentals]'', Butterworth-Heinemann (2005).
*N. Ottosen, H. Petersson: ''Introduction to the Finite Element Method, '' Prentice-Hall (1992).
*Susanne C. Brenner, L. Ridgway Scott: ''The Mathematical Theory of Finite Element Methods'', Springer-Verlag New York, ISBN 978-0-387-75933-3 (2008).
*Zohdi, T. I. (2018) A finite element primer for beginners-extended version including sample tests and projects. Second Edition https://link.springer.com/book/10.1007/978-3-319-70428-9
*Leszek F. Demkowicz: ''Mathematical Theory of Finite Elements'', SIAM, ISBN 978-1-61197-772-1 (2024).
{{Numerical PDE}}
{{Authority control}}
 
[[Category:Finite element method| ]]
We note that the choice of piecewise linear elements is not even once differentiable, however it is piecewise differentiable. It is interesting to study how such solutions converge to the real solution of the Laplace problem as the number of elements tends to infinity.
[[Category:Continuum mechanics]]
[[Category:Numerical differential equations]]
[[Category:Partial differential equations]]
[[Category:Structural analysis]]
[[Category:Computational electromagnetics]]
[[Category:Canadian inventions]]
[[Category:Russian inventions]]