Change the values of TypeEnum to all capitals

Hi,

I was trying to import an inp file. It has TOTALS = ONLY. But the program compares to ‘Only’.

Suggesting to change the TypeEnum to all capitals.

Also there is blank around = in TOTALS = ONLY in my file, so always need trim before comparing.

The third thing is when splitting with comma, need to consider the second line only has one RF value in my case, no comma.

Regards,

Cean

            // U, RF, NT
            //*NODE PRINT, NSET = ConstraintDisplacement003, TOTALS = ONLY
            //RF
namespace CaeModel
{
    [Serializable]
    public enum TotalsTypeEnum
    {
        [StandardValue("Yes", Description = "Sum of external forces is printed in addition to the individual node values.")]
        Yes,
        [StandardValue("Only", Description = "Only sum of external forces is printed.")]
        Only,
        [StandardValue("No", Description = "Only individual node values are printed (default).")]
        No
    }
1 Like

That would make it common with the input file readings in fortran (case insensitive)… So, I guess it would be a good idea.

I have this example can’t read correctly.

*STATIC, SOLVER=SPOOLES
 1.0, 1.0, 1.E-5, 1.0

Need change in Step.cs.

    public enum SolverTypeEnum
    {
        Default,
        PaStiX,
        Pardiso,
        Spooles,
        //
        [StandardValue("IterativeScaling", DisplayName = "Iterative scaling")]
        IterativeScaling,
        //
        [StandardValue("IterativeCholesky", DisplayName = "Iterative Cholesky")]
        IterativeCholesky
    }

@Matej what your think of this suggestion?

It is a good observation. I changed all calls to Enum.Parse in the .inp reader to account for the lettercase using a third parameter. The TotalsTypeEnum is now:

totalsType = (TotalsTypeEnum)Enum.Parse(typeof(TotalsTypeEnum), record2[1].Replace(" ", “”), true);

1 Like