Skip to content

Commit

Permalink
FEM: pre checks, do not allow youngs modulus and thermal conductivity…
Browse files Browse the repository at this point in the history
… (later for thermomech analysis) to be 0.0
  • Loading branch information
berndhahnebach committed Jan 14, 2017
1 parent e441c2a commit eb9f1d0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Mod/Fem/FemTools.py
Expand Up @@ -307,6 +307,7 @@ def update_objects(self):
self.shell_thicknesses.append(shell_thickness_dict)

def check_prerequisites(self):
import Units
message = ""
# analysis
if not self.analysis:
Expand Down Expand Up @@ -352,20 +353,27 @@ def check_prerequisites(self):
has_no_references = True
for m in self.materials_linear:
mat_map = m['Object'].Material
if 'YoungsModulus' not in mat_map:
if 'YoungsModulus' in mat_map:
# print Units.Quantity(mat_map['YoungsModulus']).Value
if not Units.Quantity(mat_map['YoungsModulus']).Value:
message += "Value of YoungsModulus is set to 0.0.\n"
else:
message += "No YoungsModulus defined for at least one material.\n"
if 'PoissonRatio' not in mat_map:
message += "No PoissonRatio defined for at least one material.\n"
message += "No PoissonRatio defined for at least one material.\n" # PoissonRatio is allowed to be 0.0 (in ccx), but it should be set anyway.
if self.analysis_type == "frequency" or self.selfweight_constraints:
if 'Density' not in mat_map:
message += "No Density defined for at least one material.\n"
if self.analysis_type == "thermomech":
if 'ThermalConductivity' not in mat_map:
if 'ThermalConductivity' in mat_map:
if not Units.Quantity(mat_map['ThermalConductivity']).Value:
message += "Value of ThermalConductivity is set to 0.0.\n"
else:
message += "Thermomechanical analysis: No ThermalConductivity defined for at least one material.\n"
if 'ThermalExpansionCoefficient' not in mat_map:
message += "Thermomechanical analysis: No ThermalExpansionCoefficient defined for at least one material.\n"
message += "Thermomechanical analysis: No ThermalExpansionCoefficient defined for at least one material.\n" # allowed to be 0.0 (in ccx)
if 'SpecificHeat' not in mat_map:
message += "Thermomechanical analysis: No SpecificHeat defined for at least one material.\n"
message += "Thermomechanical analysis: No SpecificHeat defined for at least one material.\n" # allowed to be 0.0 (in ccx)
for m in self.materials_linear:
has_nonlinear_material = False
for nlm in self.materials_nonlinear:
Expand Down

0 comments on commit eb9f1d0

Please sign in to comment.