v0.8.15
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 313 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoInvJacH1()

MoFEM::OpSetHoInvJacH1::OpSetHoInvJacH1 ( MatrixDouble inv_ho_jac)

Definition at line 318 of file DataOperators.hpp.

318 : 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 924 of file DataOperators.cpp.

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

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetHoInvJacH1::diffNinvJac

Definition at line 320 of file DataOperators.hpp.

◆ i

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

Definition at line 316 of file DataOperators.hpp.

◆ invHoJac

MatrixDouble& MoFEM::OpSetHoInvJacH1::invHoJac

Definition at line 315 of file DataOperators.hpp.

◆ j

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

Definition at line 317 of file DataOperators.hpp.


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