> Thank you. This really shortens the code. Is it also possible to set the 
> delimiter to a user desired value, say "|" instead of ",".

All functions of the Convert class take a unique pointer to a pattern. You can 
specify your own pattern, and use that in the conversion. The code is all in

deal.II/base/patterns_tools.h

After the Class declarations, you’ll find the implementations for the basic 
classes of deal.II, including vector, map, pairs and tuples of them. 

Best,
Luca 

> Also, where exactly is the procedure for conversion from string to 
> deali::Tensor or some other type say std::vector<double> defined? I could not 
> find it in the source code.
> 
> Best regards,
> Paras
> 
>> On Tuesday, August 4, 2020 at 6:15:47 PM UTC+2, Paras Kumar wrote:
>> Hi,
>> 
>> Could you please provide an MWE to describe how the 
>> Patterns::Convert::to_value() function would work in this case.
>> 
>> Is it must to use prm.add_parameter()  to be able to do so? I usually use 
>> prm.declare_entry() and prm.get(). 
>> 
>> Best regards,
>> Paras
>> 
>>> On Wednesday, April 15, 2020 at 6:01:53 PM UTC+2, Luca Heltai wrote:
>>> Currently, this is also the simplest way:
>>> 
>>> Tensor<rank, dim> tens;
>>> prm.add_parameter("Tensor", tens);
>>> 
>>> Take a look at the documentation of the add parameter method.
>>> 
>>> Patterns::Tools::to_string(tens);
>>> 
>>> And 
>>> 
>>> Patterns::Tools::to_value 
>>> 
>>> Are also available to simplify what you want to achieve. 
>>> 
>>> Alternatively: Patterns::Tools::Convert offers ways to construct default 
>>> Patterns for many types, including Tensors. 
>>> 
>>> Best,
>>> Luca
>>> 
>>  
> 
> -- 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/01e0068e-205b-4984-a5e8-f9d23ab1bb72o%40googlegroups.com.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2D1BF7D2-3C55-41E7-988F-110467401FAF%40gmail.com.

Reply via email to