Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
LagrangeBasis.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2014 Sandia Corporation. */
3 /* This software is released under the license detailed */
4 /* in the file, LICENSE, which is located in the top-level Nalu */
5 /* directory structure */
6 /*------------------------------------------------------------------------*/
7 #ifndef LagrangeBasis_h
8 #define LagrangeBasis_h
9 
10 #include <vector>
11 
12 namespace sierra{
13 namespace nalu{
14 
16 {
17 public:
18  Lagrange1D(const double* nodeLocs, int order);
19 
20  Lagrange1D(std::vector<double> nodeLocs);
21 
22  Lagrange1D(int order);
23 
24  virtual ~Lagrange1D();
25 
26  double interpolation_weight(double x, unsigned nodeNumber) const;
27 
28  double derivative_weight(double x, unsigned nodeNumber) const;
29 
30 private:
31  void set_lagrange_weights();
32  std::vector<double> lagrangeWeights_;
33  std::vector<double> nodeLocs_;
34 };
35 
37 {
38 public:
40  const std::vector<std::vector<int>>& indicesMap,
41  const std::vector<double>& nodeLocs
42  );
43 
44  virtual ~LagrangeBasis();
45 
46  std::vector<double> eval_basis_weights(
47  const std::vector<double>& intgLoc) const;
48 
49  std::vector<double> eval_deriv_weights(
50  const std::vector<double>& intgLoc) const;
51 
52  void interpolation_weights(const double* isoParCoord, double* weights) const;
53  void derivative_weights(const double* isoParCoord, double* weights) const;
54 
55  const std::vector<double>& point_interpolation_weights(const double* isoParCoords);
56  const std::vector<double>& point_derivative_weights(const double* isoParCoords);
57 
58  double tensor_lagrange_derivative(
59  unsigned dimension,
60  const double* x,
61  const int* node_ordinals,
62  unsigned derivativeDirection
63  ) const;
64 
65  double tensor_lagrange_interpolant(unsigned dimension, const double* x, const int* node_ordinals) const;
66 
67  unsigned num_nodes() { return numNodes_; }
68 
69  std::vector<std::vector<int>> indicesMap_;
70 
71  std::vector<double> interpWeightsAtPoint_;
72  std::vector<double> derivWeightsAtPoint_;
73 
75  unsigned numNodes1D_;
76  unsigned numNodes_;
77  unsigned polyOrder_;
78  const unsigned dim_;
79 };
80 
81 
82 } // namespace nalu
83 } // namespace Sierra
84 
85 #endif
const Lagrange1D basis1D_
Definition: LagrangeBasis.h:74
double interpolation_weight(double x, unsigned nodeNumber) const
Definition: LagrangeBasis.C:64
Definition: ABLForcingAlgorithm.C:26
const unsigned dim_
Definition: LagrangeBasis.h:78
std::vector< std::vector< int > > indicesMap_
Definition: LagrangeBasis.h:69
void set_lagrange_weights()
Definition: LagrangeBasis.C:49
std::vector< double > lagrangeWeights_
Definition: LagrangeBasis.h:32
unsigned numNodes1D_
Definition: LagrangeBasis.h:75
unsigned polyOrder_
Definition: LagrangeBasis.h:77
std::vector< double > nodeLocs_
Definition: LagrangeBasis.h:33
unsigned numNodes_
Definition: LagrangeBasis.h:76
std::vector< double > interpWeightsAtPoint_
Definition: LagrangeBasis.h:71
Definition: LagrangeBasis.h:36
std::vector< double > derivWeightsAtPoint_
Definition: LagrangeBasis.h:72
Lagrange1D(const double *nodeLocs, int order)
Definition: LagrangeBasis.C:32
Definition: LagrangeBasis.h:15
double derivative_weight(double x, unsigned nodeNumber) const
Definition: LagrangeBasis.C:76
unsigned num_nodes()
Definition: LagrangeBasis.h:67