Test read data from Frame3DD file.

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Test read data from Frame3DD file.

Post by bernd »

attached a truss calculated by FreeCAD FEM with z88 and CalculiX ...
fem-truss.fcstd
(50.32 KiB) Downloaded 96 times
screen.jpg
screen.jpg (349.16 KiB) Viewed 2575 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Test read data from Frame3DD file.

Post by bernd »

@chakkree:
If you would convert the data into FEM workbench data we could add Framme3DD as another solver for FEM for line meshes.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Test read data from Frame3DD file.

Post by bernd »

bernd wrote:@chakkree:
If you would convert the data into FEM workbench data we could add Framme3DD as another solver for FEM for line meshes.
Most important would be to create a FEM mesh out of the geometry data during import. This is not difficult to do. See http://www.freecadweb.org/wiki/index.ph ... _py_python

As an example attached the python code to produce the mesh of the truss I have shown in the post before:

Code: Select all

# Created by FreeCAD Python FEM mesh exporter
import Fem
femmesh = Fem.FemMesh()

# nodes
femmesh.addNode(0.0, 2000.0, 0.0, 1)
femmesh.addNode(0.0, 0.0, 0.0, 2)
femmesh.addNode(1000.0, 1000.0, 2000.0, 3)
femmesh.addNode(2000.0, 2000.0, 0.0, 4)
femmesh.addNode(2000.0, 0.0, 0.0, 5)
femmesh.addNode(3000.0, 1000.0, 2000.0, 6)
femmesh.addNode(4000.0, 2000.0, 0.0, 7)
femmesh.addNode(4000.0, 0.0, 0.0, 8)
femmesh.addNode(5000.0, 1000.0, 2000.0, 9)
femmesh.addNode(6000.0, 2000.0, 0.0, 10)
femmesh.addNode(6000.0, 0.0, 0.0, 11)
femmesh.addNode(7000.0, 1000.0, 2000.0, 12)
femmesh.addNode(8000.0, 2000.0, 0.0, 13)
femmesh.addNode(8000.0, 0.0, 0.0, 14)
femmesh.addNode(9000.0, 1000.0, 2000.0, 15)
femmesh.addNode(10000.0, 2000.0, 0.0, 16)
femmesh.addNode(10000.0, 0.0, 0.0, 17)
femmesh.addNode(11000.0, 1000.0, 2000.0, 18)
femmesh.addNode(12000.0, 2000.0, 0.0, 19)
femmesh.addNode(12000.0, 0.0, 0.0, 20)


# elements
femmesh.addEdge([1, 2], 1)
femmesh.addEdge([4, 5], 2)
femmesh.addEdge([7, 8], 3)
femmesh.addEdge([10, 11], 4)
femmesh.addEdge([13, 14], 5)
femmesh.addEdge([16, 17], 6)
femmesh.addEdge([19, 20], 7)
femmesh.addEdge([1, 4], 8)
femmesh.addEdge([2, 5], 9)
femmesh.addEdge([4, 7], 10)
femmesh.addEdge([5, 8], 11)
femmesh.addEdge([7, 10], 12)
femmesh.addEdge([8, 11], 13)
femmesh.addEdge([10, 13], 14)
femmesh.addEdge([11, 14], 15)
femmesh.addEdge([13, 16], 16)
femmesh.addEdge([14, 17], 17)
femmesh.addEdge([16, 19], 18)
femmesh.addEdge([17, 20], 19)
femmesh.addEdge([1, 3], 20)
femmesh.addEdge([4, 6], 21)
femmesh.addEdge([7, 9], 22)
femmesh.addEdge([10, 12], 23)
femmesh.addEdge([13, 15], 24)
femmesh.addEdge([16, 18], 25)
femmesh.addEdge([2, 3], 26)
femmesh.addEdge([5, 6], 27)
femmesh.addEdge([8, 9], 28)
femmesh.addEdge([11, 12], 29)
femmesh.addEdge([14, 15], 30)
femmesh.addEdge([17, 18], 31)
femmesh.addEdge([3, 4], 32)
femmesh.addEdge([6, 7], 33)
femmesh.addEdge([9, 10], 34)
femmesh.addEdge([12, 13], 35)
femmesh.addEdge([15, 16], 36)
femmesh.addEdge([18, 19], 37)
femmesh.addEdge([3, 5], 38)
femmesh.addEdge([6, 8], 39)
femmesh.addEdge([9, 11], 40)
femmesh.addEdge([12, 14], 41)
femmesh.addEdge([15, 17], 42)
femmesh.addEdge([18, 20], 43)
femmesh.addEdge([3, 6], 44)
femmesh.addEdge([6, 9], 45)
femmesh.addEdge([9, 12], 46)
femmesh.addEdge([12, 15], 47)
femmesh.addEdge([15, 18], 48)
femmesh.addEdge([2, 4], 49)
femmesh.addEdge([5, 7], 50)
femmesh.addEdge([8, 10], 51)
femmesh.addEdge([11, 13], 52)
femmesh.addEdge([14, 16], 53)
femmesh.addEdge([17, 19], 54)


# show FEM mesh
Fem.show(femmesh)
Gui.activeDocument().activeView().viewAxonometric()
Gui.SendMsgToActiveView("ViewFit")
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Test read data from Frame3DD file.

Post by yorik »

Wow, I could create such a mesh easily out of the Arch structural objects...
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: Test read data from Frame3DD file.

Post by chakkree »

@Bernd Thank you so much for your 1D element example. I'll learn FEM WB from a tutorial.
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: Test read data from Frame3DD file.

Post by chakkree »

test using FEM line mesh for display nodes and elements.

Code: Select all

"""
   Version4
   use FEM Mesh for display nodes and elements
"""
import FreeCADGui
import Fem


