Hi all,

I am trying to implement a MatrixFree code which uses FE_Q and FE_Nothing 
elements. Evaluating the matrix-free operator works correctly without the 
FE_Nothing elements but when I add them the code the operator tries to 
access indices which are out of range in the read_dof_values function. I 
was wondering if anyone has any tips for applying this correctly?

Here is my current local_apply function:
template <int dim, int degree_v, typename SignedDistanceType, typename 
number>
void MassOperator<dim, degree_v, SignedDistanceType, number>::local_apply(
    const dealii::MatrixFree<dim, number>                 &data,
    LinearAlgebra::distributed::BlockVector<number>       &dst,
    const LinearAlgebra::distributed::BlockVector<number> &src,
    const std::pair<unsigned int, unsigned int>           &cell_range) const
{
    using vector_t = VectorizedArray<number>;
    FEEvaluation<dim, degree_v, degree_v*2, dim, number>   velocity(data, 0
);

    for (unsigned int cell = cell_range.first; cell < cell_range.second; ++
cell)
    {
        //AssertDimension(phase_field_evaluations.size(0), 
data.n_cell_batches());
        //AssertDimension(phase_field_evaluations.size(1), 
velocity.n_q_points);

        velocity.reinit(cell);
        //std::cout << velocity.get_active_fe_index() << std::endl;
        if (velocity.get_active_fe_index()==0){
            // Dof are active and not FENothing

            velocity.read_dof_values(src.block(0));
    
            for (unsigned int q = 0; q < velocity.n_q_points; ++q)
            {
                //velocity.submit_value(phase_field_evaluations(cell, 
q)*velocity.get_value(q),q);
                velocity.submit_value(velocity.get_value(q),q);
            }
            velocity.integrate(EvaluationFlags::values);
            velocity.distribute_local_to_global(dst.block(0));
            
        }
    }
}

Regards,

Thomas

-- 
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.
To view this discussion visit 
https://groups.google.com/d/msgid/dealii/b5d8feb1-7688-4734-8360-b3a2051b38a5n%40googlegroups.com.

Reply via email to