Skip to content

Commit

Permalink
FEM: Use local variable to avoid long strings in write_load_node_sets
Browse files Browse the repository at this point in the history
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed May 1, 2015
1 parent 39fd6d9 commit 5bf115d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Mod/Fem/ccxInpWriter.py
Expand Up @@ -77,11 +77,12 @@ def write_fixed_node_sets(self, f):
def write_load_node_sets(self, f):
f.write('\n\n***********************************************************\n')
f.write('** node sets for loads\n')
for force_object in self.force_objects:
print force_object['Object'].Name
f.write('*NSET,NSET=' + force_object['Object'].Name + '\n')
for fobj in self.force_objects:
frc_obj = fobj['Object']
print frc_obj.Name
f.write('*NSET,NSET=' + frc_obj.Name + '\n')
NbrForceNodes = 0
for o, elem in force_object['Object'].References:
for o, elem in frc_obj.References:
fo = o.Shape.getElement(elem)
n = []
if fo.ShapeType == 'Face':
Expand All @@ -100,10 +101,13 @@ def write_load_node_sets(self, f):
if NbrForceNodes == 0:
print ' Warning --> no FEM-Mesh-node to apply the load to was found?'
else:
force_object['NodeLoad'] = (force_object['Object'].Force) / NbrForceNodes
fobj['NodeLoad'] = (frc_obj.Force) / NbrForceNodes
# FIXME this method is incorrect, but we don't have anything else right now
# Please refer to thread "CLOAD and DLOAD for the detailed description
# http://forum.freecadweb.org/viewtopic.php?f=18&t=10692
f.write('** concentrated load [N] distributed on all mesh nodes of the given shapes\n')
f.write('** ' + str(force_object['Object'].Force) + ' N / ' + str(NbrForceNodes) + ' Nodes = ' + str(force_object['NodeLoad']) + ' N on each node\n')
if force_object['Object'].Force == 0:
f.write('** ' + str(frc_obj.Force) + ' N / ' + str(NbrForceNodes) + ' Nodes = ' + str(fobj['NodeLoad']) + ' N on each node\n')
if frc_obj.Force == 0:
print ' Warning --> Force = 0'
f.write('\n\n')

Expand Down

0 comments on commit 5bf115d

Please sign in to comment.