Atom topic feed | site map | contact | login | Protection des données personnelles | Powered by FluxBB | réalisation artaban
You are not logged in.
Pages: 1
Hello,
I followed training instructions described in page 32 of .../DOC/Formations/01-overviewce.pdf for a beam frame model, so i defined CONCEPT string as described, after the run I obtained REPLO data in the output file and ParaVIS provide a plotting of that but NOT vectors. I applied cell center filter but it doesn't work (no vectors), glyph filter does not recognize data (the input menu is empty).
What I missed?
Last edited by ingladisa (2018-06-18 14:40:20)
Offline
You first have to apply an ELNOfieldToSurface filter. I attached a python-script which automatically plots the local coordinate system. With the tkinter dialog you select your desired result-file.
# ======== Select a file for opening:
import Tkinter,tkFileDialog
root = Tkinter.Tk()
file = tkFileDialog.askopenfilename(parent=root,
initialdir='/',
filetypes=[("Result Files","*.rmed")])
root.destroy()
import pvsimple
pvsimple.ShowParaviewView()
#### import the simple module from the paraview
from pvsimple import *
#Modules to create ParaVis-representation
#from smeca_utils import macro_post
#import presentations
#### disable automatic camera reset on 'Show'
pvsimple._DisableFirstRenderCameraReset()
#------------------------------------------------------------------------------
# Visualize Local Base X,Y,Z (red, yellow, green)
#------------------------------------------------------------------------------
print("Create Visualization of local coordinates: X,Y,Z (red, yellow, green) ")
LocalCoordinates = MEDReader(FileName=file)
RenameSource('LocalCoordinates',LocalCoordinates)
keys=LocalCoordinates.GetProperty("FieldsTreeInfo")[::2]
#Get all the fields contained in the ResultFile
arr_name_with_dis=[elt.split("/") for elt in keys]
for arr in arr_name_with_dis:
if 'RepLocal' in arr[3]:
comfield=arr[2]
timestep=arr[0]
print(timestep,comfield)
newlist=[]
for arr in arr_name_with_dis:
if arr[0]==timestep and arr[2]==comfield :
newlist.append("/".join(arr))
print(newlist)
LocalCoordinates.AllArrays = newlist
LocalCoordinates.GenerateVectors = 1
renderView1 = GetActiveViewOrCreate('RenderView')
#Script by cbourcier
# Scale factor for glyphs, factor of the bounding box dimensions
scale_factor = 1./10
source = GetActiveSource()
# Pass cell data to cell centers, since glyphs can only be applyed on points
ELNOMesh1 = ELNOfieldToSurface(Input=LocalCoordinates)
# Guess an absolute scale factor form the bounding box dimensions
bounds = source.GetDataInformation().DataInformation.GetBounds()
side = [bounds[1] - bounds[0], bounds[3] - bounds[2], bounds[5] - bounds[4]]
length = min(side)
scale = length*scale_factor
# Colors of each glyph, same colors as the global base in Paraview 3D viewer
d_colors = {1: [1.0, 0.0, 0.0], # X: red
2: [1.0, 1.0, 0.0], # Y: yellow
3: [0.0, 1.0, 0.0]} # Z: green
# For each 3 directions
direction=["X","Y","Z"]
for i in xrange(1, 4):
# Find the field for the i-th direction
for name, array in ELNOMesh1.PointData.items():
if name.endswith("RepLocal_"+direction[i-1]):
# Create glyphs (that are vectors) and set their scale factor
Glyph1 = Glyph(Input=ELNOMesh1, Vectors = ['POINTS', name], ScaleMode = 'off')
SetActiveSource(Glyph1)
Glyph1.Scalars = ['POINTS', 'None']
Glyph1.GlyphMode = 'All Points'
# Show the glyphs with the right colors
color = d_colors[i]
GlyphRepresentation = Show(DiffuseColor = color)
RenameSource("LocalAxis_"+direction[i-1], Glyph1)
localAxis = FindSource('LocalAxis_"+direction[i-1]+"')
# hide data in view
Hide(localAxis, renderView1)
import SalomePyQt
sg = SalomePyQt.SalomePyQt()
sg.activateModule("ParaViS")
Offline
I loaded the py script. It gives a NameError: name "timestep" is not defined.
The rmed file loaded, it provides results as before.
Offline
Sorry i didnt mention, this script only works with the newest SalomeMeca version.
If timestep is not defined, it means it didn't find the RepLocal field in your *.rmed file.
So either, you didn't write the CONCEPT or it has a different name (other SalomeMeca version). If you load your *.rmed file check how your REPLO field is named.
Offline
I installed Salome meca 2017.0.2.
Concept string in .comm:
CONCEPT= _F(CARA_ELEM=elemprop, MODELE=model, REPERE_LOCAL='ELEM')...
Ok I understood. I changed in REPERE_LOCAL="ELNO". It works! Thank you!
Last edited by ingladisa (2018-06-18 14:15:26)
Offline
I have seen in the same training file, that it is possible to visualize also the section, but not describing how. Is it necessary a pyton script too?
Offline
Do you mean multifibre elements with subpoints (which i assume is what youre refering to from the training-material) or simple 2D beam-elements?
The beam visualization-functionality was beforehand included in Eficas (which doesn't exisit anymore), but is currently not part of the Aster-Module. So you would need to do it manually depending on what your goal is.
For the beam-Elements you might wanne have a look at the TUBA-script i'm working on (http://tuba-v2.readthedocs.io/en/sm2017 and https://github.com/jgwagenfeld/TUBA_V2). It does the crosssection visualization and also the plotting of the local coordinate system.
The python-function to visualize the cross-section is part of the salome - geom module and is not directly available in paravis. In TUBA the geometry in the geom module is exported and then included in the Postprocessing as an overlay).
Last edited by JGWagenfeld (2018-06-18 20:45:52)
Offline
So I suppose next SM version will have these features...
I tried to use the multifibre beam string simply to define a H shaped section steel beam (that I meshed apart), I don't know if it is right, but I tried.
Thank you very much for the clarification and good luck for your challenging work.
Last edited by ingladisa (2018-06-18 21:12:54)
Offline
hello
I tried to use the multifibre beam string simply to define a H shaped section steel beam (that I meshed apart), I don't know if it is right, but I tried.
there is a much simpler way to do that
the macro command MACR_CARA_POUTRE allows you to calculate the properties on a given section directly within the .comm file
it is described in U4.42.02 and in chapter 16.2 of my book
jean pierre aubry
consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/
Offline
Thank you, I will practice it.
A question: TUBA will manage also user-defined sections?
Offline
No, for now it doesn't work with custom profiles - (only rectangular and circular). The visualization is based on the salome struct-elem library docs.salome-platform dot org/7/gui/GEOM/struct_elem_visualisation dot html which doesn't create custom crosssections.
As jeanpierreaubry wrote, for custom profiles you would need to first use MACR_CARA_POUTRE in CodeAster to calculate the characteristics of the cross section. Though this wouldn't include a proper visualization but only the mechanical behavior.
Core-Engineering (https://github.com/core-engineering/aster-calc-section) has some interesting code for the automated calculation of custom profiles (e.g I and H-Beams) with a list of standard IPE and HE profiles. I'm looking currently into how to include this code in TUBA (coupled with a visualization) but i'm still not far.
Offline
I updated the TUBA-code to include I- and H-Beams. You now have access to the list of IPE and HE-Profiles from Core-Engineerings' aster-calc-section code.
github dot com/jgwagenfeld/TUBA_V2/blob/SM2017/external/Section/IBeam.input
I attached a short example of the functionality.
Besides a 1D-Mesh, you can plot it as well as a meshed 3D-Element (V_3D() ) - though the calculation becomes very expensive very fast. I mainly included it to verify to correct orientation of the elements.
P(0,0,0)
FixPoint()
SectionIBeam("IPEAA80")
SectionOrientation(45)
V(500,0,0)
Force(z=-1000)
P(0,300,0)
FixPoint()
SectionIBeam("IPEAA80")
SectionOrientation(45)
V_3D(500,0,0)
Force(z=-1000)
I will add more standard profiles. User-defined profiles (with a Sketcher-String) should be possible soon as well.
Last edited by JGWagenfeld (2018-06-28 11:05:00)
Offline
Great...
I have no skill in pyton and adding features like this in Salome. Could you describe a "step-by-step" way to install TUBA inside Salome-meca 2017?
Thank you...
Offline
I have written a short documentation on how to install and how to use TUBA
http://tuba-v2 dot readthedocs.io/en/sm2017/Installation.html#
You basically download the TUBA-directory and add the TUBA-script to your .bashrc (and make it executable) . Then you can start it from your terminal like this (where examplescript.py is your list of function as e.g. the example i posted above)
TUBA.py examplescript.py -all
The above line will
-create your geometry and mesh(Background)
-runs the Code Aster Simulation(Background)
-launches ParaView with your results (some standard plotting)
In the tutorials folder, you have plenty of examples how to use the code.
Offline
Welcome back,
In this quarantine period, I 'reloaded' some arguments about Code_Aster.
I tried the pyton script in Salome_Meca 2019 but I had some throubles: Tkinter does not work, If I esclude it (putting file name directly) many other errors compare...
Tuba is still available? Does it work with Salome_Meca 2019?
Thank you.
Offline
Hello,
Have you tried the newest version on Github?
i have updated for SalomeMeca 2019, although the PostProcessing-Script still doesn't run through properly.
I will try to have a look the next days.
Offline
Pages: 1