Questions tagged [fenics]

FEniCS is an open-source platform for solving partial differential equations .

FEniCS enables users to translate scientific models into finite element code through high-level Python and C++ interfaces.

Resources:

64 questions
0
votes
1 answer

Why do multicolored lines keep appearing on my FEniCS plots?

I'm using FEniCS to solve a basic diffusion-over-time problem as a proof of concept. I am only using a single linear solver, but when I plot my function with pyplot, I get several multicolored lines, any one of which could represent the true…
John Doe
  • 159
  • 1
  • 1
  • 5
0
votes
1 answer

Can't add expressions with different shapes

I am working with mixed formulations in fenics. While running the code it gives me an error: UFLException: Can't add expressions with different shapes. I am new to fenics. Can anyone help me in this The complete code is mesh =…
0
votes
1 answer

Problem of C++ compilation with Expression()

I am a beginner in fenics and I am trying to resolve Poisson equation with a boundary condition which is a Perlin noise generated by opensimplex, a Python library. I'm trying to define f, the boundary condition by Expression(). I tried…
0
votes
1 answer

" ArityMismatch: Adding expressions with non-matching form arguments () vs ('v_1',) " using FEniCS

I want to solve a continuum mechanics problem thanks to FEniCS. I apply pressure and take into account the weight. But when I add the thermoelasticity component, it doesn't work anymore. Here is my code : from dolfin import * from fenics import…
MEGalex
  • 1
  • 1
0
votes
1 answer

RuntimeError using FEniCS

I'm trying to solve a continuum mechanics problem using FEniCS. I want to calculate the displacement field u in a certain case. Here is my code : from dolfin import * from fenics import * import matplotlib.pyplot as plt mesh =…
MEGalex
  • 1
  • 1
0
votes
0 answers

Can I run docker packaged software without root on podman/docker?

I've read that docker is not really meant as a way to package a program to deliver to end users, but this seems to be done a lot. There are various pieces of software that I would like to run that have only two alternatives: build from source, or…
argentum2f
  • 4,842
  • 2
  • 25
  • 30
0
votes
1 answer

Docker and anaconda and how to work with both

It looks like the fenics library can only be installed in Windows through Docker. I have never used Docker before, and I am really uncomfortable deviating from my usual habits using anaconda. In particular, I really like to be able to separate my…
user32882
  • 5,094
  • 5
  • 43
  • 82
0
votes
1 answer

Is that way of writing/reading a solution safe?

I need to store a solution of expensive FEM calculation to use it in further analysis. Browsing through tutorials I have so far discovered, that I may store my results like this: from fenics import * mesh = Mesh('mesh/UnitSquare8x8.xml') V =…
abukaj
  • 2,582
  • 1
  • 22
  • 45
0
votes
3 answers

Failed to import module found in cache

I am having a problem with a code I am running which uses a library called fenics. It runs fine on one machine but on another we get the following error: I have no idea how to attempt to solve this and am looking for tips as to what might be going…
SomeRandomPhysicist
  • 1,531
  • 4
  • 19
  • 42
0
votes
1 answer

Setting colorbar bounds with only plt.colorbar()

So I'm plotting a solution to PDE with a program called fenics that has its own plot function. I can get the colorbar with plt.colorbar, how can I call it with fixed bounds such that the lower bound and upper bounds will always be the same…
Eigenvalue
  • 1,093
  • 1
  • 14
  • 35
0
votes
1 answer

Julia language FEniCS periodic boundary condition

I would like to apply a periodic boundary condition in FEniCS for Julia language but all examples I have found are in either C++ or Python. How to create a periodic boundary condition using Julia? It seems difficult because Julia does not have…
maxsieg
  • 25
  • 3
0
votes
1 answer

FEniCS: evaluate gradient of function at point

Let u be the solution to a given problem solved using FEniCS, on a function space V from fenics import * ... u = Function(V) solve(a==L, u, bcs) and x be a Point object. How do I evaluate the gradient of u at x ? I tried g =…
usernumber
  • 1,958
  • 1
  • 21
  • 58
0
votes
2 answers

Run sequential commands in Python with subprocess

hope you can help. I need, in my Python script, to run the software container Docker with a specific image (Fenics in my case) and then to pass him a command to execute a script. I've tried with subprocess: cmd1 = 'docker exec -ti -u fenics…
SnowyNe
  • 31
  • 2
  • 10
0
votes
0 answers

Run Fenics in Maya (Python)

I need to use a script in Maya that uses the Fenics Project libraries. Is there a way to do it? Now I'm using Docker (out of Maya) and import the results in Maya, but I'd want to run the script from Maya itself
SnowyNe
  • 31
  • 2
  • 10
0
votes
1 answer

Normalize function in fenics

I have a function in fenics which is defined on product function space (for real and imaginary parts). Now I want to compute the integral of this function over the domain. I have no glue how this should work. And I am not able to find something in…
zodiac
  • 291
  • 2
  • 15