Questions tagged [fenics]
Questions about the finite element method software FEniCS and its subpackages (Dolfin, UFL, FFC).
100
questions
2
votes
1
answer
126
views
Neumann BC in the current configuration in a finite-strain problem
For a hyperelastic problem, I understand the variational formulation can be written as the minimisation of $\Pi$ with
$\Pi = \int_{\Omega} \psi( \pmb{u} )dx - \int_{\partial\Omega} \pmb{T}\cdot \pmb{u}...
1
vote
0
answers
56
views
Accessing nodal and degree of freedom organisation in the solution vector in Fenics and Firedrake
Context
Let suppose a solution to a finite element problem (associated to a mesh) stored in a vector $X$ of size $(N \cdot d)$ corresponding to $N$ nodes in the mesh and $d$ degrees of freedom for ...
1
vote
1
answer
998
views
Library for Discontinuous Galerkin method: FEniCS vs deal.ii
I am aware that both FEniCS and deal.ii are capable of solving problems with Discontinuous Galerkin (DG) method. I would like to specifically know if any of these two softwares can cater these ...
0
votes
0
answers
57
views
It is possible to solve integro-differential equations using in Fenics?
I am interested in solve the following integro-differential equation:
\begin{align}
\frac{\partial{\rho(\theta, t)}}{\partial{t}} = D \frac{\partial{\rho(\theta, t)}}{\partial{\theta^2}} - \beta \...
7
votes
3
answers
3k
views
Spectral Element vs Finite Element
I am trying to understand the difference between SEM and FEM. If I go by this paper, spectral element methods are a subset of FEM methods and the only difference lies in the choice of basis functions. ...
1
vote
1
answer
76
views
How can I define an equipotential surface/volume in FEniCS?
I want to solve electrostatic problem for potential. Charge density and medium permittivity are known, so is the potential of a grounded surface. I know how I can implement that.
But I would like to ...
2
votes
4
answers
2k
views
Simple FEniCS problem shape mismatch
This presentation by the Imperial College in London has a nice example in it, on page 8, Burgers Equations. The first part of their code reads like this:
...
0
votes
1
answer
81
views
Solving for two interconducting fluids in FEniCS
I'm trying to model in FEniCS a steady-state situation in which a coolant fluid flows through a nuclear fluid. There is finite rate of conduction between the two fluids. The simulation should output ...
4
votes
1
answer
400
views
Weak Formulation of Poisson's Equation for Electrostatics with Surface Charge
I am currently attempting to use FEnICS to solve an electrostatic problem with two materials of different permittivity $\varepsilon_1$ and $\varepsilon_2$ forming an interface:
Consider a domain $\...
1
vote
0
answers
187
views
Solving coupled PDEs with self-consistency condition
I am figuring out how to attack a problem (the Usadel equations of superconductivity) in which I need to solve a set of nonlinear PDEs for the fields $\{G_i (r)\}$
$$ U(G_i(r), \nabla G_i(r), \Delta(r)...
7
votes
2
answers
6k
views
FEniCS: how to specify boundary conditions on a circle inside 2D mesh
I would like to numerically find a mutual capacitance of two stripes of metal on the opposites sides of a cylinder. The problem is obviously a 2D Laplace equation. I would like to find the potential ...
3
votes
1
answer
164
views
FEM with elastic inhomogeneous properties leads to mesh-induced anisotropy
I'm solving an elastic homogenization problem and I'm having problems with mesh artifacts.
I would like to first give a brief summary of what I do: I have a system with inhomogeneous (but isotropic) ...
7
votes
2
answers
4k
views
FEniCS: separate boundary conditions in normal and tangential direction of mesh boundary
Given a vector-valued PDE, I'd like to enforce the boundary conditions
$$
\vec{n}\cdot u = g\\
\vec{n}\cdot \nabla (\vec{t}\cdot u) = 0
$$
on the solution $\vec{u}$. If the boundary happens to align ...
0
votes
0
answers
103
views
Dolfin convert : How to interpolate data at vertices of (3D) cells?
I hope that one of you guys can help me because i have been stuck here for a week.
I am trying to read a gmsh file (.msh) using dolfin convert to XML and then download it with dolfin.
The thing is ...
0
votes
0
answers
178
views
How to use FEniCS to calculate the electric field of an isolated charged sphere
Initially I thought that this is the kind of question which ought to have already been answered in the form of an example online, but so far I haven't found one. I will admit that I am very new to ...
1
vote
0
answers
51
views
Add orthogonality constraint to PDE over entire domain finite element
I have a nonlinear differential equation for $u:\mathbb{R}^2\rightarrow\mathbb{R}^3$ that I can express in the form:
$ \nabla (g(u)_{ij} \nabla(u)^j) = 0 $
which is similar to the "Nonlinear Poisson" ...
0
votes
0
answers
424
views
Time-dependent Schrodinger equation implementation in FEniCS
For our Bachelors thesis we're trying to solve the Schrodinger equation $i\partial_tu = -\nabla^2u+Vu$ in FEniCS. Given the domain $[-5, 5]^2$ with an initial value of $u_0(x, y)=e^{(-2(x^2+y^2))}$ ...
0
votes
0
answers
389
views
Heat diffusion simulation in a 3D piston using FENICS
I'm trying to simulate the heat diffusion in a 3D piston. I marked the boundaries on GMSH.
I have used a Dirichlet BC of 300 on the top face of piston. But the results look abnormal. There is a ...
1
vote
0
answers
462
views
Immersed boundary method in FEniCS?
I have looked at the FEniCS tutorials and documentation but I cannot find any mention to the possibility of implementing an immersed boundary method (IBM) for fluid dynamics.
In particular, I want ...
-1
votes
2
answers
587
views
How to use natural logarithm inside Expression on FENICS
I'm trying to evaluate the exact solution of heat diffusion in circular plate.
I'm not able to use the natural logarithm inside expression.
...
0
votes
0
answers
143
views
FEniCS, refinement not 'respecting' domain boundary
Short question: how to ensure that extra points are not included as 'boundary' points after calling the refine function.
More details.
I am working with a hexahedral mesh in $3$d. Let $X$ be the set ...
1
vote
0
answers
41
views
Setting up diffusion with integral B.C. in Fenics
I'm trying to model diffusion through a cylindrical domain $D = \{ (x,y,z) : x^2 + y^2 \leq 1, \;\; 0 \leq z \leq 1\}$.
The is an initial concentration of the diffusant at the upper flat surface, ...
1
vote
1
answer
535
views
Fenics: solving the same PDE multiple times
I am new to Fenics and just started reading the tutorial Solving PDEs in Python. For simplicity, we can refer to simplest example, page 17 (the linear poisson equation), despite not necessary.
My ...
0
votes
0
answers
149
views
FEniCS implementation of Maxwell equations for a dipole antenna
someone knows where I can find a FEniCS implementation of Maxwell equations for a dipole or other type of antenna? I mean a dipole antenna with an arbitrary geometry of every 'leg' in the dipole.
0
votes
0
answers
78
views
Coupling 1D-3D problem in FENICS
I was wondering whether any of you knew if FENICS has the capability to solve coupled 1D-3D problems that are linear non-iteratively? As an example, pipes embedded in a porous domain will provide ...
2
votes
1
answer
680
views
Basic Finite Element Method (FEM) question: assembly and re-assembly
I'm reading up on the Finite Element Method (Zienkiewicz's Book), so I understand better what I'm doing in FEniCS and COMSOL. Currently, I'm wondering about this:
Using FEM to solve fluid flow ...
3
votes
2
answers
1k
views
Electromagnetism FEM (FEniCS) interpolation - leakage effect
As for the background of what is going on:
I'm using FEniCS that is dedicated FEM solver
The problem I'm solving is magnetostatic problem where the governing PDE is $$ \bf{\nabla} \times \frac{1}{\mu}...
0
votes
0
answers
93
views
Stokes Equation fails to converge for an ellipse
This might be because of the mesh, but the following code blows up for all values of b not 1. Does anybody have any experience working with the ellipse mesh in Fenics?
...
2
votes
2
answers
5k
views
How to use MeshFunction in FEniCS (dolfin)?
I'm a beginner user of FEniCS and still struggling with some of the basics. Specifically,
I have some issues doing the tutorials in the Langtangen-Logg book Solving PDEs in Python - The FEniCS ...
3
votes
2
answers
1k
views
Developing a C++ solid mechanics program
I am a beginner in computational science and programming. I am doing research in non linear solid mechanics analysis and using C++ for coding. I have been exploring various finite element open source ...
0
votes
1
answer
634
views
Load the mesh file with boundary marks
I'm want to load a mesh from a file, generated by triangle, and I want to use the boundary marks of its nodes (boundary marks of the file). It is possible?
Also, I can change the mesh generator (or ...
0
votes
1
answer
302
views
Solving Vectorial Poisson Equation in FENICS
I am trying to solve the following, "test problem" involving a vectorial Poisson equation:
$$-\nabla^2 \vec{A}=\vec{J} \quad \forall x\in\Omega=[-1,1]^3$$
$$ \vec{A}=\vec{0} \quad \forall x\in\...
3
votes
2
answers
110
views
Quantification of non-stationarity of PDE solution
Suppose I have a time-dependent PDE discretized by the Rothe method and FEM, like
$$
\int_{\Omega} k^{n+1/2}(u^{n+1}-u^{n}) v \;\mathrm{d}x = F^{n+1/2}(u^{n+1},u^n)[v] \quad \forall v\in V_h^n.
$$
...
6
votes
1
answer
921
views
FEniCS: how to access coordinates when writing an equation for a trial function
I need to solve the following equation in FEniCS:
$$
\boldsymbol{\nabla} \cdot \begin{pmatrix}
f(y)\frac{\partial u}{\partial x} - g(x,y)\frac{\partial u}{\partial y} \\
- g(x,y)\frac{\partial u}{\...
1
vote
1
answer
233
views
Penalization parameter for DG with jump penalization
I adapted this FEniCS code for my problem and I'm wondering if there is any good resource about how to choose the penalty parameter $\alpha$? Best case would be, if I can define it through some ...
10
votes
3
answers
2k
views
Are there any "light-weight" FEM packages around?
Basically, FEM seems to be a problem that is pretty much "solved". There are numerous powerful frameworks existing, like Trilinos, PETSc, FEniCS, Libmesh or MOOSE.
One thing they have in common: They ...
4
votes
4
answers
8k
views
Fenics: msh to xml conversion
I generated a mesh file in gambit and wanted to convert it to xml format. I tried the code below, but there is no output.
...
2
votes
2
answers
831
views
Schrödinger equation with time dependent Hamiltonian
I need to solve the Schrödinger equation with a time dependent Hamiltonian
$$i\hbar \frac{\partial}{\partial t} \Psi = \left[-\frac{\hbar^2}{2m}\nabla^2 +\frac{1}{2} k(t)(x^2+y^2) + V(r)\right]\Psi $...
0
votes
2
answers
126
views
Computable alternative to "almost everywhere"
I am working with finite elements for Maxwell's Equations (i.e. with Nedelec's edge elements) and for computation I'm using the FEniCS-project. While implementing the Augmented Lagragian Method, I ...
1
vote
0
answers
135
views
Hello word in FEniCS? [closed]
I am trying to start using FEniCS, but have a problem with the simple hello world examples given in the books. Could you please give me the simplest hello world ...
7
votes
3
answers
6k
views
Tutorial for flow around a cylinder in FEniCS
I am continuing my dive into computational fluid dynamics. I would like to build a simple test case for modelling the flow around a cylinder in FEniCS and then continue to model turbulence in order to ...
-1
votes
1
answer
79
views
Anyone knows where I can find a simple FEniCS code where I can understand basic implantation? [closed]
I found this one, but does not work: http://www.karlin.mff.cuni.cz/~hron/warsaw_2014/pl2014_lecture5.pdf
1
vote
0
answers
133
views
computational tool for higher order Lagrangian interpolation for finite element
In finite element, I can calculate the Lagrangian interpolation shape functions for each degree of freedom in an element, from the the number of nodal degrees of freedom and the number of nodes ...
7
votes
2
answers
342
views
Comparing various implementations/software packages for large-scale finite element simulations
I currently use FEniCS and Deal.II to solve various FEM problems. I am also writing my own implementation of these problems by directly implementing the data structures, routines, and solvers within ...
0
votes
2
answers
180
views
What would be a simple approach to validate a wave propagation code?
I have a linear elastic wave propagation code and an elastoplastic wave propagation code based on FEniCS.
For now, I keep the 2D mesh (100, 100) fineness unit square and give a source wave of $\sin(...
1
vote
1
answer
301
views
imposing "measured data" to Dirichlet boundary conditions in fenics
I'm relatively new to fenics and I just looked through all questions related to Dirichlet boundary conditions. I don't seem to find a well-described question or answer about what I'm about to ask.
I'...
1
vote
0
answers
385
views
How to add a Ricker Wavelet (Mexican Hat) to a 2D/ 3D fem mesh?
I have a 2D square mesh and a 3D beam shaped mesh and I want to propagate a seismic wave in them. I am trying to simulate them using Open source FEM codes (fenics). I have left the top surface to be ...
1
vote
0
answers
211
views
Weak form for elastoplastic wave propagation
I am trying to simulate elastoplastic seismic wave propagation using Fenics Solid Mechanics Application.
The app. provides some quasi-static demos to show elastoplastic behaviour in a cube/ beam/ ...
3
votes
0
answers
426
views
A Question About Weak Forms in Fenics
Is it possible to use test and trial functions from two different function spaces (defined over two different meshes) in a single weak form? Under what conditions can I do this (eg., each term in the ...
1
vote
0
answers
103
views
Need suggestions on how to implement this time stepping for wave equation [closed]
I have the following system of equations obtained by implementing Sympletic Euler time scheme to wave equation. I want to model this in Fenics. Here 'u' is the displacement and 'p' is corresponding ...