v0.8.23
Public Member Functions | List of all members
HcurlEdgeBase Struct Reference

Public Member Functions

MoFEMErrorCode operator() (int shift, int p, int nb_integration_pts, int n0_idx, int n1_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< double *, 3 > &t_phi, FTensor::Tensor2< double *, 3, 3 > &t_diff_phi)
 
MoFEMErrorCode operator() (int shift, int p, int nb_integration_pts, int n0_idx, int n1_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< double *, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > &t_diff_phi)
 
MoFEMErrorCode operator() (int shift, int p, int nb_integration_pts, int n0_idx, int n1_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< double *, 3 > &t_phi)
 

Detailed Description

Definition at line 2013 of file Hcurl.cpp.

Member Function Documentation

◆ operator()() [1/3]

MoFEMErrorCode HcurlEdgeBase::operator() ( int  shift,
int  p,
int  nb_integration_pts,
int  n0_idx,
int  n1_idx,
double  n[],
FTensor::Tensor1< double, 3 >  t_grad_n[],
FTensor::Tensor1< double *, 3 > &  t_phi,
FTensor::Tensor2< double *, 3, 3 > &  t_diff_phi 
)

Definition at line 2014 of file Hcurl.cpp.

2018  {
2019 
2022 
2024 
2025  FTensor::Tensor1<double, 3> &t_grad_n0 = t_grad_n[n0_idx];
2026  FTensor::Tensor1<double, 3> &t_grad_n1 = t_grad_n[n1_idx];
2027  FTensor::Tensor1<double, 3> t_grad_n0_p_n1;
2028  t_grad_n0_p_n1(i) = t_grad_n0(i) + t_grad_n1(i);
2030  FTensor::Tensor2<double, 3, 3> t_diff_phi_0;
2031 
2032  VectorDouble fi(p + 1);
2033  VectorDouble diff_fi(3 * p + 3);
2034 
2035  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2036  const int shift_n = shift * gg;
2037  const double n0 = n[shift_n + n0_idx];
2038  const double n1 = n[shift_n + n1_idx];
2039 
2040  t_phi(i) = n0 * t_grad_n1(i) - n1 * t_grad_n0(i);
2041  t_diff_phi(i, j) =
2042  t_grad_n0(j) * t_grad_n1(i) - t_grad_n1(j) * t_grad_n0(i);
2043 
2044  t_phi_0(i) = t_phi(i);
2045  t_diff_phi_0(i, j) = t_diff_phi(i, j);
2046 
2047  ++t_phi;
2048  ++t_diff_phi;
2049 
2050  if (p > 1) {
2051 
2052  CHKERR Jacobi_polynomials(p, 0, n1, n0 + n1, &t_grad_n1(0),
2053  &t_grad_n0_p_n1(0), &*fi.data().begin(),
2054  &*diff_fi.data().begin(), 3);
2055 
2056  FTensor::Tensor1<double *, 3> t_diff_fi(&diff_fi[0 * (p + 1) + 1],
2057  &diff_fi[1 * (p + 1) + 1],
2058  &diff_fi[2 * (p + 1) + 1], 1);
2059 
2060  FTensor::Tensor1<double, 3> t_diff_b;
2061  for (int oo = 1; oo <= p - 1; ++oo) {
2062  const double b = pow(n0 + n1, oo);
2063  t_diff_b(i) =
2064  oo * pow(n0 + n1, oo - 1) * (t_grad_n0(i) + t_grad_n1(i));
2065  t_phi(i) = b * fi[oo] * t_phi_0(i);
2066  t_diff_phi(i, j) = (b * fi[oo]) * t_diff_phi_0(i, j) +
2067  (b * t_diff_fi(j)) * t_phi_0(i) +
2068  t_diff_b(j) * fi[oo] * t_phi_0(i);
2069 
2070  ++t_diff_fi;
2071  ++t_phi;
2072  ++t_diff_phi;
2073  }
2074  }
2075  }
2076 
2078  }
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.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
T data[Tensor_Dim]
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:76

◆ operator()() [2/3]

MoFEMErrorCode HcurlEdgeBase::operator() ( int  shift,
int  p,
int  nb_integration_pts,
int  n0_idx,
int  n1_idx,
double  n[],
FTensor::Tensor1< double, 3 >  t_grad_n[],
FTensor::Tensor1< double *, 3 > &  t_phi,
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > &  t_diff_phi 
)

Definition at line 2080 of file Hcurl.cpp.

