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

#include "src/finite_elements/FormsBrokenSpaceConstraintImpl.hpp"

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

Public Types

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

Public Member Functions

 OpTopoDerivativeBrokenSpaceConstrainDHybridImpl (const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< MatrixDouble > adjoint_hybrid_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< MatrixDoubleadjointHybridPtr
 
boost::shared_ptr< doublescalarBetaPtr
 
boost::shared_ptr< doubledJPtr
 

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< MatrixDoubletangent1DiffPtr
 
boost::shared_ptr< MatrixDoubletangent2DiffPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag thGradTag
 

Detailed Description

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

Definition at line 802 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

Definition at line 805 of file FormsBrokenSpaceConstraintImpl.hpp.

Constructor & Destructor Documentation

◆ OpTopoDerivativeBrokenSpaceConstrainDHybridImpl()

template<typename OpBase >
MoFEM::OpTopoDerivativeBrokenSpaceConstrainDHybridImpl< 3, GAUSS, OpBase >::OpTopoDerivativeBrokenSpaceConstrainDHybridImpl ( const std::string  row_field,
boost::shared_ptr< std::vector< BrokenBaseSideData > >  broken_side_data_ptr,
boost::shared_ptr< MatrixDouble adjoint_hybrid_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 831 of file FormsBrokenSpaceConstraintImpl.hpp.

831 {
833
834 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
835 auto get_adjoint_lambda_at_pts =
836 MatrixSizeHelper<GetFTensor1FromMatType<3, -1, DL>, DL>::get(
838
839 FTENSOR_INDEX(3, i);
840 FTENSOR_INDEX(3, j);
841 FTENSOR_INDEX(3, k);
842 FTENSOR_INDEX(3, J);
843
844 OP::locF.resize(row_data.getIndices().size(), false);
845 OP::locF.clear();
846
847 auto get_ftensor1 = [](MatrixDouble &m) {
849 &m(0, 0), &m(0, 1), &m(0, 2));
850 };
851
852 double d_loc_J = 0;
853
854 double triangle_scale = 1.0;
855 if (OP::getFEType() == MBTRI)
856 triangle_scale = 0.5;
857
858 for (auto &bd : *brokenSideDataPtr) {
859 auto sense = bd.getSense();
860
861 // This is used for testing the H(div) contravariant Piola trace P.n dA invariance
862 // with respect to material map variations. The variation of the normal is
863 // cancelled by the variation of bd.getFlux() in the adjoint lambda at pts
864
865 if (dJPtr) {
866 auto t_w = this->getFTensor0IntegrationWeight();
867 auto t_t1 = get_ftensor1(*this->tangent1DiffPtr);
868 auto t_t2 = get_ftensor1(*this->tangent2DiffPtr);
869 auto t_flux = getFTensor2FromMat<3, 3>(bd.getFlux());
870 auto t_adjoint_lambda_at_pts = get_adjoint_lambda_at_pts();
871 for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
872 FTensor::Tensor1<double, 3> t_tmp_normal;
873 t_tmp_normal(j) = FTensor::levi_civita(i, j, k) * t_t1(k) * t_t2(i);
874 d_loc_J +=
875 (sense * triangle_scale * t_w) *
876 (t_adjoint_lambda_at_pts(i) * (t_flux(i, J) * t_tmp_normal(J)));
877 ++t_w;
878 ++t_t1;
879 ++t_t2;
880 ++t_flux;
881 ++t_adjoint_lambda_at_pts;
882 }
883 }
884 }
885
886 // The L2 hybrid multiplier is not material-map transformed, while the H(div)
887 // contravariant Piola trace P.n dA is invariant.
888 if (dJPtr) {
889 if (scalarBetaPtr)
890 d_loc_J *= *scalarBetaPtr;
891 *dJPtr += d_loc_J;
892 }
893
895}
#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

◆ adjointHybridPtr

template<typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpTopoDerivativeBrokenSpaceConstrainDHybridImpl< 3, GAUSS, OpBase >::adjointHybridPtr
private

Definition at line 823 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ brokenSideDataPtr

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

Definition at line 822 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ dJPtr

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

Definition at line 825 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ scalarBetaPtr

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

Definition at line 824 of file FormsBrokenSpaceConstraintImpl.hpp.


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