17 #ifndef __deal2__swappable_vector_templates_h
18 #define __deal2__swappable_vector_templates_h
21 #include <deal.II/base/memory_consumption.h>
22 #include <deal.II/lac/swappable_vector.h>
25 DEAL_II_NAMESPACE_OPEN
28 template <
typename number>
31 data_is_preloaded (false)
36 template <
typename number>
40 data_is_preloaded (false)
47 template <
typename number>
63 template <
typename number>
77 data_is_preloaded =
false;
84 template <
typename number>
97 Assert (this->size() != 0, ExcSizeZero());
109 std::ofstream tmp_out(filename.c_str());
110 this->block_write (tmp_out);
118 template <
typename number>
130 if (data_is_preloaded ==
false)
134 reload_vector (
false);
139 data_is_preloaded =
false;
150 template <
typename number>
153 #ifndef DEAL_II_WITH_THREADS
166 if ( (data_is_preloaded ==
true) ||
184 template <
typename number>
187 Assert (filename !=
"", ExcInvalidFilename (filename));
188 Assert (this->size() == 0, ExcSizeNonzero());
190 std::ifstream tmp_in(filename.c_str());
191 this->block_read (tmp_in);
194 #ifdef DEAL_II_WITH_THREADS
201 data_is_preloaded =
true;
208 template <
typename number>
226 int status = std::remove (filename.c_str());
235 template <
typename number>
244 template <
typename number>
257 DEAL_II_NAMESPACE_CLOSE
259 #endif // __deal2__swappable_vector_templates_h
SwappableVector & operator=(const SwappableVector &)
#define AssertThrow(cond, exc)
Thread< RT > new_thread(const std_cxx1x::function< RT()> &function)
void reload_vector(const bool set_flag)
Vector< Number > & operator=(const Number s)
#define Assert(cond, exc)
std::size_t memory_consumption(const T &t)
virtual ~SwappableVector()
const std::string & get_filename() const
std::size_t memory_consumption() const
void swap_out(const std::string &filename)
::ExceptionBase & ExcInternalError()