Skip to content

Commit

Permalink
FEM: solver calculix, allow user time steps without Parameter DIRECT
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach authored and wwmayer committed Jun 26, 2017
1 parent d0aefe4 commit f29424c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/Mod/Fem/FemInputWriterCcx.py
Expand Up @@ -716,17 +716,17 @@ def write_step_begin(self, f):
analysis_type += ', SOLVER=ITERATIVE SCALING'
elif self.solver_obj.MatrixSolverType == "iterativecholesky":
analysis_type += ', SOLVER=ITERATIVE CHOLESKY'
# analysis line --> user defined incrementations --> parameter DIRECT
# analysis line --> user defined incrementations --> parameter DIRECT --> completely switch off ccx automatic incrementation
if self.solver_obj.IterationsUserDefinedIncrementations:
if self.analysis_type == 'static': # it would be possible in thermomech too IMHO (bernd)
if self.analysis_type == 'static':
analysis_type += ', DIRECT'
elif self.analysis_type == 'thermomech':
print('IterationsUserDefinedIncrementations not implemented for thermomech at the moment')
analysis_type += ', DIRECT'
elif self.analysis_type == 'frequency':
print('Analysis type frequency and IterationsUserDefinedIncrementations are not allowed together, it is ignored')
# analysis line --> steadystate --> thermomech only
if self.solver_obj.ThermoMechSteadyState:
if self.analysis_type == 'thermomech':
if self.analysis_type == 'thermomech': # bernd: I do not know if STEADY STATE is allowed with DIRECT but since time steps are 1.0 it makes no sense IMHO
analysis_type += ', STEADY STATE'
self.solver_obj.TimeInitialStep = 1.0 # Set time to 1 and ignore user inputs for steady state
self.solver_obj.TimeEnd = 1.0
Expand All @@ -735,8 +735,8 @@ def write_step_begin(self, f):
# ANALYSIS parameter line
analysis_parameter = ''
if self.analysis_type == 'static':
if self.solver_obj.IterationsUserDefinedIncrementations:
analysis_parameter = self.solver_obj.IterationsUserDefinedTimeStepLength
if self.solver_obj.IterationsUserDefinedIncrementations is True or self.solver_obj.IterationsUserDefinedTimeStepLength is True:
analysis_parameter = '{},{}'.format(self.solver_obj.TimeInitialStep, self.solver_obj.TimeEnd)
elif self.analysis_type == 'frequency':
if self.solver_obj.EigenmodeLowLimit == -1.0 and self.solver_obj.EigenmodeHighLimit == -1.0:
analysis_parameter = '{}\n'.format(self.solver_obj.EigenmodesCount)
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Fem/PyObjects/_FemSolverCalculix.py
Expand Up @@ -132,11 +132,11 @@ def __init__(self, obj):
obj.addProperty("App::PropertyString", "IterationsControlParameterCutb", "Fem", "User defined time incrementation cutbacks control parameter")
obj.IterationsControlParameterCutb = p_cutb

obj.addProperty("App::PropertyBool", "IterationsUserDefinedIncrementations", "Fem", "Set to True to switch of the ccx automatic incrementation (ccx parameter DIRECT)")
obj.addProperty("App::PropertyBool", "IterationsUserDefinedIncrementations", "Fem", "Set to True to switch off the ccx automatic incrementation completely (ccx parameter DIRECT). Use with care. Analysis may not converge!")
obj.IterationsUserDefinedIncrementations = False

obj.addProperty("App::PropertyString", "IterationsUserDefinedTimeStepLength", "Fem", "Set the time step length for the current step, only used if IterationsUserDefinedIncrementations is set to True")
obj.IterationsUserDefinedTimeStepLength = "0.1, 1.0"
obj.addProperty("App::PropertyBool", "IterationsUserDefinedTimeStepLength", "Fem", "Set to True to use the user defined time steps. The time steps are set with TimeInitialStep and TimeEnd")
obj.IterationsUserDefinedTimeStepLength = False

known_ccx_solver_types = ["default", "spooles", "iterativescaling", "iterativecholesky"]
obj.addProperty("App::PropertyEnumeration", "MatrixSolverType", "Fem", "Type of solver to use")
Expand Down

0 comments on commit f29424c

Please sign in to comment.