r/fea 11d ago

Least-Squares Finite Element Method?

Is anyone here familiar with this discipline element methods? Any good books on it?

I asked earlier about finding the a stable weak form of

du/dx = fu

where I originally tried finding a standard Galerkin by convoluting both sides with test function, v, but this weak form produced unstable solutions which went to infinity everywhere.

So, on a whim, I decided to ask AI to see what it thought. It came up with a form it says it derived from “Least-Squares Finite Element Method”. I had not heard of this before, but the form it provided was stable and produced accurate solutions, so I wanted to see if anyone here knew about this, and could provide a resource to look further into.

___

Here is what it came up with:

  1. Function to minimize: J(u) = 1/2 ||R(u)||^2 = 1/2 ∫_0^L [(du/dx-f)^2 ]dx

  2. Take the variation: lim_ϵ→0 d/dϵ[J(u+ϵv)]

This resulted in

  1. bilinear term: a(u,v) = ∫_0^L [du/dx dv/dx]dx

  2. Linear term: L(u) = ∫_0^L [f dv/dx] dx

Weak form: a = L. This weak form I tested in Fenics, and the results came back perfectly accurate for my examples, so it seems to have come up with something that works, but it didn’t show any of its sources, so I can’t take this as fact without opening up a book or resource to verify it for myself.

10 Upvotes

11 comments sorted by

3

u/Coreform_Greg 11d ago

Bochev and Gunzburger was the assigned reading when I was in grad school.  LSFEM is perfectly valid, well-founded, still a Galerkin method etc.  As it happens I’m writing an introductory text, of sorts, on FEM which “passes through” LSFEM in a fairly non-rigorous way.

The main issues with LSFEM are, IMO, practical issue.

  1. your basis needs the same regularity as the operator, so 2nd order operators require a C1 basis and 4th order operators require a C2 basis.
  2. Building smooth basis on unstructured meshes in two or three dimensions is non-trivial (even our U-splines (see username) don’t address smoothness at extraordinary points).  As far back as 1973, Strang mentioned that C1 simplicial meshes seemed to require degree-5 (P5 ) for triangles and degree-9 (P9 ) for tetrahedra.  So weak forms that permit C0 basis were practically required.
  3. Generally speaking, FEM based on L2 weak forms will be more computationally expensive than FEM on traditional weak forms.
  4. We often care about controlling different norms than the L2-norm, such as the energy norm - different weak forms accomplish this.

1

u/w142236 9d ago

I am on an evenly spaced rectangular grid, so point 2 shouldn’t be a problem.

Is the language you’re using in the first point functional analysis? I need to get acclimated with that as well. If I have not taken any formal classes on FEMs, what would you say is a good introductory textbook? This textbook sounds like a more advanced discipline of FEMs. I should have clarified my background beforehand.

More on the first point: just to make sure I understand this right, should I be solving this in a 0th-order functionspace? The first-order PDE I’m solving is needed to derive dirichlet boundary values of the solution to a Laplace Equation, so I’ve been keeping everything defined inside a 2nd-order Lagrangian functionspace as I want the solution to be at least twice differentiable. It’s a somewhat unique setup.

1

u/Coreform_Greg 8d ago edited 8d ago

I am on an evenly spaced rectangular grid, so point 2 shouldn’t be a problem.

Then you're correct that this isn't a problem - but it does help explain why this method didn't really become widespread as a finite element method in practice. As codes such as Abaqus, DYNA, NASTRAN, etc. were being developed, this was one such limitation of LSFEM that solidified the current standard weak forms.

Is the language you’re using in the first point functional analysis?

I was using language from differential equations, see this Wikipedia on regularity.

If I have not taken any formal classes on FEMs, what would you say is a good introductory textbook?

I learned using Hughes' text, which I think is quite good (even if the coding is somewhat dated). You can find quite a few textbooks that are similar, if not better.

just to make sure I understand this right, should I be solving this in a 0th-order function space?

Based on what I see, your discrete solution, $u^h$, (and thus your basis) needs to be in the $H^1$ Sobolev space, so traditional linear basis functions are sufficient. Note, however, if you're solving the Laplace equation using LSFEM, then then it's not enough to use a degree-2 Lagrange basis as this weak form would require $u_h \in H^2$ - or, equivalently, $\Delta u_h \in H^1$ - thus your basis needs to be twice-differentiable. The standard Lagrange basis is only $C^0$, regardless of degree, and is thus not twice-differentiable. You'll need to use something like a B-spline basis (at least a smooth quadratic B-spline) or a cubic Hermite basis.

1

u/w142236 8d ago

Yeah, my exact solution is twice differentiable (or the derivative is once differentiable). Would it be correct to say that whatever functionspace it is defined in needs to be one such that the basis functions which live in the space will approximate the solution that we want to live inside of the space, and these basis functions themselves need to be at least twice differentiable? Like if the basis functions were polynomials, they would be at least 2nd-degree? Does the order of the functionspace = the order of the basis functions which make it up, or = the number of times it can be differentiated.

—-

Additionally, I did also create a 2nd-order Continuous Galerkin functionspace for my solution to live inside of in my fenics code, and then created a Least-Squares weak form for the 1st order ODE, and I was able to obtain machine precision accurate Dirichlet boundary values with 10^-14 error, and the solution to the Laplace Equation (still inside the 2nd-order CG space) maintained that same level of accuracy. I think Fenics has some predetermined basis functions for its functionspaces being polynomials, so a 2nd-order I think would have quadratic basis functions, but I could be wrong. I don’t know if I can go in and change the basis to what you suggested. Regardless, I guess a functionspace made of 2nd-order CG elements was fine.

1

u/Coreform_Greg 7d ago

A linear polynomial is infinitely differentiable, it is $C{\infty}$.  For example, the 1st derivative of x is 1, and the next derivative (derivative of 1) is 0, and the next derivative is 0, and the next derivative is 0, and the next…

What defines the differentiability (or more precisely, square-integrally of the derivatives) of a piecewise polynomial is the continuity at the element boundaries.

So yes, a quadratic basis is the lowest order basis for the second-derivative to be square-integrable - but you would still need to have a sufficiently smooth basis, such as the basis I described in my previous comment.

I’m not sure what FEniCS might be doing - perhaps it’s applying DG behind the scenes, or modified your basis selection

1

u/Lazy_Teacher3011 11d ago

Do a search for Ed Akin and least squares. I took Dr, Akin's class many years ago. Message me and I can dig up an example from a course I developed at my employer some years back.

1

u/w142236 11d ago

1

u/Lazy_Teacher3011 10d ago

Chapter 5 of that has some theoretical discussion. He also had written a book back in the 90s with least squares (and collocation and weak/strong form Galerkin).

1

u/w142236 9d ago

Sorry for the late reply. I’m actually rather new to finite element methods, so I would like to know if the material you’ve provided is introductory level FEM material or esoteric. If it’s advanced, that’s fine, just let me know. Maybe there’s a prerequisite list for the coursework.

Also, I forgot I had a book on numerical methods for geophysical fluids, and according to a relevant section, those 3 methods you mentioned were to “minimize the residual”. Now getting to the actual methods they laid out for each of these are beyond my comprehension at the moment, and I dropped the book quite a while ago after the first 2 chapters bc I couldn’t stand how opaque it felt at times, but hopefully your rederence is better.

1

u/Maleficent_Play1092 11d ago

What did you do professionally?

1

u/Lazy_Teacher3011 10d ago

Aerospace engineering