예제 #1
0
    def test_calc_cog(self):

        a = build_test_model()
        p = a.parts["ParametricModel"]
        cog = p.fem.elements.calc_cog()
        tol = 0.01

        assert abs(roundoff(cog.p[0]) - 2.5) < tol
        assert abs(roundoff(cog.p[1]) - 2.5) < tol
        assert abs(roundoff(cog.p[2]) - 1.5) < tol
        assert abs(roundoff(cog.tot_mass) - 7854.90) < tol
        assert abs(roundoff(cog.tot_vol) - 1.001) < tol
예제 #2
0
    def test_write_test_model(self):
        a = build_test_model()
        fs = a.fem.add_set(
            FemSet("Eall", [
                el for el in a.get_by_name(
                    "ParametricModel").fem.elements.elements
            ], "elset"))

        my_step = Step("static",
                       "static",
                       total_time=1,
                       max_incr=1,
                       init_incr=1,
                       nl_geom=True,
                       restart_int=1)
        my_step.add_load(Load("Gravity", "gravity", -9.81, fem_set=fs))
        a.fem.add_step(my_step)

        a.to_fem("my_calculix", fem_format="calculix",
                 overwrite=True)  # , execute=True, exit_on_complete=False)
예제 #3
0
 def test_write_usfos(self):
     a = build_test_model()
     a.to_fem("my_usfos", fem_format="usfos", overwrite=True)
예제 #4
0
 def test_write_test_model(self):
     a = build_test_model()
     a.to_fem("simple_stru", fem_format="code_aster", overwrite=True)
예제 #5
0
 def test_write_test_model(self):
     a = build_test_model()
     a.to_fem("my_abaqus", fem_format="abaqus", overwrite=True)