v0.8.23
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 890 of file DataOperators.cpp.

891  {
893 
894  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
895 
896  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
897  if (data.getDiffN(base).size2() == 0)
898  continue;
899 
900  unsigned int nb_gauss_pts = data.getN(base).size1();
901  if (nb_gauss_pts == 0)
902  continue;
903  unsigned int nb_base_functions = data.getN(base).size2();
904  if (nb_base_functions == 0)
905  continue;
906 
907  if (invHoJac.size2() != 9) {
908  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
909  "It looks that ho inverse of Jacobian is not calculated %d != 9",
910  invHoJac.size2());
911  }
912  if (invHoJac.size1() != nb_gauss_pts) {
913  cerr << "type: " << type << " side: " << side << endl;
914  cerr << "shape fun: " << data.getN(base) << endl;
915  cerr << "diff shape fun " << data.getDiffN(base) << endl;
916  SETERRQ2(
917  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
918  "It looks that ho inverse of Jacobian is not calculated %d != %d",
919  invHoJac.size1(), nb_gauss_pts);
920  }
921  double *t_inv_jac_ptr = &*invHoJac.data().begin();
923  t_inv_jac_ptr, &t_inv_jac_ptr[1], &t_inv_jac_ptr[2], &t_inv_jac_ptr[3],
924  &t_inv_jac_ptr[4], &t_inv_jac_ptr[5], &t_inv_jac_ptr[6],
925  &t_inv_jac_ptr[7], &t_inv_jac_ptr[8], 9);
926 
927  diffNinvJac.resize(nb_gauss_pts, 3 * nb_base_functions, false);
928  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
929  FTensor::Tensor1<double *, 3> t_inv_diff_n(t_inv_n_ptr, &t_inv_n_ptr[1],
930  &t_inv_n_ptr[2], 3);
931 
932  switch (type) {
933  case MBVERTEX:
934  case MBEDGE:
935  case MBTRI:
936  case MBTET: {
937  FTensor::Tensor1<double *, 3> t_diff_n = data.getFTensor1DiffN<3>(base);
938  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
939  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
940  t_inv_diff_n(i) = t_diff_n(j) * t_inv_jac(j, i);
941  ++t_diff_n;
942  ++t_inv_diff_n;
943  }
944  ++t_inv_jac;
945  }
946  } break;
947  default:
948  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
949  }
950 
951  if (type == MBVERTEX) {
952  data.getDiffN(base).resize(diffNinvJac.size1(), diffNinvJac.size2(),
953  false);
954  }
955  data.getDiffN(base).data().swap(diffNinvJac.data());
956  }
957 
959 }
FTensor::Index< 'i', 3 > i
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
FTensor::Index< 'j', 3 > j
FieldApproximationBase
approximation base
Definition: definitions.h:143
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:145
#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: