Jane, I'm wondering whether I've misunderstood how to use the FunctionMap > declaration. I'm needing it to use for > VectorTools::compute_nonzero_normal_flux_constraints > > At the moment I am trying to apply nonzero normal component of the normal > stress in step-22 on a boundary id that is 2 > > I have tried > > std::set<types::boundary_id> bottom_normal_flux_boundaries; > > bottom_normal_flux_boundaries.insert (2); > > typename FunctionMap<dim>::type bottom_normal_map; > > RockBottomValues<dim> bottom_nonzero_normal_stress; > > bottom_normal_map[0] = &bottom_nonzero_normal_stress; > > VectorTools::compute_nonzero_normal_flux_constraints > (dof_handler, 0, > > > bottom_normal_flux_boundaries, > > > bottom_normal_map, > > > constraints); > > > with my nonzero function as > > > template <int dim> > > class RockBottomValues : public Function<dim> > > { > > public: > > RockBottomValues () : Function<dim>(1) {} > > > > virtual double value (const Point<dim> &p, > > const unsigned int component = 0) const; > > }; > > > template <int dim> > > double RockBottomValues<dim>::value (const Point<dim> &p, > > const unsigned int > /*component*/) const > > { > > return -10.0+p[1]; > > } > > > > I'm not sure if I understand what I am doing when i write, > bottom_normal_map[0] = &bottom_nonzero_normal_stress; > > I original had bottom_normal_map[2] = &bottom_nonzero_normal_stress; > > > as i thought it was to do with the boundary indicator. > Yes, it clearly does. Just as the documentation <https://www.dealii.org/8.5.1/doxygen/deal.II/structFunctionMap.html> says, this is std::map is supposed to describe which Function object to use for which boundary_id.
> > > The first gave me a segmentation fault error, something to do with memory > i'm guessing, and the second gave me a dimension mismatch error, even > though my normal component would just be a scalar value. > The documentation <https://www.dealii.org/8.5.1/doxygen/deal.II/group__constraints.html#ga5b13c2da1b235c86cdbce2270525db99> uses the vector-valued u_\Gamma for describing what the function does and in fact we are expecting the FunctionMap to point to such a vector-valued Function, i.e. it should have spacedim components. In the end, this means that you have to provide u_\Gamma instead of u_\Gamm \cdot n. Best, Daniel -- 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.