v0.14.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 2176 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 
)
inline

Definition at line 2186 of file Hcurl.cpp.

2191  {
2192 
2194 
2196  f0PhiII.resize(3 * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts, false);
2197  diffF0PhiII.resize(3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts,
2198  false);
2199 
2200  // edge base for family I
2201  double *f0_phi_ii = &*f0PhiII.data().begin();
2202  double *diff_f0_phi_ii = &*diffF0PhiII.data().begin();
2203  auto t_f0_phi_ii = getFTensor1FromPtr<3>(f0_phi_ii);
2204  auto t_diff_f0_phi_ii = getFTensor2FromPtr<3, DIM>(diff_f0_phi_ii);
2205 
2206  CHKERR hCurlBaseOnEdge.calculate<DIM, true>(p - 1, nb_integration_pts,
2207  n0f0_idx, n1f0_idx, n, t_grad_n,
2208  t_f0_phi_ii, &t_diff_f0_phi_ii);
2209 
2210  FTensor::Tensor1<double, 3> &t_grad_n0f0 = t_grad_n[n0f0_idx];
2211  FTensor::Tensor1<double, 3> &t_grad_n1f0 = t_grad_n[n1f0_idx];
2212  FTensor::Tensor1<double, 3> &t_grad_n2f0 = t_grad_n[n2f0_idx];
2213  FTensor::Tensor1<double, 3> t_grad_n0f0_p_n1f0;
2214  t_grad_n0f0_p_n1f0(i) = t_grad_n0f0(i) + t_grad_n1f0(i) + t_grad_n2f0(i);
2215 
2216  iFiF0.resize(p + 1, false);
2217  diffIFiF0.resize(3 * p + 3, false);
2218  diffIFiF0.clear();
2219 
2220  double *ifif0 = &*iFiF0.data().begin();
2221  double *diff_ifif0 = &*diffIFiF0.data().begin();
2222 
2223  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2224 
2225  const int shift_n = (DIM + 1) * gg;
2226  const double n0f0 = n[shift_n + n0f0_idx];
2227  const double n1f0 = n[shift_n + n1f0_idx];
2228  const double n2f0 = n[shift_n + n2f0_idx];
2229 
2230  int phi_shift = 3 * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2231  int diff_phi_shift = (3 * DIM) * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2232 
2233  for (int oo = 2; oo <= p; ++oo) {
2234 
2235  auto t_f0_phi_ii = getFTensor1FromPtr<3>(&f0_phi_ii[phi_shift]);
2236  auto t_diff_f0_phi_ii =
2237  getFTensor2FromPtr<3, DIM>(&diff_f0_phi_ii[diff_phi_shift]);
2238 
2239  for (int ii = 0; ii <= oo - 2; ii++) {
2240 
2241  int jj = oo - 2 - ii;
2242 
2243  // family I
2245  jj + 1, 2 * ii + 1, n2f0, n0f0 + n1f0 + n2f0, &t_grad_n2f0(0),
2246  &t_grad_n0f0_p_n1f0(0), ifif0, diff_ifif0, DIM);
2247  FTensor::Tensor1<double, 3> t_diff_ifif0(
2248  diff_ifif0[0 + jj], diff_ifif0[(jj + 1) + jj],
2249  diff_ifif0[2 * (jj + 1) + jj]);
2250  t_phi(i) = ifif0[jj] * t_f0_phi_ii(i);
2251  t_diff_phi(i, j) = ifif0[jj] * t_diff_f0_phi_ii(i, j) +
2252  t_diff_ifif0(j) * t_f0_phi_ii(i);
2253  ++t_phi;
2254  ++t_diff_phi;
2255  ++t_f0_phi_ii;
2256  ++t_diff_f0_phi_ii;
2257  }
2258  }
2259  }
2260 
2262  }

◆ 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 
)
inline

Definition at line 2266 of file Hcurl.cpp.

