FEApp_BrusselatorParameters.hpp

Go to the documentation of this file.
00001 // $Id: FEApp_BrusselatorParameters.hpp,v 1.1 2007/06/23 00:47:47 etphipp Exp $ 
00002 // $Source: /space/CVS/Trilinos/packages/sacado/example/FEApp/FEApp_BrusselatorParameters.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_BRUSSELATORPARAMETERS_HPP
00033 #define FEAPP_BRUSSELATORPARAMETERS_HPP
00034 
00035 #include "Sacado_ScalarParameterEntry.hpp"
00036 #include "Sacado_Traits.hpp"
00037 
00038 namespace FEApp {
00039 
00044   template <typename ScalarT>
00045   class BrusselatorAlphaParameter : 
00046     public Sacado::ScalarParameterEntry<ScalarT> {
00047 
00048   public:
00049 
00051     BrusselatorAlphaParameter(const ScalarT& value) : val(value) {}
00052 
00054     virtual ~BrusselatorAlphaParameter() {}
00055 
00057     virtual void setRealValue(double value) { 
00058       setValueAsConstant(ScalarT(value)); }
00059 
00061     virtual void setValueAsConstant(const ScalarT& value) { 
00062       val = value; Sacado::MarkConstant<ScalarT>::eval(val); }
00063     
00065     virtual void setValueAsIndependent(const ScalarT& value) { 
00066       val = value; }
00067     
00069     virtual const ScalarT& getValue() const { return val; }
00070     
00071   protected:  
00072     
00074     ScalarT val;
00075 
00076   };
00077 
00082   template <typename ScalarT>
00083   class BrusselatorBetaParameter : 
00084     public Sacado::ScalarParameterEntry<ScalarT> {
00085 
00086   public:
00087 
00089     BrusselatorBetaParameter(const ScalarT& value) : val(value) {}
00090 
00092     virtual ~BrusselatorBetaParameter() {}
00093 
00095     virtual void setRealValue(double value) { 
00096       setValueAsConstant(ScalarT(value)); }
00097 
00099     virtual void setValueAsConstant(const ScalarT& value) { 
00100       val = value; Sacado::MarkConstant<ScalarT>::eval(val); }
00101     
00103     virtual void setValueAsIndependent(const ScalarT& value) { 
00104       val = value; }
00105     
00107     virtual const ScalarT& getValue() const { return val; }
00108     
00109   protected:  
00110     
00112     ScalarT val;
00113 
00114   };
00115 
00116 }
00117 
00118 #endif // FEAPP_BRUSSELATORPARAMETRS_HPP

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