v0.9.0
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, const bool do_vertices=true, const bool do_edges=true, const bool do_quads=true, const bool do_tris=true, const bool do_tets=true, const bool do_prisms=true)
 
virtual ~DataOperator ()
 
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, bool symm=true)
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=true)
 
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...
 
bool doVertices
 If false skip vertices. More...
 
bool doEdges
 If false skip edges. More...
 
bool doQuads
 
bool doTris
 
bool doTets
 
bool doPrisms
 

Detailed Description

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

Definition at line 170 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoInvJacH1()

MoFEM::OpSetHoInvJacH1::OpSetHoInvJacH1 ( MatrixDouble inv_ho_jac)

Definition at line 175 of file DataOperators.hpp.

175 : 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 889 of file DataOperators.cpp.

890  {
892 
893  if (invHoJac.size2() != 9)
894  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
895  "It looks that ho inverse of Jacobian is not calculated %d != 9",
896  invHoJac.size2());
897 
898  auto transform_base = [&](MatrixDouble &diff_n) {
900 
901  unsigned int nb_gauss_pts = diff_n.size1();
902  if (nb_gauss_pts == 0)
904 
905  if (invHoJac.size1() == nb_gauss_pts) {
906 
907  unsigned int nb_base_functions = diff_n.size2() / 3;
908  if (nb_base_functions == 0)
910 
911  double *t_inv_jac_ptr = &*invHoJac.data().begin();
913  t_inv_jac_ptr, &t_inv_jac_ptr[1], &t_inv_jac_ptr[2],
914  &t_inv_jac_ptr[3], &t_inv_jac_ptr[4], &t_inv_jac_ptr[5],
915  &t_inv_jac_ptr[6], &t_inv_jac_ptr[7], &t_inv_jac_ptr[8], 9);
916 
917  diffNinvJac.resize(nb_gauss_pts, 3 * nb_base_functions, false);
918 
919  double *t_diff_n_ptr = &*diff_n.data().begin();
921  t_diff_n_ptr, &t_diff_n_ptr[1], &t_diff_n_ptr[2]);
922  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
923  FTensor::Tensor1<double *, 3> t_inv_diff_n(t_inv_n_ptr, &t_inv_n_ptr[1],
924  &t_inv_n_ptr[2], 3);
925 
926  switch (type) {
927  case MBVERTEX:
928  case MBEDGE:
929  case MBTRI:
930  case MBTET: {
931  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
932  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
933  t_inv_diff_n(i) = t_diff_n(j) * t_inv_jac(j, i);
934  ++t_diff_n;
935  ++t_inv_diff_n;
936  }
937  ++t_inv_jac;
938  }
939  } break;
940  default:
941  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
942  }
943 
944  diff_n.data().swap(diffNinvJac.data());
945  }
947  };
948 
949  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
950  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
951  CHKERR transform_base(data.getDiffN(base));
952  }
953 
954  switch (type) {
955  case MBVERTEX:
956  for (auto &m : data.getBBDiffNMap())
957  CHKERR transform_base(*(m.second));
958  break;
959  default:
960  for (auto &ptr : data.getBBDiffNByOrderArray())
961  if (ptr)
962  CHKERR transform_base(*ptr);
963  }
964 
966 }
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:501
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:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
FTensor::Index< 'j', 3 > j
FieldApproximationBase
approximation base
Definition: definitions.h:144
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:146
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetHoInvJacH1::diffNinvJac

Definition at line 177 of file DataOperators.hpp.

◆ i

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

Definition at line 173 of file DataOperators.hpp.

◆ invHoJac

MatrixDouble& MoFEM::OpSetHoInvJacH1::invHoJac

Definition at line 172 of file DataOperators.hpp.

◆ j

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

Definition at line 174 of file DataOperators.hpp.


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