2271  {
2272 
2274 
2276 
2277  f0PhiII.resize(3 * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts, false);
2278  diffF0PhiII.resize(3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts,
2279  false);
2280  f1PhiII.resize(3 * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts, false);
2281  diffF1PhiII.resize(3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p) * nb_integration_pts,
2282  false);
2283 
2284  // edge base for family I
2285  double *f0_phi_ii = &*f0PhiII.data().begin();
2286  double *diff_f0_phi_ii = &*diffF0PhiII.data().begin();
2287  auto t_f0_phi_ii = getFTensor1FromPtr<3>(f0_phi_ii);
2288  auto t_diff_f0_phi_ii = getFTensor2FromPtr<3, DIM>(diff_f0_phi_ii);
2289  CHKERR hCurlBaseOnEdge.calculate<DIM, true>(p - 1, nb_integration_pts,
2290  n0f0_idx, n1f0_idx, n, t_grad_n,
2291  t_f0_phi_ii, &t_diff_f0_phi_ii);
2292 
2293  // edge base for family II
2294  double *f1_phi_ii = &*f1PhiII.data().begin();
2295  double *diff_f1_phi_ii = &*diffF1PhiII.data().begin();
2296  auto t_f1_phi_ii = getFTensor1FromPtr<3>(f1_phi_ii);
2297  auto t_diff_f1_phi_ii = getFTensor2FromPtr<3, DIM>(diff_f1_phi_ii);
2298  CHKERR hCurlBaseOnEdge.calculate<DIM, true>(p - 1, nb_integration_pts,
2299  n0f1_idx, n1f1_idx, n, t_grad_n,
2300  t_f1_phi_ii, &t_diff_f1_phi_ii);
2301 
2302  FTensor::Tensor1<double, 3> &t_grad_n0f0 = t_grad_n[n0f0_idx];
2303  FTensor::Tensor1<double, 3> &t_grad_n1f0 = t_grad_n[n1f0_idx];
2304  FTensor::Tensor1<double, 3> &t_grad_n2f0 = t_grad_n[n2f0_idx];
2305  FTensor::Tensor1<double, 3> t_grad_n0f0_p_n1f0;
2306  t_grad_n0f0_p_n1f0(i) = t_grad_n0f0(i) + t_grad_n1f0(i);
2307 
2308  FTensor::Tensor1<double, 3> &t_grad_n0f1 = t_grad_n[n0f1_idx];
2309  FTensor::Tensor1<double, 3> &t_grad_n1f1 = t_grad_n[n1f1_idx];
2310  FTensor::Tensor1<double, 3> &t_grad_n2f1 = t_grad_n[n2f1_idx];
2311  FTensor::Tensor1<double, 3> t_grad_n0f1_p_n1f1;
2312  t_grad_n0f1_p_n1f1(i) = t_grad_n0f1(i) + t_grad_n1f1(i);
2313 
2314  iFiF0.resize(p + 1, false);
2315  diffIFiF0.resize(3 * p + 3, false);
2316  diffIFiF0.clear();
2317  double *ifif0 = &*iFiF0.data().begin();
2318  double *diff_ifif0 = &*diffIFiF0.data().begin();
2319  iFiF1.resize(p + 1, false);
2320  diffIFiF1.resize(3 * p + 3, false);
2321  diffIFiF1.clear();
2322  double *ifif1 = &*iFiF1.data().begin();
2323  double *diff_ifif1 = &*diffIFiF1.data().begin();
2324 
2325  for (int gg = 0; gg != nb_integration_pts; ++gg) {
2326 
2327  const int shift_n = (DIM + 1) * gg;
2328  const double n0f0 = n[shift_n + n0f0_idx];
2329  const double n1f0 = n[shift_n + n1f0_idx];
2330  const double n2f0 = n[shift_n + n2f0_idx];
2331  const double n0f1 = n[shift_n + n0f1_idx];
2332  const double n1f1 = n[shift_n + n1f1_idx];
2333  const double n2f1 = n[shift_n + n2f1_idx];
2334 
2335  int phi_shift = 3 * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2336  int diff_phi_shift = 3 * DIM * NBEDGE_DEMKOWICZ_HCURL(p - 1) * gg;
2337 
2338  int kk = 0;
2339  for (int oo = 2; oo <= p; ++oo) {
2340 
2341  auto t_f0_phi_ii = getFTensor1FromPtr<3>(&f0_phi_ii[phi_shift]);
2342  auto t_diff_f0_phi_ii =
2343  getFTensor2FromPtr<3, DIM>(&diff_f0_phi_ii[diff_phi_shift]);
2344  auto t_f1_phi_ii = getFTensor1FromPtr<3>(&f1_phi_ii[phi_shift]);
2345  auto t_diff_f1_phi_ii =
2346  getFTensor2FromPtr<3, DIM>(&diff_f1_phi_ii[diff_phi_shift]);
2347 
2348  for (int ii = 0; ii <= oo - 2; ii++) {
2349 
2350  int jj = oo - 2 - ii;
2351 
2352  // family I
2354  jj + 1, 2 * ii + 1, n2f0, n0f0 + n1f0, &t_grad_n2f0(0),
2355  &t_grad_n0f0_p_n1f0(0), ifif0, diff_ifif0, 3);
2356  FTensor::Tensor1<double, 3> t_diff_ifif0(
2357  diff_ifif0[0 + jj], diff_ifif0[(jj + 1) + jj],
2358  diff_ifif0[2 * (jj + 1) + jj]);
2359 
2360  t_phi(i) = ifif0[jj] * t_f0_phi_ii(i);
2361  t_diff_phi(i, j) = ifif0[jj] * t_diff_f0_phi_ii(i, j) +
2362  t_diff_ifif0(j) * t_f0_phi_ii(i);
2363 
2364  ++t_phi;
2365  ++t_diff_phi;
2366  ++t_f0_phi_ii;
2367  ++t_diff_f0_phi_ii;
2368  ++kk;
2369 
2370  // family II
2372  jj + 1, 2 * ii + 1, n2f1, n0f1 + n1f1, &t_grad_n2f1(0),
2373  &t_grad_n0f1_p_n1f1(0), ifif1, diff_ifif1, 3);
2374  FTensor::Tensor1<double, 3> t_diff_ifif1(
2375  diff_ifif1[0 + jj], diff_ifif1[(jj + 1) + jj],
2376  diff_ifif1[2 * (jj + 1) + jj]);
2377  t_phi(i) = ifif1[jj] * t_f1_phi_ii(i);
2378  t_diff_phi(i, j) = ifif1[jj] * t_diff_f1_phi_ii(i, j) +
2379  t_diff_ifif1(j) * t_f1_phi_ii(i);
2380  ++t_phi;
2381  ++t_diff_phi;
2382  ++t_f1_phi_ii;
2383  ++t_diff_f1_phi_ii;
2384  ++kk;
2385  }
2386  }
2387  if (kk != NBFACETRI_DEMKOWICZ_HCURL(p))
2388  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2389  "Wrong number of base functions");
2390  }
2392  }

Member Data Documentation

◆ diffF0PhiII

VectorDouble HcurlFaceBase::diffF0PhiII

Definition at line 2178 of file Hcurl.cpp.

◆ diffF1PhiII

VectorDouble HcurlFaceBase::diffF1PhiII

Definition at line 2179 of file Hcurl.cpp.

◆ diffIFiF0

VectorDouble HcurlFaceBase::diffIFiF0

Definition at line 2180 of file Hcurl.cpp.

◆ diffIFiF1

VectorDouble HcurlFaceBase::diffIFiF1

Definition at line 2181 of file Hcurl.cpp.

◆ f0PhiII

VectorDouble HcurlFaceBase::f0PhiII

Definition at line 2178 of file Hcurl.cpp.

◆ f1PhiII

VectorDouble HcurlFaceBase::f1PhiII

Definition at line 2179 of file Hcurl.cpp.

◆ hCurlBaseOnEdge

HcurlEdgeBase HcurlFaceBase::hCurlBaseOnEdge

Definition at line 2177 of file Hcurl.cpp.

◆ i

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

Definition at line 2183 of file Hcurl.cpp.

◆ iFiF0

VectorDouble HcurlFaceBase::iFiF0

Definition at line 2180 of file Hcurl.cpp.

◆ iFiF1

VectorDouble HcurlFaceBase::iFiF1

Definition at line 2181 of file Hcurl.cpp.


The documentation for this struct was generated from the following file:
FTensor::Tensor1< double, 3 >
HcurlFaceBase::i
FTensor::Index< 'i', 3 > i
Definition: Hcurl.cpp:2183
IntegratedJacobi_polynomials
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.
Definition: base_functions.c:134
HcurlFaceBase::f0PhiII
VectorDouble f0PhiII
Definition: Hcurl.cpp:2178
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
HcurlFaceBase::diffIFiF1
VectorDouble diffIFiF1
Definition: Hcurl.cpp:2181
HcurlEdgeBase::calculate
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
HcurlFaceBase::diffIFiF0
VectorDouble diffIFiF0
Definition: Hcurl.cpp:2180
HcurlFaceBase::hCurlBaseOnEdge
HcurlEdgeBase hCurlBaseOnEdge
Definition: Hcurl.cpp:2177
NBEDGE_DEMKOWICZ_HCURL
#define NBEDGE_DEMKOWICZ_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:108
HcurlFaceBase::iFiF0
VectorDouble iFiF0
Definition: Hcurl.cpp:2180
FTensor::Index< 'j', DIM >
NBFACETRI_DEMKOWICZ_HCURL
#define NBFACETRI_DEMKOWICZ_HCURL(P)
Definition: h1_hdiv_hcurl_l2.h:109
convert.n
n
Definition: convert.py:82
HcurlFaceBase::iFiF1
VectorDouble iFiF1
Definition: Hcurl.cpp:2181
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
HcurlFaceBase::f1PhiII
VectorDouble f1PhiII
Definition: Hcurl.cpp:2179
HcurlFaceBase::diffF0PhiII
VectorDouble diffF0PhiII
Definition: Hcurl.cpp:2178
HcurlFaceBase::diffF1PhiII
VectorDouble diffF1PhiII
Definition: Hcurl.cpp:2179
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359