Error when using displacement constraint with split input file

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
vdwalts
Posts: 9
Joined: Wed Jun 22, 2016 12:43 pm

Error when using displacement constraint with split input file

Post by vdwalts »

This is a fix on an error that occurs when you use displacement constraints in the absence of fixed constraints and write a split input file. The cause of the error was the omission of certain lines of code dictating the inclusion of the displacement constraint and the plane rotation constraint node sets in the split input file. The addition of the *INCLUDE statements for the nodes sets of both the aforementioned constraints seems to solve the error.

Line 216 of the original 'FemInputWriterCcx.py' read:

Code: Select all

if self.fixed_objects:
            inpfileMain.write('*INCLUDE,INPUT=' + include_name + "_Node_sets.inp \n")
This led to an error being given if there was no fixed constraint present in the analysis and only a displacement and/or planerotation constraint. The addition of the following two 'if' statements seems to fix it. It was added just after the 'if' statement in line 216-217 of 'FemInputWriterCcx.py'

Code: Select all

if self.displacement_objects:
            inpfileMain.write('*INCLUDE,INPUT=' + include_name + "_Node_sets.inp \n")
if self.planerotation_objects:
            inpfileMain.write('*INCLUDE,INPUT=' + include_name + "_Node_sets.inp \n")
The link to the branch is:
https://github.com/stoflap/FreeCAD/tree/NodeSetFix
Attachments
Displacement NodeSet Error.png
Displacement NodeSet Error.png (299.79 KiB) Viewed 1129 times
Last edited by vdwalts on Thu Jan 19, 2017 1:47 pm, edited 1 time in total.
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Error when using displacement constraint with split input file

Post by makkemal »

:D
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Error when using displacement constraint with split input file

Post by HoWil »

Thanks, fixes are alway welcome ;) .
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error when using displacement constraint with split input file

Post by bernd »

Would'nt it be better to use this ... https://github.com/berndhahnebach/FreeC ... it/f3f1d78
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error when using displacement constraint with split input file

Post by bernd »

vdwalts
Posts: 9
Joined: Wed Jun 22, 2016 12:43 pm

Re: Error when using displacement constraint with split input file

Post by vdwalts »

bernd wrote:Post by bernd » Sun Jan 22, 2017 6:52 pm
included in https://github.com/FreeCAD/FreeCAD/pull/464


Yes thank you Bernd, appreciate it.
Post Reply