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

Public Member Functions

template<int DIM>
MoFEMErrorCode calculateOneFamily (int p, int nb_integration_pts, int n0f0_idx, int n1f0_idx, int n2f0_idx, double n[], FTensor::Tensor1< double, 3 > t_grad_n[], FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_phi, FTensor::Tensor2< FTensor::PackPtr< double *, DIM *3 >, 3, DIM > &t_diff_phi)
 
template<int DIM>
MoFEMErrorCode calculateTwoFamily (int p, int nb_integration_pts, int n0f0_idx, int n1f0_idx, int n2f0_idx, int n0f1_idx, int n1f1_idx, int n2f1_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)
 

Public Attributes

HcurlEdgeBase hCurlBaseOnEdge
 
VectorDouble f0PhiII
 
VectorDouble diffF0PhiII
 
VectorDouble f1PhiII
 
VectorDouble diffF1PhiII
 
VectorDouble iFiF0
 
VectorDouble diffIFiF0
 
VectorDouble iFiF1
 
VectorDouble diffIFiF1
 
FTensor::Index< 'i', 3 > i
 

Detailed Description

Definition at line 2173 of file Hcurl.cpp.

Member Function Documentation

◆ calculateOneFamily()

template<int DIM>
MoFEMErrorCode HcurlFaceBase::calculateOneFamily ( int  p,
int  nb_integration_pts,
int  n0f0_idx,
int  n1f0_idx,
int  n2f0_idx,
double  n[],
FTensor::Tensor1< double, 3 >  t_grad_n[],
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &  t_phi,
FTensor::Tensor2< FTensor::PackPtr< double *, DIM *3 >, 3, DIM > &  t_diff_phi 
)

Definition at line 2183 of file Hcurl.cpp.

2188  {
2189 
2191 
2193  f0PhiII.resize(3 * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts, false);
2194  diffF0PhiII.resize(3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts,
2195  false);
2196 
2197  // edge base for family I
2198  double *f0_phi_ii = &*f0PhiII.data().begin();
2199  double *diff_f0_phi_ii = &*diffF0PhiII.data().begin();
2200  auto t_f0_phi_ii = getFTensor1FromPtr<3>(f0_phi_ii);
2201  auto t_diff_f0_phi_ii = getFTensor2FromPtr<3, DIM>(diff_f0_phi_ii);
2202 
2203  CHKERR hCurlBaseOnEdge.calculate<DIM, true>(p - 1, nb_integration_pts,
2204  n0f0_idx, n1f0_idx, n, t_grad_n,
2205  t_f0_phi_ii, &t_diff_f0_phi_ii);
2206 
2207  FTensor::Tensor1<double, 3> &t_grad_n0f0 = t_grad_n[n0f0_idx];
2208  FTensor::Tensor1<double, 3> &t_grad_n1f0 = t_grad_n[n1f0_idx];
2209  FTensor::Tensor1<double, 3> &t_grad_n2f0 = t_grad_n[n2f0_idx];
2210  FTensor::Tensor1<double, 3> t_grad_n0f0_p_n1f0;
2211  t_grad_n0f0_p_n1f0(i) = t_grad_n0f0(i) + t_grad_n1f0(i) + t_grad_n2f0(i);
2212 
2213  iFiF0.resize(p + 1, false);
2214  diffIFiF0.resize(3 * p + 3, false);
2215  diffIFiF0.clear();
2216 
2217  double *ifif0 = &*iFiF0.data().begin();
2218  double *diff_ifif0 = &*diffIFiF0.data().begin();
2219 
2220  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2221 
2222  const int shift_n = (DIM + 1) * gg;
2223  const double n0f0 = n[shift_n + n0f0_idx];
2224  const double n1f0 = n[shift_n + n1f0_idx];
2225  const double n2f0 = n[shift_n + n2f0_idx];
2226 
2227  int phi_shift = 3 * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2228  int diff_phi_shift = (3 * DIM) * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2229 
2230  for (int oo = 2; oo <= p; ++oo) {
2231 
2232  auto t_f0_phi_ii = getFTensor1FromPtr<3>(&f0_phi_ii[phi_shift]);
2233  auto t_diff_f0_phi_ii =
2234  getFTensor2FromPtr<3, DIM>(&diff_f0_phi_ii[diff_phi_shift]);
2235 
2236  for (int ii = 0; ii <= oo - 2; ii++) {
2237 
2238  int jj = oo - 2 - ii;
2239 
2240  // family I
2242  jj + 1, 2 * ii + 1, n2f0, n0f0 + n1f0 + n2f0, &t_grad_n2f0(0),
2243  &t_grad_n0f0_p_n1f0(0), ifif0, diff_ifif0, DIM);
2244  FTensor::Tensor1<double, 3> t_diff_ifif0(
2245  diff_ifif0[0 + jj], diff_ifif0[(jj + 1) + jj],
2246  diff_ifif0[2 * (jj + 1) + jj]);
2247  t_phi(i) = ifif0[jj] * t_f0_phi_ii(i);
2248  t_diff_phi(i, j) = ifif0[jj] * t_diff_f0_phi_ii(i, j) +
2249  t_diff_ifif0(j) * t_f0_phi_ii(i);
2250  ++t_phi;
2251  ++t_diff_phi;
2252  ++t_f0_phi_ii;
2253  ++t_diff_f0_phi_ii;
2254  }
2255  }
2256  }
2257 
2259  }
VectorDouble diffF0PhiII
Definition: Hcurl.cpp:2175
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
HcurlEdgeBase hCurlBaseOnEdge
Definition: Hcurl.cpp:2174
VectorDouble diffIFiF0
Definition: Hcurl.cpp:2177
FTensor::Index< 'i', 3 > i
Definition: Hcurl.cpp:2180
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)
Definition: Hcurl.cpp:1991
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1FromPtr< 3 >(double *ptr)
Definition: Templates.hpp:336
VectorDouble f0PhiII
Definition: Hcurl.cpp:2175
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define NBEDGE_DEMKOWICZ_HCURL(P)
VectorDouble iFiF0
Definition: Hcurl.cpp:2177
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
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.

◆ calculateTwoFamily()

template<int DIM>
MoFEMErrorCode HcurlFaceBase::calculateTwoFamily ( int  p,
int  nb_integration_pts,
int  n0f0_idx,
int  n1f0_idx,
int  n2f0_idx,
int  n0f1_idx,
int  n1f1_idx,
int  n2f1_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 
)

Definition at line 2263 of file Hcurl.cpp.

2268  {
2269 
2271 
2273 
2274  f0PhiII.resize(3 * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts, false);
2275  diffF0PhiII.resize(3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts,
2276  false);
2277  f1PhiII.resize(3 * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts, false);
2278  diffF1PhiII.resize(3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts,
2279  false);
2280 
2281  // edge base for family I
2282  double *f0_phi_ii = &*f0PhiII.data().begin();
2283  double *diff_f0_phi_ii = &*diffF0PhiII.data().begin();
2284  auto t_f0_phi_ii = getFTensor1FromPtr<3>(f0_phi_ii);
2285  auto t_diff_f0_phi_ii = getFTensor2FromPtr<3, DIM>(diff_f0_phi_ii);
2286  CHKERR hCurlBaseOnEdge.calculate<DIM, true>(p - 1, nb_integration_pts,
2287  n0f0_idx, n1f0_idx, n, t_grad_n,
2288  t_f0_phi_ii, &t_diff_f0_phi_ii);
2289 
2290  // edge base for family II
2291  double *f1_phi_ii = &*f1PhiII.data().begin();
2292  double *diff_f1_phi_ii = &*diffF1PhiII.data().begin();
2293  auto t_f1_phi_ii = getFTensor1FromPtr<3>(f1_phi_ii);
2294  auto t_diff_f1_phi_ii = getFTensor2FromPtr<3, DIM>(diff_f1_phi_ii);
2295  CHKERR hCurlBaseOnEdge.calculate<DIM, true>(p - 1, nb_integration_pts,
2296  n0f1_idx, n1f1_idx, n, t_grad_n,
2297  t_f1_phi_ii, &t_diff_f1_phi_ii);
2298 
2299  FTensor::Tensor1<double, 3> &t_grad_n0f0 = t_grad_n[n0f0_idx];
2300  FTensor::Tensor1<double, 3> &t_grad_n1f0 = t_grad_n[n1f0_idx];
2301  FTensor::Tensor1<double, 3> &t_grad_n2f0 = t_grad_n[n2f0_idx];
2302  FTensor::Tensor1<double, 3> t_grad_n0f0_p_n1f0;
2303  t_grad_n0f0_p_n1f0(i) = t_grad_n0f0(i) + t_grad_n1f0(i);
2304 
2305  FTensor::Tensor1<double, 3> &t_grad_n0f1 = t_grad_n[n0f1_idx];
2306  FTensor::Tensor1<double, 3> &t_grad_n1f1 = t_grad_n[n1f1_idx];
2307  FTensor::Tensor1<double, 3> &t_grad_n2f1 = t_grad_n[n2f1_idx];
2308  FTensor::Tensor1<double, 3> t_grad_n0f1_p_n1f1;
2309  t_grad_n0f1_p_n1f1(i) = t_grad_n0f1(i) + t_grad_n1f1(i);
2310 
2311  iFiF0.resize(p + 1, false);
2312  diffIFiF0.resize(3 * p + 3, false);
2313  diffIFiF0.clear();
2314  double *ifif0 = &*iFiF0.data().begin();
2315  double *diff_ifif0 = &*diffIFiF0.data().begin();
2316  iFiF1.resize(p + 1, false);
2317  diffIFiF1.resize(3 * p + 3, false);
2318  diffIFiF1.clear();
2319  double *ifif1 = &*iFiF1.data().begin();
2320  double *diff_ifif1 = &*diffIFiF1.data().begin();
2321 
2322  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2323 
2324  const int shift_n = (DIM + 1) * gg;
2325  const double n0f0 = n[shift_n + n0f0_idx];
2326  const double n1f0 = n[shift_n + n1f0_idx];
2327  const double n2f0 = n[shift_n + n2f0_idx];
2328  const double n0f1 = n[shift_n + n0f1_idx];
2329  const double n1f1 = n[shift_n + n1f1_idx];
2330  const double n2f1 = n[shift_n + n2f1_idx];
2331 
2332  int phi_shift = 3 * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2333  int diff_phi_shift = 3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2334 
2335  int kk = 0;
2336  for (int oo = 2; oo <= p; ++oo) {
2337 
2338  auto t_f0_phi_ii = getFTensor1FromPtr<3>(&f0_phi_ii[phi_shift]);
2339  auto t_diff_f0_phi_ii =
2340  getFTensor2FromPtr<3, DIM>(&diff_f0_phi_ii[diff_phi_shift]);
2341  auto t_f1_phi_ii = getFTensor1FromPtr<3>(&f1_phi_ii[phi_shift]);
2342  auto t_diff_f1_phi_ii =
2343  getFTensor2FromPtr<3, DIM>(&diff_f1_phi_ii[diff_phi_shift]);
2344 
2345  for (int ii = 0; ii <= oo - 2; ii++) {
2346 
2347  int jj = oo - 2 - ii;
2348 
2349  // family I
2351  jj + 1, 2 * ii + 1, n2f0, n0f0 + n1f0, &t_grad_n2f0(0),
2352  &t_grad_n0f0_p_n1f0(0), ifif0, diff_ifif0, 3);
2353  FTensor::Tensor1<double, 3> t_diff_ifif0(
2354  diff_ifif0[0 + jj], diff_ifif0[(jj + 1) + jj],
2355  diff_ifif0[2 * (jj + 1) + jj]);
2356 
2357  t_phi(i) = ifif0[jj] * t_f0_phi_ii(i);
2358  t_diff_phi(i, j) = ifif0[jj] * t_diff_f0_phi_ii(i, j) +
2359  t_diff_ifif0(j) * t_f0_phi_ii(i);
2360 
2361  ++t_phi;
2362  ++t_diff_phi;
2363  ++t_f0_phi_ii;
2364  ++t_diff_f0_phi_ii;
2365  ++kk;
2366 
2367  // family II
2369  jj + 1, 2 * ii + 1, n2f1, n0f1 + n1f1, &t_grad_n2f1(0),
2370  &t_grad_n0f1_p_n1f1(0), ifif1, diff_ifif1, 3);
2371  FTensor::Tensor1<double, 3> t_diff_ifif1(
2372  diff_ifif1[0 + jj], diff_ifif1[(jj + 1) + jj],
2373  diff_ifif1[2 * (jj + 1) + jj]);
2374  t_phi(i) = ifif1[jj] * t_f1_phi_ii(i);
2375  t_diff_phi(i, j) = ifif1[jj] * t_diff_f1_phi_ii(i, j) +
2376  t_diff_ifif1(j) * t_f1_phi_ii(i);
2377  ++t_phi;
2378  ++t_diff_phi;
2379  ++t_f1_phi_ii;
2380  ++t_diff_f1_phi_ii;
2381  ++kk;
2382  }
2383  }
2384  if (kk != NBFACETRI_DEMKOWICZ_HCURL(p))
2385  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2386  "Wrong number of base functions");
2387  }
2389  }
VectorDouble diffF0PhiII
Definition: Hcurl.cpp:2175
VectorDouble f1PhiII
Definition: Hcurl.cpp:2176
VectorDouble diffF1PhiII
Definition: Hcurl.cpp:2176
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
HcurlEdgeBase hCurlBaseOnEdge
Definition: Hcurl.cpp:2174
VectorDouble diffIFiF0
Definition: Hcurl.cpp:2177
FTensor::Index< 'i', 3 > i
Definition: Hcurl.cpp:2180
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)
Definition: Hcurl.cpp:1991
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1FromPtr< 3 >(double *ptr)
Definition: Templates.hpp:336
VectorDouble f0PhiII
Definition: Hcurl.cpp:2175
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define NBFACETRI_DEMKOWICZ_HCURL(P)
#define NBEDGE_DEMKOWICZ_HCURL(P)
VectorDouble iFiF1
Definition: Hcurl.cpp:2178
VectorDouble iFiF0
Definition: Hcurl.cpp:2177
VectorDouble diffIFiF1
Definition: Hcurl.cpp:2178
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
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.

