From f29424cf764534e3538f34211ef0b08bb6c5886f Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Mon, 26 Jun 2017 21:26:51 +0100 Subject: [PATCH] FEM: solver calculix, allow user time steps without Parameter DIRECT --- src/Mod/Fem/FemInputWriterCcx.py | 12 ++++++------ src/Mod/Fem/PyObjects/_FemSolverCalculix.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Mod/Fem/FemInputWriterCcx.py b/src/Mod/Fem/FemInputWriterCcx.py index fe2986224d..2e71517f2d 100644 --- a/src/Mod/Fem/FemInputWriterCcx.py +++ b/src/Mod/Fem/FemInputWriterCcx.py @@ -716,17 +716,17 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): 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 @@ -735,8 +735,8 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): # 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) diff --git a/src/Mod/Fem/PyObjects/_FemSolverCalculix.py b/src/Mod/Fem/PyObjects/_FemSolverCalculix.py index 0f54e5febb..86dacbe21c 100644 --- a/src/Mod/Fem/PyObjects/_FemSolverCalculix.py +++ b/src/Mod/Fem/PyObjects/_FemSolverCalculix.py @@ -132,11 +132,11 @@ class _FemSolverCalculix(): 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")