Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fenics]

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

0
votes
1answer
40 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\...
0
votes
1answer
80 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 ...
0
votes
2answers
102 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
0answers
89 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 ...
-1
votes
1answer
65 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
2
votes
2answers
490 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 $...
1
vote
0answers
97 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 ...
10
votes
3answers
1k 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 ...
2
votes
2answers
756 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
1answer
172 views

Meaning of this minimal python and FEniCS based wave propagation code? [closed]

This is a question about understanding a piece of random code that does not necessarily require knowledge of it's theory. This is very specific and may not be of use to the community in general but ...
0
votes
2answers
142 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
1answer
177 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
0answers
206 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
0answers
128 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/ ...
0
votes
0answers
119 views

What does a negative time stepping mean? (Adaptive time stepping)

Summary behind the problem: The following code aims at solving a static elasto-plastic problem. Like a 2D square mesh based on an elasto-plastic constitutive model like Von-Mises or Drucker-Prager ...
2
votes
0answers
97 views

an ideal fluid in a reservoir

Let us imagine that we have an ideal fluid in a reservoir, not full, which means there is a free surface of an ideal fluid on top, this reservoir makes no movements. This problem mathematical ...
1
vote
0answers
83 views

Need suggestions on how to implement this time stepping for wave equation

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 ...
2
votes
0answers
571 views

FEniCS: both normal and shear stress boundary conditions for elasticity? [closed]

I would like to have both the normal (xx) component and shear (xy) component of a 2D (stress) tensor defined on a boundary (y=const, for instance) for an equation which is of the type $$ \nabla \cdot ...
1
vote
1answer
192 views

FENICS subdomains - restriction/ prolongation operators

I am trying to implement my own multigrid method in fenics. Is there any "smart/ fenics" way how to assemble subdomains and obtain restriction/ prolongation operators ? Thanks!
0
votes
0answers
414 views

generalized eigenvalue problem, SLEPcEigenSolver no eigenvalues with negative reals

We are working on the model of a kinematic fluid dynamo in FEniCS. It tries to explore whether a magnetic field can be excited if a conducting fluid flows with a certain velocity field through some ...
3
votes
0answers
118 views

Petrov-Galerkin enrichment method for Darcy equation

I was reading about Petrov-Galerkin Enrichment Method for Darcy equations. Here are a couple papers that discuss this in detail: A Petrov–Galerkin enriched method: A mass conservative finite element ...
1
vote
1answer
212 views

Please explain the meaning of these Boundary conditions [closed]

I am trying to learn Gmsh and Fenics and was looking at an example which shows the application of Boundary conditions on a simple Poisson problem. Here is the link: http://fenicsproject.org/...
7
votes
2answers
266 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 ...
1
vote
0answers
303 views

Stationary 2D/3D Navier-Stokes source code

Trying to solve stationary Navier-Stokes problem for incompressible laminar Newtonian fluid. I've found a couple solutions for instationary Navier-Stokes equations (like FeniCS examples or CFD Python)...
2
votes
1answer
354 views

Filling out a mesh (for Fenics FEM)

I have been using Fenics to model some simple electrostatic problems, but now I need to simulate more complicated geometries. Assuming I have created a mesh of several objects, and know their ...
4
votes
0answers
892 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 ...
1
vote
0answers
185 views

4th order tensor [closed]

I'm new with FEniCS and Python and I'm stuck with this issue: is there a way to write a 4th order tensor in an easy way to implement? I have to compute the following stiffnes tensor: $A_{ijkl}= \...
1
vote
0answers
493 views

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

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: ...
3
votes
0answers
377 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 ...
3
votes
1answer
411 views

Recommendations on FEM software for implementing Nitsche's method on interfaces between matching meshes?

Suppose: I have two domains, $\Omega_{1} = [0, 1/2] \times [0, 1]$ and $\Omega_{2} = [1/2, 1] \times [0, 1]$. The domains share an interface $\Gamma = \{1/2\} \times [0, 1] = \partial\Omega_{1} \cap \...
1
vote
1answer
426 views

Tensor notation in fenics [closed]

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: ...
3
votes
2answers
489 views

Integrating an Ordinary Differential Equation over a domain in Finite Element Methods

I'm trying to get a deeper understanding of the Finite Element Method (FEM) to better understand what I do in COMSOL and FEniCS. The sketch below shows the problem that I want to solve in FEM. The ...
1
vote
1answer
566 views

Basic Finite Element Method (FEM) question: assembly and re-assembly

I'm reading up on the Finite Element Method (in 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 ...
1
vote
1answer
420 views

PETSc Krylov Subspace and nullspace

How is the nullspace correction implemented in the PETSc conjugate gradient solver? I searched the source code and documentation, but could not find references on the actual implementation. For ...
3
votes
1answer
960 views

weak formulation of coupled pdes for fenics

I am trying to implement the following system of time-dependent, coupled nonlinear pdes in FEniCS: $$\partial_{t}\rho+2\left(\nabla\rho\nabla\phi+\rho\nabla^{2}\phi\right)+2\sigma\rho\left(\rho-1\...
1
vote
1answer
1k views

time-dependent nonlinear pde in fenics

I am interesting in solving the following nonlinear, time-dependent pde in 2 spatial dimensions (complex Gross-Pitaevskii eq): $$i \frac{\partial \psi}{\partial t} = \left[ -\nabla^2 + (1-i \sigma)(|\...
0
votes
1answer
876 views

defining subdomains in FEniCS (Python) using obtained (solved) variable [closed]

I'd very much appreciate if you could help me out with this as I think I'm missing something simple out or should be using alternate syntax: I am running the following Python code in FEniCS, where I ...
3
votes
2answers
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 ...
3
votes
2answers
104 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. $$ ...
3
votes
1answer
439 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. ...
4
votes
2answers
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->...
6
votes
1answer
1k 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 ...
4
votes
1answer
136 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 ...
3
votes
2answers
788 views

Flux across a non-boundary line segment in FEniCS

I am solving an elliptic boundary value problem on a subset of the rectangle [-1,1]x[-1,1]. The domain contains the line segment x=0, however this does not need to be a part of the boundary, so it is ...
14
votes
2answers
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 ...
2
votes
1answer
353 views

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 ...
6
votes
0answers
577 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, ...
0
votes
2answers
130 views

Speed up DG FunctionSpace evalutation [closed]

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 ...
1
vote
2answers
816 views

How can I build a mesh with holes for use in FEniCS?

This is my first time using FEniCS. I am trying to solve an elliptic PDE, fairly similar to the Laplace equation, on a rectangle with two holes in it. The holes are level sets of an energy function, ...
9
votes
2answers
2k views

Discontinuous Galerkin / Poisson / Fenics

I am trying to solve the 2D Poisson equation using the Discontinuous Galerkin method (DG) and the following discretization (I have a png file but I am not allowed to upload it, sorry): Equation : $$\...