v0.15.0
Loading...
Searching...
No Matches
ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp > Struct Template Reference

#include "tutorials/adv-1/src/ContactOps.hpp"

Inheritance diagram for ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >:
[legend]
Collaboration diagram for ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >:
[legend]

Public Member Functions

 OpAssembleTotalContactTractionImpl (boost::shared_ptr< CommonData > common_data_ptr, double scale=1, bool is_axisymmetric=false)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
const double scaleTraction
 
bool isAxisymmetric
 

Detailed Description

template<int DIM, typename BoundaryEleOp>
struct ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >

Definition at line 446 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpAssembleTotalContactTractionImpl()

template<int DIM, typename BoundaryEleOp >
ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >::OpAssembleTotalContactTractionImpl ( boost::shared_ptr< CommonData > common_data_ptr,
double scale = 1,
bool is_axisymmetric = false )

Member Function Documentation

◆ doWork()

template<int DIM, typename BoundaryEleOp >
MoFEMErrorCode ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >::doWork ( int side,
EntityType type,
EntData & data )
Examples
ContactOps.hpp.

Definition at line 619 of file ContactOps.hpp.

620 {
622
623 FTensor::Index<'i', DIM> i;
624 FTensor::Tensor1<double, 3> t_sum_t{0., 0., 0.};
625
626 auto t_w = BoundaryEleOp::getFTensor0IntegrationWeight();
627 auto t_traction = getFTensor1FromMat<DIM>(commonDataPtr->contactTraction);
628 auto t_coords = BoundaryEleOp::getFTensor1CoordsAtGaussPts();
629
630 const auto nb_gauss_pts = BoundaryEleOp::getGaussPts().size2();
631 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
632 double jacobian = 1.;
633 if (isAxisymmetric) {
634 jacobian = 2. * M_PI * t_coords(0);
635 }
636 const double alpha = t_w * jacobian * BoundaryEleOp::getMeasure();
637 t_sum_t(i) += alpha * t_traction(i);
638 ++t_w;
639 ++t_traction;
640 ++t_coords;
641 }
642
643 t_sum_t(i) *= scaleTraction;
644
645 constexpr int ind[] = {0, 1, 2};
646 CHKERR VecSetValues(commonDataPtr->totalTraction, 3, ind, &t_sum_t(0),
647 ADD_VALUES);
648
650}
#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()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.

Member Data Documentation

◆ commonDataPtr

template<int DIM, typename BoundaryEleOp >
boost::shared_ptr<CommonData> ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >::commonDataPtr
private

Definition at line 454 of file ContactOps.hpp.

◆ isAxisymmetric

template<int DIM, typename BoundaryEleOp >
bool ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >::isAxisymmetric
private

Definition at line 456 of file ContactOps.hpp.

◆ scaleTraction

template<int DIM, typename BoundaryEleOp >
const double ContactOps::OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >::scaleTraction
private

Definition at line 455 of file ContactOps.hpp.


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