// gradient computation function for collection with EED boundary
    // conditions
    VectorN EED_collection_gradient(const BpCollection& bp_collection,
                                    const IndexManager& idx_mgr) {

        // dofs gradient
        const StepGradientVec grads =
        imposed_origin_dofs_gradient(bp_collection, idx_mgr);

        // frozen step contributions
        const StepGradientVec frozen_grads =
        add_frozen_steps_contribs(grads, bp_collection, idx_mgr);

        // filtering
        VectorN grad_vec = filter_free_dofs_in_StepGradientVec(frozen_grads,
                                                               idx_mgr);

        // remove dofs related to boundary conditions
        // for EED boundary conditions this corresponds to the last three dofs
        return grad_vec.slice(0,
                              idx_mgr.n_of_free_dofs_variables()-
                              BoundaryConditionsDofsTrimming::EEDCollection);

    };