Exemplo n.º 1
0
 private int NumberOfFacesPerElement(ElementType_t type)
 {
     if (number_of_coord_dimensions == 3)
     {
         if (type.Equals(ElementType_t.TRI_3) || type.Equals(ElementType_t.QUAD_4))
         {
             return(1);
         }
     }
     if (type.Equals(ElementType_t.HEXA_8))
     {
         return(6);
     }
     char[] number = type.ToString().ToCharArray();
     return(number[number.Length - 1] - 48);
 }
Exemplo n.º 2
0
        static CellType ToBoSSSCellType(this ElementType_t t)
        {
            switch (t)
            {
            case ElementType_t.ElementTypeNull: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.ElementTypeUserDefined: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.NODE: return(CellType.Point);

            case ElementType_t.BAR_2: return(CellType.Line_2);

            case ElementType_t.BAR_3: return(CellType.Line_3);

            case ElementType_t.TRI_3: return(CellType.Triangle_3);

            case ElementType_t.TRI_6: return(CellType.Triangle_6);

            case ElementType_t.QUAD_4: return(CellType.Square_4);

            case ElementType_t.QUAD_8: return(CellType.Square_8);

            case ElementType_t.QUAD_9: return(CellType.Square_9);

            case ElementType_t.TETRA_4: return(CellType.Tetra_Linear);

            case ElementType_t.TETRA_10: return(CellType.Tetra_10);

            case ElementType_t.PYRA_5: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PYRA_14: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PENTA_6: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PENTA_15: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PENTA_18: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.HEXA_8: return(CellType.Cube_8);

            case ElementType_t.HEXA_20: return(CellType.Cube_20);

            case ElementType_t.HEXA_27: return(CellType.Cube_27);

            case ElementType_t.MIXED: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.NGON_n: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            default: throw new NotImplementedException();
            }
        }
Exemplo n.º 3
0
 private static int NumberOfNodesPerElement(ElementType_t type)
 {
     char[] number = type.ToString().ToCharArray();
     return(number[number.Length - 1] - 48);
 }
Exemplo n.º 4
0
        static RefElement GetBoSSSElement(this ElementType_t t)
        {
            switch (t)
            {
            case ElementType_t.ElementTypeNull: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.ElementTypeUserDefined: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.NODE: return(Point.Instance);

            case ElementType_t.BAR_2: return(Line.Instance);

            case ElementType_t.BAR_3: return(Line.Instance);

            case ElementType_t.TRI_3: return(Triangle.Instance);

            case ElementType_t.TRI_6: return(Triangle.Instance);

            case ElementType_t.QUAD_4: return(Square.Instance);

            case ElementType_t.QUAD_8: return(Square.Instance);

            case ElementType_t.QUAD_9: return(Square.Instance);

            case ElementType_t.TETRA_4: return(Tetra.Instance);

            case ElementType_t.TETRA_10: return(Tetra.Instance);

            case ElementType_t.PYRA_5: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PYRA_14: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PENTA_6: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PENTA_15: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.PENTA_18: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.HEXA_8: return(Cube.Instance);

            case ElementType_t.HEXA_20: return(Cube.Instance);

            case ElementType_t.HEXA_27: return(Cube.Instance);

            case ElementType_t.MIXED: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            case ElementType_t.NGON_n: throw new NotSupportedException(string.Format("CGNS Element {0} not supported in BoSSS.", t.ToString()));

            default: throw new NotImplementedException();
            }
        }