Paras,

I am trying to read a list of integers from the parameter file using the dealii::Patterns::List class.
However, I get a runtime error which can be reproduced using the attached MWE.

I also tried the approach described (for tensor) in https://groups.google.com/g/dealii/c/TvtcOnxeVjw/m/9uaSAh-kAwAJ but it doesn't seem to work for the current case.

It would be great help if someone could help me understand where I go wrong?

First: Excellent job coming up with a self-contained minimal example!

The problem is that in this line:

nIters = dealii::Patterns::Tools::Convert<decltype(nIters)>::to_value(nMaxItersString);

The to_value() function creates its own pattern based on the type of the argument nMaxItersString. This pattern uses "," as the separator, but you want "|". You can fix this by providing an explicit pattern:

nIters = dealii::Patterns::Tools::Convert<decltype(nIters)>::to_value(nMaxItersString,dealii::Patterns::List(dealii::Patterns::Integer(1), 2, 8, "|"));

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/98664411-dca8-ba63-dcf3-cbdd1d0489d4%40colostate.edu.

Reply via email to