class Node:
    def __init__(self, id , x,y,z):
        self.x = x
        self.y = y
        self.z = z
        self.id = str(id)

# elmnt n1     n2    Ax     Asy     Asz     Jx     Iy     Iz     E     G     roll  density
class Member:
    def __init__(self, id , n1,n2):
        self.n1 = n1
        self.n2 = n2
        self.id = str(id)

NodeList = {}
MemberList = {}

ProjectDescription = ''
numNode = 0



path = 'D:\\StructurallAnalysis\\Frame3DD\\Data\\'


#factor = 25.42  ; fName = 'exA.3dd'
#factor = 1.0  ;fName = 'exB.3dd'
#factor = 25.42  ; fName = 'exC.3dd'
#factor = 25.42  ; fName = 'exD.3dd'
factor = 25.42  ; fName = 'exE.3dd'
#factor = 25.42  ; fName = 'exG.3dd'
#factor = 25.42  ; fName = 'exH.3dd'
#factor = 25.42  ; fName ='exI.3dd'
#factor = 1.0  ; fName = 'exJ.3dd'


# read file to list
lines = [line.rstrip('\n') for line in open(path+fName)]
# strip remark #
lines2 = []
for iLine in lines:
    pos = iLine.find('#')
    if pos>-1:
        lines2.append( iLine[:pos] )
    else:
        lines2.append( iLine )
# remove blank line
lines3 = []
for iLine in lines2:
    if len(iLine.strip())>0:
        lines3.append(iLine)

#for iLine in lines3:
#    Msg(iLine); Msg('\n')

ProjectDescription = lines3[0]
numNode = int(  lines3[1] )
numReactions = int(  lines3[numNode +2] )
numMembers = int(  lines3[numNode+ numReactions +3] )

Msg('numNode = %d\n'% numNode);
Msg('numReactions = %d\n'% numReactions);
Msg('numMembers = %d\n'% numMembers);

for i in range(0, numNode):
    dataNode = lines3[i+2].split()
    NodeList[dataNode[0]] =  Node(dataNode[0] , 
              float(dataNode[1]) ,float( dataNode[2]) , float( dataNode[3]) )

for i in range(0, numMembers):
    dataMember = lines3[i+numNode+ numReactions +4].split()
    MemberList[dataMember[0]] =  Member(dataMember[0] ,dataMember[1] , dataMember[2]) 

     
femmesh = Fem.FemMesh()
# nodes
for id in NodeList: # node
    femmesh.addNode(NodeList[id].x*factor,NodeList[id].y*factor,NodeList[id].z*factor, int(id) )
# elements
for id in MemberList:
    n1 = MemberList[id].n1
    n2 = MemberList[id].n2
    femmesh.addEdge([int(n1), int(n2)], int(id))

# show FEM mesh
obj = App.ActiveDocument.addObject("Fem::FemMeshObject",fName)
obj.FemMesh = femmesh
obj.ViewObject.DisplayMode = u"Faces, Wireframe & Nodes"
obj.ViewObject.PointColor = (0.667,0.000,0.000)
obj.ViewObject.PointSize = 7.000

FreeCADGui.activeDocument().activeView().viewAxonometric()
FreeCADGui.SendMsgToActiveView("ViewFit")
Result:
TestReadFile2Mesh.FCStd
(11.51 KiB) Downloaded 80 times
TestReadFile2Meah.png
TestReadFile2Meah.png (254.02 KiB) Viewed 2463 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Test read data from Frame3DD file.

Post by bernd »

bonfire soup pan frame ...
bonfire_soup_pan_frame.fcstd
(15.23 KiB) Downloaded 78 times
screen.jpg
screen.jpg (266.15 KiB) Viewed 2461 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Test read data from Frame3DD file.

Post by bernd »

ATM only trusses are supported in FreeCAD line analysis for Z88. CalculiX has some limitation too. If a edge normal is in z-direction a extra direction parameter needs to be defined in the line mesh analysis. This is not supported by FreeCADs inp file writer ATM.

We may should really try to get Frame3DD running in conjunction with FreeCAD FEM.

We are able to import the mesh and the geometry. We are able to define fixes (supports) and loads in FEM already. What is needed it to export the Frame3DD file format out of the FEM mesh and the FEM constraint data and call Frame3DD to run the analysis on this file.

@chakkree:
the z88 mesh exporter and importer shows how such an mesh export and import in FEM could look like. https://github.com/FreeCAD/FreeCAD/blob ... Z88Mesh.py and git commit d96ead In our case we only have seg2 elements (FEM_Mesh)
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Test read data from Frame3DD file.

Post by ulrich1a »

bernd wrote:CalculiX has some limitation too. If a edge normal is in z-direction an extra direction parameter needs to be defined in the line mesh analysis. This is not supported by FreeCADs inp file writer ATM.
I would expect, that this or something equivalent is needed in any serious frame-analysis software. Otherwise one cannot determine the orientation of a non quadratic beam cross-section. But this is essential to calculate the bending right.

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

Re: Test read data from Frame3DD file.

Post by bernd »

ulrich1a wrote:
bernd wrote:CalculiX has some limitation too. If a edge normal is in z-direction an extra direction parameter needs to be defined in the line mesh analysis. This is not supported by FreeCADs inp file writer ATM.
I would expect, that this or something equivalent is needed in any serious frame-analysis software. Otherwise one cannot determine the orientation of a non quadratic beam cross-section. But this is essential to calculate the bending right.
Ahh thats not the problem. Even on circle cross section the problem exists. It's another problem If the direction of an edge goes into z-direction and only if it goes in global z-direction an direction parameter in CalculiX has to be set. This because this direction parameter goes into z-direction and this parameter should not go in the same direction the the edge member. Just try an simple line mesh in global z-direction.
Post Reply