# Questions tagged [fenics]

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

94 questions
Filter by
Sorted by
Tagged with
2k 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 ...
3k views

### Poisson equation: Impose full gradient as boundary condition via Lagrange multipliers

I have a physical problem governed by the Poisson equation in two dimensions $$-\nabla^2 u = f(x,y), \; in \; \Omega$$ I have measurements of the two gradient components $\partial{u}/\partial{x}$ ...
3k views

3k 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 ...
2k views

### 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 ...
4k 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 ...
636 views

### Stochastic Galerkin projection approach for using generalized polynomial chaos expansion (GPCE) in solving PDE

I want to know if there is any way to define the test and trial function in the way that I want instead of using the default functions. So if I want define the polynomial and basis and coefficient, ...
863 views

### Compute lengths of the longest edge of each cell

Having mesh = UnitSquareMesh(2, 2) Q = FunctionSpace(mesh, 'DG', 0) this works as expected ...
1k views

### Poisson equation with pure Neumann boundary conditions (using FEM)

I am trying to derive the correct variational form for the Poisson equation with pure Neumann boundary conditions, and an additional contraint $\int_{\Omega} u \, {\rm d} x = 0$, as described in this ...
5k 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. ...
457 views

### Poiseuille flow

I have probably a very stupid problem. I can't solve a simple Poiseuille flow in a straight 2-D channel driven by a pressure drop. Results are complete nonsense. (Setting zero pressure on the outflow ...
4k views

### 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 ...
2k views

### Fenics, initialize vector of degrees of freedom for function

With the move away from launchpad I hope this is the right place for this question. Is there a way to initialize the DOFs for a function? generated by u = Function(V) When I run a code which I ...
138 views

### Assembling FE tensors using different quadrature degrees

Assume we have few terms contributing to element tensor and each requires different quadrature degree to be integrated exactly. Does it generally worth using different quadrature degrees for each term ...
1k views

### 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 ...
2k views

### FEniCS: importing mesh along with material and boundary data

Which is the preferred way to import into a FEniCS (python) program a mesh which was generated in an external generator which provides sub-domain and boundary markers? I was using MeshData->...
998 views

For the numerical integration of reaction terms in my PDE on a 2D triangular mesh, I would like to use the scheme $$\int_T \Phi(x) \approx \frac{|T|}{3} (\Phi(x_0) + \Phi(x_1) + \Phi(x_2))$$ where ...
1k views

### CFD: multiphase flow modeling of a laminar flow reactor

I am planning to model the laminar flow reactor shown in the picture below using computational fluid dynamics (CFD). The laminar flow reactor is used to study a multiphase flow: a layer of sheath air ...
144 views

### compute max(||u||) for vector field

Given a vector-valued Dolfin function u from the function space V*V with ...
506 views

106 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.$$ ...
1k views

### 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 ...
488 views

### Implementation of a contraction force in Fenics

Is there any way to implement an element wise contraction force (i.e., a force which causes the FEs themselves to contract onto themselves)? For example this would happen when something dehydrates. ...
107 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) ...