Skip to main content
Share Your Experience: Take the 2024 Developer Survey
10 votes

Are there any "light-weight" FEM packages around?

I've been developing a lightweight finite element library in Python 2.7 harnessing the power of NumPy arrays and SciPy sparse matrices. The general idea is that given a mesh and a finite element, you ...
knl's user avatar
  • 2,104
5 votes

Spectral Element vs Finite Element

The SEM is a FEM! It's almost like all these different names are designed to confuse the newcomer. I will speak primarily about the most popular form which uses a tensor product Lagrange basis with ...
L. Young's user avatar
  • 188
5 votes
Accepted

Spectral Element vs Finite Element

The main advantage is that it reduces the Runge phenomenon and leads to faster convergence rates. It also presents less numerical dispersion and need less nodes per wavelength (see 1 and 2). So, I ...
nicoguaro's user avatar
  • 8,515
4 votes
Accepted

How to use MeshFunction in FEniCS (dolfin)?

The different specialized VertexFunction, EdgeFunction, FaceFunction, ...
Christian Clason's user avatar
4 votes

Are there any "light-weight" FEM packages around?

I think you have some confusion. PETSc is not in the same league as Fenics, Libmesh, Moose etc. In fact, all of these (heavyweight) packages use PETSc for linear algebra. IMHO PETSc is as lightweight ...
stali's user avatar
  • 1,759
4 votes

Developing a C++ solid mechanics program

Specific answers to this question are probably time-limited. However, the following general approach (from the great Eric S. Raymond) works very well: Rule of Modularity: Write simple parts ...
Biswajit Banerjee's user avatar
4 votes

Are there any "light-weight" FEM packages around?

I can recommend nutils. nutils meets at least a few your "light-weight" requirements. it is pure python and easy to install since it only depends on standard Python libraries numpy, scipy, and ...
Jan's user avatar
  • 3,418
4 votes

How to generate mesh for space-time FEM method in FEniCS?

First of all, for FEniCS specific questions please refer to the official FEniCS forum. In my opinion, your question can be answered irrespective of your FEM library of choice. There are two ...
Julian Roth's user avatar
3 votes

Neumann BC in the current configuration in a finite-strain problem

As far as I understand, you basically want to express your traction vector from deformed (current) configuration to undeformed (reference) configuration in your integral. Would it be possible to just ...
RandomElasticity's user avatar
2 votes
Accepted

What would be a simple approach to validate a wave propagation code?

I agree with the suggestion of starting with a simple problem and with the elastic solution. Probably the simplest wave problem is the 1D, infinite bar/string. The analytical solution to this problem ...
Bill Greene's user avatar
  • 6,074
2 votes

imposing "measured data" to Dirichlet boundary conditions in fenics

I don't know how to do this in FEciCS, but that question should probably be asked of the developers or their mailing list per this SE's policy. That being said, I'm not sure such a problem is well-...
Bill Barth's user avatar
  • 10.9k
2 votes

FEniCS: how to specify boundary conditions on a circle inside 2D mesh

I have also had this problem and spent a lot of time on various forums and I have finally come up with a good solution. This solution will allow you to specify a boundary condition on any whole ...
Ryan's user avatar
  • 21
2 votes

Fenics: msh to xml conversion

meshio (a small project of mine) has as command-line tool that can do it: meshio-convert cylinder6.msh out.xml
Nico Schlömer's user avatar
2 votes
Accepted

Schrödinger equation with time dependent Hamiltonian

I'd suggest to try it on your own. Do an expansion of your wavefunction in terms of spherical harmonics, $$ \psi(\mathbf r) \ = \ \sum_{\ell} R_\ell(r,t) \, Y_{\ell 0} (\theta,\phi)\,. $$ Note that ...
davidhigh's user avatar
  • 3,137
2 votes

Schrödinger equation with time dependent Hamiltonian

