Concrete branch ready for testing
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Concrete branch ready for testing
EDIT:
Attached your example with reinforced material ... you will need my latest branch ... The concrete node search is name independent too ... There is an icon to add a reinforcement material. For the material parameter Python is needed, some is attached ... We will need a task panel, but first it needs to run ...
edit by python:
edit by material editor
show the material properties:
Attached your example with reinforced material ... you will need my latest branch ... The concrete node search is name independent too ... There is an icon to add a reinforcement material. For the material parameter Python is needed, some is attached ... We will need a task panel, but first it needs to run ...
edit by python:
Code: Select all
matrixprop = {}
matrixprop['Name'] = "Concrete"
matrixprop['YoungsModulus'] = "32000 MPa"
matrixprop['PoissonRatio'] = "0.17"
matrixprop['CompressiveStrength'] = "15.75 MPa"
matrixprop['AngleOfFriction'] = "0.52333"
reinfoprop = {}
reinfoprop['Name'] = "HarrysReinforcement"
reinfoprop['YieldStrength'] = "315 MPa"
reinfoprop['ReinforcementRatio'] = "0.0" # not an official FreeCAD material property
App.ActiveDocument.ReinforcedMaterial.Material = matrixprop
App.ActiveDocument.ReinforcedMaterial.Reinforcement = reinfoprop
edit by material editor
Code: Select all
import MaterialEditor
# matrix material
props = App.ActiveDocument.ReinforcedMaterial.Material
props = MaterialEditor.editMaterial(props)
if props:
App.ActiveDocument.MaterialReinforced.Material = props
#
Code: Select all
import MaterialEditor
# reinforcement
props = App.ActiveDocument.ReinforcedMaterial.Reinforcement
props = MaterialEditor.editMaterial(props)
if props:
App.ActiveDocument.MaterialReinforced.Reinforcement = props
show the material properties:
Code: Select all
App.ActiveDocument.ReinforcedMaterial.Material
App.ActiveDocument.ReinforcedMaterial.Reinforcement
Re: Concrete branch ready for testing
testing is highly appreciated
Re: Concrete branch ready for testing
Bernd, your example file has an object MaterialReinforced and your Python script refers to an object ReinforcedMaterial.
When I change your Python scripts to the ones below then the input goes well, but then I get the following error when running CCX:
EDIT: ah this is because I didn't specify a CCX working directory. This was never a problem before?! It would normally default to TMP.
Apart from that everything seems to work.
and
When I change your Python scripts to the ones below then the input goes well, but then I get the following error when running CCX:
EDIT: ah this is because I didn't specify a CCX working directory. This was never a problem before?! It would normally default to TMP.
Apart from that everything seems to work.
Code: Select all
Executing solver...
*ERROR in openfile: input file FEMMeshGmsh.inp
does not exist
Code: Select all
Exception in thread Thread-11:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/harry/FC_Dev/Build/Mod/Fem/femsolver/task.py", line 115, in protector
self.run()
File "/home/harry/FC_Dev/Build/Mod/Fem/femsolver/calculix/tasks.py", line 126, in run
self.load_results_ccxfrd()
File "/home/harry/FC_Dev/Build/Mod/Fem/femsolver/calculix/tasks.py", line 138, in load_results_ccxfrd
self.directory, _inputFileName + '.frd')
File "/usr/lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
Code: Select all
matrixprop = {}
matrixprop['Name'] = "Concrete"
matrixprop['YoungsModulus'] = "32000 MPa"
matrixprop['PoissonRatio'] = "0.17"
matrixprop['CompressiveStrength'] = "15.75 MPa"
matrixprop['AngleOfFriction'] = "0.52333"
reinfoprop = {}
reinfoprop['Name'] = "HarrysReinforcement"
reinfoprop['YieldStrength'] = "315 MPa"
reinfoprop['ReinforcementRatio'] = "0.0" # not an official FreeCAD material property
App.ActiveDocument.MaterialReinforced.Material = matrixprop
App.ActiveDocument.MaterialReinforced.Reinforcement = reinfoprop
Code: Select all
import MaterialEditor
# matrix material
props = App.ActiveDocument.MaterialReinforced.Material
props = MaterialEditor.editMaterial(props)
if props:
App.ActiveDocument.MaterialReinforced.Material = props
#
Code: Select all
import MaterialEditor
# reinforcement
props = App.ActiveDocument.MaterialReinforced.Reinforcement
props = MaterialEditor.editMaterial(props)
if props:
App.ActiveDocument.MaterialReinforced.Reinforcement = props
Code: Select all
App.ActiveDocument.MaterialReinforced.Material
App.ActiveDocument.MaterialReinforced.Reinforcement
Re: Concrete branch ready for testing
By the way,
it feels more natural to enter angles in degrees than in radians. You can always transform them in the code: angle_in_rad = PI()/180 * angle_in_degree
it feels more natural to enter angles in degrees than in radians. You can always transform them in the code: angle_in_rad = PI()/180 * angle_in_degree
Re: Concrete branch ready for testing
FreeCAD FEM does no longer just create non existing user specified directories. The user has to take care on this. Is this annoying?
Re: Concrete branch ready for testing
Nope. It’s ok. But it would be good to stop people when they don’t enter a directory rather than crash in CCX.
Re: Concrete branch ready for testing
FreeCAD can do this for us. The unit system is very very cool once one get used to it.
Code: Select all
matrix_af = float(FreeCAD.Units.Quantity(obj.Material['AngleOfFriction']).getValueAs('rad'))
the new material code ...
Code: Select all
matrixprop = {}
matrixprop['Name'] = "Concrete"
matrixprop['YoungsModulus'] = "32000 MPa"
matrixprop['PoissonRatio'] = "0.17"
matrixprop['CompressiveStrength'] = "15.75 MPa"
matrixprop['AngleOfFriction'] = "30 deg" # make some hint on the possible angle units in material system
reinfoprop = {}
reinfoprop['Name'] = "HarrysReinforcement"
reinfoprop['YieldStrength'] = "315 MPa"
reinfoprop['ReinforcementRatio'] = "0.0" # not an official FreeCAD material property
App.ActiveDocument.ReinforcedMaterial.Material = matrixprop
App.ActiveDocument.ReinforcedMaterial.Reinforcement = reinfoprop
Re: Concrete branch ready for testing
Mhh we gone use the new solver because has no pre checks at all. Thus he does not claim about we are not having a material in our analysis (the new reinforced material needs to be implemented in the pre checks.). Thus he does not claim about if we gone miss some other stuff. This is the main reason for not using the new solver frame work for any normal analysis because there are nearly no pre checks at all. One really misses such a comfortable pre check system once it is not available anymore
Re: Concrete branch ready for testing
Something not right yet:
OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16225 (Git)
Build type: Unknown
Branch: femconcrete
Hash: 6b861b1bc7712ba4fa26009cb3d081e7a28ea593
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
Code: Select all
Traceback (most recent call last):
File "/home/harry/FC_Dev/Build/Mod/Fem/femguiobjects/_ViewProviderFemSolverCalculix.py", line 237, in calculixFinished
self.fea.load_results()
File "/home/harry/FC_Dev/Build/Mod/Fem/femtools/ccxtools.py", line 830, in load_results
self.load_results_ccxfrd()
File "/home/harry/FC_Dev/Build/Mod/Fem/femtools/ccxtools.py", line 840, in load_results_ccxfrd
importCcxFrdResults.importFrd(frd_result_file, self.analysis, result_name_prefix)
File "/home/harry/FC_Dev/Build/Mod/Fem/feminout/importCcxFrdResults.py", line 110, in importFrd
res_obj = restools.add_principal_stress_harry(res_obj) # fill harrys calculated result values
File "/home/harry/FC_Dev/Build/Mod/Fem/femresult/resulttools.py", line 385, in add_principal_stress_harry
print(matrix_af)
UnboundLocalError: local variable 'matrix_af' referenced before assignment
OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16225 (Git)
Build type: Unknown
Branch: femconcrete
Hash: 6b861b1bc7712ba4fa26009cb3d081e7a28ea593
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)