v0.13.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, 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 doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
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
 
MatrixDouble diffNinvJac
 
- 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

Transform local reference derivatives of shape function to global derivatives.

Definition at line 131 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetInvJacH1()

MoFEM::OpSetInvJacH1::OpSetInvJacH1 ( MatrixDouble3by3 inv_jac)

Definition at line 137 of file DataOperators.hpp.

138 : tInvJac(&inv_jac(0, 0), &inv_jac(0, 1), &inv_jac(0, 2), &inv_jac(1, 0),
139 &inv_jac(1, 1), &inv_jac(1, 2), &inv_jac(2, 0), &inv_jac(2, 1),
140 &inv_jac(2, 2)) {}
FTensor::Tensor2< double *, 3, 3 > tInvJac

Member Function Documentation

◆ doWork()

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

170 {
172
173 auto transform_base = [&](MatrixDouble &diff_n) {
175
176 if (diff_n.data().size()) {
177 const int nb_base_functions = diff_n.size2() / 3;
178 const int nb_gauss_pts = diff_n.size1();
179 diffNinvJac.resize(diff_n.size1(), diff_n.size2(), false);
180
181 double *t_diff_n_ptr = &*diff_n.data().begin();
183 t_diff_n_ptr, &t_diff_n_ptr[1], &t_diff_n_ptr[2]);
184 double *t_inv_n_ptr = &*diffNinvJac.data().begin();
186 t_inv_n_ptr, &t_inv_n_ptr[1], &t_inv_n_ptr[2]);
187
188 for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
189 for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
190 t_inv_diff_n(i) = t_diff_n(j) * tInvJac(j, i);
191 ++t_diff_n;
192 ++t_inv_diff_n;
193 }
194 }
195 diff_n.swap(diffNinvJac);
196 }
197
199 };
200
201 for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
202 const auto base = static_cast<FieldApproximationBase>(b);
203 CHKERR transform_base(data.getDiffN(base));
204 }
205
206 switch (type) {
207 case MBVERTEX:
208 for (auto &m : data.getBBDiffNMap())
209 if (m.second)
210 CHKERR transform_base(*(m.second));
211 break;
212 default:
213 for (auto &ptr : data.getBBDiffNByOrderArray())
214 if (ptr)
215 CHKERR transform_base(*ptr);
216 }
217
219}
FieldApproximationBase
approximation base
Definition: definitions.h:58
@ LASTBASE
Definition: definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
FTensor::Index< 'm', SPACE_DIM > m
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
FTensor::Index< 'j', 3 > j
MatrixDouble diffNinvJac
FTensor::Index< 'i', 3 > i

Member Data Documentation

◆ diffNinvJac

MatrixDouble MoFEM::OpSetInvJacH1::diffNinvJac

Definition at line 142 of file DataOperators.hpp.

◆ i

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

Definition at line 134 of file DataOperators.hpp.

◆ j

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

Definition at line 135 of file DataOperators.hpp.

◆ tInvJac

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

Definition at line 133 of file DataOperators.hpp.


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