Skip to content

Commenting blocks in control file leads to crash #157

Description

@hmhaase

The following crashes:

\begin{CONTROL_INPUT}
   \begin{RUN_PARAMETERS}
      mesh file name = IceCreamCone.mesh
      plot file name = IceCreamCone.tec
      stats file name = IceCreamCone.txt
      mesh file format = ISM-V2
      polynomial order = 5
      plot file format = skeleton
   \end{RUN_PARAMETERS}

   \begin{BACKGROUND_GRID}
      background grid size = [0.500000, 0.500000, 0.000000]
   \end{BACKGROUND_GRID}

   \begin{SPRING_SMOOTHER}
      smoothing type = LinearAndCrossbarSpring
      smoothing = ON
   \end{SPRING_SMOOTHER}
\end{CONTROL_INPUT}

\begin{MODEL}
   \begin{OUTER_BOUNDARY}
      \begin{CIRCULAR_ARC}
         units = degrees
         name = outerCircle
         radius = 4.0
         start angle = 0.0
         center = [0.000000, -1.000000, 0.000000]
         end angle = 360.0
      \end{CIRCULAR_ARC}
   \end{OUTER_BOUNDARY}

   \begin{INNER_BOUNDARIES}
      \begin{CHAIN}
         name = IceCreamCone
            \begin{END_POINTS_LINE}
               name = cone1
               xEnd = [1.000000, 0.000000, 0.000000]
               xStart = [0.000000, -3.000000, 0.000000]
            \end{END_POINTS_LINE}
            \begin{CIRCULAR_ARC}
               units = degrees
               name = iceCream
               radius = 1.0
               start angle = 0.0
               center = [0.000000, 0.000000, 0.000000]
               end angle = 180.0
            \end{CIRCULAR_ARC}
            \begin{END_POINTS_LINE}
               name = cone2
               xEnd = [0.000000, -3.000000, 0.000000]
               xStart = [-1.000000, 0.000000, 0.000000]
            \end{END_POINTS_LINE}
      \end{CHAIN}

%
%      \begin{CHAIN}
%         name = hole
%            \begin{CIRCULAR_ARC}
%               units = degrees
%               name = hole
%               radius = 0.5
%               start angle = 0.0
%               center = [2.000000,0.000000,0.000000]
%               end angle = 360.0
%            \end{CIRCULAR_ARC}
%      \end{CHAIN}
%

   \end{INNER_BOUNDARIES}
\end{MODEL}

\end{FILE}

The likely cause is the ordering of these if statements:

IF ( INDEX(STRING = line, SUBSTRING = "begin{") > 0) THEN !Start reading a block
CALL startNewCollectionInCollection(fileUnit,line,collection)
IF(catch(FATAL_ERROR_EXCEPTION)) EXIT
ELSE IF (INDEX(STRING = line, SUBSTRING = "end{") > 0) THEN
IF(INDEX(STRING = line, SUBSTRING = "end{FILE}") > 0) RETURN
CALL completeBlock(line,objectName)
RETURN ! Done with this block, one way or another
ELSE IF (TRIM(line) == "" .OR. line(1:1) == "%") THEN !Skip blank lines

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions