~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/sacado/example/FEApp/FEApp_TemplateTypes.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: FEApp_TemplateTypes.hpp,v 1.2 2008/05/16 19:56:56 etphipp Exp $ 
2
 
// $Source: /space/CVS/Trilinos/packages/sacado/example/FEApp/FEApp_TemplateTypes.hpp,v $ 
 
1
// $Id$ 
 
2
// $Source$ 
3
3
// @HEADER
4
4
// ***********************************************************************
5
5
// 
32
32
#ifndef FEAPP_TEMPLATETYPES_HPP
33
33
#define FEAPP_TEMPLATETYPES_HPP
34
34
 
35
 
// Includ the MPL vector
 
35
#include "Sacado_ConfigDefs.h"
 
36
 
 
37
// Conditionally enable Stokhos stochastic Galerkin expansions
 
38
#ifdef HAVE_SACADO_STOKHOS
 
39
#define SG_ACTIVE 1
 
40
#else
 
41
#define SG_ACTIVE 0
 
42
#endif
 
43
 
 
44
// Include the MPL vector
36
45
#include "Sacado_mpl_vector.hpp"
37
46
 
38
47
// Include all of our AD types
39
48
#include "Sacado_MathFunctions.hpp"
40
 
#include "Sacado_Fad_DFad.hpp"
 
49
#include "Sacado.hpp"
 
50
//#include "Sacado_CacheFad_DFad.hpp"
 
51
#if SG_ACTIVE
 
52
#include "Sacado_PCE_OrthogPoly.hpp"
 
53
#endif
 
54
 
 
55
// Include ScalarParameterLibrary to specialize traits
 
56
#include "Sacado_ScalarParameterLibrary.hpp"
41
57
 
42
58
// Typedef AD types to standard names
43
59
typedef double RealType;
44
60
typedef Sacado::Fad::DFad<double> FadType;
45
 
 
46
 
// Define which types we are using
47
 
#define REAL_ACTIVE 1
48
 
#define FAD_ACTIVE 1
49
 
 
50
 
// Conditionally enable Stokhos stochastic Galerkin expansions
51
 
#ifdef HAVE_SACADO_STOKHOS
52
 
#include "Sacado_PCE_OrthogPoly.hpp"
53
 
#include "Stokhos_HermiteEBasis.hpp"
 
61
#if SG_ACTIVE
54
62
typedef Sacado::PCE::OrthogPoly<double> SGType;
55
63
typedef Sacado::Fad::DFad< Sacado::PCE::OrthogPoly<double> > SGFadType;
56
 
#define SG_ACTIVE 1
57
 
#define SGFAD_ACTIVE 1
 
64
#endif
 
65
 
 
66
// Set up evaluation traits
 
67
namespace FEApp {
 
68
 
 
69
  // Evaluation types
 
70
  struct ResidualType {};
 
71
  struct JacobianType {};
 
72
  struct TangentType {};
 
73
#if SG_ACTIVE
 
74
  struct SGResidualType {};
 
75
  struct SGJacobianType {};
 
76
#endif
 
77
 
 
78
  // Evaluation traits
 
79
  struct EvaluationTraits {
 
80
    template <class EvalT> struct apply {};
 
81
  };
 
82
 
 
83
  template <> struct EvaluationTraits::apply<ResidualType> { 
 
84
    typedef RealType type; };
 
85
  template <> struct EvaluationTraits::apply<JacobianType> { 
 
86
    typedef FadType type; };
 
87
  template <> struct EvaluationTraits::apply<TangentType> { 
 
88
    typedef FadType type; };
 
89
#if SG_ACTIVE
 
90
  template <> struct EvaluationTraits::apply<SGResidualType> { 
 
91
    typedef SGType type; };
 
92
  template <> struct EvaluationTraits::apply<SGJacobianType> { 
 
93
    typedef SGFadType  type; };
 
94
#endif
 
95
}
 
96
 
 
97
// Synonym for the ScalarParameterLibrary/Vector on our traits
 
98
typedef Sacado::ScalarParameterLibrary<FEApp::EvaluationTraits> ParamLib;
 
99
typedef Sacado::ScalarParameterVector<FEApp::EvaluationTraits> ParamVec;
 
100
 
 
101
// Build the MPL vector containing our valid evaluation types
 
102
typedef Sacado::mpl::vector<> EvalTypes0;
 
103
typedef Sacado::mpl::push_back<EvalTypes0, FEApp::ResidualType>::type EvalTypes1;
 
104
typedef Sacado::mpl::push_back<EvalTypes1, FEApp::JacobianType>::type EvalTypes2;
 
105
typedef Sacado::mpl::push_back<EvalTypes2, FEApp::TangentType>::type EvalTypes3;
 
106
#if SG_ACTIVE
 
107
typedef Sacado::mpl::push_back<EvalTypes3, FEApp::SGResidualType>::type EvalTypes4;
 
