On 6/16/21 4:29 AM, bob bill wrote:

*The boundary indicator for Neumann data is 1, and I gave a pointer to a constant function as argument. **Unfortunately, the compiler says: "*no matching constructor for initialization of 'std::map<types::boundary_id, const Function<2> *>' (aka 'map<unsigned int, const Function<2> *>') std::map<types::boundary_id, const Function<dim> *>(1,&neumann_func),*"*

*What am I missing?*

It has nothing to do with the function you're trying to call. You just can't create a map by saying
  std::map<U,V>(u,v)
where u is a key and v is a value. But you can
  std::map<U,V>({{u,v}})

Here, the outer braces enclose a list of pairs, which here has only one element and that element is initialized by the pair u,v.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/65597fa1-82de-da60-5379-88137fd14761%40colostate.edu.

Reply via email to