Hi everyone,

I'm trying to change a bit the step-7 (Helmotz Problem 
<https://www.dealii.org/current/doxygen/deal.II/step_7.html#HelmholtzProblemrefine_grid>
)

In particular, I'm going to change the estimate function
KellyErrorEstimator<dim>::estimate 
<https://www.dealii.org/current/doxygen/deal.II/classKellyErrorEstimator.html#ae2269e1c9903e9d863b7abd54948af00>
(
dof_handler,
QGauss<dim - 1> 
<https://www.dealii.org/current/doxygen/deal.II/classQGauss.html>(fe->degree 
+ 1),
std::map<types::boundary_id 
<https://www.dealii.org/current/doxygen/deal.II/classunsigned_01int.html>, 
const Function<dim> 
<https://www.dealii.org/current/doxygen/deal.II/classFunction.html> *>(),
solution,
estimated_error_per_cell);

since I want to encode the fact that we have Neumann data. To do so, I 
created a function that describes my Neumann data 


template<int dim>
class NeumannData: public Function<dim> { 
virtual double value(const Point<dim> &p, const unsigned int) const 
override; 
}; 

template<int dim> 
double NeumannData<dim>::value(const Point<dim> &p, const unsigned int) 
const {return p[0] + p[1];}


and hence my refine function becomes (in red what I changed w.r.t the 
original tutorial program)

template<int dim>

void step7<dim>::refine_grid() {
const NeumannData<dim> neumann_func;

switch (refinement_mode) {
case global_refinement: {
triangulation.refine_global(1);

break;

}

case adaptive_refinement: {

Vector<float> estimated_error_per_cell(triangulation.n_active_cells());

KellyErrorEstimator<dim>::estimate(dof_handler,

QGauss<dim - 1>(fe->degree + 1),

std::map<types::boundary_id, const Function<dim> *>(1,&neumann_func),

estimated_error_per_cell);
GridRefinement::refine_and_coarsen_fixed_number(triangulation,

estimated_error_per_cell, 0.3, 0.03);

triangulation.execute_coarsening_and_refinement();
break;

}


default: {

Assert(false, ExcNotImplemented());

}

}

}

*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?*


Thanks,

Bob

-- 
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/53039ccf-c4f3-4b3b-b6f7-e8f3590b1fcfn%40googlegroups.com.

Reply via email to