# Is it possible to create a 6- or 9-array for Tensor Glyph from 1-arrays?

**URL:** https://discourse.paraview.org/t/is-it-possible-to-create-a-6-or-9-array-for-tensor-glyph-from-1-arrays/10845
**Category:** ParaView Support
**Created:** [November 23, 2022, 8:42pm UTC](https://discourse.paraview.org/t/is-it-possible-to-create-a-6-or-9-array-for-tensor-glyph-from-1-arrays/10845 "2022-11-23T20:42:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GregVernon](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gregvernon/32/1494_2.png) [@GregVernon](https://discourse.paraview.org/u/GregVernon)
#### Post date: [November 23, 2022, 8:42pm UTC](https://discourse.paraview.org/t/is-it-possible-to-create-a-6-or-9-array-for-tensor-glyph-from-1-arrays/10845/1 "2022-11-23T20:42:23Z")

</div>

In the dataset provided below I have individual arrays for the six components of the symmetric stress tensor. The code (MOOSE) used to create this dataset does not have the ability (to best of my knowledge) to output the values in a single data array. I’d like to use the `Tensor Glyphs` filter in ParaView, but can’t seem to figure out how to use ParaView filters to create the 6-component array.

I know that I can use the `Calculator` filter to create a 3-component array:

```auto
disp_x * iHat + disp_y * jHat + disp_z * kHat

```

or via the `MergeVectorComponents` filter, so I’m wondering if there are similar tricks for 6- or 9-component arrays.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f85376ea1cc4f6631af1c340c2bc8b767bf95fda.png)

 ![image](https://discourse.paraview.org/uploads/default/original/2X/c/cea25605ca5a5233c8ab9071b8f85379f1e28bc0.jpeg)

Link to files: [http://transfer.coreform.com/get/UaH9W/nist.tar.gz](http://transfer.coreform.com/get/UaH9W/nist.tar.gz)

**EDIT** : uploaded wrong files, added screenshots

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [November 23, 2022, 9:07pm UTC](https://discourse.paraview.org/t/is-it-possible-to-create-a-6-or-9-array-for-tensor-glyph-from-1-arrays/10845/2 "2022-11-23T21:07:00Z")

</div>

One way is to use the programmable filter Check the “Create Tensor” section of this tutorial  
[https://docs.paraview.org/en/latest/Tutorials/ClassroomTutorials/PythonAndBatchPythonCalculatorProgrammableSourceAndFilter.html#programmable-filter](https://docs.paraview.org/en/latest/Tutorials/ClassroomTutorials/PythonAndBatchPythonCalculatorProgrammableSourceAndFilter.html#programmable-filter)

You can also use the main formula  
`numpy.vstack([xx,yy,zz,xy, yz, xz]).transpose()`

into the Python Calculator

---

<div class="post-metadata">

### Author: ![GregVernon](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gregvernon/32/1494_2.png) [@GregVernon](https://discourse.paraview.org/u/GregVernon)
#### Post date: [November 23, 2022, 9:25pm UTC](https://discourse.paraview.org/t/is-it-possible-to-create-a-6-or-9-array-for-tensor-glyph-from-1-arrays/10845/3 "2022-11-23T21:25:23Z")

</div>

Thanks @Christos_Tsolakis – that was very handy.
