# I/O

**URL:** https://fenicsproject.discourse.group/c/i-o/7.md?page=1

[Latest](https://fenicsproject.discourse.group/latest.md) · [Categories](https://fenicsproject.discourse.group/categories.md) · [Tags](https://fenicsproject.discourse.group/tags.md)

**Page:** 2

---

## [Error when reading Gmsh mesh with overlapping physical groups](https://fenicsproject.discourse.group/t/error-when-reading-gmsh-mesh-with-overlapping-physical-groups/16186)

<div class="topic-metadata">

**Author:** [@Puk](https://fenicsproject.discourse.group/u/Puk)\
**Replies:** 6\
**Last updated:** [November 4, 2024, 1:22am UTC](https://fenicsproject.discourse.group/t/error-when-reading-gmsh-mesh-with-overlapping-physical-groups/16186 "2024-11-04T01:22:13Z")

</div>

I’m trying to use physical groups for various different materials, as well as regions with a non-zero source term in Poisson’s equation. Consequently, regions with a source term are part of multiple physical groups. Howe…

---

## [Read xdmf file to do pyvista visualizations](https://fenicsproject.discourse.group/t/read-xdmf-file-to-do-pyvista-visualizations/16112)

<div class="topic-metadata">

**Author:** [@renol-kth](https://fenicsproject.discourse.group/u/renol-kth)\
**Replies:** 4\
**Last updated:** [October 31, 2024, 12:38pm UTC](https://fenicsproject.discourse.group/t/read-xdmf-file-to-do-pyvista-visualizations/16112 "2024-10-31T12:38:57Z")

</div>

Dear community, similar questions on the forum there have been several questions on how to read xdmf files (that store fenicsx functions and meshes) in order to visualize them in pyvista. With this I mean creating a plo…

---

## [Physical Curves and Points from gmsh](https://fenicsproject.discourse.group/t/physical-curves-and-points-from-gmsh/16064)

<div class="topic-metadata">

**Author:** [@bay\_swiss](https://fenicsproject.discourse.group/u/bay_swiss)\
**Replies:** 5\
**Last updated:** [October 24, 2024, 8:14am UTC](https://fenicsproject.discourse.group/t/physical-curves-and-points-from-gmsh/16064 "2024-10-24T08:14:31Z")

</div>

Good morning everyone, I am aware that the dolfinx.io.gmshio functions model\_to\_mesh and read\_from\_mesh return (only) the triplet (mesh, cell\_tags, facet\_tags), but I was wondering if there was an easy way to retrieve t…

---

## [3D cross section of pyvista video/gif](https://fenicsproject.discourse.group/t/3d-cross-section-of-pyvista-video-gif/16019)

<div class="topic-metadata">

**Author:** [@renol-kth](https://fenicsproject.discourse.group/u/renol-kth)\
**Replies:** 3\
**Last updated:** [October 22, 2024, 2:18pm UTC](https://fenicsproject.discourse.group/t/3d-cross-section-of-pyvista-video-gif/16019 "2024-10-22T14:18:16Z")

</div>

I would like to use Pyvista for creating a gif/video of a time-dependent FEM solution on a 3D domain. To see the interior, i would like to create a cross section. I managed to create a video of the solution without cr…

---

## [Checkpointing with mixed function spaces](https://fenicsproject.discourse.group/t/checkpointing-with-mixed-function-spaces/15739)

<div class="topic-metadata">

**Author:** [@davidbhatt](https://fenicsproject.discourse.group/u/davidbhatt)\
**Replies:** 0\
**Last updated:** [September 6, 2024, 12:44pm UTC](https://fenicsproject.discourse.group/t/checkpointing-with-mixed-function-spaces/15739 "2024-09-06T12:44:21Z")

</div>

Hi, I am trying to modify the original checkpointing for mixed function spaces. The code is # # Writing a function checkpoint # In the previous sections, we have gone in to quite some detail as to how # to store meshe…

---

## [Can't write DG0 time data to VTX](https://fenicsproject.discourse.group/t/cant-write-dg0-time-data-to-vtx/14786)

<div class="topic-metadata">

**Author:** [@mpierre](https://fenicsproject.discourse.group/u/mpierre)\
**Replies:** 5\
**Last updated:** [September 3, 2024, 7:50am UTC](https://fenicsproject.discourse.group/t/cant-write-dg0-time-data-to-vtx/14786 "2024-09-03T07:50:48Z")

</div>

I can’t seem to write the time evolution of a DG0 function with VTXWriter. The values always stay the same for all time steps. This doesn’t occur with other interpolations (I tested CG1 and DG1 so far). Here is a MWE to …

---

## [Cannot read vertex data/attributes from .xdmf](https://fenicsproject.discourse.group/t/cannot-read-vertex-data-attributes-from-xdmf/15293)

<div class="topic-metadata">

**Author:** [@APFM](https://fenicsproject.discourse.group/u/APFM)\
**Replies:** 1\
**Last updated:** [August 25, 2024, 5:55pm UTC](https://fenicsproject.discourse.group/t/cannot-read-vertex-data-attributes-from-xdmf/15293 "2024-08-25T17:55:09Z")

</div>

I have an external program which exports a 3D pipe mesh as an xdmf file by constructing it manually and exporting with meshio, and a dolfinx program which reads this file and performs a finite element method on it. In th…

---

## [Save MeshFunction in parallel with parameters\['ghost\_mode'\] = 'shared\_facet'](https://fenicsproject.discourse.group/t/save-meshfunction-in-parallel-with-parameters-ghost-mode-shared-facet/15554)

<div class="topic-metadata">

**Author:** [@HenrySuen](https://fenicsproject.discourse.group/u/HenrySuen)\
**Replies:** 5\
**Last updated:** [August 16, 2024, 12:01pm UTC](https://fenicsproject.discourse.group/t/save-meshfunction-in-parallel-with-parameters-ghost-mode-shared-facet/15554 "2024-08-16T12:01:04Z")

</div>

When I try to save a MeshFunction with MPI with parameters\['ghost\_mode'\] = 'shared\_facet' it gives me some error. May I know how to solve this? and what is the problem here? I am using dolfin 2018.2.0. from dolfin impo…

---

## [Error in PVD file writing associated with projection](https://fenicsproject.discourse.group/t/error-in-pvd-file-writing-associated-with-projection/15324)

<div class="topic-metadata">

**Author:** [@fpradelli](https://fenicsproject.discourse.group/u/fpradelli)\
**Replies:** 3\
**Last updated:** [July 25, 2024, 11:22am UTC](https://fenicsproject.discourse.group/t/error-in-pvd-file-writing-associated-with-projection/15324 "2024-07-25T11:22:28Z")

</div>

Hi everyone, I experienced a wierd issue with PVD writing using legacy FEniCS. Running multiple simulations in a for cycle, I noticed that pvd files are not saved correctly after the first iteration (i.e., the first sim…

---

## [Read meshtag from xdmf created by \<mesh generation with gmsh\>](https://fenicsproject.discourse.group/t/read-meshtag-from-xdmf-created-by-mesh-generation-with-gmsh/15302)

<div class="topic-metadata">

**Author:** [@MushishiYako](https://fenicsproject.discourse.group/u/MushishiYako)\
**Replies:** 2\
**Last updated:** [July 20, 2024, 9:26am UTC](https://fenicsproject.discourse.group/t/read-meshtag-from-xdmf-created-by-mesh-generation-with-gmsh/15302 "2024-07-20T09:26:39Z")

</div>

Hello, my dolfinx version is 0.8.0 import dolfinx print(dolfinx.\_\_version\_\_) I use gmsh to create a 2D model. And save the model in xdmf file. But the facets\_tags can’t be read. Here is a example based on dolfinx 0.8.…

---

## [Does XDMF read\_checkpoint avaliable in DOLFINX](https://fenicsproject.discourse.group/t/does-xdmf-read-checkpoint-avaliable-in-dolfinx/14452)

<div class="topic-metadata">

**Author:** [@WjjSteve](https://fenicsproject.discourse.group/u/WjjSteve)\
**Replies:** 5\
**Last updated:** [July 2, 2024, 7:12am UTC](https://fenicsproject.discourse.group/t/does-xdmf-read-checkpoint-avaliable-in-dolfinx/14452 "2024-07-02T07:12:39Z")

</div>

Hello, I want to use XDMF file to store my dolfinx::fem:::function, and use is later, but I couldn’t find any functions similar to read\_checkpoint like legacy\_DOLFIN in this page DOLFINx XDMF. Does anyone know what fun…

---

## [One xdmf file or many xdmf files?](https://fenicsproject.discourse.group/t/one-xdmf-file-or-many-xdmf-files/15112)

<div class="topic-metadata">

**Author:** [@bo-qian](https://fenicsproject.discourse.group/u/bo-qian)\
**Replies:** 0\
**Last updated:** [July 1, 2024, 8:51am UTC](https://fenicsproject.discourse.group/t/one-xdmf-file-or-many-xdmf-files/15112 "2024-07-01T08:51:32Z")

</div>

My fenics version is 2019.\*\*, and I use it for solving CH equation, AC equation and etc. Now I have a question, Should I create a total xdmf file before the loop starts, then store the results of each time step into thi…

---

## [Vtu or xdmf, How to choose output file format?](https://fenicsproject.discourse.group/t/vtu-or-xdmf-how-to-choose-output-file-format/15107)

<div class="topic-metadata">

**Author:** [@bo-qian](https://fenicsproject.discourse.group/u/bo-qian)\
**Replies:** 4\
**Last updated:** [June 30, 2024, 12:48pm UTC](https://fenicsproject.discourse.group/t/vtu-or-xdmf-how-to-choose-output-file-format/15107 "2024-06-30T12:48:22Z")

</div>

Recently I got a question about output result files, the original output file format which I choose is vtu, but I found that xdmf is more faster than vtu, so I changed the format to xdmf. Then these days I encountered an…

---

## [Initializing mesh and function from a file (read sequentially)](https://fenicsproject.discourse.group/t/initializing-mesh-and-function-from-a-file-read-sequentially/14383)

<div class="topic-metadata">

**Author:** [@R\_Tavakoli](https://fenicsproject.discourse.group/u/R_Tavakoli)\
**Replies:** 9\
**Last updated:** [June 23, 2024, 9:28am UTC](https://fenicsproject.discourse.group/t/initializing-mesh-and-function-from-a-file-read-sequentially/14383 "2024-06-23T09:28:56Z")

</div>

I require to read mesh and initial conditions from a file which is generated by another code (outside of FEniCSX). If I write them in a xdmf format, to read mesh is trivial, however, reading function to initialize fields…

---

## [Saving vector function with length greater than the geometrical dimension](https://fenicsproject.discourse.group/t/saving-vector-function-with-length-greater-than-the-geometrical-dimension/14752)

<div class="topic-metadata">

**Author:** [@mpierre](https://fenicsproject.discourse.group/u/mpierre)\
**Replies:** 5\
**Last updated:** [May 22, 2024, 8:44pm UTC](https://fenicsproject.discourse.group/t/saving-vector-function-with-length-greater-than-the-geometrical-dimension/14752 "2024-05-22T20:44:23Z")

</div>

I’m trying to write vector-valued functions to view into Paraview, where the vector has a length that is not the geometrical dimension. It appears that using VTK or VTX, writing a function with shape (n,) results in X, Y…

---

## [Save both CG and DG functions to the same file for Paraview](https://fenicsproject.discourse.group/t/save-both-cg-and-dg-functions-to-the-same-file-for-paraview/14702)

<div class="topic-metadata">

**Author:** [@mpierre](https://fenicsproject.discourse.group/u/mpierre)\
**Replies:** 3\
**Last updated:** [May 21, 2024, 11:55am UTC](https://fenicsproject.discourse.group/t/save-both-cg-and-dg-functions-to-the-same-file-for-paraview/14702 "2024-05-21T11:55:24Z")

</div>

Hello everyone, In legacy FEniCS, using XDMFFile it was possible to save both CG and DG functions in a single XDMF file for visualization in Paraview. This was handy for instance in mechanics to view the stress (DG) in …

---

## [Average value of solution across boundary of mesh](https://fenicsproject.discourse.group/t/average-value-of-solution-across-boundary-of-mesh/7728)

<div class="topic-metadata">

**Author:** [@CoE2845](https://fenicsproject.discourse.group/u/CoE2845)\
**Replies:** 3\
**Last updated:** [May 18, 2024, 1:53pm UTC](https://fenicsproject.discourse.group/t/average-value-of-solution-across-boundary-of-mesh/7728 "2024-05-18T13:53:35Z")

</div>

Hi everyone, I am currently trying to find the average value of my solution Temp across the surface of my 2D mesh. But I am unsure how I can accomplish this. Here is the example I have so far: from \_\_future\_\_ import p…

---

## [Phase Field Fracture](https://fenicsproject.discourse.group/t/phase-field-fracture/7476)

<div class="topic-metadata">

**Author:** [@Caio\_Cesar](https://fenicsproject.discourse.group/u/Caio_Cesar)\
**Replies:** 33\
**Last updated:** [May 2, 2024, 12:50am UTC](https://fenicsproject.discourse.group/t/phase-field-fracture/7476 "2024-05-02T00:50:52Z")

</div>

Dear community, I am using the following code for a research, but I did not understant how read and check the results in Paraview. Can someone help me? The code was made by Hirshikesh, S. Natarajan, R. K. Annabattula,…

---

## [Is it possible to read .xdmf files generated by legacy\_DOLFIN in DOLFINx](https://fenicsproject.discourse.group/t/is-it-possible-to-read-xdmf-files-generated-by-legacy-dolfin-in-dolfinx/14415)

<div class="topic-metadata">

**Author:** [@WjjSteve](https://fenicsproject.discourse.group/u/WjjSteve)\
**Replies:** 1\
**Last updated:** [April 24, 2024, 4:26pm UTC](https://fenicsproject.discourse.group/t/is-it-possible-to-read-xdmf-files-generated-by-legacy-dolfin-in-dolfinx/14415 "2024-04-24T16:26:13Z")

</div>

Hello, I wonder that if I have store my function generated by legacy\_DOLFIN in .xdmf file, can I load this function in DILFINX, since this file type seems to work for both of them. I have run some simulation using lega…

---

## [Adios4dolfinx misreads written function](https://fenicsproject.discourse.group/t/adios4dolfinx-misreads-written-function/14414)

<div class="topic-metadata">

**Author:** [@Ekrem\_Ekici](https://fenicsproject.discourse.group/u/Ekrem_Ekici)\
**Replies:** 1\
**Last updated:** [April 24, 2024, 2:26pm UTC](https://fenicsproject.discourse.group/t/adios4dolfinx-misreads-written-function/14414 "2024-04-24T14:26:14Z")

</div>

Hi, I am trying to solve wave equation using a mesh generated with gmsh. When adios reads the exported function, it mismatches with the solution. Here is MWE; from ufl import FiniteElement, Measure, inner, grad, TrialF…

---

## [Load mesh in DOLFINx using the C++ API](https://fenicsproject.discourse.group/t/load-mesh-in-dolfinx-using-the-c-api/14350)

<div class="topic-metadata">

**Author:** [@mcroci](https://fenicsproject.discourse.group/u/mcroci)\
**Replies:** 4\
**Last updated:** [April 22, 2024, 10:28am UTC](https://fenicsproject.discourse.group/t/load-mesh-in-dolfinx-using-the-c-api/14350 "2024-04-22T10:28:30Z")

</div>

How can I load a gmsh-generated mesh into DOLFINx in C++? Happy to convert the mesh file if it makes it easier.

---

## [Is it allowed to have two xdmf files, one for visualization the other for checkpoint, they will be written at different times](https://fenicsproject.discourse.group/t/is-it-allowed-to-have-two-xdmf-files-one-for-visualization-the-other-for-checkpoint-they-will-be-written-at-different-times/14362)

<div class="topic-metadata">

**Author:** [@Mingming\_Zhang](https://fenicsproject.discourse.group/u/Mingming_Zhang)\
**Replies:** 1\
**Last updated:** [April 22, 2024, 4:55am UTC](https://fenicsproject.discourse.group/t/is-it-allowed-to-have-two-xdmf-files-one-for-visualization-the-other-for-checkpoint-they-will-be-written-at-different-times/14362 "2024-04-22T04:55:24Z")

</div>

Hi All, I’m wondering if it is possible to have two independent xdmf files, one for visualization the other for checkpoint. For long simulations, we could store xdmf and corresponding data (.h5 file) say every 25 steps …

---

## [Save Solution as variable](https://fenicsproject.discourse.group/t/save-solution-as-variable/4786)

<div class="topic-metadata">

**Author:** [@Nico\_Su](https://fenicsproject.discourse.group/u/Nico_Su)\
**Replies:** 40\
**Last updated:** [April 17, 2024, 7:27pm UTC](https://fenicsproject.discourse.group/t/save-solution-as-variable/4786 "2024-04-17T19:27:58Z")

</div>

Hi, quick question. I want to calculate a coupled system and i need the derivative of the solution of a previous calculated variational problem as the boundary condition for the next equation. Is there a fast way to sav…

---

## [Write mixed element function to files](https://fenicsproject.discourse.group/t/write-mixed-element-function-to-files/12837)

<div class="topic-metadata">

**Author:** [@jegor.kravchenko](https://fenicsproject.discourse.group/u/jegor.kravchenko)\
**Replies:** 15\
**Last updated:** [April 17, 2024, 4:23pm UTC](https://fenicsproject.discourse.group/t/write-mixed-element-function-to-files/12837 "2024-04-17T16:23:08Z")

</div>

Hello, I’m working with a mixed element function space. I use a simple Taylor Hood element with second order interpolation for velocity and first order for pressure. Issues arise when I try to write a function from the …

---

## [Inner product of the strain field with a fourth order tensor](https://fenicsproject.discourse.group/t/inner-product-of-the-strain-field-with-a-fourth-order-tensor/9910)

<div class="topic-metadata">

**Author:** [@dries](https://fenicsproject.discourse.group/u/dries)\
**Replies:** 11\
**Last updated:** [December 17, 2022, 4:52pm UTC](https://fenicsproject.discourse.group/t/inner-product-of-the-strain-field-with-a-fourth-order-tensor/9910 "2022-12-17T16:52:08Z")

</div>

Hello, How can I perform the inner product of the strain field with a fourth order tensor? from dolfin import \* import numpy mesh = Mesh('mesh.xml') # Define Space V = FunctionSpace(mesh, 'CG', 1) W = VectorFunctionS…

---

## [Implementing Programmable Filter ParaView in PyVista](https://fenicsproject.discourse.group/t/implementing-programmable-filter-paraview-in-pyvista/14135)

<div class="topic-metadata">

**Author:** [@ppr](https://fenicsproject.discourse.group/u/ppr)\
**Replies:** 2\
**Last updated:** [April 5, 2024, 4:01pm UTC](https://fenicsproject.discourse.group/t/implementing-programmable-filter-paraview-in-pyvista/14135 "2024-04-05T16:01:24Z")

</div>

Dear FEniCSx Users, I am trying to port some Fenics Legacy 2019 code (from now on old code) into Fenicsx. One of the operations the old code performs is to save the mesh in .pvd format. This is a minimal working exampl…

---

## [Reading xdmf file from FEniCSx with python is not working](https://fenicsproject.discourse.group/t/reading-xdmf-file-from-fenicsx-with-python-is-not-working/11261)

<div class="topic-metadata">

**Author:** [@psj1866](https://fenicsproject.discourse.group/u/psj1866)\
**Replies:** 6\
**Last updated:** [March 8, 2024, 10:45am UTC](https://fenicsproject.discourse.group/t/reading-xdmf-file-from-fenicsx-with-python-is-not-working/11261 "2024-03-08T10:45:24Z")

</div>

Hello, I am using Paraview (version 5.10.1) to visualize the xdmf file created from the FEniCSx code. Actually, I can visualize my code well if I just load the file by using GUI : However, I am trying to use Python…

---

## [Instability of mesh read with HPC](https://fenicsproject.discourse.group/t/instability-of-mesh-read-with-hpc/13631)

<div class="topic-metadata">

**Author:** [@hermanmak](https://fenicsproject.discourse.group/u/hermanmak)\
**Replies:** 17\
**Last updated:** [February 26, 2024, 12:46pm UTC](https://fenicsproject.discourse.group/t/instability-of-mesh-read-with-hpc/13631 "2024-02-26T12:46:52Z")

</div>

Hi, I installed dolfinx with conda-forge on CentOS 8 on an HPC on Nov 8, 2023 with MPICH. But on this and previous installs I have had a problem with mesh reading when I use many processors spread over multiple nodes. Th…

---

## [Error in trying to write Mixed Elements](https://fenicsproject.discourse.group/t/error-in-trying-to-write-mixed-elements/13482)

<div class="topic-metadata">

**Author:** [@Shoham\_Sen](https://fenicsproject.discourse.group/u/Shoham_Sen)\
**Replies:** 5\
**Last updated:** [February 4, 2024, 8:49am UTC](https://fenicsproject.discourse.group/t/error-in-trying-to-write-mixed-elements/13482 "2024-02-04T08:49:41Z")

</div>

I am solving a nonlinear coupled ODE, with 2 functions u and A and a lagrange multiplier r. I am using Newton Rhapson; I have to control the step size (relaxation parameter) so that the residue doesn’t blow up. This mea…

---

## [Mark each cell and use in integrating over subdomains](https://fenicsproject.discourse.group/t/mark-each-cell-and-use-in-integrating-over-subdomains/13523)

<div class="topic-metadata">

**Author:** [@bagla0](https://fenicsproject.discourse.group/u/bagla0)\
**Replies:** 1\
**Last updated:** [February 6, 2024, 5:58am UTC](https://fenicsproject.discourse.group/t/mark-each-cell-and-use-in-integrating-over-subdomains/13523 "2024-02-06T05:58:43Z")

</div>

Hi, I have a query related to usage of marker for each cell. I have input mesh with 5 subdomains. I have additional information of angle related to each cell (text file with cell#, angle, subdomain\_id). My query is how…

[Previous page](https://fenicsproject.discourse.group/c/i-o/7.md)

[Next page](https://fenicsproject.discourse.group/c/i-o/7.md?page=2)
