FEM: unit tests, ccx tools frequency, delete not used document objects
This commit is contained in:
@@ -171,7 +171,7 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
|
||||
def test_freq_analysis(self):
|
||||
fcc_print('--------------- Start of FEM tests ---------------')
|
||||
box = self.active_doc.addObject("Part::Box", "Box")
|
||||
self.active_doc.addObject("Part::Box", "Box")
|
||||
fcc_print('Checking FEM new analysis...')
|
||||
analysis = ObjectsFem.makeAnalysis(self.active_doc, 'Analysis')
|
||||
self.assertTrue(analysis, "FemTest of new analysis failed")
|
||||
@@ -185,7 +185,7 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
solver_object.IterationsControlParameterTimeUse = False
|
||||
solver_object.EigenmodesCount = 10
|
||||
solver_object.EigenmodeHighLimit = 1000000.0
|
||||
solver_object.EigenmodeLowLimit = 0.0
|
||||
solver_object.EigenmodeLowLimit = 0.01
|
||||
self.assertTrue(solver_object, "FemTest of new solver failed")
|
||||
analysis.addObject(solver_object)
|
||||
|
||||
@@ -200,31 +200,6 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
self.assertTrue(material_object, "FemTest of new material failed")
|
||||
analysis.addObject(material_object)
|
||||
|
||||
fcc_print('Checking FEM new fixed constraint...')
|
||||
fixed_constraint = self.active_doc.addObject("Fem::ConstraintFixed", "FemConstraintFixed")
|
||||
fixed_constraint.References = [(box, "Face1")]
|
||||
self.assertTrue(fixed_constraint, "FemTest of new fixed constraint failed")
|
||||
analysis.addObject(fixed_constraint)
|
||||
|
||||
fcc_print('Checking FEM new force constraint...')
|
||||
force_constraint = self.active_doc.addObject("Fem::ConstraintForce", "FemConstraintForce")
|
||||
force_constraint.References = [(box, "Face6")]
|
||||
force_constraint.Force = 40000.0
|
||||
force_constraint.Direction = (box, ["Edge5"])
|
||||
self.active_doc.recompute()
|
||||
force_constraint.Reversed = True
|
||||
self.active_doc.recompute()
|
||||
self.assertTrue(force_constraint, "FemTest of new force constraint failed")
|
||||
analysis.addObject(force_constraint)
|
||||
|
||||
fcc_print('Checking FEM new pressure constraint...')
|
||||
pressure_constraint = self.active_doc.addObject("Fem::ConstraintPressure", "FemConstraintPressure")
|
||||
pressure_constraint.References = [(box, "Face2")]
|
||||
pressure_constraint.Pressure = 1000.0
|
||||
pressure_constraint.Reversed = False
|
||||
self.assertTrue(pressure_constraint, "FemTest of new pressure constraint failed")
|
||||
analysis.addObject(pressure_constraint)
|
||||
|
||||
fcc_print('Checking FEM new mesh...')
|
||||
from .testfiles.ccx.cube_mesh import create_nodes_cube
|
||||
from .testfiles.ccx.cube_mesh import create_elements_cube
|
||||
@@ -730,7 +705,6 @@ def create_test_results():
|
||||
|
||||
print("create frequency result files")
|
||||
fea.reset_all()
|
||||
FreeCAD.ActiveDocument.CalculiX.AnalysisType = 'frequency'
|
||||
fea.solver.EigenmodesCount = 1 # we should only have one result object
|
||||
fea.run()
|
||||
fea.load_results()
|
||||
|
||||
@@ -429,53 +429,6 @@ Evolumes
|
||||
*ELSET,ELSET=MechanicalMaterialSolid
|
||||
Evolumes
|
||||
|
||||
***********************************************************
|
||||
** Node sets for fixed constraint
|
||||
** written by write_node_sets_constraints_fixed function
|
||||
** FemConstraintFixed
|
||||
*NSET,NSET=FemConstraintFixed
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
45,
|
||||
46,
|
||||
47,
|
||||
48,
|
||||
49,
|
||||
50,
|
||||
51,
|
||||
52,
|
||||
53,
|
||||
54,
|
||||
55,
|
||||
56,
|
||||
57,
|
||||
58,
|
||||
59,
|
||||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
68,
|
||||
69,
|
||||
|
||||
***********************************************************
|
||||
** Materials
|
||||
** written by write_materials function
|
||||
@@ -499,17 +452,7 @@ Evolumes
|
||||
** written by write_step_begin function
|
||||
*STEP
|
||||
*FREQUENCY
|
||||
10,0.0,1000000.0
|
||||
|
||||
|
||||
***********************************************************
|
||||
** Fixed Constraints
|
||||
** written by write_constraints_fixed function
|
||||
** FemConstraintFixed
|
||||
*BOUNDARY
|
||||
FemConstraintFixed,1
|
||||
FemConstraintFixed,2
|
||||
FemConstraintFixed,3
|
||||
10,0.01,1000000.0
|
||||
|
||||
|
||||
***********************************************************
|
||||
|
||||
Reference in New Issue
Block a user