Using Paraview or Matlab to do calculations with output fields

We are trying to do calculations with the fields output by ASPECT. Does anyone have a Paraview script that does this that we can use to start with? Alternatively, does anyone have a Matlab script that can read in ASPECT’s (vtu) output files?


The hdf5 output is often easier to deal with in other programs.
Some time ago there was discussion and generally positive support for creating a set of example postprocessing scripts. I have some scripts that I could share with you or open a PR with but they’re for a couple of specific use cases

  1. reading 2D model results in MATLAB from hdf5 files
  2. reading 3D spherical geometry model results with python, averaging onto a regular or equispaced mesh and doing spherical harmonic expansions.

I have a script that loads vtu files from a 2D or 3D cartesian geometry into numpy arrays if that would be helpful. I imagine there must also be a way to load numpy arrays into Matlab.

Another option is to output data from Paraview in csv format and load that into Matlab or python.

@maxrudolph - it would be great if you can add those scripts to the repository at some point! I’ve been meaning to add mine as well.

ParaView also has a trace function that tracks all that you do manually and then outputs it as a ParaView python script that you can adapt and then again with pvbatch. It’s under Tools->Start trace and Tools->Stop trace when you’re done.

@jbnaliboff where do you think that these belong in the aspect repository? I see that there is some python/jupyter code on contrib/python. One option would be to move this into a series of subdirectories with a top-level readme file.

Thank alot! We’ll look into some of these options.

@maxrudolph I think in the contrib/python folder is the right place and I agree we should organize this directory into multiple sub-folders with a top-level readme file. In fact a file already exists. The same structure could be implemented for a matlab folder.