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

#include <users_modules/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)
 
 OpConstrainBoundaryRhsImpl (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
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 466 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryRhsImpl() [1/2]

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 716 of file ContactOps.hpp.

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

◆ OpConstrainBoundaryRhsImpl() [2/2]

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

Definition at line 509 of file ContactOps.hpp.

513 AssemblyBoundaryEleOp::OPROW),
514 commonDataPtr(common_data_ptr) {}

Member Function Documentation

◆ iNtegrate() [1/2]

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

Definition at line 726 of file ContactOps.hpp.

727 {
729
734
735 const size_t nb_gauss_pts = AssemblyBoundaryEleOp::getGaussPts().size2();
736
738
739 auto t_normal_at_pts = AssemblyBoundaryEleOp::getFTensor1NormalsAtGaussPts();
740
741 auto t_w = AssemblyBoundaryEleOp::getFTensor0IntegrationWeight();
742 auto t_disp = getFTensor1FromMat<DIM>(commonDataPtr->contactDisp);
743 auto t_traction = getFTensor1FromMat<DIM>(commonDataPtr->contactTraction);
744 auto t_coords = AssemblyBoundaryEleOp::getFTensor1CoordsAtGaussPts();
745
746 size_t nb_base_functions = data.getN().size2() / 3;
747 auto t_base = data.getFTensor1N<3>();
748
749 auto m_spatial_coords = get_spatial_coords(
751 getFTensor1FromMat<DIM>(commonDataPtr->contactDisp), nb_gauss_pts);
752 auto m_normals_at_pts = get_normalize_normals(
754
755 auto t_normal = getFTensor1FromMat<3>(m_normals_at_pts);
756
757 auto ts_time = AssemblyBoundaryEleOp::getTStime();
758 auto ts_time_step = AssemblyBoundaryEleOp::getTStimeStep();
759
760 // placeholder to pass boundary block id to python
761 int block_id = 0;
762
763 auto v_sdf =
764 surfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
765 m_spatial_coords, m_normals_at_pts, block_id);
766
767 auto m_grad_sdf =
768 gradSurfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
769 m_spatial_coords, m_normals_at_pts, block_id);
770
771 auto t_sdf = getFTensor0FromVec(v_sdf);
772 auto t_grad_sdf = getFTensor1FromMat<3>(m_grad_sdf);
773
774 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
775
776 auto t_nf = getFTensor1FromPtr<DIM>(&nf[0]);
777
778 double jacobian = 1.;
779 if (isAxisymmetric) {
780 jacobian = 2. * M_PI * t_coords(0);
781 }
782 const double alpha = t_w * jacobian * AssemblyBoundaryEleOp::getMeasure();
783
784 auto tn = -t_traction(i) * t_grad_sdf(i);
785 auto c = constrain(t_sdf, tn);
786
788 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
790 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
791
793 t_rhs(i) =
794
795 t_cQ(i, j) * (t_disp(j) - cn_contact * t_traction(j))
796
797 +
798
799 t_cP(i, j) * t_disp(j) +
800 c * (t_sdf * t_grad_sdf(i)); // add gap0 displacements
801
802 size_t bb = 0;
803 for (; bb != AssemblyBoundaryEleOp::nbRows / DIM; ++bb) {
804 const double beta = alpha * (t_base(i) * t_normal(i));
805 t_nf(i) -= beta * t_rhs(i);
806
807 ++t_nf;
808 ++t_base;
809 }
810 for (; bb < nb_base_functions; ++bb)
811 ++t_base;
812
813 ++t_disp;
814 ++t_traction;
815 ++t_coords;
816 ++t_w;
817 ++t_normal;
818 ++t_sdf;
819 ++t_grad_sdf;
820 }
821
823}
#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< '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)
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.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows

◆ iNtegrate() [2/2]

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

Member Data Documentation

◆ commonDataPtr

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

Definition at line 478 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: ContactOps.hpp:273

Definition at line 474 of file ContactOps.hpp.

◆ isAxisymmetric

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

Definition at line 479 of file ContactOps.hpp.

◆ surfaceDistanceFunction

Definition at line 473 of file ContactOps.hpp.


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