FEApp_BrusselatorPDE.hpp

Go to the documentation of this file.
00001 // $Id: FEApp_BrusselatorPDE.hpp,v 1.4 2007/07/09 17:04:02 etphipp Exp $ 
00002 // $Source: /space/CVS/Trilinos/packages/sacado/example/FEApp/FEApp_BrusselatorPDE.hpp,v $ 
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 ScalarT>
00044   class BrusselatorPDE : public FEApp::AbstractPDE<ScalarT> {
00045   public:
00046   
00048     BrusselatorPDE(
00049    double alpha, double beta, double D1, double D2,
00050    const Teuchos::RCP<Sacado::ScalarParameterLibrary>& paramLib);
00051 
00053     virtual ~BrusselatorPDE();
00054 
00056     virtual unsigned int numEquations() const;
00057 
00059     virtual void init(unsigned int numQuadPoints, unsigned int numNodes);
00060 
00062     virtual void
00063     evaluateElementResidual(const FEApp::AbstractQuadrature& quadRule,
00064           const FEApp::AbstractElement& element,
00065           const std::vector<ScalarT>* dot,
00066           const std::vector<ScalarT>& solution,
00067           std::vector<ScalarT>& residual);
00068 
00069   private:
00070     
00072     BrusselatorPDE(const BrusselatorPDE&);
00073     
00075     BrusselatorPDE& operator=(const BrusselatorPDE&);
00076     
00077   protected:
00078     
00080     unsigned int num_qp;
00081     
00083     unsigned int num_nodes;
00084     
00086     std::vector< std::vector<double> > phi;
00087 
00089     std::vector< std::vector<double> > dphi;
00090 
00092     std::vector<double> jac;
00093 
00095     std::vector<ScalarT> T;
00096 
00098     std::vector<ScalarT> C;
00099 
00101     std::vector<ScalarT> dT;
00102 
00104     std::vector<ScalarT> dC;
00105 
00107     std::vector<ScalarT> Tdot;
00108 
00110     std::vector<ScalarT> Cdot;
00111 
00113     ScalarT alpha, beta;
00114     double D1, D2;
00115 
00117     Teuchos::RCP<Sacado::ScalarParameterLibrary> pl;
00118 
00119   };
00120 
00121   class BrusselatorPDE_TemplateBuilder {
00122   public:
00123     BrusselatorPDE_TemplateBuilder(
00124   double alpha_, double beta_, double D1_, double D2_,
00125   const Teuchos::RCP<Sacado::ScalarParameterLibrary>& paramLib) :
00126       alpha(alpha_), beta(beta_), D1(D1_), D2(D2_), pl(paramLib) {}
00127     template <typename T>
00128     Teuchos::RCP<FEApp::AbstractPDE_NTBase> build() const {
00129       return Teuchos::rcp( new BrusselatorPDE<T>(alpha, beta, D1, D2, pl));
00130     }
00131   protected:
00132     double alpha, beta, D1, D2;
00133     Teuchos::RCP<Sacado::ScalarParameterLibrary> pl;
00134   };
00135 
00136 }
00137 
00138 // Include implementation
00139 #ifndef SACADO_ETI
00140 #include "FEApp_BrusselatorPDEImpl.hpp"
00141 #endif 
00142 
00143 #endif // FEAPP_BRUSSELATORPDE_HPP

Generated on Tue Oct 20 12:55:02 2009 for Sacado Package Browser (Single Doxygen Collection) by doxygen 1.4.7