v0.9.0
Public Member Functions | Public Attributes | List of all members
HcurlEdgeBase Struct Reference
Collaboration diagram for HcurlEdgeBase:
[legend]

Public Member Functions

template<int DIM, bool CALCULATE_DIRVATIVES>
MoFEMErrorCode calculate (int p, int nb_integration_pts, int n0_idx, int n1_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, 3 *DIM >, 3, DIM > *t_diff_phi_ptr)
 

Public Attributes

FTensor::Index< 'i', 3 > i
 
FTensor::Tensor1< double, 3 > tGradN0pN1
 
FTensor::Tensor1< double, 3 > tPhi0
 
FTensor::Tensor1< double, 3 > tDiffb
 
VectorDouble fI
 
MatrixDouble diffFi
 

Detailed Description

Definition at line 1978 of file Hcurl.cpp.

Member Function Documentation

◆ calculate()

template<int DIM, bool CALCULATE_DIRVATIVES>
MoFEMErrorCode HcurlEdgeBase::calculate ( int  p,
int  nb_integration_pts,
int  n0_idx,
int  n1_idx,
double  n[],
FTensor::Tensor1< double, 3 >  t_grad_n[],
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &  t_phi,
FTensor::Tensor2< FTensor::PackPtr< double *, 3 *DIM >, 3, DIM > *  t_diff_phi_ptr 
)

Definition at line 1991 of file Hcurl.cpp.

1995  {
1996 
1998 
2000 
2001  FTensor::Tensor1<double, 3> &t_grad_n0 = t_grad_n[n0_idx];
2002  FTensor::Tensor1<double, 3> &t_grad_n1 = t_grad_n[n1_idx];
2003  tGradN0pN1(i) = t_grad_n0(i) + t_grad_n1(i);
2004 
2005  fI.resize(p + 1);
2006  diffFi.resize(3, p + 1);
2007  diffFi.clear();
2008 
2010 
2011  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2012 
2013  const int shift_n = (DIM + 1) * gg;
2014  const double n0 = n[shift_n + n0_idx];
2015  const double n1 = n[shift_n + n1_idx];
2016 
2017  tPhi0(i) = n0 * t_grad_n1(i) - n1 * t_grad_n0(i);
2018  t_phi(i) = tPhi0(i);
2019 
2020  ++t_phi;
2021 
2022  if (CALCULATE_DIRVATIVES) {
2023 
2024  t_diff_phi0(i, j) =
2025  t_grad_n0(j) * t_grad_n1(i) - t_grad_n1(j) * t_grad_n0(i);
2026  (*t_diff_phi_ptr)(i, j) = t_diff_phi0(i, j);
2027  ++(*t_diff_phi_ptr);
2028  }
2029 
2030  if (p > 1) {
2031 
2032  if (CALCULATE_DIRVATIVES)
2033  CHKERR Jacobi_polynomials(p, 0, n1, n0 + n1, &t_grad_n1(0),
2034  &tGradN0pN1(0), &*fI.data().begin(),
2035  &*diffFi.data().begin(), DIM);
2036  else
2037  CHKERR Jacobi_polynomials(p, 0, n1, n0 + n1, nullptr, nullptr,
2038  &*fI.data().begin(), nullptr, DIM);
2039 
2041  &diffFi(0, 1), &diffFi(1, 1), &diffFi(2, 1));
2042 
2043  for (int oo = 1; oo <= p - 1; ++oo) {
2044 
2045  const double b = pow(n0 + n1, oo);
2046  t_phi(i) = b * fI[oo] * tPhi0(i);
2047 
2048  if (CALCULATE_DIRVATIVES) {
2049 
2050  tDiffb(i) =
2051  oo * pow(n0 + n1, oo - 1) * (t_grad_n0(i) + t_grad_n1(i));
2052  (*t_diff_phi_ptr)(i, j) = (b * fI[oo]) * t_diff_phi0(i, j) +
2053  (b * t_diff_fi(j)) * tPhi0(i) +
2054  tDiffb(j) * fI[oo] * tPhi0(i);
2055  ++t_diff_fi;
2056  ++(*t_diff_phi_ptr);
2057  }
2058 
2059  ++t_phi;
2060  }
2061  }
2062  }
2063 
2065  }
FTensor::Tensor1< double, 3 > tGradN0pN1
Definition: Hcurl.cpp:1982
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:477
FTensor::Tensor1< double, 3 > tPhi0
Definition: Hcurl.cpp:1983
FTensor::Index< 'i', 3 > i
Definition: Hcurl.cpp:1980
#define CHKERR
Inline error check.
Definition: definitions.h:596
MatrixDouble diffFi
Definition: Hcurl.cpp:1987
FTensor::Tensor1< double, 3 > tDiffb
Definition: Hcurl.cpp:1984
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
VectorDouble fI
Definition: Hcurl.cpp:1986

Member Data Documentation

◆ diffFi

MatrixDouble HcurlEdgeBase::diffFi

Definition at line 1987 of file Hcurl.cpp.

◆ fI

VectorDouble HcurlEdgeBase::fI

Definition at line 1986 of file Hcurl.cpp.

◆ i

FTensor::Index<'i', 3> HcurlEdgeBase::i

Definition at line 1980 of file Hcurl.cpp.

◆ tDiffb

FTensor::Tensor1<double, 3> HcurlEdgeBase::tDiffb

Definition at line 1984 of file Hcurl.cpp.

◆ tGradN0pN1

FTensor::Tensor1<double, 3> HcurlEdgeBase::tGradN0pN1

Definition at line 1982 of file Hcurl.cpp.

◆ tPhi0

FTensor::Tensor1<double, 3> HcurlEdgeBase::tPhi0

Definition at line 1983 of file Hcurl.cpp.


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