<ol>
+ <li> New: All vector classes now have a member function
+ <code>locally_owned_elements</code> that returns an index
+ set indicating which elements of this vector the current
+ processor owns.
+ <br>
+ (Wolfgang Bangerth, 2013/05/24)
+ </li>
+
+
<li> New: A new element FE_Q_iso_Q1 has been implemented that is defined by
a subdivision of the element into smaller Q1 elements. An element of order
@p p is similar to FE_Q of degree @p p with the same numbering of degrees of
*/
unsigned int size () const;
+ /**
+ * Return an index set that describes which elements of this vector
+ * are owned by the current processor. Note that this index set does
+ * not include elements this vector may store locally as ghost
+ * elements but that are in fact owned by another processor.
+ * As a consequence, the index sets returned on different
+ * processors if this is a distributed vector will form disjoint
+ * sets that add up to the complete index set.
+ * Obviously, if a vector is created on only one processor, then
+ * the result would satisfy
+ * @code
+ * vec.locally_owned_elements() == complete_index_set (vec.size())
+ * @endcode
+ *
+ * For block vectors, this function returns the union of the
+ * locally owned elements of the individual blocks, shifted by
+ * their respective index offsets.
+ */
+ IndexSet locally_owned_elements () const;
+
/**
* Return an iterator pointing to
* the first element.
+template <class VectorType>
+inline
+IndexSet
+BlockVectorBase<VectorType>::locally_owned_elements () const
+{
+ IndexSet is (size());
+
+ // copy index sets from blocks into the global one
+ for (unsigned int b=0; b<n_blocks(); ++b)
+ {
+ IndexSet x = block(b).locally_owned_elements();
+
+ //TODO: This can surely be made more efficient by just shifting
+ // x
+ for (unsigned int i=0; i<block(b).size(); ++i)
+ if (x.is_element(i))
+ is.add_index(block_indices.local_to_global(b,i));
+ }
+
+ is.compress();
+
+ return is;
+}
+
+
+
template <class VectorType>
inline
unsigned int
*/
bool in_local_range (const types::global_dof_index global_index) const;
+ /**
+ * Return an index set that describes which elements of this vector
+ * are owned by the current processor. Note that this index set does
+ * not include elements this vector may store locally as ghost
+ * elements but that are in fact owned by another processor.
+ * As a consequence, the index sets returned on different
+ * processors if this is a distributed vector will form disjoint
+ * sets that add up to the complete index set.
+ * Obviously, if a vector is created on only one processor, then
+ * the result would satisfy
+ * @code
+ * vec.locally_owned_elements() == complete_index_set (vec.size())
+ * @endcode
+ */
+ IndexSet locally_owned_elements () const;
+
/**
* Returns the number of ghost elements present on the vector.
*/
}
+ template <typename Number>
+ inline
+ IndexSet
+ Vector<Number>::locally_owned_elements() const
+ {
+ IndexSet is (size());
+
+ const std::pair<types::global_dof_index,types::global_dof_index> x = local_range();
+ is.add_range (x.first, x.second);
+
+ return is;
+ }
+
+
template <typename Number>
inline
*/
bool in_local_range (const unsigned int index) const;
+ /**
+ * Return an index set that describes which elements of this vector
+ * are owned by the current processor. Note that this index set does
+ * not include elements this vector may store locally as ghost
+ * elements but that are in fact owned by another processor.
+ * As a consequence, the index sets returned on different
+ * processors if this is a distributed vector will form disjoint
+ * sets that add up to the complete index set.
+ * Obviously, if a vector is created on only one processor, then
+ * the result would satisfy
+ * @code
+ * vec.locally_owned_elements() == complete_index_set (vec.size())
+ * @endcode
+ */
+ IndexSet locally_owned_elements () const;
+
/**
* Return if the vector contains ghost
* elements.
(index < static_cast<unsigned int>(end)));
}
+
+ inline
+ IndexSet
+ VectorBase::locally_owned_elements() const
+ {
+ IndexSet is (size());
+
+ // PETSc only allows for contiguous local ranges, so this is simple
+ const std::pair<unsigned int, unsigned int> x = local_range();
+ is.add_range (x.first, x.second);
+ return is;
+ }
+
+
+
inline
bool
VectorBase::has_ghost_elements() const
*/
bool in_local_range (const unsigned int index) const;
+ /**
+ * Return an index set that describes which elements of this vector
+ * are owned by the current processor. Note that this index set does
+ * not include elements this vector may store locally as ghost
+ * elements but that are in fact owned by another processor.
+ * As a consequence, the index sets returned on different
+ * processors if this is a distributed vector will form disjoint
+ * sets that add up to the complete index set.
+ * Obviously, if a vector is created on only one processor, then
+ * the result would satisfy
+ * @code
+ * vec.locally_owned_elements() == complete_index_set (vec.size())
+ * @endcode
+ */
+ IndexSet locally_owned_elements () const;
+
/**
* Return if the vector contains ghost
* elements. This answer is true if there
+ inline
+ IndexSet
+ VectorBase::locally_owned_elements() const
+ {
+ IndexSet is (size());
+
+ // TODO: Trilinos does allow non-contiguous ranges for locally
+ // owned elements. if that is the case for the current
+ // vector, local_range() will throw an exception. Fix this.
+ const std::pair<unsigned int, unsigned int> x = local_range();
+ is.add_range (x.first, x.second);
+
+ return is;
+ }
+
+
+
inline
bool
VectorBase::has_ghost_elements() const
#include <deal.II/base/logstream.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/subscriptor.h>
+#include <deal.II/base/index_set.h>
#include <boost/serialization/array.hpp>
#include <boost/serialization/split_member.hpp>
*/
bool in_local_range (const types::global_dof_index global_index) const;
+ /**
+ * Return an index set that describes which elements of this vector
+ * are owned by the current processor. Note that this index set does
+ * not include elements this vector may store locally as ghost
+ * elements but that are in fact owned by another processor.
+ * As a consequence, the index sets returned on different
+ * processors if this is a distributed vector will form disjoint
+ * sets that add up to the complete index set.
+ * Obviously, if a vector is created on only one processor, then
+ * the result would satisfy
+ * @code
+ * vec.locally_owned_elements() == complete_index_set (vec.size())
+ * @endcode
+ *
+ * Since the current data type does not support parallel data storage
+ * across different processors, the returned index set is the
+ * complete index set.
+ */
+ IndexSet locally_owned_elements () const;
+
/**
* Return dimension of the vector.
*/
+template <typename Number>
+IndexSet
+Vector<Number>::locally_owned_elements() const
+{
+ return complete_index_set(size());
+}
+
+
+
template <typename Number>
std::size_t
Vector<Number>::memory_consumption () const