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

A warning message was prompted when fenics2019 was used to define material for different subdomains

from fenics import * mesh1 = RectangleMesh(Point(0, 0), Point(1, 1), 10, 10) tol = 1E-14 class Omega_0(SubDomain): def inside(self, x, on_boundary): return x[1] <= 0.5 + tol class Omega_1(SubDomain): def inside(self, x,…
0
votes
0 answers

ModuleNotFoundError: No module named ‘mgis’ in WSL based Ubuntu 22.04

I want to use mgis.fenics python module and I have tried to build it from source using this website and also used git clone https://github.com/thelfer/tfel as mentioned in here and compiled it using the instructions given on tfel installation site.…
0
votes
0 answers

My stable-baselines3 script is interrupted in singularity images and no logs

I try to train a custom environment by stable-baselines3 inside a singularity images.But it is always interrupted by SIGTEM.Here are the informations: Loguru caught a signal: SIGTERM Loguru caught a signal: SIGTERM Loguru caught a signal:…
0
votes
0 answers

Import fenics, no module "fenics" found on python3.6.10

I needed python 3.6.10 for Pymesh2 which i hadn't installed yet. But I am trying to get Fenics to work in this version of python so it can be used concurrently with Pymesh2. I followed this installation:…
ZET
  • 1
0
votes
0 answers

How to plot a 3D mesh from Fenics library using the Python interface?

I am new to Fenics and I am trying to solve some basic pdes, following the examples in the tutorial. I am solving a Poisson equation and my code look the same as the one in the tutorial. However, the 3D mesh is not showing when I run the cell. Could…
0
votes
0 answers

python - FEniCS How do I convert a tensor expression into a scalar expression?

I'm new to FEniCS and optimization. Trying to run my code I receive the Error UFLException: Can't add expressions with different shapes. The Code: from dolfin import * from dolfin_adjoint import * mesh = Mesh("beam.xml") # beam x[0] 0 - 5,…
0
votes
1 answer

Create a mesh with boundary markers in Python, Fenics

My aim is to create a mesh in Python and setting markers on some 1-dimensional subset. Up until now, I have always creates a set, for example a rectangle in gmsh, then put for example a circle in it. Then gmsh puts a mesh on my structure and I can…
user5998510
0
votes
2 answers

How can I install the FeniCS dolfin module?

So I'm trying to install FEniCS from the instructions here. I did the pip3 install fenics-ffc --upgrade inside my virtualenv and it worked but when I try to import dolfin I get a ModuleNotFound error. I'm not sure how to get dolfin installed. I…
0
votes
1 answer

How to save mesh in .msh ASCII 2 format from Gmsh Python api?

I need to save my mesh (created with gmsh python api) in .msh ASCII version 2 format in order to use the command dolfin-convert and import the mesh inside Fenics. From the tutorials, to save the mesh I should use the…
Rbocce
  • 15
  • 3
0
votes
1 answer

How to obtain surfaces tag in Gmsh Python api?

i am trying to generate geometries and meshes with the Python api of Gmsh, planning to use it in FEniCS. I started creating my geometry following the steps reported here: https://jsdokken.com/src/tutorial_gmsh.html The author first create the volume…
Rbocce
  • 15
  • 3
0
votes
0 answers

How to Implement Non-Linear Problem in Firedrake

I am new to firedrake / fenics. I believe I have a relatively simple non-linear toy problem to solve: 1D, 1-component diffusion reaction equation at steady-state. Boundary conditions are no flux at x = 1 and a constant concentration at x = 0. When…
Nick Brady
  • 107
  • 8
0
votes
0 answers

I'm facing an issue with WindSE (a python package that uses a FEniCS backend to perform wind farm simulations and optimization)

I installed successfully WindSE from here, then I tried to run a demo by using the steps below: Quick Demo Instructions: here is the code I wrote and the problems I faced: (base) [root@localhost ~]# conda activate wera (wera) [root@localhost ~]#…
0
votes
0 answers

Install FEniCS to use it within Jupyter Lab

I’m trying to install FEniCS within Jupyter Labs (so I can import the package in my current notebooks by doing simply import fenics), but I’m failing miserably. First I installed it through pip3 install fenics as any other package, and in fact this…
pamgur
  • 83
  • 1
  • 8
0
votes
0 answers

I am having problems installing the openmpi package in the spack installation phase, how can I proceed?

I have problems regarding the configuration and installation phase of openmpi starting from the command: spack install hdf5 for the installation of spack. Keep getting the following output: [...] No patches needed for openmpi ==> openmpi: Executing…
Lorenzo11
  • 1
  • 1
0
votes
1 answer

Invalid Syntax error on addition when running FEniCS in Windows subsystem

I am currently working on a project where we are solving a system of PDE's in FEniCs. I have created the following code in order to solve the system but I get an invalid syntax error on a = a0 + a1 I am not that good in Python and I have never used…
Kate
  • 7
  • 1