v0.8.20
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, 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

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...
 
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.

Definition at line 277 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetInvJacH1()

MoFEM::OpSetInvJacH1::OpSetInvJacH1 ( MatrixDouble3by3 inv_jac)

Definition at line 283 of file DataOperators.hpp.

284  : tInvJac(&inv_jac(0, 0), &inv_jac(0, 1), &inv_jac(0, 2), &inv_jac(1, 0),
285  &inv_jac(1, 1), &inv_jac(1, 2), &inv_jac(2, 0), &inv_jac(2, 1),
286  &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 656 of file DataOperators.cpp.

657  {
659 
660  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
661 
662  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
663  const unsigned int nb_base_functions = data.getN(base).size2();
664  if (!nb_base_functions)
665  continue;
666  const unsigned int nb_gauss_pts = data.getN(base).size1();
667  if (!nb_gauss_pts)
668  continue;
669 
670  if (type != MBVERTEX) {
671  if (nb_base_functions != data.getDiffN(base).size2() / 3) {
672  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
673  "Data inconsistency nb_base_functions != data.diffN.size2()/3 "
674  "( %u != %u/3 )",
675  nb_base_functions, data.getDiffN(base).size2());
676  }
677  } else {
678  if (data.getDiffN(base).size1() != 4 ||
679  data.getDiffN(base).size2() != 3) {
680  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
681  "Data inconsistency");
682  }
683  }
684 
685  diffNinvJac.resize(data.getDiffN(base).size1(), data.getDiffN(base).size2(),
686  false);
687 
688  double *t_diff_n_ptr = &*data.getDiffN(base).data().begin();
690  t_diff_n_ptr, &t_diff_n_ptr[1], &t_diff_n_ptr[2]);
691  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
693  t_inv_n_ptr, &t_inv_n_ptr[1], &t_inv_n_ptr[2]);
694 
695  switch (type) {
696 
697  case MBVERTEX: {
698  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
699  t_inv_diff_n(i) = t_diff_n(j) * tInvJac(j, i);
700  ++t_diff_n;
701  ++t_inv_diff_n;
702  }
703  } break;
704  case MBEDGE:
705  case MBTRI:
706  case MBTET: {
707  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
708  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
709  t_inv_diff_n(i) = t_diff_n(j) * tInvJac(j, i);
710  ++t_diff_n;
711  ++t_inv_diff_n;
712  }
713  }
714 
715  } break;
716  default:
717  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
718  }
719 
720  data.getDiffN(base).data().swap(diffNinvJac.data());
721  }
722 
724 }
MatrixDouble diffNinvJac
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
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:506
FTensor::Index< 'i', 3 > i
FieldApproximationBase
approximation base
Definition: definitions.h:141
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:143
FTensor::Index< 'j', 3 > j

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetInvJacH1::diffNinvJac

Definition at line 288 of file DataOperators.hpp.

◆ i

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

Definition at line 280 of file DataOperators.hpp.

◆ j

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

Definition at line 281 of file DataOperators.hpp.

◆ tInvJac

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

Definition at line 279 of file DataOperators.hpp.


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