On 02/13/2017 07:09 AM, Bruno Turcksin wrote:


you could write everything into one string and then split it. So it
would like this:

subsection bc
  set value = 0.5*x+y; x*y^2
end

Take a look here
http://stackoverflow.com/questions/236129/split-a-string-in-c for some
ideas how to split a string.

Yes, this is the way to go. In fact, we have a function that splits strings:

https://www.dealii.org/8.4.0/doxygen/deal.II/namespaceUtilities.html#a8d799bb35ac16d206818c88e82afbfae

We use the scheme Bruno proposes to split strings first by semicolon, and then again by comma all the time in our own projects. If you don't like semicolons/commas, any other choice of course also works.

As far as working with people who are not used to programming -- this is a tricky question. It is true that you need to provide a way that's readable, but using work-arounds like have multiple sections is also not entirely obvious and will invite questions whose answers you also have to document somewhere. It is a balance that's sometimes difficult to strike. I typically strive for a solution that is easiest to describe and easiest to understand *in its entirety*. In your case, I would probably choose splitting on semicolons and colons, and in the documentation show how you can split different, semicolon-separated parts of the formula onto separate lines using a backslash at the end of the line to show that that makes formulas easier to read.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to