Parallel Finite Element - General geometry Ewald-like Method
Part of Continuum-particle Simulation Suite under MICCOM
chebyshev.h
Go to the documentation of this file.
1 // Parallel Finite Element-General Geometry Ewald-like Method.
2 // Copyright (C) 2015-2016 Xujun Zhao, Jiyuan Li, Xikai Jiang
3 
4 // This code is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 
10 // This code is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 
15 
16 // You should have received a copy of the GNU General Public
17 // License along with this code; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 
21 
22 #pragma once
23 
24 #include <stdio.h>
25 #include <cmath>
26 #include <vector>
27 
28 
29 #include "libmesh/libmesh.h"
30 #include "libmesh/dense_matrix.h"
31 #include "libmesh/dense_vector.h"
32 
33 
34 namespace libMesh
35 {
36 
37 
38  /*
39  * The Chebyshev is designed for implementing
40  * Chebyshev polynomial series
41  */
42 
43 //using libMesh::Real;
44 
45 
46 class Chebyshev
47 {
48 public:
49  // Constructor
50  Chebyshev();
51 
52 
53  // Destructor
54  ~Chebyshev();
55 
56 
57  /*
58  * The function of the Chebyshev expansion
59  */
60  Real chebyshev_function(const Real x,
61  const Real da_cheb,
62  const Real db_cheb) const;
63 
64 
65  /*
66  * Chebyshev expansion coefficients
67  */
68  DenseVector<Number> chebyshev_coefficients(const std::size_t N,
69  const Real da_cheb,
70  const Real db_cheb,
71  const std::string method) const;
72 
73 
74  /*
75  * The transforming matrix from physical space to Chebyshev tranform space
76  * using Gauss-Lotatto method
77  */
78  DenseMatrix<Number> transform_matrix(const std::size_t N) const;
79 
80 
81 
82  /*
83  * Quadrature points and weights to evaluate the Chebyshev coeffecients
84  * (1) Chebyshev-Gauss: n = 0, 1, ... , N
85  */
86  void chebyshev_gauss(const std::size_t N, // # of expansion terms
87  std::vector<Real>& x, // quadrature points
88  std::vector<Real>& w) const; // weights
89 
90 
91  /*
92  * Quadrature points and weights to evaluate the Chebyshev coeffecients
93  * (2) Chebyshev-Gauss-Radau: n = 0, 1, ... , N
94  */
95  void chebyshev_gauss_radau(const std::size_t N, // # of expansion terms
96  std::vector<Real>& x, // quadrature points
97  std::vector<Real>& w) const; // weights
98 
99 
100  /*
101  * Quadrature points and weights to evaluate the Chebyshev coeffecients
102  * (3) Chebyshev-Gauss-Lobatto: n = 0, 1, ... , N
103  */
104  void chebyshev_gauss_lobatto(const std::size_t N, // # of expansion terms
105  std::vector<Real>& x, // quadrature points
106  std::vector<Real>& w) const; // weights
107 
108 
109 
110 
111 }; // end class Chebyshev
112 
113 
114 
115 } // end namespace
116 
DenseVector< Number > chebyshev_coefficients(const std::size_t N, const Real da_cheb, const Real db_cheb, const std::string method) const
Definition: chebyshev.C:62
Definition: chebyshev.h:46
Chebyshev()
Definition: chebyshev.C:32
void chebyshev_gauss(const std::size_t N, std::vector< Real > &x, std::vector< Real > &w) const
Definition: chebyshev.C:137
Definition: brownian_system.h:58
DenseMatrix< Number > transform_matrix(const std::size_t N) const
Definition: chebyshev.C:114
Real chebyshev_function(const Real x, const Real da_cheb, const Real db_cheb) const
Definition: chebyshev.C:48
void chebyshev_gauss_lobatto(const std::size_t N, std::vector< Real > &x, std::vector< Real > &w) const
Definition: chebyshev.C:178
void chebyshev_gauss_radau(const std::size_t N, std::vector< Real > &x, std::vector< Real > &w) const
Definition: chebyshev.C:157
~Chebyshev()
Definition: chebyshev.C:40