}
#endif
+#ifdef DEAL_II_USE_TRILINOS
+namespace TrilinosWrappers
+{
+ class Vector;
+}
+#endif
+
template<typename number> class LAPACKFullMatrix;
template <typename> class BlockVector;
*/
Vector (const PETScWrappers::MPI::Vector &v);
#endif
+
+#ifdef DEAL_II_USE_TRILINOS
+ /**
+ * Another copy constructor: copy the
+ * values from a Trilinos wrapper
+ * vector class. This copy constructor is
+ * only available if Trilinos was detected
+ * during configuration time.
+ *
+ * Note that due to the communication
+ * model used in MPI, this operation can
+ * only succeed if all processes do it at
+ * the same time. I.e., it is not
+ * possible for only one process to
+ * obtain a copy of a parallel vector
+ * while the other jobs do something
+ * else.
+ */
+ Vector (const TrilinosWrappers::Vector &v);
+#endif
/**
* Constructor. Set dimension to
# include <lac/petsc_parallel_vector.h>
#endif
+#ifdef DEAL_II_USE_TRILINOS
+# include <lac/trilinos_vector.h>
+#endif
+
#include <cmath>
#include <cstring>
#include <algorithm>
#endif
+#ifdef DEAL_II_USE_TRILINOS
+
+template <typename Number>
+Vector<Number>::Vector (const TrilinosWrappers::Vector &v)
+ :
+ Subscriptor(),
+ vec_size(v.size()),
+ max_vec_size(v.size()),
+ val(0)
+{
+ if (vec_size != 0)
+ {
+ val = new Number[max_vec_size];
+ Assert (val != 0, ExcOutOfMemory());
+
+ // get a representation of the vector
+ // and copy it
+ TrilinosScalar **start_ptr;
+ int ierr = v.vector->ExtractView (&start_ptr);
+ AssertThrow (ierr == 0, ExcTrilinosError(ierr));
+
+ std::copy (start_ptr[0], start_ptr[0]+vec_size, begin());
+ }
+}
+
+#endif
template <typename Number>
template <typename Number2>