1 /*! \file io_l2h1Calculator.h 2 \brief \f$L^2\f$- and \f$H^1\f$-norm 3 4 Revision history 5 -------------------------------------------------- 6 7 Revised by Christian Power April 2016 8 Originally written by Christian Power 9 (power22c@gmail.com) Januar 2016 10 11 Idea 12 -------------------------------------------------- 13 14 Build a wrapper class for the dune implementation. 15 16 \author Christian Power 17 \date 27. April 2016 18 \copyright Copyright (c) 2016 Christian Power. All rights reserved. 19 */ 20 21 #ifndef IO_L2H1CALCULATOR_H 22 #define IO_L2H1CALCULATOR_H 23 24 #include <memory> 25 #include "esfem_fwd.h" 26 27 namespace Esfem{ 28 //! Input output routines 29 namespace Io{ 30 //! Wrapper class for dune \f$L^2\f$- and \f$H^1\f$-norms 31 class L2H1_calculator{ 32 public: 33 // explicit L2H1_calculator(const Grid::Grid_and_time&, 34 // const Grid::Scal_FEfun& exact_solution, 35 // const Grid::Scal_FEfun& numerical_solution); 36 //! Get grid. 37 /*! \post Grid_and_time outlives this object. */ 38 explicit L2H1_calculator(const Grid::Grid_and_time&); 39 //! Required by pointer to implementation technique. 40 ~L2H1_calculator(); 41 42 //! \f$L^2\f$-distance of two finite element functions 43 double l2_err(const Grid::Scal_FEfun&, const Grid::Scal_FEfun&) const; 44 //! \copybrief l2_err() 45 double l2_err(const Grid::Vec_FEfun&, const Grid::Vec_FEfun&) const; 46 //! \f$H^1\f$-distance of two finite element functions 47 double h1_err(const Grid::Scal_FEfun&, const Grid::Scal_FEfun&) const; 48 //! \copybrief h1_err() 49 double h1_err(const Grid::Vec_FEfun&, const Grid::Vec_FEfun&) const; 50 private: 51 struct Data; 52 //! Pointer to data member 53 std::unique_ptr<Data> d_ptr; 54 }; 55 } 56 } 57 58 #endif // IO_L2H1CALCULATOR_H