FEM: allow frequency analysis without constraint fix and change some error messages

This commit is contained in:
Bernd Hahnebach 2016-05-21 19:51:08 +02:00
parent 2cc36497b8
commit a440262126
2 changed files with 16 additions and 12 deletions

View File

@ -222,33 +222,34 @@ class FemTools(QtCore.QRunnable, QtCore.QObject):
if not (os.path.isdir(self.working_dir)):
message += "Working directory \'{}\' doesn't exist.".format(self.working_dir)
if not self.mesh:
message += "No mesh object in the Analysis\n"
message += "No mesh object defined in the analysis\n"
if not self.materials:
message += "No material object in the Analysis\n"
message += "No material object defined in the analysis\n"
has_no_references = False
for m in self.materials:
if len(m['Object'].References) == 0:
if has_no_references is True:
message += "More than one Material has empty References list (Only one empty References list is allowed!).\n"
message += "More than one material has an empty references list (Only one empty references list is allowed!).\n"
has_no_references = True
if not (self.fixed_constraints):
message += "No fixed-constraint nodes defined in the Analysis\n"
if self.analysis_type == "static":
if not (self.fixed_constraints or self.displacement_constraints):
message += "Neither a constraint fixed nor a contraint displacement defined in the static analysis\n"
if self.analysis_type == "static":
if not (self.force_constraints or self.pressure_constraints):
message += "No force-constraint or pressure-constraint defined in the Analysis\n"
message += "Neither constraint force nor constraint pressure defined in the static analysis\n"
if self.beam_sections:
has_no_references = False
for b in self.beam_sections:
if len(b['Object'].References) == 0:
if has_no_references is True:
message += "More than one BeamSection has empty References list (Only one empty References list is allowed!).\n"
message += "More than one beam section has an empty references list (Only one empty references list is allowed!).\n"
has_no_references = True
if self.shell_thicknesses:
has_no_references = False
for s in self.shell_thicknesses:
if len(s['Object'].References) == 0:
if has_no_references is True:
message += "More than one ShellThickness has empty References list (Only one empty References list is allowed!).\n"
message += "More than one shell thickness has an empty references list (Only one empty references list is allowed!).\n"
has_no_references = True
return message

View File

@ -202,7 +202,6 @@ class FemToolsCcx(FemTools.FemTools):
self.results_present = True
else:
raise Exception('FEM: No results found at {}!'.format(frd_result_file))
self.load_results_ccxdat()
## Load results of ccx calculations from .dat file.
# @param self The python object self
@ -214,6 +213,10 @@ class FemToolsCcx(FemTools.FemTools):
mode_frequencies = ccxDatReader.import_dat(dat_result_file, self.analysis)
else:
raise Exception('FEM: No .dat results found at {}!'.format(dat_result_file))
for m in self.analysis.Member:
if m.isDerivedFrom("Fem::FemResultObject") and m.Eigenmode > 0:
m.EigenmodeFrequency = mode_frequencies[m.Eigenmode - 1]['frequency']
if mode_frequencies:
print(mode_frequencies)
for m in self.analysis.Member:
if m.isDerivedFrom("Fem::FemResultObject") and m.Eigenmode > 0:
for mf in mode_frequencies:
if m.Eigenmode == mf['eigenmode']:
m.EigenmodeFrequency = mf['frequency']