21 #ifndef SELDON_FILE_VECTOR_PETSCVECTOR_HXX
23 #include "../share/Common.hxx"
24 #include "../share/Properties.hxx"
25 #include "../share/Storage.hxx"
26 #include "../share/Errors.hxx"
27 #include "../share/Allocator.hxx"
40 template <
class T,
class Allocator>
44 typedef typename Allocator::value_type value_type;
45 typedef typename Allocator::pointer pointer;
46 typedef typename Allocator::const_pointer const_pointer;
47 typedef typename Allocator::reference reference;
48 typedef typename Allocator::const_reference const_reference;
61 explicit PETScVector(
int i, MPI_Comm mpi_communicator = MPI_COMM_WORLD);
75 void SetData(
int i, pointer data);
80 void SetBuffer(
int i, T value, InsertMode insert_mode = INSERT_VALUES);
84 void Copy(
const Vec& petsc_vector);
95 void Fill(
const T0& x);
104 template <
class T,
class Allocator>
108 typedef typename Allocator::value_type value_type;
109 typedef typename Allocator::pointer pointer;
110 typedef typename Allocator::const_pointer const_pointer;
111 typedef typename Allocator::reference reference;
112 typedef typename Allocator::const_reference const_reference;
120 explicit Vector(
int i, MPI_Comm mpi_communicator = MPI_COMM_WORLD);
121 Vector(Vec& petsc_vector);
127 void Copy(
const Vec& petsc_vector);
129 void Reallocate(
int i);
143 void Write(
string FileName,
bool with_size =
true)
const;
144 void Write(ostream& FileStream,
bool with_size =
true)
const;
145 void WriteText(
string FileName)
const;
146 void WriteText(ostream& FileStream)
const;
147 void Read(
string FileName,
bool with_size =
true);
148 void Read(istream& FileStream,
bool with_size =
true);
149 void ReadText(
string FileName);
150 void ReadText(istream& FileStream);
155 template <
class T,
class Allocator>
161 template <
class T,
class Allocator>
165 typedef typename Allocator::value_type value_type;
166 typedef typename Allocator::pointer pointer;
167 typedef typename Allocator::const_pointer const_pointer;
168 typedef typename Allocator::reference reference;
169 typedef typename Allocator::const_reference const_reference;
177 explicit Vector(
int i, MPI_Comm mpi_communicator = MPI_COMM_WORLD);
178 explicit Vector(
int i,
int Nlocal, MPI_Comm mpi_communicator);
179 Vector(Vec& petsc_vector);
185 void Copy(
const Vec& petsc_vector);
187 void Reallocate(
int i,
int local_size = PETSC_DECIDE);
201 void Write(
string FileName,
bool with_size =
true)
const;
202 void Write(ostream& FileStream,
bool with_size =
true)
const;
203 void WriteText(
string FileName)
const;
204 void WriteText(ostream& FileStream)
const;
205 void Read(
string FileName,
bool with_size =
true);
206 void Read(istream& FileStream,
bool with_size =
true);
207 void ReadText(
string FileName);
208 void ReadText(istream& FileStream);
213 template <
class T,
class Allocator>
222 #define SELDON_FILE_VECTOR_PETSCVECTOR_HXX