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
7
votes
7 answers

Where are saved files in Google Colab located?

I'm trying to access a VTK file where the solution to the heat equation is saved, but I've no idea where it's saved in Colab. from fenics import * import time T = 2.0 # final time num_steps = 50 # number of time steps dt = T /…
Mo Houshmand
  • 115
  • 1
  • 2
  • 12
7
votes
2 answers

Solving the heat equation by FEniCS

I am facing a coding error in FEniCS when I run the heat equation code it’s fail with, error = np.abs(u_e.vector().array() - u.vector().array()) AttributeError: 'dolfin.cpp.la.PETScVector' object has no attribute 'array’ I believe the idea is to…
roby
  • 123
  • 1
  • 3
  • 11
5
votes
2 answers

Error with compiler while trying to run FEniCS example code

I've just tried to install FEniCS on Ubuntu 16.04 and when I try to run the first example code using python3.5 I get the following 2 errors: RuntimeError: Expecting a string or list of strings, not {'slepc_real', 'sz', 'mpi', 'mpi_cxx', 'hdf5',…
Natasha
  • 51
  • 2
4
votes
2 answers

fenics did not show figure . NameError: name interactive is not defined

I installed fenics on windows subsystem for linux to do my homework.I am trying to test fenics. So I use ft01_possion.py on the tutorial. from fenics import * # Create mesh and define function space mesh = UnitSquareMesh(8, 8) V =…
irIdEsdcent
  • 41
  • 1
  • 3
4
votes
1 answer

No module named 'dolfin' using Spyder

I can't, for the life of me, get dolfinrunning with Spyder. That's what I thought at first. I managed to get it running somehow, but not in a convenient way. Here is the situation: The error conda activate fenics, spyder, from dolfin import *: No…
Hannes
  • 73
  • 1
  • 6
2
votes
1 answer

No access to http://0.0.0.0:8000

I am following the directions from https://fenics.readthedocs.io/projects/containers/en/latest/introduction.html . I get: fenics@af86d2c8af46:~$ cd ~/demo/python/documented/poisson fenics@af86d2c8af46:~/demo/python/documented/poisson$ python3…
user5998510
2
votes
0 answers

Dimension of assembled bilinear forms in fenics

I'm new to stackoverflow and fenics. I recently used the env to compute input code for another file. I want to calculate finite elements and save the assembled matrices, say over a rectangle domain D=(-1,1)*(-2,2). I set the number of discretising…
szolo9
  • 21
  • 2
2
votes
0 answers

ModuleNotFoundError: No module named 'fenics'

i'm new to python on Mac and i need to solve PDEs. I saw that Fenics is right for me. When I open Spider and run the program, I get this warning: ModuleNotFoundError: No module named 'fenics' I guess Spider can't find Fenics, but I installed it…
2
votes
1 answer

compatibility problem between FEniCS and Paraview on Mac

I am using FEniCS on mac trough Docker but I have a problem visualizing the result of an analysis using a Paraview version installed on mac. These are the steps I follow: I obtain the solution of my problem using FEniCS; then send the .vtu file that…
Riccardo
  • 43
  • 4
2
votes
1 answer

How to extract the normal vectors at the boundary nodes in gmsh?

I have a geo file for gmsh and mesh it. Then I would like to extract the normal vectors at the nodes of a selected surface. How is this possible? Below is my gmsh geo file. //Construct a cube in GMSH //Build a line Point(1) = {0, 0, 0,…
Marc Frei
  • 21
  • 2
1
vote
0 answers

How can I get PID(s) of a running Jupyter notebook?

I have run several (n) Jupyter notebooks in parallel. As they use FEniCS, each has spawned a number (much more than m - 1) of threads (PIDs) which can occupy all available cores (m). Now I have much more than m * n threads (of at least n…
abukaj
  • 2,582
  • 1
  • 22
  • 45
1
vote
0 answers

Error importing dolfinx using conda: function() argument 'code' must be code, not str

I'm trying to get the latest release of FEniCS (FEniCSx 0.5) running in conda. So far, I have installed it in conda (in an environment that i call "mecanica") using the commands conda create -n mecanica conda activate mecanica conda install -c…
1
vote
1 answer

Python (PyCharm) and Fenics - Installation Problems

I’ve tried to install fenics and use the repository of the paper “Hybrid FEM-NN models: Combining artificial neural networks with the finite element method]” to calculate a linear Physics-Informed Neural Network for a linear problem…
1
vote
1 answer

docker-machine: command not found for Mac

On Mac, I have installed Python version 3.9 and Docker 20.10.6 and following the instructions from https://fenics.readthedocs.io/projects/containers/en/latest/quickstart.html Now installing the FEniCS Docker script works fine but when using the…
user5998510
1
vote
3 answers

How to install fenics in Ubuntu using PIP for a particular python environment?

I want to install fenics in Ubuntu 20. First I made a python environment using: sudo apt install python3-venv Then inside the folder I want to make an environment I open a terminal and use: python3 -m venv myproject myproject is the name of the…
MOON
  • 2,516
  • 4
  • 31
  • 49
1
2 3 4 5