Exemplo n.º 1
0
        /*
         * protected void WriteBoundaryConditions(List<string> inp)
         * {
         *  inp.Add("**");
         *  inp.Add("** BOUNDARY CONDITIONS");
         *  inp.Add("**");
         *
         *  foreach (BoundaryCondition bc in BoundaryConditions)
         *  {
         *      WriteBoundaryCondition(inp, bc);
         *  }
         * }
         */

        protected void WriteBoundaryCondition(List <string> inp, BoundaryCondition bc)
        {
            inp.Add($"** Name: {bc.Name} Type: {bc.Type}");
            inp.Add("*Boundary");

            switch (bc.Type)
            {
            case (BoundaryCondition.BoundaryConditionType.CUSTOM):
                throw new NotImplementedException("CUSTOM boundary condition not implemented yet.");
                inp.Add($"{bc.Set.Name}");
                break;

            default:
                if (bc.Set != null)
                {
                    inp.Add($"{bc.Set.Name}, {bc.Type.ToString()}");
                }
                break;
            }



            //inp.Add("Set-1, 1, 1");
            //inp.Add("Set-1, 2, 2");
            //inp.Add("Set-1, 3, 3");
        }
Exemplo n.º 2
0
        /*
         * protected void WriteBoundaryConditions(List<string> inp)
         * {
         *  inp.Add("**");
         *  inp.Add("** BOUNDARY CONDITIONS");
         *  inp.Add("**");
         *
         *  foreach (BoundaryCondition bc in BoundaryConditions)
         *  {
         *      WriteBoundaryCondition(inp, bc);
         *  }
         * }
         */

        protected void WriteBoundaryCondition(List <object> jbounds, BoundaryCondition bc)
        {
            var jbound = new Dictionary <string, object>();

            jbound.Add("name", bc.Name);
            jbound.Add("type", bc.Type);
            jbound.Add("type_string", bc.Type.ToString());

            if (bc.Set != null)
            {
                jbound.Add("element_set", bc.Set.Name);
            }

            jbounds.Add(jbound);
        }