1 /*! \file secOrd_op_rhs.h 2 \brief Load vector for ESFEM discretization of a scalar or vector valued PDE 3 4 Revision history 5 -------------------------------------------------- 6 7 Revised by Christian Power dd.mm.yyyy 8 Originally written by Christian Power 9 (power22c@gmail.com) Januar 2016 10 11 Idea 12 -------------------------------------------------- 13 14 Wrapper class for the dune implementation. 15 16 \author Christian Power 17 \date 23. April 2016 18 \copyright Copyright (c) 2016 Christian Power. All rights reserved. 19 */ 20 21 #ifndef SECORD_OP_RHS_H 22 #define SECORD_OP_RHS_H 23 24 #include <memory> 25 #include "esfem_fwd.h" 26 27 //! The evolving surface finite element method 28 namespace Esfem{ 29 //! Parabolic and elliptic second order operators 30 namespace SecOrd_op{ 31 //! Load vector for scalar valued PDE 32 /*! 33 Useful formulas 34 -------------------------------------------------- 35 36 \f{gather*}{ 37 \diver_{\surface}(X) = \diver_{\R^{n+1}}(\bar{X}) 38 - \surfaceNormal^T (D_{\R^{n+1}}\bar{X}) \surfaceNormal, \\ 39 \laplaceBeltrami f = \Delta_{\R^{n+1}}\bar{f} - \surfaceNormal^T 40 (D_{\R^{n+1}}^2\bar{f}) \surfaceNormal - H \surfaceNormal^T D_{\R^{n+1}}f. 41 \f} 42 */ 43 class Rhs{ 44 public: 45 //! Get time, finite element space and an indicator 46 /*! \post Grid_and_time must outlive this object. */ 47 explicit Rhs(const Grid::Grid_and_time&, const Growth); 48 //! Needed for the pointer to data implementation technique. 49 ~Rhs(); 50 51 //! Assemble the load vector and add with some scale to the input. 52 void assemble_and_addScaled_to(Grid::Scal_FEfun&); 53 private: 54 struct Data; 55 //! Data pointer 56 std::unique_ptr<Data> d_ptr; 57 }; 58 59 //! Load vector for vector valued PDE 60 class Vec_rhs{ 61 public: 62 //! Get time and finite element space 63 /*! \post Grid_and_time must outlive this object. */ 64 explicit Vec_rhs(const Grid::Grid_and_time&); 65 //! Needed for the pointer to data implementation technique. 66 ~Vec_rhs(); 67 68 //! Assemble the load vector and add with some scale to the input. 69 void assemble_and_addScaled_to(Grid::Vec_FEfun&); 70 private: 71 struct Data; 72 //! Data pointer 73 std::unique_ptr<Data> d_ptr; 74 }; 75 76 //! Abstract scalar valued load vector base class 77 struct sRhs{ 78 //! For Brusselator_scheme::eoc_sdp() 79 static sRhs* new_sdp_u(Grid::Grid_and_time&); 80 //! Virtual copy constructor 81 virtual sRhs* clone() =0; 82 //! Assemble load vector with some factor and add to finit element function 83 virtual void addScaled_to(Grid::Scal_FEfun&) =0; 84 //! Abstract base class 85 virtual ~sRhs(){} 86 }; 87 88 //! Abstract vector valued load vector base class 89 struct vRhs{ 90 //! For Brusselator_scheme::eoc_sls() 91 static vRhs* new_sls(Grid::Grid_and_time&); 92 //! for Brusselator_scheme::sd() 93 static vRhs* new_sd(Grid::Grid_and_time&); 94 //! Virtual copy constructor 95 virtual vRhs* clone() =0; 96 //! Assemble load vector with some factor and add to finit element function 97 virtual void addScaled_to(Grid::Vec_FEfun&) =0; 98 //! Abstract base class 99 virtual ~vRhs(){} 100 }; 101 } 102 } 103 104 #endif // SECORD_OP_RHS_H