Skip to content

Commit

Permalink
FEM: ccx unit tests, sort methods by abc
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jan 19, 2020
1 parent 4c786b5 commit bfdb124
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 66 deletions.
18 changes: 9 additions & 9 deletions src/Mod/Fem/TestFem.py
Expand Up @@ -123,13 +123,13 @@
gf()
./bin/FreeCADCmd --run-test "femtest.app.test_femimport.TestObjectExistance.test_objects_existance"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_freq_analysis"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_static_analysis"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_static_contact_shell_shell"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_static_material_multiple"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_static_material_nonlinar"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_freq_analysis"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_thermomech_spine_analysis"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_thermomech_flow1D_analysis"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_static_contact_shell_shell"
./bin/FreeCADCmd --run-test "femtest.app.test_ccxtools.TestCcxTools.test_thermomech_spine_analysis"
./bin/FreeCADCmd --run-test "femtest.app.test_common.TestFemCommon.test_adding_refshaps"
./bin/FreeCADCmd --run-test "femtest.app.test_common.TestFemCommon.test_pyimport_all_FEM_modules"
./bin/FreeCADCmd --run-test "femtest.app.test_material.TestMaterialUnits.test_known_quantity_units"
Expand Down Expand Up @@ -165,25 +165,25 @@
gf("in")
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_analysis"))
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_freq_analysis"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_material_multiple"))
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_analysis"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_material_nonlinar"))
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_contact_shell_shell"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_freq_analysis"))
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_material_multiple"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_thermomech_spine_analysis"))
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_material_nonlinar"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_thermomech_flow1D_analysis"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_static_contact_shell_shell"))
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_ccxtools.TestCcxTools.test_thermomech_spine_analysis"))
import unittest
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.app.test_common.TestFemCommon.test_adding_refshaps"))
Expand Down
114 changes: 57 additions & 57 deletions src/Mod/Fem/femtest/app/test_ccxtools.py
Expand Up @@ -68,18 +68,18 @@ def test_00print(
))

# ********************************************************************************************
def test_static_analysis(
def test_freq_analysis(
self
):
# set up
from femexamples.boxanalysis import setup_static as setup
from femexamples.boxanalysis import setup_frequency as setup
setup(self.active_doc, "ccxtools")
test_name = "ccxtools static"
base_name = "cube_static"
res_obj_name = "CCX_Results"
test_name = "frequency"
base_name = "cube_frequency"
res_obj_name = "CCX_Mode1_Results"
analysis_dir = testtools.get_unit_test_tmp_dir(
self.temp_dir,
"FEM_ccx_static"
"FEM_ccx_frequency"
)

# test input file writing
Expand All @@ -100,38 +100,49 @@ def test_static_analysis(
)

# ********************************************************************************************
def test_static_material_multiple(
def test_static_analysis(
self
):
# set up
from femexamples.material_multiple_twoboxes import setup
from femexamples.boxanalysis import setup_static as setup
setup(self.active_doc, "ccxtools")
test_name = "multiple material"
base_name = "mat_multiple"
test_name = "ccxtools static"
base_name = "cube_static"
res_obj_name = "CCX_Results"
analysis_dir = testtools.get_unit_test_tmp_dir(
self.temp_dir,
"FEM_ccx_multimat"
"FEM_ccx_static"
)

# test input file writing
self.input_file_writing_test(
fea = self.input_file_writing_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
test_end=True,
)

# test result reading
self.result_reading_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
fea=fea,
res_obj_name=res_obj_name,
)

# ********************************************************************************************
def test_static_material_nonlinar(
def test_static_contact_shell_shell(
self
):
# set up
from femexamples.material_nl_platewithhole import setup
from femexamples.contact_shell_shell import setup
setup(self.active_doc, "ccxtools")
test_name = "nonlinear material"
base_name = "mat_nonlinear"
test_name = "contact shell shell"
base_name = "contact_shell_shell"
analysis_dir = testtools.get_unit_test_tmp_dir(
self.temp_dir,
"FEM_ccx_matnonlinear"
"FEM_ccx_contact_shell_shell",
)

# test input file writing
Expand All @@ -142,67 +153,45 @@ def test_static_material_nonlinar(
)

# ********************************************************************************************
def test_freq_analysis(
def test_static_material_multiple(
self
):
# set up
from femexamples.boxanalysis import setup_frequency as setup
from femexamples.material_multiple_twoboxes import setup
setup(self.active_doc, "ccxtools")
test_name = "frequency"
base_name = "cube_frequency"
res_obj_name = "CCX_Mode1_Results"
test_name = "multiple material"
base_name = "mat_multiple"
analysis_dir = testtools.get_unit_test_tmp_dir(
self.temp_dir,
"FEM_ccx_frequency"
"FEM_ccx_multimat"
)

# test input file writing
fea = self.input_file_writing_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
test_end=True,
)

# test result reading
self.result_reading_test(
self.input_file_writing_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
fea=fea,
res_obj_name=res_obj_name,
)

# ********************************************************************************************
def test_thermomech_spine_analysis(
def test_static_material_nonlinar(
self
):
# set up
from femexamples.thermomech_spine import setup
from femexamples.material_nl_platewithhole import setup
setup(self.active_doc, "ccxtools")
test_name = "thermomechanical"
base_name = "spine_thermomech"
res_obj_name = "CCX_Results"
test_name = "nonlinear material"
base_name = "mat_nonlinear"
analysis_dir = testtools.get_unit_test_tmp_dir(
self.temp_dir,
"FEM_ccx_thermomech"
"FEM_ccx_matnonlinear"
)

# test input file writing
fea = self.input_file_writing_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
test_end=True,
)

# test result reading
self.result_reading_test(
self.input_file_writing_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
fea=fea,
res_obj_name=res_obj_name,
)

# ********************************************************************************************
Expand Down Expand Up @@ -238,24 +227,35 @@ def test_thermomech_flow1D_analysis(
)

# ********************************************************************************************
def test_static_contact_shell_shell(
def test_thermomech_spine_analysis(
self
):
# set up
from femexamples.contact_shell_shell import setup
from femexamples.thermomech_spine import setup
setup(self.active_doc, "ccxtools")
test_name = "contact shell shell"
base_name = "contact_shell_shell"
test_name = "thermomechanical"
base_name = "spine_thermomech"
res_obj_name = "CCX_Results"
analysis_dir = testtools.get_unit_test_tmp_dir(
self.temp_dir,
"FEM_ccx_contact_shell_shell",
"FEM_ccx_thermomech"
)

# test input file writing
self.input_file_writing_test(
fea = self.input_file_writing_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
test_end=True,
)

# test result reading
self.result_reading_test(
test_name=test_name,
base_name=base_name,
analysis_dir=analysis_dir,
fea=fea,
res_obj_name=res_obj_name,
)

# ********************************************************************************************
Expand Down

0 comments on commit bfdb124

Please sign in to comment.