COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Line.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_Line_hpp
8 #define cf3_mesh_gausslegendre_Line_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 };
24  enum { dimensionality = 1 };
25  enum { order = P };
26  enum { shape = GeoShape::LINE };
27 };
28 
30 
36 template <Uint P>
37 struct mesh_gausslegendre_API Line : QuadratureBase< Line_traits<P> >
38 {
39 public:
42 
43  static const LocalCoordsT& local_coordinates();
44  static const WeightsT& weights();
45 
46 private:
47  // @brief Storage and conversion to static Eigen type
49  {
52 
54  {
55  static GaussLegendreQuadrature inst;
56  return inst;
57  }
58 
59  private:
60 
62  {
63  std::pair< std::vector<Real>, std::vector<Real> > qdr = GaussLegendre(P);
64  for (Uint i=0; i<P; ++i)
65  {
66  roots[i] = qdr.first[i];
67  weights[i] = qdr.second[i];
68  }
69  }
70  };
71 };
72 
74 
75 template <Uint P>
77 {
78  static const WeightsT w = GaussLegendreQuadrature::instance().weights;
79  return w;
80 }
81 
83 
84 template <Uint P>
86 {
87  static const LocalCoordsT loc_coord = GaussLegendreQuadrature::instance().roots;
88  return loc_coord;
89 }
90 
92 
93 } // gausslegendre
94 } // mesh
95 } // cf3
96 
97 #endif // cf3_mesh_gausslegendre_Line_hpp
#define mesh_gausslegendre_API
Definition: API.hpp:18
static const WeightsT & weights()
Definition: Line.hpp:76
QuadratureBase< Line_traits< P > >::WeightsT weights
Definition: Line.hpp:51
QuadratureBase< Line_traits< P > >::LocalCoordsT LocalCoordsT
Definition: Line.hpp:40
Base class to inherit shape function implementations from.
QuadratureBase< Line_traits< P > >::LocalCoordsT roots
Definition: Line.hpp:50
Top-level namespace for coolfluid.
Definition: Action.cpp:18
static const LocalCoordsT & local_coordinates()
Definition: Line.hpp:85
static const GaussLegendreQuadrature & instance()
Definition: Line.hpp:53
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
#define P(a, b, c, d, k, s, t)
QuadratureBase< Line_traits< P > >::WeightsT WeightsT
Definition: Line.hpp:41
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
Send comments to:
COOLFluiD Web Admin