v0.9.1
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetHoInvJacH1 Struct Reference

transform local reference derivatives of shape function to global derivatives if higher order geometry is given More...

#include <src/finite_elements/DataOperators.hpp>

Inheritance diagram for MoFEM::OpSetHoInvJacH1:
[legend]
Collaboration diagram for MoFEM::OpSetHoInvJacH1:
[legend]

Public Member Functions

 OpSetHoInvJacH1 (MatrixDouble &inv_ho_jac)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Public Attributes

MatrixDoubleinvHoJac
 
FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
MatrixDouble diffNinvJac
 
- Public Attributes inherited from MoFEM::DataOperator
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 

Detailed Description

transform local reference derivatives of shape function to global derivatives if higher order geometry is given

Definition at line 165 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoInvJacH1()

MoFEM::OpSetHoInvJacH1::OpSetHoInvJacH1 ( MatrixDouble inv_ho_jac)

Definition at line 170 of file DataOperators.hpp.

170 : invHoJac(inv_ho_jac) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetHoInvJacH1::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 433 of file DataOperators.cpp.

434  {
436 
437  if (invHoJac.size2() != 9)
438  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
439  "It looks that ho inverse of Jacobian is not calculated %d != 9",
440  invHoJac.size2());
441 
442  auto transform_base = [&](MatrixDouble &diff_n) {
444 
445  unsigned int nb_gauss_pts = diff_n.size1();
446  if (nb_gauss_pts == 0)
448 
449  if (invHoJac.size1() == nb_gauss_pts) {
450 
451  unsigned int nb_base_functions = diff_n.size2() / 3;
452  if (nb_base_functions == 0)
454 
455  double *t_inv_jac_ptr = &*invHoJac.data().begin();
457  t_inv_jac_ptr, &t_inv_jac_ptr[1], &t_inv_jac_ptr[2],
458  &t_inv_jac_ptr[3], &t_inv_jac_ptr[4], &t_inv_jac_ptr[5],
459  &t_inv_jac_ptr[6], &t_inv_jac_ptr[7], &t_inv_jac_ptr[8], 9);
460 
461  diffNinvJac.resize(nb_gauss_pts, 3 * nb_base_functions, false);
462 
463  double *t_diff_n_ptr = &*diff_n.data().begin();
465  t_diff_n_ptr, &t_diff_n_ptr[1], &t_diff_n_ptr[2]);
466  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
467  FTensor::Tensor1<double *, 3> t_inv_diff_n(t_inv_n_ptr, &t_inv_n_ptr[1],
468  &t_inv_n_ptr[2], 3);
469 
470  switch (type) {
471  case MBVERTEX:
472  case MBEDGE:
473  case MBTRI:
474  case MBTET: {
475  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
476  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
477  t_inv_diff_n(i) = t_diff_n(j) * t_inv_jac(j, i);
478  ++t_diff_n;
479  ++t_inv_diff_n;
480  }
481  ++t_inv_jac;
482  }
483  } break;
484  default:
485  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
486  }
487 
488  diff_n.data().swap(diffNinvJac.data());
489  }
491  };
492 
493  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
494  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
495  CHKERR transform_base(data.getDiffN(base));
496  }
497 
498  switch (type) {
499  case MBVERTEX:
500  for (auto &m : data.getBBDiffNMap())
501  CHKERR transform_base(*(m.second));
502  break;
503  default:
504  for (auto &ptr : data.getBBDiffNByOrderArray())
505  if (ptr)
506  CHKERR transform_base(*ptr);
507  }
508 
510 }
FTensor::Index< 'i', 3 > i
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
FTensor::Index< 'j', 3 > j
FieldApproximationBase
approximation base
Definition: definitions.h:149
FTensor::Index< 'm', 2 > m
Definition: PlasticOps.hpp:32
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:151
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetHoInvJacH1::diffNinvJac

Definition at line 172 of file DataOperators.hpp.

◆ i

FTensor::Index<'i', 3> MoFEM::OpSetHoInvJacH1::i

Definition at line 168 of file DataOperators.hpp.

◆ invHoJac

MatrixDouble& MoFEM::OpSetHoInvJacH1::invHoJac

Definition at line 167 of file DataOperators.hpp.

◆ j

FTensor::Index<'j', 3> MoFEM::OpSetHoInvJacH1::j

Definition at line 169 of file DataOperators.hpp.


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