If it is not OpenSource I will not do any dev in my spare time in this regard. I would recommend to use the TCL interface than. Made a issue to bring light in the darkness … https://github.com/OpenSeesPy-pip/openseespy-pip/issues/11
according to a post on the issue OpenSeesPy is opensource and included in main opensees.
Would be good if one you you both opensees guys would test this OpenSeesPy and could give some feedback. Python is the languarge we speak, thus it would be cool to use this one.
The Regents grants permission, without fee and without a written license agreement, for (a) use,
reproduction, modification, and distribution of this software and its documentation by educational,
research, and non-profit entities for noncommercial purposes only;
is not open source because of its non-commercial restriction, failing #6 of The Open Source Definition, “6. No Discrimination Against Fields of Endeavor”. It’s source-available. With its current license it will never, for example, be able to be distributed in Debian.
now, my question is: what is principle axis in C3D20 element?
i examin it in three state, first no change between them, one for as is in picture and another for axis that i assume, but in those state gives me that error. this is my python script that convert node numbering:
inpfile = open('/home/ebi/Box_Mesh001.inp', 'r')
line = inpfile.readline()
while not line.startswith("** Volume elements"):
line = inpfile.readline()
continue
inpfile.readline()
line = inpfile.readline()
with open('/home/ebi/opensees/openseespy/element.tcl', 'w') as pyfile:
while not line.startswith('*'):
try:
num, *nodes = line.split(',')[:-1]
line = inpfile.readline()
nodes2 = line.split(',')[:-1]
n = nodes + nodes2
maps = [7, 8, 5, 6, 3, 4, 1, 2, 15, 16, 13, 14, 11, 12, 9, 10, 19, 20, 17, 18]
node = ''.join(f'{n[i - 1]} ' for i in maps)
# node = ''.join(f'{i} ' for i in n)
pyfile.write(f"element 20NodeBrick {num} {node} 1\n")
line = inpfile.readline()
except:
break
thanks @bernd, I searched for the “** Nodes” in FEM workbench to find function that write Nodes in .inp file. i found it in FemMesh.cpp in App folder.
my question. how can i obtain nodes , elements and so on? with femmesh_obj.FemMesh? that femmesh_obj is ‘Fem::FemMeshObject’ object. it gives me nodes, edges , volumes and so on. is this way is true? or I must implement it in .cpp file? I don’t know more about C++ , but with python i can. thanks
To answer your question, start FreeCAD run this code:
from femexamples import ccx_cantilever_std as canti
doc = canti.setup_cantileverfaceload()
mesh = doc.Mesh.FemMesh
print(mesh)
print(mesh.NodeCount)
for n in mesh.Nodes:
print("node no: {} has coordinate {}".format(n, mesh.getNodeById(n)))
print("done")
thanks @bernd. i implemented some part, heading and nodes. as i don’t familiar with git professional command, i think i made a mistake, but i created a PR for you, please forgive about it , only please let me know my problems, although i must cleaner the code and remove some additional parameters:
I implemented element writer. now, when i want to implement load writer it gives me that error:
for ref_shape in femobj["NodeLoadTable"]:
KeyError: 'NodeLoadTable'
while i copy format from other solver:
for femobj in self.force_objects:
# femobj --> dict, FreeCAD document object is femobj["Object"]
direction_vec = femobj["Object"].DirectionVector
print(direction_vec)
print(femobj)
for ref_shape in femobj["NodeLoadTable"]:
You did some stuff different than standard FreeCAD FEM. Like Elmer. In Elmer a lot is different too. I did not spend the time to understand everything. I just changed it in a way it runs like standard FEM to test if it works. https://github.com/berndhahnebach/FreeCAD_bhb/commit/b283f11ed8
You might change it back to your code .
set up the analysis
from femexamples import ccx_cantilever_std as canti
canti.setup_cantileverfaceload(solvertype="opensees")
activate the analysis, select the OpenSees solver and click on run …
ATM it prints the NodeLoadTable and writes some comment to tcl file …
References: empty in FemMaterial, FemMaterial
References: Face in ConstraintFixed, ConstraintFixed
References: Face in ConstraintForce, ConstraintForce
ConstraintForce:
Type: Fem::ConstraintForce, Name: ConstraintForce
ReferenceShape ... Type: Face, Object name: Box, Object label: Box, Element name: Face2
No face data in finite volume element mesh. FreeCAD uses getccxVolumesByFace() to retrieve the volume elements of the ref_face.
{'Object': <Fem::ConstraintForce object>, 'RefShapeType': 'Face', 'NodeLoadTable': [('node loads on shape: Box:Face2', {4: 0.0, 2: 0.0, 49: 0.0, 64: 750000.0000000001, 189: 1500000.0000000002, 190: 1500000.0000000002, 1: 0.0, 100: 750000.0000000001, 191: 1500000.0000000002, 3: 0.0, 188: 1500000.0000000002, 88: 750000.0000000001, 102: 750000.0000000001})]}
[('node loads on shape: Box:Face2', {4: 0.0, 2: 0.0, 49: 0.0, 64: 750000.0000000001, 189: 1500000.0000000002, 190: 1500000.0000000002, 1: 0.0, 100: 750000.0000000001, 191: 1500000.0000000002, 3: 0.0, 188: 1500000.0000000002, 88: 750000.0000000001, 102: 750000.0000000001})]
***** OpenSees input file generated: /tmp/FEMWB/Unnamed/SolverOpenSees/Mesh.tcl *****
OpenSees solver input file: Mesh.tcl
Solver binary path: /home/hugo/bin/OpenSees
OpenSees solver binary: /home/hugo/bin/OpenSees
OpenSees solver run dir: /tmp/FEMWB/Unnamed/SolverOpenSees
OpenSees-info: reading output not yet implemented.