Questions tagged [fenics]

Questions about the finite element method software FEniCS and its subpackages (Dolfin, UFL, FFC).

FEniCS is a collection of open source software for the numerical solution of partial differential equations using finite elements. It provides interfaces in C++ and Python (via the package DOLFIN).

Questions tagged should be concerned with the use of FEniCS for solving specific problems in computational science (e.g., how to implement a specific partial differential equation or boundary condition, or how to use FEniCS in optimization routines).

Questions about problems when using FEniCS (e.g., error messages when compiling/linking/running C++/Python code, explanation of Form or Expression syntax, clarifications on interfaces) belong on the FEniCS Q&A site. Until May 2013, FEniCS related issues were discussed on launchpad, and you may also find answers there.

Before posting a question, please make sure to check the documentation to see if it already addresses your issue. In particular, you might want to consult (in order of thoroughness)

  1. the documented demos in Python, C++
  2. the tutorial,
  3. the manual (in particular Chapter 4.4, which covers the UFL syntax for forms and expressions),
  4. the FEniCS book.

(Note that most of these (except demos) were written for version 1.0.0 -- current as of June 2014 is 1.4.0).

101 questions
8
votes
1 answer

FEniCS CFD work-flow for complex geometries

I have COMSOL and the CFD package therein available, which provides me with an all-in-one solution for solving CFD problems. I have modeled and solved the geometry shown in the pictures below, which took me roughly one hour. Now (just for kicks) I…
seb
  • 994
  • 1
  • 9
  • 22
4
votes
1 answer

Fenics: Meshfunction usage

I am confused most of the time with the application of boundary conditions in Fenics. Suppose I have an xml mesh for a rectangular beam and want to apply Dirichlet BC ($u =0$) on the left side of the beam in my mesh file. Can anyone tell me how can…
nickrocks
  • 117
  • 2
  • 9
4
votes
4 answers

FEniCS : How to interpolate data at vertices of (3D) cells?

I am trying to get an interpolation function $f$ (in 3D) at all vertices of cells. I extract all vertices of cells and then I assign the value to each vertex: if it's in a sphere of radius $R$, then I assign the value, say 3.91. If it's outside the…
Paul S.
  • 41
  • 2
3
votes
2 answers

Subdomain Integrals in Fenics

I'd like to compute $u(y) = \int f(x,y) dx$, but don't see a really efficient way to do this in FEniCS. My first thought was to just assemble(f*v*dx) for two different meshes. (try1, below), but it seems I can't combine 1D and 2D meshes, and that…
3
votes
1 answer

Fast function evaluation on a grid

I am trying to calculate a 3D Function f on a large set of points, say a uniform cubic grid. Besides, the cubic grid points do not coincide with the mesh vertices where the Function f is defined. For example: from dolfin import * mesh1 = Mesh(…
user4232
  • 31
  • 1
2
votes
1 answer

Mixed FEM vector indices of pressure and velocity in FEniCS

Looking at the stokes-iterative demo of FEniCS, after solving the linear system using U = Function(W) solver.solve(U.vector(), bb) the solution U is split: u, p = U.split() Is there a function with which I can get the indices of Uwhich contain the…
user4451
  • 21
  • 1
2
votes
2 answers

FEniCS: check if function is globally greater than 0

Given a Dolfin Function u on a mesh, I'd like to check if it is greater than 0 throughout the mesh. I noticed that the expression u > 0 is an object of the type GT(Coefficient(FiniteElement('Lagrange', Domain(Cell('triangle', 2),…
Nico Schlömer
  • 3,126
  • 17
  • 36
1
vote
1 answer

Fenics: problem with the mesh generation

while executing my script i get this error Traceback (most recent call last): File "/media/oss/Fenics/demo/box_3delasticity.py", line 33, in mesh = Box (0, 0, 0, 1, 1, 1, 1, 1, 1) File "/usr/lib/python2.7/dist-packages/dolfin/cpp/mesh.py",…
nickrocks
  • 117
  • 2
  • 9
1
vote
0 answers

FEniCs: help in implementing the boundary condition for 1D problem

I have just started learning FEniCS and have used: http://www.scientificpython.net/pyblog/fenics-linear-two-point-bvp to write a script for solving: u'' + u = 1 u(0) = 1, u'(1) = 0 with exact solution, u(x) =…
Sohail
  • 246
  • 1
  • 6
1
vote
1 answer

Tensor notation in fenics

Within Fenics what ordering is used for storing vectors as upper triangular matrices? Th:e question really is I define a green Lagrange strain tensor in the following way: V = VectorFunctionSpace(mesh, "Lagrange", 1) u = Function(V) I =…
Nick
  • 158
  • 1
  • 7
0
votes
2 answers

Speed up DG FunctionSpace evalutation

today I tried some evaluation on a DG function space (Fenics 1.2.0). In my calculations I need to use meshes with a large number of cells (~10mio). At the moment it takes a very long time to create a DG function space (in my distinct case a vector…
Sebastian
  • 11
  • 2
0
votes
1 answer

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 the steady-state temperature profile for each…
0
votes
0 answers

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 when i assemble the stiffness matrix and the mass…
nesrine
  • 1
  • 1