FEApp_BrusselatorPDE.hpp

Go to the documentation of this file.
00001 // $Id$ 
00002 // $Source$ 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 //                           Sacado Package
00007 //                 Copyright (2006) Sandia Corporation
00008 // 
00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00010 // the U.S. Government retains certain rights in this software.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
00027 // (etphipp@sandia.gov).
00028 // 
00029 // ***********************************************************************
00030 // @HEADER
00031 
00032 #ifndef FEAPP_BRUSSELATORPDE_HPP
00033 #define FEAPP_BRUSSELATORPDE_HPP
00034 
00035 #include "Teuchos_RCP.hpp"
00036 
00037 #include "FEApp_AbstractPDE.hpp"
00038 
00039 #include "Sacado_ScalarParameterLibrary.hpp"
00040 
00041 namespace FEApp {
00042 
00043   template <typename EvalT>
00044   class BrusselatorPDE : public FEApp::AbstractPDE<EvalT> {
00045   public:
00046 
00048     typedef typename FEApp::AbstractPDE<EvalT>::ScalarT ScalarT;
00049   
00051     BrusselatorPDE(
00052                 double alpha, double beta, double D1, double D2,
00053                 const Teuchos::RCP<ParamLib>& paramLib);
00054 
00056     virtual ~BrusselatorPDE();
00057 
00059     virtual unsigned int numEquations() const;
00060 
00062     virtual void init(unsigned int numQuadPoints, unsigned int numNodes);
00063 
00065     virtual void
00066     evaluateElementResidual(const FEApp::AbstractQuadrature& quadRule,
00067                             const FEApp::AbstractElement& element,
00068                             const std::vector<ScalarT>* dot,
00069                             const std::vector<ScalarT>& solution,
00070                             std::vector<ScalarT>& residual);
00071 
00072   private:
00073     
00075     BrusselatorPDE(const BrusselatorPDE&);
00076     
00078     BrusselatorPDE& operator=(const BrusselatorPDE&);
00079     
00080   protected:
00081     
00083     unsigned int num_qp;
00084     
00086     unsigned int num_nodes;
00087     
00089     std::vector< std::vector<double> > phi;
00090 
00092     std::vector< std::vector<double> > dphi;
00093 
00095     std::vector<double> jac;
00096 
00098     std::vector<ScalarT> T;
00099 
00101     std::vector<ScalarT> C;
00102 
00104     std::vector<ScalarT> dT;
00105 
00107     std::vector<ScalarT> dC;
00108 
00110     std::vector<ScalarT> Tdot;
00111 
00113     std::vector<ScalarT> Cdot;
00114 
00116     ScalarT alpha, beta;
00117     double D1, D2;
00118 
00120     Teuchos::RCP<ParamLib> pl;
00121 
00122   };
00123 
00124   class BrusselatorPDE_TemplateBuilder {
00125   public:
00126     BrusselatorPDE_TemplateBuilder(
00127           double alpha_, double beta_, double D1_, double D2_,
00128           const Teuchos::RCP<ParamLib>& paramLib) :
00129       alpha(alpha_), beta(beta_), D1(D1_), D2(D2_), pl(paramLib) {}
00130     template <typename T>
00131     Teuchos::RCP<FEApp::AbstractPDE_NTBase> build() const {
00132       return Teuchos::rcp( new BrusselatorPDE<T>(alpha, beta, D1, D2, pl));
00133     }
00134   protected:
00135     double alpha, beta, D1, D2;
00136     Teuchos::RCP<ParamLib> pl;
00137   };
00138 
00139 }
00140 
00141 // Include implementation
00142 #ifndef SACADO_ETI
00143 #include "FEApp_BrusselatorPDEImpl.hpp"
00144 #endif 
00145 
00146 #endif // FEAPP_BRUSSELATORPDE_HPP

Generated on Wed May 12 21:39:32 2010 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.4.7