[deal.II] error: no member named 'quadrature_point_indices' in 'dealii::FEValues<2, 2>'

31 views
Skip to first unread message

hkch...@gmail.com

unread,
Jul 7, 2020, 1:25:36 AM7/7/20
to deal.II User Group
Dear all,

I want to solve the Modification Laplace equation to get the mesh displacement:
𝛥 (1+𝛾)q=0
where q is the mesh displacement vector, 𝛾 is the coefficient about cell's area denoted by:
𝛾=(1-A_min/Amax)/(A_e/A_max)
where A_min and A_max is the minimum and maximum area of all cell respectively, and A_e is the local element's area.

so the code of assemble laplace matrix is changed to follow:

FullMatrix<double> cell_matrix(dofs_per_cell, dofs_per_cell);
std::vector<double> Area;
for (const auto &cell : dof_handler.active_cell_iterators())
{Area.emplace_back(cell->measure());}
auto maxArea = *max_element(Area.begin(), Area.end());
auto minArea = *min_element(Area.begin(), Area.end());

cell_matrix(i, j) += (1 + (maxArea - minArea)/cell->measure() ) *
(fe_values.shape_grad(i, q_index) * // grad phi_i(x_q)
fe_values.shape_grad(j, q_index) * // grad phi_j(x_q)
fe_values.JxW(q_index)); // dx

the part of moving mesh is the copy from step-18:

std::vector<bool> vertex_touched(triangulation.n_vertices(), false);
for (auto &cell : dof_handler.active_cell_iterators())
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
if (vertex_touched[cell->vertex_index(v)] == false)
{
vertex_touched[cell->vertex_index(v)] = true;
Point<dim> vertex_displacement;
// for (unsigned int d = 0; d < dim; ++d)
vertex_displacement[0] = 0.;
vertex_displacement[1] = solution_deltay(cell->vertex_dof_index(v, 1));
cell->vertex(v) += vertex_displacement;
}

When I run make to compile the code(Appendix: test.cc and input file test1.msh), some errors arised: 


Could anyone help me out?
my platform is macOS Mojave 10.14.6 Beta, the deal.ii vesion is 9.1.0

Thanks,
Chen
test.cc
test1.msh

Wolfgang Bangerth

unread,
Jul 7, 2020, 12:38:40 PM7/7/20
to dea...@googlegroups.com
On 7/6/20 11:25 PM, hkch...@gmail.com wrote:
> my platform is macOS Mojave 10.14.6 Beta, the deal.ii vesion is 9.1.0

The functions you're trying to call (FEValues::quadrature_point_indices() and
FEValues::dof_indices()) were only introduced in deal.II 9.2. You either need
to upgrade to that version, or rely on functions that were already present in 9.1.

Best
W.


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

hkch...@gmail.com

unread,
Jul 7, 2020, 12:54:38 PM7/7/20
to deal.II User Group
Thank you for responding Wolfgang Bangerth.

yes, I have compiled the code on the linux platform with deal.ii version 9.2.0; but when I run the program, there is a issure:

--------------------------------------------------------
An error occurred in line <1138> of file </public3/home/sc52217/deal.ii_work/include/deal.II/dofs/dof_accessor.templates.h> in function
    static dealii::types::global_dof_index dealii::internal::DoFAccessorImplementation::Implementation::get_vertex_dof_index(const dealii::DoFHandler<dim, spacedim>&, unsigned int, unsigned int, unsigned int) [with int dim = 2; int spacedim = 2; dealii::types::global_dof_index = unsigned int]
The violated condition was: 
    static_cast<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(local_index), decltype(dof_handler.get_fe().dofs_per_vertex)>::type)>:: type>(local_index) < static_cast<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(local_index), decltype(dof_handler.get_fe().dofs_per_vertex)>::type)>:: type>(dof_handler.get_fe().dofs_per_vertex)
Additional information: 
    Index 1 is not in the half-open range [0,1).

Stacktrace:
-----------
#0  ./test: unsigned int dealii::internal::DoFAccessorImplementation::Implementation::get_vertex_dof_index<2, 2>(dealii::DoFHandler<2, 2> const&, unsigned int, unsigned int, unsigned int)
#1  ./test: dealii::DoFAccessor<2, dealii::DoFHandler<2, 2>, false>::vertex_dof_index(unsigned int, unsigned int, unsigned int) const
#2  ./test: Step23::ModificationLaplaceEquation<2>::move_mesh()
#3  ./test: Step23::ModificationLaplaceEquation<2>::run()
#4  ./test: main
--------------------------------------------------------

I don't understand which index in the sentence: 'Index 1 is not in the half-open range [0,1).' refer to.

there newest source is included at appendix.

Thank you,
Chen
test.cc

Wolfgang Bangerth

unread,
Jul 7, 2020, 1:02:43 PM7/7/20
to dea...@googlegroups.com
On 7/7/20 10:54 AM, hkch...@gmail.com wrote:
>
> I don't understand which index in the sentence: 'Index 1 is not in the
> half-open range [0,1).' refer to.

It's apparently one of the indices passed to cell->vertex_dof_index(...).

Have you tried to run the program in a debugger? This will tell you exactly
what is happening, where, and why. Learning how to use a debugger is really a
fantastically useful skill!
Reply all
Reply to author
Forward
0 new messages