Skip to content
Snippets Groups Projects
Commit 1804d3fe authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: additional #word and #message dictionary directives (#2276)

- use `#word` to concatenate, expand content with the resulting string
  being treated as a word token. Can be used in dictionary or
  primitive context.

  In dictionary context, it fills the gap for constructing dictionary
  names on-the-fly. For example,

  ```
  #word "some_prefix_solverInfo_${application}"
  {
      type    solverInfo;
      libs    (utilityFunctionObjects);
      ...
  }
  ```

  The '#word' directive will automatically squeeze out non-word
  characters. In the block content form, it will also strip out
  comments. This means that this type of content should also work:

  ```
  #word {
     some_prefix_solverInfo
     /* Appended with application name (if defined) */
     ${application:+_}  // Use '_' separator
     ${application}     // The application
  }
  {
      type    solverInfo;
      libs    (utilityFunctionObjects);
      ...
  }
  ```
  This is admittedly quite ugly, but illustrates its capabilities.

- use `#message` to report expanded string content to stderr.
  For example,

  ```
  T
  {
     solver          PBiCG;
     preconditioner  DILU;
     tolerance       1e-10;
     relTol          0;
     #message "using solver: $solver"
  }
  ```
  Only reports on the master node.
parent 55af2fc2
Branches
Tags
No related merge requests found
Showing
with 514 additions and 131 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment