FEM: solver framework, use small written modul import names in tasks
This commit is contained in:
@@ -32,7 +32,7 @@ import subprocess
|
||||
import os.path
|
||||
|
||||
import FreeCAD as App
|
||||
import femtools.femutils as FemUtils
|
||||
import femtools.femutils as femutils
|
||||
import feminout.importCcxFrdResults as importCcxFrdResults
|
||||
import feminout.importCcxDatResults as importCcxDatResults
|
||||
|
||||
@@ -113,8 +113,8 @@ class Results(run.Results):
|
||||
self.load_results_ccxdat()
|
||||
|
||||
def purge_results(self):
|
||||
for m in FemUtils.get_member(self.analysis, "Fem::FemResultObject"):
|
||||
if FemUtils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
|
||||
for m in femutils.get_member(self.analysis, "Fem::FemResultObject"):
|
||||
if femutils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
|
||||
self.analysis.Document.removeObject(m.Mesh.Name)
|
||||
self.analysis.Document.removeObject(m.Name)
|
||||
App.ActiveDocument.recompute()
|
||||
@@ -140,7 +140,7 @@ class Results(run.Results):
|
||||
raise Exception(
|
||||
'FEM: No .dat results found at {}!'.format(dat_result_file))
|
||||
if mode_frequencies:
|
||||
for m in FemUtils.get_member(self.analysis, "Fem::FemResultObject"):
|
||||
for m in femutils.get_member(self.analysis, "Fem::FemResultObject"):
|
||||
if m.Eigenmode > 0:
|
||||
for mf in mode_frequencies:
|
||||
if m.Eigenmode == mf['eigenmode']:
|
||||
@@ -171,13 +171,13 @@ class _Container(object):
|
||||
self.transform_constraints = self.get_several_member('Fem::ConstraintTransform')
|
||||
|
||||
for m in self.analysis.Group:
|
||||
if m.isDerivedFrom("Fem::FemMeshObject") and not FemUtils.is_of_type(m, 'Fem::FemMeshResult'):
|
||||
if m.isDerivedFrom("Fem::FemMeshObject") and not femutils.is_of_type(m, 'Fem::FemMeshResult'):
|
||||
if not self.mesh:
|
||||
self.mesh = m
|
||||
else:
|
||||
raise Exception('FEM: Multiple mesh in analysis not yet supported!')
|
||||
|
||||
def get_several_member(self, t):
|
||||
return FemUtils.get_several_member(self.analysis, t)
|
||||
return femutils.get_several_member(self.analysis, t)
|
||||
|
||||
## @}
|
||||
|
||||
@@ -28,7 +28,7 @@ __url__ = "http://www.freecadweb.org"
|
||||
|
||||
import subprocess
|
||||
import os.path
|
||||
import femtools.femutils as FemUtils
|
||||
import femtools.femutils as femutils
|
||||
|
||||
from .. import run
|
||||
from .. import settings
|
||||
@@ -45,8 +45,8 @@ class Check(run.Check):
|
||||
self.checkEquations()
|
||||
|
||||
def checkMeshType(self):
|
||||
mesh = FemUtils.get_single_member(self.analysis, "Fem::FemMeshObject")
|
||||
if not FemUtils.is_of_type(mesh, "Fem::FemMeshGmsh"):
|
||||
mesh = femutils.get_single_member(self.analysis, "Fem::FemMeshObject")
|
||||
if not femutils.is_of_type(mesh, "Fem::FemMeshGmsh"):
|
||||
self.report.error(
|
||||
"Unsupported type of mesh. "
|
||||
"Mesh must be created with gmsh.")
|
||||
@@ -84,7 +84,7 @@ class Prepare(run.Prepare):
|
||||
|
||||
def checkHandled(self, w):
|
||||
handled = w.getHandledConstraints()
|
||||
allConstraints = FemUtils.get_member(self.analysis, "Fem::Constraint")
|
||||
allConstraints = femutils.get_member(self.analysis, "Fem::Constraint")
|
||||
for obj in set(allConstraints) - handled:
|
||||
self.report.warning("Ignored constraint %s." % obj.Label)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import subprocess
|
||||
import os.path
|
||||
|
||||
import FreeCAD as App
|
||||
import femtools.femutils as FemUtils
|
||||
import femtools.femutils as femutils
|
||||
import feminout.importZ88O2Results as importZ88O2Results
|
||||
|
||||
from .. import run
|
||||
@@ -115,8 +115,8 @@ class Results(run.Results):
|
||||
self.load_results_z88o2()
|
||||
|
||||
def purge_results(self):
|
||||
for m in FemUtils.get_member(self.analysis, "Fem::FemResultObject"):
|
||||
if FemUtils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
|
||||
for m in femutils.get_member(self.analysis, "Fem::FemResultObject"):
|
||||
if femutils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
|
||||
self.analysis.Document.removeObject(m.Mesh.Name)
|
||||
self.analysis.Document.removeObject(m.Name)
|
||||
App.ActiveDocument.recompute()
|
||||
@@ -159,13 +159,13 @@ class _Container(object):
|
||||
self.transform_constraints = []
|
||||
|
||||
for m in self.analysis.Group:
|
||||
if m.isDerivedFrom("Fem::FemMeshObject") and not FemUtils.is_of_type(m, 'Fem::FemMeshResult'):
|
||||
if m.isDerivedFrom("Fem::FemMeshObject") and not femutils.is_of_type(m, 'Fem::FemMeshResult'):
|
||||
if not self.mesh:
|
||||
self.mesh = m
|
||||
else:
|
||||
raise Exception('FEM: Multiple mesh in analysis not yet supported!')
|
||||
|
||||
def get_several_member(self, t):
|
||||
return FemUtils.get_several_member(self.analysis, t)
|
||||
return femutils.get_several_member(self.analysis, t)
|
||||
|
||||
## @}
|
||||
|
||||
Reference in New Issue
Block a user