797 {
799
800 const auto nb_gauss_pts = BoundaryEleOp::getGaussPts().size2();
806
807 sdf_vec.resize(nb_gauss_pts, false);
808 grad_mat.resize(nb_gauss_pts, DIM, false);
809 hess_mat.resize(nb_gauss_pts, (DIM * (DIM + 1)) / 2, false);
810 constraint_vec.resize(nb_gauss_pts, false);
811
812 auto t_traction = getFTensor1FromMat<DIM>(contactTraction_mat);
813
814 auto t_sdf = getFTensor0FromVec(sdf_vec);
815 auto t_grad_sdf = getFTensor1FromMat<DIM>(grad_mat);
816 auto t_hess_sdf = getFTensor2SymmetricFromMat<DIM>(hess_mat);
817 auto t_constraint = getFTensor0FromVec(constraint_vec);
818
819 auto t_disp = getFTensor1FromMat<DIM>(
commonDataPtr->contactDisp);
822
823 auto ts_time = BoundaryEleOp::getTStime();
824 auto ts_time_step = BoundaryEleOp::getTStimeStep();
825
827 BoundaryEleOp::getFTensor1CoordsAtGaussPts(),
828 getFTensor1FromMat<DIM>(
commonDataPtr->contactDisp), nb_gauss_pts);
830 BoundaryEleOp::getFTensor1NormalsAtGaussPts(), nb_gauss_pts);
831
832
833 int block_id = 0;
834
835 auto v_sdf =
837 m_spatial_coords, m_normals_at_pts, block_id);
838
839 auto m_grad_sdf =
841 m_spatial_coords, m_normals_at_pts, block_id);
842
843 auto m_hess_sdf =
845 m_spatial_coords, m_normals_at_pts, block_id);
846
847 auto t_sdf_v = getFTensor0FromVec(v_sdf);
848 auto t_grad_sdf_v = getFTensor1FromMat<3>(m_grad_sdf);
849 auto t_hess_sdf_v = getFTensor2SymmetricFromMat<3>(m_hess_sdf);
850
851 auto next = [&]() {
852 ++t_sdf;
853 ++t_sdf_v;
854 ++t_grad_sdf;
855 ++t_grad_sdf_v;
856 ++t_hess_sdf;
857 ++t_hess_sdf_v;
858 ++t_disp;
859 ++t_traction;
860 ++t_constraint;
861 };
862
863 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
864
865 auto tn = -t_traction(
i) * t_grad_sdf_v(
i);
867
868 t_sdf = t_sdf_v;
869 t_grad_sdf(
i) = t_grad_sdf_v(
i);
870 t_hess_sdf(
i,
j) = t_hess_sdf_v(
i,
j);
872
873 next();
874 }
875
877}
#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< 'j', 3 > j