[CIG-SHORT] Matlab HDF5 file, Use Coordinates and Topology to build the domain

Li, Teng tengli2 at illinois.edu
Tue Oct 17 23:09:21 PDT 2017


Hi Brad,

Thanks for your reply. 

And I tried to use Matlab patch function to make a 2d color plot of the whole domain. The input includes x coordinate, y coordinate, and topology. However, due to the huge amount of cell numbers, the color is always black if I don't zoom in too much. Furthermore, in order to edit edge color, I must have all points data of each cell, not the cell data in h5 file. So I wonder whether there are other ways that we can make a 2d color plot based on the coordinates, topology and cell value data?

Thanks!

Best,
Teng 
Teng Li

Master Candidate in Structures

Department of Civil and Environmental Engineering

University of Illinois at Urbana-Champaign

205 North Mathews Ave, Urbana, IL. 61801

Phone:(217)8196210, Email: tengli2 at illinois.edu



________________________________________
From: CIG-SHORT [cig-short-bounces at geodynamics.org] on behalf of Brad Aagaard [baagaard at usgs.gov]
Sent: Tuesday, October 17, 2017 3:35 PM
To: cig-short at geodynamics.org
Subject: Re: [CIG-SHORT] Matlab HDF5 file, Use Coordinates and Topology to build the domain

The topology (how the vertices are connected into cells) and geometry
(where the vertices are) of the mesh in the HDF5 files are defined by:

geometry/vertices (coordinates of the vertices)
topology/cells (index of vertices in each cell)

You will see that a mesh with 2-D triangular cells has 3 vertices per
cell and each vertex has 2 coordinates (x and y). Likewise, a mesh with
2-D quadrilateral cells has 4 vertices per cell.

So for a 2-D triangular cell with index I, the coordinates of the
vertices are:

vertices[cells[I,0],:]
vertices[cells[I,1],:]
vertices[cells[I,2],:]

Regards,
Brad


On 10/17/2017 01:29 PM, Li, Teng wrote:
> Hi list,
>
> I have a question about showing the model stress in the post processing
> step. I first output stress.vtk files and visualize them in Paraview.
> However, I am not good at using paraview python to post process the
> stress data. So I save the vtk files as csv files. Because the time step
> is 118, so I have 118 csv files. So I need to load each in Matlab and
> process them one by one.
>
> I think a smarter way is to output the stress.h5 file. And I read the
> stress.h5 file and find the following components:
> stress: stress_x, stress_y, stress_z. (2d problem). Coordinates: one row
> for x coordinate, and another for y coordinate. And Topology: each
> column has four numbers, I think it shows which four nodes form a cell.
>
> However, I find that the number of columns in Coordinates and Topology
> are different. So that should mean the coordinates are not for the
> cells. I plan to use pcolor to show the stress. So I need to first build
> the mesh according to the node coordinates and topology. And then I can
> use 3d color plot to show the stress distribution.
>
> Although I can see the model directly in Trelis and Paraview. However, I
> need to build the domain in Matlab to the Coordinates and Topology. And
> then plot the stress of each cell. Can you help me to build the domain
> according to the Coordinates and Topology?
>
> Best,
> Teng
>
>
> Teng Li
>
> Master Candidate in Structures
>
> Department of Civil and Environmental Engineering
>
> University of Illinois at Urbana-Champaign
>
> 205 North Mathews Ave, Urbana, IL. 61801
>
> Phone:(217)8196210, Email: tengli2 at illinois.edu
>
>
>

_______________________________________________
CIG-SHORT mailing list
CIG-SHORT at geodynamics.org
http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-short


More information about the CIG-SHORT mailing list