FEniCS users have solved this problem before, but keep in mind that FEniCS does not natively support complex numbers right now in its code. Therefore you have to make a workaround. See: https://...
Slenderman's user avatar
2 votes
Accepted

Penalization parameter for DG with jump penalization

TL;DR: Let $k$ be the diffusion coefficient, $\theta$ the minimum angle between any two edges of the mesh, $d$ the space dimension, and $p$ the polynomial degree of the finite element basis you're ...
Daniel Shapero's user avatar
2 votes
Accepted

Fenics: solving the same PDE multiple times

The following approach should work. A = assemble(a) bc.apply(A) solver = LUSolver(A) solver.parameters['reuse_factorization'] = True # maybe not needed Now you ...
cfdlab's user avatar
  • 3,028
2 votes

Library for Discontinuous Galerkin method: FEniCS vs deal.ii

For Hyperbolic PDEs I can highly recommend Trixi, a (if you want) high order Discontinuous Galerkin based solver with adaptive mesh refining capabilities written in ...
Dan Doe's user avatar
  • 1,083
2 votes

Load the mesh file with boundary marks

Since GMSH was mentioned in the comments as a possible meshing tool, the common way to deal with it there is to create a Physical Line. The simplest ...
Anton Menshov's user avatar
  • 8,672
2 votes
Accepted

How can I define an equipotential surface/volume in FEniCS?

This does not easily fit into a PDE formulation because it is a nonlocal constraint. But for all practical aspects, choosing a very large permittivity is usually good enough. Just choose it several ...
Wolfgang Bangerth's user avatar
1 vote

Solving for two interconducting fluids in FEniCS

You need to define your function space of your trial and test functions as the product space of the corresponding elements. ...
Bort's user avatar
  • 1,285
1 vote

FEM with elastic inhomogeneous properties leads to mesh-induced anisotropy

I believe that the issue you are facing emanates from the type of triangular mesh you are using. This particular discretisation has in-built anisotropy; note the alignment of all of the longest edges ...
Chenna K's user avatar
  • 944
1 vote

How to use natural logarithm inside Expression on FENICS

Or simply import math u_e = Constant(math.log(5))
tianyikillua's user avatar
1 vote

How to use natural logarithm inside Expression on FENICS

Double quotes(" ") represent strings in python, and hence the argument of the function Expression() is a string literal rather than a floating-point number, i.e., <...
sks-15's user avatar
  • 11
1 vote
Accepted

Solving Vectorial Poisson Equation in FENICS

Ok I will answer my own question: The problem is in the line solve(L==a,A,bc) which needs to be replaced by solve(a==L,A,bc). ...
Mantabit's user avatar
  • 121
1 vote

How to use MeshFunction in FEniCS (dolfin)?

If you're using the latest version of FEniCS, the meshing tools are deprecated as you've noticed. These tools are now under mshr module. You can install it via ...
antagim's user avatar
  • 41
1 vote

Computable alternative to "almost everywhere"

Regarding the question of how to check whether $|v|<g$ (which I would recommend to split into $v(x)<g(x)$ and $v(x)>-g(x)$, since $|v|$ will in general not be a piecewise polynomial), this is ...
Christian Clason's user avatar
1 vote

Anyone knows where I can find a simple FEniCS code where I can understand basic implantation?

You could try the FEniCS book or the FEniCS Tutorial.
user21's user avatar
  • 382
1 vote

Developing a C++ solid mechanics program

This is not really a program as much as a big repository of codes. John Burkardt from Florida State University maintains a rich collection of scripts in C++, Matlab and Fortran for a large range of ...
ptev's user avatar
  • 66
1 vote

What would be a simple approach to validate a wave propagation code?

I've found the Aldridge-Blake solution for spherical wave propagation quite useful for verification. You can find the code in Prof. Brannon's repository at https://csmbrannon.net/2012/03/13/aldridge-...
Biswajit Banerjee's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible