Discussion:
[Paraview] Saving as csv data
Li, Teng
2017-10-09 17:16:55 UTC
Permalink
Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu
Utkarsh Ayachit
2017-10-09 18:06:43 UTC
Permalink
Teng,

In your attached VTK file, stress is a cell data i.e. associated with
each of the cells rather than the points. When you export data as CSV
you can only save points along with point data or cells data and not
both. If you want to save out stress associated with each of the
points, you can apply the "Cell Data To Point Data" filter first and
then save the result out.

Utkarsh

On Mon, Oct 9, 2017 at 1:16 PM, Li, Teng <***@illinois.edu> wrote:
> Hi all,
>
> I have a question about saving vtk data in a csv file. Please find the
> following link for the vtk file:
>
> https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing
>
> I expected to see 7 components in the csv file I saved: x, y, z, stress_x,
> stress_y, stress_z, stress_magnitude. However, in the csv file I saved,
> there are only three columns of data. Please find the csv file I saved:
>
> https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing
>
> I saved the vtk file by first highlighting the vtk file in the pipeline, and
> then click save data. Then I used the default settings. Is there anything
> wrong in my saving process?
>
> 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: ***@illinois.edu
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview
Li, Teng
2017-10-09 20:09:05 UTC
Permalink
Hi Utkarsh,

Thanks!

I have successfully use the "Cell Data To Point Data" filter and save a csv file with all the components I expected to see.

Actually, I would like to process the three stress component data in the original VTK file. So I choose to save them as the CSV data. However, I have totally 118 time steps, thus 118 VTK files. If I save all of them and process each in the Matlab and finally show back in Paraview, that will be a huge amount of work. So I use python shell to access the data and process them. After some searching, I find some valuable codes:

1.
>>> a =GetActiveSource() # First highlight the stress vtk file in pipeline.
>>> a
<paraview.servermanager.LegacyVTKReader object at 0x0000006D080174E0>
>>> a.UpdatePipeline()
>>> rawData = servermanager.Fetch(a)
>>> data_cell = rawData.CELL_DATA_FIELD
>>> data_cell
>>> data_cell = rawData.GetCellData
>>> data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>
>>> print data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>

As we can see, this code only gives some simple information, not the actual stress data I need to process. I am wondering how I can access the actual data so I can finish all the calculation in Paraview. And since Paraview can read file series, so I can process the data once and change all of them in all the files.

So my question is how I can get access to the stress data in the vtk file using python shell.

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: ***@illinois.edu



________________________________________
From: Utkarsh Ayachit [***@kitware.com]
Sent: Monday, October 09, 2017 1:06 PM
To: Li, Teng
Cc: ***@paraview.org
Subject: Re: [Paraview] Saving as csv data

Teng,

In your attached VTK file, stress is a cell data i.e. associated with
each of the cells rather than the points. When you export data as CSV
you can only save points along with point data or cells data and not
both. If you want to save out stress associated with each of the
points, you can apply the "Cell Data To Point Data" filter first and
then save the result out.

Utkarsh

On Mon, Oct 9, 2017 at 1:16 PM, Li, Teng <***@illinois.edu> wrote:
> Hi all,
>
> I have a question about saving vtk data in a csv file. Please find the
> following link for the vtk file:
>
> https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing
>
> I expected to see 7 components in the csv file I saved: x, y, z, stress_x,
> stress_y, stress_z, stress_magnitude. However, in the csv file I saved,
> there are only three columns of data. Please find the csv file I saved:
>
> https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing
>
> I saved the vtk file by first highlighting the vtk file in the pipeline, and
> then click save data. Then I used the default settings. Is there anything
> wrong in my saving process?
>
> 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: ***@illinois.edu
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview
Moreland, Kenneth
2017-10-09 18:47:13 UTC
Permalink
Teng,

The issue is that your stress field data is associated with the cells and you are writing out the point data in your csv file. Thus, the stress data is not being written. There are two solutions, both with flaws:

Solution 1: When you get the dialog box labeled "Configure Writer (DataSetCSVWriter)" (after you choose a filename), change the option "Field Association" from "Points" to "Cells". If you do this option, you will only get the x, y, and z for the stress (labeled "stress:0", "stress:1", and "stress:2"). You will not get the x, y, z information for the placement of the points.

Solution 2: Before writing out the csv file, run the "Cell Data to Point Data" filter. Then write out the csv file with point data as you have been doing. You will get the x, y, and z for the stress (labeled "stress:0", "stress:1", and "stress:2") and you will also get the positional x, y, and z (labeled "Points:0", "Points:1", and "Points:2"). The problem with this solution is that it will alter the stress data slightly by averaging values of adjacent cells to points.

Also note that neither of these options will automatically write out the magnitude of the stress. To write out the stress magnitude, first run the "Calculator" filter to compute the magnitude of the stress vectors.

-Ken

From: ParaView [mailto:paraview-***@paraview.org] On Behalf Of Li, Teng
Sent: Monday, October 9, 2017 11:17 AM
To: ***@paraview.org
Subject: [EXTERNAL] [Paraview] Saving as csv data

Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu<mailto:***@illinois.edu>
Moreland, Kenneth
2017-10-09 21:15:35 UTC
Permalink
Teng,

GetCellData is a function. You have to call the function by adding parentheses to the call. Specifically, change

data_cell = rawData.GetCellData

to

data_cell = rawData.GetCellData()

That will return a class from which you can pull the data array for the stress field. (For example, data_cell.GetArray(0).)

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Monday, October 9, 2017 2:23 PM
To: Moreland, Kenneth <***@sandia.gov>; ***@paraview.org
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thank you for your detailed explanation and two specific solutions.

In order not to lose the accuracy, I will first try to save the stress data as the point data and then process it.

Also, I am searching ways to process the vtk data directly by using python shell. I have been searching the codes to get access to the real data, here are some codes I have:

>>> a =GetActiveSource() # First highlight the stress vtk file in pipeline.
>>> a
<paraview.servermanager.LegacyVTKReader object at 0x0000006D080174E0>
>>> a.UpdatePipeline()
>>> rawData = servermanager.Fetch(a)
>>> data_cell = rawData.CELL_DATA_FIELD
>>> data_cell
>>> data_cell = rawData.GetCellData
>>> data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>
>>> print data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>

However, I just have the data information, not the real stress data I need to process. And there are 118 time steps, thus 118 vtk files of my problem. I hope there is a way to process the data in python shell once and the results in all the files will change accordingly. That means I can process the stress component as the data array and do some calculations. And then save them in the old vtk file and visualize them again. That is the idea in my mind now.

And actually, since the csv file records all the stress data (cell data). If I can just print all the data arrays in the csv file and store them as variables in the python shell, I can process them and save as new csv files.

So actually, my question is how I can print out the data, no matter in the vtk files or the csv files by using python shell.

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 1:47 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [Paraview] Saving as csv data
Teng,

The issue is that your stress field data is associated with the cells and you are writing out the point data in your csv file. Thus, the stress data is not being written. There are two solutions, both with flaws:

Solution 1: When you get the dialog box labeled "Configure Writer (DataSetCSVWriter)" (after you choose a filename), change the option "Field Association" from "Points" to "Cells". If you do this option, you will only get the x, y, and z for the stress (labeled "stress:0", "stress:1", and "stress:2"). You will not get the x, y, z information for the placement of the points.

Solution 2: Before writing out the csv file, run the "Cell Data to Point Data" filter. Then write out the csv file with point data as you have been doing. You will get the x, y, and z for the stress (labeled "stress:0", "stress:1", and "stress:2") and you will also get the positional x, y, and z (labeled "Points:0", "Points:1", and "Points:2"). The problem with this solution is that it will alter the stress data slightly by averaging values of adjacent cells to points.

Also note that neither of these options will automatically write out the magnitude of the stress. To write out the stress magnitude, first run the "Calculator" filter to compute the magnitude of the stress vectors.

-Ken

From: ParaView [mailto:paraview-***@paraview.org] On Behalf Of Li, Teng
Sent: Monday, October 9, 2017 11:17 AM
To: ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] [Paraview] Saving as csv data

Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu<mailto:***@illinois.edu>
Moreland, Kenneth
2017-10-10 14:16:37 UTC
Permalink
The first parameter of GetComponent is the tuple you pull and the second parameter is the component of the tuple. Calling GetComponent(5,1) gets the 2nd component (stress_y, index 1) of the 6th stress value (index 5). Although GetComponent(1,5) technically works, you are actually asking for the 6th component (index 5) of the 2nd value (index 1). Since there are only 3 components and VTK does not check array bounds, you actually get the 3rd component of the following tuple.

Alternatively, I suggest you call GetTuple(). It takes one argument, the index to the stress value. It returns a Python triple with the 3 stress values.

-Ken


From: "Li, Teng" <***@illinois.edu>
Date: Monday, October 9, 2017 at 8:34 PM
To: "Moreland, Kenneth" <***@sandia.gov>, "***@paraview.org" <***@paraview.org>
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thanks! I am now able to go further. And now I know there is only one array, array 0 in my data. And I have three components in it. I guess they are: stress_x, stress_y, stress_xy. However, after searching some information, I still can not figure out the data structure of .stress.GetComponent(a,b). I do not know the meaning of a and b.

Please find the codes:

>>> a = GetActiveSource()

>>> a.UpdatePipeline()

>>> rawData = servermanager.Fetch(a)

>>> rawData

(vtkCommonDataModelPython.vtkUnstructuredGrid)00000077A55E0588

>>> data_cell = rawData.GetCellData()

>>> data_cell

(vtkCommonDataModelPython.vtkCellData)00000077A5564FA8

>>> stress = data_cell.GetArray(0)

>>> stress

(vtkCommonCorePython.vtkDoubleArray)00000077A55E0048

>>> stress.GetComponent(1,5)

-4059988.0

>>> stress.GetComponent(5,1)

-5031060.0



As we can see, I use 1 and 5 for both a and b. However, both cases are right. It is strange because there should be only three components. Could you help me to figure out the meanings of a and b in GetComponent(a,b)? And whether I can use the : to extract all the data in a certain dimension, say row or column.



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: ***@illinois.edu





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 4:15 PM
To: Li, Teng; ***@paraview.org
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data
Teng,

GetCellData is a function. You have to call the function by adding parentheses to the call. Specifically, change

data_cell = rawData.GetCellData

to

data_cell = rawData.GetCellData()

That will return a class from which you can pull the data array for the stress field. (For example, data_cell.GetArray(0).)

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Monday, October 9, 2017 2:23 PM
To: Moreland, Kenneth <***@sandia.gov>; ***@paraview.org
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thank you for your detailed explanation and two specific solutions.

In order not to lose the accuracy, I will first try to save the stress data as the point data and then process it.

Also, I am searching ways to process the vtk data directly by using python shell. I have been searching the codes to get access to the real data, here are some codes I have:

>>> a =GetActiveSource() # First highlight the stress vtk file in pipeline.
>>> a
<paraview.servermanager.LegacyVTKReader object at 0x0000006D080174E0>
>>> a.UpdatePipeline()
>>> rawData = servermanager.Fetch(a)
>>> data_cell = rawData.CELL_DATA_FIELD
>>> data_cell
>>> data_cell = rawData.GetCellData
>>> data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>
>>> print data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>

However, I just have the data information, not the real stress data I need to process. And there are 118 time steps, thus 118 vtk files of my problem. I hope there is a way to process the data in python shell once and the results in all the files will change accordingly. That means I can process the stress component as the data array and do some calculations. And then save them in the old vtk file and visualize them again. That is the idea in my mind now.

And actually, since the csv file records all the stress data (cell data). If I can just print all the data arrays in the csv file and store them as variables in the python shell, I can process them and save as new csv files.

So actually, my question is how I can print out the data, no matter in the vtk files or the csv files by using python shell.

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 1:47 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [Paraview] Saving as csv data
Teng,

The issue is that your stress field data is associated with the cells and you are writing out the point data in your csv file. Thus, the stress data is not being written. There are two solutions, both with flaws:

Solution 1: When you get the dialog box labeled “Configure Writer (DataSetCSVWriter)” (after you choose a filename), change the option “Field Association” from “Points” to “Cells”. If you do this option, you will only get the x, y, and z for the stress (labeled “stress:0”, “stress:1”, and “stress:2”). You will not get the x, y, z information for the placement of the points.

Solution 2: Before writing out the csv file, run the “Cell Data to Point Data” filter. Then write out the csv file with point data as you have been doing. You will get the x, y, and z for the stress (labeled “stress:0”, “stress:1”, and “stress:2”) and you will also get the positional x, y, and z (labeled “Points:0”, “Points:1”, and “Points:2”). The problem with this solution is that it will alter the stress data slightly by averaging values of adjacent cells to points.

Also note that neither of these options will automatically write out the magnitude of the stress. To write out the stress magnitude, first run the “Calculator” filter to compute the magnitude of the stress vectors.

-Ken

From: ParaView [mailto:paraview-***@paraview.org] On Behalf Of Li, Teng
Sent: Monday, October 9, 2017 11:17 AM
To: ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] [Paraview] Saving as csv data

Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu<mailto:***@illinois.edu>
Li, Teng
2017-10-10 20:11:20 UTC
Permalink
Hi Kenneth,

Thanks for your detailed explanation! I think I have to learn Paraview python carefully. And could you give me some resources to learn the paraview python function details, such as GetComponent(a,b) and other numerical operations?

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: ***@illinois.edu



________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Tuesday, October 10, 2017 9:16 AM
To: Li, Teng; ***@paraview.org
Subject: Re: [Paraview] Saving as csv data

The first parameter of GetComponent is the tuple you pull and the second parameter is the component of the tuple. Calling GetComponent(5,1) gets the 2nd component (stress_y, index 1) of the 6th stress value (index 5). Although GetComponent(1,5) technically works, you are actually asking for the 6th component (index 5) of the 2nd value (index 1). Since there are only 3 components and VTK does not check array bounds, you actually get the 3rd component of the following tuple.

Alternatively, I suggest you call GetTuple(). It takes one argument, the index to the stress value. It returns a Python triple with the 3 stress values.

-Ken


From: "Li, Teng" <***@illinois.edu>
Date: Monday, October 9, 2017 at 8:34 PM
To: "Moreland, Kenneth" <***@sandia.gov>, "***@paraview.org" <***@paraview.org>
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thanks! I am now able to go further. And now I know there is only one array, array 0 in my data. And I have three components in it. I guess they are: stress_x, stress_y, stress_xy. However, after searching some information, I still can not figure out the data structure of .stress.GetComponent(a,b). I do not know the meaning of a and b.

Please find the codes:

>>> a = GetActiveSource()

>>> a.UpdatePipeline()

>>> rawData = servermanager.Fetch(a)

>>> rawData

(vtkCommonDataModelPython.vtkUnstructuredGrid)00000077A55E0588

>>> data_cell = rawData.GetCellData()

>>> data_cell

(vtkCommonDataModelPython.vtkCellData)00000077A5564FA8

>>> stress = data_cell.GetArray(0)

>>> stress

(vtkCommonCorePython.vtkDoubleArray)00000077A55E0048

>>> stress.GetComponent(1,5)

-4059988.0

>>> stress.GetComponent(5,1)

-5031060.0



As we can see, I use 1 and 5 for both a and b. However, both cases are right. It is strange because there should be only three components. Could you help me to figure out the meanings of a and b in GetComponent(a,b)? And whether I can use the : to extract all the data in a certain dimension, say row or column.



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: ***@illinois.edu





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 4:15 PM
To: Li, Teng; ***@paraview.org
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data
Teng,

GetCellData is a function. You have to call the function by adding parentheses to the call. Specifically, change

data_cell = rawData.GetCellData

to

data_cell = rawData.GetCellData()

That will return a class from which you can pull the data array for the stress field. (For example, data_cell.GetArray(0).)

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Monday, October 9, 2017 2:23 PM
To: Moreland, Kenneth <***@sandia.gov>; ***@paraview.org
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thank you for your detailed explanation and two specific solutions.

In order not to lose the accuracy, I will first try to save the stress data as the point data and then process it.

Also, I am searching ways to process the vtk data directly by using python shell. I have been searching the codes to get access to the real data, here are some codes I have:

>>> a =GetActiveSource() # First highlight the stress vtk file in pipeline.
>>> a
<paraview.servermanager.LegacyVTKReader object at 0x0000006D080174E0>
>>> a.UpdatePipeline()
>>> rawData = servermanager.Fetch(a)
>>> data_cell = rawData.CELL_DATA_FIELD
>>> data_cell
>>> data_cell = rawData.GetCellData
>>> data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>
>>> print data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>

However, I just have the data information, not the real stress data I need to process. And there are 118 time steps, thus 118 vtk files of my problem. I hope there is a way to process the data in python shell once and the results in all the files will change accordingly. That means I can process the stress component as the data array and do some calculations. And then save them in the old vtk file and visualize them again. That is the idea in my mind now.

And actually, since the csv file records all the stress data (cell data). If I can just print all the data arrays in the csv file and store them as variables in the python shell, I can process them and save as new csv files.

So actually, my question is how I can print out the data, no matter in the vtk files or the csv files by using python shell.

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 1:47 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [Paraview] Saving as csv data
Teng,

The issue is that your stress field data is associated with the cells and you are writing out the point data in your csv file. Thus, the stress data is not being written. There are two solutions, both with flaws:

Solution 1: When you get the dialog box labeled “Configure Writer (DataSetCSVWriter)” (after you choose a filename), change the option “Field Association” from “Points” to “Cells”. If you do this option, you will only get the x, y, and z for the stress (labeled “stress:0”, “stress:1”, and “stress:2”). You will not get the x, y, z information for the placement of the points.

Solution 2: Before writing out the csv file, run the “Cell Data to Point Data” filter. Then write out the csv file with point data as you have been doing. You will get the x, y, and z for the stress (labeled “stress:0”, “stress:1”, and “stress:2”) and you will also get the positional x, y, and z (labeled “Points:0”, “Points:1”, and “Points:2”). The problem with this solution is that it will alter the stress data slightly by averaging values of adjacent cells to points.

Also note that neither of these options will automatically write out the magnitude of the stress. To write out the stress magnitude, first run the “Calculator” filter to compute the magnitude of the stress vectors.

-Ken

From: ParaView [mailto:paraview-***@paraview.org] On Behalf Of Li, Teng
Sent: Monday, October 9, 2017 11:17 AM
To: ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] [Paraview] Saving as csv data

Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu<mailto:***@illinois.edu>
Moreland, Kenneth
2017-10-10 21:57:44 UTC
Permalink
Teng,