108
typedef Sacado::mpl::push_back<EvalTypes4, FEApp::SGJacobianType>::type EvalTypes5;
58
109
#else
59
 
#define SG_ACTIVE 0
60
 
#define SGFAD_ACTIVE 0
 
110
typedef EvalTypes3 EvalTypes5;
61
111
#endif
 
112
typedef EvalTypes5 EvalTypes;
62
113
 
63
114
// Turn on/off explicit template instantiation
64
115
#define SACADO_ETI
65
116
 
66
 
// Build the MPL vector containing our valid types
67
 
typedef Sacado::mpl::vector<> ValidTypes0;
68
 
#if REAL_ACTIVE
69
 
typedef Sacado::mpl::push_back<ValidTypes0, RealType>::type ValidTypes1;
70
 
#else
71
 
typedef ValidTypes0 ValidTypes1;
72
 
#endif
73
 
#if FAD_ACTIVE
74
 
typedef Sacado::mpl::push_back<ValidTypes1, FadType>::type ValidTypes2;
75
 
#else
76
 
typedef ValidTypes1 ValidTypes2;
77
 
#endif
78
 
#if SG_ACTIVE
79
 
typedef Sacado::mpl::push_back<ValidTypes2, SGType>::type ValidTypes3;
80
 
#else
81
 
typedef ValidTypes2 ValidTypes3;
82
 
#endif
83
 
#if SGFAD_ACTIVE
84
 
typedef Sacado::mpl::push_back<ValidTypes3, SGFadType>::type ValidTypes4;
85
 
#else
86
 
typedef ValidTypes3 ValidTypes4;
87
 
#endif
88
 
typedef ValidTypes4 ValidTypes;
89
 
 
90
117
// Define macro for explicit template instantiation
91
 
#if REAL_ACTIVE
92
 
#define INSTANTIATE_TEMPLATE_CLASS_REAL(name) template class name<double>;
93
 
#else
94
 
#define INSTANTIATE_TEMPLATE_CLASS_REAL(name)
95
 
#endif
96
 
 
97
 
#if FAD_ACTIVE
98
 
#define INSTANTIATE_TEMPLATE_CLASS_FAD(name) template class name<FadType>;
99
 
#else
100
 
#define INSTANTIATE_TEMPLATE_CLASS_FAD(name)
101
 
#endif
102
 
 
 
118
#define INSTANTIATE_TEMPLATE_CLASS_RESIDUAL(name) template class name<FEApp::ResidualType>;
 
119
#define INSTANTIATE_TEMPLATE_CLASS_JACOBIAN(name) template class name<FEApp::JacobianType>;
 
120
#define INSTANTIATE_TEMPLATE_CLASS_TANGENT(name) template class name<FEApp::TangentType>;
103
121
#if SG_ACTIVE
104
 
#define INSTANTIATE_TEMPLATE_CLASS_SG(name) template class name<SGType>;
105
 
#else
106
 
#define INSTANTIATE_TEMPLATE_CLASS_SG(name)
107
 
#endif
108
 
 
109
 
#if SGFAD_ACTIVE
110
 
#define INSTANTIATE_TEMPLATE_CLASS_SGFAD(name) template class name<SGFadType>;
111
 
#else
112
 
#define INSTANTIATE_TEMPLATE_CLASS_SGFAD(name)
113
 
#endif
114
 
 
115
 
#define INSTANTIATE_TEMPLATE_CLASS(name) \
116
 
  INSTANTIATE_TEMPLATE_CLASS_REAL(name)  \
117
 
  INSTANTIATE_TEMPLATE_CLASS_FAD(name)   \
118
 
  INSTANTIATE_TEMPLATE_CLASS_SG(name)    \
119
 
  INSTANTIATE_TEMPLATE_CLASS_SGFAD(name)
 
122
#define INSTANTIATE_TEMPLATE_CLASS_SGRESIDUAL(name) template class name<FEApp::SGResidualType>;
 
123
#define INSTANTIATE_TEMPLATE_CLASS_SGJACOBIAN(name) template class name<FEApp::SGJacobianType>;
 
124
#else
 
125
#define INSTANTIATE_TEMPLATE_CLASS_SGRESIDUAL(name)
 
126
#define INSTANTIATE_TEMPLATE_CLASS_SGJACOBIAN(name)
 
127
#endif
 
128
 
 
129
#define INSTANTIATE_TEMPLATE_CLASS(name)      \
 
130
  INSTANTIATE_TEMPLATE_CLASS_RESIDUAL(name)   \
 
131
  INSTANTIATE_TEMPLATE_CLASS_JACOBIAN(name)   \
 
132
  INSTANTIATE_TEMPLATE_CLASS_TANGENT(name)    \
 
133
  INSTANTIATE_TEMPLATE_CLASS_SGRESIDUAL(name) \
 
134
  INSTANTIATE_TEMPLATE_CLASS_SGJACOBIAN(name)
120
135
 
121
136
#endif // FEAPP_TEMPLATETYPES_HPP