v0.15.0
Loading...
Searching...
No Matches
MoFEM::OpSetCovariantPiolaTransformOnEdge Struct Reference

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

#include "src/finite_elements/DataOperators.hpp"

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

Public Member Functions

 OpSetCovariantPiolaTransformOnEdge (const VectorDouble &tangent, const MatrixDouble &tangent_at_pts)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side.
 
- 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.
 
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.
 
void setSymm ()
 set if operator is executed taking in account symmetry
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem
 

Public Attributes

const VectorDoubletAngent
 
const MatrixDoubletangentAtGaussPt
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure.
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity.
 
booldoVertices
 \deprectaed If false skip vertices
 
booldoEdges
 \deprectaed If false skip edges
 
booldoQuads
 \deprectaed
 
booldoTris
 \deprectaed
 
booldoTets
 \deprectaed
 
booldoPrisms
 \deprectaed
 

Additional Inherited Members

- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType
 
using DoWorkRhsHookFunType
 

Detailed Description

transform Hcurl base fluxes from reference element to physical edge

Definition at line 496 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetCovariantPiolaTransformOnEdge()

MoFEM::OpSetCovariantPiolaTransformOnEdge::OpSetCovariantPiolaTransformOnEdge ( const VectorDouble & tangent,
const MatrixDouble & tangent_at_pts )
inline

Definition at line 501 of file DataOperators.hpp.

503 : tAngent(tangent), tangentAtGaussPt(tangent_at_pts) {}

Member Function Documentation

◆ doWork()

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

739 {
741
742 if (type != MBEDGE)
744
745 FTensor::Index<'i', 3> i;
747 &tAngent[0], &tAngent[1], &tAngent[2]);
748 const double l0 = t_m(i) * t_m(i);
749
750 auto get_base_at_pts = [&](auto base) {
752 &data.getN(base)(0, HVEC0), &data.getN(base)(0, HVEC1),
753 &data.getN(base)(0, HVEC2));
754 return t_h_curl;
755 };
756
757 auto get_tangent_at_pts = [&]() {
759 &tangentAtGaussPt(0, 0), &tangentAtGaussPt(0, 1),
760 &tangentAtGaussPt(0, 2));
761 return t_m_at_pts;
762 };
763
764 auto calculate_squared_edge_length = [&]() {
765 std::vector<double> l1;
766 int nb_gauss_pts = tangentAtGaussPt.size1();
767 if (nb_gauss_pts) {
768 l1.resize(nb_gauss_pts);
769 auto t_m_at_pts = get_tangent_at_pts();
770 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
771 l1[gg] = t_m_at_pts(i) * t_m_at_pts(i);
772 ++t_m_at_pts;
773 }
774 }
775 return l1;
776 };
777
778 auto l1 = calculate_squared_edge_length();
779
780 for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
781
782 FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
783 const size_t nb_gauss_pts = data.getN(base).size1();
784 const size_t nb_dofs = data.getN(base).size2() / 3;
785 if (nb_gauss_pts && nb_dofs) {
786 auto t_h_curl = get_base_at_pts(base);
787 int cc = 0;
788 if (tangentAtGaussPt.size1() == nb_gauss_pts) {
789 auto t_m_at_pts = get_tangent_at_pts();
790 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
791 const double l0 = l1[gg];
792 for (int ll = 0; ll != nb_dofs; ll++) {
793 const double val = t_h_curl(0);
794 const double a = val / l0;
795 t_h_curl(i) = t_m_at_pts(i) * a;
796 ++t_h_curl;
797 ++cc;
798 }
799 ++t_m_at_pts;
800 }
801 } else {
802 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
803 for (int ll = 0; ll != nb_dofs; ll++) {
804 const double val = t_h_curl(0);
805 const double a = val / l0;
806 t_h_curl(i) = t_m(i) * a;
807 ++t_h_curl;
808 ++cc;
809 }
810 }
811 }
812
813 if (cc != nb_gauss_pts * nb_dofs)
814 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "Data inconsistency");
815 }
816 }
817
819}
constexpr double a
FieldApproximationBase
approximation base
Definition definitions.h:58
@ LASTBASE
Definition definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
Definition definitions.h:60
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ HVEC0
@ HVEC1
@ HVEC2
@ MOFEM_IMPOSSIBLE_CASE
Definition definitions.h:35
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'i', SPACE_DIM > i

Member Data Documentation

◆ tAngent

const VectorDouble& MoFEM::OpSetCovariantPiolaTransformOnEdge::tAngent

Definition at line 498 of file DataOperators.hpp.

◆ tangentAtGaussPt

const MatrixDouble& MoFEM::OpSetCovariantPiolaTransformOnEdge::tangentAtGaussPt

Definition at line 499 of file DataOperators.hpp.


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