Once you have called servermanager.Fetch(), you are given a raw VTK object. There are literally books written about using the VTK library. You could consult the VTK Textbook (https://www.vtk.org/vtk-textbook/), and the VTK User's Guide (https://www.vtk.org/vtk-textbook/), both of which you can get for free as a pdf file. You can also consult the Doxygen documentation generated for all VTK classes (http://www.vtk.org/doc/nightly/html).

Unfortunately, almost all of the documentation for VTK is geared to using it in C++ since that is its native language. However, the Python bindings that you are using are very similar and it is easy to convert from one to the other.

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Tuesday, October 10, 2017 2:11 PM
To: Moreland, Kenneth <***@sandia.gov>; ***@paraview.org
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Kenneth,

Thanks for your detailed explanation! I think I have to learn Paraview python carefully. And could you give me some resources to learn the paraview python function details, such as GetComponent(a,b) and other numerical operations?

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Tuesday, October 10, 2017 9:16 AM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: Re: [Paraview] Saving as csv data
The first parameter of GetComponent is the tuple you pull and the second parameter is the component of the tuple. Calling GetComponent(5,1) gets the 2nd component (stress_y, index 1) of the 6th stress value (index 5). Although GetComponent(1,5) technically works, you are actually asking for the 6th component (index 5) of the 2nd value (index 1). Since there are only 3 components and VTK does not check array bounds, you actually get the 3rd component of the following tuple.

Alternatively, I suggest you call GetTuple(). It takes one argument, the index to the stress value. It returns a Python triple with the 3 stress values.

-Ken


From: "Li, Teng" <***@illinois.edu<mailto:***@illinois.edu>>
Date: Monday, October 9, 2017 at 8:34 PM
To: "Moreland, Kenneth" <***@sandia.gov<mailto:***@sandia.gov>>, "***@paraview.org<mailto:***@paraview.org>" <***@paraview.org<mailto:***@paraview.org>>
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thanks! I am now able to go further. And now I know there is only one array, array 0 in my data. And I have three components in it. I guess they are: stress_x, stress_y, stress_xy. However, after searching some information, I still can not figure out the data structure of .stress.GetComponent(a,b). I do not know the meaning of a and b.

Please find the codes:

>>> a = GetActiveSource()

>>> a.UpdatePipeline()

>>> rawData = servermanager.Fetch(a)

>>> rawData

(vtkCommonDataModelPython.vtkUnstructuredGrid)00000077A55E0588

>>> data_cell = rawData.GetCellData()

>>> data_cell

(vtkCommonDataModelPython.vtkCellData)00000077A5564FA8

>>> stress = data_cell.GetArray(0)

>>> stress

(vtkCommonCorePython.vtkDoubleArray)00000077A55E0048

>>> stress.GetComponent(1,5)

-4059988.0

>>> stress.GetComponent(5,1)

-5031060.0



As we can see, I use 1 and 5 for both a and b. However, both cases are right. It is strange because there should be only three components. Could you help me to figure out the meanings of a and b in GetComponent(a,b)? And whether I can use the : to extract all the data in a certain dimension, say row or column.



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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 4:15 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data
Teng,

GetCellData is a function. You have to call the function by adding parentheses to the call. Specifically, change

data_cell = rawData.GetCellData

to

data_cell = rawData.GetCellData()

That will return a class from which you can pull the data array for the stress field. (For example, data_cell.GetArray(0).)

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Monday, October 9, 2017 2:23 PM
To: Moreland, Kenneth <***@sandia.gov<mailto:***@sandia.gov>>; ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thank you for your detailed explanation and two specific solutions.

In order not to lose the accuracy, I will first try to save the stress data as the point data and then process it.

Also, I am searching ways to process the vtk data directly by using python shell. I have been searching the codes to get access to the real data, here are some codes I have:

>>> a =GetActiveSource() # First highlight the stress vtk file in pipeline.
>>> a
<paraview.servermanager.LegacyVTKReader object at 0x0000006D080174E0>
>>> a.UpdatePipeline()
>>> rawData = servermanager.Fetch(a)
>>> data_cell = rawData.CELL_DATA_FIELD
>>> data_cell
>>> data_cell = rawData.GetCellData
>>> data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>
>>> print data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>

However, I just have the data information, not the real stress data I need to process. And there are 118 time steps, thus 118 vtk files of my problem. I hope there is a way to process the data in python shell once and the results in all the files will change accordingly. That means I can process the stress component as the data array and do some calculations. And then save them in the old vtk file and visualize them again. That is the idea in my mind now.

And actually, since the csv file records all the stress data (cell data). If I can just print all the data arrays in the csv file and store them as variables in the python shell, I can process them and save as new csv files.

So actually, my question is how I can print out the data, no matter in the vtk files or the csv files by using python shell.

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 1:47 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [Paraview] Saving as csv data
Teng,

The issue is that your stress field data is associated with the cells and you are writing out the point data in your csv file. Thus, the stress data is not being written. There are two solutions, both with flaws:

Solution 1: When you get the dialog box labeled "Configure Writer (DataSetCSVWriter)" (after you choose a filename), change the option "Field Association" from "Points" to "Cells". If you do this option, you will only get the x, y, and z for the stress (labeled "stress:0", "stress:1", and "stress:2"). You will not get the x, y, z information for the placement of the points.

Solution 2: Before writing out the csv file, run the "Cell Data to Point Data" filter. Then write out the csv file with point data as you have been doing. You will get the x, y, and z for the stress (labeled "stress:0", "stress:1", and "stress:2") and you will also get the positional x, y, and z (labeled "Points:0", "Points:1", and "Points:2"). The problem with this solution is that it will alter the stress data slightly by averaging values of adjacent cells to points.

Also note that neither of these options will automatically write out the magnitude of the stress. To write out the stress magnitude, first run the "Calculator" filter to compute the magnitude of the stress vectors.

-Ken

From: ParaView [mailto:paraview-***@paraview.org] On Behalf Of Li, Teng
Sent: Monday, October 9, 2017 11:17 AM
To: ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] [Paraview] Saving as csv data

Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu<mailto:***@illinois.edu>
Li, Teng
2017-10-11 00:58:06 UTC
Permalink
Hi Kenneth,

Thanks for your information. I will download these files and learn more about VTK files. And I will find resources to learn more about both Python and C++.

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: ***@illinois.edu



________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Tuesday, October 10, 2017 4:57 PM
To: Li, Teng; ***@paraview.org
Subject: RE: [Paraview] Saving as csv data

Teng,

Once you have called servermanager.Fetch(), you are given a raw VTK object. There are literally books written about using the VTK library. You could consult the VTK Textbook (https://www.vtk.org/vtk-textbook/), and the VTK User’s Guide (https://www.vtk.org/vtk-textbook/), both of which you can get for free as a pdf file. You can also consult the Doxygen documentation generated for all VTK classes (http://www.vtk.org/doc/nightly/html).

Unfortunately, almost all of the documentation for VTK is geared to using it in C++ since that is its native language. However, the Python bindings that you are using are very similar and it is easy to convert from one to the other.

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Tuesday, October 10, 2017 2:11 PM
To: Moreland, Kenneth <***@sandia.gov>; ***@paraview.org
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Kenneth,

Thanks for your detailed explanation! I think I have to learn Paraview python carefully. And could you give me some resources to learn the paraview python function details, such as GetComponent(a,b) and other numerical operations?

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Tuesday, October 10, 2017 9:16 AM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: Re: [Paraview] Saving as csv data
The first parameter of GetComponent is the tuple you pull and the second parameter is the component of the tuple. Calling GetComponent(5,1) gets the 2nd component (stress_y, index 1) of the 6th stress value (index 5). Although GetComponent(1,5) technically works, you are actually asking for the 6th component (index 5) of the 2nd value (index 1). Since there are only 3 components and VTK does not check array bounds, you actually get the 3rd component of the following tuple.

Alternatively, I suggest you call GetTuple(). It takes one argument, the index to the stress value. It returns a Python triple with the 3 stress values.

-Ken


From: "Li, Teng" <***@illinois.edu<mailto:***@illinois.edu>>
Date: Monday, October 9, 2017 at 8:34 PM
To: "Moreland, Kenneth" <***@sandia.gov<mailto:***@sandia.gov>>, "***@paraview.org<mailto:***@paraview.org>" <***@paraview.org<mailto:***@paraview.org>>
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thanks! I am now able to go further. And now I know there is only one array, array 0 in my data. And I have three components in it. I guess they are: stress_x, stress_y, stress_xy. However, after searching some information, I still can not figure out the data structure of .stress.GetComponent(a,b). I do not know the meaning of a and b.

Please find the codes:

>>> a = GetActiveSource()

>>> a.UpdatePipeline()

>>> rawData = servermanager.Fetch(a)

>>> rawData

(vtkCommonDataModelPython.vtkUnstructuredGrid)00000077A55E0588

>>> data_cell = rawData.GetCellData()

>>> data_cell

(vtkCommonDataModelPython.vtkCellData)00000077A5564FA8

>>> stress = data_cell.GetArray(0)

>>> stress

(vtkCommonCorePython.vtkDoubleArray)00000077A55E0048

>>> stress.GetComponent(1,5)

-4059988.0

>>> stress.GetComponent(5,1)

-5031060.0



As we can see, I use 1 and 5 for both a and b. However, both cases are right. It is strange because there should be only three components. Could you help me to figure out the meanings of a and b in GetComponent(a,b)? And whether I can use the : to extract all the data in a certain dimension, say row or column.



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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 4:15 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [EXTERNAL] RE: [Paraview] Saving as csv data
Teng,

GetCellData is a function. You have to call the function by adding parentheses to the call. Specifically, change

data_cell = rawData.GetCellData

to

data_cell = rawData.GetCellData()

That will return a class from which you can pull the data array for the stress field. (For example, data_cell.GetArray(0).)

-Ken

From: Li, Teng [mailto:***@illinois.edu]
Sent: Monday, October 9, 2017 2:23 PM
To: Moreland, Kenneth <***@sandia.gov<mailto:***@sandia.gov>>; ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] RE: [Paraview] Saving as csv data

Hi Moreland,

Thank you for your detailed explanation and two specific solutions.

In order not to lose the accuracy, I will first try to save the stress data as the point data and then process it.

Also, I am searching ways to process the vtk data directly by using python shell. I have been searching the codes to get access to the real data, here are some codes I have:

>>> a =GetActiveSource() # First highlight the stress vtk file in pipeline.
>>> a
<paraview.servermanager.LegacyVTKReader object at 0x0000006D080174E0>
>>> a.UpdatePipeline()
>>> rawData = servermanager.Fetch(a)
>>> data_cell = rawData.CELL_DATA_FIELD
>>> data_cell
>>> data_cell = rawData.GetCellData
>>> data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>
>>> print data_cell
<built-in method GetCellData of vtkCommonDataModelPython.vtkUnstructuredGrid object at 0x0000006D08060648>

However, I just have the data information, not the real stress data I need to process. And there are 118 time steps, thus 118 vtk files of my problem. I hope there is a way to process the data in python shell once and the results in all the files will change accordingly. That means I can process the stress component as the data array and do some calculations. And then save them in the old vtk file and visualize them again. That is the idea in my mind now.

And actually, since the csv file records all the stress data (cell data). If I can just print all the data arrays in the csv file and store them as variables in the python shell, I can process them and save as new csv files.

So actually, my question is how I can print out the data, no matter in the vtk files or the csv files by using python shell.

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: ***@illinois.edu<mailto:***@illinois.edu>





________________________________
From: Moreland, Kenneth [***@sandia.gov]
Sent: Monday, October 09, 2017 1:47 PM
To: Li, Teng; ***@paraview.org<mailto:***@paraview.org>
Subject: RE: [Paraview] Saving as csv data
Teng,

The issue is that your stress field data is associated with the cells and you are writing out the point data in your csv file. Thus, the stress data is not being written. There are two solutions, both with flaws:

Solution 1: When you get the dialog box labeled “Configure Writer (DataSetCSVWriter)” (after you choose a filename), change the option “Field Association” from “Points” to “Cells”. If you do this option, you will only get the x, y, and z for the stress (labeled “stress:0”, “stress:1”, and “stress:2”). You will not get the x, y, z information for the placement of the points.

Solution 2: Before writing out the csv file, run the “Cell Data to Point Data” filter. Then write out the csv file with point data as you have been doing. You will get the x, y, and z for the stress (labeled “stress:0”, “stress:1”, and “stress:2”) and you will also get the positional x, y, and z (labeled “Points:0”, “Points:1”, and “Points:2”). The problem with this solution is that it will alter the stress data slightly by averaging values of adjacent cells to points.

Also note that neither of these options will automatically write out the magnitude of the stress. To write out the stress magnitude, first run the “Calculator” filter to compute the magnitude of the stress vectors.

-Ken

From: ParaView [mailto:paraview-***@paraview.org] On Behalf Of Li, Teng
Sent: Monday, October 9, 2017 11:17 AM
To: ***@paraview.org<mailto:***@paraview.org>
Subject: [EXTERNAL] [Paraview] Saving as csv data

Hi all,

I have a question about saving vtk data in a csv file. Please find the following link for the vtk file:

https://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NbGlfTm9odlZpa2M/view?usp=sharing

I expected to see 7 components in the csv file I saved: x, y, z, stress_x, stress_y, stress_z, stress_magnitude. However, in the csv file I saved, there are only three columns of data. Please find the csv file I saved:

https://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharinghttps://drive.google.com/file/d/0B-Dmy2O1v21NeWZnejVqbHEzME0/view?usp=sharing

I saved the vtk file by first highlighting the vtk file in the pipeline, and then click save data. Then I used the default settings. Is there anything wrong in my saving process?

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: ***@illinois.edu<mailto:***@illinois.edu>
Loading...