v0.8.13
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, 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
 
FTensor::Index< 'k', 3 > k
 
MatrixDouble diffHdivInvJac
 
- 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

brief Transform local reference derivatives of shape function to global derivatives

Definition at line 287 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetInvJacHdivAndHcurl()

MoFEM::OpSetInvJacHdivAndHcurl::OpSetInvJacHdivAndHcurl ( MatrixDouble3by3 inv_jac)

Definition at line 294 of file DataOperators.hpp.

294  :
295  tInvJac(
296  &inv_jac(0,0),&inv_jac(0,1),&inv_jac(0,2),
297  &inv_jac(1,0),&inv_jac(1,1),&inv_jac(1,2),
298  &inv_jac(2,0),&inv_jac(2,1),&inv_jac(2,2)
299  ) {
300  }
FTensor::Tensor2< double *, 3, 3 > tInvJac

Member Function Documentation

◆ doWork()

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

763  {
765 
766  if (type != MBEDGE && type != MBTRI && type != MBTET)
768 
769  if ((int)HDIV0_1 != (int)HCURL0_1 || (int)HDIV0_2 != (int)HCURL0_2 ||
770  (int)HDIV1_0 != (int)HCURL1_0 || (int)HDIV1_2 != (int)HCURL1_2 ||
771  (int)HDIV2_0 != (int)HCURL2_0 || (int)HDIV2_1 != (int)HCURL2_1) {
772  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
773  "Data inconsistency between Hcurl and Hdiv structure of base "
774  "functions");
775  }
776 
777  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
778 
779  FieldApproximationBase base = ApproximationBaseArray[b];
780 
781  const unsigned int nb_gauss_pts = data.getDiffHdivN(base).size1();
782  const unsigned int nb_base_functions = data.getDiffHdivN(base).size2() / 9;
783  if (!nb_base_functions)
784  continue;
785 
786  diffHdivInvJac.resize(nb_gauss_pts, data.getDiffHdivN(base).size2(), false);
787 
788  auto t_diff_n = data.getFTensor2DiffHdivN<3, 3>(base);
789  double *t_inv_diff_n_ptr = &*diffHdivInvJac.data().begin();
791  t_inv_diff_n_ptr, &t_inv_diff_n_ptr[HDIV0_1],
792  &t_inv_diff_n_ptr[HDIV0_2], &t_inv_diff_n_ptr[HDIV1_0],
793  &t_inv_diff_n_ptr[HDIV1_1], &t_inv_diff_n_ptr[HDIV1_2],
794  &t_inv_diff_n_ptr[HDIV2_0], &t_inv_diff_n_ptr[HDIV2_1],
795  &t_inv_diff_n_ptr[HDIV2_2], 9);
796 
797  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
798  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
799  t_inv_diff_n(k, i) = t_diff_n(k, j) * tInvJac(j, i);
800  ++t_diff_n;
801  ++t_inv_diff_n;
802  }
803  }
804 
805  data.getDiffHdivN(base).data().swap(diffHdivInvJac.data());
806  }
807 
809 }
FTensor::Index< 'j', 3 > j
user implemented approximation base
Definition: definitions.h:151
FTensor::Tensor2< double *, 3, 3 > tInvJac
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
FTensor::Index< 'k', 3 > k
FTensor::Index< 'i', 3 > i
FieldApproximationBase
approximation base
Definition: definitions.h:140
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439

Member Data Documentation

◆ diffHdivInvJac

MatrixDouble MoFEM::OpSetInvJacHdivAndHcurl::diffHdivInvJac

Definition at line 302 of file DataOperators.hpp.

◆ i

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

Definition at line 290 of file DataOperators.hpp.

◆ j

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

Definition at line 291 of file DataOperators.hpp.

◆ k

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

Definition at line 292 of file DataOperators.hpp.

◆ tInvJac

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

Definition at line 289 of file DataOperators.hpp.


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