Skip to main content

All Questions

Filter by
Sorted by
Tagged with
11 votes
3 answers
9k views

How to properly apply non-homogeneous Dirichlet boundary conditions with FEM?

In general, Dirichlet boundary conditions won't be satisfied exactly for FEM for non-homogeneous boundary conditions. The FEM codes I've seen set the degrees of freedom to interpolate the Dirichlet ...
andybauer's user avatar
  • 476
6 votes
1 answer
1k views

Meshing options to generate number of the sides of and element (tetgen-triangle)

I wrote a finite element code in fortran 90. This code is really fast, except the meshing process. I used triangle and tetgen for meshing in 2D and 3D, respectively, so this process is fast, of ...
yemino's user avatar
  • 527
33 votes
9 answers
6k views

Modern resources for learning FEM

I need to get started using Finite Element Methods. I am about to start reading Numerical solutions of partial differential equations by the finite element method by Claes Johnson, but it's dated 1987....
a06e's user avatar
  • 1,739
24 votes
9 answers
53k views

Basic explanation of shape function

I just started studying FEM in a more structured basis compared to what I used to do during my undergraduate courses. I am doing this because, despite the fact that I can use the "FEM" in commercial (...
Alfonso Santiago's user avatar
19 votes
1 answer
25k views

How to formulate lumped mass matrix in FEM

When solving time dependent PDE's using the finite element method, for example say the heat equation, if we use explicit time stepping then we have to solve a linear system because of the mass matrix. ...
James's user avatar
  • 1,929
11 votes
5 answers
3k views

Motivation behind Galerkin method

I have a question about Galerkin method. I don't understand why the Galerkin method weights the residual by the shape functions and sets it equal to zero. I want to know what is reason of this. Why we ...
mohammad's user avatar
  • 111
25 votes
4 answers
4k views

How to incorporate the boundary conditions with the Galerkin method?

I've been reading some resources on the web about Galerkin methods to solve PDEs, but I'm not clear about something. The following is my own account of what I have understood. Consider the following ...
a06e's user avatar
  • 1,739
4 votes
1 answer
966 views

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

I have a Hermite Cubic Finite Element Space on a computer in the form of Matlab m-files. More specifically, I can evaluate four "shape functions" $N_1, N_2, N_3,$ and $N_4$, for which the following ...
A. B. Marnie's user avatar
1 vote
1 answer
15k views

Python Finite Difference Schemes for 1D Heat Equation: How to express for loop using numpy expression

Hello all, I've recently been introduced to Python and Numpy, and am still a beginner in applying it for numerical methods. I've been performing simple 1D diffusion computations. I suppose my ...
Leonardo Parra García's user avatar
57 votes
3 answers
39k views

What are the conceptual differences between the finite element and finite volume method?

There is an obvious difference between finite difference and the finite volume method (moving from point definition of the equations to integral averages over cells). But I find FEM and FVM to be very ...
boyfarrell's user avatar
  • 5,439
55 votes
5 answers
11k views

What are criteria to choose between finite-differences and finite-elements

I am used to thinking of finite-differences as a special case of finite-elements, on a very constrained grid. So what are the conditions on how to choose between Finite Difference Method (FDM) and ...
shuhalo's user avatar
  • 3,720
29 votes
3 answers
6k views

What is the purpose of using integration by parts in deriving a weak form for FEM discretization?

When going from the strong form of a PDE to the FEM form it seems one should always do this by first stating the variational form. To do this you multiply the strong form by an element in some (...
Christian's user avatar
  • 511
24 votes
1 answer
12k views

What is the general idea of Nitsche's method in numerical analysis?

I know that the Nitsche's method is a very attractive methods since it allows to take into account Dirichlet type boundary conditions or contact with friction boundary conditions in a weak way without ...
Anh-Thi DINH's user avatar
10 votes
1 answer
3k views

PDE discretization with the method of rothe and the method of lines (Modular implementation)

The Heat equation is discretized in space with FV (or FEM), and a semi-discrete equation is obtained (system of ODEs). This approach, known as the method of lines, allows to easily switch from one ...
gnzlbg's user avatar
  • 1,085
8 votes
4 answers
6k views

How to efficiently assemble global stiffness matrix in sparse storage format (c++)

I am writing a finite element solver in C++. The main bottle neck is assembling the global stiffness matrix in sparse compressed row storage (so far I am only solving steady problems). Because I don't ...
James's user avatar
  • 1,929
5 votes
3 answers
1k views

Computing accurate fluxes with FEM

I have solved Poisson equation on a 3d domain with neumann and dirichlet boundary condition. I get the potential, take the gradient for each element and integrate on a surface of an element, I do this ...
Grandmaster Bator's user avatar
4 votes
1 answer
3k views

Comparison of Lattice Boltzmann Method vs Traditional Navier-Stokes based Methods

I have a choice of two options, analysing and implementing Lattice Boltzmann methods or traditional Navier Stokes based methods. I'm a CFD newbie and I have a rough idea (though not rigorous enough to ...
Aditya Kumar Praharaj's user avatar
4 votes
2 answers
2k views

The meaning of conservative discretization in Galerkin FEM and Discontinuous Galerkin

I do understand the meanning of "conservative discretization" within the FVM/FDM framework, indeed it is well explained in this post. Now, according to the table in this slide (pp.8), it concludes: ...
lorniper's user avatar
  • 593
2 votes
1 answer
300 views

Finite element method for odd order DE

What are theoretical hurdles in applying Galerikin method on, say, first order time dependent ODE? Is there no way we can form an inner product??
Sohail's user avatar
  • 246
2 votes
1 answer
223 views

Calculation of the EFIE integral

I need help computing the following integral: $$ \int_{}\frac{(1+jk|\vec{r}-\vec{r}^\prime|)e^{-jk|\vec{r}-\vec{r}^\prime|}}{|\vec{r}-\vec{r}^\prime|}d\vec{r}^\prime $$ in this integral $\vec{r}$ ...
hamed's user avatar
  • 21
2 votes
1 answer
259 views

Finite element (1D) for steady state non-linear problem

I need to solve with linear finite elements the equation $$\frac{\partial }{\partial x}\Bigl(\text{sgn}(x) u \Big) +\frac{\partial}{\partial x} \Bigl[ \sqrt{u} \frac{\partial u}{\partial x} \Bigr] =0$...
Vefhug's user avatar
  • 309
30 votes
9 answers
2k views

What is a good way to run parameter studies in C++

The problem I'm currently working on a Finite Element Navier Stokes simulation and I would like to investigate the effects of a variety of parameters. Some parameters are specified in an input file ...
okmatija's user avatar
  • 505
19 votes
1 answer
6k views

How to derive the Weak Formulation of a Partial Differential Equation for Finite Element Method?

I have taken a basic introduction to Finite Element Method, which did not emphasize a sophisticated understanding of a 'weak formulation'. I understand that with the galerkin method, we multiply both ...
Paul's user avatar
  • 12.2k
17 votes
2 answers
14k views

In FEM, why is the stiffness matrix positive definite?

In FEM classes, it's usually taken for granted that the stiffness matrix is positive definite, but I just can't understand why. Could anyone give some explanation? For instance, we can consider the ...
user123's user avatar
  • 699
15 votes
2 answers
3k views

FeniCS: Visualizing high order elements

I've just started messing around with FEniCS. I am solving Poisson with 3rd order elements and would like to visualize the results. However, when I use plot(u), the visualization is just a linear ...
Truman Ellis's user avatar
15 votes
3 answers
6k views

Finding which triangles points are in

Suppose I have a 2D mesh consisting of nonoverlapping triangles $\{T_k\}_{k=1}^N$, and a set of points $\{p_i\}_{i=1}^M \subset \cup_{k=1}^N T_K$. What is the best way to determine which triangle each ...
Nick Alger's user avatar
  • 3,225
14 votes
2 answers
1k views

Impose the compatibility conditions for mixed finite elements method in Stokes equation

$\newcommand{\v}[1]{\boldsymbol{#1}}$ Suppose we have following Stokes flow model equation: $$ \tag{1} \left\{ \begin{aligned} -\mathrm{div}(\nu \nabla \v{u}) + \nabla p &= \v{f} \\ \mathrm{div} \...
Shuhao Cao's user avatar
  • 2,552
11 votes
2 answers
7k views

How to efficiently implement Dirichlet boundary conditions in global sparse finite element stiffnes matrices

I am wondering how Dirichlet boundary conditions in global sparse finite element matrices are actually implemented efficiently. For example lets say that our global finite element matrix was: $$K = \...
James's user avatar
  • 1,929
10 votes
2 answers
627 views

Which novel data structures are used in adaptive FEM?

A lot of adaptive FEM libraries use more advanced mesh data structures to handle adding/removing nodes, edges, triangles, tetrahedra, etc. For example, the p4est library uses octree data structures ...
Daniel Shapero's user avatar
8 votes
0 answers
918 views

Numerical implementation of the Dirichlet-to-Neumann map

I am solving the Dirichlet problem $$ \begin{cases} \Delta u = 0, \\ u|_{\partial D} = f, \end{cases} $$ in a $2d$ domain $D$ using the finite element method. What I want to get is the ...
Appliqué's user avatar
  • 445
8 votes
2 answers
2k views

Projecting Finite Element solution onto new mesh

I am implementing a finite element solver in MATLAB and I have the following problem. Let's say I have a mesh $\mathcal{T}_1$ with triangular elements on a rectangular domain $\Omega\subset\mathbb{R}^...
Eff's user avatar
  • 213
6 votes
2 answers
3k views

Does the finite element method impose any restrictions on the Peclet number for numerical stability?

Background on finite volume method When discretising the flux with a central difference stencil of the the advection-diffusion equation restriction $\frac{ah}{d} < 2$ must be observed for the ...
boyfarrell's user avatar
  • 5,439
6 votes
3 answers
3k views

Books on mathematical foundation of finite element methods

After reading three books about finite element method, with two of them covering also finite volume and grid generation, I found myself lost when I have to discuss these topics with library developers ...
Pedro R.'s user avatar
  • 157
6 votes
3 answers
459 views

Is there a minimum angle requirement for cells in the finite volume method?

In his talk "What is a good linear finite element?", Shewchuk states that small dihedral angles in linear tetrahedra elements cause ill-conditioning of the stiffness matrix. Do small dihedral angles ...
J. Heller's user avatar
  • 163
6 votes
0 answers
615 views

How to do FEM in sector elements?

Suppose we have an element in the polar coordinate as $0\leq r\leq 1$, $0\leq\theta\leq \alpha$. What are the correct basis functions in this element? For this kind of mesh, there are a lot of ...
Hui Zhang's user avatar
  • 1,319
5 votes
1 answer
348 views

Method of Manufactured Solutions for non-differentiable coefficients

The Method of manufactured is commonly used for verification of computational science codes. I want to use the method for verification of Navier-Cauchy (elasticity) equations with periodic and Bloch-...
nicoguaro's user avatar
  • 8,622
5 votes
4 answers
2k views

FEM shape functions on triangular elements: transition from 2D to 3D

I'm writing a code for solving PDEs through the finite element method. In particular, I'm facing with 3D problems, in which I don't know how to calculate shape functions derivatives on the boundaries (...
Federico Giai Pron's user avatar
5 votes
2 answers
842 views

Absorbing boundary conditions for acoustics in Discontinuous Galerkin

Note: I'm trying to implement a Discontinuous Galerkin method, as kind of a way to learn about these things. As of now, I've taken the acoustic wave equation $c^2 \nabla \cdot \nabla u(x,t) - \frac{\...
Andy's user avatar
  • 301
5 votes
2 answers
572 views

What does symmetrize mean? (imposing multifreedom constraints to stiffness matrix)

I have a small FEM implementation program. And I want to add imposing multifreedom constraints (MFC) feature to it. The theory of master-slave method is given here (page 10 for general case). ...
danny_23's user avatar
  • 501
4 votes
1 answer
2k views

Is there a mesh generator that will generate zero thickness elements for interfaces?

I have a geometry and a finite element method where there are a couple internal interfaces across which I want to enforce some fairly simple jump conditions. One recommendation I've gotten has been ...
Geoff Oxberry's user avatar
3 votes
1 answer
471 views

Finite Elements Weak Formulation generalization

I am struggling with an equation that represents the Weak form of Galerkin method: $ \phi^{T}F(\textbf{u})\sim \int_{\Omega}^{ } \phi.f_{0}(\mathit{u},\nabla \mathit{u}) + \nabla\phi:f_{1}(\mathit{u},...
Pedro R.'s user avatar
  • 157
3 votes
1 answer
1k views

Implementation of gradient zero boundary conditon in advection-diffusion equation

My question is about Finite Element Method. I want to know how to implement "gradient zero" conditions to advection-diffusion equations in conservative form like, $\frac{\partial \rho}{\partial t} + ...
Phoenix Kyoma's user avatar
2 votes
2 answers
498 views

Weak form of the Navier-Cauchy equation

I am trying to obtain the weak form of the Navier-Cauchy equation, which is $$- \rho \omega ^2 \textbf{U} - \mu \nabla ^2 \textbf{U} - (\mu + \lambda) \nabla (\nabla \cdot \textbf{U}) = \textbf{F}$$ ...
Lucas Vieira's user avatar
2 votes
1 answer
3k views

3D Solid 8 Node FEM Matlab Code

So this semester, I'm taking a Finite Element Method course at my graduate school. We started out making codes for 1D bars and came all the way to 8 node solid elements. However, I seem to have run ...
Additional Pylons's user avatar
1 vote
1 answer
678 views

FEM on tet10 element: negetive determinant at the Gauss point

I am trying to implement a fem code on tet10 elements. I follow the lecture notes for tet10 implementation given in http://www.colorado.edu/engineering/CAS/courses.d/AFEM.d/AFEM.Ch10.d/AFEM.Ch10.pdf ...
kaush's user avatar
  • 107
1 vote
1 answer
2k views

Computation of stiffness matrix with variable coefficient

I am implementing a finite element solver (in 2D) to solve the generic differential equation : $$-\nabla(a(x) \nabla u) = f$$ Brief explanation By integrating and multipling by a test function, the ...
Electrode's user avatar
0 votes
1 answer
2k views

stiffness matrix for 3D regular grid in FEM

I have understood the stiffness matrix for 3D truss, and programmed Ku=f from scratch (in Java) to find the displacements. Then I moved to 3D solid but lost in too many concepts and equations, such ...
whitegreen's user avatar
-1 votes
1 answer
646 views

Pde problem with robin boundary condition

I have my pde 2D problem with robin condition (form: du/dn +ku=g) to solve with matlab. i have the exact function u and I want to find the function g in robin condition. How can i do it? thanks for ...
Betelgeuse's user avatar
15 votes
2 answers
8k views

What is the purpose of the test function in Finite Element Analysis?

In the wave equation: $$c^2 \nabla \cdot \nabla u(x,t) - \frac{\partial^2 u(x,t)}{\partial t^2} = f(x,t)$$ Why do we first multiply by a test function $v(x,t)$ before integrating?
Andy's user avatar
  • 301
14 votes
1 answer
463 views

What spatial discretizations work for incompressible flow with anisotropic boundary meshes?

High Reynolds number flows produce very thin boundary layers. If wall resolution is used in Large Eddy Simulation, the aspect ratio may be on the order of $10^6$. Many methods become unstable in this ...
Jed Brown's user avatar
  • 25.8k