v0.16.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/FormsBrokenSpaceConstraintImpl.hpp"

Inheritance diagram for MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >:
[legend]

Public Types

using OP = OpBrokenTopoBase< OpBase >
 
- Public Types inherited from MoFEM::OpBrokenTopoBase< OpBase >
using OP = OpBase
 

Public Member Functions

 OpTopoDerivativeBrokenSpaceConstrainDFluxImpl (const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< MatrixDouble > lamgrange_ptr, boost::shared_ptr< MatrixDouble > tangent1_ptr, boost::shared_ptr< MatrixDouble > tangent2_ptr, boost::shared_ptr< double > beta_ptr, SmartPetscObj< Vec > assemble_vec, Tag th, boost::shared_ptr< double > dJ_ptr=nullptr, boost::shared_ptr< Range > ents_ptr=nullptr)
 

Private Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data)
 

Private Attributes

boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenSideDataPtr
 
boost::shared_ptr< MatrixDouble > lagrangePtr
 
boost::shared_ptr< double > scalarBetaPtr
 
boost::shared_ptr< double > dJPtr
 

Additional Inherited Members

- Protected Member Functions inherited from MoFEM::OpBrokenTopoBase< OpBase >
 OpBrokenTopoBase (const std::string row_field, boost::shared_ptr< MatrixDouble > tangent1_diff_ptr, boost::shared_ptr< MatrixDouble > tangent2_diff_ptr, SmartPetscObj< Vec > assemble_vec, Tag th, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &row_data)
 
- Protected Attributes inherited from MoFEM::OpBrokenTopoBase< OpBase >
boost::shared_ptr< MatrixDouble > tangent1DiffPtr
 
boost::shared_ptr< MatrixDouble > tangent2DiffPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag thGradTag
 

Detailed Description

template<typename OpBase>
struct MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >

Definition at line 723 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

Definition at line 726 of file FormsBrokenSpaceConstraintImpl.hpp.

Constructor & Destructor Documentation

◆ OpTopoDerivativeBrokenSpaceConstrainDFluxImpl()

template<typename OpBase >
MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl ( const std::string  row_field,
boost::shared_ptr< std::vector< BrokenBaseSideData > >  broken_side_data_ptr,
boost::shared_ptr< MatrixDouble >  lamgrange_ptr,
boost::shared_ptr< MatrixDouble >  tangent1_ptr,
boost::shared_ptr< MatrixDouble >  tangent2_ptr,
boost::shared_ptr< double >  beta_ptr,
SmartPetscObj< Vec >  assemble_vec,
Tag  th,
boost::shared_ptr< double >  dJ_ptr = nullptr,
boost::shared_ptr< Range >  ents_ptr = nullptr 
)
inline

Member Function Documentation

◆ iNtegrate()

Definition at line 751 of file FormsBrokenSpaceConstraintImpl.hpp.

752 {
754
755 // That is used for testing the H(div) contravariant Piola trace P.n dA
756 // invariance with respect to material map variations. The variation of the
757 // normal is cancelled by the variation of bd.getVarFlux()
758
759 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
760 auto get_lagrange_at_pts =
761 MatrixSizeHelper<GetFTensor1FromMatType<3, -1, DL>, DL>::get(
763
764 FTENSOR_INDEX(3, J);
765 FTENSOR_INDEX(3, i);
766 FTENSOR_INDEX(3, j);
767 FTENSOR_INDEX(3, k);
768
769 auto get_ftensor1 = [](MatrixDouble &m) {
771 &m(0, 0), &m(0, 1), &m(0, 2));
772 };
773
774 double triangle_scale = 1.0;
775 if (OP::getFEType() == MBTRI)
776 triangle_scale = 0.5;
777
778 double d_loc_J = 0.0;
779
780 for (auto &bd : *brokenSideDataPtr) {
781 auto sense = bd.getSense();
782
783 if (dJPtr) {
784 auto t_w = this->getFTensor0IntegrationWeight();
785 auto t_t1 = get_ftensor1(*this->tangent1DiffPtr);
786 auto t_t2 = get_ftensor1(*this->tangent2DiffPtr);
787 auto t_lagrange_at_pts = get_lagrange_at_pts();
788 auto t_adjoint_lambda = getFTensor2FromMat<3, 3>(bd.getVarFlux());
789
790 for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
791 FTensor::Tensor1<double, 3> t_tmp_normal;
792 t_tmp_normal(j) = FTensor::levi_civita(i, j, k) * t_t1(k) * t_t2(i);
793 d_loc_J += (sense * triangle_scale * t_w) *
794 (t_lagrange_at_pts(i) *
795 (t_adjoint_lambda(i, J) * t_tmp_normal(J)));
796 ++t_w;
797 ++t_t1;
798 ++t_t2;
799 ++t_lagrange_at_pts;
800 ++t_adjoint_lambda;
801 }
802 }
803 }
804
805 // The H(div) contravariant Piola trace P.n dA is material-map invariant.
806 // The normal variation is cancelled by the variation of bd.getVarFlux().
807 if (dJPtr) {
808 if (scalarBetaPtr)
809 d_loc_J *= *scalarBetaPtr;
810 *dJPtr += d_loc_J;
811 }
812
814}
#define FTENSOR_INDEX(DIM, I)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
FTensor::Index< 'm', 3 > m
int nbIntegrationPts
number of integration points
boost::shared_ptr< MatrixDouble > tangent2DiffPtr
boost::shared_ptr< MatrixDouble > tangent1DiffPtr

Member Data Documentation

◆ brokenSideDataPtr

template<typename OpBase >
boost::shared_ptr<std::vector<BrokenBaseSideData> > MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >::brokenSideDataPtr
private

Definition at line 743 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ dJPtr

template<typename OpBase >
boost::shared_ptr<double> MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >::dJPtr
private

Definition at line 746 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ lagrangePtr

template<typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >::lagrangePtr
private

Definition at line 744 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ scalarBetaPtr

template<typename OpBase >
boost::shared_ptr<double> MoFEM::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >::scalarBetaPtr
private

Definition at line 745 of file FormsBrokenSpaceConstraintImpl.hpp.


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