# Converting standard stresses to Mises stresses

**URL:** https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040
**Category:** ParaView Support
**Created:** [February 28, 2024, 4:19am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040 "2024-02-28T04:19:18Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [February 28, 2024, 4:19am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/1 "2024-02-28T04:19:18Z")

</div>

Hi all.

I load a d3plot file from LS-Dyna into the ParaView program. My task is to remove stresses exceeding 600 MPa (singularities). After loading the file, the first thing I want to do is convert the standard program stresses into von Mises stresses. For this I did not find a standard button and use a calculator. I use the formula:

```auto
sqrt(0.5*((S11-S22)^+(S22-S33)^2+(S33-S11)^2+6*(S12^2+S23^2+S13^2)))

```

but I get errors and it doesn’t work.  
How to do it?

Next, I need to convert the stresses to GPa, because… When calculating in LS-Dyna I used this dimension, I also planned to use a calculator, for example like this:

```auto
S11*1e-9

```

but that won’t work either.

Give answers please. Thank you.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 28, 2024, 9:22am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/2 "2024-02-28T09:22:45Z")

</div>

It might help if you gave the specific error or shared your data. That said, it looks like you missed the `2` after the first `^`. That’s definitely a parse error.

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [February 28, 2024, 4:16pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/3 "2024-02-28T16:16:33Z")

</div>

_\>\> That said, it looks like you missed the `2` after the first `^`. That’s definitely a parse error._  
Yes sir, I was in a hurry and wrote the formula by hand, so there was a mistake, I actually used a number there. I will show below a screenshot of the error and formula. I also tried using the form with and without quoted expressions:

 ![Screenshot_14](https://discourse.paraview.org/uploads/default/original/2X/0/0c425fdec0abd9489fe80629bde186dc1130d475.png)

Sir I have tried so many variations of the formula but they do not work. I couldn’t save the project, so I attached my d3plot file:

[D3PLOT FILE](https://drive.google.com/file/d/1m0ZrpFRdOcaybsFI5lpi72WNL66k4m5O/view?usp=sharing)

Can you open it and try to apply the formula?  
Thank you.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 28, 2024, 4:50pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/4 "2024-02-28T16:50:16Z")

</div>

Is that the only file associated with this dataset? When I try to open it in ParaView 5.12.0-RC3, it says not timesteps are defined.

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [February 29, 2024, 6:36pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/5 "2024-02-29T18:36:43Z")

</div>

I’m sorry sir! Yes, to open a d3plot file you need accompanying files, which contain the results of timesteps.  
I saved the entire archive, now everything opens as it should.  
[D3PLOT](https://drive.google.com/file/d/1VWdqORww7yUWfRrrI1nqKHSzfJ4Fswwn/view?usp=sharing)

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [March 2, 2024, 10:57am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/6 "2024-03-02T10:57:45Z")

</div>

Help please

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 2, 2024, 2:26pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/7 "2024-03-02T14:26:03Z")

</div>

Thanks for posting your dataset. In your expression you are using variables like S11, S22, S33, and so on, but there are no such variables in your dataset. Are these supposed to be matrix elements from a stress variable?

You have a cell data array called Stress. Wild guess, but I think you want your expression to be

`sqrt(0.5*((Stress_XX-Stress_YY)^+(Stress_YY-Stress_ZZ)^2+(Stress_ZZ-Stress_XX)^2+6*(Stress_XY^2+Stress_YZ^2+Stress_XZ^2)))`

Make sure to change the **Attribute Type** to Cell Data in the **Calculator** so that these variables are accessible:

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

By the way, you can see which variables are available by clicking on the Scalars or Vectors menus:

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

If you select a variable from one of these menus, it will be inserted into the expression.

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [March 2, 2024, 5:03pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/8 "2024-03-02T17:03:01Z")

</div>

> [@cory.quammen](#):
>
> sqrt(0.5\*((Stress\_XX-Stress\_YY)^+(Stress\_YY-Stress\_ZZ)^2+(Stress\_ZZ-Stress\_XX)^2+6\*(Stress\_XY^2+Stress\_YZ^2+Stress\_XZ^2)))

Thanks Sir it works. But why don’t the values match?

 ![2_2](https://discourse.paraview.org/uploads/default/original/2X/b/b23daa87384964ac779dfa56dd5da2f2992638ec.png)  
 ![1_1](https://discourse.paraview.org/uploads/default/original/2X/e/e8cd5dca951b2e2241c6c3efafcdd755d03b02bf.png)

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [March 3, 2024, 4:30am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/9 "2024-03-03T04:30:39Z")

</div>

As Kenneth\_Moreland pointed out, the 2 is missing after the first ^.

 ![v_m](https://discourse.paraview.org/uploads/default/original/2X/f/f87dc54067381b97d476439a173e9ccdc8fa4f9c.jpeg)

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [March 3, 2024, 4:37am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/10 "2024-03-03T04:37:53Z")

</div>

Thanks for your answer sir! Yes, I saw this error, but it still didn’t show up for me. I removed the calculator and added a new calculator and formula again, now everything works! Thank you!

Please tell me how you set up such a rainbow on the scale?  
 ![изображение](https://discourse.paraview.org/uploads/default/original/2X/6/68723436055374674a8ee0b9e30b0a51d860bedb.jpeg)

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [March 3, 2024, 11:15am UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/11 "2024-03-03T11:15:06Z")

</div>

And my second question.  
I remove some of the tensions (singularities) using the Threshold filter. How can I save the changes correctly in my d3plot file after applying these filters? After saving correctly, I plan to use this file again for further calculations in Ls-Dyna for fatigue.  
Thank you!

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [March 3, 2024, 1:02pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/12 "2024-03-03T13:02:35Z")

</div>

> Please tell me how you set up such a rainbow on the scale?

In `Color Map Editor > Color Discretization > Number Of Table`, specify 10.

With regard to the second question, it may be difficult to use ParaView to directly reflect some modifications of the data in the d3plot file, as there is no LS-DYNA writer in ParaView. If LS-DYNA can read other file formats that ParaView can output, it may be possible to pass the modified data.

---

<div class="post-metadata">

### Author: ![rsl89](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rsl89/32/13804_2.png) [@rsl89](https://discourse.paraview.org/u/rsl89)
#### Post date: [March 3, 2024, 1:16pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/13 "2024-03-03T13:16:40Z")

</div>

> [@Kenichiro-Yoshimi](#):
>
> With regard to the second question, it may be difficult to use ParaView to directly reflect some modifications of the data in the d3plot file, as there is no LS-DYNA writer in ParaView. If LS-DYNA can read other file formats that ParaView can output, it may be possible to pass the modified data.

Can’t ParaView just save changes to a d3plot file that was opened for editing?

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [March 3, 2024, 11:25pm UTC](https://discourse.paraview.org/t/converting-standard-stresses-to-mises-stresses/14040/14 "2024-03-03T23:25:02Z")

</div>

Unfortunately, ParaView does not have the ability to output to d3plot file format, so it is not possible to save the modified results as a d3plot file.
