v0.9.1
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetInvJacH1 Struct Reference

Transform local reference derivatives of shape function to global derivatives. More...

#include <src/finite_elements/DataOperators.hpp>

Inheritance diagram for MoFEM::OpSetInvJacH1:
[legend]
Collaboration diagram for MoFEM::OpSetInvJacH1:
[legend]

Public Member Functions

 OpSetInvJacH1 (MatrixDouble3by3 &inv_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)
 
virtual ~DataOperator ()=default
 
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)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=false)
 
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

FTensor::Tensor2< double *, 3, 3 > tInvJac
 
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...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 

Detailed Description

Transform local reference derivatives of shape function to global derivatives.

Definition at line 120 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetInvJacH1()

MoFEM::OpSetInvJacH1::OpSetInvJacH1 ( MatrixDouble3by3 inv_jac)

Definition at line 126 of file DataOperators.hpp.

127  : tInvJac(&inv_jac(0, 0), &inv_jac(0, 1), &inv_jac(0, 2), &inv_jac(1, 0),
128  &inv_jac(1, 1), &inv_jac(1, 2), &inv_jac(2, 0), &inv_jac(2, 1),
129  &inv_jac(2, 2)) {}
FTensor::Tensor2< double *, 3, 3 > tInvJac

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetInvJacH1::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 200 of file DataOperators.cpp.

201  {
203 
204  auto transform_base = [&](MatrixDouble &diff_n,
205  const bool diff_at_gauss_ptr) {
207 
208  if (!diff_n.size1())
210  if (!diff_n.size2())
212 
213  const int nb_base_functions =
214  (diff_at_gauss_ptr || type != MBVERTEX) ? diff_n.size2() / 3 : 4;
215  const int nb_gauss_pts =
216  (diff_at_gauss_ptr || type != MBVERTEX) ? diff_n.size1() : 1;
217  diffNinvJac.resize(diff_n.size1(), diff_n.size2(), false);
218 
219  double *t_diff_n_ptr = &*diff_n.data().begin();
221  t_diff_n_ptr, &t_diff_n_ptr[1], &t_diff_n_ptr[2]);
222  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
224  t_inv_n_ptr, &t_inv_n_ptr[1], &t_inv_n_ptr[2]);
225 
226  switch (type) {
227 
228  case MBVERTEX:
229  case MBEDGE:
230  case MBTRI:
231  case MBTET: {
232  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
233  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
234  t_inv_diff_n(i) = t_diff_n(j) * tInvJac(j, i);
235  ++t_diff_n;
236  ++t_inv_diff_n;
237  }
238  }
239 
240  } break;
241  default:
242  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
243  }
244 
245  diff_n.data().swap(diffNinvJac.data());
246 
248  };
249 
250  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
251  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
252  CHKERR transform_base(data.getDiffN(base), false);
253  }
254 
255  switch (type) {
256  case MBVERTEX:
257  for (auto &m : data.getBBDiffNMap())
258  CHKERR transform_base(*(m.second), true);
259  break;
260  default:
261  for (auto &ptr : data.getBBDiffNByOrderArray())
262  if (ptr)
263  CHKERR transform_base(*ptr, true);
264  }
265 
267 }
MatrixDouble diffNinvJac
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:75
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
FTensor::Tensor2< double *, 3, 3 > tInvJac
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514
FTensor::Index< 'i', 3 > i
FieldApproximationBase
approximation base
Definition: definitions.h:150
FTensor::Index< 'm', 2 > m
Definition: PlasticOps.hpp:67
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:152
#define CHKERR
Inline error check.
Definition: definitions.h:602
FTensor::Index< 'j', 3 > j
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetInvJacH1::diffNinvJac

Definition at line 131 of file DataOperators.hpp.

◆ i

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

Definition at line 123 of file DataOperators.hpp.

◆ j

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

Definition at line 124 of file DataOperators.hpp.

◆ tInvJac

FTensor::Tensor2<double *, 3, 3> MoFEM::OpSetInvJacH1::tInvJac

Definition at line 122 of file DataOperators.hpp.


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