<h3>Specific improvements</h3>
<ol>
+<li> New: All vector classes should now have a in_local_range()
+function indicating whether a given index is locally stored or not.
+<br>
+(Daniel Arndt, 2013/01/14)
+
<li> Fixed: The one-argument version of ConstraintMatrix::condense was
not prepared to deal with parallel vectors. This is now fixed.
<br>
*/
real_type linfty_norm () const;
+ /**
+ * Returns true if the given global index is
+ * in the local range of this processor.
+ * Asks the corresponding block.
+ */
+ bool in_local_range (const types::global_dof_index global_index) const;
+
/**
* Return whether the vector contains only
* elements with value zero. This function
}
+template <class VectorType>
+inline
+bool
+BlockVectorBase<VectorType>::in_local_range
+(const types::global_dof_index global_index) const
+{
+ const std::pair<unsigned int,unsigned int> local_index
+ = block_indices.global_to_local (global_index);
+
+ return components[local_index.first].in_local_range (global_index);
+}
+
template <class VectorType>
bool
const typename VectorType::value_type old_value = vec(constraint_line->line);
for (unsigned int q=0; q!=constraint_line->entries.size(); ++q)
- vec(constraint_line->entries[q].first)
- += (static_cast<typename VectorType::value_type>
- (old_value) *
- constraint_line->entries[q].second);
+ if (vec.in_local_range(constraint_line->entries[q].first) == true)
+ vec(constraint_line->entries[q].first)
+ += (static_cast<typename VectorType::value_type>
+ (old_value) *
+ constraint_line->entries[q].second);
}
vec.compress();
for (std::vector<ConstraintLine>::const_iterator
constraint_line = lines.begin();
constraint_line!=lines.end(); ++constraint_line)
- vec(constraint_line->line) = 0.;
+ if (vec.in_local_range(constraint_line->line) == true)
+ vec(constraint_line->line) = 0.;
}
DEAL_II_NAMESPACE_CLOSE
#endif
+
*/
real_type linfty_norm () const;
+ /**
+ * Returns true if the given global index is
+ * in the local range of this processor.
+ * Since this is not a distributed
+ * vector the method always returns true.
+ */
+ bool in_local_range (const types::global_dof_index global_index) const;
+
/**
* Return dimension of the vector.
*/
}
+template <typename Number>
+inline
+bool Vector<Number>::in_local_range
+(const types::global_dof_index global_index) const
+{
+ return true;
+}
+
+
template <typename Number>
inline