- template <class InVector, class OutVector>
+ template <class VectorType>
inline
- void
- ConstraintMatrix::
- distribute_local_to_global (const InVector &local_vector,
- const std::vector<types::global_dof_index> &local_dof_indices,
- OutVector &global_vector) const
+ void ConstraintMatrix::distribute_local_to_global (
- const unsigned int index,
++ const types::global_dof_index index,
+ const double value,
+ VectorType &global_vector) const
{
- Assert (local_vector.size() == local_dof_indices.size(),
- ExcDimensionMismatch(local_vector.size(), local_dof_indices.size()));
- distribute_local_to_global (local_vector.begin(), local_vector.end(),
- local_dof_indices.begin(), global_vector);
- }
+ Assert (sorted == true, ExcMatrixNotClosed());
+ if (is_constrained(index) == false)
+ global_vector(index) += value;
+ else
+ {
+ const ConstraintLine& position =
+ lines[lines_cache[calculate_line_index(index)]];
+ for (unsigned int j=0; j<position.entries.size(); ++j)
+ global_vector(position.entries[j].first)
+ += value * position.entries[j].second;
+ }
+ }
template <typename ForwardIteratorVec, typename ForwardIteratorInd,
number_cache.n_global_active_cells
= std::accumulate (number_cache.n_locally_owned_active_cells.begin(),
number_cache.n_locally_owned_active_cells.end(),
- 0);
+ /* ensure sum is
+ computed with
+ correct data
+ type:*/
+ static_cast<types::global_dof_index>(0));
+ number_cache.n_global_levels = Utilities::MPI::max(this->n_levels(), mpi_communicator);
}