v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetCovariantPiolaTransformOnFace Struct Reference

transform Hcurl base fluxes from reference element to physical triangle More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetCovariantPiolaTransformOnFace (const VectorDouble &normal, const MatrixDouble &normals_at_pts, const VectorDouble &tangent0, const MatrixDouble &tangent0_at_pts, const VectorDouble &tangent1, const MatrixDouble &tangent1_at_pts)
 
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

const VectorDoublenOrmal
 
const MatrixDoublenormalsAtGaussPts
 
const VectorDoubletAngent0
 
const MatrixDoubletangent0AtGaussPt
 
const VectorDoubletAngent1
 
const MatrixDoubletangent1AtGaussPt
 
- 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 Hcurl base fluxes from reference element to physical triangle

Deprecated:
It is used in contact elements. Contact elements should be minified to work as face element,

Definition at line 457 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetCovariantPiolaTransformOnFace()

MoFEM::OpSetCovariantPiolaTransformOnFace::OpSetCovariantPiolaTransformOnFace ( const VectorDouble normal,
const MatrixDouble normals_at_pts,
const VectorDouble tangent0,
const MatrixDouble tangent0_at_pts,
const VectorDouble tangent1,
const MatrixDouble tangent1_at_pts 
)
inline

Definition at line 466 of file DataOperators.hpp.

472 : nOrmal(normal), normalsAtGaussPts(normals_at_pts), tAngent0(tangent0),
473 tangent0AtGaussPt(tangent0_at_pts), tAngent1(tangent1),
474 tangent1AtGaussPt(tangent1_at_pts) {}

Member Function Documentation

◆ doWork()

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

586 {
588
589 const auto type_dim = moab::CN::Dimension(type);
590 if (type_dim != 1 && type_dim != 2)
592
596
598 &tAngent0[0], &tAngent1[0], &nOrmal[0],
599
600 &tAngent0[1], &tAngent1[1], &nOrmal[1],
601
602 &tAngent0[2], &tAngent1[2], &nOrmal[2]);
603 double det;
606 CHKERR invertTensor3by3(t_m, det, t_inv_m);
607
608 for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; ++b) {
609
611
612 auto &baseN = data.getN(base);
613 auto &diffBaseN = data.getDiffN(base);
614
615 int nb_dofs = baseN.size2() / 3;
616 int nb_gauss_pts = baseN.size1();
617
618 MatrixDouble piola_n(baseN.size1(), baseN.size2());
619 MatrixDouble diff_piola_n(diffBaseN.size1(), diffBaseN.size2());
620
621 if (nb_dofs > 0 && nb_gauss_pts > 0) {
622
624 &baseN(0, HVEC0), &baseN(0, HVEC1), &baseN(0, HVEC2));
626 &diffBaseN(0, HVEC0_0), &diffBaseN(0, HVEC0_1),
627 &diffBaseN(0, HVEC1_0), &diffBaseN(0, HVEC1_1),
628 &diffBaseN(0, HVEC2_0), &diffBaseN(0, HVEC2_1));
629 FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3> t_transformed_h_curl(
630 &piola_n(0, HVEC0), &piola_n(0, HVEC1), &piola_n(0, HVEC2));
632 t_transformed_diff_h_curl(
633 &diff_piola_n(0, HVEC0_0), &diff_piola_n(0, HVEC0_1),
634 &diff_piola_n(0, HVEC1_0), &diff_piola_n(0, HVEC1_1),
635 &diff_piola_n(0, HVEC2_0), &diff_piola_n(0, HVEC2_1));
636
637 int cc = 0;
638 if (normalsAtGaussPts.size1() == (unsigned int)nb_gauss_pts) {
639 // HO geometry is set, so jacobian is different at each gauss point
645 &normalsAtGaussPts(0, 2));
646 for (int gg = 0; gg < nb_gauss_pts; ++gg) {
647 CHKERR determinantTensor3by3(t_m_at_pts, det);
648 CHKERR invertTensor3by3(t_m_at_pts, det, t_inv_m);
649 for (int ll = 0; ll != nb_dofs; ll++) {
650 t_transformed_h_curl(i) = t_inv_m(j, i) * t_h_curl(j);
651 t_transformed_diff_h_curl(i, k) =
652 t_inv_m(j, i) * t_diff_h_curl(j, k);
653 ++t_h_curl;
654 ++t_transformed_h_curl;
655 ++t_diff_h_curl;
656 ++t_transformed_diff_h_curl;
657 ++cc;
658 }
659 ++t_m_at_pts;
660 }
661 } else {
662 for (int gg = 0; gg < nb_gauss_pts; ++gg) {
663 for (int ll = 0; ll != nb_dofs; ll++) {
664 t_transformed_h_curl(i) = t_inv_m(j, i) * t_h_curl(j);
665 t_transformed_diff_h_curl(i, k) =
666 t_inv_m(j, i) * t_diff_h_curl(j, k);
667 ++t_h_curl;
668 ++t_transformed_h_curl;
669 ++t_diff_h_curl;
670 ++t_transformed_diff_h_curl;
671 ++cc;
672 }
673 }
674 }
675 if (cc != nb_gauss_pts * nb_dofs)
676 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "Data inconsistency");
677
678 baseN.swap(piola_n);
679 diffBaseN.swap(diff_piola_n);
680 }
681 }
682
684}
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
@ HVEC0
Definition: definitions.h:186
@ HVEC1
Definition: definitions.h:186
@ HVEC2
Definition: definitions.h:186
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
@ HVEC1_1
Definition: definitions.h:196
@ HVEC0_1
Definition: definitions.h:195
@ HVEC1_0
Definition: definitions.h:193
@ HVEC2_1
Definition: definitions.h:197
@ HVEC2_0
Definition: definitions.h:194
@ HVEC0_0
Definition: definitions.h:192
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
Definition: Templates.hpp:1323
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1312

Member Data Documentation

◆ nOrmal

const VectorDouble& MoFEM::OpSetCovariantPiolaTransformOnFace::nOrmal

Definition at line 459 of file DataOperators.hpp.

◆ normalsAtGaussPts

const MatrixDouble& MoFEM::OpSetCovariantPiolaTransformOnFace::normalsAtGaussPts

Definition at line 460 of file DataOperators.hpp.

◆ tAngent0

const VectorDouble& MoFEM::OpSetCovariantPiolaTransformOnFace::tAngent0

Definition at line 461 of file DataOperators.hpp.

◆ tangent0AtGaussPt

const MatrixDouble& MoFEM::OpSetCovariantPiolaTransformOnFace::tangent0AtGaussPt

Definition at line 462 of file DataOperators.hpp.

◆ tAngent1

const VectorDouble& MoFEM::OpSetCovariantPiolaTransformOnFace::tAngent1

Definition at line 463 of file DataOperators.hpp.

◆ tangent1AtGaussPt

const MatrixDouble& MoFEM::OpSetCovariantPiolaTransformOnFace::tangent1AtGaussPt

Definition at line 464 of file DataOperators.hpp.


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