Electrowetting on dielectric
|
00001 #ifndef _AS_FUNCTION_H_ 00002 #define _AS_FUNCTION_H_ 00003 00004 #include <deal.II/base/quadrature_lib.h> 00005 #include <deal.II/base/smartpointer.h> 00006 #include <deal.II/fe/fe.h> 00007 #include <deal.II/fe/fe_values.h> 00008 #include <deal.II/dofs/dof_handler.h> 00009 #include <deal.II/lac/trilinos_vector.h> 00010 #include <deal.II/numerics/data_out.h> 00011 00012 using namespace dealii; 00013 00022 template<int dim> class AsFunction{ 00023 public: 00029 enum FunctionType{ 00030 isScalarValued, 00031 isVectorValued 00032 }; 00041 AsFunction( const hp::DoFHandler<dim> &_dh, const TrilinosWrappers::Vector &_sol, const char* _name, 00042 const FunctionType _type = isScalarValued, const unsigned fc = 0 ); 00046 AsFunction( const AsFunction<dim> &_asfunction ); 00050 ~AsFunction(); 00056 void reset( const hp::QCollection<dim> &q, const UpdateFlags f ); 00060 void reset(); 00064 void reinit( const typename hp::DoFHandler<dim>::active_cell_iterator &cell ); 00070 void reset_face( const hp::QCollection<dim-1> &q, const UpdateFlags f ); 00074 void reset_face(); 00080 void reinit( const typename hp::DoFHandler<dim>::active_cell_iterator &cell, const unsigned face ); 00084 void get_function_values( std::vector<double> &values ) const; 00088 void get_function_gradients( std::vector< Tensor<1, dim> > &values ) const; 00092 void get_function_values( std::vector< Tensor<1, dim> > &values ) const; 00096 void get_function_gradients( std::vector< Tensor<2, dim> > &values ) const; 00100 void get_function_divergences( std::vector<double> &values ) const; 00104 void get_function_face_values( std::vector<double> &values ) const; 00108 void get_function_face_gradients( std::vector< Tensor<1, dim> > &values ) const; 00112 void get_function_face_values( std::vector< Tensor<1, dim> > &values ) const; 00116 void get_function_face_gradients( std::vector< Tensor<2, dim> > &values ) const; 00120 const TrilinosWrappers::Vector & get_vec() const; 00124 const double operator()( unsigned i ) const; 00128 const hp::DoFHandler<dim> & get_dh() const; 00132 typename hp::DoFHandler<dim>::active_cell_iterator get_begin() const; 00136 typename hp::DoFHandler<dim>::active_cell_iterator get_end() const; 00137 protected: 00141 mutable hp::QCollection<dim> *quad; 00145 mutable UpdateFlags flags; 00149 mutable hp::FEValues<dim> *fe_val; 00153 mutable hp::QCollection<dim-1> *f_quad; 00157 mutable UpdateFlags f_flags; 00161 mutable hp::FEFaceValues<dim> *fe_face_val; 00165 SmartPointer< const hp::DoFHandler<dim> > dh; 00169 SmartPointer< const TrilinosWrappers::Vector > sol; 00173 const FunctionType type; 00177 const unsigned first_component; 00178 public: 00182 const std::string name; 00186 const DataComponentInterpretation::DataComponentInterpretation interpretation; 00187 private: 00191 AsFunction(); 00192 }; 00193 00194 #endif 00195