OpenSees, the Open System for Earthquake Engineering Simulation

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

bernd wrote: Mon Apr 13, 2020 10:00 pm
ebrahim raeyat wrote: Mon Apr 13, 2020 6:58 pm ... i mean how can i find which element number has which section, not arch object, i mean by python. i want for writing opensees input file. ...
If something works in CalculiX just have a look at calculiX writer ...
i looked into .inp export file for this model. in analysis we have beams and columns sections, but in .inp file we have 4 sections with 3 similar properties, this not affect the analysis and don't produce error, but why writer produce 4 sections?

Code: Select all

** Sections
** written by write_femelementsets function
*BEAM SECTION, ELSET=M0B0RstdD7, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
20.0, 100.0
-0.0, 1.0, 0
*BEAM SECTION, ELSET=M0B1RstdD19, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
50.0, 50.0
1.0, 0, -0.0
*BEAM SECTION, ELSET=M0B1RstdD20, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
50.0, 50.0
1.0, 0, -0.0
*BEAM SECTION, ELSET=M0B1RstdD21, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
50.0, 50.0
1.0, 0, -0.0
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by bernd »

ebrahim raeyat wrote: Wed Apr 15, 2020 5:52 am
bernd wrote: Mon Apr 13, 2020 10:00 pm
ebrahim raeyat wrote: Mon Apr 13, 2020 6:58 pm ... i mean how can i find which element number has which section, not arch object, i mean by python. i want for writing opensees input file. ...
If something works in CalculiX just have a look at calculiX writer ...
i looked into .inp export file for this model. in analysis we have beams and columns sections, but in .inp file we have 4 sections with 3 similar properties, this not affect the analysis and don't produce error, but why writer produce 4 sections?

Code: Select all

** Sections
** written by write_femelementsets function
*BEAM SECTION, ELSET=M0B0RstdD7, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
20.0, 100.0
-0.0, 1.0, 0
*BEAM SECTION, ELSET=M0B1RstdD19, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
50.0, 50.0
1.0, 0, -0.0
*BEAM SECTION, ELSET=M0B1RstdD20, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
50.0, 50.0
1.0, 0, -0.0
*BEAM SECTION, ELSET=M0B1RstdD21, MATERIAL=MechanicalSolidMaterial, SECTION=RECT
50.0, 50.0
1.0, 0, -0.0
This is just due to CalculiX. It needs some reference axis (which is global x-direction, AFAIK). If the beam is in the direction of the standard reference axis the reference axis needs to be changed. Thus four element sets. See last line of each BEAM SECTION.
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

bernd wrote: Wed Apr 15, 2020 8:36 am See last line of each BEAM SECTION.
all 3 beam sections have same direction! what do you mean?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by bernd »

ebrahim raeyat wrote: Wed Apr 15, 2020 11:19 am
bernd wrote: Wed Apr 15, 2020 8:36 am See last line of each BEAM SECTION.
all 3 beam sections have same direction! what do you mean?
These are not the beam axis. These are directions calculix needs to exand the beam in a solid brick element. As I said this fourth element set is Calculix specific. In another FEA solver you would probably only make 3 element sets.

http://web.mit.edu/calculix_v2.7/Calcul ... ode53.html
In the latter case, n1 can be defined either

explicitly on the *BEAM SECTION card.
implicitly through the default of (0,0,-1).
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

bernd wrote: Wed Apr 15, 2020 12:54 pm
These are not the beam axis. These are directions calculix needs to exand the beam in a solid brick element. As I said this fourth element set is Calculix specific. In another FEA solver you would probably only make 3 element sets.

http://web.mit.edu/calculix_v2.7/Calcul ... ode53.html
thanks bernd. i had been saw that link, although i don't undrestand your hint, in opensees also we need some local direction for element to align section throw the beam[link], BTW, i will try to implement this in opensees solver.
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

@bernd, as i involved to opensees solver, i have a proposal, most of solvers want same data that can be obtain from simpler API, then only different for each solver is the format that each solver use to write their input file. this way developement in FEM take simpler and code becomes solid and cleaner. i read z88 and calculix and found that each of them take same code duplicate and i also have to repeat them. also until now big work had been done, what do you think?
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

@bernd, how can i edit *.tcl file in freecad like *.inp. i add this line in Init.py:

Code: Select all

FreeCAD.addImportType("FEM mesh OpenSees (*.tcl)", "feminout.importOpenSeesMesh")
then in importOpenSeesMesh.py i must have open and insert function. i fount you define this in c++ code:

# see FemMesh::read() and FemMesh::write() methods in src/Mod/Fem/App/FemMesh.cpp

i had been add xlsx open in freecad in my pyconcrete library:

https://forum.freecadweb.org/viewtopic. ... 31#p331931

thanks bernd.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by bernd »

ebrahim raeyat wrote: Wed Apr 15, 2020 8:28 pm @bernd, how can i edit *.tcl file in freecad like *.inp.
https://github.com/ebrahimraeyat/FreeCAD/pull/2 commit https://github.com/ebrahimraeyat/FreeCA ... de7e3d818a

use solver taskpanel or by Python ...

Code: Select all

import FemGui
FemGui.open("/home/hugo/Desktop/FEMMeshGmsh.tcl")
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by bernd »

ebrahim raeyat wrote: Wed Apr 15, 2020 7:51 pm @bernd, as i involved to opensees solver, i have a proposal, most of solvers want same data that can be obtain from simpler API, then only different for each solver is the format that each solver use to write their input file. this way developement in FEM take simpler and code becomes solid and cleaner. i read z88 and calculix and found that each of them take same code duplicate and i also have to repeat them. also until now big work had been done, what do you think?
the writerbase class is intended to do this. If you would like to extend it come up with your changes. Or do you have something totally different in mind? I am curious?
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

bernd wrote: Wed Apr 15, 2020 9:28 pm the writerbase class is intended to do this. If you would like to extend it come up with your changes. Or do you have something totally different in mind? I am curious?
first I very appreciate such great work, but I think it is a little complicated and doesn't follow the zen of python. I think if we structure FEM workbench easer like Compas-fea, it is better. look at this, for opensees and apaqus the difference is not so much and it gives a program name parameter as an argument for writing. it takes nodes, element, section properties, element sets, boundary conditions, etc. this part is not solver dependent.

why did I say this? because if I have your output *.inp file I can produce my *.tcl file and did not require any extra information, thus we can merge more and more code that present in writer into writerbase, of course, it can be separate files for better understanding like Compas-fea.

for example at the moment, I want to obtain local directions of the 1D element that you obtain in the writer of Calculix and I must do this in my OpenSees solver.
Post Reply