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

Lhs for U dU. More...

#include <users_modules/tutorials/vec-5/src/FreeSurfaceOps.hpp>

Inheritance diagram for FreeSurfaceOps::OpLhsU_dU:
[legend]
Collaboration diagram for FreeSurfaceOps::OpLhsU_dU:
[legend]

Public Member Functions

 OpLhsU_dU (const std::string field_name, boost::shared_ptr< MatrixDouble > u_ptr, boost::shared_ptr< MatrixDouble > grad_u_ptr, boost::shared_ptr< VectorDouble > h_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

boost::shared_ptr< MatrixDouble > uPtr
 
boost::shared_ptr< MatrixDouble > gradUPtr
 
boost::shared_ptr< VectorDouble > hPtr
 

Detailed Description

Lhs for U dU.

Examples
free_surface.cpp.

Definition at line 308 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpLhsU_dU()

FreeSurfaceOps::OpLhsU_dU::OpLhsU_dU ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  u_ptr,
boost::shared_ptr< MatrixDouble >  grad_u_ptr,
boost::shared_ptr< VectorDouble >  h_ptr 
)
inline

Definition at line 310 of file FreeSurfaceOps.hpp.

314 AssemblyDomainEleOp::OPROWCOL),
315 uPtr(u_ptr), gradUPtr(grad_u_ptr), hPtr(h_ptr) {
316 sYmm = false;
317 assembleTranspose = false;
318 }
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
Definition: plastic.cpp:48
constexpr auto field_name
boost::shared_ptr< MatrixDouble > gradUPtr
boost::shared_ptr< MatrixDouble > uPtr
boost::shared_ptr< VectorDouble > hPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode FreeSurfaceOps::OpLhsU_dU::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
inline

Definition at line 320 of file FreeSurfaceOps.hpp.

321 {
323
324 const double vol = getMeasure();
325 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*uPtr);
326 auto t_grad_u = getFTensor2FromMat<U_FIELD_DIM, SPACE_DIM>(*gradUPtr);
327 auto t_h = getFTensor0FromVec(*hPtr);
328 auto t_coords = getFTensor1CoordsAtGaussPts();
329
330 auto t_row_base = row_data.getFTensor0N();
331 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
332
333 auto t_w = getFTensor0IntegrationWeight();
334
335 auto get_mat = [&](const int rr) {
336 return getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(locMat, rr);
337 };
338
339 auto ts_a = getTSa();
341
342 for (int gg = 0; gg != nbIntegrationPts; gg++) {
343
344 const double r = t_coords(0);
345 const double alpha = t_w * vol * cylindrical(r);
346 const double rho = phase_function(t_h, rho_diff, rho_ave);
347 const double mu = phase_function(t_h, mu_diff, mu_ave);
348
349 const double beta0 = alpha * rho;
350 const double beta1 = beta0 * ts_a;
351 auto t_D = get_D(2 * mu);
352
353 int rr = 0;
354 for (; rr != nbRows / U_FIELD_DIM; ++rr) {
355
356 auto t_mat = get_mat(rr * U_FIELD_DIM);
357 auto t_col_base = col_data.getFTensor0N(gg, 0);
358 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
359
361 // I mix up the indices here so that it behaves like a
362 // Dg. That way I don't have to have a separate wrapper
363 // class Christof_Expr, which simplifies things.
364 t_d_stress(l, j, k) = t_D(i, j, k, l) * (alpha * t_row_diff_base(i));
365
366 for (int cc = 0; cc != nbCols / U_FIELD_DIM; ++cc) {
367
368 const double bb = t_row_base * t_col_base;
369
370 t_mat(i, j) += (beta1 * bb) * t_kd(i, j);
371 t_mat(i, j) += (beta0 * bb) * t_grad_u(i, j);
372 t_mat(i, j) +=
373 (beta0 * t_row_base) * t_kd(i, j) * (t_col_diff_base(k) * t_u(k));
374 t_mat(i, j) += t_d_stress(i, j, k) * t_col_diff_base(k);
375
376 // When we move to C++17 add if constexpr()
377 if constexpr (coord_type == CYLINDRICAL) {
378 t_mat(0, 0) += (bb * (alpha / t_coords(0))) * (2 * mu);
379 }
380
381 ++t_mat;
382 ++t_col_base;
383 ++t_col_diff_base;
384 }
385
386 ++t_row_base;
387 ++t_row_diff_base;
388 }
389
390 for (; rr < nbRowBaseFunctions; ++rr) {
391 ++t_row_diff_base;
392 ++t_row_base;
393 }
394
395 ++t_u;
396 ++t_grad_u;
397 ++t_h;
398
399 ++t_coords;
400 ++t_w;
401 }
402
404 }
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ CYLINDRICAL
Definition: definitions.h:117
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
auto cylindrical
constexpr int U_FIELD_DIM
constexpr double rho_ave
constexpr CoordinateTypes coord_type
select coordinate system <CARTESIAN, CYLINDRICAL>;
constexpr double mu_ave
constexpr double mu_diff
constexpr auto t_kd
auto phase_function
constexpr double rho_diff
auto get_D
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const double r
rate factor
double rho
Definition: plastic.cpp:101
constexpr double mu

Member Data Documentation

◆ gradUPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpLhsU_dU::gradUPtr
private

Definition at line 408 of file FreeSurfaceOps.hpp.

◆ hPtr

boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpLhsU_dU::hPtr
private

Definition at line 409 of file FreeSurfaceOps.hpp.

◆ uPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpLhsU_dU::uPtr
private

Definition at line 407 of file FreeSurfaceOps.hpp.


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