00001 // $Id: FEApp_TemplateTypes.hpp,v 1.1 2007/05/08 21:37:17 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_Fad_DFad.hpp" 00040 00041 // Typedef AD types to standard names 00042 typedef double RealType; 00043 typedef Sacado::Fad::DFad<double> FadType; 00044 00045 // Define which types we are using 00046 #define REAL_ACTIVE 1 00047 #define FAD_ACTIVE 1 00048 00049 // Turn on/off explicit template instantiation 00050 #define SACADO_ETI 00051 00052 // Build the MPL vector containing our valid types 00053 typedef Sacado::mpl::vector<> ValidTypes0; 00054 #if REAL_ACTIVE 00055 typedef Sacado::mpl::push_back<ValidTypes0, RealType>::type ValidTypes1; 00056 #else 00057 typedef ValidTypes0 ValidTypes1; 00058 #endif 00059 #if FAD_ACTIVE 00060 typedef Sacado::mpl::push_back<ValidTypes1, FadType>::type ValidTypes2; 00061 #else 00062 typedef ValidTypes1 ValidTypes2; 00063 #endif 00064 typedef ValidTypes2 ValidTypes; 00065 00066 // Define macro for explicit template instantiation 00067 #if REAL_ACTIVE 00068 #define INSTANTIATE_TEMPLATE_CLASS_REAL(name) template class name<double>; 00069 #else 00070 #define INSTANTIATE_TEMPLATE_CLASS_REAL(name) 00071 #endif 00072 00073 #if FAD_ACTIVE 00074 #define INSTANTIATE_TEMPLATE_CLASS_FAD(name) template class name<FadType>; 00075 #else 00076 #define INSTANTIATE_TEMPLATE_CLASS_FAD(name) 00077 #endif 00078 00079 #define INSTANTIATE_TEMPLATE_CLASS(name) \ 00080 INSTANTIATE_TEMPLATE_CLASS_REAL(name) \ 00081 INSTANTIATE_TEMPLATE_CLASS_FAD(name) 00082 00083 #endif // FEAPP_TEMPLATETYPES_HPP
1.4.7