v0.8.19
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 left 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 right 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 322 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoInvJacH1()

MoFEM::OpSetHoInvJacH1::OpSetHoInvJacH1 ( MatrixDouble inv_ho_jac)

Definition at line 327 of file DataOperators.hpp.

327 : 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 left hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 925 of file DataOperators.cpp.

926  {
928 
929  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
930 
931  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
932  if (data.getDiffN(base).size2() == 0)
933  continue;
934 
935  unsigned int nb_gauss_pts = data.getN(base).size1();
936  if (nb_gauss_pts == 0)
937  continue;
938  unsigned int nb_base_functions = data.getN(base).size2();
939  if (nb_base_functions == 0)
940  continue;
941 
942  if (invHoJac.size2() != 9) {
943  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
944  "It looks that ho inverse of Jacobian is not calculated %d != 9",
945  invHoJac.size2());
946  }
947  if (invHoJac.size1() != nb_gauss_pts) {
948  cerr << "type: " << type << " side: " << side << endl;
949  cerr << "shape fun: " << data.getN(base) << endl;
950  cerr << "diff shape fun " << data.getDiffN(base) << endl;
951  SETERRQ2(
952  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
953  "It looks that ho inverse of Jacobian is not calculated %d != %d",
954  invHoJac.size1(), nb_gauss_pts);
955  }
956  double *t_inv_jac_ptr = &*invHoJac.data().begin();
958  t_inv_jac_ptr, &t_inv_jac_ptr[1], &t_inv_jac_ptr[2], &t_inv_jac_ptr[3],
959  &t_inv_jac_ptr[4], &t_inv_jac_ptr[5], &t_inv_jac_ptr[6],
960  &t_inv_jac_ptr[7], &t_inv_jac_ptr[8], 9);
961 
962  diffNinvJac.resize(nb_gauss_pts, 3 * nb_base_functions, false);
963  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
964  FTensor::Tensor1<double *, 3> t_inv_diff_n(t_inv_n_ptr, &t_inv_n_ptr[1],
965  &t_inv_n_ptr[2], 3);
966 
967  switch (type) {
968  case MBVERTEX:
969  case MBEDGE:
970  case MBTRI:
971  case MBTET: {
972  FTensor::Tensor1<double *, 3> t_diff_n = data.getFTensor1DiffN<3>(base);
973  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
974  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
975  t_inv_diff_n(i) = t_diff_n(j) * t_inv_jac(j, i);
976  ++t_diff_n;
977  ++t_inv_diff_n;
978  }
979  ++t_inv_jac;
980  }
981  } break;
982  default:
983  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
984  }
985 
986  if (type == MBVERTEX) {
987  data.getDiffN(base).resize(diffNinvJac.size1(), diffNinvJac.size2(),
988  false);
989  }
990  data.getDiffN(base).data().swap(diffNinvJac.data());
991  }
992 
994 }
FTensor::Index< 'i', 3 > i
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
FTensor::Index< 'j', 3 > j
FieldApproximationBase
approximation base
Definition: definitions.h:141
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:143
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetHoInvJacH1::diffNinvJac

Definition at line 329 of file DataOperators.hpp.

◆ i

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

Definition at line 325 of file DataOperators.hpp.

◆ invHoJac

MatrixDouble& MoFEM::OpSetHoInvJacH1::invHoJac

Definition at line 324 of file DataOperators.hpp.

◆ j

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

Definition at line 326 of file DataOperators.hpp.


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