Exemple #1
0
 def checkSupported(self, allSupported):
     for m in self.analysis.Group:
         if FemUtils.isOfType(m, "Fem::Constraint"):
             supported = False
             for sc in allSupported:
                 if FemUtils.isOfType(m, *sc):
                     supported = True
             if not supported:
                 self.report.warning(
                     "Ignored unsupported constraint: %s" % m.Label)
     return True
Exemple #2
0
 def checkMeshType(self):
     mesh = FemUtils.getSingleMember(self.analysis, "Fem::FemMeshObject")
     if not FemUtils.isOfType(mesh, "FemMeshGmsh"):
         self.report.error(
             "Unsupported type of mesh. "
             "Mesh must be created with gmsh.")
         self.fail()
         return False
     return True
Exemple #3
0
 def _handleFluxsolver(self):
     activeIn = []
     for equation in self.solver.Group:
         if FemUtils.isOfType(equation, "Fem::FemEquationElmerFluxsolver"):
             if equation.References:
                 activeIn = equation.References[0][1]
             else:
                 activeIn = self._getAllBodies()
             solverSection = self._getFluxsolverSolver(equation)
             for body in activeIn:
                 self._addSolver(body, solverSection)
Exemple #4
0
 def _handleElasticity(self):
     activeIn = []
     for equation in self.solver.Group:
         if FemUtils.isOfType(equation, "Fem::FemEquationElmerElasticity"):
             if equation.References:
                 activeIn = equation.References[0][1]
             else:
                 activeIn = self._getAllBodies()
             solverSection = self._getElasticitySolver(equation)
             for body in activeIn:
                 self._addSolver(body, solverSection)
     if activeIn:
         self._handleElasticityConstants()
         self._handleElasticityBndConditions()
         self._handleElasticityInitial(activeIn)
         self._handleElasticityBodyForces(activeIn)
         self._handleElasticityMaterial(activeIn)
Exemple #5
0
 def _handleFlow(self):
     activeIn = []
     for equation in self.solver.Group:
         if FemUtils.isOfType(equation, "Fem::FemEquationElmerFlow"):
             if equation.References:
                 activeIn = equation.References[0][1]
             else:
                 activeIn = self._getAllBodies()
             solverSection = self._getFlowSolver(equation)
             for body in activeIn:
                 self._addSolver(body, solverSection)
     if activeIn:
         self._handleFlowConstants()
         self._handleFlowBndConditions()
         self._handleFlowInitialVelocity(activeIn)
         #self._handleFlowInitial(activeIn)
         #self._handleFlowBodyForces(activeIn)
         self._handleFlowMaterial(activeIn)
         self._handleFlowEquation(activeIn)
Exemple #6
0
 def purge_results(self):
     for m in FemUtils.getMember(self.analysis, "Fem::FemResultObject"):
         if FemUtils.isOfType(m.Mesh, "FemMeshResult"):
             self.analysis.Document.removeObject(m.Mesh.Name)
         self.analysis.Document.removeObject(m.Name)
     App.ActiveDocument.recompute()