FEApp_HeatNonlinearSourcePDE.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_HEATNONLINEARSOURCEPDE_HPP
00033 #define FEAPP_HEATNONLINEARSOURCEPDE_HPP
00034 
00035 #include "Teuchos_RCP.hpp"
00036 
00037 #include "FEApp_AbstractPDE.hpp"
00038 #include "FEApp_FunctionFactory.hpp"
00039 #include "FEApp_SourceFunctionFactory.hpp"
00040 #include "Sacado_ScalarParameterLibrary.hpp"
00041 
00042 namespace FEApp {
00043 
00044   template <typename EvalT>
00045   class HeatNonlinearSourcePDE : public FEApp::AbstractPDE<EvalT> {
00046   public:
00047 
00049     typedef typename FEApp::AbstractPDE<EvalT>::ScalarT ScalarT;
00050   
00052     HeatNonlinearSourcePDE(
00053       const Teuchos::RCP< const FEApp::AbstractFunction<EvalT> >& mat_func,
00054       const Teuchos::RCP< const FEApp::AbstractSourceFunction<EvalT> >& src_func);
00055 
00057     virtual ~HeatNonlinearSourcePDE();
00058 
00060     virtual unsigned int numEquations() const;
00061 
00063     virtual void init(unsigned int numQuadPoints, unsigned int numNodes);
00064 
00066     virtual void
00067     evaluateElementResidual(const FEApp::AbstractQuadrature& quadRule,
00068                             const FEApp::AbstractElement& element,
00069                             const std::vector<ScalarT>* dot,
00070                             const std::vector<ScalarT>& solution,
00071                             std::vector<ScalarT>& residual);
00072 
00073   private:
00074 
00076     HeatNonlinearSourcePDE(const HeatNonlinearSourcePDE&);
00077 
00079     HeatNonlinearSourcePDE& operator=(const HeatNonlinearSourcePDE&);
00080 
00081   protected:
00082 
00084     Teuchos::RCP< const FEApp::AbstractFunction<EvalT> > mat;
00085     
00087     Teuchos::RCP< const FEApp::AbstractSourceFunction<EvalT> > source;
00088 
00090     unsigned int num_qp;
00091     
00093     unsigned int num_nodes;
00094 
00096     std::vector< std::vector<double> > phi;
00097 
00099     std::vector< std::vector<double> > dphi;
00100 
00102     std::vector<double> jac;
00103 
00105     std::vector<ScalarT> u;
00106 
00108     std::vector<ScalarT> du;
00109 
00111     std::vector<ScalarT> udot;
00112 
00114     std::vector<ScalarT> a;
00115 
00117     std::vector<ScalarT> f;
00118 
00119   };
00120 
00121   class HeatNonlinearSourcePDE_TemplateBuilder {
00122   public:
00123     HeatNonlinearSourcePDE_TemplateBuilder(
00124     const Teuchos::RCP<Teuchos::ParameterList>& params_,
00125           const Teuchos::RCP<ParamLib>& paramLib) :
00126       mat_params(Teuchos::rcp(&(params_->sublist("Material Function")),false)),
00127       src_params(Teuchos::rcp(&(params_->sublist("Source Function")),false)),
00128       pl(paramLib) {}
00129     template <typename T>
00130     Teuchos::RCP<FEApp::AbstractPDE_NTBase> build() const {
00131       FEApp::FunctionFactory<T> matFactory(mat_params, pl);
00132       Teuchos::RCP< FEApp::AbstractFunction<T> > mat =
00133         matFactory.create();
00134       FEApp::SourceFunctionFactory<T> srcFactory(src_params, pl);
00135       Teuchos::RCP< FEApp::AbstractSourceFunction<T> > source =
00136         srcFactory.create();
00137       return Teuchos::rcp( new FEApp::HeatNonlinearSourcePDE<T>(mat, source));
00138     }
00139   protected:
00140     Teuchos::RCP<Teuchos::ParameterList> mat_params;
00141     Teuchos::RCP<Teuchos::ParameterList> src_params;
00142     Teuchos::RCP<ParamLib> pl;
00143   };
00144 
00145 }
00146 
00147 // Include implementation
00148 #ifndef SACADO_ETI
00149 #include "FEApp_HeatNonlinearSourcePDEImpl.hpp"
00150 #endif 
00151 
00152 #endif // FEAPP_HEATNONLINERASOURCEPDE_HPP

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