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

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 261 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetInvJacH1()

MoFEM::OpSetInvJacH1::OpSetInvJacH1 ( MatrixDouble3by3 inv_jac)

Definition at line 267 of file DataOperators.hpp.

267  :
268  tInvJac(
269  &inv_jac(0,0),&inv_jac(0,1),&inv_jac(0,2),
270  &inv_jac(1,0),&inv_jac(1,1),&inv_jac(1,2),
271  &inv_jac(2,0),&inv_jac(2,1),&inv_jac(2,2)
272  ) {
273  }
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 left hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 691 of file DataOperators.cpp.

692  {
694 
695  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
696 
697  FieldApproximationBase base = ApproximationBaseArray[b];
698  const unsigned int nb_base_functions = data.getN(base).size2();
699  if (!nb_base_functions)
700  continue;
701  const unsigned int nb_gauss_pts = data.getN(base).size1();
702  if (!nb_gauss_pts)
703  continue;
704 
705  if (type != MBVERTEX) {
706  if (nb_base_functions != data.getDiffN(base).size2() / 3) {
707  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
708  "Data inconsistency nb_base_functions != data.diffN.size2()/3 "
709  "( %u != %u/3 )",
710  nb_base_functions, data.getDiffN(base).size2());
711  }
712  } else {
713  if (data.getDiffN(base).size1() != 4 ||
714  data.getDiffN(base).size2() != 3) {
715  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
716  "Data inconsistency");
717  }
718  }
719 
720  diffNinvJac.resize(data.getDiffN(base).size1(), data.getDiffN(base).size2(),
721  false);
722 
723  double *t_diff_n_ptr = &*data.getDiffN(base).data().begin();
725  t_diff_n_ptr, &t_diff_n_ptr[1], &t_diff_n_ptr[2]);
726  double *t_inv_n_ptr = &*diffNinvJac.data().begin();
728  t_inv_n_ptr, &t_inv_n_ptr[1], &t_inv_n_ptr[2]);
729 
730  switch (type) {
731 
732  case MBVERTEX: {
733  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
734  t_inv_diff_n(i) = t_diff_n(j) * tInvJac(j, i);
735  ++t_diff_n;
736  ++t_inv_diff_n;
737  }
738  } break;
739  case MBEDGE:
740  case MBTRI:
741  case MBTET: {
742  for (unsigned int gg = 0; gg < nb_gauss_pts; ++gg) {
743  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
744  t_inv_diff_n(i) = t_diff_n(j) * tInvJac(j, i);
745  ++t_diff_n;
746  ++t_inv_diff_n;
747  }
748  }
749 
750  } break;
751  default:
752  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
753  }
754 
755  data.getDiffN(base).data().swap(diffNinvJac.data());
756  }
757 
759 }
MatrixDouble diffNinvJac
FTensor::Tensor2< double *, 3, 3 > tInvJac
user implemented approximation base
Definition: definitions.h:151
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
FTensor::Index< 'j', 3 > j
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
FieldApproximationBase
approximation base
Definition: definitions.h:140
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
FTensor::Index< 'i', 3 > i

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetInvJacH1::diffNinvJac

Definition at line 275 of file DataOperators.hpp.

◆ i

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

Definition at line 264 of file DataOperators.hpp.

◆ j

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

Definition at line 265 of file DataOperators.hpp.

◆ tInvJac

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

Definition at line 263 of file DataOperators.hpp.


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