v0.16.0
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< MatrixDoublelagrangePtr
 
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::OpTopoDerivativeBrokenSpaceConstrainDFluxImpl< 3, GAUSS, OpBase >

Definition at line 706 of file FormsBrokenSpaceConstraintImpl.hpp.

Member Typedef Documentation

◆ OP

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

735 {
737
738 // That is used for testing the H(div) contravariant Piola trace P.n dA
739 // invariance with respect to material map variations. The variation of the
740 // normal is cancelled by the variation of bd.getVarFlux()
741
742 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
743 auto get_lagrange_at_pts =
744 MatrixSizeHelper<GetFTensor1FromMatType<3, -1, DL>, DL>::get(
746
747 FTENSOR_INDEX(3, J);
748 FTENSOR_INDEX(3, i);
749 FTENSOR_INDEX(3, j);
750 FTENSOR_INDEX(3, k);
751
752 auto get_ftensor1 = [](MatrixDouble &m) {
754 &m(0, 0), &m(0, 1), &m(0, 2));
755 };
756
757 double triangle_scale = 1.0;
758 if (OP::getFEType() == MBTRI)
759 triangle_scale = 0.5;
760
761 double d_loc_J = 0.0;
762
763 for (auto &bd : *brokenSideDataPtr) {
764 auto sense = bd.getSense();
765
766 if (dJPtr) {
767 auto t_w = this->getFTensor0IntegrationWeight();
768 auto t_t1 = get_ftensor1(*this->tangent1DiffPtr);
769 auto t_t2 = get_ftensor1(*this->tangent2DiffPtr);
770 auto t_lagrange_at_pts = get_lagrange_at_pts();
771 auto t_adjoint_lambda = getFTensor2FromMat<3, 3>(bd.getVarFlux());
772
773 for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
774 FTensor::Tensor1<double, 3> t_tmp_normal;
775 t_tmp_normal(j) = FTensor::levi_civita(i, j, k) * t_t1(k) * t_t2(i);
776 d_loc_J += (sense * triangle_scale * t_w) *
777 (t_lagrange_at_pts(i) *
778 (t_adjoint_lambda(i, J) * t_tmp_normal(J)));
779 ++t_w;
780 ++t_t1;
781 ++t_t2;
782 ++t_lagrange_at_pts;
783 ++t_adjoint_lambda;
784 }
785 }
786 }
787
788 // The H(div) contravariant Piola trace P.n dA is material-map invariant.
789 // The normal variation is cancelled by the variation of bd.getVarFlux().
790 if (dJPtr) {
791 if (scalarBetaPtr)
792 d_loc_J *= *scalarBetaPtr;
793 *dJPtr += d_loc_J;
794 }
795
797}
#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 726 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ dJPtr

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

Definition at line 729 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ lagrangePtr

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

Definition at line 727 of file FormsBrokenSpaceConstraintImpl.hpp.

◆ scalarBetaPtr

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

Definition at line 728 of file FormsBrokenSpaceConstraintImpl.hpp.


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