Member Data Documentation

◆ diffF0PhiII

VectorDouble HcurlFaceBase::diffF0PhiII

Definition at line 2175 of file Hcurl.cpp.

◆ diffF1PhiII

VectorDouble HcurlFaceBase::diffF1PhiII

Definition at line 2176 of file Hcurl.cpp.

◆ diffIFiF0

VectorDouble HcurlFaceBase::diffIFiF0

Definition at line 2177 of file Hcurl.cpp.

◆ diffIFiF1

VectorDouble HcurlFaceBase::diffIFiF1

Definition at line 2178 of file Hcurl.cpp.

◆ f0PhiII

VectorDouble HcurlFaceBase::f0PhiII

Definition at line 2175 of file Hcurl.cpp.

◆ f1PhiII

VectorDouble HcurlFaceBase::f1PhiII

Definition at line 2176 of file Hcurl.cpp.

◆ hCurlBaseOnEdge

HcurlEdgeBase HcurlFaceBase::hCurlBaseOnEdge

Definition at line 2174 of file Hcurl.cpp.

◆ i

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

Definition at line 2180 of file Hcurl.cpp.

◆ iFiF0

VectorDouble HcurlFaceBase::iFiF0

Definition at line 2177 of file Hcurl.cpp.

◆ iFiF1

VectorDouble HcurlFaceBase::iFiF1

Definition at line 2178 of file Hcurl.cpp.


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