public static void Test3()
        {
            var model = new BriefFiniteElementNet.Model();

            var p  = new Point[20];
            var ns = new Node[20];


            p[0]  = new Point(x: 0, y: 1, z: 0);
            p[1]  = new Point(x: 0, y: 0, z: 0);
            p[2]  = new Point(x: 0.20, y: 0, z: 0);
            p[3]  = new Point(x: 0.20, y: 0, z: 0.20);
            p[4]  = new Point(x: 0.20, y: 1, z: 0);
            p[5]  = new Point(x: 0.20, y: 1, z: 0.20);
            p[6]  = new Point(x: 0, y: 1, z: 0.20);
            p[7]  = new Point(x: 0, y: 0, z: 0.20);
            p[8]  = new Point(x: 0, y: 0.50, z: 0);
            p[9]  = new Point(x: 0.20, y: 0.50, z: 0);
            p[10] = new Point(x: 0, y: 0.50, z: 0.20);
            p[11] = new Point(x: 0.20, y: 0.50, z: 0.20);
            p[12] = new Point(x: 0.20, y: 0.25, z: 0.20);
            p[13] = new Point(x: 0, y: 0.25, z: 0.20);
            p[14] = new Point(x: 0, y: 0.25, z: 0);
            p[15] = new Point(x: 0.20, y: 0.25, z: 0);
            p[16] = new Point(x: 0.20, y: 0.75, z: 0.20);
            p[17] = new Point(x: 0.20, y: 0.75, z: 0);
            p[18] = new Point(x: 0, y: 0.75, z: 0);
            p[19] = new Point(x: 0, y: 0.75, z: 0.20);

            for (var i = 0; i < 20; i++)
            {
                model.Nodes.Add(ns[i] = new Node(p[i]));
                ns[i].Label           = "n" + i.ToString(CultureInfo.CurrentCulture);
                ns[i].Constraints     = Constraints.RotationFixed;
            }



            var mesh = new int[24][];

            mesh[0]  = new int[] { 0, 4, 16, 17 };
            mesh[1]  = new int[] { 8, 15, 12, 14 };
            mesh[2]  = new int[] { 8, 16, 17, 18 };
            mesh[3]  = new int[] { 10, 8, 11, 12 };
            mesh[4]  = new int[] { 5, 19, 0, 16 };
            mesh[5]  = new int[] { 1, 15, 14, 12 };
            mesh[6]  = new int[] { 8, 10, 11, 16 };
            mesh[7]  = new int[] { 3, 13, 1, 7 };
            mesh[8]  = new int[] { 3, 13, 12, 1 };
            mesh[9]  = new int[] { 8, 12, 13, 14 };
            mesh[10] = new int[] { 1, 15, 12, 2 };
            mesh[11] = new int[] { 9, 8, 11, 16 };
            mesh[12] = new int[] { 10, 8, 12, 13 };
            mesh[13] = new int[] { 5, 0, 4, 16 };
            mesh[14] = new int[] { 5, 19, 6, 0 };
            mesh[15] = new int[] { 8, 19, 16, 18 };
            mesh[16] = new int[] { 8, 19, 10, 16 };
            mesh[17] = new int[] { 0, 19, 18, 16 };
            mesh[18] = new int[] { 1, 3, 2, 12 };
            mesh[19] = new int[] { 8, 15, 9, 12 };
            mesh[20] = new int[] { 13, 12, 1, 14 };
            mesh[21] = new int[] { 8, 9, 11, 12 };
            mesh[22] = new int[] { 9, 8, 16, 17 };
            mesh[23] = new int[] { 16, 0, 17, 18 };

            foreach (var elm in mesh)
            {
                var felm = new Tetrahedral();

                felm.Nodes[0] = ns[elm[0]];
                felm.Nodes[1] = ns[elm[1]];
                felm.Nodes[2] = ns[elm[2]];
                felm.Nodes[3] = ns[elm[3]];

                felm.E  = 210e9;
                felm.Nu = 0.33;
                model.Elements.Add(felm);
            }


            var relm = new BriefFiniteElementNet.MpcElements.RigidElement_MPC();

            relm.Nodes = new NodeList()
            {
                ns[0], ns[4], ns[5], ns[6]
            };
            relm.UseForAllLoads = true;
            //model.MpcElements.Add(relm);

            ns[1].Constraints = ns[2].Constraints = ns[3].Constraints = ns[7].Constraints = Constraints.Fixed;



            var load = new BriefFiniteElementNet.NodalLoad();
            var frc  = new Force();

            frc.Fz     = 1000;// 1kN force in Z direction
            load.Force = frc;

            ns[5].Loads.Add(load);
            ns[6].Loads.Add(load);

            model.Solve_MPC();

            var d5 = ns[5].GetNodalDisplacement();
            var d6 = ns[6].GetNodalDisplacement();

            Console.WriteLine("Nodal displacement in Z direction is {0} meters (thus {1} mm)", d5.DZ, d5.DZ * 1000);
            Console.WriteLine("Nodal displacement in Z direction is {0} meters (thus {1} mm)", d6.DZ, d6.DZ * 1000);

            var tetra  = model.Elements[0] as Tetrahedral;
            var stress = tetra.GetInternalForce(LoadCombination.DefaultLoadCombination);
        }
        /// <summary>
        /// Method that reads an Abaqus input file and returns a BFE model with the same nodes and elements
        /// </summary>
        /// <param name="path">Path to an input file</param>
        /// <returns>A BFE model</returns>
        public static Model AbaqusInputToBFE(string pathToInputFile)
        {
            var buf = new Model();

            //splitting char
            char delimiter = ',';
            Node node;
            TetrahedronElement element;

            //list for the node- and elementsets
            List <NodeSet>    nodeSets    = new List <NodeSet>();
            List <ElementSet> elementSets = new List <ElementSet>();

            using (StreamReader sr = File.OpenText(pathToInputFile))
            {
                string[] split;
                selectedInputVariable selectedVar = selectedInputVariable.Nodes;
                string input = sr.ReadLine();
                while (input != null)
                {
                    split = input.Split(delimiter);
                    if (split[0].Contains('*'))
                    {
                        switch (split[0])
                        {
                        case "*Node":
                            selectedVar = selectedInputVariable.Nodes;
                            break;

                        case "*Element":
                            selectedVar = selectedInputVariable.Elements;
                            break;

                        case "*Nset":
                            selectedVar = selectedInputVariable.NodeSet;
                            nodeSets.Add(new NodeSet()
                            {
                                Name = split[1].Replace("nset=", "")
                            });
                            break;

                        case "*Elset":
                            selectedVar = selectedInputVariable.ElementSet;
                            elementSets.Add(new ElementSet()
                            {
                                Name = split[1].Replace("elset=", "")
                            });
                            break;

                        case "*Cload":
                            selectedVar = selectedInputVariable.CLoad;
                            break;

                        case "*Boundary":
                            selectedVar = selectedInputVariable.BC;
                            break;

                        default:
                            selectedVar = selectedInputVariable.Other;
                            break;
                        }
                    }
                    else
                    {
                        switch (selectedVar)
                        {
                        case selectedInputVariable.Nodes:
                        {
                            node = ReadNode(input, delimiter);
                            if (node != null)
                            {
                                //tetrahedron element - > fix rotation
                                node.Constraints = Constraints.RotationFixed;
                                buf.Nodes.Add(node);
                            }
                            break;
                        }

                        case selectedInputVariable.Elements:
                        {
                            element = ReadTetraElement(input, delimiter, buf.Nodes);
                            if (element != null)
                            {
                                element.Material = UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.25);
                                element.FixNodeOrder();
                                buf.Elements.Add(element);
                            }
                            break;
                        }

                        case selectedInputVariable.NodeSet:
                        {
                            for (int i = 0; i < split.Count(); i++)
                            {
                                nodeSets[nodeSets.Count - 1].Nodes.Add(Convert.ToInt32(split[i]));
                            }
                            break;
                        }

                        case selectedInputVariable.ElementSet:
                        {
                            for (int i = 0; i < split.Count(); i++)
                            {
                                elementSets[elementSets.Count - 1].Elements.Add(Convert.ToInt32(split[i]));
                            }
                            break;
                        }

                        case selectedInputVariable.CLoad:
                        {
                            NodeSet set = nodeSets.Where(x => x.Name.Replace(" ", "") == split[0].Replace(" ", "")).FirstOrDefault();
                            if (set != null)
                            {
                                //determine the magnitude of the load
                                var load = new BriefFiniteElementNet.NodalLoad();
                                var frc  = new Force();
                                if (Convert.ToInt32(split[1]) == 1)
                                {
                                    frc.Fx     = Convert.ToDouble(split[2]);
                                    load.Force = frc;
                                }
                                else if (Convert.ToInt32(split[1]) == 2)
                                {
                                    frc.Fy     = Convert.ToDouble(split[2]);
                                    load.Force = frc;
                                }
                                else if (Convert.ToInt32(split[1]) == 3)
                                {
                                    frc.Fz     = Convert.ToDouble(split[2]);
                                    load.Force = frc;
                                }
                                //add the load to the nodes
                                foreach (var nodeLabel in set.Nodes)
                                {
                                    buf.Nodes[nodeLabel - 1].Loads.Add(load);
                                }
                            }
                            break;
                        }

                        case selectedInputVariable.BC:
                        {
                            NodeSet set = nodeSets.Where(x => x.Name.Replace(" ", "") == split[0].Replace(" ", "")).FirstOrDefault();
                            if (set != null)
                            {
                                //add the load to the nodes
                                foreach (var nodeLabel in set.Nodes)
                                {
                                    buf.Nodes[nodeLabel - 1].Constraints = Constraints.Fixed;
                                }
                            }
                            break;
                        }

                        default:
                            break;
                        }
                    }
                    input = sr.ReadLine();
                }
            }
            return(buf);
        }