Esempio n. 1
0
test.assertEqual(model.getSplittingMethod(),
                 code_aster.ModelSplitingMethod.Centralized)

model.build()

# Definition du modele Aster
model2 = code_aster.Model(mesh)

with test.assertRaisesRegex(RuntimeError, 'not allowed'):
    model2.addModelingOnMesh(
        code_aster.Physics.Thermal, code_aster.Modelings.DKT)

# Verification du comptage de référence sur le maillage
del mesh

with test.assertRaises(NameError):
    mesh

mesh2 = model.getMesh()
test.assertTrue('Tout' in mesh2.getGroupsOfCells())

# Vérification du debug
mesh2.debugPrint(66)

del coord
code_aster.saveObjects()

test.printSummary()

code_aster.close()
Esempio n. 2
0
kws, types = syntax.getmjm(" ", 0, 99)
test.assertEqual(len(kws), len(types))
test.assertEqual(len(kws), 3)
test.assertSequenceEqual(kws, ["IGNORE_ALARM", "IMPR_MACRO", "INFO"])
test.assertSequenceEqual(types, ["TX", "TX", "IS"])

rand = syntax.getran()
test.assertGreaterEqual(rand[0], 0.)
test.assertLessEqual(rand[0], 1.)

syntax.free()

# some more complex cases (factor keywords under conditional blocks)
syntax = CommandSyntax("DYNA_VIBRA", DYNA_VIBRA)
test.assertEqual(syntax.getName(), "DYNA_VIBRA")

test.assertTrue(syntax.getexm("", "TYPE_CALCUL"))
test.assertTrue(syntax.getexm("", "INFO"))

test.assertTrue(syntax.getexm("IMPRESSION", ""))
test.assertTrue(syntax.getexm("IMPRESSION", "NIVEAU"))

test.assertTrue(syntax.getexm("EXCIT", "CHARGE"))
test.assertTrue(syntax.getexm("EXCIT", "D_FONC_DT"))

test.printSummary()

code_aster.close(exit=True)

raise RuntimeError("no should pass here!")