00001 // $Id: FEApp_TemplateTypes.hpp,v 1.2 2008/05/16 19:56:56 etphipp Exp $ 00002 // $Source: /space/CVS/Trilinos/packages/sacado/example/FEApp/FEApp_TemplateTypes.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_TEMPLATETYPES_HPP 00033 #define FEAPP_TEMPLATETYPES_HPP 00034 00035 // Includ the MPL vector 00036 #include "Sacado_mpl_vector.hpp" 00037 00038 // Include all of our AD types 00039 #include "Sacado_MathFunctions.hpp" 00040 #include "Sacado_Fad_DFad.hpp" 00041 00042 // Typedef AD types to standard names 00043 typedef double RealType; 00044 typedef Sacado::Fad::DFad<double> FadType; 00045 00046 // Define which types we are using 00047 #define REAL_ACTIVE 1 00048 #define FAD_ACTIVE 1 00049 00050 // Conditionally enable Stokhos stochastic Galerkin expansions 00051 #ifdef HAVE_SACADO_STOKHOS 00052 #include "Sacado_PCE_OrthogPoly.hpp" 00053 #include "Stokhos_HermiteEBasis.hpp" 00054 typedef Sacado::PCE::OrthogPoly<double> SGType; 00055 typedef Sacado::Fad::DFad< Sacado::PCE::OrthogPoly<double> > SGFadType; 00056 #define SG_ACTIVE 1 00057 #define SGFAD_ACTIVE 1 00058 #else 00059 #define SG_ACTIVE 0 00060 #define SGFAD_ACTIVE 0 00061 #endif 00062 00063 // Turn on/off explicit template instantiation 00064 #define SACADO_ETI 00065 00066 // Build the MPL vector containing our valid types 00067 typedef Sacado::mpl::vector<> ValidTypes0; 00068 #if REAL_ACTIVE 00069 typedef Sacado::mpl::push_back<ValidTypes0, RealType>::type ValidTypes1; 00070 #else 00071 typedef ValidTypes0 ValidTypes1; 00072 #endif 00073 #if FAD_ACTIVE 00074 typedef Sacado::mpl::push_back<ValidTypes1, FadType>::type ValidTypes2; 00075 #else 00076 typedef ValidTypes1 ValidTypes2; 00077 #endif 00078 #if SG_ACTIVE 00079 typedef Sacado::mpl::push_back<ValidTypes2, SGType>::type ValidTypes3; 00080 #else 00081 typedef ValidTypes2 ValidTypes3; 00082 #endif 00083 #if SGFAD_ACTIVE 00084 typedef Sacado::mpl::push_back<ValidTypes3, SGFadType>::type ValidTypes4; 00085 #else 00086 typedef ValidTypes3 ValidTypes4; 00087 #endif 00088 typedef ValidTypes4 ValidTypes; 00089 00090 // Define macro for explicit template instantiation 00091 #if REAL_ACTIVE 00092 #define INSTANTIATE_TEMPLATE_CLASS_REAL(name) template class name<double>; 00093 #else 00094 #define INSTANTIATE_TEMPLATE_CLASS_REAL(name) 00095 #endif 00096 00097 #if FAD_ACTIVE 00098 #define INSTANTIATE_TEMPLATE_CLASS_FAD(name) template class name<FadType>; 00099 #else 00100 #define INSTANTIATE_TEMPLATE_CLASS_FAD(name) 00101 #endif 00102 00103 #if SG_ACTIVE 00104 #define INSTANTIATE_TEMPLATE_CLASS_SG(name) template class name<SGType>; 00105 #else 00106 #define INSTANTIATE_TEMPLATE_CLASS_SG(name) 00107 #endif 00108 00109 #if SGFAD_ACTIVE 00110 #define INSTANTIATE_TEMPLATE_CLASS_SGFAD(name) template class name<SGFadType>; 00111 #else 00112 #define INSTANTIATE_TEMPLATE_CLASS_SGFAD(name) 00113 #endif 00114 00115 #define INSTANTIATE_TEMPLATE_CLASS(name) \ 00116 INSTANTIATE_TEMPLATE_CLASS_REAL(name) \ 00117 INSTANTIATE_TEMPLATE_CLASS_FAD(name) \ 00118 INSTANTIATE_TEMPLATE_CLASS_SG(name) \ 00119 INSTANTIATE_TEMPLATE_CLASS_SGFAD(name) 00120 00121 #endif // FEAPP_TEMPLATETYPES_HPP
1.4.7