00001 //--------------------------------------------------------------------------- 00002 // @f$Id: operator.h 25460 2012-04-27 09:19:06Z bangerth @f$ 00003 // 00004 // Copyright (C) 2010, 2012 by the deal.II authors 00005 // 00006 // This file is subject to QPL and may not be distributed 00007 // without copyright and license information. Please refer 00008 // to the file deal.II/doc/license.html for the text and 00009 // further information on this license. 00010 // 00011 //--------------------------------------------------------------------------- 00012 00013 #ifndef __deal2__operator_h 00014 #define __deal2__operator_h 00015 00016 #include <deal.II/base/config.h> 00017 #include <deal.II/base/named_data.h> 00018 #include <deal.II/base/event.h> 00019 00020 #include <fstream> 00021 00022 DEAL_II_NAMESPACE_OPEN 00023 00024 namespace Algorithms 00025 { 00054 template <class VECTOR> 00055 class Operator : public Subscriptor 00056 { 00057 public: 00061 ~Operator(); 00062 00067 virtual void operator() (NamedData<VECTOR*>& out, const NamedData<VECTOR*>& in) = 0; 00068 00073 virtual void notify(const Event&); 00077 void clear_events(); 00078 protected: 00087 Event notifications; 00088 }; 00089 00096 template <class VECTOR> 00097 class OutputOperator : public Subscriptor 00098 { 00099 OutputOperator(const OutputOperator<VECTOR>&); 00100 public: 00101 OutputOperator (); 00105 virtual ~OutputOperator(); 00106 00114 void initialize_stream(std::ostream& stream); 00118 OutputOperator<VECTOR>& operator<< (unsigned int step); 00119 00123 virtual OutputOperator<VECTOR>& operator<< (const NamedData<VECTOR*>& vectors); 00124 protected: 00125 unsigned int step; 00126 private: 00127 std::ostream* os; 00128 }; 00129 00130 template <class VECTOR> 00131 OutputOperator<VECTOR>& 00132 OutputOperator<VECTOR>::operator<< (unsigned int s) 00133 { 00134 step = s; 00135 return *this; 00136 } 00137 } 00138 00139 00140 DEAL_II_NAMESPACE_CLOSE 00141 00142 #endif 00143
documentation generated on Thu May 17 2012 20:04:34 by
doxygen
1.7.3