Source code for Muscat.IO.AbaqusTools

# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
#

"""Abaqus tools
"""
import os

import Muscat.Containers.ElementsDescription as ED
from Muscat.Helpers.IO.Which import Which

InpNameToMuscat = {}

InpNameToMuscat["S3"] = ED.Triangle_3
InpNameToMuscat["CONN3D2"] = ED.Bar_2
InpNameToMuscat["T2D2"] = ED.Bar_2
InpNameToMuscat["CPS4R"] = ED.Quadrangle_4
InpNameToMuscat["C3D4"] = ED.Tetrahedron_4
InpNameToMuscat["C3D8"] = ED.Hexahedron_8
InpNameToMuscat["C3D8R"] = ED.Hexahedron_8
InpNameToMuscat["C3D8I"] = ED.Hexahedron_8
InpNameToMuscat["C3D10"] = ED.Tetrahedron_10
InpNameToMuscat["C3D10M"] = ED.Tetrahedron_10
InpNameToMuscat["C3D20"] = ED.Hexahedron_20
InpNameToMuscat["C3D6"] = ED.Wedge_6
InpNameToMuscat["T3D2"] = ED.Bar_2
InpNameToMuscat["CPS3"] = ED.Triangle_3
InpNameToMuscat["STRI3"] = ED.Triangle_3
InpNameToMuscat["CPS3"] = ED.Triangle_3
InpNameToMuscat["CPS4"] = ED.Quadrangle_4
InpNameToMuscat["CPS6"] = ED.Triangle_6
InpNameToMuscat["CPS8"] = ED.Quadrangle_8

permutation = {}
# permutation[ ED.Tetrahedron_4] = [0, 1, 3, 2]

# the first element in the InpNameToMuscat dict is kept
MuscatElementTypeToInpName = {}
for k, v in InpNameToMuscat.items():
    if k in MuscatElementTypeToInpName:  # pragma: no cover
        continue
    MuscatElementTypeToInpName[v] = k


defaultAbaqusExecName = "abaqus"


[docs]def GetAbaqusExec(): """Return the abaqus executable binary Returns ------- Union[str,None] the name of the executable for Abaqus, or None if not found """ abaqusExec = os.environ.get("ABAQUS_EXEC", defaultAbaqusExecName) return Which(abaqusExec)
[docs]def CheckIntegrity(GUI=False): return "OK"
if __name__ == "__main__": print(CheckIntegrity()) # pragma: no cover