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

#include <tutorials/adv-1/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< CommonDatacommonDataPtr
 
bool isAxisymmetric
 

Detailed Description

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

Definition at line 494 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 840 of file ContactOps.hpp.

844  AssemblyBoundaryEleOp::OPROW),
845  commonDataPtr(common_data_ptr), isAxisymmetric(is_axisymmetric) {}

Member Function Documentation

◆ iNtegrate()

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

Definition at line 849 of file ContactOps.hpp.

850  {
852 
857 
858  const size_t nb_gauss_pts = AssemblyBoundaryEleOp::getGaussPts().size2();
859 
860  auto &nf = AssemblyBoundaryEleOp::locF;
861 
862  auto t_normal_at_pts = AssemblyBoundaryEleOp::getFTensor1NormalsAtGaussPts();
863 
864  auto t_w = AssemblyBoundaryEleOp::getFTensor0IntegrationWeight();
865  auto t_disp = getFTensor1FromMat<DIM>(commonDataPtr->contactDisp);
866  auto t_traction = getFTensor1FromMat<DIM>(commonDataPtr->contactTraction);
867  auto t_coords = AssemblyBoundaryEleOp::getFTensor1CoordsAtGaussPts();
868 
869  size_t nb_base_functions = data.getN().size2() / 3;
870  auto t_base = data.getFTensor1N<3>();
871 
872  auto m_spatial_coords = get_spatial_coords(
873  BoundaryEleOp::getFTensor1CoordsAtGaussPts(),
874  getFTensor1FromMat<DIM>(commonDataPtr->contactDisp), nb_gauss_pts);
875  auto m_normals_at_pts = get_normalize_normals(
876  BoundaryEleOp::getFTensor1NormalsAtGaussPts(), nb_gauss_pts);
877 
878  auto t_normal = getFTensor1FromMat<3>(m_normals_at_pts);
879 
880  auto ts_time = AssemblyBoundaryEleOp::getTStime();
881  auto ts_time_step = AssemblyBoundaryEleOp::getTStimeStep();
882 
883  // placeholder to pass boundary block id to python
884  int block_id = 0;
885 
886  auto v_sdf =
887  surfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
888  m_spatial_coords, m_normals_at_pts, block_id);
889 
890  auto m_grad_sdf =
891  gradSurfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
892  m_spatial_coords, m_normals_at_pts, block_id);
893 
894  auto t_sdf = getFTensor0FromVec(v_sdf);
895  auto t_grad_sdf = getFTensor1FromMat<3>(m_grad_sdf);
896 
897  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
898 
899  auto t_nf = getFTensor1FromPtr<DIM>(&nf[0]);
900 
901  double jacobian = 1.;
902  if (isAxisymmetric) {
903  jacobian = 2. * M_PI * t_coords(0);
904  }
905  const double alpha = t_w * jacobian * AssemblyBoundaryEleOp::getMeasure();
906 
907  auto tn = -t_traction(i) * t_grad_sdf(i);
908  auto c = constrain(t_sdf, tn);
909 
911  t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
913  t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
914 
916  t_rhs(i) =
917 
918  t_cQ(i, j) * (t_disp(j) - cn_contact * t_traction(j))
919 
920  +
921 
922  t_cP(i, j) * t_disp(j) +
923  c * (t_sdf * t_grad_sdf(i)); // add gap0 displacements
924 
925  size_t bb = 0;
926  for (; bb != AssemblyBoundaryEleOp::nbRows / DIM; ++bb) {
927  const double beta = alpha * (t_base(i) * t_normal(i));
928  t_nf(i) -= beta * t_rhs(i);
929 
930  ++t_nf;
931  ++t_base;
932  }
933  for (; bb < nb_base_functions; ++bb)
934  ++t_base;
935 
936  ++t_disp;
937  ++t_traction;
938  ++t_coords;
939  ++t_w;
940  ++t_normal;
941  ++t_sdf;
942  ++t_grad_sdf;
943  }
944 
946 }

Member Data Documentation

◆ commonDataPtr

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

Definition at line 506 of file ContactOps.hpp.

◆ gradSurfaceDistanceFunction

template<int DIM, typename AssemblyBoundaryEleOp >
GradSurfaceDistanceFunction ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::gradSurfaceDistanceFunction
Initial value:

Definition at line 502 of file ContactOps.hpp.

◆ isAxisymmetric

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

Definition at line 507 of file ContactOps.hpp.

◆ surfaceDistanceFunction

template<int DIM, typename AssemblyBoundaryEleOp >
SurfaceDistanceFunction ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::surfaceDistanceFunction = surface_distance_function

Definition at line 501 of file ContactOps.hpp.


The documentation for this struct was generated from the following file:
ContactOps::get_spatial_coords
auto get_spatial_coords(FTensor::Tensor1< T1, DIM1 > &&t_coords, FTensor::Tensor1< T2, DIM2 > &&t_disp, size_t nb_gauss_pts)
Definition: ContactOps.hpp:414
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: ContactOps.hpp:506
ContactOps::constrain
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:603
is_axisymmetric
PetscBool is_axisymmetric
Definition: contact.cpp:93
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
ContactOps::get_normalize_normals
auto get_normalize_normals(FTensor::Tensor1< T1, DIM1 > &&t_normal_at_pts, size_t nb_gauss_pts)
Definition: ContactOps.hpp:431
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
ContactOps::AssemblyBoundaryEleOp
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: EshelbianContact.hpp:18
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', DIM >
ContactOps::cn_contact
double cn_contact
Definition: contact.cpp:100
ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::isAxisymmetric
bool isAxisymmetric
Definition: ContactOps.hpp:507
FTensor::kronecker_delta
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
Definition: Kronecker_Delta.hpp:81
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::gradSurfaceDistanceFunction
GradSurfaceDistanceFunction gradSurfaceDistanceFunction
Definition: ContactOps.hpp:502
ContactOps::grad_surface_distance_function
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:281
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
ContactOps::OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::surfaceDistanceFunction
SurfaceDistanceFunction surfaceDistanceFunction
Definition: ContactOps.hpp:501
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21