Coverage for constants.py: 100%

1 from collections import defaultdict, namedtuple

2

3# ----------------------------------------------------------------------------

4# key names for container dict

5 _SECTION = namedtuple("SECTION", ["title", "type", "args"])

6 BULK = _SECTION("bulk", defaultdict, (list,))

7 EXEC = _SECTION("exec", dict, ())

8 CASE = _SECTION("cases", dict, ())

9 PARAMS = _SECTION("params", dict, ())

10 COMMENTS = _SECTION("comments", list, ())

11 META = _SECTION("meta", dict, ())

12 SUMMARY = _SECTION("summary", defaultdict, (set,))

13

14# # cards families

15# NODE = 'node'

16 ELEMENT = "element"

17 PROPERTY = "property"

18 MATERIAL = "material"

19 LOADING = "load"

20 BOUNDARY = "boundary"

21 AXIS = "axis"

22 UNKNOWN = "unknown cards"

23

24# ----------------------------------------------------------------------------

25# elements shapes: used by elements decorators

26 Shapes = namedtuple("SHAPE", ("VERTICE", "LINE", "TRIA", "QUAD", "MPC"))

27 shapes = Shapes(VERTICE="point", LINE="line", TRIA="triangle", QUAD="quad", MPC="mpc")

28

29# ----------------------------------------------------------------------------

30# VTK shapes

31 VTKShapes = {

32 shapes.TRIA: "VTK_TRIANGLE",

33 shapes.QUAD: "VTK_QUAD",

34 shapes.LINE: "VTK_LINE",

35 shapes.MPC: "VTK_LINE",

36 shapes.VERTICE: "VTK_VERTEX",

37}

38

39# -----------------------------------------------------------------------------

40# GMSH elemets type

41 GMSHElementTypes = {

42 shapes.LINE: 1,

43 shapes.TRIA: 2,

44 shapes.QUAD: 3,

45 shapes.VERTICE: 15,

46}

47

48# name (eg. "MAT1") of available cards. filled by cards decorator

49 CARDS_REGISTER = []