2084  {
2085 
2088 
2090 
2091  FTensor::Tensor1<double, 3> &t_grad_n0 = t_grad_n[n0_idx];
2092  FTensor::Tensor1<double, 3> &t_grad_n1 = t_grad_n[n1_idx];
2093  FTensor::Tensor1<double, 3> t_grad_n0_p_n1;
2094  t_grad_n0_p_n1(i) = t_grad_n0(i) + t_grad_n1(i);
2096  FTensor::Tensor2<double, 3, 2> t_diff_phi_0;
2097 
2098  FTensor::Tensor1<double, 2> t_grad_n0_j(t_grad_n0(0), t_grad_n0(1));
2099  FTensor::Tensor1<double, 2> t_grad_n1_j(t_grad_n1(0), t_grad_n1(1));
2100 
2101  VectorDouble fi(p + 1);
2102  MatrixDouble diff_fi(2, p + 1);
2103 
2104  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2105  const int shift_n = shift * gg;
2106  const double n0 = n[shift_n + n0_idx];
2107  const double n1 = n[shift_n + n1_idx];
2108 
2109  t_phi(i) = n0 * t_grad_n1(i) - n1 * t_grad_n0(i);
2110  t_diff_phi(i, j) =
2111  t_grad_n1(i) * t_grad_n0_j(j) - t_grad_n0(i) * t_grad_n1_j(j);
2112 
2113  t_phi_0(i) = t_phi(i);
2114  t_diff_phi_0(i, j) = t_diff_phi(i, j);
2115 
2116  ++t_phi;
2117  ++t_diff_phi;
2118 
2119  if (p > 1) {
2120 
2121  CHKERR Jacobi_polynomials(p, 0, n1, n0 + n1, &t_grad_n1(0),
2122  &t_grad_n0_p_n1(0), &*fi.data().begin(),
2123  &*diff_fi.data().begin(), 2);
2124 
2125  FTensor::Tensor1<double *, 2> t_diff_fi(&diff_fi(0, 1), &diff_fi(1, 1));
2126 
2127  // cerr << diff_fi << endl;
2128 
2129  FTensor::Tensor1<double, 2> t_diff_b;
2130  for (int oo = 1; oo <= p - 1; ++oo) {
2131  const double b = pow(n0 + n1, oo);
2132  t_diff_b(j) =
2133  oo * pow(n0 + n1, oo - 1) * (t_grad_n0_j(j) + t_grad_n1_j(j));
2134  t_phi(i) = b * fi[oo] * t_phi_0(i);
2135  t_diff_phi(i, j) = (b * fi[oo]) * t_diff_phi_0(i, j) +
2136  (b * t_phi_0(i) * t_diff_fi(j)) +
2137  fi[oo] * t_phi_0(i) * t_diff_b(j);
2138 
2139  ++t_diff_fi;
2140  ++t_phi;
2141  ++t_diff_phi;
2142  }
2143  }
2144  }
2145 
2147  }
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.
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:77
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
T data[Tensor_Dim]
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:76

◆ operator()() [3/3]

MoFEMErrorCode HcurlEdgeBase::operator() ( int  shift,
int  p,
int  nb_integration_pts,
int  n0_idx,
int  n1_idx,
double  n[],
FTensor::Tensor1< double, 3 >  t_grad_n[],
FTensor::Tensor1< double *, 3 > &  t_phi 
)

Definition at line 2149 of file Hcurl.cpp.

2152  {
2153 
2155 
2157 
2158  FTensor::Tensor1<double, 3> &t_grad_n0 = t_grad_n[n0_idx];
2159  FTensor::Tensor1<double, 3> &t_grad_n1 = t_grad_n[n1_idx];
2161 
2162  double fi[p + 1];
2163 
2164  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2165  const int shift_n = shift * gg;
2166  const double n0 = n[shift_n + n0_idx];
2167  const double n1 = n[shift_n + n1_idx];
2168 
2169  t_phi(i) = n0 * t_grad_n1(i) - n1 * t_grad_n0(i);
2170  t_phi_0(i) = t_phi(i);
2171 
2172  ++t_phi;
2173 
2174  if (p > 1) {
2175 
2176  CHKERR Jacobi_polynomials(p, 0, n1, n0 + n1, NULL, NULL, fi, NULL, 1);
2177 
2178  FTensor::Tensor1<double, 2> t_diff_b;
2179  for (int oo = 1; oo <= p - 1; ++oo) {
2180  const double b = pow(n0 + n1, oo);
2181  t_phi(i) = b * fi[oo] * t_phi_0(i);
2182  ++t_phi;
2183  }
2184  }
2185  }
2186 
2188  }
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.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define CHKERR
Inline error check.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

The documentation for this struct was generated from the following file: