DataPostprocessorInputs::CommonInputs< spacedim >::get_cell()

27 views
Skip to first unread message

shuitao zhang

unread,
Apr 10, 2022, 10:32:41 AM4/10/22
to deal.II User Group
Hi everyone,

I have one question when i using DoFHandler<dim, spacedim>::cell_iterator DataPostprocessorInputs::CommonInputs< spacedim >::get_cell() const. 
The code I write this:
template <int dim>
class BoundaryIds : public DataPostprocessorScalar<dim>
{
public:
BoundaryIds()
{}
virtual void
evaluate_scalar_field(
std::vector<Vector<double>> &computed_quantities) const override
{
AssertDimension(computed_quantities.size(),
inputs.solution_values.size());
// Get the cell and face we are currently dealing with:
inputs.template get_cell<dim>();
const unsigned int face = inputs.get_face_number();
// Then fill the output fields with the boundary_id of the face
for (auto &output : computed_quantities)
{
AssertDimension(output.size(), 1);
output(0) = cell->face(face)->boundary_id();
}
}
};
And my error is:
no maching function for call to " DataPostprocessorInputs::CommonInputs< spacedim >::get_cell() "

Could someone can help me?
Thanks very much!
Best wishes,
zhang

Wolfgang Bangerth

unread,
Apr 10, 2022, 8:35:00 PM4/10/22
to dea...@googlegroups.com
On 4/10/22 08:32, shuitao zhang wrote:
> And my error is:
> no maching function for call to " DataPostprocessorInputs::CommonInputs
> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdealii.org%2Fdeveloper%2Fdoxygen%2Fdeal.II%2FstructDataPostprocessorInputs_1_1CommonInputs.html&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7C438a879b001c4ff6a17408da1afef96c%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637851979699122741%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=cPAxs8bEVQcVJ7wkba8Gj9dTuZa9WWdYEQURt92yX9U%3D&reserved=0><
> spacedim >::get_cell() "
>

Zhang:
What version of deal.II are you using? It used to be the case that you had to
write
inputs.template get_cell<DoFHandler<dim>>();
and only in newer versions of deal.II you can write
inputs.template get_cell<dim>();

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

shuitao zhang

unread,
Apr 11, 2022, 3:03:48 AM4/11/22
to deal.II User Group
Dear  Wolfgang Bangerth
I have found this problem, thanks very much for your reply.
Best 
Zhang.

Reply all
Reply to author
Forward
0 new messages