v0.14.0
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetInvJacHdivAndHcurl Struct Reference

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

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetInvJacHdivAndHcurl (MatrixDouble3by3 &inv_jac)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::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, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &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
 
FTensor::Index< 'k', 3 > k
 
MatrixDouble diffHdivInvJac
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
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...
 

Additional Inherited Members

- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 

Detailed Description

brief Transform local reference derivatives of shape function to global derivatives

Definition at line 153 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetInvJacHdivAndHcurl()

MoFEM::OpSetInvJacHdivAndHcurl::OpSetInvJacHdivAndHcurl ( MatrixDouble3by3 inv_jac)
inline

Definition at line 160 of file DataOperators.hpp.

161  : tInvJac(&inv_jac(0, 0), &inv_jac(0, 1), &inv_jac(0, 2), &inv_jac(1, 0),
162  &inv_jac(1, 1), &inv_jac(1, 2), &inv_jac(2, 0), &inv_jac(2, 1),
163  &inv_jac(2, 2)) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetInvJacHdivAndHcurl::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
virtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 222 of file DataOperators.cpp.

223  {
225 
226  if (type == MBVERTEX)
228 
229  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
230 
231  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
232 
233  const unsigned int nb_gauss_pts = data.getDiffN(base).size1();
234  const unsigned int nb_base_functions = data.getDiffN(base).size2() / 9;
235  if (!nb_base_functions)
236  continue;
237 
238  diffHdivInvJac.resize(nb_gauss_pts, data.getDiffN(base).size2(), false);
239 
240  auto t_diff_n = data.getFTensor2DiffN<3, 3>(base);
241  double *inv_diff_n_ptr = &*diffHdivInvJac.data().begin();
243  inv_diff_n_ptr, &inv_diff_n_ptr[HVEC0_1], &inv_diff_n_ptr[HVEC0_2],
244 
245  &inv_diff_n_ptr[HVEC1_0], &inv_diff_n_ptr[HVEC1_1],
246  &inv_diff_n_ptr[HVEC1_2],
247 
248  &inv_diff_n_ptr[HVEC2_0], &inv_diff_n_ptr[HVEC2_1],
249  &inv_diff_n_ptr[HVEC2_2]);
250 
251  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
252  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
253  t_inv_diff_n(k, i) = t_diff_n(k, j) * tInvJac(j, i);
254  ++t_diff_n;
255  ++t_inv_diff_n;
256  }
257  }
258 
259  data.getDiffN(base).swap(diffHdivInvJac);
260  }
261 
263 }

Member Data Documentation

◆ diffHdivInvJac

MatrixDouble MoFEM::OpSetInvJacHdivAndHcurl::diffHdivInvJac

Definition at line 165 of file DataOperators.hpp.

◆ i

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

Definition at line 156 of file DataOperators.hpp.

◆ j

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

Definition at line 157 of file DataOperators.hpp.

◆ k

FTensor::Index<'k', 3> MoFEM::OpSetInvJacHdivAndHcurl::k

Definition at line 158 of file DataOperators.hpp.

◆ tInvJac

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

Definition at line 155 of file DataOperators.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::OpSetInvJacHdivAndHcurl::i
FTensor::Index< 'i', 3 > i
Definition: DataOperators.hpp:156
LASTBASE
@ LASTBASE
Definition: definitions.h:69
HVEC0_2
@ HVEC0_2
Definition: definitions.h:211
HVEC0_1
@ HVEC0_1
Definition: definitions.h:208
HVEC1_1
@ HVEC1_1
Definition: definitions.h:209
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
MoFEM::OpSetInvJacHdivAndHcurl::tInvJac
FTensor::Tensor2< double *, 3, 3 > tInvJac
Definition: DataOperators.hpp:155
HVEC2_1
@ HVEC2_1
Definition: definitions.h:210
MoFEM::OpSetInvJacHdivAndHcurl::k
FTensor::Index< 'k', 3 > k
Definition: DataOperators.hpp:158
HVEC2_2
@ HVEC2_2
Definition: definitions.h:213
HVEC1_2
@ HVEC1_2
Definition: definitions.h:212
convert.type
type
Definition: convert.py:64
MoFEM::OpSetInvJacHdivAndHcurl::diffHdivInvJac
MatrixDouble diffHdivInvJac
Definition: DataOperators.hpp:165
MoFEM::OpSetInvJacHdivAndHcurl::j
FTensor::Index< 'j', 3 > j
Definition: DataOperators.hpp:157
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
HVEC2_0
@ HVEC2_0
Definition: definitions.h:207
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
HVEC1_0
@ HVEC1_0
Definition: definitions.h:206