Results display outside data range and custom color map

Hello! In this section we'll talk about the post processing module and the data visualization.
Post Reply
fabio
Posts: 3
Joined: Mon Feb 03, 2020 12:12 pm

Results display outside data range and custom color map

Post by fabio » Sun Apr 11, 2021 11:43 am

Hi all.
INTRODUCTION
I am trying to show the crack pattern in a masonry building through principal tensile strain plot.
The masonry is modeled using ShellMITC4 elements, LayeredShell sections with Damage TC3D material.
The recorder is set to ask section.fiber.strain.

PROBLEM 1: result data over the user range not visible.
After the model undergoes heavy damage, maximum strains may be large. This firstly reveals the high capability of the material model to easily converge, which is really good. However, if I want to better highlight the crack pattern, (related to high principal tensile strain) I need to set max data range to a lower value. This excludes gauss point countor outsite the range, simply eliminated them from the plot. For a better display it would be great to set values over the range to the same color of the max value. Is this possible in STKO? Is there any suggestion for a better visualisation?
I we want to display strains over surfaces, what should we record? Results will be adimensional strains in this case or deformation obtained integrating within the shell thickness? If surface will only display one layer, which one is shown?
.
princ_tensile_strain.png
principal tensile strain through fiber color map
princ_tensile_strain.png (210.84 KiB) Viewed 1447 times
PROBLEM 2: single-color custom color map.
In the new version 2.0.0 there was the possibility to choose different color maps. Many of them are made of two colors, which is good for displaying data ranges between negative and positive values. However, many times it is useful to visualize values ranging from 0 to max value. In this case it is convenient to only display results using one single color (such as red) ranging from its light to dark shade. So far it is only possible to select white-to-black, is it possible to customize with any other color? The closest color map is the "HOT" one, which I am using...

Thank you for your help.
Fabio

marafini.f
Posts: 363
Joined: Fri Nov 13, 2020 1:52 pm

Re: Results display outside data range and custom color map

Post by marafini.f » Mon Apr 12, 2021 11:29 am

Ciao Fabio,

Thanks a lot for your question :)

For PROBLEM 1, yes, you are right, the Gauss-points which present results exceeding the user defined range get excluded from the Fiber Plot. This was originally set to facilitate selection operation. To solve this problem you can use a custom python script, creating a new virtual result which clamps the result range without excluding anything from the visualization.

If you are not already familiar with the Python API in STKO, you can check out the first part of our latest webinar
https://www.youtube.com/watch?v=TrHhvJ8L9ao
and our online PyMpc wiki in progress:
https://asdeasoft.net/stko-wiki/

I attach an example of a script you can develop with some additional documentation here, you should change the value of the range you want to clamp, the source result and the output name if desired:

Code: Select all

#import PyMpc and shorthen the virtual result class name
from PyMpc import *
from PyMpc import MpcOdbVirtualResult as vr

#clears the terminal to run the application faster
App.clearTerminal()

# get to the post processing document
doc = App.postDocument()

# get first database, if it does not exist ask for one
if len(doc.databases) == 0:
	raise Exception("You need a database with ID = 1 for this test")
db = doc.getDatabase(1)

# get source result with a matching rule 
# (match can be: Equal, Contains, StartsWith, EndsWith, RegEx)
S = db.getElementalResult("section.fiber.strain", match = MpcOdb.Contains)

# compute derived result (clamped)
maxvalue = 0.0
minvalue = -5.0
Sclamped = vr.min(vr.max(S, minvalue), maxvalue)

#show in the terminal
print(Sclamped)

#set a display name (that you'll see in the result list in the work tree and in the editor)
Sclamped.setDisplayName("section.fiber.ClampedStrain")
Sclamped.setComponentLabels(["S11({}-{})".format(minvalue, maxvalue)])

# add the new result to the database
db.addVirtualResult(Sclamped)
The new result will be available in the list of the FiberPlot once you run the script.
If you need help with the script feel free to ask about it here on the forum.

As for this question:
I we want to display strains over surfaces, what should we record? Results will be adimensional strains in this case or deformation obtained integrating within the shell thickness? If surface will only display one layer, which one is shown?
If you want to visualize the strains, and highlight crack patterns on the surface plot without the fibers, you can request section.deformation in the results of a SurfacePlot, and visualize on the element the Gauss-points results. If you choose component Force Principal Max, they represent the membrane results.
In STKO there is not the option to choose which layer to visualize in the surface plot, like in Abaqus, because you can already see all the layers in the fiber plot. What you see in the SurfacePlot, is the result on the Gauss-points integrated along the thickness of the element.
Another useful visualization too is the VectorPlot, there you find the Membrane Principal Component in the section.force result and you can see the development of the cracking orientation.

For PROBLEM 2, there is the possibility to create a Custom Color Map: click on the + sign, assign a name first, and then by clicking on the color indicators in the scale you can redefine the colors as you like. If you click on the banner you can also add other steps in your map.
Immagine 2021-04-12 130534.png
Immagine 2021-04-12 130534.png (8.76 KiB) Viewed 1440 times
To assign the same color just in a shade, I suggest you to change the saturation level from the same color sample.

Hope this all helps.
Let us know if you need any help and if you want send us your model and we can show the solution directly there.

Enjoy your modeling
Francesca

Post Reply