Skip to content

Commit

Permalink
FEM: calculix unit tests, move test from ccxtools to calculix solver
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jul 6, 2020
1 parent e10fae8 commit a1bf9d6
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 71 deletions.
71 changes: 0 additions & 71 deletions src/Mod/Fem/femtest/app/test_ccxtools.py
Expand Up @@ -26,7 +26,6 @@
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"

import sys
import unittest
from os.path import join

Expand Down Expand Up @@ -136,76 +135,6 @@ def test_box_static(
res_obj_name=res_obj_name,
)

# ********************************************************************************************
def test_ccxcantilever_hexa20(
self
):
from femexamples.ccx_cantilever_hexa20faceload import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_contact_shell_shell(
self
):
from femexamples.constraint_contact_shell_shell import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_contact_solid_solid(
self
):
# does not pass on travis, but on my local system it does, Bernd
return
# TODO does not pass on Python 2
if sys.version_info.major < 3:
return

from femexamples.constraint_contact_solid_solid import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_sectionprint(
self
):
from femexamples.constraint_section_print import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_tie(
self
):
from femexamples.constraint_tie import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_material_multiple(
self
):
from femexamples.material_multiple_twoboxes import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_material_nonlinear(
self
):
from femexamples.material_nl_platewithhole import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_thermomech_bimetall(
self
):
from femexamples.thermomech_bimetall import setup
setup(self.document, "ccxtools")
self.input_file_writing_test(None, get_namefromdef("test_"))

# ********************************************************************************************
def test_thermomech_flow1D(
self
Expand Down
96 changes: 96 additions & 0 deletions src/Mod/Fem/femtest/app/test_solver_calculix.py
Expand Up @@ -25,6 +25,7 @@
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"

import sys
import unittest
from os.path import join

Expand Down Expand Up @@ -77,6 +78,15 @@ def test_00print(
55 * "*"
))

# ********************************************************************************************
def test_box_frequency(
self
):
fcc_print("")
from femexamples.boxanalysis_frequency import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_box_static(
self
Expand All @@ -86,6 +96,92 @@ def test_box_static(
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_ccxcantilever_hexa20(
self
):
from femexamples.ccx_cantilever_hexa20faceload import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_contact_shell_shell(
self
):
from femexamples.constraint_contact_shell_shell import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_contact_solid_solid(
self
):
# does not pass on travis, but on my local system it does, Bernd
return
# TODO does not pass on Python 2
if sys.version_info.major < 3:
return

from femexamples.constraint_contact_solid_solid import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_sectionprint(
self
):
from femexamples.constraint_section_print import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_constraint_tie(
self
):
from femexamples.constraint_tie import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_material_multiple(
self
):
from femexamples.material_multiple_twoboxes import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_material_nonlinear(
self
):
from femexamples.material_nl_platewithhole import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_thermomech_bimetall(
self
):
from femexamples.thermomech_bimetall import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_thermomech_flow1D(
self
):
from femexamples.thermomech_flow1d import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def test_thermomech_spine(
self
):
from femexamples.thermomech_spine import setup
setup(self.document, "calculix")
self.input_file_writing_test(get_namefromdef("test_"))

# ********************************************************************************************
def input_file_writing_test(
self,
Expand Down

0 comments on commit a1bf9d6

Please sign in to comment.