Skip to content

Commit

Permalink
FEM: solver CalculiX: add geometrical nonlinear analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach authored and wwmayer committed Aug 4, 2016
1 parent da91fde commit d8c294c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Mod/Fem/FemInputWriterCcx.py
Expand Up @@ -225,8 +225,12 @@ def write_step_begin(self, f):
f.write('\n***********************************************************\n')
f.write('** One step is needed to run the mechanical analysis of FreeCAD\n')
f.write('** written by {} function\n'.format(sys._getframe().f_code.co_name))
f.write('*STEP\n')
f.write('*STATIC\n')
static_frequency_step = '*STEP'
if self.solver_obj.GeometricalNonlinearity == "nonlinear" and self.analysis_type == 'static':
static_frequency_step += ', NLGEOM' # https://www.comsol.com/blogs/what-is-geometric-nonlinearity/
elif self.solver_obj.GeometricalNonlinearity == "nonlinear" and self.analysis_type == 'frequency':
print('Analysis type frequency and geometrical nonlinear analyis are not allowed together, linear is used instead!')
f.write(static_frequency_step + '\n')

def write_constraints_fixed(self, f):
f.write('\n***********************************************************\n')
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Fem/FemToolsCcx.py
Expand Up @@ -35,6 +35,7 @@
class FemToolsCcx(FemTools.FemTools):

known_analysis_types = ["static", "frequency"]
known_geom_nonlinear_types = ["linear", "nonlinear"]
finished = QtCore.Signal(int)

## The constructor
Expand Down
9 changes: 9 additions & 0 deletions src/Mod/Fem/_FemSolverCalculix.py
Expand Up @@ -50,6 +50,15 @@ def __init__(self, obj):
analysis_type = fem_prefs.GetInt("AnalysisType", 0)
obj.AnalysisType = FemToolsCcx.FemToolsCcx.known_analysis_types[analysis_type]

known_geom_nonlinear_types = ["linear", "nonlinear"]
obj.addProperty("App::PropertyEnumeration", "GeometricalNonlinearity", "Fem", "Type of geometrical nonlinearity")
obj.GeometricalNonlinearity = known_geom_nonlinear_types
geom = ccx_prefs.GetBool("NonlinearGeometry", False)
if geom is True:
obj.GeometricalNonlinearity = known_geom_nonlinear_types[1] # nonlinear
else:
obj.GeometricalNonlinearity = known_geom_nonlinear_types[0] # linear

obj.addProperty("App::PropertyIntegerConstraint", "NumberOfEigenmodes", "Fem", "Number of modes for frequency calculations")
noe = fem_prefs.GetInt("NumberOfEigenmodes", 10)
obj.NumberOfEigenmodes = (noe, 1, 100, 1)
Expand Down

0 comments on commit d8c294c

Please sign in to comment.