Re: [deal.II] Reading a list from parameter file

2025-05-09 Thread Luca Heltai
It was added after 9.6.0. It is not there on spack yet. You don’t really need to recompile the library. You need one include file (magic_enum.hpp from https://github.com/Neargye/magic_enum) in your include path, and to copy this to one of your headers: #include namespace dealii { namespace

Re: [deal.II] Reading a list from parameter file

2025-05-09 Thread Paras Kumar
Hi Luca, Thank you for the quick response. One (may be off-topic) short follow-up. How can I turn on the DEAL_II_WITH_MAGIC_ENUM option on using spack. I could not find any relevant option in the spack/dealii-9.4.0/var/spack/repos/builtin/packages/dealii/package.py file. Best regards, Paras

Re: [deal.II] Reading a list from parameter file

2025-05-08 Thread Luca Heltai
This is supported by default on deal.II master if you compile with magic enum support. It will allow you to parse directly the enum. You can simply copy and paste the relevant code in patterns.h to your header if you have an older deal.II. LucaIl giorno 8 mag 2025, alle ore 17:40, Paras Kumar ha s

Re: [deal.II] Reading a list from parameter file

2025-05-08 Thread Paras Kumar
Dear All, Here is a kind of follow-up to the above question. I now to try to read a list of strings and each of the values in the list must to be converted to an enum class type. But I get the following compile time error when I try to compile below code snippet " : error: use of deleted func

Re: [deal.II] Reading a list from parameter file

2021-04-19 Thread Wolfgang Bangerth
On 4/19/21 4:19 AM, Paras Kumar wrote: std::unique_ptr nItersListPattern(new dealii::Patterns::List(dealii::Patterns::Integer(1), 2, 8, "|")); nIters = dealii::Patterns::Tools::Convert::to_value(nMaxItersString,  nItersListPattern); I suspect you need to write this last line as dealii::P

Re: [deal.II] Reading a list from parameter file

2021-04-19 Thread Paras Kumar
Dear Wolfgang, Thank you so much for the suggestion. Just to avoid confusion for future readers, the to_value() function needs a unique_ptr, and hence the aforementioned line needs to be replaced by the following lines: std::unique_ptr nItersListPattern(new dealii::Patterns::List(dealii::Patterns

Re: [deal.II] Reading a list from parameter file

2021-04-16 Thread Wolfgang Bangerth
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

[deal.II] Reading a list from parameter file

2021-04-15 Thread Paras Kumar
Dear All, 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