Unable to open .vtu file after Electrostatics tutorial

Numerical methods and mathematical models of Elmer
Post Reply
MrJonaker
Posts: 10
Joined: 12 Jan 2024, 12:24
Antispam: Yes

Unable to open .vtu file after Electrostatics tutorial

Post by MrJonaker »

Hi!

I am trying to run the electrostatics tutorial and it runs with no apparent errors however when I try to open the .vtu file in ParaView I get two errors:

Code: Select all

ERROR: In ./VTK/IO/XMLParser/vtkXMLParser.cxx, line 375
vtkXMLDataParser (0x555baebde070): Error parsing XML in stream at line 25, column 0, byte index 1162: not well-formed (invalid token)

ERROR: In ./VTK/IO/XML/vtkXMLReader.cxx, line 521
vtkXMLUnstructuredGridReader (0x555bb23cc3c0): Error parsing input file.  ReadXMLInformation aborting.
I have downloaded the elstatics.sif file and the elmesh.grd file directly from GitHub and ran

Code: Select all

ElmerGrid 1 2 elmesh.grd
with:

Code: Select all


Starting program Elmergrid, compiled on Mar 15 2024
Elmergrid reading in-line arguments
Output will be saved to file elmesh.

Elmergrid loading data:
-----------------------
Loading the geometry from file 'elmesh.grd'.
Loading ElmerGrid file version: 210903
Defining the coordinate system (2-DIM).
Loading 4 subcell limits in X-direction
Loading 4 subcell limits in Y-direction
Loading material structure
LoadElmergrid: materials interval is [1,3]
Loading boundary conditions
Found 6 boundaries
Loading minimum number of elements
Reached the end of command file
Found 1 divisions for grid

Loading ElmerGrid commands from file 'elmesh.grd'.
Reached the end of command file
Read commands from a file

Elmergrid creating and manipulating meshes:
-------------------------------------------
5 cells were created.
Numbered 852 knots in 766 4-node elements.
Numbering order was <x><y> and max levelwidth 37.
10 element sides between materials 2 and -4 were located to type 1.
22 element sides between materials 2 and -3 were located to type 2.
22 element sides between materials 2 and -1 were located to type 3.
34 element sides between materials 0 and -3 were located to type 4.
34 element sides between materials 0 and -1 were located to type 5.
19 element sides between materials 3 and 1 were located to type 6.
Coordinates defined in 2 dimensions
Created 24 divisions in 2 cells for rotation [1.5  1e+06].
Maximum elementtype 404 extruded to type 808.
Allocated for 11 new BC lists
Extruded mesh has 14208 elements in 24 levels.
Simple extrusion would have 18384 elements
Rectangular geometry with r1=1.5 for 21300 nodes.
2154/21300 candidates for duplicate nodes.
Found 252 double nodes in 2318781 tests.
Eliminated 874 nodes from topology.
Extruded BCs list 0 of types [1,1] has 120 elements.
Extruded BCs list 1 of types [2,2] has 528 elements.
Extruded BCs list 2 of types [3,3] has 528 elements.
Extruded BCs list 3 of types [4,4] has 672 elements.
Extruded BCs list 4 of types [5,5] has 672 elements.
Extruded BCs list 5 of types [6,6] has 456 elements.
Layer BCs list 6 of types [7,7] has 120 elements.
Symmetry BCs list 7 of type 8 has 766 elements.
Symmetry BCs list 8 of type 9 has 766 elements.
21300 original nodes moved to 16620 new ones.
Reordering 16620 knots and 14208 elements in 3-dimensions.
Ordering with (1*x + 1*y + 1e+04*z)
Moving knots to new positions
Moving the elements to new positions
Moving the parents of the boundary nodes.
Indexwidth of the new node order is 782.
Cylindrical coordinate for r1=1.5 and r2=1e+06.
Maximum boundary type is 9
Separating 1 rectangular boundaries from boundary 5.
Separating 1 rectangular boundaries from boundary 6.
Created 14208 elements and 16620 nodes by rotation of 90 degrees.

Elmergrid saving data with method 2:
-------------------------------------
Saving mesh in ElmerSolver format to directory elmesh.
Saving 16620 coordinates to mesh.nodes.
Saving 14208 element topologies to mesh.elements.
Saving boundary elements to mesh.boundary.
Saving header info to mesh.header.

Thank you for using Elmergrid!
Send bug reports and feature wishes to elmeradm@csc.fi
After which I ran:

Code: Select all

ElmerSolver elstatics.sif
which produced this:

Code: Select all

ELMER SOLVER (v 9.0) STARTED AT: 2024/03/18 10:28:58
ParCommInit:  Initialize #PEs:            1
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: unknown, Compiled: 2024-03-15)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN:  HYPRE library linked in.
MAIN:  MUMPS library linked in.
MAIN:  Lua interpreter linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: elstatics.sif
LoadInputFile: Scanning input file: elstatics.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: elstatics.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 2
LoadInputFile: Number of Body Forces: 0
LoadInputFile: Number of Initial Conditions: 0
LoadInputFile: Number of Materials: 1
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 3
LoadInputFile: Number of Bodies: 1
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by area
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by volume
ElmerAsciiMesh: Base mesh name: ./elmesh
LoadMesh: Elapsed REAL time:     0.0424 (s)
MAIN: -------------------------------------
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: elstatics
OptimizeBandwidth: Initial bandwidth for stat elec solver: 783
OptimizeBandwidth: Optimized bandwidth for stat elec solver: 963
OptimizeBandwidth: Bandwidth optimization rejected, using original ordering.
MAIN: Number of timesteps to be saved: 1
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
StatElecSolver: -------------------------------------
StatElecSolver: Electrostatics solver:
StatElecSolver: -------------------------------------
StatElecSolver:  Assembly (s)          :  0.17827700000000002
      10 0.4211E-03
      20 0.2119E-06
      21 0.8143E-07
ComputeChange: NS (ITER=1) (NRM,RELC): (  590598.95      2.0000000     ) :: stat elec solver
StatElecSolver:  Solve (s)             :  0.42898899999999995
StatElecSolver:  Result Norm   :    590598.95112780191
StatElecSolver:  Relative Change :    2.0000000000000000
ComputeChange: SS (ITER=1) (NRM,RELC): (  590598.95      2.0000000     ) :: stat elec solver
StatElecForce: Computing electric force on boundaries
StatElecForce: 
StatElecForce: Net electric force  :   -2.416234E-30   1.086261E-30   1.040626E+02
StatElecForce: Resultant force  :    1.040626E+02
ResultOutputSolver: -------------------------------------
ResultOutputSolver: Saving with prefix: elstatics
ResultOutputSolver: Creating list for saving - if not present
CreateListForSaving: Field Variables for Saving
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format
VtuOutputSolver: Saving results in VTK XML format with prefix: elstatics
VtuOutputSolver: Saving number of partitions: 1
ResultOutputSolver: -------------------------------------
SaveScalars: -----------------------------------------
SaveScalars: Saving scalar values of various kinds
SaveScalars: Saving names of values to file: ./scalars.dat.names
SaveScalars: Saving values to file: ./scalars.dat
WARNING:: CompareToReferenceSolution: Solver 1 FAILED:  Norm = 5.90598951E+05  RefNorm = 5.90638626E+05
CompareToReferenceSolution: Relative Error to reference norm: 6.717284E-05
WARNING:: CompareToReferenceSolution: FAILED 1 tests out of 1!
MAIN: *** Elmer Solver: ALL DONE ***
MAIN: The end
SOLVER TOTAL TIME(CPU,REAL):         1.23        1.14
ELMER SOLVER FINISHED AT: 2024/03/18 10:29:00
Trying to open the file in ParaView yields those two mentioned errors and when opening it as a .txt file in xed takes a very long time to load and when it does some of the characters are not ... well characters. I know it is a sin but I have attached a screenshot of part of the .vtu file generated as xed stopped answering.

My system is Linux Mint 21.3:
Kernel: 5.15.0-100-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 6.0.4
tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
base: Ubuntu 22.04 jammy


I will also attach the .sif, .grd and .vtu file. What am I doing wrong here? Based on the weird behaviour of the .vtu file in my text editor it makes me more inclined to believe that has something to do with ElmerSolver and not ParaView but I could (for sure) be wrong. Could it have something to do with character encoding? In January of this year I ran this tutorial on my system. Could there
Attachments
vtu-file.tar.gz
Contains both screenshot and .vtu file
(838.03 KiB) Downloaded 11 times
elmesh.grd
(932 Bytes) Downloaded 6 times
elstatics.sif
(1.73 KiB) Downloaded 7 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Unable to open .vtu file after Electrostatics tutorial

Post by raback »

Hi

This is strange. Nothing has changed in this fore ages. My colleague also had also similar issues with Paraview on Friday.

Looks alot like this thread:
https://discourse.paraview.org/t/i-cann ... t/13938/20

In fact, it does not open for me either (Ubuntu22) . Anybody else having similar issues?

-Peter
MrJonaker
Posts: 10
Joined: 12 Jan 2024, 12:24
Antispam: Yes

Re: Unable to open .vtu file after Electrostatics tutorial

Post by MrJonaker »

Hmm, it looks like it could be a similar issue.

I have ParaView 5.10 and libexpat 2.4.7-1ubuntu3.0 (which is the latest version of the package available on my system) and they are talking about (what at least appears to be) a bug in libexpat 2.6. For someone in the thread downgrading to version 2.5 fixed the issue however I am unable to open the .vtp file

Code: Select all

ERROR: In ./VTK/IO/XMLParser/vtkXMLParser.cxx, line 375
vtkXMLDataParser (0x55af43b62980): Error parsing XML in stream at line 44, column 89, byte index 3064: not well-formed (invalid token)

ERROR: In ./VTK/IO/XML/vtkXMLReader.cxx, line 521
vtkXMLPolyDataReader (0x55af43e2b830): Error parsing input file.  ReadXMLInformation aborting.
And the errors are very similar.

Were you able to run & open the tutorial?
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Unable to open .vtu file after Electrostatics tutorial

Post by raback »

Hi

No, the bug seems to have rolled to me also today. I locally work on a Ubuntu22 virtual machine and there last update in /var/log/apt/history.log is:

Start-Date: 2024-03-18 10:16:54
Commandline: /usr/bin/unattended-upgrade
Upgrade: libexpat1:amd64 (2.4.7-1ubuntu0.2, 2.4.7-1ubuntu0.3), libexpat1-dev:amd64 (2.4.7-1ubuntu0.2, 2.4.7-1ubuntu0.3)
End-Date: 2024-03-18 10:16:54

Files that opened on Friday do not now!

More info here:
https://gitlab.archlinux.org/archlinux/ ... -/issues/4

-Peter
MrJonaker
Posts: 10
Joined: 12 Jan 2024, 12:24
Antispam: Yes

Re: Unable to open .vtu file after Electrostatics tutorial

Post by MrJonaker »

My computer also upgraded those packages over the weekend. I tried to install previous versions of the package but couldn't find them from ubuntu. Do you know a way or do we just need to wait until it is fixed?
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Unable to open .vtu file after Electrostatics tutorial

Post by kevinarden »

Ubuntu jammy
my libxpat was updated 13 March, and everything is working fine,
but I have paraview 5.12

ParaView-5.12.0-RC2-MPI-Linux-Python3.10-x86_64
MrJonaker
Posts: 10
Joined: 12 Jan 2024, 12:24
Antispam: Yes

Re: Unable to open .vtu file after Electrostatics tutorial

Post by MrJonaker »

I downloaded version 5.12 and it works!

Thank you both!
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Unable to open .vtu file after Electrostatics tutorial

Post by raback »

Hi

Thanx for confirming that this is the issue! It is really annoying that an automatic update breaks a code and reverting to previous version of "expat" library is not straight-forward. It is natural to assume that the culprint would be Elmer - as it usually is - but in this is not at all in our hands. I hope this causes so much stir that a fix will be coming soon in some upcoming update.

-Peter
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Unable to open .vtu file after Electrostatics tutorial

Post by raback »

Hi,

Just a note: the ascii output seems to be unaffected by the bug. So setting "Ascii Output = True" in ResultOutputSolver may save the day for some users.

If you face this bug and want to open binary files you should revert to old "expat" library, or install paraview 5.12 with static libraries.

-Peter
Post Reply