COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Quad.hpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #ifndef cf3_mesh_gausslegendre_Quad_hpp
8 #define cf3_mesh_gausslegendre_Quad_hpp
9 
10 #include "mesh/QuadratureBase.hpp"
13 
14 namespace cf3 {
15 namespace mesh {
16 namespace gausslegendre {
17 
19 
20 template <Uint P>
22 {
23  enum { nb_nodes = P*P };
24  enum { dimensionality = 2 };
25  enum { order = P };
26  enum { shape = GeoShape::QUAD };
27 };
28 
30 
36 template <Uint P>
37 struct mesh_gausslegendre_API Quad : QuadratureBase< Quad_traits<P> >
38 {
39 public:
42 
43  static const LocalCoordsT& local_coordinates();
44  static const WeightsT& weights();
45 
46 private:
47 
48  // @brief Storage and conversion to static Eigen type
50  {
53 
55  {
56  static GaussLegendreQuadrature inst;
57  return inst;
58  }
59 
60  private:
61 
63  {
64  std::pair< std::vector<Real>, std::vector<Real> > qdr = GaussLegendre(P);
65  for (Uint i=0; i<P; ++i)
66  {
67  for (Uint j=0; j<P; ++j)
68  {
69  roots(j+P*i, KSI) = qdr.first[i];
70  roots(j+P*i, ETA) = qdr.first[j];
71  weights[j+P*i] = qdr.second[i] * qdr.second[j];
72  }
73  }
74  }
75 
76  };
77 
78 };
79 
81 
82 template <Uint P>
84 {
85  static const WeightsT w = GaussLegendreQuadrature::instance().weights;
86  return w;
87 }
88 
90 
91 template <Uint P>
93 {
94  static const LocalCoordsT loc_coord = GaussLegendreQuadrature::instance().roots;
95  return loc_coord;
96 }
97 
99 
100 } // gausslegendre
101 } // mesh
102 } // cf3
103 
104 #endif // cf3_mesh_gausslegendre_Quad_hpp
#define mesh_gausslegendre_API
Definition: API.hpp:18
static const WeightsT & weights()
Definition: Quad.hpp:83
static const GaussLegendreQuadrature & instance()
Definition: Quad.hpp:54
Base class to inherit shape function implementations from.
QuadratureBase< Quad_traits< P > >::LocalCoordsT roots
Definition: Quad.hpp:51
QuadratureBase< Quad_traits< P > >::WeightsT weights
Definition: Quad.hpp:52
Top-level namespace for coolfluid.
Definition: Action.cpp:18
QuadratureBase< Quad_traits< P > >::LocalCoordsT LocalCoordsT
Definition: Quad.hpp:40
QuadratureBase< Quad_traits< P > >::WeightsT WeightsT
Definition: Quad.hpp:41
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
#define P(a, b, c, d, k, s, t)
Fallback class if a concrete Quadrature doesn't implement a static function.
std::pair< std::vector< Real >, std::vector< Real > > GaussLegendre(const Uint polyorder)
Definition: Legendre.cpp:132
static const LocalCoordsT & local_coordinates()
Definition: Quad.hpp:92
Send comments to:
COOLFluiD Web Admin