18 double *diff_x,
double *diff_t,
double *L,
19 double *diffL,
const int dim) {
38 diffL[0 * (p + 1) + 0] = 0;
40 diffL[1 * (p + 1) + 0] = 0;
42 diffL[2 * (p + 1) + 0] = 0;
48 L[1] = 2 * x -
t + alpha * x;
51 for (; d < dim; ++d) {
52 double d_t = (diff_t) ? diff_t[d] : 0;
53 diffL[d * (p + 1) + 1] = (2 + alpha) * diff_x[d] - d_t;
61 double a = 2 * lp1 * (lp1 + alpha) * (2 * lp1 + alpha - 2);
62 double b = 2 * lp1 + alpha - 1;
63 double c = (2 * lp1 + alpha) * (2 * lp1 + alpha - 2);
64 double d = 2 * (lp1 + alpha - 1) * (lp1 - 1) * (2 * lp1 + alpha);
65 double A = b * (
c * (2 * x -
t) + alpha * alpha *
t) /
a;
66 double B = d *
t *
t /
a;
67 L[lp1] =
A * L[
l] -
B * L[
l - 1];
70 for (; z < dim; ++z) {
71 double d_t = (diff_t) ? diff_t[z] : 0;
73 b * (
c * (2 * diff_x[z] - d_t) + alpha * alpha * d_t) /
a;
74 double diffB = d * 2 *
t * d_t /
a;
75 diffL[z * (p + 1) + lp1] =
A * diffL[z * (p + 1) +
l] -
76 B * diffL[z * (p + 1) +
l - 1] +
77 diffA * L[
l] - diffB * L[
l - 1];
85 double t,
double *diff_x,
86 double *diff_t,
double *L,
87 double *diffL,
const int dim) {
100 for (; d != dim; ++d) {
101 diffL[d * p + 0] = diff_x[d];
106 double jacobi[(p + 1)];
107 double diff_jacobi[(p + 1) * dim];
114 const double a = (
i + alpha) / ((2 *
i + alpha - 1) * (2 *
i + alpha));
115 const double b = alpha / ((2 *
i + alpha - 2) * (2 *
i + alpha));
116 const double c = (
i - 1) / ((2 *
i + alpha - 2) * (2 *
i + alpha - 1));
117 L[
l] =
a * jacobi[
i] + b *
t * jacobi[
i - 1] -
c *
t *
t * jacobi[
i - 2];
120 for (; d != dim; ++d) {
121 diffL[d * p +
l] =
a * diff_jacobi[d * (p + 1) +
i] +
122 b * (
t * diff_jacobi[d * (p + 1) +
i - 1] +
123 diff_t[d] * jacobi[
i - 1]) -
124 c * (
t *
t * diff_jacobi[d * (p + 1) +
i - 2] +
125 2 *
t * diff_t[d] * jacobi[
i - 2]);
230 double *L,
double *diffL,
242 "Polynomial beyond order 9 is not implemented");
244 if (diff_s == NULL) {
252 for (;
l != p + 1;
l++) {
258 for (;
l != p + 1;
l++) {
261 for (; d < dim; ++d) {
262 diffL[d * (p + 1) +
l] = diff_s[d] *
a;
static double f_phi4(double x)
static double f_phi1(double x)
static double f_phi0(double x)
static double f_phi8x(double x)
PetscErrorCode IntegratedJacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate integrated Jacobi approximation basis.
static double(* f_phi[])(double x)
static double f_phi7(double x)
static double f_phi0x(double x)
static double f_phi4x(double x)
static PetscErrorCode ierr
static double f_phi8(double x)
static double(* f_phix[])(double x)
PetscErrorCode Jacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate Jacobi approximation basis.
static double f_phi2x(double x)
static double f_phi1x(double x)
static double f_phi9x(double x)
static double f_phi5(double x)
static double f_phi7x(double x)
static double f_phi3x(double x)
static double f_phi3(double x)
static double f_phi5x(double x)
static double f_phi6x(double x)
static double f_phi9(double x)
static double f_phi2(double x)
static double f_phi6(double x)
#define LOBATTO_PHI0X(x)
Derivatives of kernel functions for Lobbatto base.
#define LOBATTO_PHI0(x)
Definitions taken from Hermes2d code.
useful compiler derivatives and definitions
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode LobattoKernel_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Kernel Lobatto base functions.
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
FTensor::Index< 'l', 3 > l
constexpr double t
plate stiffness