Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOOSE Input Incorrect Parse of Multi-line String #794

Closed
10 tasks done
elementx54 opened this issue Sep 17, 2018 · 1 comment · Fixed by #1204
Closed
10 tasks done

MOOSE Input Incorrect Parse of Multi-line String #794

elementx54 opened this issue Sep 17, 2018 · 1 comment · Fixed by #1204
Assignees

Comments

@elementx54
Copy link
Contributor

elementx54 commented Sep 17, 2018


Issue Description

What did you expect to see happen?

In my MOOSE input file I have a multi-line string:

type = ParsedFunction
function = 'rT := temperature / 1000.0;
            cp_f := 52.1743 + 87.951 * rT - 82.2411 * pow(rT, 2) + 31.542 * pow(rT, 3) - 2.6334 * pow(rT, 4) - 0.7139 * pow(rT, -2);
            cp_rho_fuel := 1.0e-6 * rho_fuel / M_fuel * cp_f;
            cp_rho_graphite := 1e-9 * rho_graphite / (11.07 * pow(temperature, -1.644) + 0.0003688 * pow(temperature, 0.02191));
            rho_UO2 * cp_rho_fuel + (1 - rho_UO2) * cp_rho_graphite'

It treats each line as if it was not part of the string. This could be a problem if someone was changing a matrix of values using Raven.

What did you see instead?

The new input spawned by Raven had: (the first line had the problem in #792 )

function = 'rT :
type = ParsedFunction
cp_f : = 52.1743 + 87.951 * rT - 82.2411 * pow(rT, 2) + 31.542 * pow(rT, 3) - 2.6334 * pow(rT, 4) - 0.7139 * pow(rT, -2);
cp_rho_fuel : = 1.0e-6 * rho_fuel / M_fuel * cp_f;
cp_rho_graphite : = 1e-9 * rho_graphite / (11.07 * pow(temperature, -1.644) + 0.0003688 * pow(temperature, 0.02191));
rho_UO2 * cp_rho_fuel + (1 - rho_UO2) * cp_rho_graphite'

It doesn't preserve the order (which is important for a multi-line string) and some other lines in the block can end up between the lines that were part of the string.

Do you have a suggested fix for the development team?

Not really, I suggest to check for an open ' and then end at the next '. I did find a work around: I could put the multi-line string on one line and it works (with the fix in #793 ). So perhaps taking a multi-line string and converting it to a single line string, first could work.

Please attach the input file(s) that generate this error. The simpler the input, the faster we can find the issue.

For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.

  • 1. Is it tagged with a type: defect or improvement?
  • 2. Is it tagged with a priority: critical, normal or minor?
  • 3. If it will impact requirements or requirements tests, is it tagged with requirements?
  • 4. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • 5. Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

  • 1. If the issue is a defect, is the defect fixed?
  • 2. If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • 3. If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)?
  • 4. If the issue is a defect, does it impact the latest stable branch? If yes, is there any issue tagged with stable (create if needed)?
  • 5. If the issue is being closed without a merge request, has an explanation of why it is being closed been provided?
@alfoa alfoa added priority_normal task This tag should be used for any new capability, improvement or enanchment external interfaces devel issues in current devel defect and removed task This tag should be used for any new capability, improvement or enanchment labels Sep 17, 2018
@PaulTalbot-INL PaulTalbot-INL self-assigned this Apr 7, 2020
@alfoa
Copy link
Collaborator

alfoa commented Apr 16, 2020

Closure checklist passed.

An email should be sent.

Closure approved via PR #1204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants