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

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

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

Public Member Functions

 OpConstrainBoundaryRhsImpl (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr, bool is_axisymmetric=false)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Public Attributes

SurfaceDistanceFunction surfaceDistanceFunction = surface_distance_function
 
GradSurfaceDistanceFunction gradSurfaceDistanceFunction
 

Private Attributes

boost::shared_ptr< CommonData > commonDataPtr
 
bool isAxisymmetric
 

Detailed Description

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

Definition at line 539 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryRhsImpl()

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

Definition at line 880 of file ContactOps.hpp.

885 AssemblyBoundaryEleOp::OPROW),
886 commonDataPtr(common_data_ptr), isAxisymmetric(is_axisymmetric) {}
PetscBool is_axisymmetric
Definition contact.cpp:91
constexpr auto field_name
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp

Member Function Documentation

◆ iNtegrate()

template<int DIM, typename AssemblyBoundaryEleOp >
MoFEMErrorCode ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::iNtegrate ( EntitiesFieldData::EntData &  data)

Definition at line 890 of file ContactOps.hpp.

891 {
893
894 FTensor::Index<'i', DIM> i;
895 FTensor::Index<'j', DIM> j;
896 FTensor::Index<'k', DIM> k;
897 FTensor::Index<'l', DIM> l;
898
899 const size_t nb_gauss_pts = AssemblyBoundaryEleOp::getGaussPts().size2();
900
902
903 auto t_w = AssemblyBoundaryEleOp::getFTensor0IntegrationWeight();
904 auto t_disp = getFTensor1FromMat<DIM>(commonDataPtr->contactDisp);
905 auto t_traction = getFTensor1FromMat<DIM>(commonDataPtr->contactTraction);
906 auto t_coords = AssemblyBoundaryEleOp::getFTensor1CoordsAtGaussPts();
907
908 size_t nb_base_functions = data.getN().size2() / 3;
909 auto t_base = data.getFTensor1N<3>();
910
911 auto m_spatial_coords = get_spatial_coords(
912 BoundaryEleOp::getFTensor1CoordsAtGaussPts(),
913 getFTensor1FromMat<DIM>(commonDataPtr->contactDisp), nb_gauss_pts);
914 auto m_normals_at_pts = get_normalize_normals(
915 BoundaryEleOp::getFTensor1NormalsAtGaussPts(), nb_gauss_pts);
916
917 auto t_normal = getFTensor1FromMat<3>(m_normals_at_pts);
918
919 auto ts_time = AssemblyBoundaryEleOp::getTStime();
920 auto ts_time_step = AssemblyBoundaryEleOp::getTStimeStep();
921
922 // placeholder to pass boundary block id to python
923 int block_id = 0;
924
925 auto v_sdf =
926 surfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
927 m_spatial_coords, m_normals_at_pts, block_id);
928
929 auto m_grad_sdf =
930 gradSurfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
931 m_spatial_coords, m_normals_at_pts, block_id);
932
933 auto t_sdf = getFTensor0FromVec(v_sdf);
934 auto t_grad_sdf = getFTensor1FromMat<3>(m_grad_sdf);
935
936 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
937
938 auto t_nf = getFTensor1FromPtr<DIM>(&nf[0]);
939
940 double jacobian = 1.;
941 if (isAxisymmetric) {
942 jacobian = 2. * M_PI * t_coords(0);
943 }
944 const double alpha = t_w * jacobian * AssemblyBoundaryEleOp::getMeasure();
945
946 auto tn = -t_traction(i) * t_grad_sdf(i);
947 auto c = constrain(t_sdf, tn);
948
950 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
952 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
953
955 t_rhs(i) =
956
957 t_cQ(i, j) * (t_disp(j) - cn_contact * t_traction(j))
958
959 +
960
961 t_cP(i, j) * t_disp(j) +
962 c * (t_sdf * t_grad_sdf(i)); // add gap0 displacements
963
964 size_t bb = 0;
965 for (; bb != AssemblyBoundaryEleOp::nbRows / DIM; ++bb) {
966 const double beta = alpha * (t_base(i) * t_normal(i));
967 t_nf(i) -= beta * t_rhs(i);
968
969 ++t_nf;
970 ++t_base;
971 }
972 for (; bb < nb_base_functions; ++bb)
973 ++t_base;
974
975 ++t_disp;
976 ++t_traction;
977 ++t_coords;
978 ++t_w;
979 ++t_normal;
980 ++t_sdf;
981 ++t_grad_sdf;
982 }
983
985}
SmartPetscObj< Mat > jacobian
#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
const double c
speed of light (cm/ns)
FTensor::Index< 'l', 3 > l
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)
double cn_contact
Definition contact.cpp:95
auto get_spatial_coords(FTensor::Tensor1< T1, DIM1 > &&t_coords, FTensor::Tensor1< T2, DIM2 > &&t_disp, size_t nb_gauss_pts)
double constrain(double sdf, double tn)
constrain function
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows

Member Data Documentation

◆ commonDataPtr

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

Definition at line 551 of file ContactOps.hpp.

◆ gradSurfaceDistanceFunction

template<int DIM, typename AssemblyBoundaryEleOp >
GradSurfaceDistanceFunction ContactOps::OpConstrainBoundaryRhsImpl< 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 at line 547 of file ContactOps.hpp.

◆ isAxisymmetric

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

Definition at line 552 of file ContactOps.hpp.

◆ surfaceDistanceFunction

Definition at line 546 of file ContactOps.hpp.


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