v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpContactTools::OpConstrainBoundaryRhs Struct Reference

#include <users_modules/multifield_plasticity/src/ContactOperators.hpp>

Inheritance diagram for OpContactTools::OpConstrainBoundaryRhs:
[legend]
Collaboration diagram for OpContactTools::OpConstrainBoundaryRhs:
[legend]

Public Member Functions

 OpConstrainBoundaryRhs (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 43 of file ContactOperators.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryRhs()

OpContactTools::OpConstrainBoundaryRhs::OpConstrainBoundaryRhs ( const std::string  field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 125 of file ContactOperators.hpp.

128 commonDataPtr(common_data_ptr) {}
constexpr auto field_name
@ OPROW
operator doWork function is executed on FE rows
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpContactTools::OpConstrainBoundaryRhs::iNtegrate ( EntData data)

Definition at line 130 of file ContactOperators.hpp.

130 {
132
133 const size_t nb_gauss_pts = getGaussPts().size2();
134 const size_t nb_dofs = data.getIndices().size();
135
136 if (nb_dofs) {
137
138 auto t_normal = getFTensor1Normal();
139 const double ls = sqrt(t_normal(i) * t_normal(i));
140 t_normal(i) /= ls;
141
142 auto t_w = getFTensor0IntegrationWeight();
143 auto t_disp = getFTensor1FromMat<3>(*(commonDataPtr->mDispPtr));
144 auto t_traction =
145 getFTensor1FromMat<3>(*(commonDataPtr->contactTractionPtr));
146 auto t_coords = getFTensor1CoordsAtGaussPts();
147
148 size_t nb_base_functions = data.getN().size2() / 3;
149 auto t_base = data.getFTensor1N<3>();
150
151 auto t_contact_normal =
152 getFTensor1FromMat<3>(*(commonDataPtr->contactNormalPtr));
153 auto t_gap = getFTensor0FromVec(*(commonDataPtr->contactGapPtr));
154
155 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
156
157 auto t_nf = getFTensor1FromArray<3, 3>(locF);
158
159 const double alpha = t_w * getMeasure();
160 if (getNormalsAtGaussPts().size1() == nb_gauss_pts) {
161 VectorDouble n = getNormalsAtGaussPts(gg);
162 auto t_n = getFTensor1FromPtr<3>(&*n.data().begin());
163 t_normal(i) = t_n(i) / sqrt(t_n(j) * t_n(j));
164 }
165 Tensor2<double, 3, 3> t_P;
166 t_P(i, j) = t_contact_normal(i) * t_contact_normal(j);
167
168 Tensor2<double, 3, 3> t_Q;
169 t_Q(i, j) = kronecker_delta(i, j) - t_P(i, j);
170
171 const double gap_0 = gap0(t_gap, t_disp, t_contact_normal);
172 Tensor1<double, 3> t_rhs_constrains;
173 t_rhs_constrains(i) =
174 t_contact_normal(i) *
175 constraint(gap_0, t_gap,
176 normal_traction(t_traction, t_contact_normal));
177
178 Tensor1<double, 3> t_rhs_tangent_disp, t_rhs_tangent_traction;
179 t_rhs_tangent_disp(i) = t_Q(i, j) * t_disp(j);
180 t_rhs_tangent_traction(i) = (*cache).cn_cont * t_Q(i, j) * t_traction(j);
181
182 size_t bb = 0;
183 for (; bb != nb_dofs / 3; ++bb) {
184 const double beta = alpha * (t_base(i) * t_normal(i));
185
186 t_nf(i) -= beta * t_rhs_constrains(i);
187 t_nf(i) -= beta * t_rhs_tangent_disp(i);
188 t_nf(i) += beta * t_rhs_tangent_traction(i);
189
190 ++t_nf;
191 ++t_base;
192 }
193 for (; bb < nb_base_functions; ++bb)
194 ++t_base;
195
196 ++t_contact_normal;
197 ++t_gap;
198 ++t_disp;
199 ++t_traction;
200 ++t_coords;
201 ++t_w;
202 }
203
204 }
205
207}
#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< 'n', SPACE_DIM > n
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
double constraint(double g0, double g, double &&t)
double gap0(double g, FTensor::Tensor1< T, 3 > &t_disp, FTensor::Tensor1< T, 3 > &t_normal)
double normal_traction(Tensor1< T1, 3 > &t_traction, Tensor1< T2, 3 > &t_normal)
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpContactTools::OpConstrainBoundaryRhs::commonDataPtr
private

Definition at line 49 of file ContactOperators.hpp.


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