v0.8.4
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 922 of file DataOperators.cpp.

923  {
925 
926  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
927 
928  FieldApproximationBase base = ApproximationBaseArray[b];
929  if (data.getDiffN(base).size2() == 0)
930  continue;
931 
932  unsigned int nb_gauss_pts = data.getN(base).size1();
933  if (nb_gauss_pts == 0)
934  continue;
935  unsigned int nb_base_functions = data.getN(base).size2();
936  if (nb_base_functions == 0)
937  continue;
938 
939  if (invHoJac.size2() != 9) {
940  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
941  "It looks that ho inverse of Jacobian is not calculated %d != 9",
942  invHoJac.size2());
943  }
944  if (invHoJac.size1() != nb_gauss_pts) {
945  cerr << "type: " << type << " side: " << side << endl;
946  cerr << "shape fun: " << data.getN(base) << endl;
947  cerr << "diff shape fun " << data.getDiffN(base) << endl;
948  SETERRQ2(
949  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
950  "It looks that ho inverse of Jacobian is not calculated %d != %d",
951  invHoJac.size1(), nb_gauss_pts);
952  }
953  double *t_inv_jac_ptr = &*invHoJac.data().begin();
955  t_inv_jac_ptr, &t_inv_jac_ptr[1], &t_inv_jac_ptr[2], &t_inv_jac_ptr[3],
956  &t_inv_jac_ptr[4], &t_inv_jac_ptr[5], &t_inv_jac_ptr[6],
957  &t_inv_jac_ptr[7], &t_inv_jac_ptr[8], 9);
958 
959  diffNinvJac.resize(nb_gauss_pts, 3 * nb_base_functions, false);
960  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
961  FTensor::Tensor1<double *, 3> t_inv_diff_n(t_inv_n_ptr, &t_inv_n_ptr[1],
962  &t_inv_n_ptr[2], 3);
963 
964  switch (type) {
965  case MBVERTEX:
966  case MBEDGE:
967  case MBTRI:
968  case MBTET: {
969  FTensor::Tensor1<double *, 3> t_diff_n = data.getFTensor1DiffN<3>(base);
970  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
971  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
972  t_inv_diff_n(i) = t_diff_n(j) * t_inv_jac(j, i);
973  ++t_diff_n;
974  ++t_inv_diff_n;
975  }
976  ++t_inv_jac;
977  }
978  } break;
979  default:
980  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
981  }
982 
983  // unsigned int gg = 0;
984  // for(;gg<nb_gauss_pts;++gg) {
985  // double *inv_h = &invHoJac(gg,0);
986  // for(unsigned dd = 0;dd<nb_base_functions;dd++) {
987  // double *diff_n;
988  // if(type == MBVERTEX) {
989  // diff_n = &data.getDiffN(base)(dd,0);
990  // } else {
991  // diff_n = &data.getDiffN(base)(gg,3*dd);
992  // }
993  // double *diff_n_inv_jac = &diffNinvJac(gg,3*dd);
994  // cblas_dgemv(CblasRowMajor,CblasTrans,3,3,1.,inv_h,3,diff_n,1,0.,diff_n_inv_jac,1);
995  // }
996  // }
997  if (type == MBVERTEX) {
998  data.getDiffN(base).resize(diffNinvJac.size1(), diffNinvJac.size2(),
999  false);
1000  }
1001  data.getDiffN(base).data().swap(diffNinvJac.data());
1002  }
1003 
1005 }
user implemented approximation base
Definition: definitions.h:146
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
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:443

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: