v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp > Struct Template Reference

#include <users_modules/tutorials/adv-1/src/ContactOps.hpp>

Inheritance diagram for ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >:
[legend]
Collaboration diagram for ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >:
[legend]

Public Member Functions

 OpConstrainBoundaryLhs_dTractionImpl (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr, bool is_axisymmetric=false)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 
 OpConstrainBoundaryLhs_dTractionImpl (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Public Attributes

SurfaceDistanceFunction surfaceDistanceFunction = surface_distance_function
 
GradSurfaceDistanceFunction gradSurfaceDistanceFunction
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
bool isAxisymmetric
 

Detailed Description

template<int DIM, typename AssemblyBoundaryEleOp>
struct ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >

Definition at line 503 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryLhs_dTractionImpl() [1/2]

template<int DIM, typename AssemblyBoundaryEleOp >
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::OpConstrainBoundaryLhs_dTractionImpl ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr,
bool  is_axisymmetric = false 
)

Definition at line 953 of file ContactOps.hpp.

957 : AssemblyBoundaryEleOp(row_field_name, col_field_name,
958 AssemblyBoundaryEleOp::OPROWCOL),
959 commonDataPtr(common_data_ptr), isAxisymmetric(is_axisymmetric) {
960 AssemblyBoundaryEleOp::sYmm = false;
961}
PetscBool is_axisymmetric
Definition: contact.cpp:137
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp

◆ OpConstrainBoundaryLhs_dTractionImpl() [2/2]

template<int DIM, typename AssemblyBoundaryEleOp >
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::OpConstrainBoundaryLhs_dTractionImpl ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 716 of file ContactOps.hpp.

720 : AssemblyBoundaryEleOp(row_field_name, col_field_name,
721 AssemblyBoundaryEleOp::OPROWCOL),
722 commonDataPtr(common_data_ptr) {
723 AssemblyBoundaryEleOp::sYmm = false;
724}

Member Function Documentation

◆ iNtegrate() [1/2]

template<int DIM, typename AssemblyBoundaryEleOp >
MoFEMErrorCode ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)

Definition at line 965 of file ContactOps.hpp.

967 {
969
973
974 const size_t nb_gauss_pts = AssemblyBoundaryEleOp::getGaussPts().size2();
975 auto &locMat = AssemblyBoundaryEleOp::locMat;
976
977 auto t_normal_at_pts = AssemblyBoundaryEleOp::getFTensor1NormalsAtGaussPts();
978 auto t_traction = getFTensor1FromMat<DIM>(commonDataPtr->contactTraction);
979 auto t_coords = AssemblyBoundaryEleOp::getFTensor1CoordsAtGaussPts();
980
981 auto t_w = AssemblyBoundaryEleOp::getFTensor0IntegrationWeight();
982 auto t_row_base = row_data.getFTensor1N<3>();
983 size_t nb_face_functions = row_data.getN().size2() / 3;
984
985 auto m_spatial_coords = get_spatial_coords(
987 getFTensor1FromMat<DIM>(commonDataPtr->contactDisp), nb_gauss_pts);
988 auto m_normals_at_pts = get_normalize_normals(
990
991 auto t_normal = getFTensor1FromMat<3>(m_normals_at_pts);
992
993 auto ts_time = AssemblyBoundaryEleOp::getTStime();
994 auto ts_time_step = AssemblyBoundaryEleOp::getTStimeStep();
995
996 // placeholder to pass boundary block id to python
997 int block_id = 0;
998
999 auto v_sdf =
1000 surfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
1001 m_spatial_coords, m_normals_at_pts, block_id);
1002
1003 auto m_grad_sdf =
1004 gradSurfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
1005 m_spatial_coords, m_normals_at_pts, block_id);
1006
1007 auto t_sdf = getFTensor0FromVec(v_sdf);
1008 auto t_grad_sdf = getFTensor1FromMat<3>(m_grad_sdf);
1009
1010 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
1011
1012 double jacobian = 1.;
1013 if (isAxisymmetric) {
1014 jacobian = 2. * M_PI * t_coords(0);
1015 }
1016 const double alpha = t_w * jacobian * AssemblyBoundaryEleOp::getMeasure();
1017
1018 auto tn = -t_traction(i) * t_grad_sdf(i);
1019 auto c = constrain(t_sdf, tn);
1020
1022 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
1024 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
1025
1027 t_res_dt(i, j) = -cn_contact * t_cQ(i, j);
1028
1029 size_t rr = 0;
1030 for (; rr != AssemblyBoundaryEleOp::nbRows / DIM; ++rr) {
1031
1032 auto t_mat = getFTensor2FromArray<DIM, DIM, DIM>(locMat, DIM * rr);
1033 const double row_base = t_row_base(i) * t_normal(i);
1034
1035 auto t_col_base = col_data.getFTensor1N<3>(gg, 0);
1036 for (size_t cc = 0; cc != AssemblyBoundaryEleOp::nbCols / DIM; ++cc) {
1037 const double col_base = t_col_base(i) * t_normal(i);
1038 const double beta = alpha * row_base * col_base;
1039
1040 t_mat(i, j) -= beta * t_res_dt(i, j);
1041
1042 ++t_col_base;
1043 ++t_mat;
1044 }
1045
1046 ++t_row_base;
1047 }
1048 for (; rr < nb_face_functions; ++rr)
1049 ++t_row_base;
1050
1051 ++t_traction;
1052 ++t_coords;
1053 ++t_w;
1054 ++t_normal;
1055 ++t_sdf;
1056 ++t_grad_sdf;
1057 }
1058
1060}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto get_normalize_normals(FTensor::Tensor1< T1, DIM1 > &&t_normal_at_pts, size_t nb_gauss_pts)
Definition: ContactOps.hpp:422
auto get_spatial_coords(FTensor::Tensor1< T1, DIM1 > &&t_coords, FTensor::Tensor1< T2, DIM2 > &&t_disp, size_t nb_gauss_pts)
Definition: ContactOps.hpp:405
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:572
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
auto getFTensor1CoordsAtGaussPts()
Get coordinates at integration points assuming linear geometry.
int nbRows
number of dofs on rows
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column

◆ iNtegrate() [2/2]

template<int DIM, typename AssemblyBoundaryEleOp >
MoFEMErrorCode ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)

Member Data Documentation

◆ commonDataPtr

template<int DIM, typename AssemblyBoundaryEleOp >
boost::shared_ptr< CommonData > ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::commonDataPtr
private

Definition at line 517 of file ContactOps.hpp.

◆ gradSurfaceDistanceFunction

template<int DIM, typename AssemblyBoundaryEleOp >
GradSurfaceDistanceFunction ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::gradSurfaceDistanceFunction
Initial value:
=
MatrixDouble grad_surface_distance_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_spatial_coords, MatrixDouble &m_normals_at_pts, int block_id)
Definition: ContactOps.hpp:273

Definition at line 513 of file ContactOps.hpp.

◆ isAxisymmetric

template<int DIM, typename AssemblyBoundaryEleOp >
bool ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::isAxisymmetric
private

Definition at line 518 of file ContactOps.hpp.

◆ surfaceDistanceFunction

Definition at line 512 of file ContactOps.hpp.


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