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 800 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

Definition at line 803 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 829 of file FormsBrokenSpaceConstraintImpl.hpp.

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

◆ brokenSideDataPtr

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

Definition at line 820 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ dJPtr

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

Definition at line 823 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ scalarBetaPtr

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

Definition at line 822 of file FormsBrokenSpaceConstraintImpl.hpp.


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